Use the arrow keys to move a character through an onslaught of projectiles. Try to see how long you can survive! Press space to play again if you get caught.
1) Create a character sprite.
2) Make your character move with the arrow keys.
3) Create an obstacle for your character to dodge. Have this obstacle start at a random point along the border of the screen.
4) Have the obstacle point towards your character when it spawns.
5) Make the obstacle move at a constant speed.
6) Have more obstacles be created every few milliseconds.
7) Create a timer variable that starts at at 0. Every one second, have the timer increase by one. Display the timer to the player.
8) Have the game freeze if the character touches an obstacle, and come up with a way to let the player know the game is over.
9) Make it so that if the game ends, pressing the space key will reset the timer, empty the obstacle list, and unfreeze the game.
Challenge: Can you find a way to prevent your character from being able to move off screen?