diff --git a/Code/Gruntfile.js b/Code/Gruntfile.js index 5353862..186cf45 100644 --- a/Code/Gruntfile.js +++ b/Code/Gruntfile.js @@ -3,18 +3,12 @@ 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' - }, + } ], }, }, @@ -43,15 +37,33 @@ module.exports = function (grunt) { minjson: { compile: { files: { - 'public/json//level10.json': ['src/json/level10.json'], - 'public/json//level11.json': ['src/json/level11.json'], - 'public/json//level20.json': ['src/json/level20.json'], - 'public/json//level21.json': ['src/json/level21.json'], - 'public/json//level30.json': ['src/json/level30.json'], - 'public/json//level31.json': ['src/json/level31.json'], - 'public/json//level4.json': ['src/json/level4.json'], - 'public/json//level5.json': ['src/json/level5.json'], - 'public/json//listBonus.json': ['src/json/listBonus.json'] + 'public/json/duel0.json': ['src/json/duel0.json'], + 'public/json/duel1.json': ['src/json/duel1.json'], + 'public/json/duel2.json': ['src/json/duel2.json'], + 'public/json/duel3.json': ['src/json/duel3.json'], + 'public/json/duel4.json': ['src/json/duel4.json'], + 'public/json/duel5.json': ['src/json/duel5.json'], + 'public/json/duel6.json': ['src/json/duel6.json'], + 'public/json/duel7.json': ['src/json/duel7.json'], + 'public/json/last0.json': ['src/json/last0.json'], + 'public/json/last1.json': ['src/json/last1.json'], + 'public/json/last2.json': ['src/json/last2.json'], + 'public/json/last3.json': ['src/json/last3.json'], + 'public/json/last4.json': ['src/json/last4.json'], + 'public/json/last5.json': ['src/json/last5.json'], + 'public/json/last6.json': ['src/json/last6.json'], + 'public/json/last7.json': ['src/json/last7.json'], + 'public/json/team0.json': ['src/json/team0.json'], + 'public/json/team1.json': ['src/json/team1.json'], + 'public/json/team2.json': ['src/json/team2.json'], + 'public/json/team3.json': ['src/json/team3.json'], + 'public/json/team4.json': ['src/json/team4.json'], + 'public/json/team5.json': ['src/json/team5.json'], + 'public/json/team6.json': ['src/json/team6.json'], + 'public/json/team7.json': ['src/json/team7.json'], + 'public/json/level4.json': ['src/json/level4.json'], + 'public/json/level5.json': ['src/json/level5.json'], + 'public/json/listBonus.json': ['src/json/listBonus.json'] } } } diff --git a/Code/index.html b/Code/index.html index 976b4aa..cdefc7f 100644 --- a/Code/index.html +++ b/Code/index.html @@ -4,10 +4,8 @@ Waria - - diff --git a/Code/package-lock.json b/Code/package-lock.json index 207fee0..b090b20 100644 --- a/Code/package-lock.json +++ b/Code/package-lock.json @@ -1378,11 +1378,6 @@ "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" }, - "jquery": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz", - "integrity": "sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg==" - }, "js-yaml": { "version": "3.14.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", diff --git a/Code/package.json b/Code/package.json index 6ac2473..24c8307 100644 --- a/Code/package.json +++ b/Code/package.json @@ -10,7 +10,6 @@ "license": "ISC", "dependencies": { "grunt": "^1.2.1", - "jquery": "^3.5.1", "phaser": "^3.24.1" }, "devDependencies": { diff --git a/Code/public/js/jquery.min.js b/Code/public/js/jquery.min.js deleted file mode 100644 index b061403..0000000 --- a/Code/public/js/jquery.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */ -!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0WIDTH_WINDOW/2&&(e.displayWidth=WIDTH_WINDOW/2,e.scaleY=e.scaleX);let t=super.newCategory("direction",!0,!0);super.addButton(WIDTH_WINDOW/6,HEIGHT_WINDOW/3.2,"fleeFrom",t,!1),super.addButton(WIDTH_WINDOW/3,HEIGHT_WINDOW/3.2,"moveToward",t,!0),(e=super.addTitle(WIDTH_WINDOW/4*3,HEIGHT_WINDOW/(16/3),selectWord("WHO ?","QUI ?"))).displayWidth>WIDTH_WINDOW/2&&(e.displayWidth=WIDTH_WINDOW/2,e.scaleY=e.scaleX);let s=super.newCategory("target",!0,!0);super.addButton(WIDTH_WINDOW/6*4,HEIGHT_WINDOW/3.2,"enemyBot",s,!0);let i=super.addButton(WIDTH_WINDOW/6*5,HEIGHT_WINDOW/3.2,"bonus",s,!1);e=super.addTitle(WIDTH_WINDOW/2,HEIGHT_WINDOW/(16/7),selectWord("WHAT BONUS ? (OPTIONAL)","QUEL BONUS ? (FACULTATIF)"));let h=super.newCategory("target",!0,!1),o=super.addButton(WIDTH_WINDOW/3,HEIGHT_WINDOW/(16/9),"bonusSpeed",h,"speed"),a=super.addButton(WIDTH_WINDOW/1.5,HEIGHT_WINDOW/(16/9),"bonusAttack",h,"attack"),n=super.addButton(WIDTH_WINDOW/2,HEIGHT_WINDOW/(16/12),"bonusShield",h,"shield");s.addEvent(()=>this.clickBonus(i,e,o,a,n)),this.clickBonus(i,e,o,a,n)}clickBonus(e,...t){e.isTinted?t.forEach(e=>e.setVisible(!0)):t.forEach(e=>e.setVisible(!1))}addNode(){super.verifyCategory()&&(this.selected.addRect(new RectangleNode(this.selected.getX(),this.selected.getY()+200,this.gameR,"move",[this.lCategory[0].getValue(),this.lCategory[1].getValue(),this.lCategory[2].getValue()])),super.cancel())}modifyNode(){super.verifyCategory()&&(this.selected.node.toward=this.lCategory[0].getValue(),this.selected.node.enemyBot=this.lCategory[1].getValue(),this.selected.node.typeBonus=this.lCategory[2].getValue(),this.selected.rect.setFrame(this.selected.node.getFrame()),super.cancel())}}class Attack extends Node{constructor(e=1){super("attack"),e>1/3?e>2/3?(e=1,this.percentBonus=1):(e=2/3,this.percentBonus=1.5):(e=1/3,this.percentBonus=2),this.percentRange=e}do(e){return!(!e.haveTarget()||!e.isTargetInRange(this.percentRange))&&e.attackTarget(this.percentBonus)}getFrame(){return 3*this.percentRange-1}getTreeJson(){return super.getTreeJson(this.getOptionJson())}getOptionJson(){return this.percentRange}}class Bar extends HealthBar{constructor(e,t="",s,i,h,o,a,n=new CategoryBar,r=1,l){super(e,t,s,i,h,o,void 0!==l?l:n.valueMax,a,a,!1),this.name=t,this.scene=e,this.scene.input.on("pointerdown",this.doDrag,this);let d={font:i.toString()+"px stencil",fill:"#e2e2e2"};this.text=this.scene.add.text(this.bar.x+this.width+10,this.bar.y,this.value.toString(),d).setOrigin(0,0),this.categoryBar=n,this.setValue(0),this.categoryBar.setValueOf(this,r)}addEvent(e,t){this.event=e,this.context=t,this.doEvent()}doDrag(){let e=this.scene.input;e.x>=this.bar.x-10&&e.x<=this.bar.x+this.width+10&&e.y>=this.bar.y&&e.y<=this.bar.y+this.height&&(this.scene.pauseScene(),this.clickOn())}clickOn(){this.onMove(),this.scene.input.on("pointermove",()=>this.onMove()),this.scene.input.on("pointerup",()=>this.stopClick())}stopClick(){this.scene.input.off("pointermove"),this.scene.input.off("pointerup")}onMove(){this.setValWithX(this.scene.input.x)}doEvent(){void 0!==this.event&&void 0!==this.context&&this.event.call(this.context,this.value)}setValWithX(e){let t=this.value;this.categoryBar.setValueOf(this,Math.round((e-this.bar.x)/this.width*this.valueMax)),t!==this.value&&this.doEvent()}draw(){super.draw();let e=this.value/this.valueMax*this.width-5;this.bar.fillStyle(9868950),this.bar.fillRect(e,0,10,this.height),void 0!==this.text&&this.text.setText(this.value+1)}getJson(e=[]){let t=super.getJson();return t=t.substr(0,t.length-1)+",",t+='"lText":[',e.forEach(e=>{t+='"'+e+'",'}),t=endLineJson(t),t+="]",t+="}"}destroy(){super.destroy(),this.text.destroy(),this.scene.input.off("pointerdown",this.doDrag,this)}}class BonusAttack extends Bonus{constructor(e,t,s){super(e,t,s,"attack")}useOn(e){super.useOn(e),e.setAttackBonus(this.value)}}class BonusHealth{constructor(e,t){this.value=e,this.color=t}decrease(e){this.value-=e;let t=0;return this.value<0&&(t=-this.value,this.value=0),t}}class BonusShield extends Bonus{constructor(e,t,s,i,h){super(e,t,s,"shield"),this.time=i,this.color=h}useOn(e,t){super.useOn(e);let s=new BonusHealth(this.value,this.color);e.shield.addBonus(s),t.time.addEvent({delay:this.time,callback:()=>e.shield.removeBonus(s)})}}class BonusSpeed extends Bonus{constructor(e="",t,s,i){super(e,t,s,"speed"),this.time=i}useOn(e,t){super.useOn(e),e.increaseSpeedBonus(this.value-1),t.time.addEvent({delay:this.time,callback:()=>e.decreaseSpeedBonus(this.value-1)})}}class BonusView extends Phaser.GameObjects.Image{constructor(e,t,s,i){super(e,t,s,i.texture),this.setOrigin(.5,.5),this.displayHeight=HEIGHT_BONUS,this.scaleX=this.scaleY,e.add.existing(this),this.bonus=i}useOn(e){this.bonus.useOn(e,this.scene),this.destroy()}}class Boot extends ManageLang{constructor(e){super("Boot",e)}create(){super.create();let e={font:HEIGHT_TITLE.toString()+"px stencil",fill:"#e2e2e2"};this.add.text(WIDTH_WINDOW/2,HEIGHT_WINDOW/3,"WARIA",e).setOrigin(.5,.5);let t=this.add.sprite(WIDTH_WINDOW/2,HEIGHT_WINDOW/3*2,"playLetter").setInteractive();WIDTH_WINDOW>HEIGHT_WINDOW?(t.displayHeight=HEIGHT_WINDOW/5,t.scaleX=t.scaleY):(t.displayWidth=WIDTH_WINDOW/1.5,t.scaleY=t.scaleX),t.on("pointerout",()=>t.setFrame(0)),t.on("pointerover",()=>t.setFrame(1)),t.on("pointerdown",()=>this.clickPlay(t))}clickPlay(e){console.log("Play"),this.father.scene.add("Type",new Type(this.father)),this.scene.start("Type")}}class Button extends Phaser.GameObjects.Sprite{constructor(e,t,s,i,h,o,a,n=0,r=!0){super(e,t,s,o),this.name=o,this.setInteractive().setVisible(r),this.displayHeight=h,this.displayWidth=i,this.line=n,this.on("pointerout",()=>this.changeFrame(0)),this.on("pointerover",()=>this.changeFrame(1)),this.on("pointerdown",a),this.changeFrame(0),e.add.existing(this)}changeFrame(e=0){this.setFrame(e+2*this.line)}}class Category{constructor(e="undefined",t=!0,s=!0){this.name=e,this.single=t,this.lBtn=[],this.lValue=[],this.obligatory=s}getValue(){return this.single?this.lValue[0]:this.lValue}validate(){return!(0===this.lBtn.length&&this.obligatory)}addEvent(e){this.event=e}add(e,t){0!==this.lBtn.length&&this.single&&(this.lBtn[0].clearTint(),this.lValue=[],this.lBtn=[]),this.lValue.push(t),this.lBtn.push(e),e.tint=COLOR_SELECTED,this.oneChange()}remove(e){let t=this.lBtn.indexOf(e);-1!==t&&(this.lBtn.splice(t,1),this.lValue.splice(t,1)),e.clearTint(),this.oneChange()}oneChange(){void 0!==this.event&&this.event()}}class CategoryBar{constructor(e=VALUE_MAX_BAR,t=1){this.startValue=t,this.valueMax=e,this.point=this.valueMax}addPoint(e){if(this.point+=e,this.point<0){let e=this.point;return this.point=0,e}return this.point>this.valueMax&&(this.point=this.valueMax),0}setValueOf(e,t){let s=t-e.value,i=e.value;this.point>=s?e.setValue(t):e.setValue(e.value+this.point),this.addPoint(i-e.value),this.draw()}addText(e,t,s,i,h){this.text=t;let o={font:h.toString()+"px stencil",fill:"#e2e2e2"};this.textScene=e.add.text(s,i,this.text,o).setOrigin(0,0),this.draw()}setTextPos(e,t){this.textScene.setX(e),this.textScene.setY(t)}setText(e){this.text=e,this.draw()}draw(){this.textScene.setText(this.text+this.point)}destroy(){this.textScene.destroy()}}class Condition extends Node{constructor(e,t=!1,s=!1,i,h){super("condition"),this.shieldFilter=t,this.rangeFilter=s,this.shield=i,this.range=h,this.myself=e,this.lNode=[]}addNode(e){this.lNode.push(e)}do(e){if(this.doCondition(e))for(let t=0;te+=t.getTreeJson()+","),e=endLineJson(e),e+="]}"}getOptionJson(){return this.myself+","+this.shieldFilter+","+this.rangeFilter+","+this.shield+","+this.range}}class Description extends ManageLang{constructor(e){super("Description",e)}create(){super.create();let e=WIDTH_WINDOW/2,t=HEIGHT_WINDOW,s=this.add.image(e,t,"cancel").setOrigin(.5,1).setInteractive();s.on("pointerover",()=>s.setFrame(1)),s.on("pointerout",()=>s.setFrame(0)),s.on("pointerdown",()=>this.return()),s.displayHeight=HEIGHT_WINDOW/10,s.scaleX=s.scaleY,this.loadBonus()}loadBonus(){let e,t,s;this.width=WIDTH_WINDOW/3-20,this.height=HEIGHT_WINDOW/4,WIDTH_WINDOW>HEIGHT_WINDOW?(this.nbWidth=1,this.nbHeight=3,e=WIDTH_WINDOW/3,t=0,s=0):(this.nbWidth=3,this.nbHeight=1,e=0,t=HEIGHT_WINDOW/3.5,s=WIDTH_BUTTON/1.5);let i=WIDTH_BUTTON/1.5;this.createList(lShieldBonus,s,i,!0),s+=e,i+=t,this.createList(lSpeedBonus,s,i,!1),s+=e,i+=t,this.createList(lAttackBonus,s,i,!1)}createList(e,t,s,i=!0){this.createCategoryBonus(t,s,this.width*this.nbWidth,this.height*this.nbHeight),e.forEach(e=>{let h="";void 0!==e.time&&(h=" - "+selectWord("TIME","TEMPS")+" : "+e.time/1e3);let o="";if(void 0!==e.value){let t="x";i&&(t="+"),o="BONUS : "+t+e.value}this.createBonusDescription(t,s,this.width,this.height,e.texture,e.name,o+h),this.nbHeight>1&&(s+=this.height),this.nbWidth>1&&(t+=this.width)})}createCategoryBonus(e,t,s,i){e+=10,t+=10,this.add.rectangle(e,t,s,i,8816262).setOrigin(0,0)}createBonusDescription(e,t,s,i,h,o,a){e+=20,t+=20,s-=20,i-=20,this.add.rectangle(e,t,s,i,16777215).setOrigin(0,0);let n=this.add.image(e+5,t+5,h).setOrigin(0,0),r={fill:"#000000"};WIDTH_WINDOW>HEIGHT_WINDOW?(n.displayHeight=s/5,n.scaleX=n.scaleY,r.font=(n.displayHeight/3).toString()+"px stencil",this.add.text(e+n.displayWidth+10,t+5+n.displayHeight/2,o.toString(),r).setOrigin(0,.5),r.font=(n.displayHeight/4).toString()+"px stencil",this.add.text(e+5,t+n.displayHeight+(i-n.displayHeight)/2,a.toString(),r).setOrigin(0,.5)):(n.displayHeight=i/2,n.scaleX=n.scaleY,n.displayWidth>s&&(n.displayWidth=s,n.scaleY=n.scaleX),r.font=(s/10).toString()+"px stencil",this.add.text(e+5,t+n.displayHeight+(i-n.displayHeight)/3,o.toString(),r).setOrigin(0,0),r.font=(s/15).toString()+"px stencil",this.add.text(e+5,t+n.displayHeight+(i-n.displayHeight)/1.5,a.toString(),r).setOrigin(0,1))}return(){this.father.scene.start("Game"),this.father.scene.remove("Description")}}function selectWord(e,t){switch(LANG){case"fr":return t;default:return e}}function newGame(e,t,s=new Game(e,t)){-1!==e.scene.getIndex("Game")&&e.scene.remove("Game"),e.scene.add("Game",s)}function chooseTarget(e,t){let s=2*WIDTH_MAP,i=[];return t.forEach(function(t){if(t!==e){let h=Math.hypot(t.x-e.x,t.y-e.y);s>=h&&(s>h&&(s=h,i=[]),i.push(t))}}),i.length>1?i[Math.floor(Math.random()*(i.length+1))]:i[0]}function toJson(e,t,s=!1){let i;switch(typeof t){case"string":i='"'+e.toString()+'":"'+t+'"';break;default:i='"'+e.toString()+'":'+t}return s||(i+=","),i}function endLineJson(e){return e.length>0&&","===e[e.length-1]&&(e=e.substr(0,e.length-1)),e}function getNextLevel(e=""){let t=e;return t=t.slice(0,-1)+(parseInt(e[e.length-1])+1).toString(),console.log(e[e.length-1]),t[t.length-1]>=NUMBER_LEVEL?e:t}class Game extends ManageLang{constructor(e,t="level1"){super("Game",e),super.addOtherScenes("GamingBoard"),SPEED_GAME=1,this.level=t,this.listPositionRobotInit=[],this.scoreText=0}preload(){let e,t={font:"100px stencil",fill:"#e2e2e2"};this.load.on("start",()=>{(e=this.add.text(.5*WIDTH_WINDOW,.5*HEIGHT_WINDOW,selectWord("LEVEL LOADING ...","CHARGEMENT DU NIVEAU ..."),t).setOrigin(.5,.5)).alpha=.5}),this.load.on("complete",()=>{e.destroy()}),this.cache.json.exists("level")&&this.cache.json.remove("level"),this.load.json("level","public/json/"+this.level+".json"),console.log("PRELOAD"),this.createGamingBoard()}create(){super.create();let e=this.cache.json.get("level");if(void 0!==e)this.loadSave(e),this.doLine=!1,this.createButtons(),this.input.keyboard.on("keydown-DELETE",()=>{this.clickBin()}),this.input.keyboard.on("keydown-E",()=>{this.clickPencil()}),this.input.keyboard.on("keydown-ENTER",()=>{this.clickPlus()}),this.scene.setVisible(!0,"GamingBoard"),this.setScore(0),this.gm.getMyTeam().addEventScore(this.setScore,this);else{console.log("ERROR : LEVEL UNDEFINED"),new Button(this,10,10,WIDTH_BUTTON,WIDTH_BUTTON,"back",()=>this.clickBack()).setOrigin(0,0);let e={font:"50px stencil",fill:"#e2e2e2"};this.add.text(WIDTH_WINDOW/2,HEIGHT_WINDOW/2,selectWord("LEVEL UNDEFINED","NIVEAU INDEFINI"),e).setOrigin(.5,.5)}}update(e,t){super.update(e,t),this.doLine&&this.tree.updateLine()}createGamingBoard(){this.gm=new GamingBoard(this),-1!==this.father.scene.getIndex("GamingBoard")&&this.father.scene.remove("GamingBoard"),this.father.scene.add("GamingBoard",this.gm),this.scene.launch("GamingBoard"),this.gm.pause()}loadSave(e){this.loadBonus(e.lBonus),this.loadTeam(e);let t=[];if(this.gm.getMyTeam().listRobot.forEach(e=>t.push(e)),void 0!==this.listRobot)for(let e=0;e1&&this.robotSelected.setTint(COLOR_SELECTED)}applyTree(){void 0!==this.tree&&void 0!==this.robotSelected&&(this.tree.sort(),this.robotSelected.setNodes(this.tree.getNode()))}loadTree(e,t=CENTERX_TREE,s=OFFY_TREE_BEGIN){let i;if(void 0!==e.x&&void 0!==e.y)i=new RectangleNode(e.x,e.y,this,e.type,e.option),void 0!==e.lNode&&e.lNode.length>0&&e.lNode.forEach(e=>i.addRect(this.loadTree(e)));else if(i=new RectangleNode(t,s,this,e.type,e.option),void 0!==e.lNode&&e.lNode.length>0){let h=e.lNode.length,o=t-OFFX_TREE/2*(h-1),a=s+OFFY_TREE;e.lNode.forEach(e=>{i.addRect(this.loadTree(e,o,a)),o+=OFFX_TREE})}return i}loadInitSave(e,t,...s){let i=new InitStat(this,OFFX_MAP+WIDTH_MAP+5,OFFY_MAP,7*HEIGHT_BAR,HEIGHT_BAR,e.valueMax);for(let t=0;t{t+=this.loadT(s.name,s.freeForAll,s.robots,e.robotRandomPosition,t,s.color)}),this.gm.addEventMyTeam(this.setRobotSelected,this)}}loadT(e=MY_TEAM,t,s,i,h=0,o){let a=new Team(e,t);return this.loadRobot(s,i,h).forEach(e=>a.addRobot(e)),void 0!==o&&a.getRobots().forEach(e=>e.setTint(o)),this.gm.addTeam(a),a.listRobot.length}loadRobot(e=[],t=!1,s=0){let i=s,h=[];return e.forEach(e=>{let s=[];e.lNode.forEach(e=>{s.push(this.loadNode(e))}),t&&(void 0===this.listPositionRobotInit[i]?(e.x=Math.random()*(1-e.width/2-e.width/2)+e.width/2,e.y=Math.random()*(1-e.height/2-e.height/2)+e.height/2,this.listPositionRobotInit[i]=new Position(e.x,e.y)):(e.x=this.listPositionRobotInit[i].x,e.y=this.listPositionRobotInit[i].y)),h.push(new Robot(WIDTH_MAP*e.height,WIDTH_MAP*e.width,WIDTH_MAP*e.x,WIDTH_MAP*e.y,this.gm,e.name,e.speed,e.speedReload,e.range,e.damage,s)),i+=1}),h}loadNode(e){let t;switch(e.type){case"condition":t=new Condition(e.option[0],e.option[1],e.option[2],e.option[3],e.option[4]);break;case"move":t=new Move(e.option[0],e.option[1]);break;case"attack":t=new Attack(e.option[0]);break;default:return}return void 0!==e.lNode&&e.lNode.forEach(e=>t.addNode(this.loadNode(e))),t}loadBonus(e=[]){e.forEach(e=>{this.gm.addBonus(this.loadB(e))})}loadB(e){let t;switch(e.style){case"speed":t=lSpeedBonus[e.number];break;case"attack":t=lAttackBonus[e.number];break;case"shield":t=lShieldBonus[e.number];break;default:return null}return new BonusView(this.gm,e.x*WIDTH_MAP,e.y*WIDTH_MAP,t)}finish(){let e;console.log("FINISH"),e=this.gm.winner()?new Winner(this.father,this,this.score):new Looser(this.father,this,this.score),this.father.scene.add("Finish",e),this.scene.pause("Game"),this.scene.launch("Finish"),this.robotSelected=void 0}clickNode(){this.tryClick(),this.selected=this.tree.getSelected(),void 0!==this.selected&&(this.selected!==this.tree&&(this.pencilBtn.setVisible(!0),this.binBtn.setVisible(!0)),this.selected.canAddNode&&this.plusBtn.setVisible(!0))}doDrag(e,t,s,i){t.setX(s),t.setY(i)}dragStart(){console.log("START DRAG"),this.doLine=!0,this.pauseScene()}dragEnd(){console.log("END DRAG"),this.applyTree(),this.doLine=!1}pauseScene(){this.playBtn.line=0,this.playBtn.changeFrame(0),this.gm.pause()}resume(){this.playBtn.line=1,this.playBtn.changeFrame(0),this.gm.resume()}createButtons(){let e=WIDTH_MAP+OFFX_MAP,t=WIDTH_MAP+OFFY_MAP+5,s=WIDTH_BUTTON,i=1.1*s,h=0;new Button(this,10,10,s,s,"back",()=>this.clickBack()).setOrigin(0,0),new Button(this,WIDTH_WINDOW-i,HEIGHT_WINDOW,s,s,"bonusBtn",()=>this.clickBonus()).setOrigin(1,1),new Button(this,WIDTH_WINDOW,HEIGHT_WINDOW,s,s,"save",()=>this.clickSave()).setOrigin(1,1),this.playBtn=new Button(this,e,t,s,s,"play",()=>this.clickPlay()).setOrigin(1,0),h=1===SPEED_GAME?0:1,this.speedBtn=new Button(this,e-i,t,s,s,"speed",()=>this.clickSpeed(),h).setOrigin(1,0),this.pencilBtn=new Button(this,e-2*i,t,s,s,"pencil",()=>this.clickPencil(),0,!1).setOrigin(1,0),this.binBtn=new Button(this,e-3*i,t,s,s,"bin",()=>this.clickBin(),0,!1).setOrigin(1,0),this.plusBtn=new Button(this,e-4*i,t,s,s,"plus",()=>this.clickPlus(),0,!1).setOrigin(1,0),h=this.father.sound.mute?1:0,this.muteBtn=new Button(this,e-5*i,t,s,s,"mute",()=>this.clickMute(),h).setOrigin(1,0);let o={font:(s/2).toString()+"px stencil",fill:"#e2e2e2"};this.scoreText=this.add.text(OFFX_MAP,t,"SCORE : "+this.scoreText,o).setOrigin(0,0),this.input.on("pointerdown",()=>this.clickNode()),this.input.on("drag",this.doDrag),this.input.on("dragstart",()=>this.dragStart()),this.input.on("dragend",()=>this.dragEnd())}setScore(e){this.score=e,this.scoreText.setText("SCORE : "+this.score)}clickBonus(){this.father.scene.stop("GamingBoard"),this.father.scene.remove("GamingBoard"),this.father.scene.add("Description",new Description(this.father,this)),this.scene.start("Description")}clickSave(){let e='{"tree":'+this.tree.getJson()+',"initStat":'+this.initStat.getJson()+"}";console.log(e)}clickPlay(){this.gm.paused?this.resume():this.pauseScene(),this.playBtn.changeFrame(1)}clickSpeed(){1===SPEED_GAME?(SPEED_GAME=2,this.speedBtn.line=1):(SPEED_GAME=1,this.speedBtn.line=0),this.gm.time.timeScale=SPEED_GAME,this.speedBtn.changeFrame(1)}clickPencil(){if(void 0!==this.selected){switch(console.log("PENCIL"),this.selected.type){case"attack":this.father.scene.add("AddNode",new AddAttack(this.father,this,this.selected,!1));break;case"move":this.father.scene.add("AddNode",new AddMove(this.father,this,this.selected,!1));break;case"condition":this.father.scene.add("AddNode",new AddCondition(this.father,this,this.selected,!1));break;default:return}this.scene.pause("Game"),this.scene.launch("AddNode")}}clickBin(){void 0!==this.selected&&(console.log("BIN"),this.tree.delete(this.selected),this.binBtn.changeFrame(0),this.tryClick())}clickPlus(){void 0!==this.selected&&this.selected.canAddNode&&(console.log("PLUS"),this.father.scene.add("PlusNode",new PlusNode(this.father,this,this.selected)),this.scene.launch("PlusNode"),this.plusBtn.changeFrame(0),this.scene.pause("Game"))}clickBack(){console.log("BACK"),this.father.scene.stop("GamingBoard"),this.father.scene.remove("GamingBoard"),this.father.scene.stop("Game"),this.father.scene.start("Type")}clickMute(){console.log("MUTE"),this.father.sound.mute?(this.father.sound.mute=!1,this.muteBtn.line=0):(this.father.sound.mute=!0,this.muteBtn.line=1),this.muteBtn.changeFrame(1)}tryClick(){this.pencilBtn.setVisible(!1),this.binBtn.setVisible(!1),this.plusBtn.setVisible(!1),void 0!=this.selected&&(this.selected.deselect(),this.selected=void 0)}setLevel(e){this.level!==e&&(this.level=e,this.listPositionRobotInit=[],this.robotSelected=void 0),console.log(this.level)}}class GamingBoard extends Phaser.Scene{constructor(e){super("GamingBoard"),this.listTeam=[],listBonus=[],this.father=e,this.end=!1,this.paused=!1}preload(){this.cameras.main.setViewport(OFFX_MAP,OFFY_MAP,WIDTH_MAP,WIDTH_MAP),this.sound.add("shot"),this.sound.add("hit"),this.scene.setVisible(!1,"GamingBoard")}create(){let e=this.add.image(0,0,"background").setOrigin(0,0);e.alpha=.3,e.displayWidth=WIDTH_MAP,e.displayHeight=WIDTH_MAP,this.time.addEvent({delay:2e3,callback:this.upShield,callbackScope:this})}update(e,t){this.end||this.paused||(this.listTeam.forEach(e=>{e.actualise(this.getEnemyRobotTeam(e))||this.listTeam.splice(this.listTeam.indexOf(e),1)}),this.listTeam.forEach(e=>e.readAll()),(void 0===this.getMyTeam()||this.listTeam.length<=1)&&(this.end=!0,this.finish()))}addEventMyTeam(e,t){this.getMyTeam().addEvent(e,t)}getEnemyRobotTeam(e){let t=[];return this.listTeam.forEach(s=>{(e.freeForAll||s!==e)&&(t=t.concat(s.getRobots()))}),t}setRobotVisible(e=!0){this.listTeam.forEach(t=>t.setRobotVisible(e))}setEnemyRobotVisible(e=!0){let t=this.getMyTeam();this.listTeam.forEach(s=>{t!==s&&s.setRobotVisible(e)})}setBonusVisible(e=!0){listBonus.forEach(t=>t.setVisible(e))}finish(){this.pause(),this.father.finish()}winner(){return void 0!==this.getMyTeam()}pause(){this.sound.pauseAll(),this.paused=!0,this.time.timeScale=0}resume(){this.sound.resumeAll(),this.setRobotVisible(!0),this.setBonusVisible(!0),this.paused=!1,this.time.timeScale=SPEED_GAME}addTeam(e){this.listTeam.push(e)}addBonus(e){listBonus.push(e)}modifyNodes(e){let t=this.getMyTeam();return void 0!==t&&(t.modifyNodes(e),!0)}modifyValue(e,t,s,i){let h=this.getMyTeam();return void 0!==h&&(h.modifyValue(e,t,s,i),!0)}getMyTeam(){for(let e=0;ee.listRobot.forEach(e=>{e.addShield(SHIELD_PER_SECOND)})),this.time.addEvent({delay:1e3,callback:this.upShield,callbackScope:this})}}class InitStat{constructor(e,t,s,i,h,o=10){this.scene=e,this.posX=t,this.posY=s,this.width=i,this.height=h,this.category=new CategoryBar(o),this.lBar=[],this.lText=[],this.category.addText(this.scene,selectWord("TOKENS : ","JETONS : "),this.posX,this.posY,this.height)}addBar(e,t,s,i=[]){this.lText.push(i),this.lBar.push(new Bar(this.scene,selectWord(i[0],i[1]),this.width,this.height,this.posX,this.posY,s,this.category,e,t)),this.posY+=1.5*this.height,this.category.setTextPos(this.posX,this.posY)}getJson(){let e="{";e+=toJson("valueMax",this.category.valueMax),e+='"lBar":[';for(let t=0;te.destroy())}}class LevelSelect extends ManageLang{constructor(e,t=""){super("LevelSelect"),this.father=e,this.level=t}create(){super.create();let e={font:HEIGHT_TITLE.toString()+"px stencil",fill:"#e2e2e2"};this.add.text(WIDTH_WINDOW/2,HEIGHT_WINDOW/6,"WARIA",e).setOrigin(.5,.5),this.createLevel(WIDTH_WINDOW/3,HEIGHT_WINDOW/2,1),this.createLevel(WIDTH_WINDOW/1.5,HEIGHT_WINDOW/2,2)}createLevel(e,t,s=0){let i;i=WIDTH_WINDOW>HEIGHT_WINDOW?HEIGHT_WINDOW/4:WIDTH_WINDOW/4;let h=this.add.image(e,t,"rectangle").setOrigin(.5,.5).setInteractive();h.displayHeight=h.displayWidth=i;let o={font:(i/2).toString()+"px stencil",fill:"#000000"},a=this.add.text(e,t,s.toString(),o).setOrigin(.5,.5);h.on("pointerover",()=>this.over(h,a)),h.on("pointerout",()=>this.out(h,a)),h.on("pointerdown",()=>this.click(s)),new Button(this,10,10,WIDTH_BUTTON,WIDTH_BUTTON,"back",()=>this.clickBack()).setOrigin(0,0)}over(e,t){e.setFrame(1),t.setColor("white")}out(e,t){e.setFrame(0),t.setColor("black")}click(e){e-=1,this.level+=e.toString(),newGame(this.father,this.level),this.scene.start("Game")}clickBack(){this.scene.start("Type")}}class LoadFile extends Phaser.Scene{constructor(e,t,s){super("LoadFile"),this.father=e,this.son=s,this.nameSon=t,this.father.scene.pause(this.nameSon),this.father.scene.stop(this.nameSon),this.father.scene.remove("LoadFile")}preload(){let e=this.add.graphics(),t=this.add.graphics(),s=WIDTH_WINDOW/2-160,i=HEIGHT_WINDOW/2-25;t.fillStyle(2236962,.8),t.fillRect(s,i,320,50),this.load.on("progress",function(t){e.clear(),e.fillStyle(16777215,1),e.fillRect(s+10,i+10,300*t,30)}),this.load.on("complete",()=>{e.destroy(),t.destroy()}),this.load.audio("shot","assets/sounds/shot.ogg"),this.load.audio("hit","assets/sounds/hit.ogg"),this.loadImage("en","flags/",!0),this.loadImage("fr","flags/",!0),this.loadImage("bonusSpeed0","bonus/",!0),this.loadImage("bonusSpeed1","bonus/",!0),this.loadImage("bonusSpeed2","bonus/",!0),this.loadImage("bonusAttack0","bonus/",!0),this.loadImage("bonusAttack1","bonus/",!0),this.loadImage("bonusAttack2","bonus/",!0),this.loadImage("bonusShield0","bonus/",!0),this.loadImage("bonusShield1","bonus/",!0),this.loadImage("bonusShield2","bonus/",!0),this.loadImage("enemy","robots/"),this.loadImage("myBot","robots/"),this.loadSprite("playLetter",550,150,"buttons/"),this.loadSprite("cancel",550,150,"buttons/"),this.loadSprite("add",550,150,"buttons/"),this.loadSprite("modify",550,150,"buttons/"),this.loadSprite("home",550,150,"buttons/"),this.loadSprite("next",550,150,"buttons/"),this.loadSprite("retry",550,150,"buttons/"),this.loadSprite("duel",269,262,"buttons/"),this.loadSprite("last",269,262,"buttons/"),this.loadSprite("team",269,262,"buttons/"),this.loadSprite("flag",269,262,"buttons/"),this.loadSprite("map",269,262,"buttons/"),this.loadSprite("play",100,100,"buttons/",!0),this.loadSprite("bin",100,100,"buttons/",!0),this.loadSprite("plus",100,100,"buttons/",!0),this.loadSprite("pencil",100,100,"buttons/",!0),this.loadSprite("speed",100,100,"buttons/",!0),this.loadSprite("mute",100,100,"buttons/",!0),this.loadSprite("save",100,100,"buttons/",!0),this.loadSprite("bonusBtn",100,100,"buttons/",!0),this.loadSprite("back",200,200,"buttons/",!0),this.loadSprite("shortRange",300,150,"buttons/"),this.loadSprite("mediumRange",300,150,"buttons/"),this.loadSprite("longRange",300,150,"buttons/"),this.loadSprite("shield0",300,150,"buttons/"),this.loadSprite("shield33",300,150,"buttons/"),this.loadSprite("shield66",300,150,"buttons/"),this.loadSprite("shield100",300,150,"buttons/"),this.loadSprite("bonusShield",300,150,"buttons/"),this.loadSprite("bonusSpeed",300,150,"buttons/"),this.loadSprite("bonusAttack",300,150,"buttons/"),this.loadSprite("myself",300,150,"buttons/"),this.loadSprite("enemyBot",300,150,"buttons/"),this.loadSprite("bonus",300,150,"buttons/"),this.loadSprite("moveToward",300,150,"buttons/"),this.loadSprite("fleeFrom",300,150,"buttons/"),this.loadSprite("attackNode",180,190,"nodes/",!0),this.loadSprite("moveNode",180,190,"nodes/",!0),this.loadSprite("conditionNode",180,190,"nodes/",!0),this.loadSprite("rectangle",400,400,"buttons/",!0),this.loadImage("background","others/",!0),this.loadImage("bullet","others/",!0),this.loadImage("logoWaria","others/",!0),this.loadImage("attack","nodes/",!0),this.loadImage("move","nodes/",!0),this.loadImage("condition","nodes/",!0),this.cache.json.exists("listBonus")&&(this.cache.json.remove("listBonus"),lSpeedBonus=[],lShieldBonus=[],lAttackBonus=[]),this.load.json("listBonus","public/json/listBonus.json")}create(){this.loadBonus(),-1===this.father.scene.getIndex(this.nameSon)&&this.father.scene.add(this.nameSon,this.son),this.father.scene.start(this.nameSon)}loadBonus(){let e=this.cache.json.get("listBonus");void 0!==e&&(e.lSpeedBonus.forEach(e=>lSpeedBonus.push(new BonusSpeed(selectWord(e.name.en,e.name.fr),e.texture,e.value,e.time))),e.lShieldBonus.forEach(e=>lShieldBonus.push(new BonusShield(selectWord(e.name.en,e.name.fr),e.texture,e.value,e.time,e.color))),e.lAttackBonus.forEach(e=>lAttackBonus.push(new BonusAttack(selectWord(e.name.en,e.name.fr),e.texture,e.value))))}loadSprite(e,t,s,i="",h=!1){this.textures.exists(e)&&h||(this.deleteLoad(e),h?this.load.spritesheet(e,"assets/"+i+e+".png",{frameWidth:t,frameHeight:s}):this.load.spritesheet(e,"assets/lang/"+LANG+"/"+i+e+".png",{frameWidth:t,frameHeight:s}))}loadImage(e,t="",s=!1){this.textures.exists(e)&&s||(this.deleteLoad(e),s?this.load.image(e,"assets/"+t+e+".png"):this.load.image(e,"assets/lang/"+LANG+"/"+t+e+".png"))}deleteLoad(e){this.textures.exists(e)&&this.textures.remove(e)}}class Looser extends Finish{constructor(e,t,s){super(e,t,s)}create(){super.create(),super.addTitle(selectWord("GAME OVER","PARTIE PERDUE")),super.btnRetry(super.createButton(WIDTH_WINDOW/3,"retry")),super.btnHome(super.createButton(WIDTH_WINDOW/1.5,"home"))}}class Missile extends Phaser.GameObjects.Image{constructor(e,t,s,i){super(e,0,0,t),this.visible=!1,this.setOrigin(.5,.5),this.setScale(.02)}}class Move extends Node{constructor(e,t=!0,s){super("move"),this.toward=e,this.enemyBot=t,this.typeBonus=s}do(e){if(this.enemyBot){if(e.verifyTarget())return!0===this.toward?this.moveToward(e):this.fleeFrom(e)}else{let t=chooseTarget(e,this.getListBonus());if(void 0!==t){let s;return(s=!0===this.toward?this.moveToward(e,t):this.fleeFrom(e,t))||(t.useOn(e),listBonus.splice(listBonus.indexOf(t),1),e.target=null),!0}}return!1}getListBonus(){if(void 0!==this.typeBonus){let e=[];return listBonus.forEach(t=>{t.bonus.type===this.typeBonus&&e.push(t)}),e}return listBonus}moveToward(e,t=e.target){return e.advanceTo(t)}fleeFrom(e,t=e.target){return e.fleeFrom(t)}getFrame(){let e;if(e=this.toward?0:5,!this.enemyBot)switch(this.typeBonus){case"speed":e+=2;break;case"attack":e+=3;break;case"shield":e+=4;break;default:e+=1}return e}getTreeJson(){return super.getTreeJson(this.getOptionJson())}getOptionJson(){let e=this.toward+","+this.enemyBot;return void 0!==this.typeBonus&&(e+=',"'+this.typeBonus+'"'),e}}class PlusNode extends Phaser.Scene{constructor(e,t,s){super("PlusNode"),this.father=e,this.gameR=t,this.selected=s}create(){this.add.rectangle(0,0,WIDTH_WINDOW,HEIGHT_WINDOW,0).setOrigin(0,0).setAlpha(.5),this.add.rectangle(0,HEIGHT_WINDOW/2,WIDTH_WINDOW,HEIGHT_WINDOW/2,3487290).setOrigin(0,.5),this.createNode(),this.createButton()}createNode(){let e=WIDTH_WINDOW/2,t=HEIGHT_WINDOW/2,s=WIDTH_WINDOW/3,i=HEIGHT_WINDOW/10,h=i/1.5;ORIENTATION_VERTICAL&&(h/=1.5),this.createBtn(e-s,t,"attack",selectWord("ATTACK","ATTAQUE"),s,i,()=>this.click("attack")),this.createBtn(e,t,"move",selectWord("MOVE","DEPLACEMENT"),s,i,()=>this.click("move")),this.createBtn(e+s,t,"condition",selectWord("CONDITION","CONDITION"),s,i,()=>this.click("condition"))}createBtn(e,t,s,i,h,o,a){let n=this.add.sprite(e,t+o,s).setOrigin(.5,.5).setInteractive().on("pointerdown",a);n.displayHeight=2*o,n.scaleX=n.scaleY,n.displayWidth>h&&(n.displayWidth=h/1.1,n.scaleY=n.scaleX);let r={font:HEIGHT_TITLE.toString()+"px stencil",fill:"#e2e2e2"},l=this.add.text(e,t-o,i,r).setOrigin(.5,.5);return l.displayWidth=n.displayWidth,l.scaleY=l.scaleX,n}click(e){switch(e.toString()){case"attack":this.father.scene.add("AddNode",new AddAttack(this.father,this.gameR,this.selected));break;case"move":this.father.scene.add("AddNode",new AddMove(this.father,this.gameR,this.selected));break;case"condition":this.father.scene.add("AddNode",new AddCondition(this.father,this.gameR,this.selected))}this.scene.launch("AddNode"),this.scene.stop("PlusNode"),this.father.scene.remove("PlusNode")}createButton(){let e=WIDTH_WINDOW/2,t=HEIGHT_WINDOW-100,s=this.add.image(e,t,"cancel").setOrigin(.5,.5).setInteractive();s.on("pointerover",()=>s.setFrame(1)),s.on("pointerout",()=>s.setFrame(0)),s.on("pointerdown",()=>this.cancel()),s.displayHeight=HEIGHT_WINDOW/10,s.scaleX=s.scaleY}cancel(){this.scene.resume("Game"),this.scene.stop("PlusNode"),this.father.scene.remove("PlusNode")}}class Position{constructor(e,t){this.x=e,this.y=t}}class RectangleNode{constructor(e,t,s,i,h=[]){switch(i.toString().toLowerCase()){case"attack":this.rect=new Phaser.GameObjects.Image(s,e,t,"attackNode"),this.node=new Attack(h[0]),this.canAddNode=!1,this.line=s.add.graphics();break;case"move":this.rect=new Phaser.GameObjects.Image(s,e,t,"moveNode"),this.node=new Move(h[0],h[1],h[2]),this.canAddNode=!1,this.line=s.add.graphics();break;case"condition":this.rect=new Phaser.GameObjects.Image(s,e,t,"conditionNode"),this.node=new Condition(h[0],h[1],h[2],h[3],h[4]),this.canAddNode=!0,this.lRect=[],this.scene=s,this.line=s.add.graphics();break;case"waria":this.rect=new Phaser.GameObjects.Image(s,e,t,"logoWaria").setInteractive(),this.canAddNode=!0,this.lRect=[],this.scene=s,this.scene.add.existing(this.rect),this.scene.input.setDraggable(this.rect);break;default:return void console.log("Création d'un node echoué")}"waria"!==i.toString().toLowerCase()&&this.rect.setFrame(this.node.getFrame()),this.type=i,this.rect.on("pointerdown",()=>this.click()),this.rect.setOrigin(.5,0),this.rect.displayHeight=HEIGHT_NODE,this.rect.scaleX=this.rect.scaleY}getSelected(){if(this.rect.isTinted)return this;if(this.canAddNode)for(let e=0;ethis.addLine(e))}addLine(e){e.setLine(this.rect.x,this.rect.y+.9*this.rect.displayHeight)}getNode(){if(void 0===this.node){let e=[];return this.lRect.forEach(function(t){e.push(t.getNode())}),e}return this.canAddNode&&(this.node.clearNodes(),this.lRect.forEach(e=>this.node.addNode(e.getNode()))),this.node}sort(e=((e,t)=>e.getX()-t.getX())){this.canAddNode&&(this.lRect.sort(e),this.lRect.forEach(function(t){t.canAddNode&&t.sort(e)}))}destroy(){this.line.destroy(),this.rect.destroy(),void 0!==this.lRect&&this.lRect.forEach(e=>e.destroy())}delete(e){let t=this.lRect.indexOf(e);if(-1!==t)return this.lRect.splice(t,1),e.destroy(),!0;for(let t=0;tt+=s.getJson(e)+","),t=endLineJson(t)+"]"),t=endLineJson(t),t+="}"}destroy(){this.rect.destroy(),void 0!==this.line&&this.line.destroy(),void 0!==this.lRect&&this.lRect.forEach(e=>e.destroy())}}class Robot{constructor(e,t,s,i,h,o="enemy",a=SPEED_BEGIN,n=SPEED_RELOAD_BEGIN,r=RANGE_BEGIN,l=DAMAGE_BEGIN,d=[]){this.speedBonus=1,this.attackBonus=1,this.name=o,this.height=e,this.width=t,this.x=s,this.y=i,this.life=new HealthBar(h,selectWord("LIFE","VIE"),2*this.width,this.width/3,this.x,this.y-this.width,LIFE,32768),this.shield=new HealthBar(h,selectWord("SHIELD","BOUCLIER"),2*this.width,this.width/3,this.x,this.y-1.5*this.width,SHIELD,255),this.canAttack=!0,this.missile=new Missile(h,"bullet",this.width/5,this.width/4),h.add.existing(this.missile),this.addScene(h),this.lNode=d,this.setSpeed(a),this.setSpeedReload(n),this.setRange(r),this.setDamage(l),this.setX(this.x),this.setY(this.y),this.team=void 0}addScene(e){this.scene=e,"enemy"===this.name?this.circle=this.scene.add.image(this.x,this.y,"enemy").setOrigin(.5,.5).setInteractive():this.circle=this.scene.add.image(this.x,this.y,"myBot").setOrigin(.5,.5).setInteractive(),this.circle.displayWidth=this.width,this.circle.displayHeight=this.height,this.circle.on("pointerdown",()=>this.click())}click(){void 0===this.circleRange?this.drawRange():this.eraseRange(),this.doEvent()}addEvent(e,t,s){this.eventClick=e,this.contextClick=t,this.valueClick=s}doEvent(){void 0!==this.eventClick&&void 0!==this.contextClick&&this.eventClick.call(this.contextClick,this,this.valueClick)}addShield(e){this.shield.increase(e)}setX(e){this.x=e,this.life.setX(this.x),this.shield.setX(this.x),this.circle.setX(this.x),this.drawCircleRange()}setY(e){this.y=e;let t=this.y-this.width,s=this.y-1.5*this.width;t<0?(s=this.y+this.width-this.shield.height,t=this.y+1.5*this.width-this.shield.height):s<0&&(s=t,t=this.y+this.width-this.shield.height),this.life.setY(t),this.shield.setY(s),this.circle.setY(this.y),this.drawCircleRange()}setTint(e){this.circle.setTint(e)}clearTint(){this.circle.clearTint()}setTarget(e){this.target=e}updateTarget(){this.verifyTarget()&&this.setTargetPos(this.target.x,this.target.y)}setTargetPos(e,t){}setDamage(e=this.damage){this.damage=e+DAMAGE_BASE}setRange(e=this.range){this.range=e+RANGE_BASE,this.drawCircleRange()}setSpeed(e=this.speed){this.speed=e+SPEED_BASE}setSpeedReload(e=this.speedReload){this.speedReload=e+SPEED_RELOAD_BASE}setAttackBonus(e){this.attackBonus=e}increaseSpeedBonus(e){this.speedBonus+=e}decreaseSpeedBonus(e){this.speedBonus-=e}advanceToTarget(){return this.verifyTarget()&&this.advanceTo(this.target),!1}advanceTo(e){if(e.x!==this.x||e.y!==this.y){let t=!1,s=!1,i=this.getVelocity(e),h=i[0]+this.x,o=i[1]+this.y;return i[0]>=0&&h>=e.x||i[0]<=0&&h<=e.x?(this.setX(e.x),t=!0):this.setX(this.x+i[0]),i[1]>=0&&o>=e.y||i[1]<=0&&o<=e.y?(this.setY(e.y),s=!0):this.setY(this.y+i[1]),!(t&&s)}return!1}fleeFromTarget(){return!!this.verifyTarget()&&this.fleeFrom(this.target)}fleeFrom(e){if(this.target.x!==this.x||this.target.y!==this.y){let t=this.getVelocity(e,!0);return t[0]>=0&&this.x-this.width/2<=0?this.setX(this.width/2):t[0]<=0&&this.x+this.width/2>=WIDTH_MAP?this.setX(WIDTH_MAP-this.width/2):this.setX(this.x-t[0]),t[1]>=0&&this.y-this.width/2<=0?this.setY(this.height/2):t[1]<=0&&this.y+this.width/2>=WIDTH_MAP?this.setY(WIDTH_MAP-this.height/2):this.setY(this.y-t[1]),!0}return!1}getVelocity(e,t=!1){let s=[],i=e.x-this.x,h=e.y-this.y,o=Math.hypot(i,h);return s[0]=i/o*SPEED*this.speed*this.speedBonus*SPEED_GAME,s[1]=h/o*SPEED*this.speed*this.speedBonus*SPEED_GAME,t&&(this.x+this.width/2+s[0]>WIDTH_MAP||this.x-this.width/2-s[0]<0?(s[1]+=s[0]*Math.sign(s[1]),s[0]=0):(this.y+this.width/2-s[1]>WIDTH_MAP||this.y-this.width/2+s[1]<0)&&(s[0]+=s[1]*Math.sign(-s[0]),s[1]=0)),s}attackTarget(e=0){return!!this.verifyTarget()&&(this.canAttack&&this.attack(this.target,e),!0)}verifyTarget(){return!!this.haveTarget()&&(!!this.target.isAlive()||(this.setTarget(null),!1))}attack(e,t){this.canAttack=!1,this.missile.setPosition(this.x,this.y).setVisible(!0),this.missile.setRotation(Math.atan2(this.y-this.target.y,this.x-this.target.x)-1.57),this.scene.sound.play("shot",{rate:SPEED_GAME});let s=this.calcDistance(this.target)*WIDTH_MAP/1e3;this.scene.tweens.add({targets:this.missile,x:e.x,y:e.y,ease:"Linear",duration:s,onComplete:()=>this.finishAttack(e,t)}),this.scene.time.addEvent({delay:SPEED_RELOAD/this.speedReload,callback:this.reload,callbackScope:this})}finishAttack(e,t){e.beAttack(this.damage*this.attackBonus*DAMAGE*t,this.team)&&this.setTarget(null),this.missile.setVisible(!1),1!==this.attackBonus&&this.setAttackBonus(1)}reload(){this.canAttack=!0}beAttack(e,t){let s=this.shield.decrease(e),i={font:HEIGHT_DAMAGE.toString()+"px stencil",fill:"#ffff00"},h=this.scene.add.text(this.x,this.y,e.toString(),i).setOrigin(0,1);return this.scene.tweens.add({targets:h,x:this.x+30,y:this.y-50,alpha:0,duration:DURATION_DAMAGE,ease:"Sine.easeOut",onComplete:()=>h.destroy()}),this.scene.sound.play("hit",{rate:SPEED_GAME}),console.log("HIT"),s>0&&(console.log("Shield Broken"),this.life.decrease(s)),this.addScore(t),this.die()}addScore(e){void 0!==e&&(e.addScore(SCORE_HIT),0===this.life.value&&e.addScore(SCORE_KILL))}isTargetInRange(e=1){return!!this.haveTarget()&&this.calcDistance(this.target)<=this.range*RANGE*e}calcDistance(e){return Math.hypot(e.x-this.x,e.y-this.y)}isAlive(){return this.life.value>0}die(){return 0===this.life.value&&(void 0!==this.circleRange&&this.circleRange.destroy(),this.circle.destroy(),this.shield.destroy(),this.life.destroy(),!0)}haveTarget(){return null!=this.target}read(){this.verifyTarget();for(let e=0;ethis.addNode(e))}setVisible(e){this.circle.setVisible(e),this.life.setVisible(e),this.shield.setVisible(e),void 0!==this.circleRange&&this.circleRange.setVisible(e)}getTreeJson(){let e="{"+toJson("type","waria");return e+='"lNode":[',this.lNode.forEach(t=>e+=t.getTreeJson()+","),e=endLineJson(e),e+="]}"}copy(e){e.lNode=this.lNode,e.damage=this.damage,e.speedReload=this.speedReload,e.speed=this.speed,e.range=this.range,void 0!==this.circleRange?e.drawRange():e.eraseRange()}}class Team{constructor(e="enemy",t=!1){this.freeForAll=t,this.listRobot=[],this.name=e,this.score=0}addEventScore(e,t){this.eventScore=e,this.context=t}addScore(e){this.score+=e,void 0!==this.eventScore&&void 0!==this.context&&this.eventScore.call(this.context,this.score)}addRobot(e){this.listRobot.push(e),e.team=this}readAll(){this.listRobot.forEach(e=>e.read())}getRobots(){return this.listRobot}actualise(e=[]){for(let t=0;t{i.addEvent(e,t,s),s++})}modifyValue(e,t,s,i){this.setSpeed(s),this.setRange(i),this.setSpeedReload(t),this.setDamage(e)}setRange(e){this.listRobot.forEach(t=>{t.setRange(e)})}setSpeed(e){this.listRobot.forEach(t=>{t.setSpeed(e)})}setSpeedReload(e){this.listRobot.forEach(t=>{t.setSpeedReload(e)})}setDamage(e){this.listRobot.forEach(t=>{t.setDamage(e)})}drawRange(){this.listRobot.forEach(e=>{e.drawRange()})}modifyNodes(e){this.listRobot.forEach(t=>{t.setNodes(e)})}setRobotVisible(e){this.listRobot.forEach(t=>t.setVisible(e))}}class Type extends ManageLang{constructor(e){super("Type",e)}preload(){}create(){super.create();let e={font:HEIGHT_TITLE.toString()+"px stencil",fill:"#e2e2e2"};this.add.text(WIDTH_WINDOW/2,HEIGHT_WINDOW/6,"WARIA",e).setOrigin(.5,.5);let t=this.add.sprite(WIDTH_WINDOW/8*3,HEIGHT_WINDOW/4*2,"duel").setInteractive();this.createbutton(t,"level1");let s=this.add.sprite(WIDTH_WINDOW/8*5,HEIGHT_WINDOW/4*2,"last").setInteractive();this.createbutton(s,"level2");let i=this.add.sprite(WIDTH_WINDOW/2,HEIGHT_WINDOW/4*3,"team").setInteractive();this.createbutton(i,"level3")}createbutton(e,t){WIDTH_WINDOW>HEIGHT_WINDOW?(e.displayHeight=HEIGHT_WINDOW/4,e.scaleX=e.scaleY):(e.displayWidth=WIDTH_WINDOW/4,e.scaleY=e.scaleX),e.on("pointerout",()=>e.setFrame(0)),e.on("pointerover",()=>e.setFrame(1)),e.on("pointerdown",()=>this.clickPlay(t))}clickPlay(e){-1!==father.scene.getIndex("LevelSelect")&&this.father.scene.remove("LevelSelect"),this.father.scene.add("LevelSelect",new LevelSelect(this.father,e)),this.scene.start("LevelSelect")}}var listBonus=[],LANG=navigator.language.substr(0,2).toLowerCase(),SPEED_GAME=1,lSpeedBonus=[],lShieldBonus=[],lAttackBonus=[];const MYSELF="myself",MY_TEAM="myTeam",SHIELD_PER_SECOND=5,COLOR_ATTACK=16711680,COLOR_MOVE=255,COLOR_CONDITION=921102,COLOR_RED=16711680,COLOR_ORANGE=16744192,COLOR_GREEN=32768,COLOR_RANGE=32768,COLOR_SPEED_RELOAD=8323327,NUMBER_LEVEL=2,COLOR_SELECTED=15718407,COLOR_MYSELF=6711039,WIDTH_WINDOW=$(document).width()-20,HEIGHT_WINDOW=$(document).height()-20;var OFFY_MAP,WIDTH_MAP,OFFY_TREE_BEGIN,CENTERX_TREE,HEIGHT_TITLE,HEIGHT_NODE,HEIGHT_BUTTON_TEXT,OFFX_MAP=WIDTH_WINDOW/20,ORIENTATION_VERTICAL=!0;WIDTH_WINDOW.4*HEIGHT_WINDOW&&(WIDTH_MAP=.4*HEIGHT_WINDOW,OFFX_MAP*=3),OFFY_TREE_BEGIN=WIDTH_MAP+2*OFFY_MAP,CENTERX_TREE=WIDTH_WINDOW/2,HEIGHT_TITLE=WIDTH_WINDOW/5,HEIGHT_NODE=(HEIGHT_WINDOW-WIDTH_MAP)/6):(ORIENTATION_VERTICAL=!1,HEIGHT_NODE=HEIGHT_WINDOW/7,HEIGHT_BUTTON_TEXT=HEIGHT_WINDOW/9,(WIDTH_MAP=.8*HEIGHT_WINDOW)>.5*WIDTH_WINDOW&&(HEIGHT_NODE=(WIDTH_WINDOW-((WIDTH_MAP=.4*WIDTH_WINDOW)+OFFX_MAP))/6,HEIGHT_BUTTON_TEXT=HEIGHT_WINDOW/15),OFFY_TREE_BEGIN=(OFFY_MAP=(HEIGHT_WINDOW-WIDTH_MAP)/2)+WIDTH_MAP/8,CENTERX_TREE=(WIDTH_WINDOW-(WIDTH_MAP+OFFX_MAP+WIDTH_MAP/4))/2+(WIDTH_MAP+OFFX_MAP+WIDTH_MAP/4),HEIGHT_TITLE=HEIGHT_WINDOW/5);const WIDTH_LINE=HEIGHT_NODE/20,OFFX_TREE=HEIGHT_NODE,OFFY_TREE=1.1*HEIGHT_NODE,WIDTH_BUTTON=WIDTH_MAP/10,SCORE_HIT=5,SCORE_KILL=15,SCORE_BONUS=4,HEIGHT_BAR=WIDTH_MAP/20,LIFE=100,SHIELD=100,VALUE_MAX_BAR=5,SPEED=WIDTH_MAP/1e3,SPEED_BASE=1,SPEED_BEGIN=3,RANGE=WIDTH_MAP/16,RANGE_BASE=3,RANGE_BEGIN=2,SPEED_RELOAD=4e3,SPEED_RELOAD_BASE=2,SPEED_RELOAD_BEGIN=3,DAMAGE=2,DAMAGE_BASE=10,DAMAGE_BEGIN=2,HEIGHT_BONUS=WIDTH_MAP/10,HEIGHT_DAMAGE=WIDTH_MAP/20,DURATION_DAMAGE=700;class Winner extends Finish{constructor(e,t,s){super(e,t,s)}create(){super.create(),super.addTitle(selectWord("YOU WIN","PARTIE GAGNÉE")),super.btnRetry(super.createButton(WIDTH_WINDOW/4,"retry")),super.btnHome(super.createButton(WIDTH_WINDOW/2,"home")),getNextLevel(this.gameSave.level)===this.gameSave.level||super.btnNext(super.createButton(WIDTH_WINDOW/4*3,"next"))}} \ No newline at end of file +class AddAttack extends AddNode{constructor(e,t,s,i=!0){i?super(e,t,s):super(e,t,s,!1,s.node.percentRange)}create(){console.log("ATTACK"),super.create(),super.addTitle(WIDTH_WINDOW/2,HEIGHT_WINDOW/16,selectWord("ADD NODE : ATTACK","AJOUTER ACTION : ATTAQUE")),super.addTitle(WIDTH_WINDOW/2,HEIGHT_WINDOW/(16/3),selectWord("WHO ?","QUI ?")),super.addTitle(WIDTH_WINDOW/2,HEIGHT_WINDOW/(16/7),selectWord("TARGET FILTERS","FILTRES CIBLES")),super.addButton(WIDTH_WINDOW/2,HEIGHT_WINDOW/3.2,"enemyBot",super.newCategory("target",!0,!0),!1);let e=super.newCategory("range",!0,!0);super.addButton(WIDTH_WINDOW/3,HEIGHT_WINDOW/(16/9),"shortRange",e,1/3),super.addButton(WIDTH_WINDOW/1.5,HEIGHT_WINDOW/(16/9),"mediumRange",e,2/3),super.addButton(WIDTH_WINDOW/2,HEIGHT_WINDOW/(16/12),"longRange",e,1)}addNode(){super.verifyCategory()&&(this.selected.addRect(new RectangleNode(this.selected.getX(),this.selected.getY()+200,this.gameR,"attack",[this.lCategory[1].getValue()])),super.cancel())}modifyNode(){super.verifyCategory()&&(this.selected.node.percentRange=this.lCategory[1].getValue(),this.selected.rect.setFrame(this.selected.node.getFrame()),super.cancel())}}class AddCondition extends AddNode{constructor(e,t,s,i=!0){i?super(e,t,s):s.node.shieldFilter?super(e,t,s,s.node.myself,[s.node.shield,"shield"]):super(e,t,s,s.node.myself,[s.node.range,"range"])}create(){super.create(),console.log("CONDITION"),super.addTitle(WIDTH_WINDOW/2,HEIGHT_WINDOW/16,selectWord("ADD NODE : CONDITION","AJOUTER ACTION : CONDITION")),super.addTitle(WIDTH_WINDOW/2,HEIGHT_WINDOW/(16/3),selectWord("WHO ?","QUI ?")),super.addTitle(WIDTH_WINDOW/2,HEIGHT_WINDOW/(16/7),selectWord("TARGET FILTERS","FILTRES CIBLES"));let e=super.newCategory("target",!0,!0);super.addButton(WIDTH_WINDOW/3,HEIGHT_WINDOW/3.2,"enemyBot",e,!1),super.addButton(WIDTH_WINDOW/1.5,HEIGHT_WINDOW/3.2,"myself",e,!0);let t=super.newCategory("shield",!0,!0);super.addButton(WIDTH_WINDOW/8,HEIGHT_WINDOW/(16/9),"shortRange",t,[1/3,"range"]),super.addButton(WIDTH_WINDOW/4*1.5,HEIGHT_WINDOW/(16/9),"mediumRange",t,[2/3,"range"]),super.addButton(WIDTH_WINDOW/4,HEIGHT_WINDOW/(16/12),"longRange",t,[1,"range"]);let s=this.add.graphics();s.lineStyle(10,16777215,1),s.lineBetween(WIDTH_WINDOW/2,HEIGHT_WINDOW/2,WIDTH_WINDOW/2,HEIGHT_WINDOW/(16/13)),super.addButton(WIDTH_WINDOW/8*5,HEIGHT_WINDOW/(16/9),"shield0",t,[0,"shield"]),super.addButton(WIDTH_WINDOW/8*7,HEIGHT_WINDOW/(16/9),"shield33",t,[1/3,"shield"]),super.addButton(WIDTH_WINDOW/8*5,HEIGHT_WINDOW/(16/12),"shield66",t,[2/3,"shield"]),super.addButton(WIDTH_WINDOW/8*7,HEIGHT_WINDOW/(16/12),"shield100",t,[1,"shield"])}addNode(){super.verifyCategory()&&("range"===this.lCategory[1].getValue()[1]?this.selected.addRect(new RectangleNode(this.selected.getX(),this.selected.getY()+200,this.gameR,"condition",[this.lCategory[0].getValue(),!1,!0,0,this.lCategory[1].getValue()[0]])):this.selected.addRect(new RectangleNode(this.selected.getX(),this.selected.getY()+200,this.gameR,"condition",[this.lCategory[0].getValue(),!0,!1,this.lCategory[1].getValue()[0],0])),super.cancel())}modifyNode(){super.verifyCategory()&&(this.selected.node.shieldFilter=!1,this.selected.node.rangeFilter=!1,"range"===this.lCategory[1].getValue()[1]?(this.selected.node.rangeFilter=!0,this.selected.node.range=this.lCategory[1].getValue()[0]):(this.selected.node.shieldFilter=!0,this.selected.node.shield=this.lCategory[1].getValue()[0]),this.selected.node.myself=this.lCategory[0].getValue(),this.selected.rect.setFrame(this.selected.node.getFrame()),super.cancel())}}class AddMove extends AddNode{constructor(e,t,s,i=!0){i?super(e,t,s):super(e,t,s,s.node.toward,s.node.enemyBot,s.node.typeBonus)}create(){console.log("MOVE"),super.create(),super.addTitle(WIDTH_WINDOW/2,HEIGHT_WINDOW/16,selectWord("ADD NODE : MOVE","AJOUTER ACTION : DEPLACEMENT"));let e=super.addTitle(WIDTH_WINDOW/4,HEIGHT_WINDOW/(16/3),selectWord("FLEE OR MOVE ?","RECULER OU AVANCER ?"));e.displayWidth>WIDTH_WINDOW/2&&(e.displayWidth=WIDTH_WINDOW/2,e.scaleY=e.scaleX);let t=super.newCategory("direction",!0,!0);super.addButton(WIDTH_WINDOW/6,HEIGHT_WINDOW/3.2,"fleeFrom",t,!1),super.addButton(WIDTH_WINDOW/3,HEIGHT_WINDOW/3.2,"moveToward",t,!0),(e=super.addTitle(WIDTH_WINDOW/4*3,HEIGHT_WINDOW/(16/3),selectWord("WHO ?","QUI ?"))).displayWidth>WIDTH_WINDOW/2&&(e.displayWidth=WIDTH_WINDOW/2,e.scaleY=e.scaleX);let s=super.newCategory("target",!0,!0);super.addButton(WIDTH_WINDOW/6*4,HEIGHT_WINDOW/3.2,"enemyBot",s,!0);let i=super.addButton(WIDTH_WINDOW/6*5,HEIGHT_WINDOW/3.2,"bonus",s,!1);e=super.addTitle(WIDTH_WINDOW/2,HEIGHT_WINDOW/(16/7),selectWord("WHAT BONUS ? (OPTIONAL)","QUEL BONUS ? (FACULTATIF)"));let h=super.newCategory("target",!0,!1),a=super.addButton(WIDTH_WINDOW/3,HEIGHT_WINDOW/(16/9),"bonusSpeed",h,"speed"),o=super.addButton(WIDTH_WINDOW/1.5,HEIGHT_WINDOW/(16/9),"bonusAttack",h,"attack"),n=super.addButton(WIDTH_WINDOW/2,HEIGHT_WINDOW/(16/12),"bonusShield",h,"shield");s.addEvent(()=>this.clickBonus(i,e,a,o,n)),this.clickBonus(i,e,a,o,n)}clickBonus(e,...t){e.isTinted?t.forEach(e=>e.setVisible(!0)):t.forEach(e=>e.setVisible(!1))}addNode(){super.verifyCategory()&&(this.selected.addRect(new RectangleNode(this.selected.getX(),this.selected.getY()+200,this.gameR,"move",[this.lCategory[0].getValue(),this.lCategory[1].getValue(),this.lCategory[2].getValue()])),super.cancel())}modifyNode(){super.verifyCategory()&&(this.selected.node.toward=this.lCategory[0].getValue(),this.selected.node.enemyBot=this.lCategory[1].getValue(),this.selected.node.typeBonus=this.lCategory[2].getValue(),this.selected.rect.setFrame(this.selected.node.getFrame()),super.cancel())}}class Attack extends Node{constructor(e=1){super("attack"),e>1/3?e>2/3?(e=1,this.percentBonus=1):(e=2/3,this.percentBonus=1.5):(e=1/3,this.percentBonus=2),this.percentRange=e}do(e){return!(!e.haveTarget()||!e.isTargetInRange(this.percentRange))&&e.attackTarget(this.percentBonus)}getFrame(){return 3*this.percentRange-1}getTreeJson(){return super.getTreeJson(this.getOptionJson())}getOptionJson(){return this.percentRange}}class Bar extends HealthBar{constructor(e,t="",s,i,h,a,o,n=new CategoryBar,r=1,l){super(e,t,s,i,h,a,void 0!==l?l:n.valueMax,o,o,!1),this.name=t,this.scene=e,this.scene.input.on("pointerdown",this.doDrag,this);let d={font:i.toString()+"px stencil",fill:"#e2e2e2"};this.text=this.scene.add.text(this.bar.x+this.width+10,this.bar.y,this.value.toString(),d).setOrigin(0,0),this.categoryBar=n,this.setValue(0),this.categoryBar.setValueOf(this,r)}addEvent(e,t){this.event=e,this.context=t,this.doEvent()}doDrag(){let e=this.scene.input;e.x>=this.bar.x-10&&e.x<=this.bar.x+this.width+10&&e.y>=this.bar.y&&e.y<=this.bar.y+this.height&&(this.scene.pauseScene(),this.clickOn())}clickOn(){this.onMove(),this.scene.input.on("pointermove",()=>this.onMove()),this.scene.input.on("pointerup",()=>this.stopClick())}stopClick(){this.scene.input.off("pointermove"),this.scene.input.off("pointerup")}onMove(){this.setValWithX(this.scene.input.x)}doEvent(){void 0!==this.event&&void 0!==this.context&&this.event.call(this.context,this.value)}setValWithX(e){let t=this.value;this.categoryBar.setValueOf(this,Math.round((e-this.bar.x)/this.width*this.valueMax)),t!==this.value&&this.doEvent()}draw(){super.draw();let e=this.value/this.valueMax*this.width-5;this.bar.fillStyle(9868950),this.bar.fillRect(e,0,10,this.height),void 0!==this.text&&this.text.setText(this.value+1)}getJson(e=[]){let t=super.getJson();return t=t.substr(0,t.length-1)+",",t+='"lText":[',e.forEach(e=>{t+='"'+e+'",'}),t=endLineJson(t),t+="]",t+="}"}destroy(){super.destroy(),this.text.destroy(),this.scene.input.off("pointerdown",this.doDrag,this)}}class BonusAttack extends Bonus{constructor(e,t,s){super(e,t,s,"attack")}useOn(e){super.useOn(e),e.setAttackBonus(this.value)}}class BonusHealth{constructor(e,t){this.value=e,this.color=t}decrease(e){this.value-=e;let t=0;return this.value<0&&(t=-this.value,this.value=0),t}}class BonusShield extends Bonus{constructor(e,t,s,i,h){super(e,t,s,"shield"),this.time=i,this.color=h}useOn(e,t){super.useOn(e);let s=new BonusHealth(this.value,this.color);e.shield.addBonus(s),t.time.addEvent({delay:this.time,callback:()=>e.shield.removeBonus(s)})}}class BonusSpeed extends Bonus{constructor(e="",t,s,i){super(e,t,s,"speed"),this.time=i}useOn(e,t){super.useOn(e),e.increaseSpeedBonus(this.value-1),t.time.addEvent({delay:this.time,callback:()=>e.decreaseSpeedBonus(this.value-1)})}}class BonusView extends Phaser.GameObjects.Image{constructor(e,t,s,i){super(e,t,s,i.texture),this.setOrigin(.5,.5),this.displayHeight=HEIGHT_BONUS,this.scaleX=this.scaleY,e.add.existing(this),this.bonus=i}useOn(e){this.bonus.useOn(e,this.scene),this.destroy()}}class Boot extends ManageLang{constructor(e){super("Boot",e)}create(){super.create();let e={font:HEIGHT_TITLE.toString()+"px stencil",fill:"#e2e2e2"};this.add.text(WIDTH_WINDOW/2,HEIGHT_WINDOW/3,"WARIA",e).setOrigin(.5,.5);let t=this.add.sprite(WIDTH_WINDOW/2,HEIGHT_WINDOW/3*2,"playLetter").setInteractive();WIDTH_WINDOW>HEIGHT_WINDOW?(t.displayHeight=HEIGHT_WINDOW/5,t.scaleX=t.scaleY):(t.displayWidth=WIDTH_WINDOW/1.5,t.scaleY=t.scaleX),t.on("pointerout",()=>t.setFrame(0)),t.on("pointerover",()=>t.setFrame(1)),t.on("pointerdown",()=>this.clickPlay(t))}clickPlay(e){console.log("Play"),this.father.scene.add("Type",new Type(this.father)),this.scene.start("Type")}}class Button extends Phaser.GameObjects.Sprite{constructor(e,t,s,i,h,a,o,n=0,r=!0){super(e,t,s,a),this.name=a,this.setInteractive().setVisible(r),this.displayHeight=h,this.displayWidth=i,this.line=n,this.on("pointerout",()=>this.changeFrame(0)),this.on("pointerover",()=>this.changeFrame(1)),this.on("pointerdown",o),this.changeFrame(0),e.add.existing(this)}changeFrame(e=0){this.setFrame(e+2*this.line)}}class Category{constructor(e="undefined",t=!0,s=!0){this.name=e,this.single=t,this.lBtn=[],this.lValue=[],this.obligatory=s}getValue(){return this.single?this.lValue[0]:this.lValue}validate(){return!(0===this.lBtn.length&&this.obligatory)}addEvent(e){this.event=e}add(e,t){0!==this.lBtn.length&&this.single&&(this.lBtn[0].clearTint(),this.lValue=[],this.lBtn=[]),this.lValue.push(t),this.lBtn.push(e),e.tint=COLOR_SELECTED,this.oneChange()}remove(e){let t=this.lBtn.indexOf(e);-1!==t&&(this.lBtn.splice(t,1),this.lValue.splice(t,1)),e.clearTint(),this.oneChange()}oneChange(){void 0!==this.event&&this.event()}}class CategoryBar{constructor(e=VALUE_MAX_BAR,t=1){this.startValue=t,this.valueMax=e,this.point=this.valueMax}addPoint(e){if(this.point+=e,this.point<0){let e=this.point;return this.point=0,e}return this.point>this.valueMax&&(this.point=this.valueMax),0}setValueOf(e,t){let s=t-e.value,i=e.value;this.point>=s?e.setValue(t):e.setValue(e.value+this.point),this.addPoint(i-e.value),this.draw()}addText(e,t,s,i,h){this.text=t;let a={font:h.toString()+"px stencil",fill:"#e2e2e2"};this.textScene=e.add.text(s,i,this.text,a).setOrigin(0,0),this.draw()}setTextPos(e,t){this.textScene.setX(e),this.textScene.setY(t)}setText(e){this.text=e,this.draw()}draw(){this.textScene.setText(this.text+this.point)}destroy(){this.textScene.destroy()}}class Condition extends Node{constructor(e,t=!1,s=!1,i,h){super("condition"),this.shieldFilter=t,this.rangeFilter=s,this.shield=i,this.range=h,this.myself=e,this.lNode=[]}addNode(e){this.lNode.push(e)}do(e){if(this.doCondition(e))for(let t=0;te+=t.getTreeJson()+","),e=endLineJson(e),e+="]}"}getOptionJson(){return this.myself+","+this.shieldFilter+","+this.rangeFilter+","+this.shield+","+this.range}}class Description extends ManageLang{constructor(e){super("Description",e)}create(){super.create();let e=WIDTH_WINDOW/2,t=HEIGHT_WINDOW,s=this.add.image(e,t,"cancel").setOrigin(.5,1).setInteractive();s.on("pointerover",()=>s.setFrame(1)),s.on("pointerout",()=>s.setFrame(0)),s.on("pointerdown",()=>this.return()),s.displayHeight=HEIGHT_WINDOW/10,s.scaleX=s.scaleY,this.loadBonus()}loadBonus(){let e,t,s;this.width=WIDTH_WINDOW/3-20,this.height=HEIGHT_WINDOW/4,WIDTH_WINDOW>HEIGHT_WINDOW?(this.nbWidth=1,this.nbHeight=3,e=WIDTH_WINDOW/3,t=0,s=0):(this.nbWidth=3,this.nbHeight=1,e=0,t=HEIGHT_WINDOW/3.5,s=WIDTH_BUTTON/1.5);let i=WIDTH_BUTTON/1.5;this.createList(lShieldBonus,s,i,!0),s+=e,i+=t,this.createList(lSpeedBonus,s,i,!1),s+=e,i+=t,this.createList(lAttackBonus,s,i,!1)}createList(e,t,s,i=!0){this.createCategoryBonus(t,s,this.width*this.nbWidth,this.height*this.nbHeight),e.forEach(e=>{let h="";void 0!==e.time&&(h=" - "+selectWord("TIME","TEMPS")+" : "+e.time/1e3);let a="";if(void 0!==e.value){let t="x";i&&(t="+"),a="BONUS : "+t+e.value}this.createBonusDescription(t,s,this.width,this.height,e.texture,e.name,a+h),this.nbHeight>1&&(s+=this.height),this.nbWidth>1&&(t+=this.width)})}createCategoryBonus(e,t,s,i){e+=10,t+=10,this.add.rectangle(e,t,s,i,8816262).setOrigin(0,0)}createBonusDescription(e,t,s,i,h,a,o){e+=20,t+=20,s-=20,i-=20,this.add.rectangle(e,t,s,i,16777215).setOrigin(0,0);let n=this.add.image(e+5,t+5,h).setOrigin(0,0),r={fill:"#000000"};WIDTH_WINDOW>HEIGHT_WINDOW?(n.displayHeight=s/5,n.scaleX=n.scaleY,r.font=(n.displayHeight/3).toString()+"px stencil",this.add.text(e+n.displayWidth+10,t+5+n.displayHeight/2,a.toString(),r).setOrigin(0,.5),r.font=(n.displayHeight/4).toString()+"px stencil",this.add.text(e+5,t+n.displayHeight+(i-n.displayHeight)/2,o.toString(),r).setOrigin(0,.5)):(n.displayHeight=i/2,n.scaleX=n.scaleY,n.displayWidth>s&&(n.displayWidth=s,n.scaleY=n.scaleX),r.font=(s/10).toString()+"px stencil",this.add.text(e+5,t+n.displayHeight+(i-n.displayHeight)/3,a.toString(),r).setOrigin(0,0),r.font=(s/15).toString()+"px stencil",this.add.text(e+5,t+n.displayHeight+(i-n.displayHeight)/1.5,o.toString(),r).setOrigin(0,1))}return(){this.father.scene.start("Game"),this.father.scene.remove("Description")}}class Game extends ManageLang{constructor(e,t="level1"){super("Game",e),super.addOtherScenes("GamingBoard"),SPEED_GAME=1,this.level=t,this.listPositionRobotInit=[],this.scoreText=0}preload(){let e,t={font:"100px stencil",fill:"#e2e2e2"};this.load.on("start",()=>{(e=this.add.text(.5*WIDTH_WINDOW,.5*HEIGHT_WINDOW,selectWord("LEVEL LOADING ...","CHARGEMENT DU NIVEAU ..."),t).setOrigin(.5,.5)).alpha=.5}),this.load.on("complete",()=>{e.destroy()}),this.cache.json.exists("level")&&this.cache.json.remove("level"),this.load.json("level","public/json/"+this.level+".json"),console.log("PRELOAD"),this.createGamingBoard()}create(){super.create();let e=this.cache.json.get("level");if(void 0!==e)this.loadSave(e),this.doLine=!1,this.createButtons(),this.input.keyboard.on("keydown-DELETE",()=>{this.clickBin()}),this.input.keyboard.on("keydown-E",()=>{this.clickPencil()}),this.input.keyboard.on("keydown-ENTER",()=>{this.clickPlus()}),this.scene.setVisible(!0,"GamingBoard"),this.setScore(0),this.gm.getMyTeam().addEventScore(this.setScore,this);else{console.log("ERROR : LEVEL UNDEFINED ("+this.level+")"),new Button(this,10,10,WIDTH_BUTTON,WIDTH_BUTTON,"back",()=>this.clickBack()).setOrigin(0,0);let e={font:"50px stencil",fill:"#e2e2e2"};this.add.text(WIDTH_WINDOW/2,HEIGHT_WINDOW/2,selectWord("LEVEL UNDEFINED","NIVEAU INDEFINI"),e).setOrigin(.5,.5)}}update(e,t){super.update(e,t),this.doLine&&this.tree.updateLine()}createGamingBoard(){this.gm=new GamingBoard(this),-1!==this.father.scene.getIndex("GamingBoard")&&this.father.scene.remove("GamingBoard"),this.father.scene.add("GamingBoard",this.gm),this.scene.launch("GamingBoard"),this.gm.pause()}loadSave(e){this.loadBonus(e.lBonus),this.loadTeam(e);let t=[];if(this.gm.getMyTeam().listRobot.forEach(e=>t.push(e)),void 0!==this.listRobot)for(let e=0;e1&&this.robotSelected.setTint(COLOR_SELECTED)}applyTree(){void 0!==this.tree&&void 0!==this.robotSelected&&(this.tree.sort(),this.robotSelected.setNodes(this.tree.getNode()))}loadTree(e,t=CENTERX_TREE,s=OFFY_TREE_BEGIN){let i;if(void 0!==e.x&&void 0!==e.y)i=new RectangleNode(e.x,e.y,this,e.type,e.option),void 0!==e.lNode&&e.lNode.length>0&&e.lNode.forEach(e=>i.addRect(this.loadTree(e)));else if(i=new RectangleNode(t,s,this,e.type,e.option),void 0!==e.lNode&&e.lNode.length>0){let h=e.lNode.length,a=t-OFFX_TREE/2*(h-1),o=s+OFFY_TREE;e.lNode.forEach(e=>{i.addRect(this.loadTree(e,a,o)),a+=OFFX_TREE})}return i}loadInitSave(e,t,...s){let i=new InitStat(this,OFFX_MAP+WIDTH_MAP+5,OFFY_MAP,7*HEIGHT_BAR,HEIGHT_BAR,e.valueMax);for(let t=0;t{t+=this.loadT(s.name,s.freeForAll,s.robots,e.robotRandomPosition,t,s.color)}),this.gm.addEventMyTeam(this.setRobotSelected,this)}}loadT(e=MY_TEAM,t,s,i,h=0,a){let o=new Team(e,t);return this.loadRobot(s,i,h).forEach(e=>o.addRobot(e)),void 0!==a&&o.getRobots().forEach(e=>e.setTint(a)),this.gm.addTeam(o),o.listRobot.length}loadRobot(e=[],t=!1,s=0){let i=s,h=[];return e.forEach(e=>{let s=[];e.lNode.forEach(e=>{s.push(this.loadNode(e))}),t&&(void 0===this.listPositionRobotInit[i]?(e.x=Math.random()*(1-e.width/2-e.width/2)+e.width/2,e.y=Math.random()*(1-e.height/2-e.height/2)+e.height/2,this.listPositionRobotInit[i]=new Position(e.x,e.y)):(e.x=this.listPositionRobotInit[i].x,e.y=this.listPositionRobotInit[i].y)),h.push(new Robot(WIDTH_MAP*e.height,WIDTH_MAP*e.width,WIDTH_MAP*e.x,WIDTH_MAP*e.y,this.gm,e.name,e.speed,e.speedReload,e.range,e.damage,s)),i+=1}),h}loadNode(e){let t;switch(e.type){case"condition":t=new Condition(e.option[0],e.option[1],e.option[2],e.option[3],e.option[4]);break;case"move":t=new Move(e.option[0],e.option[1]);break;case"attack":t=new Attack(e.option[0]);break;default:return}return void 0!==e.lNode&&e.lNode.forEach(e=>t.addNode(this.loadNode(e))),t}loadBonus(e=[]){e.forEach(e=>{this.gm.addBonus(this.loadB(e))})}loadB(e){let t;switch(e.style){case"speed":t=lSpeedBonus[e.number];break;case"attack":t=lAttackBonus[e.number];break;case"shield":t=lShieldBonus[e.number];break;default:return null}return new BonusView(this.gm,e.x*WIDTH_MAP,e.y*WIDTH_MAP,t)}finish(){let e;console.log("FINISH"),e=this.gm.winner()?new Winner(this.father,this,this.score):new Looser(this.father,this,this.score),this.father.scene.add("Finish",e),this.scene.pause("Game"),this.scene.launch("Finish"),this.robotSelected=void 0}clickNode(){this.tryClick(),this.selected=this.tree.getSelected(),void 0!==this.selected&&(this.selected!==this.tree&&(this.pencilBtn.setVisible(!0),this.binBtn.setVisible(!0)),this.selected.canAddNode&&this.plusBtn.setVisible(!0))}doDrag(e,t,s,i){t.setX(s),t.setY(i)}dragStart(){console.log("START DRAG"),this.doLine=!0,this.pauseScene()}dragEnd(){console.log("END DRAG"),this.applyTree(),this.doLine=!1}pauseScene(){this.playBtn.line=0,this.playBtn.changeFrame(0),this.gm.pause()}resume(){this.playBtn.line=1,this.playBtn.changeFrame(0),this.gm.resume()}createButtons(){let e=WIDTH_MAP+OFFX_MAP,t=WIDTH_MAP+OFFY_MAP+5,s=WIDTH_BUTTON,i=1.1*s,h=0;new Button(this,10,10,s,s,"back",()=>this.clickBack()).setOrigin(0,0),new Button(this,WIDTH_WINDOW-i,HEIGHT_WINDOW,s,s,"bonusBtn",()=>this.clickBonus()).setOrigin(1,1),new Button(this,WIDTH_WINDOW,HEIGHT_WINDOW,s,s,"save",()=>this.clickSave()).setOrigin(1,1),this.playBtn=new Button(this,e,t,s,s,"play",()=>this.clickPlay()).setOrigin(1,0),h=1===SPEED_GAME?0:1,this.speedBtn=new Button(this,e-i,t,s,s,"speed",()=>this.clickSpeed(),h).setOrigin(1,0),this.pencilBtn=new Button(this,e-2*i,t,s,s,"pencil",()=>this.clickPencil(),0,!1).setOrigin(1,0),this.binBtn=new Button(this,e-3*i,t,s,s,"bin",()=>this.clickBin(),0,!1).setOrigin(1,0),this.plusBtn=new Button(this,e-4*i,t,s,s,"plus",()=>this.clickPlus(),0,!1).setOrigin(1,0),h=this.father.sound.mute?1:0,this.muteBtn=new Button(this,e-5*i,t,s,s,"mute",()=>this.clickMute(),h).setOrigin(1,0);let a={font:(s/2).toString()+"px stencil",fill:"#e2e2e2"};this.scoreText=this.add.text(OFFX_MAP,t,"SCORE : "+this.scoreText,a).setOrigin(0,0),this.input.on("pointerdown",()=>this.clickNode()),this.input.on("drag",this.doDrag),this.input.on("dragstart",()=>this.dragStart()),this.input.on("dragend",()=>this.dragEnd())}setScore(e){this.score=e,this.scoreText.setText("SCORE : "+this.score)}clickBonus(){this.father.scene.stop("GamingBoard"),this.father.scene.remove("GamingBoard"),this.father.scene.add("Description",new Description(this.father,this)),this.scene.start("Description")}clickSave(){let e='{"tree":'+this.tree.getJson()+',"initStat":'+this.initStat.getJson()+"}";console.log(e)}clickPlay(){this.gm.paused?this.resume():this.pauseScene(),this.playBtn.changeFrame(1)}clickSpeed(){1===SPEED_GAME?(SPEED_GAME=2,this.speedBtn.line=1):(SPEED_GAME=1,this.speedBtn.line=0),this.gm.time.timeScale=SPEED_GAME,this.speedBtn.changeFrame(1)}clickPencil(){if(void 0!==this.selected){switch(console.log("PENCIL"),this.selected.type){case"attack":this.father.scene.add("AddNode",new AddAttack(this.father,this,this.selected,!1));break;case"move":this.father.scene.add("AddNode",new AddMove(this.father,this,this.selected,!1));break;case"condition":this.father.scene.add("AddNode",new AddCondition(this.father,this,this.selected,!1));break;default:return}this.scene.pause("Game"),this.scene.launch("AddNode")}}clickBin(){void 0!==this.selected&&(console.log("BIN"),this.tree.delete(this.selected),this.binBtn.changeFrame(0),this.tryClick())}clickPlus(){void 0!==this.selected&&this.selected.canAddNode&&(console.log("PLUS"),this.father.scene.add("PlusNode",new PlusNode(this.father,this,this.selected)),this.scene.launch("PlusNode"),this.plusBtn.changeFrame(0),this.scene.pause("Game"))}clickBack(){console.log("BACK"),this.father.scene.stop("GamingBoard"),this.father.scene.remove("GamingBoard"),this.father.scene.stop("Game"),this.father.scene.start("Type")}clickMute(){console.log("MUTE"),this.father.sound.mute?(this.father.sound.mute=!1,this.muteBtn.line=0):(this.father.sound.mute=!0,this.muteBtn.line=1),this.muteBtn.changeFrame(1)}tryClick(){this.pencilBtn.setVisible(!1),this.binBtn.setVisible(!1),this.plusBtn.setVisible(!1),void 0!=this.selected&&(this.selected.deselect(),this.selected=void 0)}setLevel(e){this.level!==e&&(this.level=e,this.listPositionRobotInit=[],this.robotSelected=void 0),console.log(this.level)}}class GamingBoard extends Phaser.Scene{constructor(e){super("GamingBoard"),this.listTeam=[],listBonus=[],this.father=e,this.end=!1,this.paused=!1}preload(){this.cameras.main.setViewport(OFFX_MAP,OFFY_MAP,WIDTH_MAP,WIDTH_MAP),this.sound.add("shot"),this.sound.add("hit"),this.scene.setVisible(!1,"GamingBoard")}create(){let e=this.add.image(0,0,"background").setOrigin(0,0);e.alpha=.3,e.displayWidth=WIDTH_MAP,e.displayHeight=WIDTH_MAP,this.time.addEvent({delay:2e3,callback:this.upShield,callbackScope:this})}update(e,t){this.end||this.paused||(this.listTeam.forEach(e=>{e.actualise(this.getEnemyRobotTeam(e))||this.listTeam.splice(this.listTeam.indexOf(e),1)}),this.listTeam.forEach(e=>e.readAll()),(void 0===this.getMyTeam()||this.listTeam.length<=1)&&(this.end=!0,this.finish()))}addEventMyTeam(e,t){this.getMyTeam().addEvent(e,t)}getEnemyRobotTeam(e){let t=[];return this.listTeam.forEach(s=>{(e.freeForAll||s!==e)&&(t=t.concat(s.getRobots()))}),t}setRobotVisible(e=!0){this.listTeam.forEach(t=>t.setRobotVisible(e))}setEnemyRobotVisible(e=!0){let t=this.getMyTeam();this.listTeam.forEach(s=>{t!==s&&s.setRobotVisible(e)})}setBonusVisible(e=!0){listBonus.forEach(t=>t.setVisible(e))}finish(){this.pause(),this.father.finish()}winner(){return void 0!==this.getMyTeam()}pause(){this.sound.pauseAll(),this.paused=!0,this.time.timeScale=0}resume(){this.sound.resumeAll(),this.setRobotVisible(!0),this.setBonusVisible(!0),this.paused=!1,this.time.timeScale=SPEED_GAME}addTeam(e){this.listTeam.push(e)}addBonus(e){listBonus.push(e)}modifyNodes(e){let t=this.getMyTeam();return void 0!==t&&(t.modifyNodes(e),!0)}modifyValue(e,t,s,i){let h=this.getMyTeam();return void 0!==h&&(h.modifyValue(e,t,s,i),!0)}getMyTeam(){for(let e=0;ee.listRobot.forEach(e=>{e.addShield(SHIELD_PER_SECOND)})),this.time.addEvent({delay:1e3,callback:this.upShield,callbackScope:this})}}class InitStat{constructor(e,t,s,i,h,a=10){this.scene=e,this.posX=t,this.posY=s,this.width=i,this.height=h,this.category=new CategoryBar(a),this.lBar=[],this.lText=[],this.category.addText(this.scene,selectWord("TOKENS : ","JETONS : "),this.posX,this.posY,this.height)}addBar(e,t,s,i=[]){this.lText.push(i),this.lBar.push(new Bar(this.scene,selectWord(i[0],i[1]),this.width,this.height,this.posX,this.posY,s,this.category,e,t)),this.posY+=1.5*this.height,this.category.setTextPos(this.posX,this.posY)}getJson(){let e="{";e+=toJson("valueMax",this.category.valueMax),e+='"lBar":[';for(let t=0;te.destroy())}}class LevelSelect extends ManageLang{constructor(e,t=""){super("LevelSelect"),this.father=e,this.level=t,console.log(getCookie(this.level))}create(){super.create();let e={font:HEIGHT_TITLE.toString()+"px stencil",fill:"#e2e2e2"};this.add.text(WIDTH_WINDOW/2,HEIGHT_WINDOW/6,"WARIA",e).setOrigin(.5,.5);let t=parseInt(getCookie(this.level));isNaN(t)&&(t=1);let s=WIDTH_WINDOW/5,i=HEIGHT_WINDOW/3,h=s,a=HEIGHT_WINDOW/2.5;for(let e=1;e<=t&&!(e>NUMBER_LEVEL);e++)this.createLevel(h,a,e),(h+=s)===WIDTH_WINDOW&&(h=s,a+=i);new Button(this,10,10,WIDTH_BUTTON,WIDTH_BUTTON,"back",()=>this.clickBack()).setOrigin(0,0)}createLevel(e,t,s=0){let i;i=WIDTH_WINDOW>HEIGHT_WINDOW?HEIGHT_WINDOW/4:WIDTH_WINDOW/4;let h=this.add.image(e,t,"rectangle").setOrigin(.5,.5).setInteractive();h.displayHeight=h.displayWidth=i;let a={font:(i/2).toString()+"px stencil",fill:"#000000"},o=this.add.text(e,t,s.toString(),a).setOrigin(.5,.5);h.on("pointerover",()=>this.over(h,o)),h.on("pointerout",()=>this.out(h,o)),h.on("pointerdown",()=>this.click(s))}over(e,t){e.setFrame(1),t.setColor("white")}out(e,t){e.setFrame(0),t.setColor("black")}click(e){e-=1,this.level+=e.toString(),newGame(this.father,this.level),this.scene.start("Game")}clickBack(){this.scene.start("Type")}}class LoadFile extends Phaser.Scene{constructor(e,t,s){super("LoadFile"),this.father=e,this.son=s,this.nameSon=t,this.father.scene.pause(this.nameSon),this.father.scene.stop(this.nameSon),this.father.scene.remove("LoadFile")}preload(){let e=this.add.graphics(),t=this.add.graphics(),s=WIDTH_WINDOW/2-160,i=HEIGHT_WINDOW/2-25;t.fillStyle(2236962,.8),t.fillRect(s,i,320,50),this.load.on("progress",function(t){e.clear(),e.fillStyle(16777215,1),e.fillRect(s+10,i+10,300*t,30)}),this.load.on("complete",()=>{e.destroy(),t.destroy()}),this.load.audio("shot","assets/sounds/shot.ogg"),this.load.audio("hit","assets/sounds/hit.ogg"),this.loadImage("en","flags/",!0),this.loadImage("fr","flags/",!0),this.loadImage("bonusSpeed0","bonus/",!0),this.loadImage("bonusSpeed1","bonus/",!0),this.loadImage("bonusSpeed2","bonus/",!0),this.loadImage("bonusAttack0","bonus/",!0),this.loadImage("bonusAttack1","bonus/",!0),this.loadImage("bonusAttack2","bonus/",!0),this.loadImage("bonusShield0","bonus/",!0),this.loadImage("bonusShield1","bonus/",!0),this.loadImage("bonusShield2","bonus/",!0),this.loadImage("enemy","robots/"),this.loadImage("myBot","robots/"),this.loadSprite("playLetter",550,150,"buttons/"),this.loadSprite("cancel",550,150,"buttons/"),this.loadSprite("add",550,150,"buttons/"),this.loadSprite("modify",550,150,"buttons/"),this.loadSprite("home",550,150,"buttons/"),this.loadSprite("next",550,150,"buttons/"),this.loadSprite("retry",550,150,"buttons/"),this.loadSprite("duel",269,262,"buttons/"),this.loadSprite("last",269,262,"buttons/"),this.loadSprite("team",269,262,"buttons/"),this.loadSprite("flag",269,262,"buttons/"),this.loadSprite("map",269,262,"buttons/"),this.loadSprite("play",100,100,"buttons/",!0),this.loadSprite("bin",100,100,"buttons/",!0),this.loadSprite("plus",100,100,"buttons/",!0),this.loadSprite("pencil",100,100,"buttons/",!0),this.loadSprite("speed",100,100,"buttons/",!0),this.loadSprite("mute",100,100,"buttons/",!0),this.loadSprite("save",100,100,"buttons/",!0),this.loadSprite("bonusBtn",100,100,"buttons/",!0),this.loadSprite("back",200,200,"buttons/",!0),this.loadSprite("shortRange",300,150,"buttons/"),this.loadSprite("mediumRange",300,150,"buttons/"),this.loadSprite("longRange",300,150,"buttons/"),this.loadSprite("shield0",300,150,"buttons/"),this.loadSprite("shield33",300,150,"buttons/"),this.loadSprite("shield66",300,150,"buttons/"),this.loadSprite("shield100",300,150,"buttons/"),this.loadSprite("bonusShield",300,150,"buttons/"),this.loadSprite("bonusSpeed",300,150,"buttons/"),this.loadSprite("bonusAttack",300,150,"buttons/"),this.loadSprite("myself",300,150,"buttons/"),this.loadSprite("enemyBot",300,150,"buttons/"),this.loadSprite("bonus",300,150,"buttons/"),this.loadSprite("moveToward",300,150,"buttons/"),this.loadSprite("fleeFrom",300,150,"buttons/"),this.loadSprite("attackNode",180,190,"nodes/",!0),this.loadSprite("moveNode",180,190,"nodes/",!0),this.loadSprite("conditionNode",180,190,"nodes/",!0),this.loadSprite("rectangle",400,400,"buttons/",!0),this.loadImage("background","others/",!0),this.loadImage("bullet","others/",!0),this.loadImage("logoWaria","others/",!0),this.loadImage("attack","nodes/",!0),this.loadImage("move","nodes/",!0),this.loadImage("condition","nodes/",!0),this.cache.json.exists("listBonus")&&(this.cache.json.remove("listBonus"),lSpeedBonus=[],lShieldBonus=[],lAttackBonus=[]),this.load.json("listBonus","public/json/listBonus.json")}create(){this.loadBonus(),-1===this.father.scene.getIndex(this.nameSon)&&this.father.scene.add(this.nameSon,this.son),this.father.scene.start(this.nameSon)}loadBonus(){let e=this.cache.json.get("listBonus");void 0!==e&&(e.lSpeedBonus.forEach(e=>lSpeedBonus.push(new BonusSpeed(selectWord(e.name.en,e.name.fr),e.texture,e.value,e.time))),e.lShieldBonus.forEach(e=>lShieldBonus.push(new BonusShield(selectWord(e.name.en,e.name.fr),e.texture,e.value,e.time,e.color))),e.lAttackBonus.forEach(e=>lAttackBonus.push(new BonusAttack(selectWord(e.name.en,e.name.fr),e.texture,e.value))))}loadSprite(e,t,s,i="",h=!1){this.textures.exists(e)&&h||(this.deleteLoad(e),h?this.load.spritesheet(e,"assets/"+i+e+".png",{frameWidth:t,frameHeight:s}):this.load.spritesheet(e,"assets/lang/"+LANG+"/"+i+e+".png",{frameWidth:t,frameHeight:s}))}loadImage(e,t="",s=!1){this.textures.exists(e)&&s||(this.deleteLoad(e),s?this.load.image(e,"assets/"+t+e+".png"):this.load.image(e,"assets/lang/"+LANG+"/"+t+e+".png"))}deleteLoad(e){this.textures.exists(e)&&this.textures.remove(e)}}class Looser extends Finish{constructor(e,t,s){super(e,t,s)}create(){super.create(),super.addTitle(selectWord("GAME OVER","PARTIE PERDUE")),super.btnRetry(super.createButton(WIDTH_WINDOW/3,"retry")),super.btnHome(super.createButton(WIDTH_WINDOW/1.5,"home"))}}class Missile extends Phaser.GameObjects.Image{constructor(e,t,s,i){super(e,0,0,t),this.visible=!1,this.setOrigin(.5,.5),this.setScale(.02)}}class Move extends Node{constructor(e,t=!0,s){super("move"),this.toward=e,this.enemyBot=t,this.typeBonus=s}do(e){if(this.enemyBot){if(e.verifyTarget())return!0===this.toward?this.moveToward(e):this.fleeFrom(e)}else{let t=chooseTarget(e,this.getListBonus());if(void 0!==t){let s;return(s=!0===this.toward?this.moveToward(e,t):this.fleeFrom(e,t))||(t.useOn(e),listBonus.splice(listBonus.indexOf(t),1),e.target=null),!0}}return!1}getListBonus(){if(void 0!==this.typeBonus){let e=[];return listBonus.forEach(t=>{t.bonus.type===this.typeBonus&&e.push(t)}),e}return listBonus}moveToward(e,t=e.target){return e.advanceTo(t)}fleeFrom(e,t=e.target){return e.fleeFrom(t)}getFrame(){let e;if(e=this.toward?0:5,!this.enemyBot)switch(this.typeBonus){case"speed":e+=2;break;case"attack":e+=3;break;case"shield":e+=4;break;default:e+=1}return e}getTreeJson(){return super.getTreeJson(this.getOptionJson())}getOptionJson(){let e=this.toward+","+this.enemyBot;return void 0!==this.typeBonus&&(e+=',"'+this.typeBonus+'"'),e}}class PlusNode extends Phaser.Scene{constructor(e,t,s){super("PlusNode"),this.father=e,this.gameR=t,this.selected=s}create(){this.add.rectangle(0,0,WIDTH_WINDOW,HEIGHT_WINDOW,0).setOrigin(0,0).setAlpha(.5),this.add.rectangle(0,HEIGHT_WINDOW/2,WIDTH_WINDOW,HEIGHT_WINDOW/2,3487290).setOrigin(0,.5),this.createNode(),this.createButton()}createNode(){let e=WIDTH_WINDOW/2,t=HEIGHT_WINDOW/2,s=WIDTH_WINDOW/3,i=HEIGHT_WINDOW/10,h=i/1.5;ORIENTATION_VERTICAL&&(h/=1.5),this.createBtn(e-s,t,"attack",selectWord("ATTACK","ATTAQUE"),s,i,()=>this.click("attack")),this.createBtn(e,t,"move",selectWord("MOVE","DEPLACEMENT"),s,i,()=>this.click("move")),this.createBtn(e+s,t,"condition",selectWord("CONDITION","CONDITION"),s,i,()=>this.click("condition"))}createBtn(e,t,s,i,h,a,o){let n=this.add.sprite(e,t+a,s).setOrigin(.5,.5).setInteractive().on("pointerdown",o);n.displayHeight=2*a,n.scaleX=n.scaleY,n.displayWidth>h&&(n.displayWidth=h/1.1,n.scaleY=n.scaleX);let r={font:HEIGHT_TITLE.toString()+"px stencil",fill:"#e2e2e2"},l=this.add.text(e,t-a,i,r).setOrigin(.5,.5);return l.displayWidth=n.displayWidth,l.scaleY=l.scaleX,n}click(e){switch(e.toString()){case"attack":this.father.scene.add("AddNode",new AddAttack(this.father,this.gameR,this.selected));break;case"move":this.father.scene.add("AddNode",new AddMove(this.father,this.gameR,this.selected));break;case"condition":this.father.scene.add("AddNode",new AddCondition(this.father,this.gameR,this.selected))}this.scene.launch("AddNode"),this.scene.stop("PlusNode"),this.father.scene.remove("PlusNode")}createButton(){let e=WIDTH_WINDOW/2,t=HEIGHT_WINDOW-100,s=this.add.image(e,t,"cancel").setOrigin(.5,.5).setInteractive();s.on("pointerover",()=>s.setFrame(1)),s.on("pointerout",()=>s.setFrame(0)),s.on("pointerdown",()=>this.cancel()),s.displayHeight=HEIGHT_WINDOW/10,s.scaleX=s.scaleY}cancel(){this.scene.resume("Game"),this.scene.stop("PlusNode"),this.father.scene.remove("PlusNode")}}class Position{constructor(e,t){this.x=e,this.y=t}}class RectangleNode{constructor(e,t,s,i,h=[]){switch(i.toString().toLowerCase()){case"attack":this.rect=new Phaser.GameObjects.Image(s,e,t,"attackNode"),this.node=new Attack(h[0]),this.canAddNode=!1,this.line=s.add.graphics();break;case"move":this.rect=new Phaser.GameObjects.Image(s,e,t,"moveNode"),this.node=new Move(h[0],h[1],h[2]),this.canAddNode=!1,this.line=s.add.graphics();break;case"condition":this.rect=new Phaser.GameObjects.Image(s,e,t,"conditionNode"),this.node=new Condition(h[0],h[1],h[2],h[3],h[4]),this.canAddNode=!0,this.lRect=[],this.scene=s,this.line=s.add.graphics();break;case"waria":this.rect=new Phaser.GameObjects.Image(s,e,t,"logoWaria").setInteractive(),this.canAddNode=!0,this.lRect=[],this.scene=s,this.scene.add.existing(this.rect),this.scene.input.setDraggable(this.rect);break;default:return void console.log("Création d'un node echoué")}"waria"!==i.toString().toLowerCase()&&this.rect.setFrame(this.node.getFrame()),this.type=i,this.rect.on("pointerdown",()=>this.click()),this.rect.setOrigin(.5,0),this.rect.displayHeight=HEIGHT_NODE,this.rect.scaleX=this.rect.scaleY}getSelected(){if(this.rect.isTinted)return this;if(this.canAddNode)for(let e=0;ethis.addLine(e))}addLine(e){e.setLine(this.rect.x,this.rect.y+.9*this.rect.displayHeight)}getNode(){if(void 0===this.node){let e=[];return this.lRect.forEach(function(t){e.push(t.getNode())}),e}return this.canAddNode&&(this.node.clearNodes(),this.lRect.forEach(e=>this.node.addNode(e.getNode()))),this.node}sort(e=((e,t)=>e.getX()-t.getX())){this.canAddNode&&(this.lRect.sort(e),this.lRect.forEach(function(t){t.canAddNode&&t.sort(e)}))}destroy(){this.line.destroy(),this.rect.destroy(),void 0!==this.lRect&&this.lRect.forEach(e=>e.destroy())}delete(e){let t=this.lRect.indexOf(e);if(-1!==t)return this.lRect.splice(t,1),e.destroy(),!0;for(let t=0;tt+=s.getJson(e)+","),t=endLineJson(t)+"]"),t=endLineJson(t),t+="}"}destroy(){this.rect.destroy(),void 0!==this.line&&this.line.destroy(),void 0!==this.lRect&&this.lRect.forEach(e=>e.destroy())}}class Robot{constructor(e,t,s,i,h,a="enemy",o=SPEED_BEGIN,n=SPEED_RELOAD_BEGIN,r=RANGE_BEGIN,l=DAMAGE_BEGIN,d=[]){this.speedBonus=1,this.attackBonus=1,this.name=a,this.height=e,this.width=t,this.x=s,this.y=i,this.life=new HealthBar(h,selectWord("LIFE","VIE"),2*this.width,this.width/3,this.x,this.y-this.width,LIFE,32768),this.shield=new HealthBar(h,selectWord("SHIELD","BOUCLIER"),2*this.width,this.width/3,this.x,this.y-1.5*this.width,SHIELD,255),this.canAttack=!0,this.missile=new Missile(h,"bullet",this.width/5,this.width/4),h.add.existing(this.missile),this.addScene(h),this.lNode=d,this.setSpeed(o),this.setSpeedReload(n),this.setRange(r),this.setDamage(l),this.setX(this.x),this.setY(this.y),this.team=void 0}addScene(e){this.scene=e,"enemy"===this.name?this.circle=this.scene.add.image(this.x,this.y,"enemy").setOrigin(.5,.5).setInteractive():this.circle=this.scene.add.image(this.x,this.y,"myBot").setOrigin(.5,.5).setInteractive(),this.circle.displayWidth=this.width,this.circle.displayHeight=this.height,this.circle.on("pointerdown",()=>this.click())}click(){void 0===this.circleRange?this.drawRange():this.eraseRange(),this.doEvent()}addEvent(e,t,s){this.eventClick=e,this.contextClick=t,this.valueClick=s}doEvent(){void 0!==this.eventClick&&void 0!==this.contextClick&&this.eventClick.call(this.contextClick,this,this.valueClick)}addShield(e){this.shield.increase(e)}setX(e){this.x=e,this.life.setX(this.x),this.shield.setX(this.x),this.circle.setX(this.x),this.drawCircleRange()}setY(e){this.y=e;let t=this.y-this.width,s=this.y-1.5*this.width;t<0?(s=this.y+this.width-this.shield.height,t=this.y+1.5*this.width-this.shield.height):s<0&&(s=t,t=this.y+this.width-this.shield.height),this.life.setY(t),this.shield.setY(s),this.circle.setY(this.y),this.drawCircleRange()}setTint(e){this.circle.setTint(e)}clearTint(){this.circle.clearTint()}setTarget(e){this.target=e}updateTarget(){this.verifyTarget()&&this.setTargetPos(this.target.x,this.target.y)}setTargetPos(e,t){}setDamage(e=this.damage){this.damage=e+DAMAGE_BASE}setRange(e=this.range){this.range=e+RANGE_BASE,this.drawCircleRange()}setSpeed(e=this.speed){this.speed=e+SPEED_BASE}setSpeedReload(e=this.speedReload){this.speedReload=e+SPEED_RELOAD_BASE}setAttackBonus(e){this.attackBonus=e}increaseSpeedBonus(e){this.speedBonus+=e}decreaseSpeedBonus(e){this.speedBonus-=e}advanceToTarget(){return this.verifyTarget()&&this.advanceTo(this.target),!1}advanceTo(e){if(e.x!==this.x||e.y!==this.y){let t=!1,s=!1,i=this.getVelocity(e),h=i[0]+this.x,a=i[1]+this.y;return i[0]>=0&&h>=e.x||i[0]<=0&&h<=e.x?(this.setX(e.x),t=!0):this.setX(this.x+i[0]),i[1]>=0&&a>=e.y||i[1]<=0&&a<=e.y?(this.setY(e.y),s=!0):this.setY(this.y+i[1]),!(t&&s)}return!1}fleeFromTarget(){return!!this.verifyTarget()&&this.fleeFrom(this.target)}fleeFrom(e){if(this.target.x!==this.x||this.target.y!==this.y){let t=this.getVelocity(e,!0);return t[0]>=0&&this.x-this.width/2<=0?this.setX(this.width/2):t[0]<=0&&this.x+this.width/2>=WIDTH_MAP?this.setX(WIDTH_MAP-this.width/2):this.setX(this.x-t[0]),t[1]>=0&&this.y-this.width/2<=0?this.setY(this.height/2):t[1]<=0&&this.y+this.width/2>=WIDTH_MAP?this.setY(WIDTH_MAP-this.height/2):this.setY(this.y-t[1]),!0}return!1}getVelocity(e,t=!1){let s=[],i=e.x-this.x,h=e.y-this.y,a=Math.hypot(i,h);return s[0]=i/a*SPEED*this.speed*this.speedBonus*SPEED_GAME,s[1]=h/a*SPEED*this.speed*this.speedBonus*SPEED_GAME,t&&(this.x+this.width/2+s[0]>WIDTH_MAP||this.x-this.width/2-s[0]<0?(s[1]+=s[0]*Math.sign(s[1]),s[0]=0):(this.y+this.width/2-s[1]>WIDTH_MAP||this.y-this.width/2+s[1]<0)&&(s[0]+=s[1]*Math.sign(-s[0]),s[1]=0)),s}attackTarget(e=0){return!!this.verifyTarget()&&(this.canAttack&&this.attack(this.target,e),!0)}verifyTarget(){return!!this.haveTarget()&&(!!this.target.isAlive()||(this.setTarget(null),!1))}attack(e,t){this.canAttack=!1,this.missile.setPosition(this.x,this.y).setVisible(!0),this.missile.setRotation(Math.atan2(this.y-this.target.y,this.x-this.target.x)-1.57),this.scene.sound.play("shot",{rate:SPEED_GAME});let s=this.calcDistance(this.target)*WIDTH_MAP/1e3;this.scene.tweens.add({targets:this.missile,x:e.x,y:e.y,ease:"Linear",duration:s,onComplete:()=>this.finishAttack(e,t)}),this.scene.time.addEvent({delay:SPEED_RELOAD/this.speedReload,callback:this.reload,callbackScope:this})}finishAttack(e,t){e.beAttack(this.damage*this.attackBonus*DAMAGE*t,this.team)&&this.setTarget(null),this.missile.setVisible(!1),1!==this.attackBonus&&this.setAttackBonus(1)}reload(){this.canAttack=!0}beAttack(e,t){let s=this.shield.decrease(e),i={font:HEIGHT_DAMAGE.toString()+"px stencil",fill:"#ffff00"},h=this.scene.add.text(this.x,this.y,e.toString(),i).setOrigin(0,1);return this.scene.tweens.add({targets:h,x:this.x+30,y:this.y-50,alpha:0,duration:DURATION_DAMAGE,ease:"Sine.easeOut",onComplete:()=>h.destroy()}),this.scene.sound.play("hit",{rate:SPEED_GAME}),console.log("HIT"),s>0&&(console.log("Shield Broken"),this.life.decrease(s)),this.addScore(t),this.die()}addScore(e){void 0!==e&&(e.addScore(SCORE_HIT),0===this.life.value&&e.addScore(SCORE_KILL))}isTargetInRange(e=1){return!!this.haveTarget()&&this.calcDistance(this.target)<=this.range*RANGE*e}calcDistance(e){return Math.hypot(e.x-this.x,e.y-this.y)}isAlive(){return this.life.value>0}die(){return 0===this.life.value&&(void 0!==this.circleRange&&this.circleRange.destroy(),this.circle.destroy(),this.shield.destroy(),this.life.destroy(),!0)}haveTarget(){return null!=this.target}read(){this.verifyTarget();for(let e=0;ethis.addNode(e))}setVisible(e){this.circle.setVisible(e),this.life.setVisible(e),this.shield.setVisible(e),void 0!==this.circleRange&&this.circleRange.setVisible(e)}getTreeJson(){let e="{"+toJson("type","waria");return e+='"lNode":[',this.lNode.forEach(t=>e+=t.getTreeJson()+","),e=endLineJson(e),e+="]}"}copy(e){e.lNode=this.lNode,e.damage=this.damage,e.speedReload=this.speedReload,e.speed=this.speed,e.range=this.range,void 0!==this.circleRange?e.drawRange():e.eraseRange()}}class Team{constructor(e="enemy",t=!1){this.freeForAll=t,this.listRobot=[],this.name=e,this.score=0}addEventScore(e,t){this.eventScore=e,this.context=t}addScore(e){this.score+=e,void 0!==this.eventScore&&void 0!==this.context&&this.eventScore.call(this.context,this.score)}addRobot(e){this.listRobot.push(e),e.team=this}readAll(){this.listRobot.forEach(e=>e.read())}getRobots(){return this.listRobot}actualise(e=[]){for(let t=0;t{i.addEvent(e,t,s),s++})}modifyValue(e,t,s,i){this.setSpeed(s),this.setRange(i),this.setSpeedReload(t),this.setDamage(e)}setRange(e){this.listRobot.forEach(t=>{t.setRange(e)})}setSpeed(e){this.listRobot.forEach(t=>{t.setSpeed(e)})}setSpeedReload(e){this.listRobot.forEach(t=>{t.setSpeedReload(e)})}setDamage(e){this.listRobot.forEach(t=>{t.setDamage(e)})}drawRange(){this.listRobot.forEach(e=>{e.drawRange()})}modifyNodes(e){this.listRobot.forEach(t=>{t.setNodes(e)})}setRobotVisible(e){this.listRobot.forEach(t=>t.setVisible(e))}}class Type extends ManageLang{constructor(e){super("Type",e)}preload(){}create(){super.create();let e={font:HEIGHT_TITLE.toString()+"px stencil",fill:"#e2e2e2"};this.add.text(WIDTH_WINDOW/2,HEIGHT_WINDOW/6,"WARIA",e).setOrigin(.5,.5);let t=this.add.sprite(WIDTH_WINDOW/8*3,HEIGHT_WINDOW/4*2,"duel").setInteractive();this.createbutton(t,"duel");let s=this.add.sprite(WIDTH_WINDOW/8*5,HEIGHT_WINDOW/4*2,"last").setInteractive();this.createbutton(s,"last");let i=this.add.sprite(WIDTH_WINDOW/2,HEIGHT_WINDOW/4*3,"team").setInteractive();this.createbutton(i,"team")}createbutton(e,t){WIDTH_WINDOW>HEIGHT_WINDOW?(e.displayHeight=HEIGHT_WINDOW/4,e.scaleX=e.scaleY):(e.displayWidth=WIDTH_WINDOW/4,e.scaleY=e.scaleX),e.on("pointerout",()=>e.setFrame(0)),e.on("pointerover",()=>e.setFrame(1)),e.on("pointerdown",()=>this.clickPlay(t))}clickPlay(e){-1!==father.scene.getIndex("LevelSelect")&&this.father.scene.remove("LevelSelect"),this.father.scene.add("LevelSelect",new LevelSelect(this.father,e)),this.scene.start("LevelSelect")}}var listBonus=[],LANG=navigator.language.substr(0,2).toLowerCase(),SPEED_GAME=1,lSpeedBonus=[],lShieldBonus=[],lAttackBonus=[];const MYSELF="myself",MY_TEAM="myTeam",SHIELD_PER_SECOND=5,COLOR_ATTACK=16711680,COLOR_MOVE=255,COLOR_CONDITION=921102,COLOR_RED=16711680,COLOR_ORANGE=16744192,COLOR_GREEN=32768,COLOR_RANGE=32768,COLOR_SPEED_RELOAD=8323327,NUMBER_LEVEL=8,COLOR_SELECTED=15718407,COLOR_MYSELF=6711039,WIDTH_WINDOW=window.innerWidth-20,HEIGHT_WINDOW=window.innerHeight-20;var OFFY_MAP,WIDTH_MAP,OFFY_TREE_BEGIN,CENTERX_TREE,HEIGHT_TITLE,HEIGHT_NODE,HEIGHT_BUTTON_TEXT,OFFX_MAP=WIDTH_WINDOW/20,ORIENTATION_VERTICAL=!0;WIDTH_WINDOW.4*HEIGHT_WINDOW&&(WIDTH_MAP=.4*HEIGHT_WINDOW,OFFX_MAP*=3),OFFY_TREE_BEGIN=WIDTH_MAP+2*OFFY_MAP,CENTERX_TREE=WIDTH_WINDOW/2,HEIGHT_TITLE=WIDTH_WINDOW/5,HEIGHT_NODE=(HEIGHT_WINDOW-WIDTH_MAP)/6):(ORIENTATION_VERTICAL=!1,HEIGHT_NODE=HEIGHT_WINDOW/7,HEIGHT_BUTTON_TEXT=HEIGHT_WINDOW/9,(WIDTH_MAP=.8*HEIGHT_WINDOW)>.5*WIDTH_WINDOW&&(HEIGHT_NODE=(WIDTH_WINDOW-((WIDTH_MAP=.4*WIDTH_WINDOW)+OFFX_MAP))/6,HEIGHT_BUTTON_TEXT=HEIGHT_WINDOW/15),OFFY_TREE_BEGIN=(OFFY_MAP=(HEIGHT_WINDOW-WIDTH_MAP)/2)+WIDTH_MAP/8,CENTERX_TREE=(WIDTH_WINDOW-(WIDTH_MAP+OFFX_MAP+WIDTH_MAP/4))/2+(WIDTH_MAP+OFFX_MAP+WIDTH_MAP/4),HEIGHT_TITLE=HEIGHT_WINDOW/5);const WIDTH_LINE=HEIGHT_NODE/20,OFFX_TREE=HEIGHT_NODE,OFFY_TREE=1.1*HEIGHT_NODE,WIDTH_BUTTON=WIDTH_MAP/10,SCORE_HIT=5,SCORE_KILL=15,SCORE_BONUS=4,HEIGHT_BAR=WIDTH_MAP/20,LIFE=100,SHIELD=100,VALUE_MAX_BAR=5,SPEED=WIDTH_MAP/1e3,SPEED_BASE=1,SPEED_BEGIN=3,RANGE=WIDTH_MAP/16,RANGE_BASE=3,RANGE_BEGIN=2,SPEED_RELOAD=4e3,SPEED_RELOAD_BASE=2,SPEED_RELOAD_BEGIN=3,DAMAGE=2,DAMAGE_BASE=10,DAMAGE_BEGIN=2,HEIGHT_BONUS=WIDTH_MAP/10,HEIGHT_DAMAGE=WIDTH_MAP/20,DURATION_DAMAGE=700;class Winner extends Finish{constructor(e,t,s){super(e,t,s),setCookie(t.level.slice(0,-1),parseInt(t.level[t.level.length-1])+2)}create(){super.create(),super.addTitle(selectWord("YOU WIN","PARTIE GAGNÉE")),super.btnRetry(super.createButton(WIDTH_WINDOW/4,"retry")),super.btnHome(super.createButton(WIDTH_WINDOW/2,"home")),getNextLevel(this.gameSave.level)===this.gameSave.level||super.btnNext(super.createButton(WIDTH_WINDOW/4*3,"next"))}} \ No newline at end of file diff --git a/Code/public/js/level3.min.js b/Code/public/js/level3.min.js index b67ab18..bc0b061 100644 --- a/Code/public/js/level3.min.js +++ b/Code/public/js/level3.min.js @@ -1 +1 @@ -class AddNode extends Phaser.Scene{constructor(t,e,s,...i){super("AddNode"),this.father=t,this.gameR=e,this.selected=s,this.lCategory=[];let a=HEIGHT_WINDOW/14;this.style={font:a.toString()+"px stencil",fill:"#e2e2e2"},this.lastCategory=null,void 0===i&&(i=[]),this.option=i}create(){let t=HEIGHT_WINDOW/(4/3);this.add.rectangle(0,0,WIDTH_WINDOW,HEIGHT_WINDOW,0).setOrigin(0,0).setAlpha(.5),this.add.rectangle(0,HEIGHT_WINDOW/2,WIDTH_WINDOW,t,3487290).setOrigin(0,.5),this.createButtonCancel(),this.option.length>0?this.createButtonModify():this.createButtonAdd()}addButton(t,e,s,i=new Category,a){let h=this.createButton(t,e,s);return h.on("pointerdown",()=>this.click(h,i,a)),i!==this.lastCategory&&this.option.length>0&&(this.option[0]===a||void 0!==this.option[0]&&this.option[0].length>0&&this.option[0][0]===a[0]&&this.option[0][1]===a[1])&&(this.option.splice(0,1),this.lastCategory=i,this.click(h,i,a)),h}createButton(t,e,s,i=1.3*HEIGHT_BUTTON_TEXT,a=null){let h=this.add.image(t,e,s).setOrigin(.5,.5).setInteractive();return h.on("pointerover",()=>h.setFrame(1)),h.on("pointerout",()=>h.setFrame(0)),h.displayHeight=i,null===a?h.scaleX=h.scaleY:h.displayWidth=a,h}click(t,e,s){t.isTinted?e.remove(t):e.add(t,s)}newCategory(t,e,s){let i=new Category(t,e,s);return this.lCategory.push(i),i}addTitle(t,e,s){let i=this.add.text(t,e,s,this.style).setOrigin(.5,.5);return i.displayWidth>WIDTH_WINDOW&&(i.displayWidth=WIDTH_WINDOW,i.scaleY=i.scaleX),i}createButtonCancel(){this.createButton(WIDTH_WINDOW/3,HEIGHT_WINDOW/(16/15),"cancel",HEIGHT_BUTTON_TEXT).on("pointerdown",()=>this.cancel())}createButtonAdd(){this.createButton(WIDTH_WINDOW/1.5,HEIGHT_WINDOW/(16/15),"add",HEIGHT_BUTTON_TEXT).on("pointerdown",()=>this.addNode())}createButtonModify(){this.createButton(WIDTH_WINDOW/1.5,HEIGHT_WINDOW/(16/15),"modify",HEIGHT_BUTTON_TEXT).on("pointerdown",()=>this.modifyNode())}verifyCategory(){for(let t=0;tWIDTH_WINDOW&&(i.displayWidth=WIDTH_WINDOW,i.scaleY=i.scaleX),s={font:(e/2).toString()+"px stencil",fill:"#e2e2e2"},this.add.text(WIDTH_WINDOW/2,i.y+i.displayHeight,"SCORE : "+this.score.toString(),s).setOrigin(.5,.5)}createButton(t,e){let s=this.add.image(t,HEIGHT_WINDOW/8*7,e).setOrigin(.5,.5).setInteractive();return s.on("pointerover",()=>s.setFrame(1)),s.on("pointerout",()=>s.setFrame(0)),s.displayHeight=HEIGHT_BUTTON_TEXT,s.scaleX=s.scaleY,s}btnRetry(t){t.on("pointerdown",()=>this.retry())}retry(){this.close(),console.log("RETRY"),-1===this.father.scene.getIndex("Game")&&newGame(this.father),this.father.scene.start("Game")}btnHome(t){t.on("pointerdown",()=>this.home())}home(){console.log("HOME"),this.close(),this.father.scene.remove("Game"),this.father.scene.start("Type")}btnNext(t){t.on("pointerdown",()=>this.next())}next(){console.log("NEXT"),this.gameSave.setLevel(getNextLevel(this.gameSave.level)),this.retry()}close(){this.sound.stopAll(),this.father.scene.remove("GamingBoard"),this.father.scene.remove("Finish")}}class HealthBar{constructor(t,e="",s,i,a,h,r,n,o=COLOR_RED,l=!0){this.bar=new Phaser.GameObjects.Graphics(t),this.width=Math.floor(s),this.height=Math.floor(i),this.valueMax=r,this.value=r,this.color=n,this.colorMin=o,this.bonus=[],this.draw(),t.add.existing(this.bar);let d={font:(i-=4).toString()+"px stencil",fill:"#000000"};this.nameText=t.add.text(a,h,e,d).setOrigin(0,0),this.nameText.alpha=.5,this.setX(a,l),this.setY(h)}addBonus(t){t.value>0&&this.bonus.push(t),this.draw()}removeBonus(t){this.bonus.splice(this.bonus.indexOf(t),1),this.draw()}setValue(t){t<0&&(t=0),t>this.valueMax&&(t=this.valueMax),t!==this.value&&(this.value=t,this.draw())}getValue(){let t=this.value;return this.bonus.forEach(e=>t+=e.value),t}setValueMax(t=this.valueMax){if(t<=0)return;let e=t-this.valueMax;this.valueMax=t,this.setValue(this.value+e)}decrease(t){let e=t;return this.bonus.forEach(s=>{(e=s.decrease(t))>0&&this.bonus.splice(this.bonus.indexOf(s),1)}),this.value-=e,e=0,this.value<0&&(e=-this.value,this.value=0),this.draw(),e}increase(t){this.value+=t,this.value>this.valueMax&&(this.value=this.valueMax),this.draw()}setX(t,e=!0){e&&(t-=this.width/2),this.bar.setX(t),this.nameText.setX(t+5)}setY(t){this.bar.setY(t),this.nameText.setY(t)}draw(){this.bar.clear(),this.bar.fillStyle(0),this.bar.fillRect(0,0,this.width,this.height),this.bar.fillStyle(16777215),this.bar.fillRect(2,2,this.width-4,this.height-4);let t=this.valueMax;this.bonus.forEach(e=>t+=e.value);let e=this.value/this.valueMax;e<1/3?this.bar.fillStyle(this.colorMin):this.bar.fillStyle(this.color);let s=(e=this.value/t)*(this.width-4);this.bar.fillRect(2,2,s,this.height-4);let i=s+2;this.bonus.forEach(e=>{let s=e.value/t;this.bar.fillStyle(e.color);let a=s*(this.width-4);this.bar.fillRect(i,2,a,this.height-4),i+=a})}destroy(){this.bar.destroy(),this.nameText.destroy()}getJson(){let t="{";return t+=toJson("valueMax",this.valueMax)+toJson("color",this.color)+toJson("colorMin",this.colorMin),t=endLineJson(t),t+="}"}setVisible(t){this.bar.setVisible(t),this.nameText.setVisible(t)}}class ManageLang extends Phaser.Scene{constructor(t,e){super(t),this.name=t,this.father=e,this.otherScenes=[]}addOtherScenes(t){this.otherScenes.push(t)}create(){this.createFlags()}createFlags(){this.diffXFlag=0,this.createFlag("fr"),this.createFlag("en")}createFlag(t){let e=this.add.image(WIDTH_WINDOW-10-this.diffXFlag,10,t).setOrigin(1,0).setInteractive();e.displayHeight=WIDTH_BUTTON/2,e.scaleX=e.scaleY,this.diffXFlag=this.diffXFlag+e.displayWidth+10,e.on("pointerdown",()=>this.setLang(t))}setLang(t){t!==LANG&&(LANG=t,this.father.scene.add("LoadFile",new LoadFile(this.father,this.name)),this.father.scene.start("LoadFile"),this.otherScenes.forEach(t=>this.father.scene.stop(t)))}}class Node{constructor(t=""){this.type=t}getTreeJson(t=""){let e="{"+toJson("type",this.type);return e+='"option":['+t+"]}"}} \ No newline at end of file +class AddNode extends Phaser.Scene{constructor(t,e,s,...i){super("AddNode"),this.father=t,this.gameR=e,this.selected=s,this.lCategory=[];let a=HEIGHT_WINDOW/14;this.style={font:a.toString()+"px stencil",fill:"#e2e2e2"},this.lastCategory=null,void 0===i&&(i=[]),this.option=i}create(){let t=HEIGHT_WINDOW/(4/3);this.add.rectangle(0,0,WIDTH_WINDOW,HEIGHT_WINDOW,0).setOrigin(0,0).setAlpha(.5),this.add.rectangle(0,HEIGHT_WINDOW/2,WIDTH_WINDOW,t,3487290).setOrigin(0,.5),this.createButtonCancel(),this.option.length>0?this.createButtonModify():this.createButtonAdd()}addButton(t,e,s,i=new Category,a){let h=this.createButton(t,e,s);return h.on("pointerdown",()=>this.click(h,i,a)),i!==this.lastCategory&&this.option.length>0&&(this.option[0]===a||void 0!==this.option[0]&&this.option[0].length>0&&this.option[0][0]===a[0]&&this.option[0][1]===a[1])&&(this.option.splice(0,1),this.lastCategory=i,this.click(h,i,a)),h}createButton(t,e,s,i=1.3*HEIGHT_BUTTON_TEXT,a=null){let h=this.add.image(t,e,s).setOrigin(.5,.5).setInteractive();return h.on("pointerover",()=>h.setFrame(1)),h.on("pointerout",()=>h.setFrame(0)),h.displayHeight=i,null===a?h.scaleX=h.scaleY:h.displayWidth=a,h}click(t,e,s){t.isTinted?e.remove(t):e.add(t,s)}newCategory(t,e,s){let i=new Category(t,e,s);return this.lCategory.push(i),i}addTitle(t,e,s){let i=this.add.text(t,e,s,this.style).setOrigin(.5,.5);return i.displayWidth>WIDTH_WINDOW&&(i.displayWidth=WIDTH_WINDOW,i.scaleY=i.scaleX),i}createButtonCancel(){this.createButton(WIDTH_WINDOW/3,HEIGHT_WINDOW/(16/15),"cancel",HEIGHT_BUTTON_TEXT).on("pointerdown",()=>this.cancel())}createButtonAdd(){this.createButton(WIDTH_WINDOW/1.5,HEIGHT_WINDOW/(16/15),"add",HEIGHT_BUTTON_TEXT).on("pointerdown",()=>this.addNode())}createButtonModify(){this.createButton(WIDTH_WINDOW/1.5,HEIGHT_WINDOW/(16/15),"modify",HEIGHT_BUTTON_TEXT).on("pointerdown",()=>this.modifyNode())}verifyCategory(){for(let t=0;tWIDTH_WINDOW&&(i.displayWidth=WIDTH_WINDOW,i.scaleY=i.scaleX),s={font:(e/2).toString()+"px stencil",fill:"#e2e2e2"},this.add.text(WIDTH_WINDOW/2,i.y+i.displayHeight,"SCORE : "+this.score.toString(),s).setOrigin(.5,.5)}createButton(t,e){let s=this.add.image(t,HEIGHT_WINDOW/8*7,e).setOrigin(.5,.5).setInteractive();return s.on("pointerover",()=>s.setFrame(1)),s.on("pointerout",()=>s.setFrame(0)),s.displayHeight=HEIGHT_BUTTON_TEXT,s.scaleX=s.scaleY,s}btnRetry(t){t.on("pointerdown",()=>this.retry())}retry(){this.close(),console.log("RETRY"),-1===this.father.scene.getIndex("Game")&&newGame(this.father),this.father.scene.start("Game")}btnHome(t){t.on("pointerdown",()=>this.home())}home(){console.log("HOME"),this.close(),this.father.scene.remove("Game"),this.father.scene.start("Type")}btnNext(t){t.on("pointerdown",()=>this.next())}next(){console.log("NEXT"),this.gameSave.setLevel(getNextLevel(this.gameSave.level)),this.retry()}close(){this.sound.stopAll(),this.father.scene.remove("GamingBoard"),this.father.scene.remove("Finish")}}function selectWord(t,e){switch(LANG){case"fr":return e;default:return t}}function newGame(t,e,s=new Game(t,e)){-1!==t.scene.getIndex("Game")&&t.scene.remove("Game"),t.scene.add("Game",s)}function chooseTarget(t,e){let s=2*WIDTH_MAP,i=[];return e.forEach(function(e){if(e!==t){let a=Math.hypot(e.x-t.x,e.y-t.y);s>=a&&(s>a&&(s=a,i=[]),i.push(e))}}),i.length>1?i[Math.floor(Math.random()*(i.length+1))]:i[0]}function toJson(t,e,s=!1){let i;switch(typeof e){case"string":i='"'+t.toString()+'":"'+e+'"';break;default:i='"'+t.toString()+'":'+e}return s||(i+=","),i}function endLineJson(t){return t.length>0&&","===t[t.length-1]&&(t=t.substr(0,t.length-1)),t}function getNextLevel(t=""){let e=t;return e=e.slice(0,-1)+(parseInt(t[t.length-1])+1).toString(),console.log(t[t.length-1]),e[e.length-1]>=NUMBER_LEVEL?t:e}function setCookie(t,e){let s=new Date;s.setTime(s.getTime()+864e7);let i="expires="+s.toUTCString();document.cookie=t+"="+e+";"+i+";path=/;SameSite=Lax"}function getCookie(t){let e=document.cookie.split("; ");for(let s=0;s0&&this.bonus.push(t),this.draw()}removeBonus(t){this.bonus.splice(this.bonus.indexOf(t),1),this.draw()}setValue(t){t<0&&(t=0),t>this.valueMax&&(t=this.valueMax),t!==this.value&&(this.value=t,this.draw())}getValue(){let t=this.value;return this.bonus.forEach(e=>t+=e.value),t}setValueMax(t=this.valueMax){if(t<=0)return;let e=t-this.valueMax;this.valueMax=t,this.setValue(this.value+e)}decrease(t){let e=t;return this.bonus.forEach(s=>{(e=s.decrease(t))>0&&this.bonus.splice(this.bonus.indexOf(s),1)}),this.value-=e,e=0,this.value<0&&(e=-this.value,this.value=0),this.draw(),e}increase(t){this.value+=t,this.value>this.valueMax&&(this.value=this.valueMax),this.draw()}setX(t,e=!0){e&&(t-=this.width/2),this.bar.setX(t),this.nameText.setX(t+5)}setY(t){this.bar.setY(t),this.nameText.setY(t)}draw(){this.bar.clear(),this.bar.fillStyle(0),this.bar.fillRect(0,0,this.width,this.height),this.bar.fillStyle(16777215),this.bar.fillRect(2,2,this.width-4,this.height-4);let t=this.valueMax;this.bonus.forEach(e=>t+=e.value);let e=this.value/this.valueMax;e<1/3?this.bar.fillStyle(this.colorMin):this.bar.fillStyle(this.color);let s=(e=this.value/t)*(this.width-4);this.bar.fillRect(2,2,s,this.height-4);let i=s+2;this.bonus.forEach(e=>{let s=e.value/t;this.bar.fillStyle(e.color);let a=s*(this.width-4);this.bar.fillRect(i,2,a,this.height-4),i+=a})}destroy(){this.bar.destroy(),this.nameText.destroy()}getJson(){let t="{";return t=endLineJson(t+=toJson("valueMax",this.valueMax)+toJson("color",this.color)+toJson("colorMin",this.colorMin)),t+="}"}setVisible(t){this.bar.setVisible(t),this.nameText.setVisible(t)}}class ManageLang extends Phaser.Scene{constructor(t,e){super(t),this.name=t,this.father=e,this.otherScenes=[]}addOtherScenes(t){this.otherScenes.push(t)}create(){this.createFlags()}createFlags(){this.diffXFlag=0,this.createFlag("fr"),this.createFlag("en")}createFlag(t){let e=this.add.image(WIDTH_WINDOW-10-this.diffXFlag,10,t).setOrigin(1,0).setInteractive();e.displayHeight=WIDTH_BUTTON/2,e.scaleX=e.scaleY,this.diffXFlag=this.diffXFlag+e.displayWidth+10,e.on("pointerdown",()=>this.setLang(t))}setLang(t){t!==LANG&&(LANG=t,this.father.scene.add("LoadFile",new LoadFile(this.father,this.name)),this.father.scene.start("LoadFile"),this.otherScenes.forEach(t=>this.father.scene.stop(t)))}}class Node{constructor(t=""){this.type=t}getTreeJson(t=""){let e="{"+toJson("type",this.type);return e+='"option":['+t+"]}"}} \ No newline at end of file diff --git a/Code/public/json/level10.json b/Code/public/json/duel0.json similarity index 100% rename from Code/public/json/level10.json rename to Code/public/json/duel0.json diff --git a/Code/public/json/level11.json b/Code/public/json/duel1.json similarity index 100% rename from Code/public/json/level11.json rename to Code/public/json/duel1.json diff --git a/Code/public/json/duel2.json b/Code/public/json/duel2.json new file mode 100644 index 0000000..c3f9270 --- /dev/null +++ b/Code/public/json/duel2.json @@ -0,0 +1 @@ +{"enemyVisible":true,"bonusVisible":true,"robotRandomPosition":true,"initStat":{"valueMax":10,"lBar":[{"valueMax":5,"color":16711680,"colorMin":16711680,"lText":["DAMAGE","DEGATS"]},{"valueMax":5,"color":8323327,"colorMin":8323327,"lText":["R.S","RECHARGEMENT"]},{"valueMax":5,"color":255,"colorMin":255,"lText":["SPEED","VITESSE"]},{"valueMax":5,"color":32768,"colorMin":32768,"lText":["RANGE","PORTEE"]}]},"listTeam":[{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.1,"y":0.1,"name":"enemy","speed":3,"speedReload":3,"range":3,"damage":5,"lNode":[{"type":"condition","option":[false,false,true,0,1],"lNode":[{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[0.3333333333333333]},{"type":"attack","option":[0.6666666666666666]},{"type":"attack","option":[]}]},{"type":"move","option":[true,false]},{"type":"move","option":[true]}]}]},{"name":"myTeam","robots":[{"height":0.1,"width":0.1,"x":0.9,"y":0.9,"name":"myself","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"type":"move","option":[true,false]},{"type":"attack","option":[0.3333333333333333]},{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lNode":[{"type":"move","option":[false,true]},{"type":"attack","option":[1]}]},{"type":"move","option":[true,true]}]}]}],"lBonus":[{"style":"shield","number":0,"x":0.2,"y":0.1},{"style":"shield","number":1,"x":0.5,"y":0.9},{"style":"shield","number":2,"x":0.2,"y":0.8}]} \ No newline at end of file diff --git a/Code/public/json/duel3.json b/Code/public/json/duel3.json new file mode 100644 index 0000000..c3f9270 --- /dev/null +++ b/Code/public/json/duel3.json @@ -0,0 +1 @@ +{"enemyVisible":true,"bonusVisible":true,"robotRandomPosition":true,"initStat":{"valueMax":10,"lBar":[{"valueMax":5,"color":16711680,"colorMin":16711680,"lText":["DAMAGE","DEGATS"]},{"valueMax":5,"color":8323327,"colorMin":8323327,"lText":["R.S","RECHARGEMENT"]},{"valueMax":5,"color":255,"colorMin":255,"lText":["SPEED","VITESSE"]},{"valueMax":5,"color":32768,"colorMin":32768,"lText":["RANGE","PORTEE"]}]},"listTeam":[{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.1,"y":0.1,"name":"enemy","speed":3,"speedReload":3,"range":3,"damage":5,"lNode":[{"type":"condition","option":[false,false,true,0,1],"lNode":[{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[0.3333333333333333]},{"type":"attack","option":[0.6666666666666666]},{"type":"attack","option":[]}]},{"type":"move","option":[true,false]},{"type":"move","option":[true]}]}]},{"name":"myTeam","robots":[{"height":0.1,"width":0.1,"x":0.9,"y":0.9,"name":"myself","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"type":"move","option":[true,false]},{"type":"attack","option":[0.3333333333333333]},{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lNode":[{"type":"move","option":[false,true]},{"type":"attack","option":[1]}]},{"type":"move","option":[true,true]}]}]}],"lBonus":[{"style":"shield","number":0,"x":0.2,"y":0.1},{"style":"shield","number":1,"x":0.5,"y":0.9},{"style":"shield","number":2,"x":0.2,"y":0.8}]} \ No newline at end of file diff --git a/Code/public/json/duel4.json b/Code/public/json/duel4.json new file mode 100644 index 0000000..c3f9270 --- /dev/null +++ b/Code/public/json/duel4.json @@ -0,0 +1 @@ +{"enemyVisible":true,"bonusVisible":true,"robotRandomPosition":true,"initStat":{"valueMax":10,"lBar":[{"valueMax":5,"color":16711680,"colorMin":16711680,"lText":["DAMAGE","DEGATS"]},{"valueMax":5,"color":8323327,"colorMin":8323327,"lText":["R.S","RECHARGEMENT"]},{"valueMax":5,"color":255,"colorMin":255,"lText":["SPEED","VITESSE"]},{"valueMax":5,"color":32768,"colorMin":32768,"lText":["RANGE","PORTEE"]}]},"listTeam":[{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.1,"y":0.1,"name":"enemy","speed":3,"speedReload":3,"range":3,"damage":5,"lNode":[{"type":"condition","option":[false,false,true,0,1],"lNode":[{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[0.3333333333333333]},{"type":"attack","option":[0.6666666666666666]},{"type":"attack","option":[]}]},{"type":"move","option":[true,false]},{"type":"move","option":[true]}]}]},{"name":"myTeam","robots":[{"height":0.1,"width":0.1,"x":0.9,"y":0.9,"name":"myself","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"type":"move","option":[true,false]},{"type":"attack","option":[0.3333333333333333]},{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lNode":[{"type":"move","option":[false,true]},{"type":"attack","option":[1]}]},{"type":"move","option":[true,true]}]}]}],"lBonus":[{"style":"shield","number":0,"x":0.2,"y":0.1},{"style":"shield","number":1,"x":0.5,"y":0.9},{"style":"shield","number":2,"x":0.2,"y":0.8}]} \ No newline at end of file diff --git a/Code/public/json/duel5.json b/Code/public/json/duel5.json new file mode 100644 index 0000000..c3f9270 --- /dev/null +++ b/Code/public/json/duel5.json @@ -0,0 +1 @@ +{"enemyVisible":true,"bonusVisible":true,"robotRandomPosition":true,"initStat":{"valueMax":10,"lBar":[{"valueMax":5,"color":16711680,"colorMin":16711680,"lText":["DAMAGE","DEGATS"]},{"valueMax":5,"color":8323327,"colorMin":8323327,"lText":["R.S","RECHARGEMENT"]},{"valueMax":5,"color":255,"colorMin":255,"lText":["SPEED","VITESSE"]},{"valueMax":5,"color":32768,"colorMin":32768,"lText":["RANGE","PORTEE"]}]},"listTeam":[{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.1,"y":0.1,"name":"enemy","speed":3,"speedReload":3,"range":3,"damage":5,"lNode":[{"type":"condition","option":[false,false,true,0,1],"lNode":[{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[0.3333333333333333]},{"type":"attack","option":[0.6666666666666666]},{"type":"attack","option":[]}]},{"type":"move","option":[true,false]},{"type":"move","option":[true]}]}]},{"name":"myTeam","robots":[{"height":0.1,"width":0.1,"x":0.9,"y":0.9,"name":"myself","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"type":"move","option":[true,false]},{"type":"attack","option":[0.3333333333333333]},{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lNode":[{"type":"move","option":[false,true]},{"type":"attack","option":[1]}]},{"type":"move","option":[true,true]}]}]}],"lBonus":[{"style":"shield","number":0,"x":0.2,"y":0.1},{"style":"shield","number":1,"x":0.5,"y":0.9},{"style":"shield","number":2,"x":0.2,"y":0.8}]} \ No newline at end of file diff --git a/Code/public/json/duel6.json b/Code/public/json/duel6.json new file mode 100644 index 0000000..c3f9270 --- /dev/null +++ b/Code/public/json/duel6.json @@ -0,0 +1 @@ +{"enemyVisible":true,"bonusVisible":true,"robotRandomPosition":true,"initStat":{"valueMax":10,"lBar":[{"valueMax":5,"color":16711680,"colorMin":16711680,"lText":["DAMAGE","DEGATS"]},{"valueMax":5,"color":8323327,"colorMin":8323327,"lText":["R.S","RECHARGEMENT"]},{"valueMax":5,"color":255,"colorMin":255,"lText":["SPEED","VITESSE"]},{"valueMax":5,"color":32768,"colorMin":32768,"lText":["RANGE","PORTEE"]}]},"listTeam":[{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.1,"y":0.1,"name":"enemy","speed":3,"speedReload":3,"range":3,"damage":5,"lNode":[{"type":"condition","option":[false,false,true,0,1],"lNode":[{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[0.3333333333333333]},{"type":"attack","option":[0.6666666666666666]},{"type":"attack","option":[]}]},{"type":"move","option":[true,false]},{"type":"move","option":[true]}]}]},{"name":"myTeam","robots":[{"height":0.1,"width":0.1,"x":0.9,"y":0.9,"name":"myself","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"type":"move","option":[true,false]},{"type":"attack","option":[0.3333333333333333]},{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lNode":[{"type":"move","option":[false,true]},{"type":"attack","option":[1]}]},{"type":"move","option":[true,true]}]}]}],"lBonus":[{"style":"shield","number":0,"x":0.2,"y":0.1},{"style":"shield","number":1,"x":0.5,"y":0.9},{"style":"shield","number":2,"x":0.2,"y":0.8}]} \ No newline at end of file diff --git a/Code/public/json/duel7.json b/Code/public/json/duel7.json new file mode 100644 index 0000000..c3f9270 --- /dev/null +++ b/Code/public/json/duel7.json @@ -0,0 +1 @@ +{"enemyVisible":true,"bonusVisible":true,"robotRandomPosition":true,"initStat":{"valueMax":10,"lBar":[{"valueMax":5,"color":16711680,"colorMin":16711680,"lText":["DAMAGE","DEGATS"]},{"valueMax":5,"color":8323327,"colorMin":8323327,"lText":["R.S","RECHARGEMENT"]},{"valueMax":5,"color":255,"colorMin":255,"lText":["SPEED","VITESSE"]},{"valueMax":5,"color":32768,"colorMin":32768,"lText":["RANGE","PORTEE"]}]},"listTeam":[{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.1,"y":0.1,"name":"enemy","speed":3,"speedReload":3,"range":3,"damage":5,"lNode":[{"type":"condition","option":[false,false,true,0,1],"lNode":[{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[0.3333333333333333]},{"type":"attack","option":[0.6666666666666666]},{"type":"attack","option":[]}]},{"type":"move","option":[true,false]},{"type":"move","option":[true]}]}]},{"name":"myTeam","robots":[{"height":0.1,"width":0.1,"x":0.9,"y":0.9,"name":"myself","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"type":"move","option":[true,false]},{"type":"attack","option":[0.3333333333333333]},{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lNode":[{"type":"move","option":[false,true]},{"type":"attack","option":[1]}]},{"type":"move","option":[true,true]}]}]}],"lBonus":[{"style":"shield","number":0,"x":0.2,"y":0.1},{"style":"shield","number":1,"x":0.5,"y":0.9},{"style":"shield","number":2,"x":0.2,"y":0.8}]} \ No newline at end of file diff --git a/Code/public/json/level20.json b/Code/public/json/last0.json similarity index 100% rename from Code/public/json/level20.json rename to Code/public/json/last0.json diff --git a/Code/public/json/level21.json b/Code/public/json/last1.json similarity index 100% rename from Code/public/json/level21.json rename to Code/public/json/last1.json diff --git a/Code/public/json/last2.json b/Code/public/json/last2.json new file mode 100644 index 0000000..b567b0b --- /dev/null +++ b/Code/public/json/last2.json @@ -0,0 +1 @@ +{"enemyVisible":false,"bonusVisible":true,"robotRandomPosition":true,"initStat":{"valueMax":10,"lBar":[{"valueMax":5,"color":16711680,"colorMin":16711680,"lText":["DAMAGE","DEGATS"]},{"valueMax":5,"color":8323327,"colorMin":8323327,"lText":["R.S","RECHARGEMENT"]},{"valueMax":5,"color":255,"colorMin":255,"lText":["SPEED","VITESSE"]},{"valueMax":5,"color":32768,"colorMin":32768,"lText":["RANGE","PORTEE"]}]},"listTeam":[{"name":"myTeam","robots":[{"height":0.1,"width":0.1,"x":0.9,"y":0.9,"name":"myself","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"type":"move","option":[true,false]},{"type":"attack","option":[0.3333333333333333]},{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lNode":[{"type":"move","option":[false,true]},{"type":"attack","option":[1]}]},{"type":"move","option":[true,true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.1,"y":0.1,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.3,"y":0.1,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.7,"y":0.1,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.5,"y":0.4,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.1,"y":0.9,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.3,"y":0.7,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.9,"y":0.2,"name":"enemy","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]}],"lBonus":[{"style":"speed","number":0,"x":0.5,"y":0.5},{"style":"attack","number":2,"x":0.7,"y":0.7},{"style":"shield","number":0,"x":0.2,"y":0.9},{"style":"shield","number":1,"x":0.8,"y":0.4},{"style":"shield","number":2,"x":0.2,"y":0.2}]} \ No newline at end of file diff --git a/Code/public/json/last3.json b/Code/public/json/last3.json new file mode 100644 index 0000000..b567b0b --- /dev/null +++ b/Code/public/json/last3.json @@ -0,0 +1 @@ +{"enemyVisible":false,"bonusVisible":true,"robotRandomPosition":true,"initStat":{"valueMax":10,"lBar":[{"valueMax":5,"color":16711680,"colorMin":16711680,"lText":["DAMAGE","DEGATS"]},{"valueMax":5,"color":8323327,"colorMin":8323327,"lText":["R.S","RECHARGEMENT"]},{"valueMax":5,"color":255,"colorMin":255,"lText":["SPEED","VITESSE"]},{"valueMax":5,"color":32768,"colorMin":32768,"lText":["RANGE","PORTEE"]}]},"listTeam":[{"name":"myTeam","robots":[{"height":0.1,"width":0.1,"x":0.9,"y":0.9,"name":"myself","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"type":"move","option":[true,false]},{"type":"attack","option":[0.3333333333333333]},{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lNode":[{"type":"move","option":[false,true]},{"type":"attack","option":[1]}]},{"type":"move","option":[true,true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.1,"y":0.1,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.3,"y":0.1,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.7,"y":0.1,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.5,"y":0.4,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.1,"y":0.9,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.3,"y":0.7,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.9,"y":0.2,"name":"enemy","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]}],"lBonus":[{"style":"speed","number":0,"x":0.5,"y":0.5},{"style":"attack","number":2,"x":0.7,"y":0.7},{"style":"shield","number":0,"x":0.2,"y":0.9},{"style":"shield","number":1,"x":0.8,"y":0.4},{"style":"shield","number":2,"x":0.2,"y":0.2}]} \ No newline at end of file diff --git a/Code/public/json/last4.json b/Code/public/json/last4.json new file mode 100644 index 0000000..b567b0b --- /dev/null +++ b/Code/public/json/last4.json @@ -0,0 +1 @@ +{"enemyVisible":false,"bonusVisible":true,"robotRandomPosition":true,"initStat":{"valueMax":10,"lBar":[{"valueMax":5,"color":16711680,"colorMin":16711680,"lText":["DAMAGE","DEGATS"]},{"valueMax":5,"color":8323327,"colorMin":8323327,"lText":["R.S","RECHARGEMENT"]},{"valueMax":5,"color":255,"colorMin":255,"lText":["SPEED","VITESSE"]},{"valueMax":5,"color":32768,"colorMin":32768,"lText":["RANGE","PORTEE"]}]},"listTeam":[{"name":"myTeam","robots":[{"height":0.1,"width":0.1,"x":0.9,"y":0.9,"name":"myself","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"type":"move","option":[true,false]},{"type":"attack","option":[0.3333333333333333]},{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lNode":[{"type":"move","option":[false,true]},{"type":"attack","option":[1]}]},{"type":"move","option":[true,true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.1,"y":0.1,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.3,"y":0.1,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.7,"y":0.1,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.5,"y":0.4,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.1,"y":0.9,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.3,"y":0.7,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.9,"y":0.2,"name":"enemy","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]}],"lBonus":[{"style":"speed","number":0,"x":0.5,"y":0.5},{"style":"attack","number":2,"x":0.7,"y":0.7},{"style":"shield","number":0,"x":0.2,"y":0.9},{"style":"shield","number":1,"x":0.8,"y":0.4},{"style":"shield","number":2,"x":0.2,"y":0.2}]} \ No newline at end of file diff --git a/Code/public/json/last5.json b/Code/public/json/last5.json new file mode 100644 index 0000000..b567b0b --- /dev/null +++ b/Code/public/json/last5.json @@ -0,0 +1 @@ +{"enemyVisible":false,"bonusVisible":true,"robotRandomPosition":true,"initStat":{"valueMax":10,"lBar":[{"valueMax":5,"color":16711680,"colorMin":16711680,"lText":["DAMAGE","DEGATS"]},{"valueMax":5,"color":8323327,"colorMin":8323327,"lText":["R.S","RECHARGEMENT"]},{"valueMax":5,"color":255,"colorMin":255,"lText":["SPEED","VITESSE"]},{"valueMax":5,"color":32768,"colorMin":32768,"lText":["RANGE","PORTEE"]}]},"listTeam":[{"name":"myTeam","robots":[{"height":0.1,"width":0.1,"x":0.9,"y":0.9,"name":"myself","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"type":"move","option":[true,false]},{"type":"attack","option":[0.3333333333333333]},{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lNode":[{"type":"move","option":[false,true]},{"type":"attack","option":[1]}]},{"type":"move","option":[true,true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.1,"y":0.1,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.3,"y":0.1,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.7,"y":0.1,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.5,"y":0.4,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.1,"y":0.9,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.3,"y":0.7,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.9,"y":0.2,"name":"enemy","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]}],"lBonus":[{"style":"speed","number":0,"x":0.5,"y":0.5},{"style":"attack","number":2,"x":0.7,"y":0.7},{"style":"shield","number":0,"x":0.2,"y":0.9},{"style":"shield","number":1,"x":0.8,"y":0.4},{"style":"shield","number":2,"x":0.2,"y":0.2}]} \ No newline at end of file diff --git a/Code/public/json/last6.json b/Code/public/json/last6.json new file mode 100644 index 0000000..b567b0b --- /dev/null +++ b/Code/public/json/last6.json @@ -0,0 +1 @@ +{"enemyVisible":false,"bonusVisible":true,"robotRandomPosition":true,"initStat":{"valueMax":10,"lBar":[{"valueMax":5,"color":16711680,"colorMin":16711680,"lText":["DAMAGE","DEGATS"]},{"valueMax":5,"color":8323327,"colorMin":8323327,"lText":["R.S","RECHARGEMENT"]},{"valueMax":5,"color":255,"colorMin":255,"lText":["SPEED","VITESSE"]},{"valueMax":5,"color":32768,"colorMin":32768,"lText":["RANGE","PORTEE"]}]},"listTeam":[{"name":"myTeam","robots":[{"height":0.1,"width":0.1,"x":0.9,"y":0.9,"name":"myself","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"type":"move","option":[true,false]},{"type":"attack","option":[0.3333333333333333]},{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lNode":[{"type":"move","option":[false,true]},{"type":"attack","option":[1]}]},{"type":"move","option":[true,true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.1,"y":0.1,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.3,"y":0.1,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.7,"y":0.1,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.5,"y":0.4,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.1,"y":0.9,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.3,"y":0.7,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.9,"y":0.2,"name":"enemy","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]}],"lBonus":[{"style":"speed","number":0,"x":0.5,"y":0.5},{"style":"attack","number":2,"x":0.7,"y":0.7},{"style":"shield","number":0,"x":0.2,"y":0.9},{"style":"shield","number":1,"x":0.8,"y":0.4},{"style":"shield","number":2,"x":0.2,"y":0.2}]} \ No newline at end of file diff --git a/Code/public/json/last7.json b/Code/public/json/last7.json new file mode 100644 index 0000000..b567b0b --- /dev/null +++ b/Code/public/json/last7.json @@ -0,0 +1 @@ +{"enemyVisible":false,"bonusVisible":true,"robotRandomPosition":true,"initStat":{"valueMax":10,"lBar":[{"valueMax":5,"color":16711680,"colorMin":16711680,"lText":["DAMAGE","DEGATS"]},{"valueMax":5,"color":8323327,"colorMin":8323327,"lText":["R.S","RECHARGEMENT"]},{"valueMax":5,"color":255,"colorMin":255,"lText":["SPEED","VITESSE"]},{"valueMax":5,"color":32768,"colorMin":32768,"lText":["RANGE","PORTEE"]}]},"listTeam":[{"name":"myTeam","robots":[{"height":0.1,"width":0.1,"x":0.9,"y":0.9,"name":"myself","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"type":"move","option":[true,false]},{"type":"attack","option":[0.3333333333333333]},{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lNode":[{"type":"move","option":[false,true]},{"type":"attack","option":[1]}]},{"type":"move","option":[true,true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.1,"y":0.1,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.3,"y":0.1,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.7,"y":0.1,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.5,"y":0.4,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.1,"y":0.9,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.3,"y":0.7,"name":"enemy","speed":1,"speedReload":1,"range":5,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","robots":[{"height":0.1,"width":0.1,"x":0.9,"y":0.2,"name":"enemy","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"type":"condition","option":[true,true,false,0.5,0],"lNode":[{"type":"move","option":[true,false]}]},{"type":"attack","option":[]},{"type":"move","option":[true]}]}]}],"lBonus":[{"style":"speed","number":0,"x":0.5,"y":0.5},{"style":"attack","number":2,"x":0.7,"y":0.7},{"style":"shield","number":0,"x":0.2,"y":0.9},{"style":"shield","number":1,"x":0.8,"y":0.4},{"style":"shield","number":2,"x":0.2,"y":0.2}]} \ No newline at end of file diff --git a/Code/public/json/level30.json b/Code/public/json/team0.json similarity index 100% rename from Code/public/json/level30.json rename to Code/public/json/team0.json diff --git a/Code/public/json/level31.json b/Code/public/json/team1.json similarity index 100% rename from Code/public/json/level31.json rename to Code/public/json/team1.json diff --git a/Code/public/json/team2.json b/Code/public/json/team2.json new file mode 100644 index 0000000..864384c --- /dev/null +++ b/Code/public/json/team2.json @@ -0,0 +1 @@ +{"enemyVisible":false,"bonusVisible":true,"robotRandomPosition":false,"initStat":{"valueMax":10,"lBar":[{"valueMax":5,"color":16711680,"colorMin":16711680,"lText":["DAMAGE","DEGATS"]},{"valueMax":5,"color":8323327,"colorMin":8323327,"lText":["R.S","RECHARGEMENT"]},{"valueMax":5,"color":255,"colorMin":255,"lText":["SPEED","VITESSE"]},{"valueMax":5,"color":32768,"colorMin":32768,"lText":["RANGE","PORTEE"]}]},"listTeam":[{"name":"myTeam","robots":[{"height":0.1,"width":0.1,"x":0.9,"y":0.8,"name":"myself","speed":3,"speedReload":1,"range":1,"damage":5,"lNode":[{"type":"move","option":[true,false]},{"type":"attack","option":[0.3333333333333333]},{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lNode":[{"type":"move","option":[false,true]},{"type":"attack","option":[1]}]},{"type":"move","option":[true,true]}]},{"height":0.1,"width":0.1,"x":0.8,"y":0.9,"name":"myself","speed":3,"speedReload":1,"range":1,"damage":5,"lNode":[{"type":"move","option":[true,false]},{"type":"attack","option":[0.3333333333333333]},{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lNode":[{"type":"move","option":[false,true]},{"type":"attack","option":[1]}]},{"type":"move","option":[true,true]}]}]},{"name":"enemyTeam","color":16711680,"robots":[{"height":0.1,"width":0.1,"x":0.1,"y":0.8,"name":"enemy","speed":3,"speedReload":3,"range":3,"damage":5,"lNode":[{"type":"attack","option":[]},{"type":"move","option":[true]}]},{"height":0.1,"width":0.1,"x":0.2,"y":0.9,"name":"enemy","speed":3,"speedReload":3,"range":3,"damage":5,"lNode":[{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","color":32768,"robots":[{"height":0.1,"width":0.1,"x":0.5,"y":0.1,"name":"enemy","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"type":"attack","option":[]},{"type":"move","option":[true]}]},{"height":0.1,"width":0.1,"x":0.5,"y":0.2,"name":"enemy","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"type":"attack","option":[]},{"type":"move","option":[true]}]}]}],"lBonus":[{"style":"speed","number":1,"x":0.5,"y":0.5},{"style":"shield","number":2,"x":0.1,"y":0.1},{"style":"attack","number":2,"x":0.9,"y":0.1}]} \ No newline at end of file diff --git a/Code/public/json/team3.json b/Code/public/json/team3.json new file mode 100644 index 0000000..864384c --- /dev/null +++ b/Code/public/json/team3.json @@ -0,0 +1 @@ +{"enemyVisible":false,"bonusVisible":true,"robotRandomPosition":false,"initStat":{"valueMax":10,"lBar":[{"valueMax":5,"color":16711680,"colorMin":16711680,"lText":["DAMAGE","DEGATS"]},{"valueMax":5,"color":8323327,"colorMin":8323327,"lText":["R.S","RECHARGEMENT"]},{"valueMax":5,"color":255,"colorMin":255,"lText":["SPEED","VITESSE"]},{"valueMax":5,"color":32768,"colorMin":32768,"lText":["RANGE","PORTEE"]}]},"listTeam":[{"name":"myTeam","robots":[{"height":0.1,"width":0.1,"x":0.9,"y":0.8,"name":"myself","speed":3,"speedReload":1,"range":1,"damage":5,"lNode":[{"type":"move","option":[true,false]},{"type":"attack","option":[0.3333333333333333]},{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lNode":[{"type":"move","option":[false,true]},{"type":"attack","option":[1]}]},{"type":"move","option":[true,true]}]},{"height":0.1,"width":0.1,"x":0.8,"y":0.9,"name":"myself","speed":3,"speedReload":1,"range":1,"damage":5,"lNode":[{"type":"move","option":[true,false]},{"type":"attack","option":[0.3333333333333333]},{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lNode":[{"type":"move","option":[false,true]},{"type":"attack","option":[1]}]},{"type":"move","option":[true,true]}]}]},{"name":"enemyTeam","color":16711680,"robots":[{"height":0.1,"width":0.1,"x":0.1,"y":0.8,"name":"enemy","speed":3,"speedReload":3,"range":3,"damage":5,"lNode":[{"type":"attack","option":[]},{"type":"move","option":[true]}]},{"height":0.1,"width":0.1,"x":0.2,"y":0.9,"name":"enemy","speed":3,"speedReload":3,"range":3,"damage":5,"lNode":[{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","color":32768,"robots":[{"height":0.1,"width":0.1,"x":0.5,"y":0.1,"name":"enemy","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"type":"attack","option":[]},{"type":"move","option":[true]}]},{"height":0.1,"width":0.1,"x":0.5,"y":0.2,"name":"enemy","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"type":"attack","option":[]},{"type":"move","option":[true]}]}]}],"lBonus":[{"style":"speed","number":1,"x":0.5,"y":0.5},{"style":"shield","number":2,"x":0.1,"y":0.1},{"style":"attack","number":2,"x":0.9,"y":0.1}]} \ No newline at end of file diff --git a/Code/public/json/team4.json b/Code/public/json/team4.json new file mode 100644 index 0000000..864384c --- /dev/null +++ b/Code/public/json/team4.json @@ -0,0 +1 @@ +{"enemyVisible":false,"bonusVisible":true,"robotRandomPosition":false,"initStat":{"valueMax":10,"lBar":[{"valueMax":5,"color":16711680,"colorMin":16711680,"lText":["DAMAGE","DEGATS"]},{"valueMax":5,"color":8323327,"colorMin":8323327,"lText":["R.S","RECHARGEMENT"]},{"valueMax":5,"color":255,"colorMin":255,"lText":["SPEED","VITESSE"]},{"valueMax":5,"color":32768,"colorMin":32768,"lText":["RANGE","PORTEE"]}]},"listTeam":[{"name":"myTeam","robots":[{"height":0.1,"width":0.1,"x":0.9,"y":0.8,"name":"myself","speed":3,"speedReload":1,"range":1,"damage":5,"lNode":[{"type":"move","option":[true,false]},{"type":"attack","option":[0.3333333333333333]},{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lNode":[{"type":"move","option":[false,true]},{"type":"attack","option":[1]}]},{"type":"move","option":[true,true]}]},{"height":0.1,"width":0.1,"x":0.8,"y":0.9,"name":"myself","speed":3,"speedReload":1,"range":1,"damage":5,"lNode":[{"type":"move","option":[true,false]},{"type":"attack","option":[0.3333333333333333]},{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lNode":[{"type":"move","option":[false,true]},{"type":"attack","option":[1]}]},{"type":"move","option":[true,true]}]}]},{"name":"enemyTeam","color":16711680,"robots":[{"height":0.1,"width":0.1,"x":0.1,"y":0.8,"name":"enemy","speed":3,"speedReload":3,"range":3,"damage":5,"lNode":[{"type":"attack","option":[]},{"type":"move","option":[true]}]},{"height":0.1,"width":0.1,"x":0.2,"y":0.9,"name":"enemy","speed":3,"speedReload":3,"range":3,"damage":5,"lNode":[{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","color":32768,"robots":[{"height":0.1,"width":0.1,"x":0.5,"y":0.1,"name":"enemy","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"type":"attack","option":[]},{"type":"move","option":[true]}]},{"height":0.1,"width":0.1,"x":0.5,"y":0.2,"name":"enemy","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"type":"attack","option":[]},{"type":"move","option":[true]}]}]}],"lBonus":[{"style":"speed","number":1,"x":0.5,"y":0.5},{"style":"shield","number":2,"x":0.1,"y":0.1},{"style":"attack","number":2,"x":0.9,"y":0.1}]} \ No newline at end of file diff --git a/Code/public/json/team5.json b/Code/public/json/team5.json new file mode 100644 index 0000000..864384c --- /dev/null +++ b/Code/public/json/team5.json @@ -0,0 +1 @@ +{"enemyVisible":false,"bonusVisible":true,"robotRandomPosition":false,"initStat":{"valueMax":10,"lBar":[{"valueMax":5,"color":16711680,"colorMin":16711680,"lText":["DAMAGE","DEGATS"]},{"valueMax":5,"color":8323327,"colorMin":8323327,"lText":["R.S","RECHARGEMENT"]},{"valueMax":5,"color":255,"colorMin":255,"lText":["SPEED","VITESSE"]},{"valueMax":5,"color":32768,"colorMin":32768,"lText":["RANGE","PORTEE"]}]},"listTeam":[{"name":"myTeam","robots":[{"height":0.1,"width":0.1,"x":0.9,"y":0.8,"name":"myself","speed":3,"speedReload":1,"range":1,"damage":5,"lNode":[{"type":"move","option":[true,false]},{"type":"attack","option":[0.3333333333333333]},{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lNode":[{"type":"move","option":[false,true]},{"type":"attack","option":[1]}]},{"type":"move","option":[true,true]}]},{"height":0.1,"width":0.1,"x":0.8,"y":0.9,"name":"myself","speed":3,"speedReload":1,"range":1,"damage":5,"lNode":[{"type":"move","option":[true,false]},{"type":"attack","option":[0.3333333333333333]},{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lNode":[{"type":"move","option":[false,true]},{"type":"attack","option":[1]}]},{"type":"move","option":[true,true]}]}]},{"name":"enemyTeam","color":16711680,"robots":[{"height":0.1,"width":0.1,"x":0.1,"y":0.8,"name":"enemy","speed":3,"speedReload":3,"range":3,"damage":5,"lNode":[{"type":"attack","option":[]},{"type":"move","option":[true]}]},{"height":0.1,"width":0.1,"x":0.2,"y":0.9,"name":"enemy","speed":3,"speedReload":3,"range":3,"damage":5,"lNode":[{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","color":32768,"robots":[{"height":0.1,"width":0.1,"x":0.5,"y":0.1,"name":"enemy","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"type":"attack","option":[]},{"type":"move","option":[true]}]},{"height":0.1,"width":0.1,"x":0.5,"y":0.2,"name":"enemy","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"type":"attack","option":[]},{"type":"move","option":[true]}]}]}],"lBonus":[{"style":"speed","number":1,"x":0.5,"y":0.5},{"style":"shield","number":2,"x":0.1,"y":0.1},{"style":"attack","number":2,"x":0.9,"y":0.1}]} \ No newline at end of file diff --git a/Code/public/json/team6.json b/Code/public/json/team6.json new file mode 100644 index 0000000..864384c --- /dev/null +++ b/Code/public/json/team6.json @@ -0,0 +1 @@ +{"enemyVisible":false,"bonusVisible":true,"robotRandomPosition":false,"initStat":{"valueMax":10,"lBar":[{"valueMax":5,"color":16711680,"colorMin":16711680,"lText":["DAMAGE","DEGATS"]},{"valueMax":5,"color":8323327,"colorMin":8323327,"lText":["R.S","RECHARGEMENT"]},{"valueMax":5,"color":255,"colorMin":255,"lText":["SPEED","VITESSE"]},{"valueMax":5,"color":32768,"colorMin":32768,"lText":["RANGE","PORTEE"]}]},"listTeam":[{"name":"myTeam","robots":[{"height":0.1,"width":0.1,"x":0.9,"y":0.8,"name":"myself","speed":3,"speedReload":1,"range":1,"damage":5,"lNode":[{"type":"move","option":[true,false]},{"type":"attack","option":[0.3333333333333333]},{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lNode":[{"type":"move","option":[false,true]},{"type":"attack","option":[1]}]},{"type":"move","option":[true,true]}]},{"height":0.1,"width":0.1,"x":0.8,"y":0.9,"name":"myself","speed":3,"speedReload":1,"range":1,"damage":5,"lNode":[{"type":"move","option":[true,false]},{"type":"attack","option":[0.3333333333333333]},{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lNode":[{"type":"move","option":[false,true]},{"type":"attack","option":[1]}]},{"type":"move","option":[true,true]}]}]},{"name":"enemyTeam","color":16711680,"robots":[{"height":0.1,"width":0.1,"x":0.1,"y":0.8,"name":"enemy","speed":3,"speedReload":3,"range":3,"damage":5,"lNode":[{"type":"attack","option":[]},{"type":"move","option":[true]}]},{"height":0.1,"width":0.1,"x":0.2,"y":0.9,"name":"enemy","speed":3,"speedReload":3,"range":3,"damage":5,"lNode":[{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","color":32768,"robots":[{"height":0.1,"width":0.1,"x":0.5,"y":0.1,"name":"enemy","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"type":"attack","option":[]},{"type":"move","option":[true]}]},{"height":0.1,"width":0.1,"x":0.5,"y":0.2,"name":"enemy","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"type":"attack","option":[]},{"type":"move","option":[true]}]}]}],"lBonus":[{"style":"speed","number":1,"x":0.5,"y":0.5},{"style":"shield","number":2,"x":0.1,"y":0.1},{"style":"attack","number":2,"x":0.9,"y":0.1}]} \ No newline at end of file diff --git a/Code/public/json/team7.json b/Code/public/json/team7.json new file mode 100644 index 0000000..864384c --- /dev/null +++ b/Code/public/json/team7.json @@ -0,0 +1 @@ +{"enemyVisible":false,"bonusVisible":true,"robotRandomPosition":false,"initStat":{"valueMax":10,"lBar":[{"valueMax":5,"color":16711680,"colorMin":16711680,"lText":["DAMAGE","DEGATS"]},{"valueMax":5,"color":8323327,"colorMin":8323327,"lText":["R.S","RECHARGEMENT"]},{"valueMax":5,"color":255,"colorMin":255,"lText":["SPEED","VITESSE"]},{"valueMax":5,"color":32768,"colorMin":32768,"lText":["RANGE","PORTEE"]}]},"listTeam":[{"name":"myTeam","robots":[{"height":0.1,"width":0.1,"x":0.9,"y":0.8,"name":"myself","speed":3,"speedReload":1,"range":1,"damage":5,"lNode":[{"type":"move","option":[true,false]},{"type":"attack","option":[0.3333333333333333]},{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lNode":[{"type":"move","option":[false,true]},{"type":"attack","option":[1]}]},{"type":"move","option":[true,true]}]},{"height":0.1,"width":0.1,"x":0.8,"y":0.9,"name":"myself","speed":3,"speedReload":1,"range":1,"damage":5,"lNode":[{"type":"move","option":[true,false]},{"type":"attack","option":[0.3333333333333333]},{"type":"condition","option":[true,true,false,0.3333333333333333,0],"lNode":[{"type":"move","option":[false,true]},{"type":"attack","option":[1]}]},{"type":"move","option":[true,true]}]}]},{"name":"enemyTeam","color":16711680,"robots":[{"height":0.1,"width":0.1,"x":0.1,"y":0.8,"name":"enemy","speed":3,"speedReload":3,"range":3,"damage":5,"lNode":[{"type":"attack","option":[]},{"type":"move","option":[true]}]},{"height":0.1,"width":0.1,"x":0.2,"y":0.9,"name":"enemy","speed":3,"speedReload":3,"range":3,"damage":5,"lNode":[{"type":"attack","option":[]},{"type":"move","option":[true]}]}]},{"name":"enemyTeam","color":32768,"robots":[{"height":0.1,"width":0.1,"x":0.5,"y":0.1,"name":"enemy","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"type":"attack","option":[]},{"type":"move","option":[true]}]},{"height":0.1,"width":0.1,"x":0.5,"y":0.2,"name":"enemy","speed":3,"speedReload":1,"range":3,"damage":5,"lNode":[{"type":"attack","option":[]},{"type":"move","option":[true]}]}]}],"lBonus":[{"style":"speed","number":1,"x":0.5,"y":0.5},{"style":"shield","number":2,"x":0.1,"y":0.1},{"style":"attack","number":2,"x":0.9,"y":0.1}]} \ No newline at end of file diff --git a/Code/src/js/level2/Game.js b/Code/src/js/level2/Game.js index bf3f5b5..9d644cd 100644 --- a/Code/src/js/level2/Game.js +++ b/Code/src/js/level2/Game.js @@ -34,7 +34,7 @@ class Game extends ManageLang { let level = this.cache.json.get('level'); if (level === undefined) { - console.log("ERROR : LEVEL UNDEFINED"); + console.log("ERROR : LEVEL UNDEFINED (" + this.level + ")"); new Button(this, 10, 10, WIDTH_BUTTON, WIDTH_BUTTON, 'back', () => this.clickBack()).setOrigin(0, 0); let style = {font: '50px stencil', fill: "#e2e2e2"}; this.add.text(WIDTH_WINDOW / 2, HEIGHT_WINDOW / 2, selectWord("LEVEL UNDEFINED", "NIVEAU INDEFINI"), style).setOrigin(0.5, 0.5); diff --git a/Code/src/js/level2/LevelSelect.js b/Code/src/js/level2/LevelSelect.js index 0f21135..1d2b344 100644 --- a/Code/src/js/level2/LevelSelect.js +++ b/Code/src/js/level2/LevelSelect.js @@ -3,14 +3,33 @@ class LevelSelect extends ManageLang { super('LevelSelect'); this.father = father; this.level = level; + console.log(getCookie(this.level)); } create() { super.create(); let style = {font: HEIGHT_TITLE.toString() + 'px stencil', fill: "#e2e2e2"}; this.add.text(WIDTH_WINDOW / 2, HEIGHT_WINDOW / 6, "WARIA", style).setOrigin(0.5, 0.5); - this.createLevel(WIDTH_WINDOW / 3, HEIGHT_WINDOW / 2, 1); - this.createLevel(WIDTH_WINDOW / 1.5, HEIGHT_WINDOW / 2, 2); + let nb = parseInt(getCookie(this.level)); + if (isNaN(nb)) { + nb = 1; + } + let offX = WIDTH_WINDOW / 5; + let offY = HEIGHT_WINDOW / 3; + let x = offX; + let y = HEIGHT_WINDOW / 2.5; + for (let i = 1; i <= nb; i++) { + if (i > NUMBER_LEVEL) + break; + this.createLevel(x, y, i); + x += offX; + if (x === WIDTH_WINDOW) { + x = offX; + y += offY; + } + } + + new Button(this, 10, 10, WIDTH_BUTTON, WIDTH_BUTTON, 'back', () => this.clickBack()).setOrigin(0, 0); } createLevel(x, y, number = 0) { @@ -27,8 +46,6 @@ class LevelSelect extends ManageLang { btn.on('pointerover', () => this.over(btn, text)); btn.on('pointerout', () => this.out(btn, text)); btn.on('pointerdown', () => this.click(number)); - - new Button(this, 10, 10, WIDTH_BUTTON, WIDTH_BUTTON, 'back', () => this.clickBack()).setOrigin(0, 0); } over(btn, text) { diff --git a/Code/src/js/level2/Type.js b/Code/src/js/level2/Type.js index b7971f9..45b8f9a 100644 --- a/Code/src/js/level2/Type.js +++ b/Code/src/js/level2/Type.js @@ -12,13 +12,13 @@ class Type extends ManageLang { this.add.text(WIDTH_WINDOW / 2, HEIGHT_WINDOW / 6, "WARIA", style).setOrigin(0.5, 0.5); let btnDuel = this.add.sprite((WIDTH_WINDOW / 8) * 3, (HEIGHT_WINDOW / 4) * 2, 'duel').setInteractive(); - this.createbutton(btnDuel, 'level1'); + this.createbutton(btnDuel, 'duel'); let btnLast = this.add.sprite((WIDTH_WINDOW / 8) * 5, (HEIGHT_WINDOW / 4) * 2, 'last').setInteractive(); - this.createbutton(btnLast, 'level2'); + this.createbutton(btnLast, 'last'); let btnTeam = this.add.sprite(WIDTH_WINDOW / 2, (HEIGHT_WINDOW / 4) * 3, 'team').setInteractive(); - this.createbutton(btnTeam, 'level3'); + this.createbutton(btnTeam, 'team'); } createbutton(btn, level) { diff --git a/Code/src/js/level2/Variable.js b/Code/src/js/level2/Variable.js index 404ec4e..757d89f 100644 --- a/Code/src/js/level2/Variable.js +++ b/Code/src/js/level2/Variable.js @@ -15,12 +15,12 @@ const COLOR_ORANGE = 0xff7f00; const COLOR_GREEN = 0x008000; const COLOR_RANGE = 0x008000; const COLOR_SPEED_RELOAD = 0x7f00ff; -const NUMBER_LEVEL = 2; +const NUMBER_LEVEL = 8; const COLOR_SELECTED = 0xEFD807; const COLOR_MYSELF = 0x6666ff; -const WIDTH_WINDOW = $(document).width() - 20; -const HEIGHT_WINDOW = $(document).height() - 20; +const WIDTH_WINDOW = window.innerWidth - 20; +const HEIGHT_WINDOW = window.innerHeight - 20; var OFFX_MAP = WIDTH_WINDOW / 20; var OFFY_MAP; var WIDTH_MAP; diff --git a/Code/src/js/level2/Winner.js b/Code/src/js/level2/Winner.js index 3984a8c..8945447 100644 --- a/Code/src/js/level2/Winner.js +++ b/Code/src/js/level2/Winner.js @@ -1,6 +1,7 @@ class Winner extends Finish { constructor(father, game, score) { super(father, game, score); + setCookie(game.level.slice(0, -1), parseInt(game.level[game.level.length - 1]) + 2); } create() { diff --git a/Code/src/js/level2/Function.js b/Code/src/js/level3/Function.js similarity index 69% rename from Code/src/js/level2/Function.js rename to Code/src/js/level3/Function.js index ed7de44..ce25f82 100644 --- a/Code/src/js/level2/Function.js +++ b/Code/src/js/level3/Function.js @@ -69,4 +69,36 @@ function getNextLevel(level = "") { return level; } return newLevel; +} + +function setCookie(cName, cValue) { + let d = new Date(); + let day = 100; + d.setTime(d.getTime() + (day * 24 * 60 * 60 * 1000)); + let expires = "expires=" + d.toUTCString(); + document.cookie = cName + "=" + cValue + ";" + expires + ";path=/;SameSite=Lax"; +} + +/* +function getCookies() { + let c = document.cookie.split('; '); + let json = "{"; + c.forEach(cookie => { + let m = cookie.split(('=')); + json += '"' + m[0] + '":' + m[1] + ','; + }); + json = endLineJson(json) + '}'; + return JSON.parse(json); +} +*/ + +function getCookie(cName) { + let c = document.cookie.split('; '); + for (let i = 0; i < c.length; i++) { + let m = c[i].split(('=')); + if (m[0] === cName.toString()) { + return m[1]; + } + } + return ""; } \ No newline at end of file diff --git a/Code/src/json/level10.json b/Code/src/json/duel0.json similarity index 100% rename from Code/src/json/level10.json rename to Code/src/json/duel0.json diff --git a/Code/src/json/level11.json b/Code/src/json/duel1.json similarity index 100% rename from Code/src/json/level11.json rename to Code/src/json/duel1.json diff --git a/Code/src/json/duel2.json b/Code/src/json/duel2.json new file mode 100644 index 0000000..23eaa1c --- /dev/null +++ b/Code/src/json/duel2.json @@ -0,0 +1,210 @@ +{ + "enemyVisible": true, + "bonusVisible": true, + "robotRandomPosition": true, + "initStat": { + "valueMax": 10, + "lBar": [ + { + "valueMax": 5, + "color": 16711680, + "colorMin": 16711680, + "lText": [ + "DAMAGE", + "DEGATS" + ] + }, + { + "valueMax": 5, + "color": 8323327, + "colorMin": 8323327, + "lText": [ + "R.S", + "RECHARGEMENT" + ] + }, + { + "valueMax": 5, + "color": 255, + "colorMin": 255, + "lText": [ + "SPEED", + "VITESSE" + ] + }, + { + "valueMax": 5, + "color": 32768, + "colorMin": 32768, + "lText": [ + "RANGE", + "PORTEE" + ] + } + ] + }, + "listTeam": [ + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.1, + "y": 0.1, + "name": "enemy", + "speed": 3, + "speedReload": 3, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + false, + false, + true, + 0, + 1 + ], + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.3333333333333333, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + 0.3333333333333333 + ] + }, + { + "type": "attack", + "option": [ + 0.6666666666666666 + ] + }, + { + "type": "attack", + "option": [ + ] + } + ] + }, + { + "type": "move", + "option": [ + true, + false + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "myTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.9, + "y": 0.9, + "name": "myself", + "speed": 3, + "speedReload": 1, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + }, + { + "type": "attack", + "option": [ + 0.3333333333333333 + ] + }, + { + "type": "condition", + "option": [ + true, + true, + false, + 0.3333333333333333, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + false, + true + ] + }, + { + "type": "attack", + "option": [ + 1 + ] + } + ] + }, + { + "type": "move", + "option": [ + true, + true + ] + } + ] + } + ] + } + ], + "lBonus": [ + { + "style": "shield", + "number": 0, + "x": 0.2, + "y": 0.1 + }, + { + "style": "shield", + "number": 1, + "x": 0.5, + "y": 0.9 + }, + { + "style": "shield", + "number": 2, + "x": 0.2, + "y": 0.8 + } + ] +} \ No newline at end of file diff --git a/Code/src/json/duel3.json b/Code/src/json/duel3.json new file mode 100644 index 0000000..23eaa1c --- /dev/null +++ b/Code/src/json/duel3.json @@ -0,0 +1,210 @@ +{ + "enemyVisible": true, + "bonusVisible": true, + "robotRandomPosition": true, + "initStat": { + "valueMax": 10, + "lBar": [ + { + "valueMax": 5, + "color": 16711680, + "colorMin": 16711680, + "lText": [ + "DAMAGE", + "DEGATS" + ] + }, + { + "valueMax": 5, + "color": 8323327, + "colorMin": 8323327, + "lText": [ + "R.S", + "RECHARGEMENT" + ] + }, + { + "valueMax": 5, + "color": 255, + "colorMin": 255, + "lText": [ + "SPEED", + "VITESSE" + ] + }, + { + "valueMax": 5, + "color": 32768, + "colorMin": 32768, + "lText": [ + "RANGE", + "PORTEE" + ] + } + ] + }, + "listTeam": [ + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.1, + "y": 0.1, + "name": "enemy", + "speed": 3, + "speedReload": 3, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + false, + false, + true, + 0, + 1 + ], + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.3333333333333333, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + 0.3333333333333333 + ] + }, + { + "type": "attack", + "option": [ + 0.6666666666666666 + ] + }, + { + "type": "attack", + "option": [ + ] + } + ] + }, + { + "type": "move", + "option": [ + true, + false + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "myTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.9, + "y": 0.9, + "name": "myself", + "speed": 3, + "speedReload": 1, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + }, + { + "type": "attack", + "option": [ + 0.3333333333333333 + ] + }, + { + "type": "condition", + "option": [ + true, + true, + false, + 0.3333333333333333, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + false, + true + ] + }, + { + "type": "attack", + "option": [ + 1 + ] + } + ] + }, + { + "type": "move", + "option": [ + true, + true + ] + } + ] + } + ] + } + ], + "lBonus": [ + { + "style": "shield", + "number": 0, + "x": 0.2, + "y": 0.1 + }, + { + "style": "shield", + "number": 1, + "x": 0.5, + "y": 0.9 + }, + { + "style": "shield", + "number": 2, + "x": 0.2, + "y": 0.8 + } + ] +} \ No newline at end of file diff --git a/Code/src/json/duel4.json b/Code/src/json/duel4.json new file mode 100644 index 0000000..23eaa1c --- /dev/null +++ b/Code/src/json/duel4.json @@ -0,0 +1,210 @@ +{ + "enemyVisible": true, + "bonusVisible": true, + "robotRandomPosition": true, + "initStat": { + "valueMax": 10, + "lBar": [ + { + "valueMax": 5, + "color": 16711680, + "colorMin": 16711680, + "lText": [ + "DAMAGE", + "DEGATS" + ] + }, + { + "valueMax": 5, + "color": 8323327, + "colorMin": 8323327, + "lText": [ + "R.S", + "RECHARGEMENT" + ] + }, + { + "valueMax": 5, + "color": 255, + "colorMin": 255, + "lText": [ + "SPEED", + "VITESSE" + ] + }, + { + "valueMax": 5, + "color": 32768, + "colorMin": 32768, + "lText": [ + "RANGE", + "PORTEE" + ] + } + ] + }, + "listTeam": [ + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.1, + "y": 0.1, + "name": "enemy", + "speed": 3, + "speedReload": 3, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + false, + false, + true, + 0, + 1 + ], + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.3333333333333333, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + 0.3333333333333333 + ] + }, + { + "type": "attack", + "option": [ + 0.6666666666666666 + ] + }, + { + "type": "attack", + "option": [ + ] + } + ] + }, + { + "type": "move", + "option": [ + true, + false + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "myTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.9, + "y": 0.9, + "name": "myself", + "speed": 3, + "speedReload": 1, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + }, + { + "type": "attack", + "option": [ + 0.3333333333333333 + ] + }, + { + "type": "condition", + "option": [ + true, + true, + false, + 0.3333333333333333, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + false, + true + ] + }, + { + "type": "attack", + "option": [ + 1 + ] + } + ] + }, + { + "type": "move", + "option": [ + true, + true + ] + } + ] + } + ] + } + ], + "lBonus": [ + { + "style": "shield", + "number": 0, + "x": 0.2, + "y": 0.1 + }, + { + "style": "shield", + "number": 1, + "x": 0.5, + "y": 0.9 + }, + { + "style": "shield", + "number": 2, + "x": 0.2, + "y": 0.8 + } + ] +} \ No newline at end of file diff --git a/Code/src/json/duel5.json b/Code/src/json/duel5.json new file mode 100644 index 0000000..23eaa1c --- /dev/null +++ b/Code/src/json/duel5.json @@ -0,0 +1,210 @@ +{ + "enemyVisible": true, + "bonusVisible": true, + "robotRandomPosition": true, + "initStat": { + "valueMax": 10, + "lBar": [ + { + "valueMax": 5, + "color": 16711680, + "colorMin": 16711680, + "lText": [ + "DAMAGE", + "DEGATS" + ] + }, + { + "valueMax": 5, + "color": 8323327, + "colorMin": 8323327, + "lText": [ + "R.S", + "RECHARGEMENT" + ] + }, + { + "valueMax": 5, + "color": 255, + "colorMin": 255, + "lText": [ + "SPEED", + "VITESSE" + ] + }, + { + "valueMax": 5, + "color": 32768, + "colorMin": 32768, + "lText": [ + "RANGE", + "PORTEE" + ] + } + ] + }, + "listTeam": [ + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.1, + "y": 0.1, + "name": "enemy", + "speed": 3, + "speedReload": 3, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + false, + false, + true, + 0, + 1 + ], + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.3333333333333333, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + 0.3333333333333333 + ] + }, + { + "type": "attack", + "option": [ + 0.6666666666666666 + ] + }, + { + "type": "attack", + "option": [ + ] + } + ] + }, + { + "type": "move", + "option": [ + true, + false + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "myTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.9, + "y": 0.9, + "name": "myself", + "speed": 3, + "speedReload": 1, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + }, + { + "type": "attack", + "option": [ + 0.3333333333333333 + ] + }, + { + "type": "condition", + "option": [ + true, + true, + false, + 0.3333333333333333, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + false, + true + ] + }, + { + "type": "attack", + "option": [ + 1 + ] + } + ] + }, + { + "type": "move", + "option": [ + true, + true + ] + } + ] + } + ] + } + ], + "lBonus": [ + { + "style": "shield", + "number": 0, + "x": 0.2, + "y": 0.1 + }, + { + "style": "shield", + "number": 1, + "x": 0.5, + "y": 0.9 + }, + { + "style": "shield", + "number": 2, + "x": 0.2, + "y": 0.8 + } + ] +} \ No newline at end of file diff --git a/Code/src/json/duel6.json b/Code/src/json/duel6.json new file mode 100644 index 0000000..23eaa1c --- /dev/null +++ b/Code/src/json/duel6.json @@ -0,0 +1,210 @@ +{ + "enemyVisible": true, + "bonusVisible": true, + "robotRandomPosition": true, + "initStat": { + "valueMax": 10, + "lBar": [ + { + "valueMax": 5, + "color": 16711680, + "colorMin": 16711680, + "lText": [ + "DAMAGE", + "DEGATS" + ] + }, + { + "valueMax": 5, + "color": 8323327, + "colorMin": 8323327, + "lText": [ + "R.S", + "RECHARGEMENT" + ] + }, + { + "valueMax": 5, + "color": 255, + "colorMin": 255, + "lText": [ + "SPEED", + "VITESSE" + ] + }, + { + "valueMax": 5, + "color": 32768, + "colorMin": 32768, + "lText": [ + "RANGE", + "PORTEE" + ] + } + ] + }, + "listTeam": [ + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.1, + "y": 0.1, + "name": "enemy", + "speed": 3, + "speedReload": 3, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + false, + false, + true, + 0, + 1 + ], + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.3333333333333333, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + 0.3333333333333333 + ] + }, + { + "type": "attack", + "option": [ + 0.6666666666666666 + ] + }, + { + "type": "attack", + "option": [ + ] + } + ] + }, + { + "type": "move", + "option": [ + true, + false + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "myTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.9, + "y": 0.9, + "name": "myself", + "speed": 3, + "speedReload": 1, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + }, + { + "type": "attack", + "option": [ + 0.3333333333333333 + ] + }, + { + "type": "condition", + "option": [ + true, + true, + false, + 0.3333333333333333, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + false, + true + ] + }, + { + "type": "attack", + "option": [ + 1 + ] + } + ] + }, + { + "type": "move", + "option": [ + true, + true + ] + } + ] + } + ] + } + ], + "lBonus": [ + { + "style": "shield", + "number": 0, + "x": 0.2, + "y": 0.1 + }, + { + "style": "shield", + "number": 1, + "x": 0.5, + "y": 0.9 + }, + { + "style": "shield", + "number": 2, + "x": 0.2, + "y": 0.8 + } + ] +} \ No newline at end of file diff --git a/Code/src/json/duel7.json b/Code/src/json/duel7.json new file mode 100644 index 0000000..23eaa1c --- /dev/null +++ b/Code/src/json/duel7.json @@ -0,0 +1,210 @@ +{ + "enemyVisible": true, + "bonusVisible": true, + "robotRandomPosition": true, + "initStat": { + "valueMax": 10, + "lBar": [ + { + "valueMax": 5, + "color": 16711680, + "colorMin": 16711680, + "lText": [ + "DAMAGE", + "DEGATS" + ] + }, + { + "valueMax": 5, + "color": 8323327, + "colorMin": 8323327, + "lText": [ + "R.S", + "RECHARGEMENT" + ] + }, + { + "valueMax": 5, + "color": 255, + "colorMin": 255, + "lText": [ + "SPEED", + "VITESSE" + ] + }, + { + "valueMax": 5, + "color": 32768, + "colorMin": 32768, + "lText": [ + "RANGE", + "PORTEE" + ] + } + ] + }, + "listTeam": [ + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.1, + "y": 0.1, + "name": "enemy", + "speed": 3, + "speedReload": 3, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + false, + false, + true, + 0, + 1 + ], + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.3333333333333333, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + 0.3333333333333333 + ] + }, + { + "type": "attack", + "option": [ + 0.6666666666666666 + ] + }, + { + "type": "attack", + "option": [ + ] + } + ] + }, + { + "type": "move", + "option": [ + true, + false + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "myTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.9, + "y": 0.9, + "name": "myself", + "speed": 3, + "speedReload": 1, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + }, + { + "type": "attack", + "option": [ + 0.3333333333333333 + ] + }, + { + "type": "condition", + "option": [ + true, + true, + false, + 0.3333333333333333, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + false, + true + ] + }, + { + "type": "attack", + "option": [ + 1 + ] + } + ] + }, + { + "type": "move", + "option": [ + true, + true + ] + } + ] + } + ] + } + ], + "lBonus": [ + { + "style": "shield", + "number": 0, + "x": 0.2, + "y": 0.1 + }, + { + "style": "shield", + "number": 1, + "x": 0.5, + "y": 0.9 + }, + { + "style": "shield", + "number": 2, + "x": 0.2, + "y": 0.8 + } + ] +} \ No newline at end of file diff --git a/Code/src/json/level20.json b/Code/src/json/last0.json similarity index 100% rename from Code/src/json/level20.json rename to Code/src/json/last0.json diff --git a/Code/src/json/level21.json b/Code/src/json/last1.json similarity index 100% rename from Code/src/json/level21.json rename to Code/src/json/last1.json diff --git a/Code/src/json/last2.json b/Code/src/json/last2.json new file mode 100644 index 0000000..b9af2d5 --- /dev/null +++ b/Code/src/json/last2.json @@ -0,0 +1,460 @@ +{ + "enemyVisible": false, + "bonusVisible": true, + "robotRandomPosition": true, + "initStat": { + "valueMax": 10, + "lBar": [ + { + "valueMax": 5, + "color": 16711680, + "colorMin": 16711680, + "lText": [ + "DAMAGE", + "DEGATS" + ] + }, + { + "valueMax": 5, + "color": 8323327, + "colorMin": 8323327, + "lText": [ + "R.S", + "RECHARGEMENT" + ] + }, + { + "valueMax": 5, + "color": 255, + "colorMin": 255, + "lText": [ + "SPEED", + "VITESSE" + ] + }, + { + "valueMax": 5, + "color": 32768, + "colorMin": 32768, + "lText": [ + "RANGE", + "PORTEE" + ] + } + ] + }, + "listTeam": [ + { + "name": "myTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.9, + "y": 0.9, + "name": "myself", + "speed": 3, + "speedReload": 1, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + }, + { + "type": "attack", + "option": [ + 0.3333333333333333 + ] + }, + { + "type": "condition", + "option": [ + true, + true, + false, + 0.3333333333333333, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + false, + true + ] + }, + { + "type": "attack", + "option": [ + 1 + ] + } + ] + }, + { + "type": "move", + "option": [ + true, + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.1, + "y": 0.1, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.3, + "y": 0.1, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.7, + "y": 0.1, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.5, + "y": 0.4, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.1, + "y": 0.9, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.3, + "y": 0.7, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.9, + "y": 0.2, + "name": "enemy", + "speed": 3, + "speedReload": 1, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + } + ], + "lBonus": [ + { + "style": "speed", + "number": 0, + "x": 0.5, + "y": 0.5 + }, + { + "style": "attack", + "number": 2, + "x": 0.7, + "y": 0.7 + }, + { + "style": "shield", + "number": 0, + "x": 0.2, + "y": 0.9 + }, + { + "style": "shield", + "number": 1, + "x": 0.8, + "y": 0.4 + }, + { + "style": "shield", + "number": 2, + "x": 0.2, + "y": 0.2 + } + ] +} \ No newline at end of file diff --git a/Code/src/json/last3.json b/Code/src/json/last3.json new file mode 100644 index 0000000..b9af2d5 --- /dev/null +++ b/Code/src/json/last3.json @@ -0,0 +1,460 @@ +{ + "enemyVisible": false, + "bonusVisible": true, + "robotRandomPosition": true, + "initStat": { + "valueMax": 10, + "lBar": [ + { + "valueMax": 5, + "color": 16711680, + "colorMin": 16711680, + "lText": [ + "DAMAGE", + "DEGATS" + ] + }, + { + "valueMax": 5, + "color": 8323327, + "colorMin": 8323327, + "lText": [ + "R.S", + "RECHARGEMENT" + ] + }, + { + "valueMax": 5, + "color": 255, + "colorMin": 255, + "lText": [ + "SPEED", + "VITESSE" + ] + }, + { + "valueMax": 5, + "color": 32768, + "colorMin": 32768, + "lText": [ + "RANGE", + "PORTEE" + ] + } + ] + }, + "listTeam": [ + { + "name": "myTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.9, + "y": 0.9, + "name": "myself", + "speed": 3, + "speedReload": 1, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + }, + { + "type": "attack", + "option": [ + 0.3333333333333333 + ] + }, + { + "type": "condition", + "option": [ + true, + true, + false, + 0.3333333333333333, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + false, + true + ] + }, + { + "type": "attack", + "option": [ + 1 + ] + } + ] + }, + { + "type": "move", + "option": [ + true, + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.1, + "y": 0.1, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.3, + "y": 0.1, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.7, + "y": 0.1, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.5, + "y": 0.4, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.1, + "y": 0.9, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.3, + "y": 0.7, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.9, + "y": 0.2, + "name": "enemy", + "speed": 3, + "speedReload": 1, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + } + ], + "lBonus": [ + { + "style": "speed", + "number": 0, + "x": 0.5, + "y": 0.5 + }, + { + "style": "attack", + "number": 2, + "x": 0.7, + "y": 0.7 + }, + { + "style": "shield", + "number": 0, + "x": 0.2, + "y": 0.9 + }, + { + "style": "shield", + "number": 1, + "x": 0.8, + "y": 0.4 + }, + { + "style": "shield", + "number": 2, + "x": 0.2, + "y": 0.2 + } + ] +} \ No newline at end of file diff --git a/Code/src/json/last4.json b/Code/src/json/last4.json new file mode 100644 index 0000000..b9af2d5 --- /dev/null +++ b/Code/src/json/last4.json @@ -0,0 +1,460 @@ +{ + "enemyVisible": false, + "bonusVisible": true, + "robotRandomPosition": true, + "initStat": { + "valueMax": 10, + "lBar": [ + { + "valueMax": 5, + "color": 16711680, + "colorMin": 16711680, + "lText": [ + "DAMAGE", + "DEGATS" + ] + }, + { + "valueMax": 5, + "color": 8323327, + "colorMin": 8323327, + "lText": [ + "R.S", + "RECHARGEMENT" + ] + }, + { + "valueMax": 5, + "color": 255, + "colorMin": 255, + "lText": [ + "SPEED", + "VITESSE" + ] + }, + { + "valueMax": 5, + "color": 32768, + "colorMin": 32768, + "lText": [ + "RANGE", + "PORTEE" + ] + } + ] + }, + "listTeam": [ + { + "name": "myTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.9, + "y": 0.9, + "name": "myself", + "speed": 3, + "speedReload": 1, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + }, + { + "type": "attack", + "option": [ + 0.3333333333333333 + ] + }, + { + "type": "condition", + "option": [ + true, + true, + false, + 0.3333333333333333, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + false, + true + ] + }, + { + "type": "attack", + "option": [ + 1 + ] + } + ] + }, + { + "type": "move", + "option": [ + true, + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.1, + "y": 0.1, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.3, + "y": 0.1, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.7, + "y": 0.1, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.5, + "y": 0.4, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.1, + "y": 0.9, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.3, + "y": 0.7, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.9, + "y": 0.2, + "name": "enemy", + "speed": 3, + "speedReload": 1, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + } + ], + "lBonus": [ + { + "style": "speed", + "number": 0, + "x": 0.5, + "y": 0.5 + }, + { + "style": "attack", + "number": 2, + "x": 0.7, + "y": 0.7 + }, + { + "style": "shield", + "number": 0, + "x": 0.2, + "y": 0.9 + }, + { + "style": "shield", + "number": 1, + "x": 0.8, + "y": 0.4 + }, + { + "style": "shield", + "number": 2, + "x": 0.2, + "y": 0.2 + } + ] +} \ No newline at end of file diff --git a/Code/src/json/last5.json b/Code/src/json/last5.json new file mode 100644 index 0000000..b9af2d5 --- /dev/null +++ b/Code/src/json/last5.json @@ -0,0 +1,460 @@ +{ + "enemyVisible": false, + "bonusVisible": true, + "robotRandomPosition": true, + "initStat": { + "valueMax": 10, + "lBar": [ + { + "valueMax": 5, + "color": 16711680, + "colorMin": 16711680, + "lText": [ + "DAMAGE", + "DEGATS" + ] + }, + { + "valueMax": 5, + "color": 8323327, + "colorMin": 8323327, + "lText": [ + "R.S", + "RECHARGEMENT" + ] + }, + { + "valueMax": 5, + "color": 255, + "colorMin": 255, + "lText": [ + "SPEED", + "VITESSE" + ] + }, + { + "valueMax": 5, + "color": 32768, + "colorMin": 32768, + "lText": [ + "RANGE", + "PORTEE" + ] + } + ] + }, + "listTeam": [ + { + "name": "myTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.9, + "y": 0.9, + "name": "myself", + "speed": 3, + "speedReload": 1, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + }, + { + "type": "attack", + "option": [ + 0.3333333333333333 + ] + }, + { + "type": "condition", + "option": [ + true, + true, + false, + 0.3333333333333333, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + false, + true + ] + }, + { + "type": "attack", + "option": [ + 1 + ] + } + ] + }, + { + "type": "move", + "option": [ + true, + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.1, + "y": 0.1, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.3, + "y": 0.1, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.7, + "y": 0.1, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.5, + "y": 0.4, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.1, + "y": 0.9, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.3, + "y": 0.7, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.9, + "y": 0.2, + "name": "enemy", + "speed": 3, + "speedReload": 1, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + } + ], + "lBonus": [ + { + "style": "speed", + "number": 0, + "x": 0.5, + "y": 0.5 + }, + { + "style": "attack", + "number": 2, + "x": 0.7, + "y": 0.7 + }, + { + "style": "shield", + "number": 0, + "x": 0.2, + "y": 0.9 + }, + { + "style": "shield", + "number": 1, + "x": 0.8, + "y": 0.4 + }, + { + "style": "shield", + "number": 2, + "x": 0.2, + "y": 0.2 + } + ] +} \ No newline at end of file diff --git a/Code/src/json/last6.json b/Code/src/json/last6.json new file mode 100644 index 0000000..b9af2d5 --- /dev/null +++ b/Code/src/json/last6.json @@ -0,0 +1,460 @@ +{ + "enemyVisible": false, + "bonusVisible": true, + "robotRandomPosition": true, + "initStat": { + "valueMax": 10, + "lBar": [ + { + "valueMax": 5, + "color": 16711680, + "colorMin": 16711680, + "lText": [ + "DAMAGE", + "DEGATS" + ] + }, + { + "valueMax": 5, + "color": 8323327, + "colorMin": 8323327, + "lText": [ + "R.S", + "RECHARGEMENT" + ] + }, + { + "valueMax": 5, + "color": 255, + "colorMin": 255, + "lText": [ + "SPEED", + "VITESSE" + ] + }, + { + "valueMax": 5, + "color": 32768, + "colorMin": 32768, + "lText": [ + "RANGE", + "PORTEE" + ] + } + ] + }, + "listTeam": [ + { + "name": "myTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.9, + "y": 0.9, + "name": "myself", + "speed": 3, + "speedReload": 1, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + }, + { + "type": "attack", + "option": [ + 0.3333333333333333 + ] + }, + { + "type": "condition", + "option": [ + true, + true, + false, + 0.3333333333333333, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + false, + true + ] + }, + { + "type": "attack", + "option": [ + 1 + ] + } + ] + }, + { + "type": "move", + "option": [ + true, + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.1, + "y": 0.1, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.3, + "y": 0.1, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.7, + "y": 0.1, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.5, + "y": 0.4, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.1, + "y": 0.9, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.3, + "y": 0.7, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.9, + "y": 0.2, + "name": "enemy", + "speed": 3, + "speedReload": 1, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + } + ], + "lBonus": [ + { + "style": "speed", + "number": 0, + "x": 0.5, + "y": 0.5 + }, + { + "style": "attack", + "number": 2, + "x": 0.7, + "y": 0.7 + }, + { + "style": "shield", + "number": 0, + "x": 0.2, + "y": 0.9 + }, + { + "style": "shield", + "number": 1, + "x": 0.8, + "y": 0.4 + }, + { + "style": "shield", + "number": 2, + "x": 0.2, + "y": 0.2 + } + ] +} \ No newline at end of file diff --git a/Code/src/json/last7.json b/Code/src/json/last7.json new file mode 100644 index 0000000..b9af2d5 --- /dev/null +++ b/Code/src/json/last7.json @@ -0,0 +1,460 @@ +{ + "enemyVisible": false, + "bonusVisible": true, + "robotRandomPosition": true, + "initStat": { + "valueMax": 10, + "lBar": [ + { + "valueMax": 5, + "color": 16711680, + "colorMin": 16711680, + "lText": [ + "DAMAGE", + "DEGATS" + ] + }, + { + "valueMax": 5, + "color": 8323327, + "colorMin": 8323327, + "lText": [ + "R.S", + "RECHARGEMENT" + ] + }, + { + "valueMax": 5, + "color": 255, + "colorMin": 255, + "lText": [ + "SPEED", + "VITESSE" + ] + }, + { + "valueMax": 5, + "color": 32768, + "colorMin": 32768, + "lText": [ + "RANGE", + "PORTEE" + ] + } + ] + }, + "listTeam": [ + { + "name": "myTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.9, + "y": 0.9, + "name": "myself", + "speed": 3, + "speedReload": 1, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + }, + { + "type": "attack", + "option": [ + 0.3333333333333333 + ] + }, + { + "type": "condition", + "option": [ + true, + true, + false, + 0.3333333333333333, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + false, + true + ] + }, + { + "type": "attack", + "option": [ + 1 + ] + } + ] + }, + { + "type": "move", + "option": [ + true, + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.1, + "y": 0.1, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.3, + "y": 0.1, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.7, + "y": 0.1, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.5, + "y": 0.4, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.1, + "y": 0.9, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.3, + "y": 0.7, + "name": "enemy", + "speed": 1, + "speedReload": 1, + "range": 5, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.9, + "y": 0.2, + "name": "enemy", + "speed": 3, + "speedReload": 1, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "condition", + "option": [ + true, + true, + false, + 0.5, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + } + ] + }, + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + } + ], + "lBonus": [ + { + "style": "speed", + "number": 0, + "x": 0.5, + "y": 0.5 + }, + { + "style": "attack", + "number": 2, + "x": 0.7, + "y": 0.7 + }, + { + "style": "shield", + "number": 0, + "x": 0.2, + "y": 0.9 + }, + { + "style": "shield", + "number": 1, + "x": 0.8, + "y": 0.4 + }, + { + "style": "shield", + "number": 2, + "x": 0.2, + "y": 0.2 + } + ] +} \ No newline at end of file diff --git a/Code/src/json/level30.json b/Code/src/json/team0.json similarity index 100% rename from Code/src/json/level30.json rename to Code/src/json/team0.json diff --git a/Code/src/json/level31.json b/Code/src/json/team1.json similarity index 100% rename from Code/src/json/level31.json rename to Code/src/json/team1.json diff --git a/Code/src/json/team2.json b/Code/src/json/team2.json new file mode 100644 index 0000000..abb85c2 --- /dev/null +++ b/Code/src/json/team2.json @@ -0,0 +1,297 @@ +{ + "enemyVisible": false, + "bonusVisible": true, + "robotRandomPosition": false, + "initStat": { + "valueMax": 10, + "lBar": [ + { + "valueMax": 5, + "color": 16711680, + "colorMin": 16711680, + "lText": [ + "DAMAGE", + "DEGATS" + ] + }, + { + "valueMax": 5, + "color": 8323327, + "colorMin": 8323327, + "lText": [ + "R.S", + "RECHARGEMENT" + ] + }, + { + "valueMax": 5, + "color": 255, + "colorMin": 255, + "lText": [ + "SPEED", + "VITESSE" + ] + }, + { + "valueMax": 5, + "color": 32768, + "colorMin": 32768, + "lText": [ + "RANGE", + "PORTEE" + ] + } + ] + }, + "listTeam": [ + { + "name": "myTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.9, + "y": 0.8, + "name": "myself", + "speed": 3, + "speedReload": 1, + "range": 1, + "damage": 5, + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + }, + { + "type": "attack", + "option": [ + 0.3333333333333333 + ] + }, + { + "type": "condition", + "option": [ + true, + true, + false, + 0.3333333333333333, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + false, + true + ] + }, + { + "type": "attack", + "option": [ + 1 + ] + } + ] + }, + { + "type": "move", + "option": [ + true, + true + ] + } + ] + }, + { + "height": 0.1, + "width": 0.1, + "x": 0.8, + "y": 0.9, + "name": "myself", + "speed": 3, + "speedReload": 1, + "range": 1, + "damage": 5, + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + }, + { + "type": "attack", + "option": [ + 0.3333333333333333 + ] + }, + { + "type": "condition", + "option": [ + true, + true, + false, + 0.3333333333333333, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + false, + true + ] + }, + { + "type": "attack", + "option": [ + 1 + ] + } + ] + }, + { + "type": "move", + "option": [ + true, + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "color": 16711680, + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.1, + "y": 0.8, + "name": "enemy", + "speed": 3, + "speedReload": 3, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + }, + { + "height": 0.1, + "width": 0.1, + "x": 0.2, + "y": 0.9, + "name": "enemy", + "speed": 3, + "speedReload": 3, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "color": 32768, + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.5, + "y": 0.1, + "name": "enemy", + "speed": 3, + "speedReload": 1, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + }, + { + "height": 0.1, + "width": 0.1, + "x": 0.5, + "y": 0.2, + "name": "enemy", + "speed": 3, + "speedReload": 1, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + } + ], + "lBonus": [ + { + "style": "speed", + "number": 1, + "x": 0.5, + "y": 0.5 + }, + { + "style": "shield", + "number": 2, + "x": 0.1, + "y": 0.1 + }, + { + "style": "attack", + "number": 2, + "x": 0.9, + "y": 0.1 + } + ] +} \ No newline at end of file diff --git a/Code/src/json/team3.json b/Code/src/json/team3.json new file mode 100644 index 0000000..abb85c2 --- /dev/null +++ b/Code/src/json/team3.json @@ -0,0 +1,297 @@ +{ + "enemyVisible": false, + "bonusVisible": true, + "robotRandomPosition": false, + "initStat": { + "valueMax": 10, + "lBar": [ + { + "valueMax": 5, + "color": 16711680, + "colorMin": 16711680, + "lText": [ + "DAMAGE", + "DEGATS" + ] + }, + { + "valueMax": 5, + "color": 8323327, + "colorMin": 8323327, + "lText": [ + "R.S", + "RECHARGEMENT" + ] + }, + { + "valueMax": 5, + "color": 255, + "colorMin": 255, + "lText": [ + "SPEED", + "VITESSE" + ] + }, + { + "valueMax": 5, + "color": 32768, + "colorMin": 32768, + "lText": [ + "RANGE", + "PORTEE" + ] + } + ] + }, + "listTeam": [ + { + "name": "myTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.9, + "y": 0.8, + "name": "myself", + "speed": 3, + "speedReload": 1, + "range": 1, + "damage": 5, + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + }, + { + "type": "attack", + "option": [ + 0.3333333333333333 + ] + }, + { + "type": "condition", + "option": [ + true, + true, + false, + 0.3333333333333333, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + false, + true + ] + }, + { + "type": "attack", + "option": [ + 1 + ] + } + ] + }, + { + "type": "move", + "option": [ + true, + true + ] + } + ] + }, + { + "height": 0.1, + "width": 0.1, + "x": 0.8, + "y": 0.9, + "name": "myself", + "speed": 3, + "speedReload": 1, + "range": 1, + "damage": 5, + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + }, + { + "type": "attack", + "option": [ + 0.3333333333333333 + ] + }, + { + "type": "condition", + "option": [ + true, + true, + false, + 0.3333333333333333, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + false, + true + ] + }, + { + "type": "attack", + "option": [ + 1 + ] + } + ] + }, + { + "type": "move", + "option": [ + true, + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "color": 16711680, + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.1, + "y": 0.8, + "name": "enemy", + "speed": 3, + "speedReload": 3, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + }, + { + "height": 0.1, + "width": 0.1, + "x": 0.2, + "y": 0.9, + "name": "enemy", + "speed": 3, + "speedReload": 3, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "color": 32768, + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.5, + "y": 0.1, + "name": "enemy", + "speed": 3, + "speedReload": 1, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + }, + { + "height": 0.1, + "width": 0.1, + "x": 0.5, + "y": 0.2, + "name": "enemy", + "speed": 3, + "speedReload": 1, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + } + ], + "lBonus": [ + { + "style": "speed", + "number": 1, + "x": 0.5, + "y": 0.5 + }, + { + "style": "shield", + "number": 2, + "x": 0.1, + "y": 0.1 + }, + { + "style": "attack", + "number": 2, + "x": 0.9, + "y": 0.1 + } + ] +} \ No newline at end of file diff --git a/Code/src/json/team4.json b/Code/src/json/team4.json new file mode 100644 index 0000000..abb85c2 --- /dev/null +++ b/Code/src/json/team4.json @@ -0,0 +1,297 @@ +{ + "enemyVisible": false, + "bonusVisible": true, + "robotRandomPosition": false, + "initStat": { + "valueMax": 10, + "lBar": [ + { + "valueMax": 5, + "color": 16711680, + "colorMin": 16711680, + "lText": [ + "DAMAGE", + "DEGATS" + ] + }, + { + "valueMax": 5, + "color": 8323327, + "colorMin": 8323327, + "lText": [ + "R.S", + "RECHARGEMENT" + ] + }, + { + "valueMax": 5, + "color": 255, + "colorMin": 255, + "lText": [ + "SPEED", + "VITESSE" + ] + }, + { + "valueMax": 5, + "color": 32768, + "colorMin": 32768, + "lText": [ + "RANGE", + "PORTEE" + ] + } + ] + }, + "listTeam": [ + { + "name": "myTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.9, + "y": 0.8, + "name": "myself", + "speed": 3, + "speedReload": 1, + "range": 1, + "damage": 5, + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + }, + { + "type": "attack", + "option": [ + 0.3333333333333333 + ] + }, + { + "type": "condition", + "option": [ + true, + true, + false, + 0.3333333333333333, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + false, + true + ] + }, + { + "type": "attack", + "option": [ + 1 + ] + } + ] + }, + { + "type": "move", + "option": [ + true, + true + ] + } + ] + }, + { + "height": 0.1, + "width": 0.1, + "x": 0.8, + "y": 0.9, + "name": "myself", + "speed": 3, + "speedReload": 1, + "range": 1, + "damage": 5, + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + }, + { + "type": "attack", + "option": [ + 0.3333333333333333 + ] + }, + { + "type": "condition", + "option": [ + true, + true, + false, + 0.3333333333333333, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + false, + true + ] + }, + { + "type": "attack", + "option": [ + 1 + ] + } + ] + }, + { + "type": "move", + "option": [ + true, + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "color": 16711680, + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.1, + "y": 0.8, + "name": "enemy", + "speed": 3, + "speedReload": 3, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + }, + { + "height": 0.1, + "width": 0.1, + "x": 0.2, + "y": 0.9, + "name": "enemy", + "speed": 3, + "speedReload": 3, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "color": 32768, + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.5, + "y": 0.1, + "name": "enemy", + "speed": 3, + "speedReload": 1, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + }, + { + "height": 0.1, + "width": 0.1, + "x": 0.5, + "y": 0.2, + "name": "enemy", + "speed": 3, + "speedReload": 1, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + } + ], + "lBonus": [ + { + "style": "speed", + "number": 1, + "x": 0.5, + "y": 0.5 + }, + { + "style": "shield", + "number": 2, + "x": 0.1, + "y": 0.1 + }, + { + "style": "attack", + "number": 2, + "x": 0.9, + "y": 0.1 + } + ] +} \ No newline at end of file diff --git a/Code/src/json/team5.json b/Code/src/json/team5.json new file mode 100644 index 0000000..abb85c2 --- /dev/null +++ b/Code/src/json/team5.json @@ -0,0 +1,297 @@ +{ + "enemyVisible": false, + "bonusVisible": true, + "robotRandomPosition": false, + "initStat": { + "valueMax": 10, + "lBar": [ + { + "valueMax": 5, + "color": 16711680, + "colorMin": 16711680, + "lText": [ + "DAMAGE", + "DEGATS" + ] + }, + { + "valueMax": 5, + "color": 8323327, + "colorMin": 8323327, + "lText": [ + "R.S", + "RECHARGEMENT" + ] + }, + { + "valueMax": 5, + "color": 255, + "colorMin": 255, + "lText": [ + "SPEED", + "VITESSE" + ] + }, + { + "valueMax": 5, + "color": 32768, + "colorMin": 32768, + "lText": [ + "RANGE", + "PORTEE" + ] + } + ] + }, + "listTeam": [ + { + "name": "myTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.9, + "y": 0.8, + "name": "myself", + "speed": 3, + "speedReload": 1, + "range": 1, + "damage": 5, + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + }, + { + "type": "attack", + "option": [ + 0.3333333333333333 + ] + }, + { + "type": "condition", + "option": [ + true, + true, + false, + 0.3333333333333333, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + false, + true + ] + }, + { + "type": "attack", + "option": [ + 1 + ] + } + ] + }, + { + "type": "move", + "option": [ + true, + true + ] + } + ] + }, + { + "height": 0.1, + "width": 0.1, + "x": 0.8, + "y": 0.9, + "name": "myself", + "speed": 3, + "speedReload": 1, + "range": 1, + "damage": 5, + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + }, + { + "type": "attack", + "option": [ + 0.3333333333333333 + ] + }, + { + "type": "condition", + "option": [ + true, + true, + false, + 0.3333333333333333, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + false, + true + ] + }, + { + "type": "attack", + "option": [ + 1 + ] + } + ] + }, + { + "type": "move", + "option": [ + true, + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "color": 16711680, + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.1, + "y": 0.8, + "name": "enemy", + "speed": 3, + "speedReload": 3, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + }, + { + "height": 0.1, + "width": 0.1, + "x": 0.2, + "y": 0.9, + "name": "enemy", + "speed": 3, + "speedReload": 3, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "color": 32768, + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.5, + "y": 0.1, + "name": "enemy", + "speed": 3, + "speedReload": 1, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + }, + { + "height": 0.1, + "width": 0.1, + "x": 0.5, + "y": 0.2, + "name": "enemy", + "speed": 3, + "speedReload": 1, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + } + ], + "lBonus": [ + { + "style": "speed", + "number": 1, + "x": 0.5, + "y": 0.5 + }, + { + "style": "shield", + "number": 2, + "x": 0.1, + "y": 0.1 + }, + { + "style": "attack", + "number": 2, + "x": 0.9, + "y": 0.1 + } + ] +} \ No newline at end of file diff --git a/Code/src/json/team6.json b/Code/src/json/team6.json new file mode 100644 index 0000000..abb85c2 --- /dev/null +++ b/Code/src/json/team6.json @@ -0,0 +1,297 @@ +{ + "enemyVisible": false, + "bonusVisible": true, + "robotRandomPosition": false, + "initStat": { + "valueMax": 10, + "lBar": [ + { + "valueMax": 5, + "color": 16711680, + "colorMin": 16711680, + "lText": [ + "DAMAGE", + "DEGATS" + ] + }, + { + "valueMax": 5, + "color": 8323327, + "colorMin": 8323327, + "lText": [ + "R.S", + "RECHARGEMENT" + ] + }, + { + "valueMax": 5, + "color": 255, + "colorMin": 255, + "lText": [ + "SPEED", + "VITESSE" + ] + }, + { + "valueMax": 5, + "color": 32768, + "colorMin": 32768, + "lText": [ + "RANGE", + "PORTEE" + ] + } + ] + }, + "listTeam": [ + { + "name": "myTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.9, + "y": 0.8, + "name": "myself", + "speed": 3, + "speedReload": 1, + "range": 1, + "damage": 5, + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + }, + { + "type": "attack", + "option": [ + 0.3333333333333333 + ] + }, + { + "type": "condition", + "option": [ + true, + true, + false, + 0.3333333333333333, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + false, + true + ] + }, + { + "type": "attack", + "option": [ + 1 + ] + } + ] + }, + { + "type": "move", + "option": [ + true, + true + ] + } + ] + }, + { + "height": 0.1, + "width": 0.1, + "x": 0.8, + "y": 0.9, + "name": "myself", + "speed": 3, + "speedReload": 1, + "range": 1, + "damage": 5, + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + }, + { + "type": "attack", + "option": [ + 0.3333333333333333 + ] + }, + { + "type": "condition", + "option": [ + true, + true, + false, + 0.3333333333333333, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + false, + true + ] + }, + { + "type": "attack", + "option": [ + 1 + ] + } + ] + }, + { + "type": "move", + "option": [ + true, + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "color": 16711680, + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.1, + "y": 0.8, + "name": "enemy", + "speed": 3, + "speedReload": 3, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + }, + { + "height": 0.1, + "width": 0.1, + "x": 0.2, + "y": 0.9, + "name": "enemy", + "speed": 3, + "speedReload": 3, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "color": 32768, + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.5, + "y": 0.1, + "name": "enemy", + "speed": 3, + "speedReload": 1, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + }, + { + "height": 0.1, + "width": 0.1, + "x": 0.5, + "y": 0.2, + "name": "enemy", + "speed": 3, + "speedReload": 1, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + } + ], + "lBonus": [ + { + "style": "speed", + "number": 1, + "x": 0.5, + "y": 0.5 + }, + { + "style": "shield", + "number": 2, + "x": 0.1, + "y": 0.1 + }, + { + "style": "attack", + "number": 2, + "x": 0.9, + "y": 0.1 + } + ] +} \ No newline at end of file diff --git a/Code/src/json/team7.json b/Code/src/json/team7.json new file mode 100644 index 0000000..abb85c2 --- /dev/null +++ b/Code/src/json/team7.json @@ -0,0 +1,297 @@ +{ + "enemyVisible": false, + "bonusVisible": true, + "robotRandomPosition": false, + "initStat": { + "valueMax": 10, + "lBar": [ + { + "valueMax": 5, + "color": 16711680, + "colorMin": 16711680, + "lText": [ + "DAMAGE", + "DEGATS" + ] + }, + { + "valueMax": 5, + "color": 8323327, + "colorMin": 8323327, + "lText": [ + "R.S", + "RECHARGEMENT" + ] + }, + { + "valueMax": 5, + "color": 255, + "colorMin": 255, + "lText": [ + "SPEED", + "VITESSE" + ] + }, + { + "valueMax": 5, + "color": 32768, + "colorMin": 32768, + "lText": [ + "RANGE", + "PORTEE" + ] + } + ] + }, + "listTeam": [ + { + "name": "myTeam", + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.9, + "y": 0.8, + "name": "myself", + "speed": 3, + "speedReload": 1, + "range": 1, + "damage": 5, + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + }, + { + "type": "attack", + "option": [ + 0.3333333333333333 + ] + }, + { + "type": "condition", + "option": [ + true, + true, + false, + 0.3333333333333333, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + false, + true + ] + }, + { + "type": "attack", + "option": [ + 1 + ] + } + ] + }, + { + "type": "move", + "option": [ + true, + true + ] + } + ] + }, + { + "height": 0.1, + "width": 0.1, + "x": 0.8, + "y": 0.9, + "name": "myself", + "speed": 3, + "speedReload": 1, + "range": 1, + "damage": 5, + "lNode": [ + { + "type": "move", + "option": [ + true, + false + ] + }, + { + "type": "attack", + "option": [ + 0.3333333333333333 + ] + }, + { + "type": "condition", + "option": [ + true, + true, + false, + 0.3333333333333333, + 0 + ], + "lNode": [ + { + "type": "move", + "option": [ + false, + true + ] + }, + { + "type": "attack", + "option": [ + 1 + ] + } + ] + }, + { + "type": "move", + "option": [ + true, + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "color": 16711680, + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.1, + "y": 0.8, + "name": "enemy", + "speed": 3, + "speedReload": 3, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + }, + { + "height": 0.1, + "width": 0.1, + "x": 0.2, + "y": 0.9, + "name": "enemy", + "speed": 3, + "speedReload": 3, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + }, + { + "name": "enemyTeam", + "color": 32768, + "robots": [ + { + "height": 0.1, + "width": 0.1, + "x": 0.5, + "y": 0.1, + "name": "enemy", + "speed": 3, + "speedReload": 1, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + }, + { + "height": 0.1, + "width": 0.1, + "x": 0.5, + "y": 0.2, + "name": "enemy", + "speed": 3, + "speedReload": 1, + "range": 3, + "damage": 5, + "lNode": [ + { + "type": "attack", + "option": [ + ] + }, + { + "type": "move", + "option": [ + true + ] + } + ] + } + ] + } + ], + "lBonus": [ + { + "style": "speed", + "number": 1, + "x": 0.5, + "y": 0.5 + }, + { + "style": "shield", + "number": 2, + "x": 0.1, + "y": 0.1 + }, + { + "style": "attack", + "number": 2, + "x": 0.9, + "y": 0.1 + } + ] +} \ No newline at end of file