1
0
Fork 0

Dim dead ship sprite instead of removing it

This commit is contained in:
Michaël Lemaire 2017-01-12 01:37:05 +01:00
parent 356486c6ce
commit 337bb5c74f
3 changed files with 6 additions and 9 deletions

View file

@ -84,11 +84,10 @@ module SpaceTac.View {
}
// Remove a ship sprite
removeShip(ship: Game.Ship): void {
markAsDead(ship: Game.Ship): void {
var sprite = this.findShipSprite(ship);
if (sprite) {
this.ship_sprites.splice(this.ship_sprites.indexOf(sprite), 1);
sprite.destroy();
sprite.alpha = 0.5;
}
}

View file

@ -106,8 +106,8 @@ module SpaceTac.View {
if (this.view.ship_hovered === event.ship) {
this.view.setShipHovered(null);
}
this.view.arena.removeShip(event.ship);
this.view.ship_list.removeShip(event.ship);
this.view.arena.markAsDead(event.ship);
this.view.ship_list.markAsDead(event.ship);
}
// Weapon used

View file

@ -92,13 +92,11 @@ module SpaceTac.View {
}
// Remove a ship from the list
removeShip(ship: Game.Ship): void {
markAsDead(ship: Game.Ship): void {
var item = this.findItem(ship);
if (item) {
this.ships.splice(this.ships.indexOf(item), 1);
item.destroy();
item.alpha = 0.5;
}
this.updateItemsLocation();
}
// Set the currently playing ship