Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Use thePygamelibrary Use the AlienInvasion code from the book as a starting point and change it to add the project requirements. Enemies are generated at
- Use thePygamelibrary
- Use the AlienInvasion code from the book as a starting point and change it to add the project requirements.
- Enemies are generated at a random X position and then move downward on the screen.
- You can use the Pythonrandint() methodLinks to an external site.to determine the starting position.
- Enemies are generated at random times. Import theprovided module "alien_timer_functions.py"Download provided module "alien_timer_functions.py"to determine when to make new enemy.
- Enemies should move from Top-to-Bottom until they disappear off-screen or are destroyed.
- Enemies do not move back and forth (left and right) as they did in the original game from the book.
- Objects (bullets, aliens) should be removed after they fly off-screen; like the way that the bullets are removed in the Alien Invasion game. Try adding a line of code to tell you how many aliens still exist in your game: e.g. print(len(self.aliens))
- May add your own graphics and/or sounds --https://opengameart.org/Links to an external site. Or just use the graphics from the Alien Invasion gameOr just use the graphics from the Alien Invasion game
- Graphics can be as simple as they were in the Alien Invaders game
- Software design should classes separated into multiple modules and imported into the main
- program file (The code should not be in a single file).
- Using modules for classes (such as player, health_bar, enemy, advanced_enemy, bullets, settings, etc...If you didn't do very well with the Alien Invasion game coding before, here's a copy of the game as it should be at the end of Chapter 14. you can download it and use it as a starting point for the project.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started