Closed STEFANOVIVAS closed 3 years ago
In order to test this I would have to copy all of this code into separate files, fix some indentation, and then try to run it. And it probably wouldn't be the exact same code you're running, because of the indentation issues.
Can you either post your code to a separate GitHub repo and link to it, or email me a zip file of your project? I'm ehmatthes at gmail.
Also, this looks like code from the second edition, but you're in the online resources for the first edition. If it helps in any way, the second edition resources are here: https://ehmatthes.github.io/pcc_2e/regular_index/
Yeah..you are right. I'm in the wrong edition. Anyway..i just found the error..a missing pair of brackets in the alien.check_edges funcition. Rsrsrs Sorry
My code is exactly the same as the book but I can't get the aliens to move laterally, just on the vertical axis.
alien.py
` class Alien(Sprite):
alien_invasion.py
` class AlienInvasion:
if name == 'main': ai = AlienInvasion() ai.run_game() ` settings.py
` class Settings: def init(self):
Screen setings
`