diff --git a/graphics/ui/battle.svg b/graphics/ui/battle.svg index 24dd5eb..431f21f 100644 --- a/graphics/ui/battle.svg +++ b/graphics/ui/battle.svg @@ -85,17 +85,18 @@ borderopacity="1.0" inkscape:pageopacity="0" inkscape:pageshadow="2" - inkscape:zoom="0.70710678" - inkscape:cx="1028.3203" - inkscape:cy="623.67986" + inkscape:zoom="2.8284271" + inkscape:cx="112.1938" + inkscape:cy="932.35192" inkscape:document-units="px" - inkscape:current-layer="layer4" + inkscape:current-layer="layer14" showgrid="false" units="px" showguides="true" inkscape:snap-bbox="false" inkscape:bbox-nodes="true" - inkscape:bbox-paths="true"> + inkscape:bbox-paths="true" + inkscape:snap-to-guides="true"> + + @@ -126,170 +135,124 @@ - - + id="layer13" + inkscape:label="Ship list"> + inkscape:groupmode="layer" + id="layer14" + inkscape:label="Ship list background"> - - - - - - - - + transform="translate(0,27.637839)" + style="opacity:1;fill:#1c1f24;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:16;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4415" + width="133.01472" + height="948.2301" + x="0" + y="104.13197" /> - - - - - - - - + + + + + + + + + 2 + style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve">2 + - + inkscape:label="Playbar" + style="display:inline"> + + + - - - + id="layer9" + inkscape:label="Actions"> + + + + + + + y="139" /> Juggernaut + x="279" + y="174.70711">Juggernaut + y="192" /> + y="370" /> @@ -404,13 +377,49 @@ xml:space="preserve" style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" x="226" - y="419" + y="414" id="text4598" sodipodi:linespacing="125%">Rotary gun + y="414" + style="font-size:22.5px">Rotary gun + + + Energy recovery -15% (2 turns) + Shoot a single missile that explodes just before impact, and overloads the shield, doing 7 shield damage + + + + + + + + + + + + + + style="display:none"> Available weapon/ability Auto-scroll area Ship details, on hover or hold + id="tspan4635-2-2">Ship details,on hover or hold @@ -611,5 +695,23 @@ id="path4615-5-9-0-6" inkscape:connector-curvature="0" sodipodi:nodetypes="cc" /> + Active effect + diff --git a/out/assets/images/battle/actionbar.png b/out/assets/images/battle/actionbar.png index 43cb467..24cb11e 100644 Binary files a/out/assets/images/battle/actionbar.png and b/out/assets/images/battle/actionbar.png differ diff --git a/out/assets/images/battle/actionpointsempty.png b/out/assets/images/battle/actionpointsempty.png index cac0dfa..b2d1909 100644 Binary files a/out/assets/images/battle/actionpointsempty.png and b/out/assets/images/battle/actionpointsempty.png differ diff --git a/out/assets/images/battle/actionpointsfull.png b/out/assets/images/battle/actionpointsfull.png index d2a37fe..268b36f 100644 Binary files a/out/assets/images/battle/actionpointsfull.png and b/out/assets/images/battle/actionpointsfull.png differ diff --git a/out/assets/images/battle/actionpointsnone.png b/out/assets/images/battle/actionpointsnone.png new file mode 100644 index 0000000..9df62fc Binary files /dev/null and b/out/assets/images/battle/actionpointsnone.png differ diff --git a/out/assets/images/battle/actionpointspart.png b/out/assets/images/battle/actionpointspart.png index 7a5675f..548687d 100644 Binary files a/out/assets/images/battle/actionpointspart.png and b/out/assets/images/battle/actionpointspart.png differ diff --git a/out/assets/images/battle/shiplist-background.png b/out/assets/images/battle/shiplist-background.png new file mode 100644 index 0000000..31c451d Binary files /dev/null and b/out/assets/images/battle/shiplist-background.png differ diff --git a/out/assets/images/battle/shiplist-base.png b/out/assets/images/battle/shiplist-base.png deleted file mode 100644 index 1e6e718..0000000 Binary files a/out/assets/images/battle/shiplist-base.png and /dev/null differ diff --git a/out/assets/images/battle/shiplist-enemy.png b/out/assets/images/battle/shiplist-enemy.png index 8202c26..0fb195b 100644 Binary files a/out/assets/images/battle/shiplist-enemy.png and b/out/assets/images/battle/shiplist-enemy.png differ diff --git a/out/assets/images/battle/shiplist-energy-empty.png b/out/assets/images/battle/shiplist-energy-empty.png new file mode 100644 index 0000000..224498c Binary files /dev/null and b/out/assets/images/battle/shiplist-energy-empty.png differ diff --git a/out/assets/images/battle/shiplist-energy-full.png b/out/assets/images/battle/shiplist-energy-full.png new file mode 100644 index 0000000..55ca104 Binary files /dev/null and b/out/assets/images/battle/shiplist-energy-full.png differ diff --git a/out/assets/images/battle/shiplist-hull-empty.png b/out/assets/images/battle/shiplist-hull-empty.png index 7a417a7..02d0a3a 100644 Binary files a/out/assets/images/battle/shiplist-hull-empty.png and b/out/assets/images/battle/shiplist-hull-empty.png differ diff --git a/out/assets/images/battle/shiplist-hull-full.png b/out/assets/images/battle/shiplist-hull-full.png index e21b4a0..68cc0ee 100644 Binary files a/out/assets/images/battle/shiplist-hull-full.png and b/out/assets/images/battle/shiplist-hull-full.png differ diff --git a/out/assets/images/battle/shiplist-own.png b/out/assets/images/battle/shiplist-own.png index 48c6de8..6cf301e 100644 Binary files a/out/assets/images/battle/shiplist-own.png and b/out/assets/images/battle/shiplist-own.png differ diff --git a/out/assets/images/battle/shiplist-shield-empty.png b/out/assets/images/battle/shiplist-shield-empty.png index 5af3d0d..e402caa 100644 Binary files a/out/assets/images/battle/shiplist-shield-empty.png and b/out/assets/images/battle/shiplist-shield-empty.png differ diff --git a/out/assets/images/battle/shiplist-shield-full.png b/out/assets/images/battle/shiplist-shield-full.png index 2740e18..27abfaa 100644 Binary files a/out/assets/images/battle/shiplist-shield-full.png and b/out/assets/images/battle/shiplist-shield-full.png differ diff --git a/out/index.html b/out/index.html index 50f9829..853bac7 100644 --- a/out/index.html +++ b/out/index.html @@ -1,7 +1,8 @@ + - + SpaceTac - + + -
+
- - - - + + + + - - - - - - - + + + + + + + - + currentWindowOnload(); + } + + var queryString = new jasmine.QueryString({ + getWindowLocation: function () { return window.location; } + }); + if (queryString.getParam('onlytests') || queryString.getParam('spec')) { + document.getElementById("-space-tac").hidden = true; + } else { + new SpaceTac.GameUI(); + } + }; + - + + \ No newline at end of file diff --git a/src/GameUI.ts b/src/GameUI.ts index 2d807fb..337a260 100644 --- a/src/GameUI.ts +++ b/src/GameUI.ts @@ -13,7 +13,7 @@ module SpaceTac { audio: View.Audio; constructor(headless: boolean = false) { - super(1280, 720, headless ? Phaser.HEADLESS : Phaser.AUTO, '-space-tac'); + super(1920, 1080, headless ? Phaser.HEADLESS : Phaser.AUTO, '-space-tac'); this.audio = new View.Audio(this); diff --git a/src/view/Preload.ts b/src/view/Preload.ts index 20d868a..b150fa2 100644 --- a/src/view/Preload.ts +++ b/src/view/Preload.ts @@ -6,7 +6,7 @@ module SpaceTac.View { preload() { // Add preload sprite - this.add.text(640, 340, "... Loading ...", {align: "center", font: "bold 20px Arial", fill: "#c0c0c0"}) + this.add.text(640, 340, "... Loading ...", { align: "center", font: "bold 20px Arial", fill: "#c0c0c0" }) .anchor.set(0.5, 0.5); this.preloadBar = this.add.sprite(0, 0, "preload-bar"); this.preloadBar.anchor.set(0.5, 0.5); @@ -16,9 +16,11 @@ module SpaceTac.View { // Load images this.loadImage("menu/button.png"); this.loadImage("battle/waiting.png"); - this.loadImage("battle/shiplist-base.png"); + this.loadImage("battle/shiplist-background.png"); this.loadImage("battle/shiplist-own.png"); this.loadImage("battle/shiplist-enemy.png"); + this.loadImage("battle/shiplist-energy-empty.png"); + this.loadImage("battle/shiplist-energy-full.png"); this.loadImage("battle/shiplist-hull-empty.png"); this.loadImage("battle/shiplist-hull-full.png"); this.loadImage("battle/shiplist-shield-empty.png"); @@ -31,6 +33,7 @@ module SpaceTac.View { this.loadImage("battle/action-active.png"); this.loadImage("battle/action-fading.png"); this.loadImage("battle/action-tooltip.png"); + this.loadImage("battle/actionpointsnone.png"); this.loadImage("battle/actionpointsempty.png"); this.loadImage("battle/actionpointsfull.png"); this.loadImage("battle/actionpointspart.png"); diff --git a/src/view/battle/ActionBar.ts b/src/view/battle/ActionBar.ts index 6630ae3..0936c5d 100644 --- a/src/view/battle/ActionBar.ts +++ b/src/view/battle/ActionBar.ts @@ -23,23 +23,21 @@ module SpaceTac.View { // Create an empty action bar constructor(battleview: BattleView) { super(battleview.game); - + this.battleview = battleview; this.actions = []; this.ship = null; - this.x = 230; - this.y = 0; battleview.ui.add(this); // Background this.addChild(new Phaser.Image(this.game, 0, 0, "battle-actionbar", 0)); // Action points progress bar - this.actionpoints = new ValueBar(this.game, 119, 76, "battle-actionpointsempty"); + this.actionpoints = new ValueBar(this.game, 190, 111, "battle-actionpointsempty"); this.actionpoints.setBarImage("battle-actionpointspart"); this.addChild(this.actionpoints); - this.actionpointstemp = new ValueBar(this.game, 119, 76, "battle-actionpointsempty"); + this.actionpointstemp = new ValueBar(this.game, 190, 111, "battle-actionpointsnone"); this.actionpointstemp.setBarImage("battle-actionpointsfull"); this.addChild(this.actionpointstemp); @@ -68,7 +66,7 @@ module SpaceTac.View { // Add an action icon addAction(ship: Game.Ship, action: Game.BaseAction): ActionIcon { - var icon = new ActionIcon(this, 90 + this.actions.length * 62, 2, ship, action); + var icon = new ActionIcon(this, 200 + this.actions.length * 62, 2, ship, action); this.actions.push(icon); this.tooltip.bringToTop(); @@ -115,10 +113,10 @@ module SpaceTac.View { }); this.ship = ship; - this.game.tweens.create(this).to({"alpha": 1}, 400).start(); + this.game.tweens.create(this).to({ "alpha": 1 }, 400).start(); } else { this.ship = null; - this.game.tweens.create(this).to({"alpha": 0.5}, 400).start(); + this.game.tweens.create(this).to({ "alpha": 0.5 }, 400).start(); } this.updateActionPoints(); diff --git a/src/view/battle/Arena.ts b/src/view/battle/Arena.ts index e708318..cc35c1a 100644 --- a/src/view/battle/Arena.ts +++ b/src/view/battle/Arena.ts @@ -25,15 +25,15 @@ module SpaceTac.View { // Create a graphical arena for ship sprites to fight in a 2D space constructor(battleview: BattleView) { super(battleview.game); - + this.battleview = battleview; this.ship_sprites = []; this.playing = null; this.hovered = null; this.range_hint = null; - var offset_x = 206; - var offset_y = 84; + var offset_x = 133; + var offset_y = 132; var background = new Phaser.Button(battleview.game, 0, 0, "battle-arena-background"); var expected_width = battleview.getWidth() - offset_x; diff --git a/src/view/battle/ShipList.ts b/src/view/battle/ShipList.ts index da1a9fe..9e4e3c2 100644 --- a/src/view/battle/ShipList.ts +++ b/src/view/battle/ShipList.ts @@ -1,6 +1,6 @@ module SpaceTac.View { // Bar with all playing ships, by play order - export class ShipList extends Phaser.Group { + export class ShipList extends Phaser.Image { // Link to the parent battleview battleview: BattleView; @@ -15,7 +15,7 @@ module SpaceTac.View { // Create an empty action bar constructor(battleview: BattleView) { - super(battleview.game, battleview.ui); + super(battleview.game, 0, 131, "battle-shiplist-background"); this.battleview = battleview; this.ships = []; @@ -24,26 +24,11 @@ module SpaceTac.View { battleview.ui.add(this); - this.addBackground(); - if (battleview.battle) { this.setShipsFromBattle(battleview.battle); } } - // Add background children - addBackground(): void { - var background = new Phaser.Graphics(this.game, 0, 0); - background.beginFill(0xFFFFFFFF, 0.9); - background.drawRect(0, 0, 224, 84); - background.endFill(); - background.beginFill(0xFFFFFFFF, 0.45); - background.drawRect(0, 84, 206, this.battleview.getHeight() - 84); - background.endFill(); - background.visible = true; - this.addChild(background); - } - // Clear the action icons clearAll(): void { this.ships.forEach((ship: ShipListItem) => { @@ -66,7 +51,7 @@ module SpaceTac.View { var owned = ship.getPlayer() === this.battleview.player; var result = new ShipListItem(this, -200, 0, ship, owned); this.ships.push(result); - this.add(result); + this.addChild(result); return result; } @@ -98,11 +83,11 @@ module SpaceTac.View { this.ships.forEach((item: ShipListItem) => { var position = this.findPlayPosition(item.ship); if (position === 0) { - item.moveTo(12, 12, animate); + item.moveTo(20, 20 - this.y, animate); } else { - item.moveTo(3, 26 + position * 63, animate); + item.moveTo(8, 36 + position * 102 - this.y, animate); } - this.setChildIndex(item, 1 + position); + this.setChildIndex(item, position); }); } diff --git a/src/view/battle/ShipListItem.ts b/src/view/battle/ShipListItem.ts index a76ce31..fd41ae0 100644 --- a/src/view/battle/ShipListItem.ts +++ b/src/view/battle/ShipListItem.ts @@ -4,15 +4,15 @@ module SpaceTac.View { // Reference to the ship game object ship: Game.Ship; + // Energy display + energy: ValueBar; + // Hull display hull: ValueBar; // Shield display shield: ValueBar; - // Base display - layer_base: Phaser.Image; - // Portrait layer_portrait: Phaser.Image; @@ -36,12 +36,9 @@ module SpaceTac.View { list.battleview.cursorOffShip(ship); }); - this.layer_base = new Phaser.Image(this.game, 0, 0, "battle-shiplist-base", 0); - this.addChild(this.layer_base); - - this.layer_portrait = new Phaser.Image(this.game, 30, 30, "ship-" + ship.model + "-portrait", 0); - this.layer_portrait.anchor.set(0.5, 0.5); - this.layer_portrait.scale.set(0.19, 0.19); + this.layer_portrait = new Phaser.Image(this.game, 76, 76, "ship-" + ship.model + "-portrait", 0); + this.layer_portrait.position.set(8, 8); + this.layer_portrait.scale.set(0.3, 0.3); this.addChild(this.layer_portrait); this.layer_hover = new Phaser.Image(this.game, 30, 30, "battle-arena-shipspritehover", 0); @@ -49,10 +46,13 @@ module SpaceTac.View { this.layer_hover.visible = false; this.addChild(this.layer_hover); - this.shield = ValueBar.newStyled(this.game, "battle-shiplist-shield", 127, 48); + this.energy = ValueBar.newStyled(this.game, "battle-shiplist-energy", 90, 39, true); + this.addChild(this.energy); + + this.shield = ValueBar.newStyled(this.game, "battle-shiplist-shield", 98, 39, true); this.addChild(this.shield); - this.hull = ValueBar.newStyled(this.game, "battle-shiplist-hull", 60, 48); + this.hull = ValueBar.newStyled(this.game, "battle-shiplist-hull", 106, 39, true); this.addChild(this.hull); this.active_effects = new Phaser.Group(this.game); @@ -67,6 +67,7 @@ module SpaceTac.View { updateAttributes() { this.attributeChanged(this.ship.hull); this.attributeChanged(this.ship.shield); + this.attributeChanged(this.ship.ap_current); } // Update effects applied on the ship @@ -84,6 +85,8 @@ module SpaceTac.View { this.hull.setValue(attribute.current, attribute.maximal); } else if (attribute.code === Game.AttributeCode.Shield) { this.shield.setValue(attribute.current, attribute.maximal); + } else if (attribute.code === Game.AttributeCode.AP) { + this.energy.setValue(attribute.current, attribute.maximal); } } @@ -91,7 +94,7 @@ module SpaceTac.View { moveTo(x: number, y: number, animate: boolean) { if (animate) { var tween = this.game.tweens.create(this); - tween.to({x: x, y: y}); + tween.to({ x: x, y: y }); tween.start(); } else { this.x = x;