Star Rats is an asteroids-style space shooter game created with Java FX 8. This code is for demonstration purposes only, if you wish to play the game, download the project directory and open in Netbeans to compile.
Game loop, canvas drawing, for loops, nested if statements, polymorphism, abstract classes, interfaces (serializable, comparable, custom), try/catch/finally blocks, file writing
Star Rats uses Java FX's Timeline to create a simple game loop. All graphics are rendered using a Canvas, so the graphics are redrawn each frame. All of the games objects are kept track of using the Handler class, which calls the update function to update the position and state of every game object during each iteration of the game loop. Users are able to save and load the game, a feature made possible with the use of serialization.