# Plants vs Zombies
SYSC 3110 - Third Year Project
## Folders description
- Documentation - Java doc generated from classes
- Diagrams - UML diagrams (Class and Sequence)
- Source - The project source code (.java files) and JUnit testing files
## Workload
* View -> [Ahmed (Ahmed Romih)](@decarbonite) & [Dima (Dmytro Sytnik)](@vanarman)
* Controller -> [Ahmed (Ahmed Romih)](@decarbonite) & [Dima (Dmytro Sytnik)](@vanarman)
* NodeButton -> [Dima (Dmytro Sytnik)](@vanarman)
* Plant -> [Ahmed (Ahmed Romih)](@decarbonite) & [Dima (Dmytro Sytnik)](@vanarman) & [Mrunal (Mrunal Patel)](@mrunal-patel1997)
* MoneyPlant -> [Ahmed (Ahmed Romih)](@decarbonite) & [Dima (Dmytro Sytnik)](@vanarman) & [Mrunal (Mrunal Patel)](@mrunal-patel1997)
* NPC -> [Ahmed (Ahmed Romih)](@decarbonite)
* Zombie -> [Ahmed (Ahmed Romih)](@decarbonite)
* Board -> [Ahmed (Ahmed Romih)](@decarbonite) & [Dima (Dmytro Sytnik)](@vanarman)
* InitialScreen -> [Dima (Dmytro Sytnik)](@vanarman)
* InitialScreenController -> [Dima (Dmytro Sytnik)](@vanarman)
* ReadLevel -> [Dima (Dmytro Sytnik)](@vanarman)
* BoardRow -> [Dima (Dmytro Sytnik)](@vanarman)
* BoardNode -> [Dima (Dmytro Sytnik)](@vanarman)
* Game -> [Ahmed (Ahmed Romih)](@decarbonite)
* Testing -> [Ahmed (Ahmed Romih)](@decarbonite) & [Dima (Dmytro Sytnik)](@vanarman)
## Game specification and Design decisions
The current game is a step-by-step strategy game (simulation of the existing **Plats vs Zombies** game). In the current version,
the game is working in real-time, using delay function to delay zombie's movement and the plants' shooting which makes it dynamic.
Plants are placed by the Player at anytime of the game as long as the money is sufficient. In order to win the game,
Plants should kill all Zombies on the board.
Currently, the game has two modes, regular mode; which the player starts with choosing what type of zombie he wants to face and the amount to show on the board, and XML Game Builder Mode; in which the game automatically reads the amount of zombies that would show up and number of levels from a XML file. Zombies are generated randomly at the beginning (right side) of the board.
Unlimited undo and redo functionality was added in Milestone 3. Stacks were used to track the last plants that were added to the board and their coordinates. In case of undo, you pop from the stack and remove from board, if it's redo, you add back the plant and its coordinate into the stacks.
As the instructions of implementing the undo/redo were not very clear, the way I implemeted it in case of placing a plant at (x,y) and clicking undo, then placing a different plant at same position (x,y) and doing redo would not allow the redo because there is already another plant there, therefore this plant needs to be killed to be able to do redo again. Moreover, undo also gives back the money you spent on the plant that was undo-ed, and redo would decrease your money.
The player can add plants to fight against Zombies and able to choose out of two types of plants:
* **Plant** - Attack first available Zombie across a row were Plant is placed.
* **MoneyPlant** - Cannot attack Zombies but generates in-game money which helps the player to buy more plants. In each step of the game, if a MoneyPlant is placed, it has 50% chance to increase money by 25 money points.
Each time Plant kills Zombie Player will be rewarded by score point (each Zombie worth 10 points).
Game continue until Plants kill all Zombies or at least one Zombie reaches the end of the board
(left side) and kills the Plant in the last cell if exists.
## User manual
1. When the game starts, the first look is like the picture below.
![Initial Game Look](Documentation/images/initialgame.png)
The player gets to put his name and chooses the game mode.
2. At the beginning of the game, the player has a few seconds to place plants before zombies start to appear on the board.
By clicking once on the Plant you want to choose from the top panel, the cursor image changes to that Plant image, then the player can choose which cell on the board to place it by clicking on that cell as long as there is no other object already placed there.
![Plants Placement](Documentation/images/Plantsplacing.png)
3. In the top menu you can choose undo to remove a plant that you added to the board or redo to bring it back.
4. The player can save the state of the game by choosing save from the top menu and upon his return to the game he can loads to start where he left.
5. After the time delay is over the zombies will start to appear from the right side of the board, automatically moving towards the left side of the board.
![Zombies Display](Documentation/images/zombies.png)
6. The game ends either by the player winning; killing all zombies on the board and no more zombies are left to spawn, or losing in case of a zombie reaching the last cell at the left side of the board.
When the player wins, a message pops up indicating victory like the picture below.
![Victory](Documentation/images/victory.png)
When the player loses, a message pops up indicating that the player has lost like the picture below.
![Lose](Documentation/images/lose.png)
## Changes Log
1. Save and Load functionality was added.
2. Regular game mode added.
3. Game Level Builder Mode added.
4. Unused classes were removed.
5. JavaDoc added to the entire code.
6. Overall refactoring.
7. Reflections of the project file has been added.
8. Changes to the UML diagrams according to the changes noted above.
9. Sequence diagram has been changed into a multiple pages PDF file for each event as we were advised to by the TA.
## Known Issues
1. Plants are shooting at the zombies across the row, but there is no graphical image of the actual shooting, like peas getting thrown at the zombie.
2. On MacOS platform there happens to be a problem when the JOptionPane that appears declaring winning or losing at the end of the game. If the MacOS user click on the "OK" button to close it, it SOMETIMES shows the problem below. However, this doesn't affect the game experience in any way.
This issue doesn't happen on other platforms and after some research it happens to be a known issue with MacOS.
![Issue](Documentation/images/issue.png)
没有合适的资源?快使用搜索试试~ 我知道了~
java版植物大战僵尸源码-PlantsvsZombies:植物大战僵尸
共125个文件
html:67个
png:28个
java:23个
需积分: 50 9 下载量 29 浏览量
2021-06-05
03:21:39
上传
评论 1
收藏 2.75MB ZIP 举报
温馨提示
java版植物大战僵尸源码植物大战僵尸 SYSC 3110 - 第三年项目 文件夹说明 文档 - 从类生成的 Java 文档 图 - UML 图(类和序列) Source - 项目源代码(.java 文件)和 JUnit 测试文件 工作量 查看 -> & 控制器 -> & 节点按钮 -> 植物 -> & & MoneyPlant -> & & NPC -> 僵尸 -> 板 -> & 初始屏幕 -> InitialScreenController -> 阅读级别 -> BoardRow -> BoardNode -> 游戏 -> 测试 -> & 游戏规范和设计决策 目前的游戏是一个循序渐进的策略游戏(模拟现有的Plats vs Zombies游戏)。 在当前版本中,游戏是实时运行的,使用延迟功能来延迟僵尸的移动和植物的射击,使其具有动态性。 只要钱足够,玩家可以在游戏的任何时候放置植物。 为了赢得比赛,植物应该杀死棋盘上的所有僵尸。 目前,游戏有两种模式,普通模式; 玩家首先选择他想面对的僵尸类型和显示在板上的数量,以及 XML 游戏构建器模式; 其中游戏会自动从 XML 文件中读取出现
资源推荐
资源详情
资源评论
收起资源包目录
java版植物大战僵尸源码-PlantsvsZombies:植物大战僵尸 (125个子文件)
stylesheet.css 21KB
.gitignore 2KB
View.html 43KB
NodeButton.html 27KB
Board.html 23KB
BoardNode.html 19KB
Controller.html 17KB
NPC.html 16KB
BoardRow.html 16KB
index-15.html 16KB
BoardRowTest.html 15KB
Zombie.html 14KB
index-6.html 14KB
Game.html 14KB
BoardNodeTest.html 14KB
GameRound.html 13KB
MoneyPlant.html 12KB
MoneyPlantTest.html 12KB
ZombieTest.html 12KB
InitialScreen.html 12KB
PlantTest.html 12KB
XYPlant.html 12KB
Player.html 11KB
Plant.html 11KB
ControllerTest.html 11KB
BoardTest.html 11KB
index-14.html 11KB
InitialScreenController.html 11KB
ViewTest.html 11KB
Zombie.html 10KB
Plant.html 9KB
index-2.html 9KB
ReadLevel.html 9KB
index-12.html 9KB
index-1.html 9KB
serialized-form.html 9KB
NPC.html 9KB
package-summary.html 8KB
index-10.html 8KB
constant-values.html 8KB
help-doc.html 8KB
index-18.html 8KB
package-tree.html 8KB
overview-tree.html 8KB
index-13.html 8KB
index-11.html 7KB
index-8.html 7KB
index-7.html 7KB
index-3.html 7KB
index-17.html 7KB
index-16.html 7KB
AllTests.html 6KB
package-use.html 6KB
MoneyPlant.html 6KB
BoardNode.html 6KB
BoardRow.html 6KB
index-5.html 6KB
index-4.html 6KB
index-9.html 6KB
GameRound.html 5KB
Player.html 5KB
Board.html 5KB
Game.html 5KB
XYPlant.html 4KB
deprecated-list.html 3KB
package-frame.html 3KB
allclasses-frame.html 3KB
index.html 3KB
allclasses-noframe.html 2KB
Controller.java 11KB
View.java 9KB
Board.java 9KB
BoardRow.java 5KB
BoardNode.java 4KB
BoardNodeTest.java 4KB
InitialScreen.java 3KB
BoardRowTest.java 3KB
NodeButton.java 3KB
Game.java 3KB
NPC.java 2KB
ReadLevel.java 2KB
BoardTest.java 2KB
Zombie.java 2KB
PlantTest.java 2KB
MoneyPlantTest.java 2KB
ZombieTest.java 2KB
ControllerTest.java 2KB
Plant.java 1KB
InitialScreenController.java 1KB
ViewTest.java 1KB
MoneyPlant.java 998B
AllTests.java 396B
script.js 827B
README.md 6KB
package-list 1B
SequenceDiagram.pdf 300KB
zombieSuit.png 606KB
zombies.png 271KB
lose.png 257KB
victory.png 246KB
共 125 条
- 1
- 2
资源评论
weixin_38618312
- 粉丝: 4
- 资源: 890
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功