2015-04-07 00:00:00 +00:00
|
|
|
/// <reference path="BaseView.ts"/>
|
|
|
|
|
2017-02-09 00:00:35 +00:00
|
|
|
module TS.SpaceTac.UI {
|
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");
|
2017-05-02 22:49:35 +00:00
|
|
|
this.loadImage("menu/load-bg.png");
|
2017-05-03 18:12:13 +00:00
|
|
|
this.loadImage("common/transparent.png");
|
|
|
|
this.loadImage("common/debug.png");
|
2017-05-02 22:49:35 +00:00
|
|
|
this.loadImage("common/waiting.png");
|
|
|
|
this.loadImage("common/arrow.png");
|
|
|
|
this.loadImage("common/button-ok.png");
|
|
|
|
this.loadImage("common/button-cancel.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-02-19 21:33:07 +00:00
|
|
|
this.loadImage("battle/power-available.png");
|
|
|
|
this.loadImage("battle/power-using.png");
|
|
|
|
this.loadImage("battle/power-used.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-02-15 22:34:27 +00:00
|
|
|
this.loadImage("battle/ship-tooltip-stasis.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");
|
2017-02-15 22:34:27 +00:00
|
|
|
this.loadImage("battle/arena/stasis.png");
|
2017-05-09 18:17:49 +00:00
|
|
|
this.loadImage("battle/arena/target.png");
|
|
|
|
this.loadImage("battle/arena/blast.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");
|
2017-02-13 19:31:45 +00:00
|
|
|
this.loadImage("battle/weapon/default.png");
|
|
|
|
this.loadImage("battle/weapon/bullets.png");
|
|
|
|
this.loadImage("battle/weapon/hot.png");
|
|
|
|
this.loadImage("battle/weapon/shield-impact.png");
|
2017-02-15 16:41:24 +00:00
|
|
|
this.loadImage("battle/weapon/blast.png");
|
2017-02-05 21:41:06 +00:00
|
|
|
this.loadImage("battle/attributes/power.png");
|
2017-02-12 22:18:36 +00:00
|
|
|
this.loadImage("battle/attributes/powercapacity.png");
|
2017-03-05 14:12:08 +00:00
|
|
|
this.loadImage("battle/attributes/hull.png");
|
|
|
|
this.loadImage("battle/attributes/hullcapacity.png");
|
|
|
|
this.loadImage("battle/attributes/shield.png");
|
|
|
|
this.loadImage("battle/attributes/shieldcapacity.png");
|
2017-02-05 21:41:06 +00:00
|
|
|
this.loadImage("battle/attributes/effect-increase.png");
|
|
|
|
this.loadImage("battle/attributes/effect-decrease.png");
|
|
|
|
this.loadImage("battle/attributes/effect-limit.png");
|
2017-03-12 23:32:41 +00:00
|
|
|
this.loadImage("battle/outcome/dialog.png");
|
|
|
|
this.loadImage("battle/outcome/title-victory.png");
|
|
|
|
this.loadImage("battle/outcome/title-defeat.png");
|
|
|
|
this.loadImage("battle/outcome/button-menu.png");
|
|
|
|
this.loadImage("battle/outcome/button-map.png");
|
|
|
|
this.loadImage("battle/outcome/button-revert.png");
|
|
|
|
this.loadImage("battle/outcome/button-loot.png");
|
2017-01-26 00:01:31 +00:00
|
|
|
this.loadImage("map/starsystem-background.png");
|
2017-03-15 23:45:52 +00:00
|
|
|
this.loadImage("map/current-location.png");
|
2017-01-26 00:01:31 +00:00
|
|
|
this.loadImage("map/zoom-in.png");
|
|
|
|
this.loadImage("map/zoom-out.png");
|
2017-05-10 16:49:08 +00:00
|
|
|
this.loadImage("map/name.png");
|
2017-02-09 19:16:49 +00:00
|
|
|
this.loadImage("map/button-jump.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");
|
2017-03-23 18:58:09 +00:00
|
|
|
this.loadImage("map/state-shop.png");
|
2017-02-27 23:36:12 +00:00
|
|
|
this.loadImage("character/sheet.png");
|
|
|
|
this.loadImage("character/close.png");
|
|
|
|
this.loadImage("character/ship.png");
|
|
|
|
this.loadImage("character/ship-selected.png");
|
2017-03-17 00:07:00 +00:00
|
|
|
this.loadImage("character/skill-upgrade.png");
|
2017-02-27 23:36:12 +00:00
|
|
|
this.loadImage("character/cargo-slot.png");
|
|
|
|
this.loadImage("character/equipment-slot.png");
|
2017-02-28 22:34:02 +00:00
|
|
|
this.loadImage("character/slot-power.png");
|
2017-03-05 14:12:08 +00:00
|
|
|
this.loadImage("character/slot-hull.png");
|
|
|
|
this.loadImage("character/slot-shield.png");
|
|
|
|
this.loadImage("character/slot-engine.png");
|
|
|
|
this.loadImage("character/slot-weapon.png");
|
2017-04-06 18:05:20 +00:00
|
|
|
this.loadImage("character/upgrade-available.png");
|
2017-03-23 18:58:09 +00:00
|
|
|
this.loadImage("character/price-tag.png");
|
2017-05-09 17:19:26 +00:00
|
|
|
this.loadImage("character/experience.png");
|
2017-03-07 00:28:40 +00:00
|
|
|
this.loadImage("equipment/ironhull.png");
|
2017-04-18 22:55:59 +00:00
|
|
|
this.loadImage("equipment/forcefield.png");
|
|
|
|
this.loadImage("equipment/nuclearreactor.png");
|
|
|
|
this.loadImage("equipment/rocketengine.png");
|
2015-02-16 00:00:00 +00:00
|
|
|
|
2015-04-26 09:21:55 +00:00
|
|
|
// Load ships
|
|
|
|
this.loadShip("scout");
|
2017-05-14 20:07:33 +00:00
|
|
|
this.loadShip("breeze");
|
|
|
|
this.loadShip("creeper");
|
2015-04-26 09:21:55 +00:00
|
|
|
this.loadShip("whirlwind");
|
2017-04-15 21:16:55 +00:00
|
|
|
this.loadShip("tomahawk");
|
2017-05-14 20:07:33 +00:00
|
|
|
this.loadShip("avenger");
|
|
|
|
this.loadShip("commodore");
|
|
|
|
this.loadShip("falcon");
|
2015-04-26 09:21:55 +00:00
|
|
|
|
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
|
|
|
|
2017-02-10 00:08:28 +00:00
|
|
|
loadShip(name: string) {
|
2015-04-26 09:21:55 +00:00
|
|
|
this.loadImage("ship/" + name + "/sprite.png");
|
|
|
|
this.loadImage("ship/" + name + "/portrait.png");
|
|
|
|
}
|
|
|
|
|
2017-02-10 00:08:28 +00:00
|
|
|
loadImage(path: string) {
|
2015-02-04 00:00:00 +00:00
|
|
|
this.load.image(path.replace(/\//g, "-").replace(".png", "").replace(".jpg", ""), "assets/images/" + path);
|
|
|
|
}
|
2015-02-16 00:00:00 +00:00
|
|
|
|
2017-02-10 00:08:28 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|