Commit 4b68e6b1 authored by Raphaël Bastide's avatar Raphaël Bastide

Bonuses lock/unlock, color update

parent 0f11e674
......@@ -25,9 +25,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="2.8"
inkscape:cx="-16.017187"
inkscape:cy="101.59706"
inkscape:zoom="1.4"
inkscape:cx="97.40718"
inkscape:cy="136.18283"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
......@@ -35,12 +35,23 @@
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1920"
inkscape:window-height="1024"
inkscape:window-x="0"
inkscape:window-y="868"
inkscape:window-width="1080"
inkscape:window-height="1892"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="1"
units="px" />
units="px"
inkscape:snap-bbox="true"
inkscape:bbox-paths="true"
inkscape:bbox-nodes="true"
inkscape:snap-bbox-edge-midpoints="true"
inkscape:snap-bbox-midpoints="true"
inkscape:snap-smooth-nodes="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-page="true"
inkscape:object-paths="true"
inkscape:snap-intersection-paths="true"
inkscape:snap-global="false" />
<metadata
id="metadata5">
<rdf:RDF>
......@@ -49,7 +60,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
......@@ -58,34 +69,72 @@
inkscape:groupmode="layer"
id="layer1"
transform="translate(46.310902,285.37685)">
<circle
id="path817"
style="opacity:1;vector-effect:none;fill:#ff0000;fill-opacity:1;stroke:none;stroke-width:0.59829068;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
cx="-19.852568"
cy="-258.91852"
r="26.458334"
inkscape:export-xdpi="57.439999"
inkscape:export-ydpi="57.439999" />
<g
id="g940"
transform="matrix(0.31873447,0.02352675,-0.02320874,0.3231018,-5.661252,-170.34948)"
style="stroke:#ffffff;stroke-width:7.7697587;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none">
id="g839"
transform="matrix(0.99238553,0,0,0.9923411,-0.15116588,-1.9830296)"
style="stroke-width:1.00769544">
<circle
inkscape:export-ydpi="57.439999"
inkscape:export-xdpi="57.439999"
r="25.796873"
cy="-258.91852"
cx="-19.85257"
style="opacity:1;vector-effect:none;fill:#ec82be;fill-opacity:1;stroke:#000000;stroke-width:1.3330971;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke"
id="path817" />
<path
style="opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:7.7697587;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
d="m -90.544714,-264.43722 c 5.304341,0.78317 10.700125,-0.26491 16.063629,-0.38683 1.041152,-0.0237 2.090544,0.0217 3.127462,-0.0538"
id="path868"
inkscape:connector-curvature="0" />
sodipodi:nodetypes="ccc"
inkscape:connector-curvature="0"
id="path18"
d="m -1.1897255,-277.6733 -18.6628445,18.75478 19.68907482,17.67438"
style="opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#000000;stroke-width:1.28581941;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.98431373;paint-order:normal" />
<path
sodipodi:nodetypes="cc"
inkscape:connector-curvature="0"
id="path20"
d="m -19.85257,-258.91852 -23.433927,12.28391"
style="opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#000000;stroke-width:1.28581941;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.98431373;paint-order:normal" />
<path
style="opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:7.7697587;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
d="m -80.091698,-272.59188 c -0.04962,0.62408 -0.202903,1.11882 -0.22009,1.75568 -0.05264,1.9503 0.334741,4.16881 0.09492,6.08187 -0.350846,2.79873 -0.558332,5.47244 -0.346938,8.3756"
id="path870"
inkscape:connector-curvature="0" />
sodipodi:nodetypes="ccc"
inkscape:connector-curvature="0"
id="path22"
d="m -46.310902,-258.91877 26.458332,2.5e-4 -13.26433,-22.89325"
style="opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#000000;stroke-width:1.28581941;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.98431373;paint-order:normal" />
<path
style="opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:7.7697587;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
d="m -58.718888,-281.74214 c 1.263179,-0.93935 2.820754,-2.04422 3.852415,-3.23793 1.73214,-2.0042 2.904101,-2.79342 4.203899,-5.08843 0.405227,-0.71549 2.992305,-1.4795 3.362614,-2.21261 0.242176,-0.47945 0.401962,-1.13522 0.363317,-0.98327 -0.245806,0.96643 0.12248,2.13617 0.05376,3.12746 -0.182406,2.63132 0.32724,5.26618 0.227229,7.89888 -0.01699,0.44725 0.16236,0.94247 0.100805,1.38438 -0.158473,1.13765 -0.395737,2.34139 -0.440183,3.51136 -0.0179,0.47123 0.164464,1.16956 0.03318,1.65026 -0.07187,0.26317 -0.324447,0.45707 -0.382217,0.72369 -0.234018,1.08011 0.216834,2.37376 0.07897,3.47356 -0.02739,0.21852 -0.181664,0.40695 -0.215472,0.62457 -0.17369,1.1181 0.173669,2.32215 -0.100384,3.39963 -0.285747,1.12346 0.621282,2.61847 0.270911,3.72053 -0.387073,1.21749 0.208375,6.44537 0.326354,8.06563"
id="path872"
sodipodi:nodetypes="cc"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccsccccccscc" />
id="path24"
d="m -19.85257,-258.91852 4.001178,26.15405"
style="opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#000000;stroke-width:1.28581941;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.98431373;paint-order:normal" />
</g>
<path
style="opacity:1;vector-effect:none;fill:#ffb380;fill-opacity:1;stroke:#000000;stroke-width:0.80000001;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.98431373;paint-order:fill markers stroke"
d="m -44.987984,-284.29017 6.047619,6.04762"
id="path818"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path820"
d="m -0.94492716,-239.41384 6.12445026,5.9698"
style="opacity:1;vector-effect:none;fill:#ffb380;fill-opacity:1;stroke:#000000;stroke-width:0.80000001;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.98431373;paint-order:fill markers stroke" />
<path
style="opacity:1;vector-effect:none;fill:#ffb380;fill-opacity:1;stroke:#000000;stroke-width:0.80000001;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.98431373;paint-order:fill markers stroke"
d="m -36.184207,-284.78632 1.932225,2.60622"
id="path822"
inkscape:connector-curvature="0" />
<path
style="opacity:1;vector-effect:none;fill:#ffb380;fill-opacity:1;stroke:#000000;stroke-width:0.80000001;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.98431373;paint-order:fill markers stroke"
d="m -35.927618,-237.45883 -3.190677,4.70563"
id="path826"
inkscape:connector-curvature="0" />
<path
style="opacity:1;vector-effect:none;fill:#ffb380;fill-opacity:1;stroke:#000000;stroke-width:0.80000001;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.98431373;paint-order:fill markers stroke"
d="m 1.9045591,-242.31194 3.4910081,1.75432"
id="path830"
inkscape:connector-curvature="0" />
<path
style="opacity:1;vector-effect:none;fill:#ffb380;fill-opacity:1;stroke:#000000;stroke-width:0.80000001;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.98431373;paint-order:fill markers stroke"
d="m -4.0760511,-281.39922 1.897855,-3.37229"
id="path834"
inkscape:connector-curvature="0" />
</g>
</svg>
......@@ -15,6 +15,7 @@
</head>
<body>
<aside>
<div id="unitlist"></div>
<div id="alertbox"></div>
</aside>
<!-- <button class="play">play</button> -->
......@@ -36,6 +37,7 @@
<!-- <script src="js/car.js"></script>
<script src="js/launcher.js"></script> -->
<script src="js/launch.js"></script>
<script src="js/functions.js"></script>
<script src="js/world.js"></script>
</body>
</html>
function getDistances(unit){
var realW = unit.bounds.max.x - unit.bounds.min.x
var realH = unit.bounds.max.y - unit.bounds.min.y
return unit.distances = {w:realW, h:realH}
}
function checkLock(unit){
if (unit.isLocked === true) {
// var message = unit.name+' ['+unit.char+'] is locked. Unlock it so you can use it in the URL'
// notifAlert(message)
return true
}else {
return false
}
}
function notifAlert(message){
var alertBox = document.getElementById("alertbox")
var alertLine = document.createElement('p')
alertLine.innerHTML = message
alertBox.appendChild(alertLine)
alertLine.classList.add('visible')
setTimeout(function(){ alertLine.classList.remove('visible') }, 5000);
// alert(unit.name+' ('+unit.char+') is locked. Unlock it so you can use it in the URL')
}
function findObjectsByKey(array, key, value) {
var result = []
for (var i = 0; i < array.length; i++) {
if (array[i][key] === value) {
result.push(array[i]);
}
}
return result
}
......@@ -5,7 +5,7 @@
"char": "f",
"verticalShift":"0",
"isLocked": false,
"color":"#D7D7CD",
"color":"#D7D7CD77",
"angle":"0",
"isStatic":true
},
......@@ -14,35 +14,35 @@
"char": "d",
"verticalShift":"-1",
"isLocked": false,
"color":"#eeeeee",
"color":"#eeeeee77",
"angle":"0.2",
"isStatic":true
},
{
"name": "up",
"char": "u",
"verticalShift": "1",
"isLocked": true,
"color":"#eeeeee",
"angle":"-0.2",
"isStatic":true
},
{
"name": "gap",
"char": "g",
"verticalShift": "0",
"isLocked": true,
"isLocked": false,
"color":"#ffffff00",
"angle":"0",
"isStatic":true,
"isSensor":true
},
{
"name": "up",
"char": "u",
"verticalShift": "1",
"isLocked": true,
"color":"#eeeeee77",
"angle":"-0.2",
"isStatic":true
},
{
"name": "boost",
"char": "b",
"verticalShift": "0",
"isLocked": true,
"color":"#e26262",
"color":"#e2626277",
"angle":"0",
"isStatic":true
},
......@@ -51,7 +51,7 @@
"char": "t",
"verticalShift": "0",
"isLocked": true,
"color":"#532890",
"color":"#53289077",
"angle":"0",
"isStatic":true
},
......@@ -60,7 +60,7 @@
"char": "i",
"verticalShift": "0",
"isLocked": true,
"color":"#69e262",
"color":"#69e26277",
"angle":"0",
"isStatic":true
},
......@@ -69,7 +69,7 @@
"char": "j",
"verticalShift": "0",
"isLocked": true,
"color":"#62e2c3",
"color":"#62e2c377",
"angle":"0",
"isStatic":true
},
......@@ -78,35 +78,42 @@
"char": "z",
"verticalShift": "0",
"isLocked": true,
"color":"#dfe262",
"color":"#dfe26277",
"angle":"0",
"isStatic":true
},
{
"name": "buildUp",
"type": "buildPlace",
"role": "buildPlace",
"char": "1",
"verticalShift": -500
},
{
"name": "buildDown",
"type": "buildPlace",
"role": "buildPlace",
"char": "0",
"verticalShift": 500
},
{
"name": "bonus1",
"type": "bonus",
"posX": 3300,
"role": "bonus",
"posX": 1300,
"posY": 500,
"unlocks":"boost"
},
{
"name": "bonus2",
"type": "bonus",
"role": "bonus",
"posX": 2300,
"posY": 500,
"unlocks":"jump"
},
{
"name": "bonus3",
"role": "bonus",
"posX": 300,
"posY": 200,
"unlocks":"up"
}
]
}
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment