Challenges and Bugs
It is common for programs to have bugs. I've deliberately left a few bugs in our ninja runner game. Have you spotted any? Try fixing them!
Bug Fix 1. Game Over Score
Play the game, let your ninja touch a cactus, then watch the score carefully after game over... Did you see the score continue to increase? That happens because after game over, we are still adding cactuses to the obstacles
list. Can you fix this?
Bug Fix 2. Multi-Jumps
Try quickly pressing the jump button multiple times. Did your ninja jump out of the screen? Our ninja should only be able to jump when she is on the ground, and not when she is in the air. Can you fix this?
Challenges!
Here are some challenges to make the game better.
Challenge 1. Gliding Ninja
Can you change the ninja image to a gliding ninja whenever she jumps? If you are using a different character, most of them will have a jumping image that you can use.
Challenge 2. Different obstacles
The only obstacle we have now is the cactus. Can you make the program randomly select a different type of obstacle each time?
Challenge 3. Spacing out
In the current game, the obstacles always appear at the same distance away from each other. Can you randomize this, so that sometimes the obstacles will be closer and at other times further apart.