diff --git a/src/assets/images/ui/battle/actionpointsempty.png b/src/assets/images/ui/battle/actionpointsempty.png new file mode 100644 index 0000000..cac0dfa Binary files /dev/null and b/src/assets/images/ui/battle/actionpointsempty.png differ diff --git a/src/assets/images/ui/battle/actionpointsfull.png b/src/assets/images/ui/battle/actionpointsfull.png new file mode 100644 index 0000000..d2a37fe Binary files /dev/null and b/src/assets/images/ui/battle/actionpointsfull.png differ diff --git a/src/scripts/view/Preload.ts b/src/scripts/view/Preload.ts index 43ec0d2..3ad9763 100644 --- a/src/scripts/view/Preload.ts +++ b/src/scripts/view/Preload.ts @@ -14,6 +14,8 @@ module SpaceTac.View { this.load.image("ui-shiplist-enemy", "assets/images/battle/shiplist-enemy.png"); this.load.image("ui-arena-background", "assets/images/battle/arena-background.png"); this.load.image("ui-battle-actionbar", "assets/images/ui/battle/actionbar.png"); + this.load.image("ui-battle-actionpointsempty", "assets/images/ui/battle/actionpointsempty.png"); + this.load.image("ui-battle-actionpointsfull", "assets/images/ui/battle/actionpointsfull.png"); this.load.image("ui-ship-card", "assets/images/battle/ship-card.png"); this.load.image("arena-ship", "assets/images/battle/ship01.png"); this.load.image("ui-bar-standard-background", "assets/images/ui/bars/standard-background.png"); diff --git a/src/scripts/view/battle/ActionBar.ts b/src/scripts/view/battle/ActionBar.ts index ebcb4f5..a457e6d 100644 --- a/src/scripts/view/battle/ActionBar.ts +++ b/src/scripts/view/battle/ActionBar.ts @@ -9,6 +9,9 @@ module SpaceTac.View { // List of action icons actions: ActionIcon[]; + // Progress bar displaying action points + actionpoints: ValueBar; + // Create an empty action bar constructor(battleview: BattleView) { this.battleview = battleview; @@ -17,7 +20,11 @@ module SpaceTac.View { super(battleview.game, 170, 0, "ui-battle-actionbar"); battleview.ui.add(this); - this.update(); + // Action points progress bar + this.actionpoints = new ValueBar(battleview.game, 119, 76, "ui-battle-actionpointsempty"); + this.actionpoints.setBarImage("ui-battle-actionpointsfull"); + this.actionpoints.setValue(50, 100); + this.addChild(this.actionpoints); } // Clear the action icons diff --git a/src/scripts/view/battle/BattleView.ts b/src/scripts/view/battle/BattleView.ts index b0de922..7ca2c80 100644 --- a/src/scripts/view/battle/BattleView.ts +++ b/src/scripts/view/battle/BattleView.ts @@ -64,13 +64,8 @@ module SpaceTac.View { // Add UI elements this.action_bar = new ActionBar(this); this.ship_list = new ShipList(this); - this.card_playing = new ShipCard(this, 500, 0); - this.card_hovered = new ShipCard(this, 500, 300); - - // Add a test progress bar - var bar = ValueBar.newStandard(game, 300, 300); - bar.setValue(50, 100); - this.ui.add(bar); + this.card_playing = new ShipCard(this, 1060, 130); + this.card_hovered = new ShipCard(this, 1060, 430); // Start processing the battle log this.log_processor = new LogProcessor(this); diff --git a/src/scripts/view/common/ValueBar.ts b/src/scripts/view/common/ValueBar.ts index 3a66e33..c9adf44 100644 --- a/src/scripts/view/common/ValueBar.ts +++ b/src/scripts/view/common/ValueBar.ts @@ -31,7 +31,7 @@ module SpaceTac.View { } // Set an image to use for the bar - setBarImage(key: string, offset_x: number, offset_y: number): void { + setBarImage(key: string, offset_x: number = 0, offset_y: number = 0): void { this.bar_sprite = new Phaser.Sprite(this.game, offset_x, offset_y, key); this.addChild(this.bar_sprite); }