Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

30 lines (25 sloc) 0.5 kB
package entities
{
import net.flashpunk.*;
public class Enemy extends AreaEntity
{
public var health:uint;
public var dead:Boolean = false;
public function Enemy(x:int, y:int, health:uint)
{
super(x, y);
type = "enemy";
layer = 0;
this.health = health;
}
public function hit():void
{
if (!dead && --health == 0) die();
}
public function die():void
{
dead = true;
area.remove(this);
}
}
}
Jump to Line
Something went wrong with that request. Please try again.