mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 13:43:26 +00:00
24 lines
No EOL
459 B
TypeScript
24 lines
No EOL
459 B
TypeScript
/// <reference path="phaser.d.ts" />
|
|
|
|
module BasicGame
|
|
{
|
|
export class MainMenu extends Phaser.State{
|
|
music:Phaser.Sound;
|
|
playButton:Phaser.Button;
|
|
|
|
create():void {
|
|
|
|
this.music = this.add.audio("titleMusic");
|
|
this.music.play();
|
|
|
|
this.add.sprite(0,0,"titlepage");
|
|
|
|
this.playButton = this.add.button(200,300,"playButton", this.startGame, this);
|
|
}
|
|
|
|
startGame():void {
|
|
this.music.stop();
|
|
this.game.state.start("GameState");
|
|
}
|
|
}
|
|
} |