How-To's > How do I build a game?


See the following links for tutorials and examples of how to build JavaFX game applications.

  • Brick Breaker
    This sample contains a single-user game. It incorporates the following important game concepts:
    • Controlling an onscreen object with user input
    • Displaying onscreen events by using animation
    • Keeping track of scores and lives
    In this game users control an onscreen bat by using a keyboard or mouse. The bat is used to propel a ball to break a wall of bricks. The more bricks you break, the higher your score. Players are assigned a a number of lives. Every time the bat misses hitting the ball, the player loses a life.
  • Pac-Man New window
    This multipart tutorial, written for JavaFX 1.2, walks you though building this popular game as a JavaFX application. In the first part, you create the data model for the maze, which controls drawing the maze. In the second part, you create the Pac-Man character and the following actions that it can execute:
    • Open and close its mouth
    • Walk the maze
    • Change its location based on user input
    • Gobble dots
    In the final part of the tutorial, you create the ghost characters.
  • WishtreeNew window
    This game prototype, written for JavaFX 1.2, is a multiuser application that includes the following components of game applications:
    • A JavaFX rich client for user interaction
    • A server handling communication among multiple clients
    • A database for data persistence

Last Updated: April 2010
[Return to How-To's Home]