-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathfailure.js
More file actions
44 lines (32 loc) · 2.13 KB
/
failure.js
File metadata and controls
44 lines (32 loc) · 2.13 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
BasicGame.Failure = function (game) {
};
BasicGame.Failure.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, "Désolé!", { font: "30px monospace", fill: "#fff" });
this.loadingText = this.add.text(this.game.width / 4, this.game.height / 2 + 40, "Tu n'as pas eu le bac.", { 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" });
} else if (localStorage.getItem('done') == 'secondLvl'){
this.loadingText = this.add.text(this.game.width / 4, this.game.height / 2, "Désolé!", { font: "30px monospace", fill: "#fff" });
this.loadingText = this.add.text(this.game.width / 4, this.game.height / 2 + 40, "Tu n'as pas eu ton diplôme.", { 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" });
} else if (localStorage.getItem('done') == 'thirdLvl'){
this.loadingText = this.add.text(this.game.width / 4, this.game.height / 2, "Désolé!", { font: "30px monospace", fill: "#fff" });
this.loadingText = this.add.text(this.game.width / 4, this.game.height / 2 + 40, "Ton profil ne convient pas.", { 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);
infoButton = this.game.add.button(this.game.width - 50, 10, 'question', function() {
window.open("http://www.inegalites.fr/", "_blank");
}, this);
bonusButton = this.game.add.button(this.game.width - 70, this.game.height - 70, 'simplon', function() {
this.state.start('Bonus');
}, this);
},
update: function () {
if (this.input.activePointer.isDown) {
this.state.start('MainMenu');
}
},
};