Browse Source

added constructor to zombie class

pull/1/head
16nlyons 8 years ago
parent
commit
7dea12e90a
1 changed files with 13 additions and 0 deletions
  1. +13
    -0
      src/tanks/Tanks.java

+ 13
- 0
src/tanks/Tanks.java View File

@ -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);

Loading…
Cancel
Save