Sauvegarde des infos des stats du robot en json - Recharger la page en changeant de langue garde les stats du robots - Réessayer un niveau à la fin de celui-ci garde notre arbre d'action et nos statistiques - Modification de HealthBar pour implémenter l'écriture dans la barre - Implémentation de l'écriture "Bouclier" et "Vie" dans leurs barres respectives - L'edition d'action est normalement fonctionnelle - Création des boutons modifier en anglais et en français
parent
680ed6088d
commit
29a70f9c78
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 22 KiB |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,40 @@
|
||||
class InitStat {
|
||||
constructor(scene, posX, posY, width, height, valueMax) {
|
||||
this.scene = scene;
|
||||
this.posX = posX;
|
||||
this.posY = posY;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.category = new CategoryBar(valueMax);
|
||||
this.lBar = [];
|
||||
this.lText = [];
|
||||
this.category.addText(this.scene, selectWord("TOKENS : ", "JETONS : "), this.posX, this.posY, this.height);
|
||||
}
|
||||
|
||||
addBar(value, valueMax, color, text) {
|
||||
this.lText.push(text);
|
||||
this.lBar.push(new Bar(this.scene, selectWord(text[0], text[1]), this.width, this.height, this.posX, this.posY, color, this.category, value, valueMax));
|
||||
this.posY += this.height * 1.5;
|
||||
this.category.setTextPos(this.posX, this.posY);
|
||||
}
|
||||
|
||||
getJson() {
|
||||
let json = '{';
|
||||
json += '"lBar":[';
|
||||
this.lBar.forEach(bar => json += bar.getJson() + ',');
|
||||
json = endLineJson(json) + '],';
|
||||
json += '"lText":[';
|
||||
this.lText.forEach(text => {
|
||||
json += '[';
|
||||
text.forEach(word => {
|
||||
json += '"' + word + '",';
|
||||
});
|
||||
json = endLineJson(json);
|
||||
json += '],';
|
||||
});
|
||||
json = endLineJson(json);
|
||||
json += ']';
|
||||
json += '}';
|
||||
return json;
|
||||
}
|
||||
}
|
Loading…
Reference in new issue