-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenu.js
30 lines (23 loc) · 971 Bytes
/
menu.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
'use strict';
function Menu() {}
Menu.prototype = {
preload: function() {
},
create: function() {
var style = { font: '65px Arial', fill: '#ffffff', align: 'center'};
this.sprite = this.game.add.sprite(this.game.world.centerX, 138, 'yeoman');
this.sprite.anchor.setTo(0.5, 0.5);
this.titleText = this.game.add.text(this.game.world.centerX, 300, '\'Allo, \'Allo!', style);
this.titleText.anchor.setTo(0.5, 0.5);
this.instructionsText = this.game.add.text(this.game.world.centerX, 400, 'Click anywhere to play "Click The Yeoman Logo"', { font: '16px Arial', fill: '#ffffff', align: 'center'});
this.instructionsText.anchor.setTo(0.5, 0.5);
this.sprite.angle = -20;
this.game.add.tween(this.sprite).to({angle: 20}, 1000, Phaser.Easing.Linear.NONE, true, 0, 1000, true);
},
update: function() {
if(this.game.input.activePointer.justPressed()) {
this.game.state.start('play');
}
}
};
module.exports = Menu;