Star Wars borrows from a number of films, especially World War II films. The escape from the Deathstar borrows from Howard Hawks’ Air Force, which came out during the war:
While it is immediately obvious, as shown in the side-by-side scenes in the Empire of Dreams documentary, that the movie inspired the gun turret scenes on the Millennium Falcon. What may not be as obvious is that the underlying structure of several sequences are quite similar to scenes from Star Wars. One scene in Air Force has the crew of the Mary Ann, as the B-17 is called, scrambling to get onboard and take off as japanese soldiers appear in force from a tree line, much in the same way that the Falcon blasts its way out of Mos Eisley with stormtroopers hot on its heels. And though the order is different, it’s hard not to draw direct parallels between the attack on Pearl Harbor and the destruction of Alderaan, both of which happen as the respective flights are on their way to it as a destination, catching their crews by utter surprise.
As the B-17 arrives in the Philippines, the crew chief learns that his son died just as the the first attack began, but has no time to grieve as another Japanese attack forces the Mary Ann into the air, where the crew man the gun turrets in almost identical fashion to the scenes following the death of Obi-Wan on the Deathstar, complete with the donning of headsets and a “Here they come!” opening from the cockpit as the zeroes dive into the B-17. The hexagonal designs of the Falcon gun ports and cockpit, including the exact framing and angles they’re shot at are straight out of Air Force.
Unfortunately, while the Falcon survives, the Mary Ann makes a belly landing, and the similarities come to an abrupt end. That said, there are other similarities throughout, including many echoing smaller scenes in The Empire Strikes Back (huddles of pilots and mechanics scurrying around, working on the planes), but most fascinating is the fact that the way Hawks used the same aircraft throughout the film, having it serve almost as a character in its own right, complete with a name, also informed Lucas in the way he used the Millennium Falcon; not merely in terms of it providing the stage for the same kinds of scenes, but in it providing a character of its own throughout the trilogy.