1
0
Fork 0

Fixed dead ships moving on game loading

This commit is contained in:
Michaël Lemaire 2017-05-22 22:18:17 +02:00
parent dbd2c8e49b
commit 637e66deaa

View file

@ -85,6 +85,7 @@ module TS.SpaceTac.UI {
this.add(this.sticky_effects);
this.effects = new Phaser.Group(this.game);
this.add(this.effects);
this.updateStickyEffects();
// Handle input on ship sprite
UITools.setHoverClick(this.sprite,
@ -94,8 +95,12 @@ module TS.SpaceTac.UI {
);
// Set location
this.position.set(ship.arena_x - 150 * Math.cos(ship.arena_angle), ship.arena_y - 150 * Math.sin(ship.arena_angle));
this.moveTo(ship.arena_x, ship.arena_y, ship.arena_angle);
if (ship.alive) {
this.position.set(ship.arena_x - 150 * Math.cos(ship.arena_angle), ship.arena_y - 150 * Math.sin(ship.arena_angle));
this.moveTo(ship.arena_x, ship.arena_y, ship.arena_angle);
} else {
this.moveTo(ship.arena_x, ship.arena_y, ship.arena_angle, false);
}
// Log processing
this.battleview.log_processor.registerForShip(ship, event => this.processLogEvent(event));