Modified level format
Added player speed label Player speed will change in level Player progress and speed reset at new level Ramp collision error fixed
This commit is contained in:
@ -1,12 +1,12 @@
|
||||
<levelPack name="Grasslands" id="1">
|
||||
<levels class="java.util.ArrayList">
|
||||
<level number="1" goalX="22.606565">
|
||||
<terrain height="-0.6" endX="25.106565">
|
||||
<gaps class="java.util.ArrayList">
|
||||
<gap leftEdge="5.3500023" rightEdge="5.950004"/>
|
||||
<gap leftEdge="15.353701" rightEdge="15.7197"/>
|
||||
</gaps>
|
||||
</terrain>
|
||||
<level number="1" goalX="22.606565" startSpeed="0.25" endSpeed="0.7" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<terrainTiles class="java.util.ArrayList">
|
||||
<tileData x="0.5854988" width="7.1709976"/>
|
||||
<tileData x="10.153494" width="10.408993"/>
|
||||
<tileData x="21.640932" width="11.797886"/>
|
||||
</terrainTiles>
|
||||
<ceilingTiles class="java.util.ArrayList"/>
|
||||
<obstacles class="java.util.ArrayList">
|
||||
<obstacleData type="" leftEdge="10.873024" rightEdge="11.427025" height="0.304" y="-0.448" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="14.860029" rightEdge="15.360029" height="0.3" y="-0.45000002" attachedToGround="true"/>
|
||||
@ -19,16 +19,15 @@
|
||||
<starData index="3" x="22.043303" y="-0.20666662" width="0.25" height="0.25"/>
|
||||
</stars>
|
||||
</level>
|
||||
<level number="2" goalX="22.366613">
|
||||
<terrain height="-0.6" endX="25.36662">
|
||||
<gaps class="java.util.ArrayList">
|
||||
<gap leftEdge="4.863002" rightEdge="5.6970024"/>
|
||||
<gap leftEdge="10.581718" rightEdge="11.33174"/>
|
||||
<gap leftEdge="15.4032545" rightEdge="16.05025"/>
|
||||
<gap leftEdge="19.54848" rightEdge="20.111479"/>
|
||||
<gap leftEdge="20.609486" rightEdge="21.050488"/>
|
||||
</gaps>
|
||||
</terrain>
|
||||
<level number="2" goalX="22.366613" startSpeed="0.25" endSpeed="0.7" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<terrainTiles class="java.util.ArrayList">
|
||||
<tileData x="0.9448314" width="7.8896627"/>
|
||||
<tileData x="8.345928" width="4.4445295"/>
|
||||
<tileData x="15.41926" width="8.228134"/>
|
||||
<tileData x="20.374657" width="0.4826603"/>
|
||||
<tileData x="24.32193" width="6.43589"/>
|
||||
</terrainTiles>
|
||||
<ceilingTiles class="java.util.ArrayList"/>
|
||||
<obstacles class="java.util.ArrayList">
|
||||
<obstacleData type="" leftEdge="3.3708305" rightEdge="4.8758307" height="0.2" y="-0.5" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="11.334382" rightEdge="11.912381" height="0.319" y="-0.44050002" attachedToGround="true"/>
|
||||
@ -38,7 +37,8 @@
|
||||
<obstacleData type="" leftEdge="16.873312" rightEdge="17.873312" height="0.367" y="-0.41650003" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="17.884027" rightEdge="18.896029" height="0.327" y="-0.4365" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="19.046677" rightEdge="19.546677" height="0.884" y="-0.15800002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="20.113306" rightEdge="20.613306" height="0.5" y="-0.35000002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="15.948046" rightEdge="16.852045" height="0.5" y="-0.35000002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="20.123379" rightEdge="20.623379" height="0.5" y="-0.35000002" attachedToGround="true"/>
|
||||
</obstacles>
|
||||
<stars class="java.util.ArrayList">
|
||||
<starData index="1" x="10.94335" y="-0.61999965" width="0.25" height="0.25"/>
|
||||
@ -46,14 +46,13 @@
|
||||
<starData index="3" x="18.893328" y="-0.12666662" width="0.25" height="0.25"/>
|
||||
</stars>
|
||||
</level>
|
||||
<level number="3" goalX="19.200012">
|
||||
<terrain height="-0.6" endX="18.900013">
|
||||
<gaps class="java.util.ArrayList">
|
||||
<gap leftEdge="2.3799982" rightEdge="2.9799984"/>
|
||||
<gap leftEdge="4.825835" rightEdge="5.200835"/>
|
||||
<gap leftEdge="7.5069995" rightEdge="8.013"/>
|
||||
</gaps>
|
||||
</terrain>
|
||||
<level number="3" goalX="19.200012" startSpeed="0.25" endSpeed="0.7" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<terrainTiles class="java.util.ArrayList">
|
||||
<tileData x="-0.4151678" width="5.1696644"/>
|
||||
<tileData x="7.1337633" width="8.020197"/>
|
||||
<tileData x="15.293072" width="7.220421"/>
|
||||
</terrainTiles>
|
||||
<ceilingTiles class="java.util.ArrayList"/>
|
||||
<obstacles class="java.util.ArrayList">
|
||||
<obstacleData type="" leftEdge="8.00651" rightEdge="8.67351" height="0.319" y="-0.44050002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="11.703371" rightEdge="12.7233715" height="0.299" y="-0.4505" attachedToGround="true"/>
|
||||
@ -68,34 +67,36 @@
|
||||
<starData index="3" x="12.253348" y="-0.13333318" width="0.25" height="0.25"/>
|
||||
</stars>
|
||||
</level>
|
||||
<level number="4" goalX="23.639889">
|
||||
<terrain height="-0.6" endX="23.639889">
|
||||
<gaps class="java.util.ArrayList">
|
||||
<gap leftEdge="15.903543" rightEdge="17.656546"/>
|
||||
<gap leftEdge="20.776228" rightEdge="22.557226"/>
|
||||
</gaps>
|
||||
</terrain>
|
||||
<level number="4" goalX="23.933224" startSpeed="0.25" endSpeed="0.7" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<terrainTiles class="java.util.ArrayList">
|
||||
<tileData x="6.06402" width="18.12804"/>
|
||||
<tileData x="19.269924" width="3.0757751"/>
|
||||
<tileData x="25.439342" width="4.201065"/>
|
||||
</terrainTiles>
|
||||
<ceilingTiles class="java.util.ArrayList">
|
||||
<tileData x="23.786556" width="0.29333496"/>
|
||||
</ceilingTiles>
|
||||
<obstacles class="java.util.ArrayList">
|
||||
<obstacleData type="" leftEdge="1.948999" rightEdge="2.5509992" height="0.354" y="-0.42300004" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="5.592169" rightEdge="8.321169" height="0.408" y="-0.39600003" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="1.9489989" rightEdge="2.5509992" height="0.354" y="-0.42300004" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="18.512207" rightEdge="21.241207" height="0.408" y="0.50399995" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="8.408872" rightEdge="11.137872" height="0.803" y="-0.19850004" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="11.196732" rightEdge="14.196732" height="0.5" y="0.3966666" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="14.865067" rightEdge="17.775066" height="0.299" y="0.48666632" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="17.871216" rightEdge="18.522217" height="1.415" y="0.10749996" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="18.612877" rightEdge="20.853878" height="0.231" y="0.55999976" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="17.824553" rightEdge="18.475554" height="1.415" y="0.10749996" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="5.79467" rightEdge="8.37867" height="0.544" y="-0.328" attachedToGround="true"/>
|
||||
</obstacles>
|
||||
<stars class="java.util.ArrayList">
|
||||
<starData index="1" x="11.560022" y="-0.26000002" width="0.25" height="0.25"/>
|
||||
<starData index="2" x="16.310017" y="0.80666655" width="0.25" height="0.25"/>
|
||||
<starData index="3" x="21.629972" y="-0.12" width="0.25" height="0.25"/>
|
||||
<starData index="3" x="21.9833" y="-0.099999994" width="0.25" height="0.25"/>
|
||||
</stars>
|
||||
</level>
|
||||
<level number="5" goalX="16.249996">
|
||||
<terrain height="-0.6" endX="18.249996">
|
||||
<gaps class="java.util.ArrayList">
|
||||
<gap leftEdge="6.810508" rightEdge="8.329505"/>
|
||||
</gaps>
|
||||
</terrain>
|
||||
<level number="5" goalX="16.249996" startSpeed="0.25" endSpeed="0.7" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<terrainTiles class="java.util.ArrayList">
|
||||
<tileData x="1.9915047" width="9.983009"/>
|
||||
<tileData x="12.045149" width="7.65627"/>
|
||||
</terrainTiles>
|
||||
<ceilingTiles class="java.util.ArrayList"/>
|
||||
<obstacles class="java.util.ArrayList">
|
||||
<obstacleData type="" leftEdge="2.3669987" rightEdge="2.7929988" height="1.074" y="-0.06300002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="12.000204" rightEdge="13.373203" height="0.946" y="-0.12700003" attachedToGround="true"/>
|
||||
@ -108,28 +109,29 @@
|
||||
<starData index="3" x="11.85002" y="-0.4533334" width="0.25" height="0.25"/>
|
||||
</stars>
|
||||
</level>
|
||||
<level number="6" goalX="27.539873">
|
||||
<terrain height="-0.6" endX="26.939873">
|
||||
<gaps class="java.util.ArrayList">
|
||||
<gap leftEdge="4.026832" rightEdge="5.179832"/>
|
||||
<gap leftEdge="9.292203" rightEdge="10.061208"/>
|
||||
<gap leftEdge="10.566699" rightEdge="11.166699"/>
|
||||
<gap leftEdge="16.414387" rightEdge="16.75238"/>
|
||||
</gaps>
|
||||
</terrain>
|
||||
<level number="6" goalX="27.539873" startSpeed="0.25" endSpeed="0.7" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<terrainTiles class="java.util.ArrayList">
|
||||
<tileData x="0.4867487" width="6.9734974"/>
|
||||
<tileData x="7.8615937" width="5.390193"/>
|
||||
<tileData x="13.799343" width="5.285305"/>
|
||||
<tileData x="21.770779" width="9.7455635"/>
|
||||
</terrainTiles>
|
||||
<ceilingTiles class="java.util.ArrayList"/>
|
||||
<obstacles class="java.util.ArrayList">
|
||||
<obstacleData type="" leftEdge="1.1131666" rightEdge="1.5001667" height="0.941" y="-0.12950003" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="1.6498328" rightEdge="1.7768329" height="0.902" y="-0.14900002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="1.9103338" rightEdge="2.1163337" height="0.838" y="-0.18100002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="1.9103339" rightEdge="2.1163337" height="0.838" y="-0.18100002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="2.224499" rightEdge="2.415499" height="0.735" y="-0.23250002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="2.500666" rightEdge="2.6726658" height="0.613" y="-0.29350004" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="2.731666" rightEdge="3.961666" height="0.5" y="-0.35000002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="2.7449994" rightEdge="3.9749994" height="0.5" y="-0.35000002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="5.1713314" rightEdge="5.955332" height="0.186" y="-0.507" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="10.060041" rightEdge="10.560041" height="0.843" y="-0.17850003" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="20.506636" rightEdge="20.806635" height="0.558" y="-0.321" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="20.5105" rightEdge="20.8095" height="0.286" y="0.9333331" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="14.943075" rightEdge="16.437075" height="0.231" y="-0.48450002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="25.285612" rightEdge="26.707613" height="0.599" y="-0.30050004" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="25.300407" rightEdge="26.619408" height="0.612" y="-0.29400003" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="23.873228" rightEdge="24.373228" height="0.5" y="-0.35000002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="24.34991" rightEdge="24.84991" height="0.5" y="-0.35000002" attachedToGround="true"/>
|
||||
</obstacles>
|
||||
<stars class="java.util.ArrayList">
|
||||
<starData index="1" x="4.586666" y="-0.5866665" width="0.25" height="0.25"/>
|
||||
@ -137,59 +139,61 @@
|
||||
<starData index="3" x="20.64665" y="0.39999995" width="0.25" height="0.25"/>
|
||||
</stars>
|
||||
</level>
|
||||
<level number="7" goalX="25.473257">
|
||||
<terrain height="-0.6" endX="28.473238">
|
||||
<gaps class="java.util.ArrayList">
|
||||
<gap leftEdge="7.3475013" rightEdge="9.372511"/>
|
||||
<gap leftEdge="9.8666935" rightEdge="10.466708"/>
|
||||
<gap leftEdge="15.304541" rightEdge="16.335531"/>
|
||||
<gap leftEdge="19.761318" rightEdge="20.305317"/>
|
||||
<gap leftEdge="24.703619" rightEdge="25.36962"/>
|
||||
</gaps>
|
||||
</terrain>
|
||||
<level number="7" goalX="25.866587" startSpeed="0.25" endSpeed="0.7" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<terrainTiles class="java.util.ArrayList">
|
||||
<tileData x="2.1916704" width="10.383341"/>
|
||||
<tileData x="11.639271" width="7.31187"/>
|
||||
<tileData x="17.96075" width="3.4850826"/>
|
||||
<tileData x="22.583197" width="4.5598145"/>
|
||||
</terrainTiles>
|
||||
<ceilingTiles class="java.util.ArrayList">
|
||||
<tileData x="25.669922" width="0.39332962"/>
|
||||
</ceilingTiles>
|
||||
<obstacles class="java.util.ArrayList">
|
||||
<obstacleData type="" leftEdge="2.9593315" rightEdge="3.9473314" height="0.313" y="-0.01333334" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="3.987667" rightEdge="5.565667" height="0.272" y="-0.046666723" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="8.7657" rightEdge="10.8077" height="0.095" y="-0.5525" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="10.1723585" rightEdge="12.214358" height="0.095" y="0.027500032" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="5.595845" rightEdge="6.950845" height="0.19" y="-0.073333286" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="15.055702" rightEdge="16.537703" height="0.218" y="-0.49100003" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="8.669004" rightEdge="10.151005" height="0.218" y="0.0023332927" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="6.992841" rightEdge="7.353841" height="0.558" y="-0.321" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="19.35432" rightEdge="19.75232" height="0.762" y="-0.21900001" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="19.32099" rightEdge="19.718988" height="0.762" y="-0.21900001" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="19.963318" rightEdge="20.463318" height="0.5" y="0.7533332" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="20.287636" rightEdge="21.245636" height="0.435" y="-0.38250002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="20.503141" rightEdge="21.190142" height="0.5" y="0.42999995" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="12.539991" rightEdge="13.659992" height="0.395" y="0.124166645" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="11.773358" rightEdge="12.273358" height="0.884" y="0.5499999" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="20.503757" rightEdge="21.642757" height="0.327" y="0.3799999" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="24.1271" rightEdge="24.886099" height="0.694" y="-0.25300002" attachedToGround="true"/>
|
||||
</obstacles>
|
||||
<stars class="java.util.ArrayList">
|
||||
<starData index="1" x="6.6800065" y="-0.38666666" width="0.25" height="0.25"/>
|
||||
<starData index="2" x="15.820039" y="-0.7866664" width="0.25" height="0.25"/>
|
||||
<starData index="2" x="13.066695" y="0.48666692" width="0.25" height="0.25"/>
|
||||
<starData index="3" x="20.679989" y="0.85333335" width="0.25" height="0.25"/>
|
||||
</stars>
|
||||
</level>
|
||||
<level number="8" goalX="20.523335">
|
||||
<terrain height="-0.6" endX="23.523335">
|
||||
<gaps class="java.util.ArrayList">
|
||||
<gap leftEdge="-1.3473341" rightEdge="2.240666"/>
|
||||
<gap leftEdge="3.05333" rightEdge="7.05333"/>
|
||||
<gap leftEdge="11.257536" rightEdge="14.282536"/>
|
||||
<gap leftEdge="15.696874" rightEdge="16.10987"/>
|
||||
</gaps>
|
||||
</terrain>
|
||||
<level number="8" goalX="17.896662" startSpeed="0.25" endSpeed="0.7" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<terrainTiles class="java.util.ArrayList">
|
||||
<tileData x="-2.0766673" width="1.8466654"/>
|
||||
<tileData x="2.5266657" width="0.7200012"/>
|
||||
<tileData x="9.478603" width="3.1838756"/>
|
||||
<tileData x="16.133102" width="3.5271206"/>
|
||||
</terrainTiles>
|
||||
<ceilingTiles class="java.util.ArrayList"/>
|
||||
<obstacles class="java.util.ArrayList">
|
||||
<obstacleData type="" leftEdge="-0.9233334" rightEdge="2.0766666" height="0.136" y="-0.90666574" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="4.979664" rightEdge="5.9736643" height="0.286" y="-0.89333284" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="3.057998" rightEdge="3.9619977" height="0.299" y="-0.81333286" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="3.9729972" rightEdge="4.9669976" height="0.286" y="-0.8533326" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="5.997839" rightEdge="6.8288393" height="0.231" y="-0.9199996" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="11.854198" rightEdge="13.119198" height="1.02" y="0.023333304" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="13.141195" rightEdge="13.792196" height="0.639" y="0.18666656" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="13.15453" rightEdge="13.805531" height="0.639" y="0.13999994" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="14.541548" rightEdge="15.698547" height="0.422" y="-0.38900003" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="20.074863" rightEdge="20.851864" height="1.02" y="-0.09000003" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="11.280017" rightEdge="14.280017" height="0.218" y="-1.1066662" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="11.286684" rightEdge="14.286684" height="0.218" y="-1.1266662" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="6.876839" rightEdge="7.689839" height="0.286" y="-1.0" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="-1.0233328" rightEdge="1.9766672" height="0.136" y="-0.86666656" attachedToGround="false"/>
|
||||
</obstacles>
|
||||
<stars class="java.util.ArrayList">
|
||||
<starData index="1" x="2.6366663" y="0.44666678" width="0.25" height="0.25"/>
|
||||
<starData index="1" x="2.543333" y="0.3933335" width="0.25" height="0.25"/>
|
||||
<starData index="2" x="14.12338" y="-0.79999965" width="0.25" height="0.25"/>
|
||||
<starData index="3" x="20.230003" y="0.5599996" width="0.25" height="0.25"/>
|
||||
<starData index="3" x="17.523336" y="0.4799996" width="0.25" height="0.25"/>
|
||||
</stars>
|
||||
</level>
|
||||
</levels>
|
||||
|
@ -1,27 +1,27 @@
|
||||
<levelPack name="Testcave" id="0" terrainHeight="0.306" ceilingHeight="0.538">
|
||||
<levelPack name="Testcave" id="0">
|
||||
<levels class="java.util.ArrayList">
|
||||
<level number="1" goalX="32.129963" startSpeed="0.25" endSpeed="0.7">
|
||||
<terrainTiles class="entities.tileLists.Terrain">
|
||||
<tile x="-1.6499999" width="2.7000003"/>
|
||||
<tile x="0.6273333" width="0.6546662"/>
|
||||
<tile x="5.837672" width="5.558014"/>
|
||||
<level number="1" goalX="32.129963" startSpeed="0.25" endSpeed="0.7" terrainEdge="0.305" ceilingEdge="0.538">
|
||||
<terrainTiles class="java.util.ArrayList">
|
||||
<tileData x="-2.5737498" width="0.85250044"/>
|
||||
<tileData x="0.14783376" width="0.40066564"/>
|
||||
<tileData x="1.9032495" width="0.47616577"/>
|
||||
<tileData x="6.2710066" width="4.691348"/>
|
||||
</terrainTiles>
|
||||
<ceilingTiles class="entities.tileLists.Ceiling">
|
||||
<tile x="-0.41333365" width="5.1733327"/>
|
||||
<tile x="7.895005" width="1.4433479"/>
|
||||
<ceilingTiles class="java.util.ArrayList">
|
||||
<tileData x="0.37516427" width="6.7503285"/>
|
||||
<tileData x="7.106504" width="3.0203505"/>
|
||||
</ceilingTiles>
|
||||
<obstacles class="java.util.ArrayList">
|
||||
<obstacleData type="" leftEdge="9.0" rightEdge="10.0" height="0.3" y="-0.45000002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="13.0" rightEdge="14.0" height="0.2" y="-0.5" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="19.52634" rightEdge="20.580341" height="0.3" y="-0.45000002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="20.580004" rightEdge="21.580004" height="0.5" y="-0.35000002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="21.580002" rightEdge="22.580002" height="0.1" y="-0.55" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="1.6033329" rightEdge="2.103333" height="0.5" y="-0.18399999" attachedToGround="true"/>
|
||||
<obstacleData type="default" leftEdge="-0.25" rightEdge="0.25" height="0.5" y="0.0" attachedToGround="false"/>
|
||||
<obstacleData type="default" leftEdge="-0.25" rightEdge="0.25" height="0.5" y="0.0" attachedToGround="false"/>
|
||||
<obstacleData type="default" leftEdge="-0.25" rightEdge="0.25" height="0.5" y="0.0" attachedToGround="true"/>
|
||||
<obstacleData type="default" leftEdge="-0.25" rightEdge="0.25" height="0.5" y="0.0" attachedToGround="false"/>
|
||||
<obstacleData type="default" leftEdge="-0.25" rightEdge="0.25" height="0.5" y="0.0" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="9.0" rightEdge="10.0" height="0.3" y="0.455" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="13.0" rightEdge="14.0" height="0.2" y="0.405" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="19.52634" rightEdge="20.580341" height="0.3" y="0.455" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="20.580004" rightEdge="21.580004" height="0.5" y="0.555" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="21.580002" rightEdge="22.580002" height="0.1" y="0.35500002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="-0.25" rightEdge="0.25" height="0.5" y="0.0" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="-0.25" rightEdge="0.25" height="0.5" y="0.0" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="-0.32999998" rightEdge="0.17000002" height="0.5" y="0.48000002" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="0.5966666" rightEdge="1.0966666" height="0.5" y="0.50666666" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="3.2433324" rightEdge="3.7433324" height="0.5" y="0.45999995" attachedToGround="false"/>
|
||||
</obstacles>
|
||||
<stars class="java.util.ArrayList">
|
||||
<starData index="1" x="10.163283" y="-0.05999978" width="0.25" height="0.25"/>
|
||||
@ -29,14 +29,14 @@
|
||||
<starData index="3" x="21.73662" y="0.05333341" width="0.25" height="0.25"/>
|
||||
</stars>
|
||||
</level>
|
||||
<level number="3" goalX="8.616679" startSpeed="0.19" endSpeed="0.44">
|
||||
<terrainTiles class="entities.tileLists.Terrain">
|
||||
<tile x="-1.0226668" width="3.9546664"/>
|
||||
<tile x="5.837672" width="5.5580134"/>
|
||||
<level number="3" goalX="8.616679" startSpeed="0.19" endSpeed="0.44" terrainEdge="-0.861" ceilingEdge="-0.637">
|
||||
<terrainTiles class="java.util.ArrayList">
|
||||
<tileData x="-0.19666648" width="5.606667"/>
|
||||
</terrainTiles>
|
||||
<ceilingTiles class="entities.tileLists.Ceiling">
|
||||
<tile x="-0.43666697" width="5.126666"/>
|
||||
<tile x="7.8716717" width="1.4900146"/>
|
||||
<ceilingTiles class="java.util.ArrayList">
|
||||
<tileData x="-2.2467475" width="1.5065048"/>
|
||||
<tileData x="1.1300858" width="0.893161"/>
|
||||
<tileData x="5.396673" width="6.440013"/>
|
||||
</ceilingTiles>
|
||||
<obstacles class="java.util.ArrayList">
|
||||
<obstacleData type="" leftEdge="1.3278332" rightEdge="3.098833" height="0.5" y="-0.2733331" attachedToGround="false"/>
|
||||
@ -46,5 +46,48 @@
|
||||
<starData index="1" x="6.0466657" y="0.83333325" width="0.25" height="0.25"/>
|
||||
</stars>
|
||||
</level>
|
||||
<level number="4" goalX="3.0" startSpeed="0.1" endSpeed="0.5" terrainEdge="-0.583" ceilingEdge="0.582">
|
||||
<terrainTiles class="java.util.ArrayList">
|
||||
<tileData x="0.0" width="6.0"/>
|
||||
</terrainTiles>
|
||||
<ceilingTiles class="java.util.ArrayList">
|
||||
<tileData x="0.0" width="6.0"/>
|
||||
</ceilingTiles>
|
||||
<obstacles class="java.util.ArrayList"/>
|
||||
<stars class="java.util.ArrayList"/>
|
||||
</level>
|
||||
<level number="5" goalX="2.606667" startSpeed="0.1" endSpeed="0.5" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<terrainTiles class="java.util.ArrayList">
|
||||
<tileData x="-0.19666648" width="5.606667"/>
|
||||
</terrainTiles>
|
||||
<ceilingTiles class="java.util.ArrayList">
|
||||
<tileData x="-0.19666648" width="5.606667"/>
|
||||
</ceilingTiles>
|
||||
<obstacles class="java.util.ArrayList"/>
|
||||
<stars class="java.util.ArrayList"/>
|
||||
</level>
|
||||
<level number="6" goalX="6.053331" startSpeed="0.1" endSpeed="0.5" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<terrainTiles class="java.util.ArrayList">
|
||||
<tileData x="0.89166594" width="7.783332"/>
|
||||
<tileData x="5.668331" width="0.769999"/>
|
||||
</terrainTiles>
|
||||
<ceilingTiles class="java.util.ArrayList">
|
||||
<tileData x="-0.03000021" width="5.9399996"/>
|
||||
<tileData x="4.4966655" width="3.113331"/>
|
||||
</ceilingTiles>
|
||||
<obstacles class="java.util.ArrayList"/>
|
||||
<stars class="java.util.ArrayList"/>
|
||||
</level>
|
||||
<level number="7" goalX="6.633333" startSpeed="0.1" endSpeed="0.5" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<terrainTiles class="java.util.ArrayList">
|
||||
<tileData x="0.8699992" width="7.7399983"/>
|
||||
<tileData x="5.9866657" width="1.2933354"/>
|
||||
</terrainTiles>
|
||||
<ceilingTiles class="java.util.ArrayList">
|
||||
<tileData x="1.8166666" width="9.633333"/>
|
||||
</ceilingTiles>
|
||||
<obstacles class="java.util.ArrayList"/>
|
||||
<stars class="java.util.ArrayList"/>
|
||||
</level>
|
||||
</levels>
|
||||
</levelPack>
|
@ -1,106 +0,0 @@
|
||||
<levelPack name="First Pack">
|
||||
<levels class="java.util.ArrayList">
|
||||
<level number="1" goalX="22.259893">
|
||||
<terrain height="-0.6" endX="23.259893">
|
||||
<gaps class="java.util.ArrayList">
|
||||
<gap leftEdge="5.3500023" rightEdge="5.950004"/>
|
||||
<gap leftEdge="15.353701" rightEdge="15.7197"/>
|
||||
</gaps>
|
||||
</terrain>
|
||||
<obstacles class="java.util.ArrayList">
|
||||
<obstacleData type="" leftEdge="10.873024" rightEdge="11.427025" height="0.304" y="-0.448" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="14.860029" rightEdge="15.360029" height="0.3" y="-0.45000002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="19.383318" rightEdge="21.383318" height="0.25" y="-0.47500002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="21.586645" rightEdge="22.086645" height="0.5" y="-0.35000002" attachedToGround="true"/>
|
||||
</obstacles>
|
||||
<stars class="java.util.ArrayList">
|
||||
<starData x="11.150023" y="-0.1200001" width="0.25" height="0.25"/>
|
||||
<starData x="15.120053" y="-0.12666668" width="0.25" height="0.25"/>
|
||||
<starData x="21.42998" y="-0.20666662" width="0.25" height="0.25"/>
|
||||
</stars>
|
||||
</level>
|
||||
<level number="2" goalX="16.220043">
|
||||
<terrain height="-0.6" endX="19.220049">
|
||||
<gaps class="java.util.ArrayList">
|
||||
<gap leftEdge="4.8896685" rightEdge="5.723669"/>
|
||||
<gap leftEdge="10.581718" rightEdge="11.33174"/>
|
||||
<gap leftEdge="15.4032545" rightEdge="16.05025"/>
|
||||
</gaps>
|
||||
</terrain>
|
||||
<obstacles class="java.util.ArrayList">
|
||||
<obstacleData type="" leftEdge="3.3708305" rightEdge="4.8758307" height="0.2" y="-0.5" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="11.334382" rightEdge="11.912381" height="0.319" y="-0.44050002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="2.4509985" rightEdge="3.3089983" height="0.275" y="-0.46250004" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="1.6111658" rightEdge="2.3221657" height="0.338" y="-0.43100002" attachedToGround="true"/>
|
||||
</obstacles>
|
||||
<stars class="java.util.ArrayList">
|
||||
<starData x="5.310005" y="-0.61333305" width="0.25" height="0.25"/>
|
||||
<starData x="10.976699" y="-0.6333332" width="0.25" height="0.25"/>
|
||||
<starData x="15.743367" y="0.31333324" width="0.25" height="0.25"/>
|
||||
</stars>
|
||||
</level>
|
||||
<level number="3" goalX="19.146683">
|
||||
<terrain height="-0.6" endX="18.846684">
|
||||
<gaps class="java.util.ArrayList">
|
||||
<gap leftEdge="2.3799982" rightEdge="2.9799984"/>
|
||||
<gap leftEdge="4.825835" rightEdge="5.200835"/>
|
||||
<gap leftEdge="7.5069995" rightEdge="8.013"/>
|
||||
</gaps>
|
||||
</terrain>
|
||||
<obstacles class="java.util.ArrayList">
|
||||
<obstacleData type="" leftEdge="8.00651" rightEdge="8.67351" height="0.319" y="-0.44050002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="11.703371" rightEdge="12.7233715" height="0.299" y="-0.4505" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="15.164396" rightEdge="15.762396" height="0.466" y="-0.36700004" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="15.818368" rightEdge="16.828367" height="0.402" y="-0.39900002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="16.858376" rightEdge="18.108376" height="0.353" y="-0.42350003" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="18.216705" rightEdge="18.716705" height="0.789" y="-0.20550004" attachedToGround="true"/>
|
||||
</obstacles>
|
||||
<stars class="java.util.ArrayList">
|
||||
<starData x="2.6933327" y="0.1266667" width="0.25" height="0.25"/>
|
||||
<starData x="8.853351" y="-0.4533331" width="0.25" height="0.25"/>
|
||||
<starData x="12.253348" y="-0.13333318" width="0.25" height="0.25"/>
|
||||
</stars>
|
||||
</level>
|
||||
<level number="4" goalX="17.23667">
|
||||
<terrain height="-0.6" endX="19.23667">
|
||||
<gaps class="java.util.ArrayList">
|
||||
<gap leftEdge="6.810508" rightEdge="8.329505"/>
|
||||
</gaps>
|
||||
</terrain>
|
||||
<obstacles class="java.util.ArrayList">
|
||||
<obstacleData type="" leftEdge="2.3669987" rightEdge="2.7929988" height="1.074" y="-0.06300002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="11.929536" rightEdge="13.150537" height="0.946" y="-0.12700003" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="13.377707" rightEdge="14.495707" height="0.725" y="-0.23750001" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="14.676702" rightEdge="15.176702" height="1.539" y="0.1695" attachedToGround="true"/>
|
||||
</obstacles>
|
||||
<stars class="java.util.ArrayList">
|
||||
<starData x="2.573332" y="0.62" width="0.25" height="0.25"/>
|
||||
<starData x="7.5566673" y="0.26000008" width="0.25" height="0.25"/>
|
||||
<starData x="11.710016" y="-0.42666656" width="0.25" height="0.25"/>
|
||||
</stars>
|
||||
</level>
|
||||
<level number="5" goalX="10.1833515">
|
||||
<terrain height="-0.6" endX="9.483352">
|
||||
<gaps class="java.util.ArrayList">
|
||||
<gap leftEdge="4.026832" rightEdge="5.179832"/>
|
||||
<gap leftEdge="8.085517" rightEdge="8.854522"/>
|
||||
</gaps>
|
||||
</terrain>
|
||||
<obstacles class="java.util.ArrayList">
|
||||
<obstacleData type="" leftEdge="1.1131666" rightEdge="1.5001667" height="0.941" y="-0.12950003" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="1.6498328" rightEdge="1.7768329" height="0.902" y="-0.14900002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="1.9103338" rightEdge="2.1163337" height="0.838" y="-0.18100002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="2.224499" rightEdge="2.415499" height="0.735" y="-0.23250002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="2.500666" rightEdge="2.6726658" height="0.613" y="-0.29350004" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="2.731666" rightEdge="3.961666" height="0.5" y="-0.35000002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="5.1713314" rightEdge="5.955332" height="0.186" y="-0.507" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="8.860007" rightEdge="9.360007" height="0.843" y="-0.17850003" attachedToGround="true"/>
|
||||
</obstacles>
|
||||
<stars class="java.util.ArrayList">
|
||||
<starData x="4.5599995" y="-0.54666656" width="0.25" height="0.25"/>
|
||||
<starData x="6.203336" y="0.36666653" width="0.25" height="0.25"/>
|
||||
<starData x="9.543362" y="-0.43333334" width="0.25" height="0.25"/>
|
||||
</stars>
|
||||
</level>
|
||||
</levels>
|
||||
</levelPack>
|
@ -1,84 +0,0 @@
|
||||
<levelPack name="Test Pack">
|
||||
<levels class="java.util.ArrayList">
|
||||
<level number="1" goalX="24.0">
|
||||
<terrain height="-0.6" endX="27.0">
|
||||
<gaps class="java.util.ArrayList">
|
||||
<gap leftEdge="4.0" rightEdge="5.0"/>
|
||||
<gap leftEdge="12.0" rightEdge="13.0"/>
|
||||
<gap leftEdge="16.0" rightEdge="16.5"/>
|
||||
<gap leftEdge="16.8" rightEdge="17.3"/>
|
||||
</gaps>
|
||||
</terrain>
|
||||
<obstacles class="java.util.ArrayList">
|
||||
<obstacleData type="" leftEdge="9.0" rightEdge="10.0" height="0.3" y="-0.45000002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="13.0" rightEdge="14.0" height="0.2" y="-0.5" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="19.52634" rightEdge="20.580341" height="0.3" y="-0.45000002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="20.580004" rightEdge="21.580004" height="0.5" y="-0.35000002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="21.580002" rightEdge="22.580002" height="0.1" y="-0.55" attachedToGround="true"/>
|
||||
</obstacles>
|
||||
<stars class="java.util.ArrayList"/>
|
||||
</level>
|
||||
<level number="2" goalX="21.25">
|
||||
<terrain height="-0.6" endX="21.0">
|
||||
<gaps class="java.util.ArrayList">
|
||||
<gap leftEdge="1.0" rightEdge="1.7"/>
|
||||
<gap leftEdge="8.9" rightEdge="9.6"/>
|
||||
<gap leftEdge="9.7" rightEdge="10.4"/>
|
||||
<gap leftEdge="15.0" rightEdge="16.1"/>
|
||||
</gaps>
|
||||
</terrain>
|
||||
<obstacles class="java.util.ArrayList">
|
||||
<obstacleData type="" leftEdge="0.42333412" rightEdge="0.99333405" height="0.3" y="-0.45000002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="2.9" rightEdge="3.6" height="0.5" y="-0.35000002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="5.0" rightEdge="7.0" height="0.3" y="-0.45000002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="7.1000004" rightEdge="8.5" height="0.52" y="-0.34000003" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="11.4" rightEdge="12.800001" height="0.5" y="-0.35000002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="13.9" rightEdge="14.199999" height="0.5" y="-0.35000002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="16.8" rightEdge="18.3" height="0.24" y="-0.48000002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="18.30001" rightEdge="18.8" height="0.35" y="-0.425" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="18.80001" rightEdge="19.400002" height="0.54" y="-0.33" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="19.40001" rightEdge="20.5" height="0.41" y="-0.39500004" attachedToGround="true"/>
|
||||
</obstacles>
|
||||
<stars class="java.util.ArrayList">
|
||||
<starData x="0.19333333" y="-0.02" width="0.25" height="0.25"/>
|
||||
</stars>
|
||||
</level>
|
||||
<level number="3" goalX="10.013344">
|
||||
<terrain height="-0.6" endX="13.013344">
|
||||
<gaps class="java.util.ArrayList">
|
||||
<gap leftEdge="0.99333334" rightEdge="1.5933334"/>
|
||||
<gap leftEdge="2.3266642" rightEdge="5.326664"/>
|
||||
<gap leftEdge="5.376665" rightEdge="8.376666"/>
|
||||
</gaps>
|
||||
</terrain>
|
||||
<obstacles class="java.util.ArrayList">
|
||||
<obstacleData type="" leftEdge="1.0611664" rightEdge="1.5121664" height="0.431" y="-0.12666668" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="2.615834" rightEdge="3.590834" height="0.181" y="-0.37333322" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="3.5901666" rightEdge="4.2031665" height="0.27" y="-0.21999994" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="4.1894994" rightEdge="4.910499" height="0.294" y="0.0" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="5.1586647" rightEdge="6.5946646" height="0.279" y="-0.24049996" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="5.76284" rightEdge="5.9838395" height="0.76" y="0.5999998" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="6.808838" rightEdge="8.097838" height="0.211" y="-0.33999994" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="8.2516775" rightEdge="8.761678" height="0.877" y="-0.16150004" attachedToGround="true"/>
|
||||
</obstacles>
|
||||
<stars class="java.util.ArrayList"/>
|
||||
</level>
|
||||
<level number="4" goalX="14.916662">
|
||||
<terrain height="-0.6" endX="17.916662">
|
||||
<gaps class="java.util.ArrayList">
|
||||
<gap leftEdge="12.363373" rightEdge="12.963373"/>
|
||||
</gaps>
|
||||
</terrain>
|
||||
<obstacles class="java.util.ArrayList">
|
||||
<obstacleData type="" leftEdge="2.5548315" rightEdge="3.9518313" height="0.201" y="-0.09283342" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="0.84966636" rightEdge="1.1636665" height="0.27" y="-0.46500003" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="4.0266647" rightEdge="4.5266647" height="0.5" y="-0.35000002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="5.05683" rightEdge="6.16983" height="0.25" y="-0.09333334" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="6.2320023" rightEdge="6.948002" height="0.5" y="-0.35000002" attachedToGround="true"/>
|
||||
<obstacleData type="" leftEdge="7.572172" rightEdge="8.621172" height="0.284" y="-0.08666665" attachedToGround="false"/>
|
||||
<obstacleData type="" leftEdge="8.682344" rightEdge="9.084345" height="1.142" y="0.40666664" attachedToGround="false"/>
|
||||
</obstacles>
|
||||
<stars class="java.util.ArrayList"/>
|
||||
</level>
|
||||
</levels>
|
||||
</levelPack>
|
@ -1,12 +0,0 @@
|
||||
<levelPack name="test" id="1" terrainHeight="0.0" ceilingHeight="0.0">
|
||||
<levels class="java.util.ArrayList">
|
||||
<level number="2" goalX="3.0">
|
||||
<terrainTiles class="java.util.ArrayList">
|
||||
<tile x="0.0" width="6.0"/>
|
||||
</terrainTiles>
|
||||
<ceilingTiles class="java.util.ArrayList"/>
|
||||
<obstacles class="java.util.ArrayList"/>
|
||||
<stars class="java.util.ArrayList"/>
|
||||
</level>
|
||||
</levels>
|
||||
</levelPack>
|
@ -30,8 +30,8 @@ public class Entity extends Quad {
|
||||
rotation += factor;
|
||||
}
|
||||
|
||||
public void setToTerrain(float terrainHeight) {
|
||||
position.y = terrainHeight + height / 2;
|
||||
public void setToTerrain(float terrainEdge) {
|
||||
position.y = terrainEdge + height / 2;
|
||||
}
|
||||
|
||||
public Texture getTexture() {
|
||||
|
@ -9,10 +9,10 @@ import com.example.julian.endlessroll.levels.ObstacleData;
|
||||
*/
|
||||
public class Obstacle extends Entity {
|
||||
|
||||
public Obstacle(Texture texture, ObstacleData data, float terrainHeight) {
|
||||
public Obstacle(Texture texture, ObstacleData data, float terrainEdge) {
|
||||
super(texture, new Vector(data.getX(), data.getY()), data.getWidth(), data.getHeight());
|
||||
if (data.isAttachedToGround())
|
||||
super.setToTerrain(terrainHeight);
|
||||
super.setToTerrain(terrainEdge);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,10 @@
|
||||
package com.example.julian.endlessroll.entities;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.example.julian.endlessroll.data.Vector;
|
||||
import com.example.julian.endlessroll.entities.textures.Texture;
|
||||
import com.example.julian.endlessroll.main.GameLog;
|
||||
|
||||
/**
|
||||
* Created by Julian on 20.11.2015.
|
||||
@ -11,7 +14,10 @@ public class Player extends Entity {
|
||||
private final float ROTATION_SPEED = -400;
|
||||
public final float RADIUS = 0.1f;
|
||||
private final float START_X = -0.9f;
|
||||
private float speed = 0.001f;
|
||||
private final float SPEED = 0.002f;
|
||||
|
||||
private float startSpeed, endSpeed;
|
||||
private float speed = SPEED;
|
||||
|
||||
public Player(Texture texture) {
|
||||
super(texture, new Vector(), 0, 0);
|
||||
@ -19,20 +25,29 @@ public class Player extends Entity {
|
||||
super.setHeight(RADIUS * 2);
|
||||
}
|
||||
|
||||
public void init(float terrainHeight) {
|
||||
super.setToTerrain(terrainHeight);
|
||||
public void init(float terrainEdge, float startSpeed, float endSpeed) {
|
||||
super.setToTerrain(terrainEdge);
|
||||
super.getPosition().x = START_X;
|
||||
super.setMovement(new Vector(speed, 0));
|
||||
this.startSpeed = startSpeed;
|
||||
this.endSpeed = endSpeed;
|
||||
setSpeedByProgress(0);
|
||||
}
|
||||
|
||||
public void setSpeed(float speed) {
|
||||
this.speed = speed;
|
||||
public void setSpeedByProgress(float progress) {
|
||||
this.speed = ((endSpeed - startSpeed) * progress + startSpeed) * SPEED;
|
||||
super.getMovement().x = speed;
|
||||
GameLog.i("Speed: "+ speed);
|
||||
}
|
||||
|
||||
public float getProgress() {
|
||||
return getPosition().x - START_X;
|
||||
}
|
||||
|
||||
public float getSpeed() {
|
||||
return speed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void move(Vector movement) {
|
||||
super.move(movement);
|
||||
|
@ -1,78 +0,0 @@
|
||||
package com.example.julian.endlessroll.entities;
|
||||
|
||||
import com.example.julian.endlessroll.data.Vector;
|
||||
import com.example.julian.endlessroll.entities.textures.Texture;
|
||||
import com.example.julian.endlessroll.levels.Gap;
|
||||
import com.example.julian.endlessroll.levels.TerrainData;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Julian on 08.12.2015.
|
||||
*/
|
||||
public class Terrain extends ArrayList<TerrainTile> {
|
||||
|
||||
private Texture texture;
|
||||
private float height;
|
||||
private boolean endless;
|
||||
|
||||
public Terrain(Texture texture) {
|
||||
this.texture = texture;
|
||||
}
|
||||
|
||||
private void create(float endX, float height, List<Gap> gaps) {
|
||||
this.height = height;
|
||||
float y = calculateYPositionFromHeight();
|
||||
float h = 1 + height;
|
||||
float lastGapRightEdge = -3;
|
||||
for (int i = 0; i < gaps.size() + 1; i++) {
|
||||
float nextGapLeftEdge;
|
||||
if (i == gaps.size())
|
||||
nextGapLeftEdge = endX;
|
||||
else
|
||||
nextGapLeftEdge = gaps.get(i).getLeftEdge();
|
||||
float width = nextGapLeftEdge - lastGapRightEdge;
|
||||
float x = lastGapRightEdge + width / 2;
|
||||
TerrainTile entity = new TerrainTile(texture, new Vector(x, y), width, h);
|
||||
super.add(entity);
|
||||
if (i != gaps.size())
|
||||
lastGapRightEdge = gaps.get(i).getRightEdge();
|
||||
}
|
||||
}
|
||||
|
||||
public void loadData(TerrainData data) {
|
||||
super.clear();
|
||||
this.endless = false;
|
||||
create(data.getEndX(), data.getHeight(), data.getGaps());
|
||||
}
|
||||
|
||||
public void createEndless(float height) {
|
||||
super.clear();
|
||||
this.endless = true;
|
||||
this.height = height;
|
||||
super.add(new TerrainTile(texture, new Vector(0, calculateYPositionFromHeight()), 5, 1 + height));
|
||||
}
|
||||
|
||||
public void update(float cameraX) {
|
||||
if (!super.isEmpty()) {
|
||||
if (super.get(0).getRightEdge() - cameraX < -3) {
|
||||
super.remove(0);
|
||||
}
|
||||
if (endless) {
|
||||
Entity last = super.get(super.size() - 1);
|
||||
if (last.getRightEdge() - cameraX < 3)
|
||||
super.add(new TerrainTile(texture, new Vector(last.getRightEdge() + 2.5f, calculateYPositionFromHeight()), 5, 1 + height));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private float calculateYPositionFromHeight() {
|
||||
return height - (1 + height) / 2;
|
||||
}
|
||||
|
||||
public float getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
package com.example.julian.endlessroll.entities;
|
||||
|
||||
import com.example.julian.endlessroll.data.Vector;
|
||||
import com.example.julian.endlessroll.entities.textures.Texture;
|
||||
|
||||
/**
|
||||
* Created by Julian on 18.12.2015.
|
||||
*/
|
||||
|
||||
public class TerrainTile extends Entity {
|
||||
|
||||
public TerrainTile(Texture texture, Vector position, float width, float height) {
|
||||
super(texture, position, width, height);
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.example.julian.endlessroll.entities.tileLists;
|
||||
|
||||
import com.example.julian.endlessroll.entities.textures.TexturePack;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class Ceiling extends TileList {
|
||||
|
||||
public Ceiling(TexturePack textures) {
|
||||
super(Type.CEILING, textures.terrain);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.example.julian.endlessroll.entities.tileLists;
|
||||
|
||||
import com.example.julian.endlessroll.entities.textures.TexturePack;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class Terrain extends TileList {
|
||||
|
||||
public Terrain(TexturePack textures) {
|
||||
super(TileList.Type.TERRAIN, textures.terrain);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.example.julian.endlessroll.entities.tileLists;
|
||||
|
||||
import com.example.julian.endlessroll.data.Vector;
|
||||
import com.example.julian.endlessroll.entities.Entity;
|
||||
import com.example.julian.endlessroll.entities.textures.Texture;
|
||||
import com.example.julian.endlessroll.levels.TileData;
|
||||
|
||||
/**
|
||||
* Created by Julian on 18.12.2015.
|
||||
*/
|
||||
|
||||
public class Tile extends Entity {
|
||||
|
||||
public Tile(TileList.Type type, Texture texture, float edge, TileData data) {
|
||||
this(type, texture, edge, data.getX(), data.getWidth());
|
||||
}
|
||||
|
||||
public Tile(TileList.Type type, Texture texture, float edge, float x, float width) {
|
||||
super(texture, new Vector(), width, 0);
|
||||
super.height = type.calculateTileHeightFromEdge(edge);
|
||||
super.position.x = x;
|
||||
switch (type) {
|
||||
case TERRAIN:
|
||||
super.position.y = edge - super.height / 2;
|
||||
break;
|
||||
case CEILING:
|
||||
super.position.y = edge + super.height / 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
package com.example.julian.endlessroll.entities.tileLists;
|
||||
|
||||
import com.example.julian.endlessroll.entities.textures.Texture;
|
||||
import com.example.julian.endlessroll.levels.TileData;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class TileList extends ArrayList<Tile> {
|
||||
|
||||
public enum Type {
|
||||
TERRAIN, CEILING;
|
||||
|
||||
public float calculateTileHeightFromEdge(float edge) {
|
||||
switch (this) {
|
||||
case TERRAIN:
|
||||
return 1 + edge;
|
||||
case CEILING:
|
||||
return 1 - edge;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private Type type;
|
||||
private Texture texture;
|
||||
private float edge;
|
||||
private boolean endless;
|
||||
|
||||
public TileList(Type type, Texture texture) {
|
||||
this.type = type;
|
||||
this.texture = texture;
|
||||
}
|
||||
|
||||
public void loadData(float edge, List<TileData> tileData) {
|
||||
this.endless = false;
|
||||
super.clear();
|
||||
for (TileData data : tileData)
|
||||
super.add(new Tile(type, texture, edge, data));
|
||||
this.edge = edge;
|
||||
}
|
||||
|
||||
public void createEndless(float edge) {
|
||||
loadData(edge, new ArrayList<TileData>());
|
||||
super.add(createEndlessTile(0));
|
||||
this.endless = true;
|
||||
}
|
||||
|
||||
public void update(float cameraX) {
|
||||
if (!super.isEmpty()) {
|
||||
if (endless) {
|
||||
Tile last = super.get(super.size() - 1);
|
||||
if (last.getRightEdge() - cameraX < 3)
|
||||
super.add(createEndlessTile(last.getRightEdge() + 2.5f));
|
||||
}
|
||||
if (super.get(0).getRightEdge() - cameraX < -3) {
|
||||
super.remove(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Tile createEndlessTile(float x) {
|
||||
return new Tile(type, texture, edge, x, 5);
|
||||
}
|
||||
|
||||
public float getEdge() {
|
||||
return edge;
|
||||
}
|
||||
|
||||
}
|
@ -40,8 +40,7 @@ public class Ramp extends Tool {
|
||||
@Override
|
||||
public void onPlayerCollision(Player player) {
|
||||
float necessaryY = calcNecessaryPlayerY(player);
|
||||
if (necessaryY - player.RADIUS >= super.getBottomEdge() && necessaryY + player.RADIUS <= super.getTopEdge())
|
||||
player.getPosition().y = necessaryY;
|
||||
player.getPosition().y = necessaryY;
|
||||
float acceleration = player.getMovement().x * getGradient();
|
||||
player.getMovement().y = acceleration;
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.example.julian.endlessroll.levels;
|
||||
|
||||
import org.simpleframework.xml.Attribute;
|
||||
import org.simpleframework.xml.Element;
|
||||
import org.simpleframework.xml.ElementList;
|
||||
|
||||
import java.util.List;
|
||||
@ -15,8 +14,18 @@ public class Level {
|
||||
private int number;
|
||||
@Attribute
|
||||
private float goalX;
|
||||
@Element
|
||||
private TerrainData terrain;
|
||||
@Attribute
|
||||
private float startSpeed;
|
||||
@Attribute
|
||||
private float endSpeed;
|
||||
@Attribute
|
||||
private float terrainEdge;
|
||||
@Attribute
|
||||
private float ceilingEdge;
|
||||
@ElementList
|
||||
private List<TileData> terrainTiles;
|
||||
@ElementList
|
||||
private List<TileData> ceilingTiles;
|
||||
@ElementList
|
||||
private List<ObstacleData> obstacles;
|
||||
@ElementList
|
||||
@ -36,8 +45,28 @@ public class Level {
|
||||
return goalX;
|
||||
}
|
||||
|
||||
public TerrainData getTerrain() {
|
||||
return terrain;
|
||||
public float getStartSpeed() {
|
||||
return startSpeed;
|
||||
}
|
||||
|
||||
public float getEndSpeed() {
|
||||
return endSpeed;
|
||||
}
|
||||
|
||||
public float getTerrainEdge() {
|
||||
return terrainEdge;
|
||||
}
|
||||
|
||||
public float getCeilingEdge() {
|
||||
return ceilingEdge;
|
||||
}
|
||||
|
||||
public List<TileData> getTerrainTiles() {
|
||||
return terrainTiles;
|
||||
}
|
||||
|
||||
public List<TileData> getCeilingTiles() {
|
||||
return ceilingTiles;
|
||||
}
|
||||
|
||||
public List<ObstacleData> getObstacles() {
|
||||
|
@ -1,32 +0,0 @@
|
||||
package com.example.julian.endlessroll.levels;
|
||||
|
||||
import org.simpleframework.xml.Attribute;
|
||||
import org.simpleframework.xml.ElementList;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Julian on 27.11.2015.
|
||||
*/
|
||||
public class TerrainData {
|
||||
|
||||
@Attribute
|
||||
private float height;
|
||||
@Attribute
|
||||
private float endX;
|
||||
@ElementList
|
||||
private List<Gap> gaps;
|
||||
|
||||
public float getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public float getEndX() {
|
||||
return endX;
|
||||
}
|
||||
|
||||
public List<Gap> getGaps() {
|
||||
return gaps;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.example.julian.endlessroll.levels;
|
||||
|
||||
import org.simpleframework.xml.Attribute;
|
||||
|
||||
public class TileData {
|
||||
|
||||
@Attribute
|
||||
private float x;
|
||||
@Attribute
|
||||
private float width;
|
||||
|
||||
public float getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public float getWidth() {
|
||||
return width;
|
||||
}
|
||||
}
|
@ -98,7 +98,7 @@ public class Game extends Rendering<GameScene> {
|
||||
scene.loadLevel(level);
|
||||
player = scene.getPlayer();
|
||||
if (viewManager.isScreenSizeSet())
|
||||
viewManager.resetToolButtonBar();
|
||||
viewManager.resetViews();
|
||||
currentTool = viewManager.toolButtonBar.getActiveButton().getToolType();
|
||||
viewManager.startCountdown();
|
||||
}
|
||||
@ -123,9 +123,12 @@ public class Game extends Rendering<GameScene> {
|
||||
// GameLog.d("update GAME");
|
||||
particleSystem.update(timer);
|
||||
float playerProgress = 0;
|
||||
if (player != null)
|
||||
float playerSpeed = 0;
|
||||
if (player != null) {
|
||||
playerProgress = player.getProgress();
|
||||
viewManager.update(gameState == GameState.RUNNING, timer, playerProgress);
|
||||
playerSpeed = player.getSpeed();
|
||||
}
|
||||
viewManager.update(gameState == GameState.RUNNING, timer, playerProgress, playerSpeed);
|
||||
switch (gameState) {
|
||||
case RUNNING:
|
||||
if (player.getPosition().y < -2f) {
|
||||
@ -160,7 +163,7 @@ public class Game extends Rendering<GameScene> {
|
||||
}
|
||||
|
||||
public void resetViews() {
|
||||
viewManager.resetToolButtonBar();
|
||||
viewManager.resetViews();
|
||||
}
|
||||
|
||||
public void continueGame() {
|
||||
@ -230,7 +233,7 @@ public class Game extends Rendering<GameScene> {
|
||||
viewManager.showLevelUp(user.getLevel());
|
||||
user.getToolSlotSettings().unlockSlotsIfLevelReached(user.getLevel(), levelUpBounties);
|
||||
user.increaseStarCount(levelUpBounties.getBountyStarsAtLevel(user.getLevel()));
|
||||
viewManager.resetToolButtonBar();
|
||||
viewManager.resetViews();
|
||||
}
|
||||
viewManager.showMessage(levelPack.isLastLevel(level), MessageType.WIN);
|
||||
|
||||
|
@ -6,8 +6,6 @@ import com.example.julian.endlessroll.entities.Entity;
|
||||
import com.example.julian.endlessroll.entities.Goal;
|
||||
import com.example.julian.endlessroll.entities.Obstacle;
|
||||
import com.example.julian.endlessroll.entities.Star;
|
||||
import com.example.julian.endlessroll.entities.Terrain;
|
||||
import com.example.julian.endlessroll.entities.TerrainTile;
|
||||
import com.example.julian.endlessroll.entities.collision.CollisionDetector;
|
||||
import com.example.julian.endlessroll.entities.particles.ParticleSystem;
|
||||
import com.example.julian.endlessroll.entities.textures.TexturePack;
|
||||
@ -46,9 +44,10 @@ public class GameScene extends Scene {
|
||||
public void loadLevel(Level level) throws Exception {
|
||||
reset();
|
||||
lock.lock();
|
||||
terrain.loadData(level.getTerrain());
|
||||
terrain.loadData(level.getTerrainEdge(), level.getTerrainTiles());
|
||||
ceiling.loadData(level.getCeilingEdge(), level.getCeilingTiles());
|
||||
super.add(goal);
|
||||
player.init(terrain.getHeight());
|
||||
player.init(terrain.getEdge(), level.getStartSpeed(), level.getEndSpeed());
|
||||
super.add(player);
|
||||
lock.unlock();
|
||||
for (ObstacleData data : level.getObstacles())
|
||||
@ -89,7 +88,7 @@ public class GameScene extends Scene {
|
||||
}
|
||||
|
||||
public void addObstacle(ObstacleData data) {
|
||||
Obstacle obstacle = new Obstacle(textures.obstacle, data, terrain.getHeight());
|
||||
Obstacle obstacle = new Obstacle(textures.obstacle, data, terrain.getEdge());
|
||||
lock.lock();
|
||||
super.add(obstacle);
|
||||
obstacles.add(obstacle);
|
||||
@ -119,6 +118,8 @@ public class GameScene extends Scene {
|
||||
@Override
|
||||
public void update(Timer timer) {
|
||||
super.update(timer);
|
||||
float playerProgress = player.getPosition().x / goalX;
|
||||
player.setSpeedByProgress(playerProgress);
|
||||
for (Tool tool : tools) {
|
||||
tool.update(timer);
|
||||
if (tool instanceof Bomb) {
|
||||
@ -140,10 +141,6 @@ public class GameScene extends Scene {
|
||||
obstacles.remove(entity);
|
||||
}
|
||||
|
||||
public Terrain getTerrain() {
|
||||
return terrain;
|
||||
}
|
||||
|
||||
public List<Tool> getTools() {
|
||||
return tools;
|
||||
}
|
||||
|
@ -5,8 +5,8 @@ import android.support.annotation.Nullable;
|
||||
import com.example.julian.endlessroll.entities.Entity;
|
||||
import com.example.julian.endlessroll.entities.Obstacle;
|
||||
import com.example.julian.endlessroll.entities.Star;
|
||||
import com.example.julian.endlessroll.entities.Terrain;
|
||||
import com.example.julian.endlessroll.entities.TerrainTile;
|
||||
import com.example.julian.endlessroll.entities.tileLists.Terrain;
|
||||
import com.example.julian.endlessroll.entities.tileLists.Tile;
|
||||
import com.example.julian.endlessroll.entities.collision.CollisionDetector;
|
||||
import com.example.julian.endlessroll.entities.collision.collisionData.EntityCollisionData;
|
||||
import com.example.julian.endlessroll.entities.collision.collisionData.ObstacleCollisionData;
|
||||
@ -51,15 +51,15 @@ public class Physics {
|
||||
if (tool.isFloating())
|
||||
continue;
|
||||
}
|
||||
float terrainHeight = getTerrainHeight(tool, scene.getTerrain());
|
||||
float terrainEdge = getTerrainEdge(tool, scene.getTerrain());
|
||||
Obstacle toolIsOver = getObstacleToolIsOver(tool, scene.getObstacles());
|
||||
|
||||
float orientingHeight = terrainHeight;
|
||||
float orientingHeight = terrainEdge;
|
||||
if (toolIsOver != null) {
|
||||
if (toolIsOver.getBottomEdge() < tool.getTopEdge())
|
||||
orientingHeight = Math.max(toolIsOver.getTopEdge(), terrainHeight);
|
||||
orientingHeight = Math.max(toolIsOver.getTopEdge(), terrainEdge);
|
||||
else{
|
||||
orientingHeight = terrainHeight;
|
||||
orientingHeight = terrainEdge;
|
||||
}
|
||||
}
|
||||
|
||||
@ -90,13 +90,13 @@ public class Physics {
|
||||
return null;
|
||||
}
|
||||
|
||||
private float getTerrainHeight(Entity tool, Terrain terrain) {
|
||||
for (TerrainTile instance : terrain) {
|
||||
private float getTerrainEdge(Entity tool, Terrain terrain) {
|
||||
for (Tile instance : terrain) {
|
||||
if ((tool.getLeftEdge() >= instance.getLeftEdge() && tool.getLeftEdge() <= instance.getRightEdge())
|
||||
|| (tool.getRightEdge() <= instance.getRightEdge() && tool.getRightEdge() >= instance.getLeftEdge())
|
||||
|| (instance.getLeftEdge() >= tool.getLeftEdge() && instance.getLeftEdge() <= tool.getRightEdge())
|
||||
|| (instance.getRightEdge() <= tool.getRightEdge() && instance.getRightEdge() >= tool.getLeftEdge()))
|
||||
return terrain.getHeight();
|
||||
return terrain.getEdge();
|
||||
}
|
||||
return -10;
|
||||
}
|
||||
@ -111,7 +111,7 @@ public class Physics {
|
||||
|
||||
private EntityCollisionData playerCollidesWithTerrain(GameScene scene) {
|
||||
Terrain terrain = scene.getTerrain();
|
||||
for (TerrainTile terrainTile : terrain) {
|
||||
for (Tile terrainTile : terrain) {
|
||||
EntityCollisionData data = detector.playerEntityCollision(scene.getPlayer(), terrainTile);
|
||||
if (data.isCollision())
|
||||
return data;
|
||||
|
@ -4,9 +4,10 @@ import com.example.julian.endlessroll.data.Vector;
|
||||
import com.example.julian.endlessroll.entities.Background;
|
||||
import com.example.julian.endlessroll.entities.Entity;
|
||||
import com.example.julian.endlessroll.entities.Player;
|
||||
import com.example.julian.endlessroll.entities.Terrain;
|
||||
import com.example.julian.endlessroll.entities.particles.ParticleSystem;
|
||||
import com.example.julian.endlessroll.entities.textures.TexturePack;
|
||||
import com.example.julian.endlessroll.entities.tileLists.Ceiling;
|
||||
import com.example.julian.endlessroll.entities.tileLists.Terrain;
|
||||
import com.example.julian.endlessroll.rendering.Lock;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -27,6 +28,7 @@ public abstract class Scene extends ArrayList<Entity> {
|
||||
protected TexturePack textures;
|
||||
protected Background background;
|
||||
protected Terrain terrain;
|
||||
protected Ceiling ceiling;
|
||||
protected Player player;
|
||||
|
||||
public Scene(TexturePack texturePack, ParticleSystem particleSystem) {
|
||||
@ -34,7 +36,8 @@ public abstract class Scene extends ArrayList<Entity> {
|
||||
setTexturePack(texturePack);
|
||||
playerArrow = new Entity(textures.playerArrow, new Vector(0, 0.9f), .2f, .2f);
|
||||
background = new Background(textures.background);
|
||||
terrain = new Terrain(textures.terrain);
|
||||
terrain = new Terrain(textures);
|
||||
ceiling = new Ceiling(textures);
|
||||
player = new Player(textures.player);
|
||||
lock = new Lock();
|
||||
}
|
||||
@ -82,6 +85,7 @@ public abstract class Scene extends ArrayList<Entity> {
|
||||
cameraX += x;
|
||||
background.move(x * 0.95f, cameraX);
|
||||
terrain.update(cameraX);
|
||||
ceiling.update(cameraX);
|
||||
}
|
||||
|
||||
protected Vector calcWorldFromScreenCoords(float screenX, float screenY) throws Exception {
|
||||
@ -106,6 +110,10 @@ public abstract class Scene extends ArrayList<Entity> {
|
||||
return terrain;
|
||||
}
|
||||
|
||||
public Ceiling getCeiling() {
|
||||
return ceiling;
|
||||
}
|
||||
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ public class StartScene extends Scene {
|
||||
public StartScene(TexturePack texturePack, ParticleSystem particleSystem) {
|
||||
super(texturePack, particleSystem);
|
||||
terrain.createEndless(-.8f);
|
||||
player.init(terrain.getHeight());
|
||||
player.init(terrain.getEdge(), 0.5f, 0.5f);
|
||||
super.add(player);
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,8 @@ import android.opengl.GLSurfaceView;
|
||||
|
||||
import com.example.julian.endlessroll.entities.Entity;
|
||||
import com.example.julian.endlessroll.entities.textures.TexturePack;
|
||||
import com.example.julian.endlessroll.entities.tileLists.Tile;
|
||||
import com.example.julian.endlessroll.entities.tileLists.TileList;
|
||||
import com.example.julian.endlessroll.main.GameLog;
|
||||
import com.example.julian.endlessroll.main.game.Scene;
|
||||
import com.example.julian.endlessroll.main.game.Timer;
|
||||
@ -103,7 +105,8 @@ public class GameRenderer implements GLSurfaceView.Renderer {
|
||||
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
|
||||
|
||||
renderEntities(gl, scene);
|
||||
renderTerrain(gl, scene);
|
||||
renderTileList(gl, scene.getTerrain(), scene);
|
||||
renderTileList(gl, scene.getCeiling(), scene);
|
||||
renderFbo(gl);
|
||||
}
|
||||
}
|
||||
@ -129,13 +132,13 @@ public class GameRenderer implements GLSurfaceView.Renderer {
|
||||
quad.draw();
|
||||
}
|
||||
|
||||
private void renderTerrain(GL10 gl, Scene scene) {
|
||||
private void renderTileList(GL10 gl, TileList tileList, Scene scene) {
|
||||
terrainShader.start();
|
||||
terrainShader.loadMVPMatrix(matrixCreator, scene.cameraX);
|
||||
for (Entity entity : scene.getTerrain()) {
|
||||
for (Tile tile : tileList) {
|
||||
gl.glActiveTexture(GL10.GL_TEXTURE0);
|
||||
gl.glBindTexture(GL10.GL_TEXTURE_2D, entity.getTexture().getId());
|
||||
terrainShader.loadTransformationMatrix(matrixCreator, entity);
|
||||
gl.glBindTexture(GL10.GL_TEXTURE_2D, tile.getTexture().getId());
|
||||
terrainShader.loadTransformationMatrix(matrixCreator, tile);
|
||||
quad.draw();
|
||||
}
|
||||
terrainShader.stop();
|
||||
|
@ -10,6 +10,7 @@ import android.widget.TextView;
|
||||
import com.example.julian.endlessroll.R;
|
||||
import com.example.julian.endlessroll.data.Vector;
|
||||
import com.example.julian.endlessroll.main.GameHandler;
|
||||
import com.example.julian.endlessroll.main.GameLog;
|
||||
import com.example.julian.endlessroll.main.game.Game;
|
||||
import com.example.julian.endlessroll.main.game.GameState;
|
||||
import com.example.julian.endlessroll.main.game.Timer;
|
||||
@ -25,6 +26,7 @@ public class ViewManager implements View.OnClickListener {
|
||||
|
||||
private TextView fpsView;
|
||||
private TextView playerProgress;
|
||||
private TextView playerSpeed;
|
||||
private ImageView pauseButton;
|
||||
private Message message;
|
||||
public ToolButtonBar toolButtonBar;
|
||||
@ -50,6 +52,7 @@ public class ViewManager implements View.OnClickListener {
|
||||
pauseButton = (ImageView) layout.findViewById(R.id.game_pausebutton);
|
||||
pauseButton.setOnClickListener(this);
|
||||
playerProgress = (TextView) layout.findViewById(R.id.game_playerprogress);
|
||||
playerSpeed = (TextView) layout.findViewById(R.id.game_playerspeed);
|
||||
fpsView = (TextView) layout.findViewById(R.id.game_fps);
|
||||
}
|
||||
|
||||
@ -67,12 +70,14 @@ public class ViewManager implements View.OnClickListener {
|
||||
game.pause();
|
||||
}
|
||||
|
||||
public void resetToolButtonBar() {
|
||||
public void resetViews() {
|
||||
gameViewHandler.startInUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
toolButtonBar.reset();
|
||||
toolButtonBar.update(0);
|
||||
playerProgress.setText("0.0m");
|
||||
playerSpeed.setText("0.0m/s");
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -113,16 +118,22 @@ public class ViewManager implements View.OnClickListener {
|
||||
countdown.stop();
|
||||
}
|
||||
|
||||
public void update(final boolean gameRunning, final Timer timer, final float playerX) {
|
||||
public void update(final boolean gameRunning, final Timer timer, final float playerX, final float playerXMov) {
|
||||
gameViewHandler.startInUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fpsView.setText("Fps: " + timer.getFps());
|
||||
if (gameRunning) {
|
||||
playerProgress.setText(((int) (playerX * 20)) / 10f + "m");
|
||||
playerProgress.setText(toMeters(playerX) + "m");
|
||||
playerSpeed.setText(toMeters(playerXMov * 1000) + "m/s");
|
||||
toolButtonBar.update(timer.getFrameTime());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private float toMeters(float value){
|
||||
return ((int) (value * 20)) / 10f;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -28,9 +28,21 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="4dp"
|
||||
android:text="0m"
|
||||
android:text="0.0m"
|
||||
android:textColor="#ffb405"
|
||||
android:textSize="25sp" />
|
||||
android:textSize="22sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/game_playerspeed"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0.0m/s"
|
||||
android:textColor="#ffb405"
|
||||
android:textSize="22sp"
|
||||
android:layout_below="@+id/game_playerprogress"
|
||||
android:layout_alignLeft="@+id/game_playerprogress"
|
||||
android:layout_alignStart="@+id/game_playerprogress" />
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/game_fps"
|
||||
|
Reference in New Issue
Block a user