Ajout bonus Attaque (Balle (x2), Bombe(x3), Obus(x4)), le bonus s'applique uniquement au prochain tir du robot - Ajout bonus Bouclier, ça augmente la valeur max du bouclier du robot pendant un certain temps - Correction du fond de la carte qui était devant les robots - Correction : Les bonus apparaissent maintenant derrière les robots et plus devant - Test de fonctionnement du jeux avec plus de robot (8 dans le mode "Last")

master
clmaisonha 5 years ago
parent 3123426007
commit 253322aae6

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 684 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 693 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 517 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

@ -4,11 +4,32 @@
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@types/json-schema": {
"version": "7.0.5",
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.5.tgz",
"integrity": "sha512-7+2BITlgjgDhH0vvwZU/HZJVyk+2XUlvxXe8dFMedNX/aMkaOq++rMAFXc0tM7ij15QaWlbdQASBR9dihi+bDQ=="
},
"abbrev": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="
},
"ajv": {
"version": "6.12.3",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.3.tgz",
"integrity": "sha512-4K0cK3L1hsqk9xIb2z9vs/XU+PGJZ9PNpJRDS9YLzmNdX6jmVPfamLvTJr0aDAusnHyCHO6MjzlkAsgtqp9teA==",
"requires": {
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.2"
}
},
"ajv-keywords": {
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.1.tgz",
"integrity": "sha512-KWcq3xN8fDjSB+IMoh2VaXVhRI0BBGxoYp3rx7Pkb6z0cFjYR9Q9l4yZqqals0/zsioCmocC5H6UvsGD4MoIBA=="
},
"ansi-regex": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
@ -449,9 +470,9 @@
"integrity": "sha1-j2G3XN4BKy6esoTUVFWDtWQ7Yas="
},
"eventemitter3": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz",
"integrity": "sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q=="
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.4.tgz",
"integrity": "sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ=="
},
"exit": {
"version": "0.1.2",
@ -499,19 +520,13 @@
}
},
"exports-loader": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/exports-loader/-/exports-loader-0.7.0.tgz",
"integrity": "sha512-RKwCrO4A6IiKm0pG3c9V46JxIHcDplwwGJn6+JJ1RcVnh/WSGJa0xkmk5cRVtgOPzCAtTMGj2F7nluh9L0vpSA==",
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/exports-loader/-/exports-loader-1.1.0.tgz",
"integrity": "sha512-zGB2SujiAyO0Rwn4GQ17/HlT8cwmT8abcBeZpr2R3sItJ5sI5Y9BzNzus3H9tH1iWLAoJLi9N3TP54D2+j859Q==",
"requires": {
"loader-utils": "^1.1.0",
"source-map": "0.5.0"
},
"dependencies": {
"source-map": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.0.tgz",
"integrity": "sha1-D+llA6yGpa213mP05BKuSHLNvoY="
}
"loader-utils": "^2.0.0",
"schema-utils": "^2.7.0",
"source-map": "^0.6.1"
}
},
"extend": {
@ -597,6 +612,16 @@
}
}
},
"fast-deep-equal": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
},
"fast-json-stable-stringify": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
"integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="
},
"figures": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz",
@ -1145,12 +1170,14 @@
}
},
"imports-loader": {
"version": "0.8.0",
"resolved": "https://registry.npmjs.org/imports-loader/-/imports-loader-0.8.0.tgz",
"integrity": "sha512-kXWL7Scp8KQ4552ZcdVTeaQCZSLW+e6nJfp3cwUMB673T7Hr98Xjx5JK+ql7ADlJUvj1JS5O01RLbKoutN5QDQ==",
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/imports-loader/-/imports-loader-1.1.0.tgz",
"integrity": "sha512-HcPM6rULdQ6EBLVq+5O+CF9xb7qiUjsRm6V28bTG/c3IU5sQkVZzUDwYY0r4jHvSAmVFdO9WA/vLAURR5WQSeQ==",
"requires": {
"loader-utils": "^1.0.2",
"source-map": "^0.6.1"
"loader-utils": "^2.0.0",
"schema-utils": "^2.7.0",
"source-map": "^0.6.1",
"strip-comments": "^2.0.1"
}
},
"indent-string": {
@ -1365,12 +1392,17 @@
"esprima": "^4.0.0"
}
},
"json-schema-traverse": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
},
"json5": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
"integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz",
"integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==",
"requires": {
"minimist": "^1.2.0"
"minimist": "^1.2.5"
}
},
"kind-of": {
@ -1420,13 +1452,13 @@
}
},
"loader-utils": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz",
"integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==",
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz",
"integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^1.0.1"
"json5": "^2.1.2"
}
},
"lodash": {
@ -1819,13 +1851,13 @@
}
},
"phaser": {
"version": "3.23.0",
"resolved": "https://registry.npmjs.org/phaser/-/phaser-3.23.0.tgz",
"integrity": "sha512-tl8dZT5onDxor8Yf+QjxAk2fY4E0vy3oxc+ZsZiI8ppDwr3gWz7XA6hjVRnmEbAF64NcjRwWLU80VvKLi81VtQ==",
"version": "3.24.1",
"resolved": "https://registry.npmjs.org/phaser/-/phaser-3.24.1.tgz",
"integrity": "sha512-WbrRMkbpEzarkfrq83akeauc6b8xNxsOTpDygyW7wrU2G2ne6kOYu3hji4UAaGnZaOLrVuj8ycYPjX9P1LxcDw==",
"requires": {
"eventemitter3": "^3.1.0",
"exports-loader": "^0.7.0",
"imports-loader": "^0.8.0",
"eventemitter3": "^4.0.4",
"exports-loader": "^1.1.0",
"imports-loader": "^1.1.0",
"path": "^0.12.7"
}
},
@ -1876,6 +1908,11 @@
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==",
"dev": true
},
"punycode": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
"integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
},
"read-pkg": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz",
@ -2012,6 +2049,16 @@
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
"schema-utils": {
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.0.tgz",
"integrity": "sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==",
"requires": {
"@types/json-schema": "^7.0.4",
"ajv": "^6.12.2",
"ajv-keywords": "^3.4.1"
}
},
"semver": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
@ -2260,6 +2307,11 @@
"is-utf8": "^0.2.0"
}
},
"strip-comments": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/strip-comments/-/strip-comments-2.0.1.tgz",
"integrity": "sha512-ZprKx+bBLXv067WTCALv8SSz5l2+XhpYCsVtSqlMnkAXMWDq+/ekVbl1ghqP9rUHTzv6sm/DwCOiYutU/yp1fw=="
},
"strip-indent": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz",
@ -2398,6 +2450,14 @@
}
}
},
"uri-js": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz",
"integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==",
"requires": {
"punycode": "^2.1.0"
}
},
"uri-path": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/uri-path/-/uri-path-1.0.0.tgz",

@ -11,7 +11,7 @@
"dependencies": {
"grunt": "^1.2.1",
"jquery": "^3.5.1",
"phaser": "^3.23.0"
"phaser": "^3.24.1"
},
"devDependencies": {
"grunt-contrib-copy": "^1.0.0",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1 +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"]]},"robots":[{"height":0.1,"width":0.1,"x":0.6,"y":0.6,"name":"myself","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[]},{"height":0.1,"width":0.1,"x":0.1,"y":0.1,"name":"enemy","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"name":"condition","option":[true,true,false,0.5,0],"lNode":[{"name":"move","option":[false]}]},{"name":"attack","option":[]},{"name":"move","option":[true]}]},{"height":0.1,"width":0.1,"x":0.1,"y":0.9,"name":"enemy","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"name":"condition","option":[true,true,false,0.5,0],"lNode":[{"name":"move","option":[false]}]},{"name":"attack","option":[]},{"name":"move","option":[true]}]}],"lBonus":[{"style":"speed","x":0.5,"y":0.5,"value":2,"time":2000}]}
{"tree":{"type":"waria","lRect":[{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lRect":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[0.3333333333333333]},{"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"]]},"robots":[{"height":0.1,"width":0.1,"x":0.9,"y":0.9,"name":"myself","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[]},{"height":0.1,"width":0.1,"x":0.1,"y":0.1,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"name":"attack","option":[]},{"name":"move","option":[true]}]},{"height":0.1,"width":0.1,"x":0.3,"y":0.1,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"name":"condition","option":[true,true,false,0.5,0],"lNode":[{"name":"move","option":[false]}]},{"name":"attack","option":[]},{"name":"move","option":[true]}]},{"height":0.1,"width":0.1,"x":0.7,"y":0.1,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"name":"condition","option":[true,true,false,0.5,0],"lNode":[{"name":"move","option":[false]}]},{"name":"attack","option":[]},{"name":"move","option":[true]}]},{"height":0.1,"width":0.1,"x":0.5,"y":0.4,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"name":"condition","option":[true,true,false,0.5,0],"lNode":[{"name":"move","option":[false]}]},{"name":"attack","option":[]},{"name":"move","option":[true]}]},{"height":0.1,"width":0.1,"x":0.1,"y":0.9,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"name":"condition","option":[true,true,false,0.5,0],"lNode":[{"name":"move","option":[false]}]},{"name":"attack","option":[]},{"name":"move","option":[true]}]},{"height":0.1,"width":0.1,"x":0.3,"y":0.7,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"name":"condition","option":[true,true,false,0.5,0],"lNode":[{"name":"move","option":[false]}]},{"name":"attack","option":[]},{"name":"move","option":[true]}]},{"height":0.1,"width":0.1,"x":0.9,"y":0.2,"name":"enemy","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"name":"condition","option":[true,true,false,0.5,0],"lNode":[{"name":"move","option":[false]}]},{"name":"attack","option":[]},{"name":"move","option":[true]}]}],"lBonus":[{"style":"speed","x":0.5,"y":0.5,"value":1,"time":8000},{"style":"shield","x":0.2,"y":0.9,"value":75,"time":15000,"color":8323327},{"style":"shield","x":0.8,"y":0.4,"value":125,"time":10000,"color":8323327},{"style":"shield","x":0.2,"y":0.2,"value":200,"time":5000,"color":8323327}]}

@ -1 +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"]]},"robots":[{"height":0.1,"width":0.1,"x":0.9,"y":0.9,"name":"myself","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[]},{"height":0.1,"width":0.1,"x":0.1,"y":0.1,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"name":"attack","option":[]},{"name":"move","option":[true]}]},{"height":0.1,"width":0.1,"x":0.2,"y":0.2,"name":"enemy","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"name":"condition","option":[true,true,false,0.5,0],"lNode":[{"name":"move","option":[false]}]},{"name":"attack","option":[]},{"name":"move","option":[true]}]}],"lBonus":[{"style":"speed","x":0.5,"y":0.5,"value":1,"time":8000},{"style":"speed","x":0.2,"y":0.9,"value":3,"time":3000}]}
{"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"]]},"robots":[{"height":0.1,"width":0.1,"x":0.6,"y":0.6,"name":"myself","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[]},{"height":0.1,"width":0.1,"x":0.1,"y":0.1,"name":"enemy","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"name":"condition","option":[true,true,false,0.5,0],"lNode":[{"name":"move","option":[false]}]},{"name":"attack","option":[]},{"name":"move","option":[true]}]},{"height":0.1,"width":0.1,"x":0.1,"y":0.9,"name":"enemy","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"name":"condition","option":[true,true,false,0.5,0],"lNode":[{"name":"move","option":[false]}]},{"name":"attack","option":[]},{"name":"move","option":[true]}]}],"lBonus":[{"style":"speed","x":0.5,"y":0.5,"value":2,"time":2000}]}

@ -1,12 +1,25 @@
class BonusAttack extends Bonus {
constructor(name, scene, x, y, value) {
super(name, scene, x, y, 'bonusAttack', value);
let bonus;
switch (value) {
case 1:
bonus = 'bonusAttack0';
break;
case 2:
bonus = 'bonusAttack1';
break;
case 3:
bonus = 'bonusAttack2';
break;
default:
bonus = 'bonusAttack2';
break;
}
super(name, scene, x, y, bonus, value);
}
useOn(robot) {
let oldSpeed = robot.speed;
robot.setSpeed(oldSpeed + this.value);
this.scene.time.addEvent({delay: this.time, callback: robot.setSpeed(oldSpeed)});
robot.setAttackBonus(this.value + 1);
this.destroy();
}
}

@ -1,11 +1,32 @@
class BonusShield extends Bonus {
constructor(name, scene, x, y, value) {
super(name, scene, x, y, 'bonusShield', value);
constructor(name, scene, x, y, value, time, color) {
let bonus;
switch (value) {
case 75:
bonus = 'bonusShield0';
break;
case 125:
bonus = 'bonusShield1';
break;
case 200:
bonus = 'bonusShield2';
break;
default:
bonus = 'bonusShield2';
break;
}
super(name, scene, x, y, bonus, value);
this.time = time;
this.color = color;
}
useOn(robot) {
robot.shield.valueMax = robot.shield.valueMax + this.value;
robot.shield.value = robot.shield.value + this.val
let oldColor = robot.shield.color;
robot.shield.increaseValueMax(this.value, this.color);
this.scene.time.addEvent({
delay: this.time,
callback: () => robot.shield.decreaseValueMax(this.value, oldColor)
});
this.destroy();
}
}

@ -23,10 +23,6 @@ class Game extends ManageLang {
this.cache.json.remove('level');
}
this.load.json('level', 'public/json/' + this.level + '.json');
}
create() {
super.create();
this.gm = new GamingBoard(this);
if (this.father.scene.getIndex('GamingBoard') !== -1) {
@ -35,6 +31,10 @@ class Game extends ManageLang {
this.father.scene.add('GamingBoard', this.gm);
this.scene.launch('GamingBoard');
this.scene.pause('GamingBoard');
}
create() {
super.create();
let level = this.cache.json.get('level');
if (level === undefined) {
@ -79,8 +79,8 @@ class Game extends ManageLang {
loadSave(tree, initStat, robot, lBonus) {
this.loadRobot(robot);
this.loadBonus(lBonus);
this.loadRobot(robot);
this.initStat = this.loadInitSave(initStat);
this.tree = this.loadTree(tree);
}
@ -160,8 +160,10 @@ class Game extends ManageLang {
return new BonusSpeed("", this.gm, WIDTH_MAP * bonus.x, WIDTH_MAP * bonus.y, bonus.value, bonus.time);
case "attack":
return new BonusAttack("", this.gm, WIDTH_MAP * bonus.x, WIDTH_MAP * bonus.y, bonus.value);
case "shield":
return new BonusShield("", this.gm, WIDTH_MAP * bonus.x, WIDTH_MAP * bonus.y, bonus.value, bonus.time, bonus.color);
default:
return;
return null;
}
}

@ -14,16 +14,12 @@ class GamingBoard extends Phaser.Scene {
}
create() {
this.add.image(0, 0, 'background').alpha = 0.1;
for (let i = 0; i < this.listRobot.length; i++) {
this.listRobot[i].setTarget(chooseTarget(this.listRobot[i], this.listRobot));
}
this.listRobot[0].drawRange();
let background = this.add.image(0, 0, 'background').setOrigin(0, 0);
background.alpha = 0.3;
background.displayWidth = WIDTH_MAP;
background.displayHeight = WIDTH_MAP;
this.time.addEvent({delay: 2000, callback: this.upShield, callbackScope: this});
}
update(time, delta) {

@ -44,6 +44,12 @@ class LoadFile extends Phaser.Scene {
this.loadImage('bonusSpeed0', 'bonus/', true);
this.loadImage('bonusSpeed1', 'bonus/', true);
this.loadImage('bonusSpeed2', 'bonus/', true);
this.loadImage('bonusAttack0', 'bonus/', true);
this.loadImage('bonusAttack1', 'bonus/', true);
this.loadImage('bonusAttack2', 'bonus/', true);
this.loadImage('bonusShield0', 'bonus/', true);
this.loadImage('bonusShield1', 'bonus/', true);
this.loadImage('bonusShield2', 'bonus/', true);
this.loadImage('enemy', 'robots/');
@ -91,9 +97,9 @@ class LoadFile extends Phaser.Scene {
this.loadSprite('conditionNode', 180, 190, 'nodes/', true);
this.loadImage('background');
this.loadImage('bullet');
this.loadImage('logoWaria');
this.loadImage('background', 'others/', true);
this.loadImage('bullet', 'others/', true);
this.loadImage('logoWaria', 'others/', true);
this.loadImage('attack', 'nodes/', true);
this.loadImage('move', 'nodes/', true);
this.loadImage('condition', 'nodes/', true);

@ -25,6 +25,7 @@ class Move {
if (!ret) {
bonusTarget.useOn(robot);
listBonus.splice(listBonus.indexOf(bonusTarget), 1);
robot.target = null;
}
return true;
}

@ -1,6 +1,7 @@
class Robot {
constructor(height, width, x, y, scene, name = 'enemy', speed = SPEED_BEGIN, speedReload = SPEED_RELOAD_BEGIN, range = RANGE_BEGIN, damage = DAMAGE_BEGIN, lNode = []) {
this.speedBonus = 1;
this.attackBonus = 1;
this.name = name;
this.height = height;
this.width = width;
@ -98,6 +99,10 @@ class Robot {
this.speedReload = speedReload + SPEED_RELOAD_BASE;
}
setAttackBonus(amount) {
this.attackBonus = amount;
}
increaseSpeedBonus(amount) {
this.speedBonus += amount;
}
@ -239,10 +244,13 @@ class Robot {
}
finishAttack(target, percentBonus) {
if (target.beAttack(this.damage * DAMAGE * percentBonus)) {
if (target.beAttack(this.damage * this.attackBonus * DAMAGE * percentBonus)) {
this.setTarget(null);
}
this.missile.setVisible(false);
if (this.attackBonus !== 1) {
this.setAttackBonus(1);
}
}
reload() {

@ -42,7 +42,7 @@ const SPEED_RELOAD = 4000;
const SPEED_RELOAD_BASE = 2;
const SPEED_RELOAD_BEGIN = 3;
const DAMAGE = 3;
const DAMAGE = 2;
const DAMAGE_BASE = 10;
const DAMAGE_BEGIN = 2;

@ -35,6 +35,25 @@ class HealthBar {
}
}
setValueMax(valueMax = this.valueMax) {
if (valueMax <= 0) {
return;
}
let diff = valueMax - this.valueMax;
this.valueMax = valueMax;
this.setValue(this.value + diff);
}
increaseValueMax(amount = 0, color = this.color) {
this.color = color;
this.setValueMax(this.valueMax + amount);
}
decreaseValueMax(amount = 0, color = this.color) {
this.color = color;
this.setValueMax(this.valueMax - amount);
}
decrease(amount) {
this.value -= amount;

@ -2,19 +2,6 @@
"tree": {
"type": "waria",
"lRect": [
{
"type": "attack",
"option": [
0.3333333333333333
]
},
{
"type": "move",
"option": [
true,
false
]
},
{
"type": "condition",
"option": [
@ -28,18 +15,18 @@
{
"type": "move",
"option": [
false,
true
]
},
{
"type": "attack",
"option": [
1
true,
false
]
}
]
},
{
"type": "attack",
"option": [
0.3333333333333333
]
},
{
"type": "move",
"option": [
@ -52,19 +39,19 @@
"initStat": {
"lBar": [
{
"value": 3,
"value": 0,
"valueMax": 5,
"color": 16711680,
"colorMin": 16711680
},
{
"value": 2,
"value": 0,
"valueMax": 5,
"color": 8323327,
"colorMin": 8323327
},
{
"value": 0,
"value": 5,
"valueMax": 5,
"color": 255,
"colorMin": 255
@ -99,8 +86,8 @@
{
"height": 0.1,
"width": 0.1,
"x": 0.6,
"y": 0.6,
"x": 0.9,
"y": 0.9,
"name": "myself",
"speed": 3,
"speedReload": 1,
@ -115,9 +102,117 @@
"x": 0.1,
"y": 0.1,
"name": "enemy",
"speed": 3,
"speed": 1,
"speedReload": 1,
"range": 3,
"range": 5,
"damage": 5,
"lNode": [
{
"name": "attack",
"option": [
]
},
{
"name": "move",
"option": [
true
]
}
]
},
{
"height": 0.1,
"width": 0.1,
"x": 0.3,
"y": 0.1,
"name": "enemy",
"speed": 1,
"speedReload": 1,
"range": 5,
"damage": 5,
"lNode": [
{
"name": "condition",
"option": [
true,
true,
false,
0.5,
0
],
"lNode": [
{
"name": "move",
"option": [
false
]
}
]
},
{
"name": "attack",
"option": [
]
},
{
"name": "move",
"option": [
true
]
}
]
},
{
"height": 0.1,
"width": 0.1,
"x": 0.7,
"y": 0.1,
"name": "enemy",
"speed": 1,
"speedReload": 1,
"range": 5,
"damage": 5,
"lNode": [
{
"name": "condition",
"option": [
true,
true,
false,
0.5,
0
],
"lNode": [
{
"name": "move",
"option": [
false
]
}
]
},
{
"name": "attack",
"option": [
]
},
{
"name": "move",
"option": [
true
]
}
]
},
{
"height": 0.1,
"width": 0.1,
"x": 0.5,
"y": 0.4,
"name": "enemy",
"speed": 1,
"speedReload": 1,
"range": 5,
"damage": 5,
"lNode": [
{
@ -157,6 +252,90 @@
"x": 0.1,
"y": 0.9,
"name": "enemy",
"speed": 1,
"speedReload": 1,
"range": 5,
"damage": 5,
"lNode": [
{
"name": "condition",
"option": [
true,
true,
false,
0.5,
0
],
"lNode": [
{
"name": "move",
"option": [
false
]
}
]
},
{
"name": "attack",
"option": [
]
},
{
"name": "move",
"option": [
true
]
}
]
},
{
"height": 0.1,
"width": 0.1,
"x": 0.3,
"y": 0.7,
"name": "enemy",
"speed": 1,
"speedReload": 1,
"range": 5,
"damage": 5,
"lNode": [
{
"name": "condition",
"option": [
true,
true,
false,
0.5,
0
],
"lNode": [
{
"name": "move",
"option": [
false
]
}
]
},
{
"name": "attack",
"option": [
]
},
{
"name": "move",
"option": [
true
]
}
]
},
{
"height": 0.1,
"width": 0.1,
"x": 0.9,
"y": 0.2,
"name": "enemy",
"speed": 3,
"speedReload": 1,
"range": 3,
@ -199,8 +378,32 @@
"style": "speed",
"x": 0.5,
"y": 0.5,
"value": 2,
"time": 2000
"value": 1,
"time": 8000
},
{
"style": "shield",
"x": 0.2,
"y": 0.9,
"value": 75,
"time": 15000,
"color": 8323327
},
{
"style": "shield",
"x": 0.8,
"y": 0.4,
"value": 125,
"time": 10000,
"color": 8323327
},
{
"style": "shield",
"x": 0.2,
"y": 0.2,
"value": 200,
"time": 5000,
"color": 8323327
}
]
}

@ -9,16 +9,35 @@
]
},
{
"type": "attack",
"type": "move",
"option": [
1
true,
false
]
},
{
"type": "move",
"type": "condition",
"option": [
true,
false
true,
false,
0.3333333333333333,
0
],
"lRect": [
{
"type": "move",
"option": [
false,
true
]
},
{
"type": "attack",
"option": [
1
]
}
]
},
{
@ -33,19 +52,19 @@
"initStat": {
"lBar": [
{
"value": 0,
"value": 3,
"valueMax": 5,
"color": 16711680,
"colorMin": 16711680
},
{
"value": 0,
"value": 2,
"valueMax": 5,
"color": 8323327,
"colorMin": 8323327
},
{
"value": 5,
"value": 0,
"valueMax": 5,
"color": 255,
"colorMin": 255
@ -80,8 +99,8 @@
{
"height": 0.1,
"width": 0.1,
"x": 0.9,
"y": 0.9,
"x": 0.6,
"y": 0.6,
"name": "myself",
"speed": 3,
"speedReload": 1,
@ -96,11 +115,29 @@
"x": 0.1,
"y": 0.1,
"name": "enemy",
"speed": 1,
"speed": 3,
"speedReload": 1,
"range": 5,
"range": 3,
"damage": 5,
"lNode": [
{
"name": "condition",
"option": [
true,
true,
false,
0.5,
0
],
"lNode": [
{
"name": "move",
"option": [
false
]
}
]
},
{
"name": "attack",
"option": [
@ -117,8 +154,8 @@
{
"height": 0.1,
"width": 0.1,
"x": 0.2,
"y": 0.2,
"x": 0.1,
"y": 0.9,
"name": "enemy",
"speed": 3,
"speedReload": 1,
@ -162,15 +199,8 @@
"style": "speed",
"x": 0.5,
"y": 0.5,
"value": 1,
"time": 8000
},
{
"style": "speed",
"x": 0.2,
"y": 0.9,
"value": 3,
"time": 3000
"value": 2,
"time": 2000
}
]
}
Loading…
Cancel
Save