diff --git a/.gitignore b/.gitignore index 1d56431..1cc7fdb 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,5 @@ /core /node_modules /src/vendor +/graphics/**/*.blend?* diff --git a/graphics/ui/brushedmetal.jpg b/graphics/ui/brushedmetal.jpg new file mode 100644 index 0000000..ab1b222 Binary files /dev/null and b/graphics/ui/brushedmetal.jpg differ diff --git a/graphics/ui/ui.blend b/graphics/ui/ui.blend new file mode 100644 index 0000000..c6ea289 Binary files /dev/null and b/graphics/ui/ui.blend differ diff --git a/src/assets/images/ui/battle/actionbar.png b/src/assets/images/ui/battle/actionbar.png new file mode 100644 index 0000000..43cb467 Binary files /dev/null and b/src/assets/images/ui/battle/actionbar.png differ diff --git a/src/css/main.less b/src/css/main.less index e3f8348..ae66b17 100644 --- a/src/css/main.less +++ b/src/css/main.less @@ -9,7 +9,7 @@ html, body { } .game { - width: 800px; - height: 600px; + width: 1280px; + height: 720px; margin: 20px auto; } diff --git a/src/scripts/GameRouter.ts b/src/scripts/GameRouter.ts index f5f5d69..9043d3a 100644 --- a/src/scripts/GameRouter.ts +++ b/src/scripts/GameRouter.ts @@ -6,7 +6,7 @@ module SpaceTac { // Router between game views export class GameRouter extends Phaser.Game { constructor() { - super(800, 600, Phaser.AUTO, '-space-tac'); + super(1280, 720, Phaser.AUTO, '-space-tac'); this.state.add('boot', View.Boot); this.state.add('preload', View.Preload); diff --git a/src/scripts/view/Preload.ts b/src/scripts/view/Preload.ts index 38cf16d..43ec0d2 100644 --- a/src/scripts/view/Preload.ts +++ b/src/scripts/view/Preload.ts @@ -13,6 +13,7 @@ module SpaceTac.View { this.load.image("ui-shiplist-own", "assets/images/battle/shiplist-own.png"); 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-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 0bfb452..ebcb4f5 100644 --- a/src/scripts/view/battle/ActionBar.ts +++ b/src/scripts/view/battle/ActionBar.ts @@ -2,7 +2,7 @@ module SpaceTac.View { "use strict"; // Bar with all available action icons displayed - export class ActionBar extends Phaser.Group { + export class ActionBar extends Phaser.Sprite { // Link to the parent battleview battleview: BattleView; @@ -14,19 +14,12 @@ module SpaceTac.View { this.battleview = battleview; this.actions = []; - super(battleview.game, battleview.ui); + super(battleview.game, 170, 0, "ui-battle-actionbar"); battleview.ui.add(this); this.update(); } - // Update the bar status (and position) - update() { - super.update(); - - this.x = 100; - } - // Clear the action icons clearAll(): void { this.actions.forEach((action: ActionIcon) => { @@ -37,7 +30,7 @@ module SpaceTac.View { // Add an action icon addAction(ship: Game.Ship, action: Game.BaseAction): ActionIcon { - var icon = new ActionIcon(this, this.actions.length * 50, 0, ship, action); + var icon = new ActionIcon(this, 110 + this.actions.length * 50, 25, ship, action); this.actions.push(icon); return icon; } diff --git a/src/scripts/view/battle/ActionIcon.ts b/src/scripts/view/battle/ActionIcon.ts index faf8f86..f1c29d1 100644 --- a/src/scripts/view/battle/ActionIcon.ts +++ b/src/scripts/view/battle/ActionIcon.ts @@ -23,7 +23,7 @@ module SpaceTac.View { this.action = action; super(bar.game, x, y, "action-" + action.code); - bar.add(this); + bar.addChild(this); // TODO Handle action.canBeUsed() result to enable/disable the button