[engine] fix

This commit is contained in:
2018-01-16 22:07:57 +03:00
parent b3dfc42f0b
commit 35404d5732
3 changed files with 13 additions and 3 deletions

View File

@@ -35,14 +35,16 @@ class BrickState implements IState<Brick> {
class EntityState implements IState<Entity> {
private var x:Float;
private var y:Float;
private var d:Direction;
private var type:Int;
public function new() {}
public function update(object:Entity):Bool {
if (x != object.rect.x || y != object.rect.y) {
if (x != object.rect.x || y != object.rect.y || !d.equals(object.rect.direction)) {
x = object.rect.x;
y = object.rect.y;
d = object.rect.direction;
return true;
}
if (Std.is(object, Tank)) {