Step 5

Coding the player/enemy collision


Lastly we need to program how our sprites interact with each other.

Complete the code as shown, this will make our player lose a life when they hit an enemy. It will also make the enemy disappear.

Coding the projectile/enemy collision


Next, complete the code as shown. This will destroy an enemy when a projectile hits it. It will also add to our score.

Play/test the game!


Congrats! The game is now complete! Test it out and make sure it there aren’t any bugs with any of your code. Think of some ways you can further customize and add on to this game.