Created by: Bhavya Chopra and Sonali Singhal
This is a clone of the strategy video game, Plants vs. Zombies, originally developed by PopCap Games.
A working demo of the game can be seen here.
Made as a part of project in Advanced Programming course at IIIT-Delhi.
Uses Java and JavaFx.
- 5 Levels with increasing difficulties
- 2 Themes (Night Mode and Day Mode)
- Plants Available: Sunflower, Pea Shooter, Cherry Bomb, Walnut, Repeater, Jalapeno
- Zombies Available: Normal Zombie, Conehead Zombie and Buckethead Zombie
- Almanac: Displays details and attack methods and power of each zombie and plant
- Shovel: Tool to shovel plants out of the grid
- Save Game and Restart Game options: User can save multiple game states, and reload them, or delete game progress
- Cool sound effects for all lawn interactions
- Lots of fun :P
- Navigation is via FXML files
- Load Game menu is used to load multiple saved states of the game. Everytime a user saves a game, the game state is given an id, which is displayed as Game_ID along with the level on which the game was saved. 'Delete all progress' removes all the saved game states.
- Level Menu can be used for starting a new game from the unlocked levels. A user cannot play a new level if they haven't won the all previous levels.
- Exit Game saves all the progress and exits the game.
- In Game Menu: Allows the user to save the game, restart the game or exit to main menu.
- Levels become harder as the user progresses through the game. The cone and bucket zombies start appearing in subsequent levels, their frequency also increases.
- Different menus on winning and losing a game. Winning tells the user about the new plant unlock and losing menu gives the message βZombies ate your brainsβ
- After placing a plant, a plant is locked for sometime before it can be planted again.
- The shovel can be used to remove a plant from the lawn.
- Sound effects have been added for all interactions on the lawn to enhance the experience.
- The users can also choose between the day and the night mode. Unlike the day mode, no sun tokens fall from the sky in the night mode, and sunflowers are the only source of sun tokens.
- Singleton: For the database and for shovel feature, as we need only one reference through out the game.
- Iterator - To ensure that Plant, Zombie and Lawnmower lists are accessed in a synchronized way.
- Facade for menu based implementation
To play the game, the following steps can be followed:
- Clone this repository using the command:
git clone https://github.com/BhavyaC16/Plants-Vs-Zombies.git
- cd into the directory
Plant-Vs-Zombies-JAR
using:cd Plants-Vs-Zombies/Plant-Vs-Zombies-JAR
- Download the JavaFX SDK 11.0.2 from here, depending on your platform. Unzip and situate the folder
javafx-sdk-11.0.2
inPlants-Vs-Zombies/Plant-Vs-Zombies-JAR
- Execute the command
./PlantsVsZombies.sh
. Alternatively, execute the commandjava --module-path ~/javafx-sdk-11.0.2/lib --add-modules javafx.controls,javafx.fxml,javafx.graphics,javafx.media -jar PlantVsZombies.jar
(Note:--module-path
specifies the path to your JavaFX SDK 11 lib folder. The variableLIB_PATH
inPlantsVsZombies.sh
holds the path to the lib folder, and can be updated accordingly.)
Path to code: PlantVsZombies/src/sample
Path to Images and sounds: PlantVsZombies/src/sample/assets
You may copy, distribute and modify the software as long as you track changes/dates in source files. Any modifications to or software including (via compiler) GPL-licensed code must also be made available under the GPL along with build & install instructions.