-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsc_game_over.js
68 lines (57 loc) · 2.02 KB
/
sc_game_over.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
var sc_game_over = new Phaser.Class({
Extends: Phaser.Scene,
initialize:
function sc_game_over(){
Phaser.Scene.call(this, { key: 'sc_game_over'});
},
preload (){
},
create (){
//FINALES
//Final 1 - toca tierra
if (ending === 1){
texto2 = this.add.text(650,520, 'The satellite re-entered the The Earth, \nburning through the atmosphere \nand leaving no remains', {
fontSize: '40px',
fill: '#848484'
})};
//Final 2 - toca basura
if (ending === 2){
texto2 = this.add.text(610,520, 'The satellite got hit and was destroyed, \nincreasing the amount of scrap in orbit', {
fontSize: '40px',
fill: '#848484'
})};
//Final 3 - estacion destruida
if (ending === 3){
texto2 = this.add.text(650,520, 'The International Space Station was destroyed!', {
fontSize: '40px',
fill: '#848484'
})};
//Final 4 - ????
if (ending === 4 || ending === 0){
texto2 = this.add.text(650,520, 'The satellite left The Earth\'s sphere of\n gravitational influence and you\nlost communications with it.', {
fontSize: '40px',
fill: '#848484'
})};
//PUNTAJE FINAL
texto1 = this.add.text(800, 150, ' GAME OVER\n Final Score: ' + score, {
fontSize: '50px',
fill: '#c96520'
});
//BOTON RETRODECER
back = this.add.text(game.config.width -300, game.config.height - 50, 'GO TO MENU', {
fontSize: '40px',
fill: '#ffffff'
}).setOrigin(0.0).setInteractive();
back.on('pointerover', function() {
back.setTint(0x554bbb);
});
back.on('pointerout', function() {
back.clearTint();
});
back.on('pointerdown', ()=>{
this.scene.start('sc_menu')
});
},
update(){
},
});