2
0
Fork 0
mirror of https://github.com/photonstorm/phaser synced 2024-12-19 09:34:02 +00:00
phaser/wip/examples/state/MainMenu.js
2013-09-13 17:48:47 +01:00

30 lines
547 B
JavaScript

TestGame.MainMenu = function (game) {
// Our main menu
this.game = game;
};
TestGame.MainMenu.prototype = {
create: function () {
var bg = this.game.add.sprite(0, 100, 'nocooper');
bg.scale.setTo(2.5, 2.5);
var t = this.game.add.sprite(100, 600, 'touhou');
t.anchor.setTo(0, 1);
button = this.game.add.button(this.game.world.centerX, 400, 'button', this.startGame, this, 2, 1, 0);
button.anchor.setTo(0.5, 0.5);
},
startGame: function () {
console.log('lets play');
this.game.state.start('game');
}
}