Day 3: donuts!!!
Today, I added the main scoring mechanism of the game, donuts. (because cops eat donuts, hahaha so funny)
First, I drew a sprite using the free pixel art app Piskel. This is what it looks like:
I used the same generation algorithm as the walls and enemies to randomly place donuts around the map, based on the player's level.
I made the score increment when the player touches a donut, and killed donuts when an enemy bullet hits one.
After that, I created an introduction screen and a game over screen. This was where I reached a little issue with the arcade library, it would segfault whenever I tried to draw text. To fix this, I copied the draw_text function from the arcade library, and implemented a fix.
Here's the opening screen:
and the game over screen:
On the opening screen, I created a little function to display a helpful tip that will help the player when playing the game.
'Till Tomorrow!