2015-04-07 00:00:00 +00:00
|
|
|
/// <reference path="BaseView.ts"/>
|
|
|
|
|
2017-01-26 23:52:45 +00:00
|
|
|
module TS.SpaceTac.View {
|
2015-04-07 00:00:00 +00:00
|
|
|
export class Preload extends BaseView {
|
2017-01-22 17:00:59 +00:00
|
|
|
private preloadBar: Phaser.Image;
|
2014-12-29 00:00:00 +00:00
|
|
|
|
|
|
|
preload() {
|
2014-12-30 00:00:00 +00:00
|
|
|
// Add preload sprite
|
2017-01-22 17:00:59 +00:00
|
|
|
let bg = this.add.image(678, 426, "preload-background");
|
|
|
|
this.preloadBar = this.add.image(684, bg.y + 166, "preload-bar");
|
2014-12-30 00:00:00 +00:00
|
|
|
this.load.setPreloadSprite(this.preloadBar);
|
|
|
|
|
2015-02-16 00:00:00 +00:00
|
|
|
// Load images
|
2017-01-22 16:17:59 +00:00
|
|
|
this.loadImage("menu/title.png");
|
2015-03-12 00:00:00 +00:00
|
|
|
this.loadImage("menu/button.png");
|
2017-01-23 18:12:36 +00:00
|
|
|
this.loadImage("menu/button-hover.png");
|
2017-01-22 17:41:32 +00:00
|
|
|
this.loadImage("menu/star.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");
|
|
|
|
this.loadImage("battle/action-inactive.png");
|
|
|
|
this.loadImage("battle/action-active.png");
|
2017-01-19 23:39:13 +00:00
|
|
|
this.loadImage("battle/action-selected.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-02-05 21:41:06 +00:00
|
|
|
this.loadImage("battle/actions/fire-powerdepleter.png");
|
2017-01-12 23:57:28 +00:00
|
|
|
this.loadImage("battle/actions/fire-submunitionmissile.png");
|
2017-02-08 00:18:54 +00:00
|
|
|
this.loadImage("battle/actions/deploy-repairdrone.png");
|
2015-02-20 00:00:00 +00:00
|
|
|
this.loadImage("battle/weapon/bullet.png");
|
2017-02-05 21:41:06 +00:00
|
|
|
this.loadImage("battle/attributes/power.png");
|
|
|
|
this.loadImage("battle/attributes/effect-increase.png");
|
|
|
|
this.loadImage("battle/attributes/effect-decrease.png");
|
|
|
|
this.loadImage("battle/attributes/effect-limit.png");
|
2015-02-04 00:00:00 +00:00
|
|
|
this.loadImage("common/standard-bar-background.png");
|
|
|
|
this.loadImage("common/standard-bar-foreground.png");
|
2017-01-26 00:01:31 +00:00
|
|
|
this.loadImage("map/starsystem-background.png");
|
|
|
|
this.loadImage("map/zoom-in.png");
|
|
|
|
this.loadImage("map/zoom-out.png");
|
2017-01-26 23:01:04 +00:00
|
|
|
this.loadImage("map/location-star.png");
|
|
|
|
this.loadImage("map/location-planet.png");
|
|
|
|
this.loadImage("map/location-warp.png");
|
|
|
|
this.loadImage("map/state-unknown.png");
|
|
|
|
this.loadImage("map/state-enemy.png");
|
|
|
|
this.loadImage("map/state-clear.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");
|
2017-01-22 17:00:59 +00:00
|
|
|
this.load.start();
|
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
|
|
|
}
|
|
|
|
}
|