-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsuccess.js
40 lines (30 loc) · 2.03 KB
/
success.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
BasicGame.Success = function (game) {
};
BasicGame.Success.prototype = {
create: function () {
this.add.sprite(0, 0, 'empty');
if (localStorage.getItem('done') == 'firstLvl'){
this.loadingText = this.add.text(this.game.width / 4 , this.game.height / 2, "Bravo!", { font: "30px monospace", fill: "#fff" });
this.loadingText = this.add.text(this.game.width / 4, this.game.height / 2 + 40, "Tu as obtenu ton bac.", { font: "30px monospace", fill: "#fff" });
this.loadingText = this.add.text(this.game.width / 2, this.game.height / 2 + 100, "Clique pour continuer tes études.", { font: "20px monospace", fill: "#fff" });
} else if (localStorage.getItem('done') == 'secondLvl'){
this.loadingText = this.add.text(this.game.width / 4, this.game.height / 2, "Bravo!", { font: "30px monospace", fill: "#fff" });
this.loadingText = this.add.text(this.game.width / 4, this.game.height / 2 + 40, "Tu as réussi tes études.", { font: "30px monospace", fill: "#fff" });
this.loadingText = this.add.text(this.game.width / 2, this.game.height / 2 + 100, "Clique pour chercher du boulot.", { font: "20px monospace", fill: "#fff" });
} else if (localStorage.getItem('done') == 'thirdLvl'){
this.loadingText = this.add.text(this.game.width / 4, this.game.height / 2, "Bravo!", { font: "30px monospace", fill: "#fff" });
this.loadingText = this.add.text(this.game.width / 4, this.game.height / 2 + 40, "Tu as trouvé un boulot.", { font: "30px monospace", fill: "#fff" });
this.loadingText = this.add.text(this.game.width / 2, this.game.height / 2 + 100, "Clique pour recommencer.", { font: "20px monospace", fill: "#fff" });
}
this.loadingText.anchor.setTo(0.5, 0.5);
},
update: function () {
if (this.input.activePointer.isDown) {
if (localStorage.getItem('done') == 'firstLvl' || localStorage.getItem('done') == 'secondLvl'){
this.state.start('FirstLvl');
} else if (localStorage.getItem('done') == 'thirdLvl'){
this.state.start('MainMenu');
}
}
},
};