Java Game

  1. Instructions to play the game:

Press the start button to start the level. Move the player left or right by using the “A” and “D” keys respectively. To jump, press the “W” key. Shoot the zombies (scary-looking walking characters) by clicking the mouse. For every zombie killed, the zombie count increments. You can pick up stink bombs which would increment your bomb count. If you collide with a red ball, your health decrements. Each level of the game has certain conditions which can be read on the panel on the right side of the game. After fulfilling the level’s conditions, make your way through to the portal which will allow you to go to the next level.

  • Extra feature is timer:

The extra features my game includes are main menu, sound and timer. However, the main feature is the timer. The timer counts the time taken for the player to complete the level. This timer is present on the right side of the game. When the player takes more than 25 seconds to complete the level a different message appears in the panel. The timer restarts after the completion of each level. The timer also pauses when the game is paused.

  • Saving and Loading:

My game allows you to press the “S” key to save the players current position and level in the game. The load button allows you to load the saved player position and level in the game. This means you can save the player’s position at mid-level and load the game to that same position of the level. I’ve also got a score board which saves the players stink bomb count and name when they die, this score board updates with the new values the next time its loaded. Alongside this, I have also implemented a high score saver for the amount of zombies the player kills which writes to the scores.txt document as the player presses the “H” key.

  • Special features:

As mentioned previously, my game also features a main menu, sound effects on certain collisions and of course, the timer present on the panel. When the player dies by either colliding with the zombie, wheel or when their health is 0, a scores panel pops up on the screen which saves the players stink bomb pick up count and name. There are 2 progress bars on the right panel featuring the game completion for example, if the current level is 1, the bar is 1/3 filled etc. The second progress bar contains the player’s health value which is updated by pressing the update button beneath it. Other than the player, there are the zombies which class as walkers. These zombies are killed by the players shots and the zombies can kill the player by colliding with them. There are numerous types of dynamic bodies in my game which act uniquely. For example, there are some “blood” (red balls which decrement health) which acts like rain in level 3 while others don’t. Other examples include the spring which cause the player to jump. The wheels are another example of dynamic bodies which roll and kill the player when collided with them.

  • Javadoc classes:

The classes I have fully documented using Javadoc are Person.java, GameLevel.java and Game.java.

Level 1 to Level 2
Level 2 to Level 3
Level 3 to End

Get in touch for the GitHub repository!