Create a game in java that gives the user a ship that they must navigate to dodge flying saucers. These flying saucers are of random size, speed and color.
All flying saucers (circles) begin at the top and are spaced across the screen. There are seven circles at a time. In the following picture the first two are still hidden behind the life bar for the game player.
Note: we start with three extra lives meaning the user has four lives total. see image.
Everytime a circle reaches the bottom of the page a new circle replaces it back at its top postion. The new circle will probably end up being a different size, speed and color since these attributes are chosen at random. If the user hits a ship he/she looses a life as shown in the following picture: see image.
If the user got hit two more times he/she would be on their last life and no spare lives would show at the top as in the following picture: see image.
When the user is hit for the last time the final ship will go away and a Game Over string should be drawn to the window and the flying saucers should continue to fall. Make sure you code it so that the ghost of your last ship is still not colliding with any of them. The following is a picture when the game is over: see image.
Important instructions:
Mr. Arnold is providing you with an example that listens for keys from the user. You should use this as the foundation for your project. Since you are going to have to redraw the ship in your paint method and since your game will have the focus and not the ship, it is best NOT to use the rectangle class for your ship. Simply draw a rectangle for each ship as it is done in the example provided. Since you will have multiple circles and they are not being interacted with via the keys you should use a modified version of our circle class from earlier in the semester. You will be responsible for the modification of that class.
Have fun with your project!