mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 13:43:26 +00:00
25 lines
476 B
TypeScript
25 lines
476 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",1,false);
|
||
|
this.music.play("titleMusic",0);
|
||
|
|
||
|
this.add.sprite(0,0,"titlepage");
|
||
|
|
||
|
this.playButton = this.add.button(200,300,"playButton", this.startGame, 1, 1, 1);
|
||
|
}
|
||
|
|
||
|
startGame():void {
|
||
|
this.music.stop();
|
||
|
alert("START THE GAME!");
|
||
|
}
|
||
|
}
|
||
|
}
|