2013-11-13 09:26:15 +00:00
|
|
|
/// <reference path="phaser.d.ts" />
|
|
|
|
|
|
|
|
module BasicGame
|
|
|
|
{
|
2013-11-15 21:50:41 +00:00
|
|
|
export class MainMenu extends Phaser.State{
|
2013-11-13 09:26:15 +00:00
|
|
|
music:Phaser.Sound;
|
|
|
|
playButton:Phaser.Button;
|
|
|
|
|
|
|
|
create():void {
|
|
|
|
|
2013-11-15 21:50:41 +00:00
|
|
|
this.music = this.add.audio("titleMusic");
|
|
|
|
this.music.play();
|
2013-11-13 09:26:15 +00:00
|
|
|
|
|
|
|
this.add.sprite(0,0,"titlepage");
|
|
|
|
|
2013-11-15 21:50:41 +00:00
|
|
|
this.playButton = this.add.button(200,300,"playButton", this.startGame, this);
|
2013-11-13 09:26:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
startGame():void {
|
|
|
|
this.music.stop();
|
2013-11-15 21:50:41 +00:00
|
|
|
this.game.state.start("GameState");
|
2013-11-13 09:26:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|