1
0
Fork 0

Added battle background image

This commit is contained in:
Michaël Lemaire 2015-02-03 01:00:00 +01:00
parent ca43fa2e53
commit 22454512f2
4 changed files with 8 additions and 0 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 B

After

Width:  |  Height:  |  Size: 141 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 614 KiB

View file

@ -11,6 +11,7 @@ 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-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");

View file

@ -16,6 +16,9 @@ module SpaceTac.View {
// Battleground container
arena: Arena;
// Background image
background: Phaser.Image;
// Targetting mode (null if we're not in this mode)
targetting: Targetting;
@ -44,6 +47,7 @@ module SpaceTac.View {
this.targetting = null;
this.ship_hovered = null;
this.log_processor = null;
this.background = null;
}
// Create view graphics
@ -51,7 +55,10 @@ module SpaceTac.View {
var battleview = this;
var game = this.game;
// Background
game.stage.backgroundColor = 0x000000;
this.background = new Phaser.Image(game, 0, 0, "battle-background", 0);
game.add.existing(this.background);
// Add arena (local map)
this.arena = new Arena(battleview);