I attempted to add a shooting feature where the player presses the
M key to fire bullets upward. Originally, I tried making the space bar
the key to shoot but this has shown to be difficult as it did not
shoot bullets using M or the space bar. I created a new Bullet class
and added code to spaceship.py that should create a bullet agent above
the ship.However, the shooting did not work because Retro was not
detecting the M key the way the code expected. Even though the feature
is not working yet, it is an important mechanic because it would allow
the player to clear asteroids and add a new layer of interaction and
strategy to the game. I was annoyed with the idea that I was not able
to get shooting to work but ultimately I decided to keep it within my
code as a way to show that my previous did work and eventhough
the shooting mechanic did not it is important for me to look back at it
one day. Even if it doesn't work, it was an attempt at an idea.
For the meteor speed mechanic, I updated asteroid.py to give each asteroid a speed value and move only on certain turns depending on that speed.
I also changed the spawner so each new asteroid gets a random speed between 1 and 3. This means some asteroids fall quickly while others fall more
slowly. This addition is important because it creates more variety in the game, makes movement patterns less predictable, and increases the
challenge in a natural way as the player navigates different kinds of threats.
For this feature, I added a health system so the player has three
lives instead of losing instantly. In nav_game.py, I added "health": 3
to the game state, and in spaceship.py I created a take_damage method
that subtracts one life when the ship is hit. If the player's health
reaches zero, the game ends. This change is important because it
makes the game less punishing, gives the player more chances to
recover from mistakes, and makes gameplay feel more balanced and fun.