Tagged Entries

Entries matching: game
In previous articles, we finished writing most of the code of the Pac-Man game. In article 3, we implemented a simple algorithm for the ghosts to catch the Pac-Man. The ghosts randomly decides in which direction they move. They do not chase the Pac-Man even they are very close to him. This makes the game less challenging. In fact, the behavior of the ghosts are the most tricky part of the game. According to Iwatani, the author of the original arcade game, he had designed each ghost with its own distinct personality in order to keep the game from becoming too difficult or boring to play. ( More info) However, there is generally no conclusion on what behavior of the ghosts are good for the players.

In the last article, we developed a preliminary version of the Pac-Man game. Four ghosts are randomly roaming the maze and a Pac-Man character can be controlled by a player. Now, we write some more code for the interaction between ghosts and the Pac-Man:

  1. Pac-Man eats a ghost after he gobbles a magic dot.
  2. A ghost eats the Pac-Man when it touches him.

We are now ready to create the ghosts in our game. The four ghosts, namely Blinky(red), Pinky(pink), Inky(cyan) and Clyde(orange), are trapped inside a cage when a game starts. After some time, they get out of the cage one by one and start roaming the maze. Their goal is to catch the Pac-Man. The Pac-Man dies if he is touched by one of the ghosts. If the Pac-Man swallows a magic dot, he has the power to eat ghosts for a while. During this time, the ghosts turn hollow and move more slowly.
In last article, we designed a data model and drew a maze with dots spread into the maze. Now we are ready to create the Pac-Man character. The Pac-Man character is controlled by the game player to move around the maze. While he is moving, he keeps gobbling dots along the path. To implement the Pac-Man character, we divide the coding into a few tasks so that we can create it bit by bit:
When I was young I was fascinated by arcade games. One of my favorites was the Pac-Man game.  Recently, when I was learning the JavaFX language, I decided to write the game in JavaFX.  Based on my experience in other programming languages, I assumed there would be some amount of work in building a game such as Pac-Man, giving me a good feel for RIA development in JavaFX.

Tag Cloud

iPad

What's your take on the iPad? (Putting aside the Flash/iPad flame war)

Answer

Latest Features

Recommended for You

@InsideRIA on Twitter

Archives

  • Or, visit our complete archive.  

About This Site

Welcome to the premiere community site for all things RIA sponsored by O'Reilly Media and Adobe Systems Incorporated.