In general, when coding the user controlled Player and the computer controlled enemies, they would have very little in common. Sometimes, however, you can still save some time by finding something common and making sure not to code it twice. In this example, both our Player and the Enemy have…