![]() |
During the weekend, JavaFX expert Jim Weaver had laid a challenge on me to create a WidgetFX widget of the Pac-Man Game, a JavaFX demo game that I introduced in insiderRIA.com. The author of WidgetFX, Stephen Chin even offered to show it in JavaOne if I can finished in time(before June 2-3). With about one week to go, I think it is interesting and fun to give it a try. I will keep track of my progress in this post. I have installed the WidgetFX package before, but to get a clean start, I re-downloaded the source code from Widgetfx.org. Here is my progress: (updated continuously)
May 25: |
May 26:
Steve provided some useful hints on how to deal with the resizing of the widget. It looks like the WidgetFX API is quite intelligent on resizing the window. What I need to do is to define default width/height and aspectRatio and everything else will be taken care of. I modified my original Pac-Man code to allow the game to be paused. Now the game is fully working as a widget. When it is docked, the game will be automatically paused. When it is undocked, it zooms to its original size and the player can press ‘P’ button to continue playing. Click on the below button to see how the Pac-Man widget looks like:
Pac-Man Widget (JavaFX 1.1)
or try widget for WidgetFX 1.2 version
Pac-Man Widget 1.2
Some issues remains: the game is kind of slow on my laptop(single core, 1.6Ghz Intel, WinXP). I am checking with Steve to see if he has any suggestions.

pretty cool, although it is very small in the sidebar. I can barely see the dots. This way it is not that fun
but anyway, great implementation!
if you planning on doing games only maybe you should have a look at http://www.interactivemesh.org/ (3D + javafx)
Although I’m still waiting for the next release of javafx where native 3D support could be expected. Do you know anything about that? (is it possible sometimes soon?)
Comment by dev567 — May 30, 2009 @ 1:06 pm
Hi, I saw your interesting blog, I just want to report you my JavaFX clone of Crayon Physics game.. I’m still working on it but it’s quite playable right now
http://theorymatters.wordpress.com/2009/05/28/javafx-crayon-physics/
regards,
Claudio
Comment by Claudio — May 30, 2009 @ 1:30 pm
[...] Articles: Pac-Man Game WidgetFX Widget JavaFX Game Example Code: MineSweeper JavaFX Game Demo Example: [...]
Pingback by Writing the JavaFX Pac-Man Game Part 3 — May 31, 2009 @ 3:42 am
[...] Games in JavaFX Source of the Pac-Man Game JavaFX Demo Game: MineSweeper JavaFX Demo Game: LinkUP Game Widgets for WidgetFX: Pac-Man My JavaFX Demo Game: [...]
Pingback by Writing the Pac-Man Game Part 4 — June 6, 2009 @ 7:21 am
[...] before the JavaOne 2009, Jim Weaver asked me to write a widget for my JavaFX Pac-man game. The WidgetFX API was quite simple to use, so I finished it pretty soon. The game widget later got [...]
Pingback by Pac-Man Widget for JavaFX 1.2 — June 19, 2009 @ 12:38 am