-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstate11.js
More file actions
35 lines (32 loc) · 1.42 KB
/
state11.js
File metadata and controls
35 lines (32 loc) · 1.42 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
demo.state11 = function(){};
demo.state11.prototype = {
preload: function(){
game.load.image('bullet', 'assets/sprites/bullet.png', 62,19);
game.load.image('deaddetective', 'assets/sprites/deaddetective.png', 256,256);
},
create: function(){
//game.physics.startSystem(Phaser.Physics.ARCADE);
//game.world.setBounds(0,0,640,640);
game.stage.backgroundColor = '#6b6e5e';
console.log('state11');
game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;
var bullet = game.add.sprite(220,320,'bullet')
bullet = game.add.sprite(300,320,'bullet')
bullet = game.add.sprite(380,320,'bullet')
bullet = game.add.sprite(460,320,'bullet')
bullet = game.add.sprite(540,320,'bullet')
ripdetective = game.add.sprite(290, 350,'deaddetective');
var riptext = game.add.text(165, 230, 'UH-OH! YOU RAN OUT OF BULLETS!', {fill: '#e7edcc'});
riptext.font = 'Monaco', 'Monospace';
riptext = game.add.text(330, 270, 'TRY AGAIN!', {fill: '#e7edcc'});
riptext.font = 'Monaco', 'Monospace';
riptext = game.add.text(500, 700, 'PRESS ENTER TO TRY AGAIN!', {fill: '#e7edcc'});
riptext.font = 'Monaco', 'Monospace';
riptext.fontSize = '18px'
},
update: function(){
if(game.input.keyboard.isDown(Phaser.Keyboard.ENTER)){
game.state.start('state9');
}
}
}