Added battle background image
This commit is contained in:
parent
ca43fa2e53
commit
22454512f2
Binary file not shown.
Before Width: | Height: | Size: 122 B After Width: | Height: | Size: 141 B |
BIN
src/assets/images/battle/background.jpg
Normal file
BIN
src/assets/images/battle/background.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 614 KiB |
|
@ -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");
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue