The Player enters a tomb to search for a treasure box. The tomb is filled with zombies, that the
Player needs to fight before reaching the treasure. While the fighting is energy-consuming, the
tomb is also filled with the nutritious foods to let the Player regain strength.
The game will run automatically without interacting with keyborad or mouth.
The code can be run by using IntelliJ opening this folder (after cloning). To load different environments, simply copy the file named "environment.csv" from test folder into res/IO folder. The res/IO/output.csv file will record the positions of the bullet (shot by the player) in each game; whether the player has reached the treasure successfully and the enegy level left will be printed out when the game ends.
- Player (only 1)
- Sandwich
- Zombie
- Treasure box (only 1)
- Player moves to the closest zombie if his energy level >= 3, to the closest sandwich otherwise
- Player can shoot a bullet to a zombie if his energy level >= 3 and the distance must be close enough
- Player can only move to treasure after all zombies are killed
- Eating one sandwich can help increase energy level by 5
- Shooting one bullet will recude energy level by 3
- The game will end if player's energy level < 3 and there are zombies but no sandwiches OR player reaches the treasure