diff --git a/src/scripts/view/Preload.ts b/src/scripts/view/Preload.ts index ed5ae40..77b8856 100644 --- a/src/scripts/view/Preload.ts +++ b/src/scripts/view/Preload.ts @@ -11,28 +11,33 @@ module SpaceTac.View { this.load.setPreloadSprite(this.preloadBar); // Load assets - this.load.image("battle-background", "assets/images/battle/background.jpg"); - this.load.image("battle-shiplist-base", "assets/images/battle/shiplist-base.png"); - this.load.image("battle-shiplist-normal", "assets/images/battle/shiplist-normal.png"); - this.load.image("battle-shiplist-playing", "assets/images/battle/shiplist-playing.png"); - this.load.image("battle-shiplist-own", "assets/images/battle/shiplist-own.png"); - this.load.image("battle-shiplist-enemy", "assets/images/battle/shiplist-enemy.png"); - this.load.image("battle-arena-background", "assets/images/battle/arena/background.png"); - this.load.image("battle-actionbar", "assets/images/battle/actionbar.png"); - this.load.image("battle-action-inactive", "assets/images/battle/action-inactive.png"); - this.load.image("battle-action-active", "assets/images/battle/action-active.png"); - this.load.image("battle-actionpointsempty", "assets/images/battle/actionpointsempty.png"); - this.load.image("battle-actionpointsfull", "assets/images/battle/actionpointsfull.png"); - this.load.image("battle-arena-shipspritehover", "assets/images/battle/arena/shipspritehover.png"); - this.load.image("battle-arena-shipspriteplaying", "assets/images/battle/arena/shipspriteplaying.png"); - this.load.image("battle-ship-card", "assets/images/battle/ship-card.png"); - this.load.image("battle-arena-ship01", "assets/images/battle/arena/ship01.png"); - this.load.image("common-standard-bar-background", "assets/images/common/standard-bar-background.png"); - this.load.image("common-standard-bar-foreground", "assets/images/common/standard-bar-foreground.png"); + this.loadImage("battle/background.jpg"); + this.loadImage("battle/shiplist-base.png"); + this.loadImage("battle/shiplist-normal.png"); + this.loadImage("battle/shiplist-playing.png"); + this.loadImage("battle/shiplist-own.png"); + this.loadImage("battle/shiplist-enemy.png"); + this.loadImage("battle/arena/background.png"); + this.loadImage("battle/actionbar.png"); + this.loadImage("battle/action-inactive.png"); + this.loadImage("battle/action-active.png"); + this.loadImage("battle/actionpointsempty.png"); + this.loadImage("battle/actionpointsfull.png"); + this.loadImage("battle/arena/shipspritehover.png"); + this.loadImage("battle/arena/shipspriteplaying.png"); + this.loadImage("battle/ship-card.png"); + this.loadImage("ship/scout/sprite.png"); + this.loadImage("ship/scout/portrait.png"); + this.loadImage("common/standard-bar-background.png"); + this.loadImage("common/standard-bar-foreground.png"); } create() { this.game.state.start("main"); } + + private loadImage(path: string) { + this.load.image(path.replace(/\//g, "-").replace(".png", "").replace(".jpg", ""), "assets/images/" + path); + } } } diff --git a/src/scripts/view/battle/ArenaShip.ts b/src/scripts/view/battle/ArenaShip.ts index bf7d3c6..4e1e21d 100644 --- a/src/scripts/view/battle/ArenaShip.ts +++ b/src/scripts/view/battle/ArenaShip.ts @@ -29,7 +29,7 @@ module SpaceTac.View { this.addChild(this.hover); // Add ship sprite - this.sprite = new Phaser.Button(battleview.game, 0, 0, "battle-arena-ship01"); + this.sprite = new Phaser.Button(battleview.game, 0, 0, "ship-scout-sprite"); this.sprite.scale.set(0.1, 0.1); this.sprite.rotation = ship.arena_angle; this.sprite.anchor.set(0.5, 0.5); diff --git a/src/scripts/view/battle/ShipListItem.ts b/src/scripts/view/battle/ShipListItem.ts index 38958d0..a14333c 100644 --- a/src/scripts/view/battle/ShipListItem.ts +++ b/src/scripts/view/battle/ShipListItem.ts @@ -12,6 +12,9 @@ module SpaceTac.View { // Shield display shield: ValueBar; + // Portrait + layer_portrait: Phaser.Image; + // Hover indicator layer_hover: Phaser.Image; @@ -42,16 +45,18 @@ module SpaceTac.View { this.layer_playing.alpha = 0; this.addChild(this.layer_playing); + this.layer_portrait = new Phaser.Image(this.game, 14, 15, "ship-scout-portrait", 0); + this.addChild(this.layer_portrait); + this.layer_normal = new Phaser.Image(this.game, 0, 0, "battle-shiplist-normal", 0); this.addChild(this.layer_normal); this.layer_enemy = new Phaser.Image(this.game, 0, 0, owned ? "battle-shiplist-own" : "battle-shiplist-enemy", 0); this.addChild(this.layer_enemy); - this.layer_hover = new Phaser.Image(this.game, 0, 0, "battle-arena-shipspritehover", 0); + this.layer_hover = new Phaser.Image(this.game, 8, 5, "battle-arena-shipspritehover", 0); this.layer_hover.visible = false; this.layer_hover.scale.set(0.5, 0.5); - this.layer_hover.position.set(8, 5); this.addChild(this.layer_hover); this.hull = ValueBar.newStandard(list.battleview.game, 85, 28);