The latest JavaFX article of writing the Pac-Man game is published on May 28. It is the third out of a five-article series: “Writing the Pac-Man Game in JavaFX - Part 3“.
In this article, the ghosts are introduced. The animation of the ghosts are almost the same as the Pac-Man character. It is basically [...] [...more]
In this article, the ghosts are introduced. The animation of the ghosts are almost the same as the Pac-Man character. It is basically moving a CustomNode and switching the images. There are three sets of images for the animation: normal, hollow and flashing. The moving algorithm of the ghosts is the heart of the code. In this article, for simplicity, a random moving algorithm is applied. A more complicated moving behavior of the ghosts will be introduced in Article 5. Click on the below image to try the program so far. The Pac-man and ghosts cannot eat each other even they meet in the maze. The feature of eating each other will be illustrated in next article. As before, you can try this semi-completed program by clicking Java Web Start button below:
UPDATE: June 30, 2009
If you are interested in how to write the Pac-Man game in JavaFX, the source code of this game, please check out this article:
How to Write the Pac-Man Game with JavaFX
or Articles on Writing the JavaFX Pac-Man Game
I spent some time to implement the classic game “PAC MAN”. It demos many [...] [...more]
UPDATE: June 30, 2009
If you are interested in how to write the Pac-Man game in JavaFX, the source code of this game, please check out this article:
I spent some time to implement the classic game “PAC MAN”. It demos many features of the JavaFX language. Right now, it is a “simplified” PACMAN Game. I am working on the code and hopefully to complete the PACMAN game soon. Source code is not released yet because I plan to do so when I finish the whole game. A blog of writing this game will be available soon. Stay tuned.
Usage:
Arrow keys to move and control to pac-man to eat all dots inside the maze. The big dots are magic dots which allow the pac-man to eat ghosts.
JavaFX Features Demostrated:
Bindings
Animations
Effects
Transforms
Multiple inheritant
Java classes integration
Declarative statements
Sequences, how to map 2D arrays into a 1D Sequence
Handling keyboard events
JRE 1.5+ required, JRE1.6 U10 is better, it will take some time for first time launching the game …