Fun with fireballs
Includes free State pattern!

Originally posted on November 27, 2012
Updated on January 11, 2015


This was my first ever JavaFX application. Its intended purpose was to:

  • help me learn JavaFX, especially properties and bindings.
  • have fun programming a game with sprites, physics and side-scrolling.
  • apply the State design pattern in a comprehensive example.

The game contains a massive 2-line 'physics engine' to update all the game objects. This update triggers bindings that adjust the positions of all the nodes on screen. Keyboard input is fed into a state machine that models the movements of the playable character, like walking, running, braking or jumping.

This was a really fun project to work on and is ever so popular with students. If you enjoy casual game programming or want to learn more about JavaFX or the State pattern, have a look at the source code!


The source code is available on GitHub.

If you've enjoyed my work or found it helpful, please consider becoming a patron. Your support helps me free up time to work on my books and projects.