Unicorn Dodge
I made this game because I really like unicorns and wanted to explore how to make a player bounce and move around objects. So, I made this game where the player can use the w, a, s, d keys to move the unicorn over the objects and when they hit a starship it takes them to the sky stage. On this screen the same keys are used to get around the objects and to collect the starships.
I was mainly inspired by the T-Rex Dinosaur game, but I was also inspired by the Mario game to add in an object that makes something new happen, such as the sky stage.
States shown:
Ground state - where the unicorn waits to jump the obstacles and has to avoid being hit as the obstacles speed up.
Sky state - where to unicorn has to move around to avoid obstacles and collect starships to change and speed up the obstacles.
Hit state - when the unicorn gets hit by an obstacle, the hit screen shows up and the player can restart the game.
Steps:
First, I created two squares that came across the screen and then a square as a player that would jump over the other squares. I did this by creating an object and a player class.
Then, I added the timer class and animation class. With these I was able to get the timer that is shown at the top and was able to add in the unicorn, cloud, and balloon animations and pictures. Then I used the millis() function to speed up the objects as time went on and as more starships were collected.
Video: