This is an obstacle race kart program that allows the user to reach from the beginning of the race to the end of the race. To finish the race, the user must avoid the bananas to reach the end. The theme of this game is going to be a survival on a land full of stars and with a sky full of star gazes. The piranha plants are added in to make the scene look more interesting.
Here is a screenshot and representation of the game:
If the user hits a banana, the car will spin 360 degree and the game will end. To do that, I included collision detection that detects when the user hits a banana, the car goes spinning. In another scenario, if the user hits the item box, it will send the user flying over the banana.
Collision detection also prevents the user from going off the race course. Here is a screenshot of collision detection preventing the user from going off track:
I also included directional lighting with one side of the image. When I press "Q", directional light will point to the left side. When I press "E", directional light will point to the right side. For the two images above, I press"E" and the light remains on the right side. Here is an example of the plants on the left being lid up with the directional light:
Here is also a screenshot of the item box:
Once the user survives the whole race, it is welcomed by two yoshis waiting at the end line: