Fixed ship rotation animation
This commit is contained in:
parent
08a1946c1f
commit
ba4cda168a
|
@ -40,6 +40,12 @@ module TS.SpaceTac.Specs {
|
|||
|
||||
ship.moveTo(70, 50);
|
||||
expect(battle.log.events).toEqual([new MoveEvent(ship, new ArenaLocationAngle(50, 50, Math.PI), new ArenaLocationAngle(70, 50, 0))]);
|
||||
|
||||
ship.rotate(2.1);
|
||||
expect(battle.log.events).toEqual([
|
||||
new MoveEvent(ship, new ArenaLocationAngle(50, 50, Math.PI), new ArenaLocationAngle(70, 50, 0)),
|
||||
new MoveEvent(ship, new ArenaLocationAngle(70, 50, 0), new ArenaLocationAngle(70, 50, 2.1))
|
||||
]);
|
||||
});
|
||||
|
||||
it("applies equipment cooldown", function () {
|
||||
|
|
|
@ -430,10 +430,11 @@ module TS.SpaceTac {
|
|||
*/
|
||||
rotate(angle: number, log = true) {
|
||||
if (angle != this.arena_angle) {
|
||||
let start = copy(this.location);
|
||||
this.setArenaFacingAngle(angle);
|
||||
|
||||
if (log) {
|
||||
this.addBattleEvent(new MoveEvent(this, copy(this.location), new ArenaLocationAngle(this.arena_x, this.arena_y, angle)));
|
||||
this.addBattleEvent(new MoveEvent(this, start, copy(this.location)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue