Projects‎ > ‎Software Projects‎ > ‎

Java 2D Graphics - Multiplayer PacMan [Java]


The goal was to write a window program with 2D graphics in Java. Therefore I chose to program a multiplayer game based on the classic arcade game PacMan


I started with drawing some 2D graphics. My idea was to generate a dynamic level based on a grid. Each cell of the grid represents a cell in the game and has specified attributes. The attributes describe the type of the cell (the picture, which is shown) and the behavior (is it a collectible coin, a barrier etc.).

Figure 1: Filed pictures

The game field is a 2-dimensional array of field cells. The array is overlapped with the corresponding picture.

Figure 2: Overlapping

If a movement key is pressed, the destination cell is checked for its attributes. The attributes defines the action, which will be performed. 
A free cell leads to a movement, a coin cell to a movement and increment of the score, a barrier to no action and a monster to the temporally death of the player.

I added some free 8-bit music from the internet to the background and to some actions in the game (collect coins, death). Unfortunately I couldn't achieve 


The yellow player uses WASD as control keys and the red player the arrow keys for moving. The goal is to collect the coins. The scores are displayed on top of the screen.
If one player is hit by a monster, the player is moved to a restricted area for five seconds. The monster movement is random.
Use the 'm' key to turn on/off the background music.

Figure 3: Game screen


The gadget spec URL could not be found


Alexander Wegner,
13 Mar 2012, 07:22
Alexander Wegner,
13 Mar 2012, 07:21