2015-04-07 00:00:00 +00:00
|
|
|
/// <reference path="BaseView.ts"/>
|
|
|
|
|
2014-12-29 00:00:00 +00:00
|
|
|
module SpaceTac.View {
|
2015-04-07 00:00:00 +00:00
|
|
|
export class Preload extends BaseView {
|
2014-12-29 00:00:00 +00:00
|
|
|
private preloadBar: Phaser.Sprite;
|
|
|
|
|
|
|
|
preload() {
|
2014-12-30 00:00:00 +00:00
|
|
|
// Add preload sprite
|
2017-01-10 00:22:59 +00:00
|
|
|
this.add.text(this.getMidWidth(), this.getMidHeight() - 40, "... Loading ...", { align: "center", font: "bold 20px Arial", fill: "#c0c0c0" })
|
2015-03-12 00:00:00 +00:00
|
|
|
.anchor.set(0.5, 0.5);
|
2015-01-18 00:00:00 +00:00
|
|
|
this.preloadBar = this.add.sprite(0, 0, "preload-bar");
|
2015-04-07 00:00:00 +00:00
|
|
|
this.preloadBar.anchor.set(0.5, 0.5);
|
|
|
|
this.preloadBar.position.set(this.getMidWidth(), this.getMidHeight());
|
2014-12-30 00:00:00 +00:00
|
|
|
this.load.setPreloadSprite(this.preloadBar);
|
|
|
|
|
2015-02-16 00:00:00 +00:00
|
|
|
// Load images
|
2015-03-12 00:00:00 +00:00
|
|
|
this.loadImage("menu/button.png");
|
2015-02-16 00:00:00 +00:00
|
|
|
this.loadImage("battle/waiting.png");
|
2017-01-08 22:04:07 +00:00
|
|
|
this.loadImage("battle/shiplist-background.png");
|
2015-02-04 00:00:00 +00:00
|
|
|
this.loadImage("battle/shiplist-own.png");
|
|
|
|
this.loadImage("battle/shiplist-enemy.png");
|
2017-01-15 22:05:00 +00:00
|
|
|
this.loadImage("battle/shiplist-damage.png");
|
2017-01-16 23:20:33 +00:00
|
|
|
this.loadImage("battle/shiplist-effect-good.png");
|
|
|
|
this.loadImage("battle/shiplist-effect-bad.png");
|
2017-01-08 22:04:07 +00:00
|
|
|
this.loadImage("battle/shiplist-energy-empty.png");
|
|
|
|
this.loadImage("battle/shiplist-energy-full.png");
|
2015-02-28 00:00:00 +00:00
|
|
|
this.loadImage("battle/shiplist-hull-empty.png");
|
|
|
|
this.loadImage("battle/shiplist-hull-full.png");
|
|
|
|
this.loadImage("battle/shiplist-shield-empty.png");
|
|
|
|
this.loadImage("battle/shiplist-shield-full.png");
|
2015-02-16 00:00:00 +00:00
|
|
|
this.loadImage("battle/background.jpg");
|
2015-02-04 00:00:00 +00:00
|
|
|
this.loadImage("battle/arena/background.png");
|
2017-01-19 18:33:56 +00:00
|
|
|
this.loadImage("battle/arena/ap-indicator.png");
|
2015-02-04 00:00:00 +00:00
|
|
|
this.loadImage("battle/actionbar.png");
|
2015-02-28 00:00:00 +00:00
|
|
|
this.loadImage("battle/actionbar-cancel.png");
|
2015-02-04 00:00:00 +00:00
|
|
|
this.loadImage("battle/action-inactive.png");
|
|
|
|
this.loadImage("battle/action-active.png");
|
2015-03-03 00:00:00 +00:00
|
|
|
this.loadImage("battle/action-tooltip.png");
|
2017-01-08 22:04:07 +00:00
|
|
|
this.loadImage("battle/actionpointsnone.png");
|
2015-02-04 00:00:00 +00:00
|
|
|
this.loadImage("battle/actionpointsempty.png");
|
|
|
|
this.loadImage("battle/actionpointsfull.png");
|
2015-04-28 16:35:48 +00:00
|
|
|
this.loadImage("battle/actionpointspart.png");
|
2017-01-11 00:38:08 +00:00
|
|
|
this.loadImage("battle/ship-tooltip-own.png");
|
|
|
|
this.loadImage("battle/ship-tooltip-enemy.png");
|
2017-01-16 23:20:33 +00:00
|
|
|
this.loadImage("battle/ship-tooltip-effect.png");
|
2017-01-10 00:22:59 +00:00
|
|
|
this.loadImage("battle/arena/ship-hover.png");
|
|
|
|
this.loadImage("battle/arena/ship-normal-enemy.png");
|
|
|
|
this.loadImage("battle/arena/ship-normal-own.png");
|
|
|
|
this.loadImage("battle/arena/ship-playing-enemy.png");
|
|
|
|
this.loadImage("battle/arena/ship-playing-own.png");
|
2015-02-04 00:00:00 +00:00
|
|
|
this.loadImage("battle/actions/move.png");
|
2015-02-23 00:00:00 +00:00
|
|
|
this.loadImage("battle/actions/endturn.png");
|
|
|
|
this.loadImage("battle/actions/fire-gatlinggun.png");
|
2017-01-12 23:57:28 +00:00
|
|
|
this.loadImage("battle/actions/fire-energydepleter.png");
|
|
|
|
this.loadImage("battle/actions/fire-submunitionmissile.png");
|
2015-02-20 00:00:00 +00:00
|
|
|
this.loadImage("battle/weapon/bullet.png");
|
2015-02-04 00:00:00 +00:00
|
|
|
this.loadImage("common/standard-bar-background.png");
|
|
|
|
this.loadImage("common/standard-bar-foreground.png");
|
2015-03-19 00:00:00 +00:00
|
|
|
this.loadImage("map/star-icon.png");
|
2015-03-25 00:00:00 +00:00
|
|
|
this.loadImage("map/fleet-icon.png");
|
2015-03-24 00:00:00 +00:00
|
|
|
this.loadImage("map/planet-icon.png");
|
|
|
|
this.loadImage("map/warp-icon.png");
|
|
|
|
this.loadImage("map/button-back.png");
|
2015-03-27 00:00:00 +00:00
|
|
|
this.loadImage("map/button-jump.png");
|
2015-02-16 00:00:00 +00:00
|
|
|
|
2015-04-26 09:21:55 +00:00
|
|
|
// Load ships
|
|
|
|
this.loadShip("scout");
|
|
|
|
this.loadShip("whirlwind");
|
|
|
|
|
2015-02-16 00:00:00 +00:00
|
|
|
// Load sounds
|
|
|
|
this.loadSound("battle/ship-change.wav");
|
2015-02-20 00:00:00 +00:00
|
|
|
this.loadSound("battle/weapon-bullets.wav");
|
2015-04-22 21:42:40 +00:00
|
|
|
|
|
|
|
// Load musics
|
|
|
|
this.loadSound("music/walking-along.mp3");
|
|
|
|
this.loadSound("music/full-on.mp3");
|
2014-12-29 00:00:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
create() {
|
2015-03-12 00:00:00 +00:00
|
|
|
this.game.state.start("mainmenu");
|
2014-12-29 00:00:00 +00:00
|
|
|
}
|
2015-02-04 00:00:00 +00:00
|
|
|
|
2015-04-26 09:21:55 +00:00
|
|
|
private loadShip(name: string) {
|
|
|
|
this.loadImage("ship/" + name + "/sprite.png");
|
|
|
|
this.loadImage("ship/" + name + "/portrait.png");
|
|
|
|
}
|
|
|
|
|
2015-02-04 00:00:00 +00:00
|
|
|
private loadImage(path: string) {
|
|
|
|
this.load.image(path.replace(/\//g, "-").replace(".png", "").replace(".jpg", ""), "assets/images/" + path);
|
|
|
|
}
|
2015-02-16 00:00:00 +00:00
|
|
|
|
|
|
|
private loadSound(path: string) {
|
2015-04-22 21:42:40 +00:00
|
|
|
var key = path.replace(/\//g, "-").replace(".wav", "").replace(".mp3", "");
|
2015-02-16 00:00:00 +00:00
|
|
|
this.load.audio(key, "assets/sounds/" + path);
|
|
|
|
}
|
2014-12-29 00:00:00 +00:00
|
|
|
}
|
|
|
|
}
|