Space Invaders, Group Project for Python Class

programming with python
game graphics design

To finish out our Python class, we had to complete a group project. My team consisted of three people. I was the group leader and responsible for graphics. Another team member was the programming lead, and our third person concentrated on our final presentation to the class. We were allowed to start with a tutorial and code we found online. It was a basic game that explained the basics of using the Pygame library to set up a game window, how to use a main game loop, and how to set up basic rows of aliens, the player ship, bullets, and handling collisions. Our goal was to offer the user a choice of enemies, make the aliens on level 1 drop down, and add 2 more levels of gameplay. Level 2 would be harder, and Level 3 would feature a “boss” instead of the traditional columns of enemies.

 

As with most group projects in school, things did not go as planned. Our programmer had big ambitions for Level 3, and spent most of his time programming that. I ended up creating all the art, figuring out how to allow the user to choose which enemies to face, and programming Levels 1 and 2. I also ended up doing the programming to add in my teammate’s Level 3. It’s not pretty code, and I ran out of time to fully implement my menu system into Level 3, but the game does work.

I learned so much by working on this project. I had not really used classes in Python before. I had never used Pygame, and I have never tried to program a game before. Working with the game loop and figuring out how to go between the menu screen, the countdown screen to start off each level, and moving from one level to the next took some trial and error, but we were happy with how our final game worked.

I hope to one day have time to revisit the code and make it cleaner and more efficient. 

The characters for the levels were drawn on an iPad in Procreate. I then brought them into Photoshop to size them as needed for the game and save them as .png files. The buttons were created in Photoshop. I used Photoshop’s AI to create the background images.

Start Screen
Start Screen
Level 1 - Alien Invaders
Level 1 – Alien Invaders
Level 2 - Alien Invaders
Level 2 – Alien Invaders
Level 3 - Alien Invaders
Level 3 – Alien Invaders
Level 1 - Holiday Invaders
Level 1 – Holiday Invaders
Level 2 - Holiday Invaders
Level 2 – Holiday Invaders
Level 3 - Holiday Invaders
Level 3 – Holiday Invaders