瀏覽代碼

added constructor to zombie class

pull/1/head
16nlyons 9 年前
父節點
當前提交
7dea12e90a
共有 1 個檔案被更改,包括 13 行新增0 行删除
  1. +13
    -0
      src/tanks/Tanks.java

+ 13
- 0
src/tanks/Tanks.java 查看文件

@ -81,6 +81,19 @@ public class Tanks
*/ */
private class Zombie extends Enemy private class Zombie extends Enemy
{ {
//constructor instanciated fields
public Zombie()
{
super();
this.spawn(frame);
width = 30;
height = 30;
this.setShape();
health = 10;
isAlive=true;
}
//uses super to move player if collision then removes zombie and player
//takes damage
public void move() public void move()
{ {
direction = angleToPlayer(p); direction = angleToPlayer(p);

載入中…
取消
儲存