-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscene1.js
More file actions
49 lines (37 loc) · 1.25 KB
/
scene1.js
File metadata and controls
49 lines (37 loc) · 1.25 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//Main Menu
scenes.scene1 = function(){};
scenes.scene1.prototype = {
create: function (){
game.add.sprite(0,0, 'title');
var text1 = "Play"
var text2 = "Instructions"
var text3 = "Highscores"
sound = game.add.audio('pop');
sound.addMarker('blep', 0, 0.1);
var b1 = game.add.button(900,150, 'button', function() {
changeState(null, 2);
});
var b2 = game.add.button(900,350, 'button', function() {
changeState(null, 3);
});
var b3 = game.add.button(900,550, 'button', function() {});
b1.onInputDown.add(this.tint, b1);
b2.onInputDown.add(this.tint, b2);
b3.onInputDown.add(this.tint, b3);
b1.onInputUp.add(this.unTint, b1);
b2.onInputUp.add(this.unTint, b2);
b3.onInputUp.add(this.unTint, b3);
game.add.text(975,240, text1);
game.add.text(935,440, text2);
game.add.text(935,640, text3);
},
update: function (){
},
tint: function() {
this.tint = 0xbbbbbb;
sound.play('blep');
},
unTint: function() {
this.tint = 0xFFFFFF;
}
};