Ajout de l'image du bouton de sauvegarde - Création des fichiers json qui serviront à charger les niveaux du jeux - Pour le moment, l'arbre d'action et les stats initials sont chargés depuis un fichier json - L'arbre se charge automatiquement en placant les actions au bon endroit et dans le bon ordre - création des constantes CENTERX_TREE, OFFX_TREE et OFFY_TREE dans le but de gérer la disposition et l'écartement des actions - Suppression du code en dur de la création de l'arbre initial. Dorénavant, tout les arbres initiaux sot issus d'un fichier json) - Ajout d'un bouton sauvegarder en bas à droite de l'écran dans le but d'afficher dans la console la sauvegarde json de l'arbre et des stats du robot - Chaque type de partie (TEAM, FLAG ...) possède dorénavant son propre fichier json (level1, level2, level3, level4, level5)

master
clmaisonha 5 years ago
parent 184fd823c3
commit 20c3716b7d

@ -3,8 +3,18 @@ module.exports = function (grunt) {
copy: {
main: {
files: [
{expand: false, src: ['node_modules/jquery/dist/jquery.min.js'], dest: 'public/js/jquery.min.js', filter: 'isFile'},
{expand: false, src: ['node_modules/phaser/dist/phaser.min.js'], dest: 'public/js/phaser.min.js', filter: 'isFile'},
{
expand: false,
src: ['node_modules/jquery/dist/jquery.min.js'],
dest: 'public/js/jquery.min.js',
filter: 'isFile'
},
{
expand: false,
src: ['node_modules/phaser/dist/phaser.min.js'],
dest: 'public/js/phaser.min.js',
filter: 'isFile'
},
],
},
},
@ -29,14 +39,28 @@ module.exports = function (grunt) {
'public/css//app.min.css': ['src/css/*.css']
}
}
},
minjson: {
compile: {
files: {
'public/json//level1.json': ['src/json/level1.json'],
'public/json//level2.json': ['src/json/level2.json'],
'public/json//level3.json': ['src/json/level3.json'],
'public/json//level4.json': ['src/json/level4.json'],
'public/json//level5.json': ['src/json/level5.json']
}
}
}
})
grunt.loadNpmTasks('grunt-minjson');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify-es');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.registerTask('json', ['minjson']);
grunt.registerTask('cp', ['copy']);
grunt.registerTask('ugl', ['uglify', 'cssmin']);
grunt.registerTask('default', ['cp', 'ugl']);
grunt.registerTask('default', ['cp', 'ugl', 'json']);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

@ -663,11 +663,6 @@
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
}
},
"path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
}
}
},
@ -741,13 +736,6 @@
"minimatch": "^3.0.4",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
},
"dependencies": {
"path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
}
}
},
"global-modules": {
@ -779,9 +767,9 @@
"dev": true
},
"grunt": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/grunt/-/grunt-1.2.0.tgz",
"integrity": "sha512-uGMrucC+isjLBEcEyQjaSj41ehhePr07uCykQFJR0ciKs9kDsLdr1L976+v5aFsLB+l0n7JoWpovs941xbI9MA==",
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/grunt/-/grunt-1.2.1.tgz",
"integrity": "sha512-zgJjn9N56tScvRt/y0+1QA+zDBnKTrkpyeSBqQPLcZvbqTD/oyGMrdZQXmm6I3828s+FmPvxc3Xv+lgKFtudOw==",
"requires": {
"dateformat": "~3.0.3",
"eventemitter2": "~0.4.13",
@ -797,7 +785,6 @@
"minimatch": "~3.0.4",
"mkdirp": "~1.0.4",
"nopt": "~3.0.6",
"path-is-absolute": "~2.0.0",
"rimraf": "~3.0.2"
},
"dependencies": {
@ -1011,6 +998,72 @@
"which": "~1.3.0"
}
},
"grunt-minjson": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/grunt-minjson/-/grunt-minjson-0.4.0.tgz",
"integrity": "sha1-I5PO+bADVrur6pB9Zc33fHYoCkQ=",
"dev": true,
"requires": {
"maxmin": "^2.1.0"
},
"dependencies": {
"ansi-styles": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
"integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
"dev": true
},
"chalk": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
"dev": true,
"requires": {
"ansi-styles": "^2.2.1",
"escape-string-regexp": "^1.0.2",
"has-ansi": "^2.0.0",
"strip-ansi": "^3.0.0",
"supports-color": "^2.0.0"
}
},
"gzip-size": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-3.0.0.tgz",
"integrity": "sha1-VGGI6b3DN/Zzdy+BZgRks4nc5SA=",
"dev": true,
"requires": {
"duplexer": "^0.1.1"
}
},
"maxmin": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/maxmin/-/maxmin-2.1.0.tgz",
"integrity": "sha1-TTsiCQPZXu5+t6x/qGTnLcCaMWY=",
"dev": true,
"requires": {
"chalk": "^1.0.0",
"figures": "^1.0.1",
"gzip-size": "^3.0.0",
"pretty-bytes": "^3.0.0"
}
},
"pretty-bytes": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-3.0.1.tgz",
"integrity": "sha1-J9AAjXeAY6C0gRuzXHnxvV1fvM8=",
"dev": true,
"requires": {
"number-is-nan": "^1.0.0"
}
},
"supports-color": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
"dev": true
}
}
},
"gzip-size": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-1.0.0.tgz",
@ -1377,9 +1430,9 @@
}
},
"lodash": {
"version": "4.17.15",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A=="
"version": "4.17.19",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ=="
},
"loud-rejection": {
"version": "1.6.0",
@ -1732,9 +1785,9 @@
}
},
"path-is-absolute": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-2.0.0.tgz",
"integrity": "sha512-ajROpjq1SLxJZsgSVCcVIt+ZebVH+PwJtPnVESjfg6JKwJGwAgHRC3zIcjvI0LnecjIHCJhtfNZ/Y/RregqyXg=="
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
},
"path-parse": {
"version": "1.0.6",

@ -9,13 +9,14 @@
"author": "Clément Maisonhaute",
"license": "ISC",
"dependencies": {
"grunt": "^1.2.0",
"grunt": "^1.2.1",
"jquery": "^3.5.1",
"phaser": "^3.23.0"
},
"devDependencies": {
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-cssmin": "^3.0.0",
"grunt-contrib-uglify-es": "^3.3.0"
"grunt-contrib-uglify-es": "^3.3.0",
"grunt-minjson": "^0.4.0"
}
}

File diff suppressed because one or more lines are too long

@ -0,0 +1 @@
{"tree":{"type":"waria","lRect":[{"type":"move","option":[true,false]},{"type":"attack","option":[0.3333333333333333]},{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lRect":[{"type":"move","option":[false,true]},{"type":"attack","option":[1]}]},{"type":"move","option":[true,true]}]},"initStat":{"lBar":[{"value":2,"valueMax":5,"color":16711680,"colorMin":16711680},{"value":3,"valueMax":5,"color":8323327,"colorMin":8323327},{"value":3,"valueMax":5,"color":255,"colorMin":255},{"value":2,"valueMax":5,"color":32768,"colorMin":32768}],"lText":[["DAMAGE","DEGATS"],["R.S","RECHARGEMENT"],["SPEED","VITESSE"],["RANGE","PORTEE"]]}}

@ -0,0 +1 @@
{"tree":{"type":"waria","lRect":[{"type":"attack","option":[0.3333333333333333]},{"type":"move","option":[true,false]},{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lRect":[{"type":"move","option":[false,true]},{"type":"attack","option":[1]}]},{"type":"move","option":[true,true]}]},"initStat":{"lBar":[{"value":3,"valueMax":5,"color":16711680,"colorMin":16711680},{"value":2,"valueMax":5,"color":8323327,"colorMin":8323327},{"value":0,"valueMax":5,"color":255,"colorMin":255},{"value":5,"valueMax":5,"color":32768,"colorMin":32768}],"lText":[["DAMAGE","DEGATS"],["R.S","RECHARGEMENT"],["SPEED","VITESSE"],["RANGE","PORTEE"]]}}

@ -0,0 +1 @@
{"tree":{"type":"waria","lRect":[{"type":"attack","option":[0.3333333333333333]},{"type":"condition","option":[false,false,true,0.3333333333333333,1],"lRect":[{"type":"move","option":[false,true]},{"type":"attack","option":[1]}]},{"type":"move","option":[true,false]},{"type":"move","option":[true,true]}]},"initStat":{"lBar":[{"value":5,"valueMax":5,"color":16711680,"colorMin":16711680},{"value":0,"valueMax":5,"color":8323327,"colorMin":8323327},{"value":0,"valueMax":5,"color":255,"colorMin":255},{"value":5,"valueMax":5,"color":32768,"colorMin":32768}],"lText":[["DAMAGE","DEGATS"],["R.S","RECHARGEMENT"],["SPEED","VITESSE"],["RANGE","PORTEE"]]}}

@ -0,0 +1 @@
{"tree":{"type":"waria","lRect":[{"type":"condition","option":[false,false,true,0.3333333333333333,1],"lRect":[{"type":"move","option":[false,true]},{"type":"attack","option":[1]}]},{"type":"attack","option":[0.3333333333333333]},{"type":"move","option":[true,false]},{"type":"move","option":[true,true]}]},"initStat":{"lBar":[{"value":5,"valueMax":5,"color":16711680,"colorMin":16711680},{"value":5,"valueMax":5,"color":8323327,"colorMin":8323327},{"value":0,"valueMax":5,"color":255,"colorMin":255},{"value":0,"valueMax":5,"color":32768,"colorMin":32768}],"lText":[["DAMAGE","DEGATS"],["R.S","RECHARGEMENT"],["SPEED","VITESSE"],["RANGE","PORTEE"]]}}

@ -0,0 +1 @@
{"tree":{"type":"waria","lRect":[{"type":"attack","option":[0.3333333333333333]},{"type":"attack","option":[1]},{"type":"move","option":[true,false]},{"type":"move","option":[true,true]}]},"initStat":{"lBar":[{"value":0,"valueMax":5,"color":16711680,"colorMin":16711680},{"value":0,"valueMax":5,"color":8323327,"colorMin":8323327},{"value":5,"valueMax":5,"color":255,"colorMin":255},{"value":5,"valueMax":5,"color":32768,"colorMin":32768}],"lText":[["DAMAGE","DEGATS"],["R.S","RECHARGEMENT"],["SPEED","VITESSE"],["RANGE","PORTEE"]]}}

@ -7,7 +7,7 @@ function selectWord(en, fr) {
}
}
function newGame(father, game = new Game(father)) {
function newGame(father, level, game = new Game(father, level)) {
if (father.scene.getIndex('Game') !== -1) {
father.scene.remove('Game');
}

@ -1,18 +1,39 @@
var tree = undefined;
class Game extends ManageLang {
constructor(father, saveTree) {
constructor(father, level = "level1") {
super('Game', father);
super.addOtherScenes('GamingBoard');
SPEED_GAME = 1;
if (saveTree !== undefined) {
this.tree = JSON.parse(saveTree);
this.loadSave(this.tree);
this.level = level;
}
preload() {
if (this.cache.json.exists('level')) {
this.cache.json.remove('level');
}
this.load.json('level', 'public/json/' + this.level + '.json');
}
create() {
super.create();
if (this.tree !== undefined && this.initStat !== undefined) {
let tree = this.tree.getJson(true);
console.log(tree);
tree = JSON.parse(tree);
let initStat = this.initStat.getJson(true);
initStat = JSON.parse(initStat);
this.loadSave(tree, initStat);
} else {
let level = this.cache.json.get('level');
if (level !== undefined) {
this.loadSave(level.tree, level.initStat);
}
}
this.doLine = false;
this.gm = new GamingBoard(this);
if (this.father.scene.getIndex('GamingBoard') !== -1) {
@ -32,34 +53,6 @@ class Game extends ManageLang {
let centerX = WIDTH_WINDOW / 4 * 3;
let diffX = WIDTH_WINDOW / 10;
if (this.tree === undefined) {
this.initStat = new InitStat(this, OFFX_MAP + WIDTH_MAP + 5, OFFY_MAP, width, height, 10);
this.initStat.addBar(DAMAGE_BEGIN, 5, COLOR_ATTACK, ["DAMAGE", "DEGATS"]);
this.initStat.addBar(SPEED_RELOAD_BEGIN, 5, COLOR_SPEED_RELOAD, ["R.S", "RECHARGEMENT"]);
this.initStat.addBar(SPEED_BEGIN, 5, COLOR_MOVE, ["SPEED", "VITESSE"]);
this.initStat.addBar(RANGE_BEGIN, 5, COLOR_RANGE, ["RANGE", "PORTEE"]);
this.tree = new RectangleNode(centerX, HEIGHT_WINDOW / 10, this, 'waria');
this.tree.addRect(new RectangleNode(centerX - 2 * diffX, HEIGHT_WINDOW / 3, this, 'move', [true, false]));
this.tree.addRect(new RectangleNode(centerX + diffX, HEIGHT_WINDOW / 3, this, 'move', [true]));
this.tree.addRect(new RectangleNode(centerX, HEIGHT_WINDOW / 3, this, 'attack', [1 / 3]));
let condition = new RectangleNode(centerX - diffX, HEIGHT_WINDOW / 3, this, 'condition', [true, true, false, 1 / 3, 0]);
this.tree.addRect(condition);
condition.addRect(new RectangleNode(centerX, HEIGHT_WINDOW / 1.5, this, 'move', [false]));
condition.addRect(new RectangleNode(centerX - diffX, HEIGHT_WINDOW / 1.5, this, 'attack', [1]))
} else {
let tree = this.tree.getJson();
tree = JSON.parse(tree);
let initStat = this.initStat.getJson();
initStat = JSON.parse(initStat);
this.loadSave(tree, initStat);
}
this.gm.addRobot(new Robot(WIDTH_MAP * 0.1, WIDTH_MAP * 0.1, WIDTH_MAP * 0.9, WIDTH_MAP * 0.9, this.gm, MYSELF));
this.gm.addRobot(new Robot(WIDTH_MAP * 0.1, WIDTH_MAP * 0.1, WIDTH_MAP * 0.2, WIDTH_MAP * 0.1, this.gm));
@ -89,12 +82,26 @@ class Game extends ManageLang {
this.tree = this.loadTree(tree);
}
loadTree(element) {
let tree = new RectangleNode(element.x, element.y, this, element.type, element.option);
if (element.lRect !== undefined && element.lRect.length > 0) {
element.lRect.forEach(rect => tree.addRect(this.loadTree(rect)))
loadTree(element, posX = CENTERX_TREE, posY = OFFY_TREE / 2) {
if (element.x !== undefined && element.y !== undefined) {
let tree = new RectangleNode(element.x, element.y, this, element.type, element.option);
if (element.lRect !== undefined && element.lRect.length > 0) {
element.lRect.forEach(rect => tree.addRect(this.loadTree(rect)))
}
return tree;
} else {
let tree = new RectangleNode(posX, posY, this, element.type, element.option);
if (element.lRect !== undefined && element.lRect.length > 0) {
let nbRect = element.lRect.length;
let x = posX - (OFFX_TREE / 2) * (nbRect - 1);
let y = posY + OFFY_TREE;
element.lRect.forEach(rect => {
tree.addRect(this.loadTree(rect, x, y))
x += OFFX_TREE;
});
}
return tree;
}
return tree;
}
loadInitSave(element) {
@ -194,6 +201,8 @@ class Game extends ManageLang {
this.play = this.add.sprite(x, y, 'play').setOrigin(1, 0).setInteractive();
let speed = this.add.sprite(x - diffX, y, 'speed').setOrigin(1, 0).setInteractive();
let save = this.add.sprite(WIDTH_WINDOW, y, 'save').setOrigin(1, 0).setInteractive();
this.pencil = this.add.sprite(x - diffX * 2, y, 'pencil').setOrigin(1, 0).setInteractive().setVisible(false);
this.bin = this.add.sprite(x - diffX * 3, y, 'bin').setOrigin(1, 0).setInteractive().setVisible(false);
this.plus = this.add.sprite(x - diffX * 4, y, 'plus').setOrigin(1, 0).setInteractive().setVisible(false);
@ -215,7 +224,7 @@ class Game extends ManageLang {
this.changeFrame(mute, 0, this.lineMute);
back.displayHeight = back.displayWidth = width;
save.displayHeight = save.displayWidth = width;
this.play.displayHeight = this.play.displayWidth = width;
speed.displayHeight = speed.displayWidth = width;
mute.displayHeight = mute.displayWidth = width;
@ -229,6 +238,7 @@ class Game extends ManageLang {
speed.on('pointerover', () => this.changeFrame(speed, 1, this.lineSpeed));
mute.on('pointerout', () => this.changeFrame(mute, 0, this.lineMute));
mute.on('pointerover', () => this.changeFrame(mute, 1, this.lineMute));
this.creatBtnOutAndOver(save);
this.creatBtnOutAndOver(back);
this.creatBtnOutAndOver(this.pencil);
this.creatBtnOutAndOver(this.bin);
@ -238,6 +248,7 @@ class Game extends ManageLang {
speed.on('pointerdown', () => this.clickSpeed(speed));
back.on('pointerdown', () => this.clickBack());
mute.on('pointerdown', () => this.clickMute(mute));
save.on('pointerdown', () => this.clickSave());
this.pencil.on('pointerdown', () => this.clickPencil());
this.bin.on('pointerdown', () => this.clickBin());
this.plus.on('pointerdown', () => this.clickPlus());
@ -253,6 +264,15 @@ class Game extends ManageLang {
btn.on('pointerover', () => this.changeFrame(btn, 1));
}
clickSave() {
let sortDesc = (a, b) => a.getX() - b.getX();
this.tree.sort(sortDesc);
let tree = this.tree.getJson();
let initStat = this.initStat.getJson();
let json = '{' + '"tree":' + tree + ',"initStat":' + initStat + '}';
console.log(json);
}
clickPlay() {
if (this.scene.isPaused('GamingBoard'))
this.resume();

@ -67,6 +67,7 @@ class LoadFile extends Phaser.Scene {
this.loadSprite('pencil', 100, 100, 'buttons/');
this.loadSprite('speed', 100, 100, 'buttons/');
this.loadSprite('mute', 100, 100, 'buttons/');
this.loadSprite('save', 100, 100, 'buttons/');
this.loadSprite('back', 200, 200, 'buttons/');
this.loadSprite('shortRange', 300, 150, 'buttons/');

@ -40,7 +40,7 @@ class RectangleNode {
this.type = type;
this.rect.on('pointerdown', () => this.click());
this.rect.setOrigin(0.5, 0);
this.rect.displayHeight = HEIGHT_WINDOW / 6;
this.rect.displayHeight = HEIGHT_NODE;
this.rect.scaleX = this.rect.scaleY;
}
@ -167,15 +167,18 @@ class RectangleNode {
return false;
}
getJson() {
getJson(withX = false) {
let json = '{';
json += toJson("x", this.rect.x) + toJson("y", this.rect.y) + toJson("type", this.type);
if(this.node !==undefined){
if (withX) {
json += toJson("x", this.rect.x) + toJson("y", this.rect.y)
}
json += toJson("type", this.type);
if (this.node !== undefined) {
json += '"option":[' + this.node.getOptionJson() + '],';
}
if (this.canAddNode) {
json += '"lRect":[';
this.lRect.forEach(rect => json += rect.getJson() + ',');
this.lRect.forEach(rect => json += rect.getJson(withX) + ',');
json = endLineJson(json) + ']';
}
json = endLineJson(json);

@ -12,31 +12,31 @@ class Type extends ManageLang {
this.add.text(WIDTH_WINDOW / 2, HEIGHT_WINDOW / 4, "WARIA", style).setOrigin(0.5, 1);
let btnDuel = this.add.sprite((WIDTH_WINDOW / 8) * 3, (HEIGHT_WINDOW / 4) * 2, 'duel').setInteractive();
this.createbutton(btnDuel);
this.createbutton(btnDuel, 'level1');
let btnLast = this.add.sprite((WIDTH_WINDOW / 8) * 5, (HEIGHT_WINDOW / 4) * 2, 'last').setInteractive();
this.createbutton(btnLast);
this.createbutton(btnLast, 'level2');
let btnTeam = this.add.sprite((WIDTH_WINDOW / 8) * 2, (HEIGHT_WINDOW / 4) * 3, 'team').setInteractive();
this.createbutton(btnTeam);
this.createbutton(btnTeam, 'level3');
let btnFlag = this.add.sprite((WIDTH_WINDOW / 8) * 4, (HEIGHT_WINDOW / 4) * 3, 'flag').setInteractive();
this.createbutton(btnFlag);
this.createbutton(btnFlag, 'level4');
let btnMap = this.add.sprite((WIDTH_WINDOW / 8) * 6, (HEIGHT_WINDOW / 4) * 3, 'map').setInteractive();
this.createbutton(btnMap);
this.createbutton(btnMap, 'level5');
}
createbutton(btn) {
createbutton(btn, level) {
btn.displayHeight = HEIGHT_WINDOW / 4;
btn.scaleX = btn.scaleY;
btn.on('pointerout', () => btn.setFrame(0));
btn.on('pointerover', () => btn.setFrame(1));
btn.on('pointerdown', () => this.clickPlay(btn));
btn.on('pointerdown', () => this.clickPlay(level));
}
clickPlay(btn) {
newGame(this.father);
clickPlay(level) {
newGame(this.father, level);
this.scene.start('Game');
}
}

@ -18,6 +18,11 @@ const HEIGHT_WINDOW = $(document).height() - 20;
const WIDTH_MAP = WIDTH_WINDOW < HEIGHT_WINDOW ? WIDTH_WINDOW * 0.8 : HEIGHT_WINDOW * 0.8;
const OFFX_MAP = WIDTH_WINDOW / 20;
const OFFY_MAP = (HEIGHT_WINDOW - WIDTH_MAP) / 2;
const CENTERX_TREE = WIDTH_WINDOW / 4 * 3;
const OFFX_TREE = WIDTH_WINDOW / 10;
const OFFY_TREE = HEIGHT_WINDOW / 6
const HEIGHT_NODE = HEIGHT_WINDOW / 6;
const LIFE = 100;
const SHIELD = 100;

@ -0,0 +1,99 @@
{
"tree": {
"type": "waria",
"lRect": [
{
"type": "move",
"option": [
true,
false
]
},
{
"type": "attack",
"option": [
0.3333333333333333
]
},
{
"type": "condition",
"option": [
true,
true,
false,
0.3333333333333333,
0
],
"lRect": [
{
"type": "move",
"option": [
false,
true
]
},
{
"type": "attack",
"option": [
1
]
}
]
},
{
"type": "move",
"option": [
true,
true
]
}
]
},
"initStat": {
"lBar": [
{
"value": 2,
"valueMax": 5,
"color": 16711680,
"colorMin": 16711680
},
{
"value": 3,
"valueMax": 5,
"color": 8323327,
"colorMin": 8323327
},
{
"value": 3,
"valueMax": 5,
"color": 255,
"colorMin": 255
},
{
"value": 2,
"valueMax": 5,
"color": 32768,
"colorMin": 32768
}
],
"lText": [
[
"DAMAGE",
"DEGATS"
],
[
"R.S",
"RECHARGEMENT"
],
[
"SPEED",
"VITESSE"
],
[
"RANGE",
"PORTEE"
]
]
}
}

@ -0,0 +1,98 @@
{
"tree": {
"type": "waria",
"lRect": [
{
"type": "attack",
"option": [
0.3333333333333333
]
},
{
"type": "move",
"option": [
true,
false
]
},
{
"type": "condition",
"option": [
true,
true,
false,
0.3333333333333333,
0
],
"lRect": [
{
"type": "move",
"option": [
false,
true
]
},
{
"type": "attack",
"option": [
1
]
}
]
},
{
"type": "move",
"option": [
true,
true
]
}
]
},
"initStat": {
"lBar": [
{
"value": 3,
"valueMax": 5,
"color": 16711680,
"colorMin": 16711680
},
{
"value": 2,
"valueMax": 5,
"color": 8323327,
"colorMin": 8323327
},
{
"value": 0,
"valueMax": 5,
"color": 255,
"colorMin": 255
},
{
"value": 5,
"valueMax": 5,
"color": 32768,
"colorMin": 32768
}
],
"lText": [
[
"DAMAGE",
"DEGATS"
],
[
"R.S",
"RECHARGEMENT"
],
[
"SPEED",
"VITESSE"
],
[
"RANGE",
"PORTEE"
]
]
}
}

@ -0,0 +1,98 @@
{
"tree": {
"type": "waria",
"lRect": [
{
"type": "attack",
"option": [
0.3333333333333333
]
},
{
"type": "condition",
"option": [
false,
false,
true,
0.3333333333333333,
1
],
"lRect": [
{
"type": "move",
"option": [
false,
true
]
},
{
"type": "attack",
"option": [
1
]
}
]
},
{
"type": "move",
"option": [
true,
false
]
},
{
"type": "move",
"option": [
true,
true
]
}
]
},
"initStat": {
"lBar": [
{
"value": 5,
"valueMax": 5,
"color": 16711680,
"colorMin": 16711680
},
{
"value": 0,
"valueMax": 5,
"color": 8323327,
"colorMin": 8323327
},
{
"value": 0,
"valueMax": 5,
"color": 255,
"colorMin": 255
},
{
"value": 5,
"valueMax": 5,
"color": 32768,
"colorMin": 32768
}
],
"lText": [
[
"DAMAGE",
"DEGATS"
],
[
"R.S",
"RECHARGEMENT"
],
[
"SPEED",
"VITESSE"
],
[
"RANGE",
"PORTEE"
]
]
}
}

@ -0,0 +1,98 @@
{
"tree": {
"type": "waria",
"lRect": [
{
"type": "condition",
"option": [
false,
false,
true,
0.3333333333333333,
1
],
"lRect": [
{
"type": "move",
"option": [
false,
true
]
},
{
"type": "attack",
"option": [
1
]
}
]
},
{
"type": "attack",
"option": [
0.3333333333333333
]
},
{
"type": "move",
"option": [
true,
false
]
},
{
"type": "move",
"option": [
true,
true
]
}
]
},
"initStat": {
"lBar": [
{
"value": 5,
"valueMax": 5,
"color": 16711680,
"colorMin": 16711680
},
{
"value": 5,
"valueMax": 5,
"color": 8323327,
"colorMin": 8323327
},
{
"value": 0,
"valueMax": 5,
"color": 255,
"colorMin": 255
},
{
"value": 0,
"valueMax": 5,
"color": 32768,
"colorMin": 32768
}
],
"lText": [
[
"DAMAGE",
"DEGATS"
],
[
"R.S",
"RECHARGEMENT"
],
[
"SPEED",
"VITESSE"
],
[
"RANGE",
"PORTEE"
]
]
}
}

@ -0,0 +1,79 @@
{
"tree": {
"type": "waria",
"lRect": [
{
"type": "attack",
"option": [
0.3333333333333333
]
},
{
"type": "attack",
"option": [
1
]
},
{
"type": "move",
"option": [
true,
false
]
},
{
"type": "move",
"option": [
true,
true
]
}
]
},
"initStat": {
"lBar": [
{
"value": 0,
"valueMax": 5,
"color": 16711680,
"colorMin": 16711680
},
{
"value": 0,
"valueMax": 5,
"color": 8323327,
"colorMin": 8323327
},
{
"value": 5,
"valueMax": 5,
"color": 255,
"colorMin": 255
},
{
"value": 5,
"valueMax": 5,
"color": 32768,
"colorMin": 32768
}
],
"lText": [
[
"DAMAGE",
"DEGATS"
],
[
"R.S",
"RECHARGEMENT"
],
[
"SPEED",
"VITESSE"
],
[
"RANGE",
"PORTEE"
]
]
}
}
Loading…
Cancel
Save