[engine] fix
This commit is contained in:
@@ -23,6 +23,10 @@ class Direction {
|
||||
return from(-x, -y);
|
||||
}
|
||||
|
||||
public function equals(other:Direction):Bool {
|
||||
return other.x == x && other.y == y;
|
||||
}
|
||||
|
||||
public static function from(x:Int, y:Int):Direction {
|
||||
return directions.get(x + y * 10);
|
||||
}
|
||||
@@ -36,4 +40,8 @@ class Direction {
|
||||
case _: null;
|
||||
}
|
||||
}
|
||||
|
||||
public function toString():String {
|
||||
return 'Direction{x=$x,y=$y}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,10 +46,10 @@ class Tank extends MobileEntity {
|
||||
|
||||
override public function move(direction:Direction):Void {
|
||||
// ToDo: spike
|
||||
if (direction != this.direction) {
|
||||
/*if (direction != this.direction) {
|
||||
rect.x -= this.direction.x * 4;
|
||||
rect.y -= this.direction.y * 4;
|
||||
}
|
||||
}*/
|
||||
super.move(direction);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user