Added more objects and changed leveldata
This commit is contained in:
parent
075f421100
commit
673a02f2fa
Binary file not shown.
Before Width: | Height: | Size: 187 KiB |
@ -1,189 +0,0 @@
|
||||
<TextureAtlas imagePath="allSprites_retina.png">
|
||||
<SubTexture name="barrelBlack_side.png" x="1016" y="510" width="40" height="56"/>
|
||||
<SubTexture name="barrelBlack_top.png" x="1014" y="1032" width="48" height="48"/>
|
||||
<SubTexture name="barrelGreen_side.png" x="1024" y="0" width="40" height="56"/>
|
||||
<SubTexture name="barrelGreen_top.png" x="1012" y="809" width="48" height="48"/>
|
||||
<SubTexture name="barrelRed_side.png" x="828" y="740" width="40" height="56"/>
|
||||
<SubTexture name="barrelRed_top.png" x="1014" y="984" width="48" height="48"/>
|
||||
<SubTexture name="barrelRust_side.png" x="1016" y="753" width="40" height="56"/>
|
||||
<SubTexture name="barrelRust_top.png" x="1014" y="936" width="48" height="48"/>
|
||||
<SubTexture name="barricadeMetal.png" x="958" y="936" width="56" height="56"/>
|
||||
<SubTexture name="barricadeWood.png" x="958" y="1048" width="56" height="56"/>
|
||||
<SubTexture name="bulletBlue1.png" x="1006" y="1104" width="8" height="20"/>
|
||||
<SubTexture name="bulletBlue1_outline.png" x="1106" y="1069" width="16" height="28"/>
|
||||
<SubTexture name="bulletBlue2.png" x="990" y="1104" width="16" height="24"/>
|
||||
<SubTexture name="bulletBlue2_outline.png" x="1026" y="705" width="24" height="32"/>
|
||||
<SubTexture name="bulletBlue3.png" x="870" y="465" width="8" height="28"/>
|
||||
<SubTexture name="bulletBlue3_outline.png" x="1107" y="240" width="16" height="36"/>
|
||||
<SubTexture name="bulletDark1.png" x="228" y="1024" width="8" height="20"/>
|
||||
<SubTexture name="bulletDark1_outline.png" x="1106" y="1097" width="16" height="28"/>
|
||||
<SubTexture name="bulletDark2.png" x="974" y="1104" width="16" height="24"/>
|
||||
<SubTexture name="bulletDark2_outline.png" x="1085" y="654" width="24" height="32"/>
|
||||
<SubTexture name="bulletDark3.png" x="1024" y="158" width="8" height="28"/>
|
||||
<SubTexture name="bulletDark3_outline.png" x="1106" y="492" width="16" height="36"/>
|
||||
<SubTexture name="bulletGreen1.png" x="308" y="1104" width="8" height="20"/>
|
||||
<SubTexture name="bulletGreen1_outline.png" x="1106" y="412" width="16" height="28"/>
|
||||
<SubTexture name="bulletGreen2.png" x="684" y="1099" width="16" height="24"/>
|
||||
<SubTexture name="bulletGreen2_outline.png" x="1066" y="1069" width="24" height="32"/>
|
||||
<SubTexture name="bulletGreen3.png" x="700" y="1099" width="8" height="28"/>
|
||||
<SubTexture name="bulletGreen3_outline.png" x="1105" y="204" width="16" height="36"/>
|
||||
<SubTexture name="bulletRed1.png" x="236" y="1024" width="8" height="20"/>
|
||||
<SubTexture name="bulletRed1_outline.png" x="668" y="1099" width="16" height="28"/>
|
||||
<SubTexture name="bulletRed2.png" x="958" y="1104" width="16" height="24"/>
|
||||
<SubTexture name="bulletRed2_outline.png" x="1061" y="654" width="24" height="32"/>
|
||||
<SubTexture name="bulletRed3.png" x="308" y="1076" width="8" height="28"/>
|
||||
<SubTexture name="bulletRed3_outline.png" x="1064" y="60" width="16" height="36"/>
|
||||
<SubTexture name="bulletSand1.png" x="212" y="1108" width="8" height="20"/>
|
||||
<SubTexture name="bulletSand1_outline.png" x="652" y="1099" width="16" height="28"/>
|
||||
<SubTexture name="bulletSand2.png" x="1090" y="518" width="16" height="24"/>
|
||||
<SubTexture name="bulletSand2_outline.png" x="1084" y="120" width="24" height="32"/>
|
||||
<SubTexture name="bulletSand3.png" x="952" y="753" width="8" height="28"/>
|
||||
<SubTexture name="bulletSand3_outline.png" x="930" y="569" width="16" height="36"/>
|
||||
<SubTexture name="crateMetal.png" x="958" y="992" width="56" height="56"/>
|
||||
<SubTexture name="crateMetal_side.png" x="960" y="434" width="56" height="56"/>
|
||||
<SubTexture name="crateWood.png" x="960" y="753" width="56" height="56"/>
|
||||
<SubTexture name="crateWood_side.png" x="960" y="490" width="56" height="56"/>
|
||||
<SubTexture name="explosion1.png" x="640" y="804" width="120" height="120"/>
|
||||
<SubTexture name="explosion2.png" x="764" y="508" width="114" height="112"/>
|
||||
<SubTexture name="explosion3.png" x="640" y="256" width="127" height="126"/>
|
||||
<SubTexture name="explosion4.png" x="860" y="96" width="92" height="90"/>
|
||||
<SubTexture name="explosion5.png" x="0" y="1024" width="106" height="104"/>
|
||||
<SubTexture name="explosionSmoke1.png" x="640" y="924" width="120" height="120"/>
|
||||
<SubTexture name="explosionSmoke2.png" x="760" y="940" width="114" height="112"/>
|
||||
<SubTexture name="explosionSmoke3.png" x="640" y="382" width="126" height="126"/>
|
||||
<SubTexture name="explosionSmoke4.png" x="768" y="96" width="92" height="90"/>
|
||||
<SubTexture name="explosionSmoke5.png" x="106" y="1024" width="106" height="104"/>
|
||||
<SubTexture name="fenceRed.png" x="212" y="1076" width="96" height="32"/>
|
||||
<SubTexture name="fenceYellow.png" x="212" y="1044" width="104" height="32"/>
|
||||
<SubTexture name="oilSpill_large.png" x="524" y="1024" width="100" height="100"/>
|
||||
<SubTexture name="oilSpill_small.png" x="624" y="1099" width="28" height="28"/>
|
||||
<SubTexture name="sandbagBeige.png" x="768" y="186" width="64" height="44"/>
|
||||
<SubTexture name="sandbagBeige_open.png" x="624" y="1044" width="84" height="55"/>
|
||||
<SubTexture name="sandbagBrown.png" x="764" y="740" width="64" height="44"/>
|
||||
<SubTexture name="sandbagBrown_open.png" x="708" y="1052" width="84" height="55"/>
|
||||
<SubTexture name="shotLarge.png" x="1024" y="56" width="40" height="50"/>
|
||||
<SubTexture name="shotOrange.png" x="1033" y="214" width="32" height="56"/>
|
||||
<SubTexture name="shotRed.png" x="1016" y="434" width="42" height="76"/>
|
||||
<SubTexture name="shotThin.png" x="1106" y="440" width="16" height="52"/>
|
||||
<SubTexture name="specialBarrel1.png" x="1014" y="1080" width="28" height="44"/>
|
||||
<SubTexture name="specialBarrel1_outline.png" x="1024" y="106" width="36" height="52"/>
|
||||
<SubTexture name="specialBarrel2.png" x="1042" y="1080" width="24" height="48"/>
|
||||
<SubTexture name="specialBarrel2_outline.png" x="1033" y="158" width="32" height="56"/>
|
||||
<SubTexture name="specialBarrel3.png" x="1088" y="0" width="20" height="56"/>
|
||||
<SubTexture name="specialBarrel3_outline.png" x="832" y="186" width="28" height="64"/>
|
||||
<SubTexture name="specialBarrel4.png" x="1088" y="746" width="20" height="64"/>
|
||||
<SubTexture name="specialBarrel4_outline.png" x="1060" y="765" width="28" height="72"/>
|
||||
<SubTexture name="specialBarrel5.png" x="1060" y="106" width="24" height="52"/>
|
||||
<SubTexture name="specialBarrel5_outline.png" x="1058" y="362" width="32" height="60"/>
|
||||
<SubTexture name="specialBarrel6.png" x="1089" y="152" width="16" height="52"/>
|
||||
<SubTexture name="specialBarrel6_outline.png" x="1062" y="897" width="24" height="60"/>
|
||||
<SubTexture name="specialBarrel7.png" x="1106" y="360" width="16" height="52"/>
|
||||
<SubTexture name="specialBarrel7_outline.png" x="1062" y="1009" width="24" height="60"/>
|
||||
<SubTexture name="tankBlue_barrel1.png" x="1086" y="957" width="24" height="52"/>
|
||||
<SubTexture name="tankBlue_barrel1_outline.png" x="1058" y="422" width="32" height="60"/>
|
||||
<SubTexture name="tankBlue_barrel2.png" x="1090" y="1069" width="16" height="52"/>
|
||||
<SubTexture name="tankBlue_barrel2_outline.png" x="1060" y="837" width="24" height="60"/>
|
||||
<SubTexture name="tankBlue_barrel3.png" x="1090" y="466" width="16" height="52"/>
|
||||
<SubTexture name="tankBlue_barrel3_outline.png" x="1061" y="542" width="24" height="60"/>
|
||||
<SubTexture name="tankBody_bigRed.png" x="768" y="0" width="96" height="96"/>
|
||||
<SubTexture name="tankBody_bigRed_outline.png" x="420" y="1024" width="104" height="104"/>
|
||||
<SubTexture name="tankBody_blue.png" x="792" y="1052" width="76" height="76"/>
|
||||
<SubTexture name="tankBody_blue_outline.png" x="868" y="620" width="84" height="84"/>
|
||||
<SubTexture name="tankBody_dark.png" x="876" y="864" width="76" height="72"/>
|
||||
<SubTexture name="tankBody_darkLarge.png" x="767" y="256" width="96" height="112"/>
|
||||
<SubTexture name="tankBody_darkLarge_outline.png" x="764" y="620" width="104" height="120"/>
|
||||
<SubTexture name="tankBody_dark_outline.png" x="868" y="704" width="84" height="80"/>
|
||||
<SubTexture name="tankBody_green.png" x="947" y="290" width="76" height="72"/>
|
||||
<SubTexture name="tankBody_green_outline.png" x="874" y="1032" width="84" height="80"/>
|
||||
<SubTexture name="tankBody_huge.png" x="760" y="804" width="116" height="136"/>
|
||||
<SubTexture name="tankBody_huge_outline.png" x="640" y="660" width="124" height="144"/>
|
||||
<SubTexture name="tankBody_red.png" x="1023" y="290" width="68" height="72"/>
|
||||
<SubTexture name="tankBody_red_outline.png" x="952" y="569" width="76" height="80"/>
|
||||
<SubTexture name="tankBody_sand.png" x="952" y="864" width="76" height="72"/>
|
||||
<SubTexture name="tankBody_sand_outline.png" x="876" y="784" width="84" height="80"/>
|
||||
<SubTexture name="tankDark_barrel1.png" x="1085" y="602" width="24" height="52"/>
|
||||
<SubTexture name="tankDark_barrel1_outline.png" x="1056" y="705" width="32" height="60"/>
|
||||
<SubTexture name="tankDark_barrel2.png" x="1091" y="308" width="16" height="52"/>
|
||||
<SubTexture name="tankDark_barrel2_outline.png" x="1084" y="837" width="24" height="60"/>
|
||||
<SubTexture name="tankDark_barrel3.png" x="1107" y="276" width="16" height="52"/>
|
||||
<SubTexture name="tankDark_barrel3_outline.png" x="1065" y="210" width="24" height="60"/>
|
||||
<SubTexture name="tankGreen_barrel1.png" x="1062" y="957" width="24" height="52"/>
|
||||
<SubTexture name="tankGreen_barrel1_outline.png" x="1028" y="857" width="32" height="60"/>
|
||||
<SubTexture name="tankGreen_barrel2.png" x="1108" y="746" width="16" height="52"/>
|
||||
<SubTexture name="tankGreen_barrel2_outline.png" x="1086" y="897" width="24" height="60"/>
|
||||
<SubTexture name="tankGreen_barrel3.png" x="1089" y="204" width="16" height="52"/>
|
||||
<SubTexture name="tankGreen_barrel3_outline.png" x="1086" y="1009" width="24" height="60"/>
|
||||
<SubTexture name="tankRed_barrel1.png" x="1061" y="602" width="24" height="52"/>
|
||||
<SubTexture name="tankRed_barrel1_outline.png" x="1026" y="362" width="32" height="60"/>
|
||||
<SubTexture name="tankRed_barrel2.png" x="1090" y="414" width="16" height="52"/>
|
||||
<SubTexture name="tankRed_barrel2_outline.png" x="1085" y="542" width="24" height="60"/>
|
||||
<SubTexture name="tankRed_barrel3.png" x="1090" y="362" width="16" height="52"/>
|
||||
<SubTexture name="tankRed_barrel3_outline.png" x="1088" y="686" width="24" height="60"/>
|
||||
<SubTexture name="tankSand_barrel1.png" x="1065" y="158" width="24" height="52"/>
|
||||
<SubTexture name="tankSand_barrel1_outline.png" x="1058" y="482" width="32" height="60"/>
|
||||
<SubTexture name="tankSand_barrel2.png" x="1105" y="152" width="16" height="52"/>
|
||||
<SubTexture name="tankSand_barrel2_outline.png" x="1064" y="0" width="24" height="60"/>
|
||||
<SubTexture name="tankSand_barrel3.png" x="1091" y="256" width="16" height="52"/>
|
||||
<SubTexture name="tankSand_barrel3_outline.png" x="1084" y="60" width="24" height="60"/>
|
||||
<SubTexture name="tank_bigRed.png" x="316" y="1024" width="104" height="104"/>
|
||||
<SubTexture name="tank_blue.png" x="874" y="940" width="84" height="92"/>
|
||||
<SubTexture name="tank_dark.png" x="870" y="373" width="84" height="92"/>
|
||||
<SubTexture name="tank_darkLarge.png" x="766" y="382" width="104" height="120"/>
|
||||
<SubTexture name="tank_green.png" x="864" y="0" width="84" height="92"/>
|
||||
<SubTexture name="tank_huge.png" x="640" y="508" width="124" height="152"/>
|
||||
<SubTexture name="tank_red.png" x="948" y="0" width="76" height="92"/>
|
||||
<SubTexture name="tank_sand.png" x="863" y="281" width="84" height="92"/>
|
||||
<SubTexture name="tileGrass1.png" x="384" y="896" width="128" height="128"/>
|
||||
<SubTexture name="tileGrass2.png" x="384" y="256" width="128" height="128"/>
|
||||
<SubTexture name="tileGrass_roadCornerLL.png" x="0" y="512" width="128" height="128"/>
|
||||
<SubTexture name="tileGrass_roadCornerLR.png" x="0" y="640" width="128" height="128"/>
|
||||
<SubTexture name="tileGrass_roadCornerUL.png" x="128" y="256" width="128" height="128"/>
|
||||
<SubTexture name="tileGrass_roadCornerUR.png" x="128" y="384" width="128" height="128"/>
|
||||
<SubTexture name="tileGrass_roadCrossing.png" x="128" y="640" width="128" height="128"/>
|
||||
<SubTexture name="tileGrass_roadCrossingRound.png" x="384" y="512" width="128" height="128"/>
|
||||
<SubTexture name="tileGrass_roadEast.png" x="0" y="768" width="128" height="128"/>
|
||||
<SubTexture name="tileGrass_roadNorth.png" x="128" y="896" width="128" height="128"/>
|
||||
<SubTexture name="tileGrass_roadSplitE.png" x="128" y="768" width="128" height="128"/>
|
||||
<SubTexture name="tileGrass_roadSplitN.png" x="384" y="384" width="128" height="128"/>
|
||||
<SubTexture name="tileGrass_roadSplitS.png" x="384" y="768" width="128" height="128"/>
|
||||
<SubTexture name="tileGrass_roadSplitW.png" x="512" y="512" width="128" height="128"/>
|
||||
<SubTexture name="tileGrass_roadTransitionE.png" x="512" y="640" width="128" height="128"/>
|
||||
<SubTexture name="tileGrass_roadTransitionE_dirt.png" x="512" y="768" width="128" height="128"/>
|
||||
<SubTexture name="tileGrass_roadTransitionN.png" x="512" y="384" width="128" height="128"/>
|
||||
<SubTexture name="tileGrass_roadTransitionN_dirt.png" x="640" y="0" width="128" height="128"/>
|
||||
<SubTexture name="tileGrass_roadTransitionS.png" x="512" y="896" width="128" height="128"/>
|
||||
<SubTexture name="tileGrass_roadTransitionS_dirt.png" x="0" y="0" width="128" height="128"/>
|
||||
<SubTexture name="tileGrass_roadTransitionW.png" x="0" y="256" width="128" height="128"/>
|
||||
<SubTexture name="tileGrass_roadTransitionW_dirt.png" x="0" y="128" width="128" height="128"/>
|
||||
<SubTexture name="tileGrass_transitionE.png" x="640" y="128" width="128" height="128"/>
|
||||
<SubTexture name="tileGrass_transitionN.png" x="512" y="256" width="128" height="128"/>
|
||||
<SubTexture name="tileGrass_transitionS.png" x="512" y="128" width="128" height="128"/>
|
||||
<SubTexture name="tileGrass_transitionW.png" x="512" y="0" width="128" height="128"/>
|
||||
<SubTexture name="tileSand1.png" x="256" y="128" width="128" height="128"/>
|
||||
<SubTexture name="tileSand2.png" x="256" y="0" width="128" height="128"/>
|
||||
<SubTexture name="tileSand_roadCornerLL.png" x="384" y="640" width="128" height="128"/>
|
||||
<SubTexture name="tileSand_roadCornerLR.png" x="0" y="896" width="128" height="128"/>
|
||||
<SubTexture name="tileSand_roadCornerUL.png" x="128" y="128" width="128" height="128"/>
|
||||
<SubTexture name="tileSand_roadCornerUR.png" x="0" y="384" width="128" height="128"/>
|
||||
<SubTexture name="tileSand_roadCrossing.png" x="384" y="128" width="128" height="128"/>
|
||||
<SubTexture name="tileSand_roadCrossingRound.png" x="384" y="0" width="128" height="128"/>
|
||||
<SubTexture name="tileSand_roadEast.png" x="256" y="896" width="128" height="128"/>
|
||||
<SubTexture name="tileSand_roadNorth.png" x="256" y="768" width="128" height="128"/>
|
||||
<SubTexture name="tileSand_roadSplitE.png" x="256" y="640" width="128" height="128"/>
|
||||
<SubTexture name="tileSand_roadSplitN.png" x="256" y="512" width="128" height="128"/>
|
||||
<SubTexture name="tileSand_roadSplitS.png" x="256" y="384" width="128" height="128"/>
|
||||
<SubTexture name="tileSand_roadSplitW.png" x="256" y="256" width="128" height="128"/>
|
||||
<SubTexture name="tracksDouble.png" x="951" y="186" width="82" height="104"/>
|
||||
<SubTexture name="tracksLarge.png" x="878" y="465" width="82" height="104"/>
|
||||
<SubTexture name="tracksSmall.png" x="952" y="649" width="74" height="104"/>
|
||||
<SubTexture name="treeBrown_large.png" x="128" y="512" width="128" height="128"/>
|
||||
<SubTexture name="treeBrown_leaf.png" x="212" y="1024" width="16" height="20"/>
|
||||
<SubTexture name="treeBrown_small.png" x="952" y="92" width="72" height="72"/>
|
||||
<SubTexture name="treeBrown_twigs.png" x="878" y="569" width="52" height="44"/>
|
||||
<SubTexture name="treeGreen_large.png" x="128" y="0" width="128" height="128"/>
|
||||
<SubTexture name="treeGreen_leaf.png" x="624" y="1024" width="16" height="20"/>
|
||||
<SubTexture name="treeGreen_small.png" x="954" y="362" width="72" height="72"/>
|
||||
<SubTexture name="treeGreen_twigs.png" x="960" y="809" width="52" height="44"/>
|
||||
<SubTexture name="wireCrooked.png" x="863" y="186" width="88" height="95"/>
|
||||
<SubTexture name="wireStraight.png" x="1028" y="566" width="33" height="139"/>
|
||||
</TextureAtlas>
|
Binary file not shown.
Before Width: | Height: | Size: 110 KiB |
@ -1,149 +0,0 @@
|
||||
<TextureAtlas imagePath="onlyObjects_retina.png">
|
||||
<SubTexture name="barrelBlack_side.png" x="652" y="532" width="40" height="56"/>
|
||||
<SubTexture name="barrelBlack_top.png" x="645" y="220" width="48" height="48"/>
|
||||
<SubTexture name="barrelGreen_side.png" x="652" y="476" width="40" height="56"/>
|
||||
<SubTexture name="barrelGreen_top.png" x="597" y="220" width="48" height="48"/>
|
||||
<SubTexture name="barrelRed_side.png" x="648" y="420" width="40" height="56"/>
|
||||
<SubTexture name="barrelRed_top.png" x="645" y="172" width="48" height="48"/>
|
||||
<SubTexture name="barrelRust_side.png" x="652" y="588" width="40" height="56"/>
|
||||
<SubTexture name="barrelRust_top.png" x="597" y="172" width="48" height="48"/>
|
||||
<SubTexture name="barricadeMetal.png" x="596" y="532" width="56" height="56"/>
|
||||
<SubTexture name="barricadeWood.png" x="596" y="72" width="56" height="56"/>
|
||||
<SubTexture name="bulletBlue1.png" x="232" y="216" width="8" height="20"/>
|
||||
<SubTexture name="bulletBlue1_outline.png" x="570" y="584" width="16" height="28"/>
|
||||
<SubTexture name="bulletBlue2.png" x="323" y="368" width="16" height="24"/>
|
||||
<SubTexture name="bulletBlue2_outline.png" x="484" y="388" width="24" height="32"/>
|
||||
<SubTexture name="bulletBlue3.png" x="332" y="624" width="8" height="28"/>
|
||||
<SubTexture name="bulletBlue3_outline.png" x="576" y="348" width="16" height="36"/>
|
||||
<SubTexture name="bulletDark1.png" x="372" y="573" width="8" height="20"/>
|
||||
<SubTexture name="bulletDark1_outline.png" x="560" y="348" width="16" height="28"/>
|
||||
<SubTexture name="bulletDark2.png" x="291" y="368" width="16" height="24"/>
|
||||
<SubTexture name="bulletDark2_outline.png" x="696" y="744" width="24" height="32"/>
|
||||
<SubTexture name="bulletDark3.png" x="423" y="308" width="8" height="28"/>
|
||||
<SubTexture name="bulletDark3_outline.png" x="544" y="348" width="16" height="36"/>
|
||||
<SubTexture name="bulletGreen1.png" x="232" y="236" width="8" height="20"/>
|
||||
<SubTexture name="bulletGreen1_outline.png" x="407" y="308" width="16" height="28"/>
|
||||
<SubTexture name="bulletGreen2.png" x="259" y="368" width="16" height="24"/>
|
||||
<SubTexture name="bulletGreen2_outline.png" x="460" y="388" width="24" height="32"/>
|
||||
<SubTexture name="bulletGreen3.png" x="432" y="518" width="8" height="28"/>
|
||||
<SubTexture name="bulletGreen3_outline.png" x="538" y="584" width="16" height="36"/>
|
||||
<SubTexture name="bulletRed1.png" x="380" y="573" width="8" height="20"/>
|
||||
<SubTexture name="bulletRed1_outline.png" x="391" y="308" width="16" height="28"/>
|
||||
<SubTexture name="bulletRed2.png" x="275" y="368" width="16" height="24"/>
|
||||
<SubTexture name="bulletRed2_outline.png" x="436" y="388" width="24" height="32"/>
|
||||
<SubTexture name="bulletRed3.png" x="332" y="596" width="8" height="28"/>
|
||||
<SubTexture name="bulletRed3_outline.png" x="522" y="584" width="16" height="36"/>
|
||||
<SubTexture name="bulletSand1.png" x="364" y="573" width="8" height="20"/>
|
||||
<SubTexture name="bulletSand1_outline.png" x="375" y="308" width="16" height="28"/>
|
||||
<SubTexture name="bulletSand2.png" x="243" y="368" width="16" height="24"/>
|
||||
<SubTexture name="bulletSand2_outline.png" x="520" y="348" width="24" height="32"/>
|
||||
<SubTexture name="bulletSand3.png" x="508" y="388" width="8" height="28"/>
|
||||
<SubTexture name="bulletSand3_outline.png" x="554" y="584" width="16" height="36"/>
|
||||
<SubTexture name="crateMetal.png" x="596" y="588" width="56" height="56"/>
|
||||
<SubTexture name="crateMetal_side.png" x="596" y="268" width="56" height="56"/>
|
||||
<SubTexture name="crateWood.png" x="596" y="476" width="56" height="56"/>
|
||||
<SubTexture name="crateWood_side.png" x="592" y="420" width="56" height="56"/>
|
||||
<SubTexture name="explosion1.png" x="0" y="652" width="120" height="120"/>
|
||||
<SubTexture name="explosion2.png" x="128" y="0" width="114" height="112"/>
|
||||
<SubTexture name="explosion3.png" x="0" y="256" width="127" height="126"/>
|
||||
<SubTexture name="explosion4.png" x="344" y="336" width="92" height="90"/>
|
||||
<SubTexture name="explosion5.png" x="128" y="112" width="106" height="104"/>
|
||||
<SubTexture name="explosionSmoke1.png" x="120" y="660" width="120" height="120"/>
|
||||
<SubTexture name="explosionSmoke2.png" x="126" y="392" width="114" height="112"/>
|
||||
<SubTexture name="explosionSmoke3.png" x="0" y="382" width="126" height="126"/>
|
||||
<SubTexture name="explosionSmoke4.png" x="344" y="692" width="92" height="90"/>
|
||||
<SubTexture name="explosionSmoke5.png" x="234" y="112" width="106" height="104"/>
|
||||
<SubTexture name="fenceRed.png" x="243" y="336" width="96" height="32"/>
|
||||
<SubTexture name="fenceYellow.png" x="128" y="216" width="104" height="32"/>
|
||||
<SubTexture name="oilSpill_large.png" x="248" y="496" width="100" height="100"/>
|
||||
<SubTexture name="oilSpill_small.png" x="347" y="308" width="28" height="28"/>
|
||||
<SubTexture name="sandbagBeige.png" x="436" y="164" width="64" height="44"/>
|
||||
<SubTexture name="sandbagBeige_open.png" x="348" y="518" width="84" height="55"/>
|
||||
<SubTexture name="sandbagBrown.png" x="440" y="622" width="64" height="44"/>
|
||||
<SubTexture name="sandbagBrown_open.png" x="248" y="596" width="84" height="55"/>
|
||||
<SubTexture name="shotLarge.png" x="648" y="644" width="40" height="50"/>
|
||||
<SubTexture name="shotOrange.png" x="692" y="584" width="32" height="56"/>
|
||||
<SubTexture name="shotRed.png" x="652" y="268" width="42" height="76"/>
|
||||
<SubTexture name="shotThin.png" x="748" y="535" width="16" height="52"/>
|
||||
<SubTexture name="specialBarrel1.png" x="649" y="128" width="28" height="44"/>
|
||||
<SubTexture name="specialBarrel1_outline.png" x="652" y="72" width="36" height="52"/>
|
||||
<SubTexture name="specialBarrel2.png" x="688" y="644" width="24" height="48"/>
|
||||
<SubTexture name="specialBarrel2_outline.png" x="692" y="344" width="32" height="56"/>
|
||||
<SubTexture name="specialBarrel3.png" x="746" y="236" width="20" height="56"/>
|
||||
<SubTexture name="specialBarrel3_outline.png" x="694" y="271" width="28" height="64"/>
|
||||
<SubTexture name="specialBarrel4.png" x="746" y="172" width="20" height="64"/>
|
||||
<SubTexture name="specialBarrel4_outline.png" x="694" y="199" width="28" height="72"/>
|
||||
<SubTexture name="specialBarrel5.png" x="696" y="692" width="24" height="52"/>
|
||||
<SubTexture name="specialBarrel5_outline.png" x="692" y="464" width="32" height="60"/>
|
||||
<SubTexture name="specialBarrel6.png" x="764" y="431" width="16" height="52"/>
|
||||
<SubTexture name="specialBarrel6_outline.png" x="720" y="700" width="24" height="60"/>
|
||||
<SubTexture name="specialBarrel7.png" x="764" y="292" width="16" height="52"/>
|
||||
<SubTexture name="specialBarrel7_outline.png" x="721" y="0" width="24" height="60"/>
|
||||
<SubTexture name="tankBlue_barrel1.png" x="721" y="60" width="24" height="52"/>
|
||||
<SubTexture name="tankBlue_barrel1_outline.png" x="660" y="344" width="32" height="60"/>
|
||||
<SubTexture name="tankBlue_barrel2.png" x="749" y="112" width="16" height="52"/>
|
||||
<SubTexture name="tankBlue_barrel2_outline.png" x="722" y="199" width="24" height="60"/>
|
||||
<SubTexture name="tankBlue_barrel3.png" x="748" y="431" width="16" height="52"/>
|
||||
<SubTexture name="tankBlue_barrel3_outline.png" x="722" y="259" width="24" height="60"/>
|
||||
<SubTexture name="tankBody_bigRed.png" x="344" y="596" width="96" height="96"/>
|
||||
<SubTexture name="tankBody_bigRed_outline.png" x="242" y="0" width="104" height="104"/>
|
||||
<SubTexture name="tankBody_blue.png" x="520" y="72" width="76" height="76"/>
|
||||
<SubTexture name="tankBody_blue_outline.png" x="434" y="0" width="84" height="84"/>
|
||||
<SubTexture name="tankBody_dark.png" x="518" y="0" width="76" height="72"/>
|
||||
<SubTexture name="tankBody_darkLarge.png" x="340" y="104" width="96" height="112"/>
|
||||
<SubTexture name="tankBody_darkLarge_outline.png" x="240" y="660" width="104" height="120"/>
|
||||
<SubTexture name="tankBody_dark_outline.png" x="436" y="692" width="84" height="80"/>
|
||||
<SubTexture name="tankBody_green.png" x="520" y="622" width="76" height="72"/>
|
||||
<SubTexture name="tankBody_green_outline.png" x="436" y="308" width="84" height="80"/>
|
||||
<SubTexture name="tankBody_huge.png" x="127" y="256" width="116" height="136"/>
|
||||
<SubTexture name="tankBody_huge_outline.png" x="0" y="508" width="124" height="144"/>
|
||||
<SubTexture name="tankBody_red.png" x="592" y="348" width="68" height="72"/>
|
||||
<SubTexture name="tankBody_red_outline.png" x="520" y="268" width="76" height="80"/>
|
||||
<SubTexture name="tankBody_sand.png" x="594" y="0" width="76" height="72"/>
|
||||
<SubTexture name="tankBody_sand_outline.png" x="436" y="84" width="84" height="80"/>
|
||||
<SubTexture name="tankDark_barrel1.png" x="724" y="319" width="24" height="52"/>
|
||||
<SubTexture name="tankDark_barrel1_outline.png" x="692" y="524" width="32" height="60"/>
|
||||
<SubTexture name="tankDark_barrel2.png" x="748" y="483" width="16" height="52"/>
|
||||
<SubTexture name="tankDark_barrel2_outline.png" x="724" y="512" width="24" height="60"/>
|
||||
<SubTexture name="tankDark_barrel3.png" x="748" y="292" width="16" height="52"/>
|
||||
<SubTexture name="tankDark_barrel3_outline.png" x="725" y="112" width="24" height="60"/>
|
||||
<SubTexture name="tankGreen_barrel1.png" x="744" y="632" width="24" height="52"/>
|
||||
<SubTexture name="tankGreen_barrel1_outline.png" x="693" y="139" width="32" height="60"/>
|
||||
<SubTexture name="tankGreen_barrel2.png" x="670" y="0" width="16" height="52"/>
|
||||
<SubTexture name="tankGreen_barrel2_outline.png" x="744" y="684" width="24" height="60"/>
|
||||
<SubTexture name="tankGreen_barrel3.png" x="504" y="622" width="16" height="52"/>
|
||||
<SubTexture name="tankGreen_barrel3_outline.png" x="720" y="640" width="24" height="60"/>
|
||||
<SubTexture name="tankRed_barrel1.png" x="720" y="400" width="24" height="52"/>
|
||||
<SubTexture name="tankRed_barrel1_outline.png" x="664" y="694" width="32" height="60"/>
|
||||
<SubTexture name="tankRed_barrel2.png" x="764" y="483" width="16" height="52"/>
|
||||
<SubTexture name="tankRed_barrel2_outline.png" x="724" y="452" width="24" height="60"/>
|
||||
<SubTexture name="tankRed_barrel3.png" x="764" y="535" width="16" height="52"/>
|
||||
<SubTexture name="tankRed_barrel3_outline.png" x="744" y="371" width="24" height="60"/>
|
||||
<SubTexture name="tankSand_barrel1.png" x="745" y="60" width="24" height="52"/>
|
||||
<SubTexture name="tankSand_barrel1_outline.png" x="688" y="404" width="32" height="60"/>
|
||||
<SubTexture name="tankSand_barrel2.png" x="766" y="164" width="16" height="52"/>
|
||||
<SubTexture name="tankSand_barrel2_outline.png" x="745" y="0" width="24" height="60"/>
|
||||
<SubTexture name="tankSand_barrel3.png" x="765" y="112" width="16" height="52"/>
|
||||
<SubTexture name="tankSand_barrel3_outline.png" x="724" y="572" width="24" height="60"/>
|
||||
<SubTexture name="tank_bigRed.png" x="240" y="392" width="104" height="104"/>
|
||||
<SubTexture name="tank_blue.png" x="432" y="426" width="84" height="92"/>
|
||||
<SubTexture name="tank_dark.png" x="348" y="426" width="84" height="92"/>
|
||||
<SubTexture name="tank_darkLarge.png" x="243" y="216" width="104" height="120"/>
|
||||
<SubTexture name="tank_green.png" x="431" y="216" width="84" height="92"/>
|
||||
<SubTexture name="tank_huge.png" x="124" y="508" width="124" height="152"/>
|
||||
<SubTexture name="tank_red.png" x="516" y="388" width="76" height="92"/>
|
||||
<SubTexture name="tank_sand.png" x="347" y="216" width="84" height="92"/>
|
||||
<SubTexture name="tracksDouble.png" x="515" y="164" width="82" height="104"/>
|
||||
<SubTexture name="tracksLarge.png" x="440" y="518" width="82" height="104"/>
|
||||
<SubTexture name="tracksSmall.png" x="522" y="480" width="74" height="104"/>
|
||||
<SubTexture name="treeBrown_large.png" x="0" y="0" width="128" height="128"/>
|
||||
<SubTexture name="treeBrown_leaf.png" x="348" y="573" width="16" height="20"/>
|
||||
<SubTexture name="treeBrown_small.png" x="592" y="694" width="72" height="72"/>
|
||||
<SubTexture name="treeBrown_twigs.png" x="597" y="128" width="52" height="44"/>
|
||||
<SubTexture name="treeGreen_large.png" x="0" y="128" width="128" height="128"/>
|
||||
<SubTexture name="treeGreen_leaf.png" x="307" y="368" width="16" height="20"/>
|
||||
<SubTexture name="treeGreen_small.png" x="520" y="694" width="72" height="72"/>
|
||||
<SubTexture name="treeGreen_twigs.png" x="596" y="644" width="52" height="44"/>
|
||||
<SubTexture name="wireCrooked.png" x="346" y="0" width="88" height="95"/>
|
||||
<SubTexture name="wireStraight.png" x="688" y="0" width="33" height="139"/>
|
||||
</TextureAtlas>
|
42
res/images/terrainTiles_default.json
Normal file
42
res/images/terrainTiles_default.json
Normal file
@ -0,0 +1,42 @@
|
||||
[
|
||||
{ "x": 0, "y": 0 },
|
||||
{ "x": 1, "y": 0 },
|
||||
{ "x": 2, "y": 0 },
|
||||
{ "x": 3, "y": 0 },
|
||||
{ "x": 4, "y": 0 },
|
||||
{ "x": 5, "y": 0 },
|
||||
{ "x": 6, "y": 0 },
|
||||
{ "x": 7, "y": 0 },
|
||||
{ "x": 8, "y": 0 },
|
||||
{ "x": 9, "y": 0 },
|
||||
{ "x": 0, "y": 1 },
|
||||
{ "x": 1, "y": 1 },
|
||||
{ "x": 2, "y": 1 },
|
||||
{ "x": 3, "y": 1 },
|
||||
{ "x": 4, "y": 1 },
|
||||
{ "x": 5, "y": 1 },
|
||||
{ "x": 6, "y": 1 },
|
||||
{ "x": 7, "y": 1 },
|
||||
{ "x": 8, "y": 1 },
|
||||
{ "x": 9, "y": 1 },
|
||||
{ "x": 0, "y": 2 },
|
||||
{ "x": 1, "y": 2 },
|
||||
{ "x": 2, "y": 2 },
|
||||
{ "x": 3, "y": 2 },
|
||||
{ "x": 4, "y": 2 },
|
||||
{ "x": 5, "y": 2 },
|
||||
{ "x": 6, "y": 2 },
|
||||
{ "x": 7, "y": 2 },
|
||||
{ "x": 8, "y": 2 },
|
||||
{ "x": 9, "y": 2 },
|
||||
{ "x": 0, "y": 3 },
|
||||
{ "x": 1, "y": 3 },
|
||||
{ "x": 2, "y": 3 },
|
||||
{ "x": 3, "y": 3 },
|
||||
{ "x": 4, "y": 3 },
|
||||
{ "x": 5, "y": 3 },
|
||||
{ "x": 6, "y": 3 },
|
||||
{ "x": 7, "y": 3 },
|
||||
{ "x": 8, "y": 3 },
|
||||
{ "x": 9, "y": 3 }
|
||||
]
|
BIN
res/images/terrainTiles_default.png
Normal file
BIN
res/images/terrainTiles_default.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 35 KiB |
@ -1,9 +1,9 @@
|
||||
var asdf = require("asdf-games");
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { Container, TileSpriteXML, math, Texture, SpriteSheetXML } = asdf;
|
||||
const { Container, TileSpriteXML, math, Texture, SpriteSheetXML, entity } = asdf;
|
||||
|
||||
const texture = new Texture("../res/images/allSprites_default.png");
|
||||
const xml = new SpriteSheetXML("../res/images/allSprites_default.xml");
|
||||
const texture = new Texture("../res/images/onlyObjects_default.png");
|
||||
const xml = new SpriteSheetXML("../res/images/onlyObjects_default.xml");
|
||||
|
||||
// properties = {
|
||||
// type: "",
|
||||
@ -15,35 +15,64 @@ class Object extends TileSpriteXML {
|
||||
constructor(level, pos, properties) {
|
||||
var type;
|
||||
switch (properties.type) {
|
||||
case "crate_metal":
|
||||
case "crateMetal":
|
||||
type = "crateMetal.png";
|
||||
properties.pushable = (properties.pushable == undefined) ? true : properties.pushable;
|
||||
properties.explode = (properties.explode == undefined) ? false : properties.explode;
|
||||
break;
|
||||
case "crate_wood":
|
||||
case "crateWood":
|
||||
type = "crateWood.png";
|
||||
properties.pushable = (properties.pushable == undefined) ? true : properties.pushable;
|
||||
properties.explode = (properties.explode == undefined) ? false : properties.explode;
|
||||
break;
|
||||
case "fence_red":
|
||||
case "fenceRed":
|
||||
type = "fenceRed.png";
|
||||
properties.pushable = (properties.pushable == undefined) ? true : properties.pushable;
|
||||
properties.explode = (properties.explode == undefined) ? false : properties.explode;
|
||||
break;
|
||||
case "fence_yellow":
|
||||
case "fenceYellow":
|
||||
type = "fenceYellow.png";
|
||||
properties.pushable = (properties.pushable == undefined) ? true : properties.pushable;
|
||||
properties.explode = (properties.explode == undefined) ? false : properties.explode;
|
||||
break;
|
||||
case "wireCrooked":
|
||||
type = "wireCrooked.png";
|
||||
properties.pushable = (properties.pushable == undefined) ? false : properties.pushable;
|
||||
properties.explode = (properties.explode == undefined) ? false : properties.explode;
|
||||
break;
|
||||
case "wireStraight":
|
||||
type = "wireStraight.png";
|
||||
properties.pushable = (properties.pushable == undefined) ? false : properties.pushable;
|
||||
properties.explode = (properties.explode == undefined) ? false : properties.explode;
|
||||
break;
|
||||
case "barricadeMetal":
|
||||
type = "barricadeMetal.png";
|
||||
properties.pushable = (properties.pushable == undefined) ? false : properties.pushable;
|
||||
properties.explode = (properties.explode == undefined) ? false : properties.explode;
|
||||
break;
|
||||
case "barricadeWood":
|
||||
type = "barricadeWood.png";
|
||||
properties.pushable = (properties.pushable == undefined) ? true : properties.pushable;
|
||||
properties.explode = (properties.explode == undefined) ? false : properties.explode;
|
||||
break;
|
||||
}
|
||||
|
||||
super(texture, xml, xml.findIndex("name", type));
|
||||
this.level = level;
|
||||
this.pos = pos;
|
||||
this.rotation = properties.rotation || 0;
|
||||
|
||||
this.properties = properties;
|
||||
console.log(this.properties);
|
||||
|
||||
entity.addDebug(this);
|
||||
|
||||
console.log(this.level.players);
|
||||
}
|
||||
|
||||
update(dt, t) {
|
||||
super.update(dt, t);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,8 +2,8 @@ var asdf = require("asdf-games");
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { Container, TileSpriteXML, math, Texture, SpriteSheetXML } = asdf;
|
||||
|
||||
const texture = new Texture("../res/images/allSprites_default.png");
|
||||
const xml = new SpriteSheetXML("../res/images/allSprites_default.xml");
|
||||
const texture = new Texture("../res/images/onlyObjects_default.png");
|
||||
const xml = new SpriteSheetXML("../res/images/onlyObjects_default.xml");
|
||||
|
||||
class Bullet extends TileSpriteXML {
|
||||
constructor(player, type) {
|
||||
@ -130,7 +130,7 @@ class Tank extends TileSpriteXML {
|
||||
}
|
||||
|
||||
// Shoot bullet on action key
|
||||
if (this.keys.action && this.firerate.current >= this.firerate.min && this.bullets.children.length <= this.firerate.maxAmount) {
|
||||
if (this.mouse.isDown && this.firerate.current >= this.firerate.min && this.bullets.children.length <= this.firerate.maxAmount) {
|
||||
var bullet = new Bullet(this, 0);
|
||||
bullet.rotation = this.barrel.rotation;
|
||||
bullet.pos = {
|
||||
|
@ -1,15 +1,22 @@
|
||||
const fs = require("fs");
|
||||
|
||||
const asdf = require("asdf-games");
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { Container, Texture, SpriteSheetXML, TileMapXML } = asdf;
|
||||
const { Container, Texture, TileMap } = asdf;
|
||||
|
||||
const texture = new Texture("../res/images/allSprites_default.png");
|
||||
const xml = new SpriteSheetXML("../res/images/allSprites_default.xml");
|
||||
const texture = new Texture("../res/images/terrainTiles_default.png");
|
||||
const tilemap = JSON.parse(fs.readFileSync("./res/images/terrainTiles_default.json"));
|
||||
|
||||
const Object = require("../entities/Object.js");
|
||||
|
||||
class Level extends TileMapXML {
|
||||
class Level extends TileMap {
|
||||
constructor(level, game, players) {
|
||||
super(level.tileData, Math.ceil(game.w / 64), Math.ceil(game.h / 64), texture, xml);
|
||||
var tileData = [];
|
||||
level.tileData.forEach(value => {
|
||||
tileData.push(tilemap[value]);
|
||||
});
|
||||
|
||||
super(tileData, Math.ceil(game.w / 64), Math.ceil(game.h / 64), 64, 64, texture);
|
||||
this.game = game;
|
||||
this.players = players;
|
||||
|
||||
|
@ -1,25 +1,25 @@
|
||||
{
|
||||
"tileData": [
|
||||
161, 160, 160, 161, 160, 159, 134, 135, 143, 134, 135, 135,
|
||||
161, 160, 160, 161, 161, 159, 135, 134, 143, 135, 135, 134,
|
||||
161, 161, 160, 161, 160, 159, 134, 135, 144, 142, 142, 142,
|
||||
161, 160, 160, 161, 160, 159, 135, 134, 143, 135, 134, 135,
|
||||
161, 160, 161, 161, 160, 159, 134, 135, 143, 134, 135, 135,
|
||||
160, 160, 160, 161, 160, 159, 135, 134, 143, 135, 135, 134,
|
||||
161, 160, 160, 168, 168, 155, 142, 142, 138, 135, 135, 135,
|
||||
160, 160, 160, 161, 160, 159, 135, 134, 134, 135, 134, 135
|
||||
20, 30, 21, 20, 30,8, 0, 10, 1, 0, 10, 10,
|
||||
20, 30, 21, 20, 20,8, 10, 0, 1, 10, 10, 0,
|
||||
20, 20, 21, 20, 30,8, 0, 10, 3, 2, 2, 2,
|
||||
20, 30, 21, 20, 30,8, 10, 0, 1, 10, 0, 10,
|
||||
20, 30, 21, 20, 30,8, 0, 10, 1, 0, 10, 10,
|
||||
30, 30, 21, 20, 30,8, 10, 0, 1, 10, 10, 0,
|
||||
22, 22, 31, 22, 22, 9, 2, 2, 16, 10, 10, 10,
|
||||
30, 30, 21, 20, 30,8, 10, 0, 0, 10, 0, 10
|
||||
],
|
||||
"objects": [
|
||||
{
|
||||
"pos": { "x": 100, "y": 100 },
|
||||
"properties": {
|
||||
"type": "crate_metal"
|
||||
"type": "barricadeWood"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pos": { "x": 100, "y": 100 },
|
||||
"properties": {
|
||||
"type": "fence_yellow",
|
||||
"type": "wireStraight",
|
||||
"rotation": 3
|
||||
}
|
||||
}
|
||||
|
@ -18,15 +18,6 @@ class GameScreen extends Container {
|
||||
|
||||
this.controls.keys.reset();
|
||||
|
||||
// Connect to TanksJS-Server instance
|
||||
this.socket = io("http://localhost:3000");
|
||||
this.socket.on("identify", () => {
|
||||
this.socket.emit("identification", {
|
||||
name: "Arn",
|
||||
gamemode: 2
|
||||
});
|
||||
console.log(`Connected to server as ${this.socket.id}`);
|
||||
});
|
||||
|
||||
// Define tank colours
|
||||
const colours = ["Blue", "Red", "Green", "Sand"];
|
||||
@ -34,23 +25,34 @@ class GameScreen extends Container {
|
||||
// Keep local and external players
|
||||
this.players = {};
|
||||
|
||||
// Draw level
|
||||
var json = fs.readFileSync("./src/levels/default.json");
|
||||
var level = new Level(JSON.parse(json), this.game, this.players);
|
||||
this.add(level);
|
||||
// Connect to TanksJS-Server instance
|
||||
this.socket = io("http://arnweb.nl:3000");
|
||||
this.socket.on("identify", () => {
|
||||
this.socket.emit("identification", {
|
||||
name: "Arn",
|
||||
gamemode: 2
|
||||
});
|
||||
console.log(`Connected to server as ${this.socket.id}`);
|
||||
|
||||
// Define local player
|
||||
this.players[this.socket.id] = new Tank(this.controls.keys, this.controls.mouse, level, colours[Object.keys(this.players).length]);
|
||||
this.player = this.players[this.socket.id];
|
||||
this.add(this.players[this.socket.id]);
|
||||
// Draw level
|
||||
var json = fs.readFileSync("./src/levels/default.json");
|
||||
this.level = new Level(JSON.parse(json), this.game, this.players);
|
||||
this.add(this.level);
|
||||
|
||||
// Define local player
|
||||
this.players[this.socket.id] = new Tank(this.controls.keys, this.controls.mouse, this.level, colours[Object.keys(this.players).length]);
|
||||
this.player = this.players[this.socket.id];
|
||||
this.add(this.players[this.socket.id]);
|
||||
|
||||
// Store current state of controls for comparing
|
||||
this.dataBuffer = JSON.stringify({
|
||||
pos: this.player.pos,
|
||||
rotation: {
|
||||
body: this.player.rotation,
|
||||
barrel: this.player.children[0].rotation
|
||||
}
|
||||
});
|
||||
|
||||
// Store current state of controls for comparing
|
||||
this.dataBuffer = JSON.stringify({
|
||||
pos: this.player.pos,
|
||||
rotation: {
|
||||
body: this.player.rotation,
|
||||
barrel: this.player.children[0].rotation
|
||||
}
|
||||
});
|
||||
|
||||
// Handle player logins
|
||||
@ -58,12 +60,18 @@ class GameScreen extends Container {
|
||||
// Add any player that is not the local player and is not already added
|
||||
for (const id in data) {
|
||||
if (id != this.socket.id && !(this.players[id])) {
|
||||
this.players[id] = new Tank(new KeyControls(false), new MouseControls(false), level, colours[Object.keys(this.players).length], true);
|
||||
this.players[id] = new Tank(new KeyControls(false), new MouseControls(false), this.level, colours[Object.keys(this.players).length], true);
|
||||
this.add(this.players[id]);
|
||||
}
|
||||
}
|
||||
console.log(this.players);
|
||||
// TODO: Remove players who left
|
||||
|
||||
// Remove any player that disconnects from the game
|
||||
for (const id in this.players) {
|
||||
if (data[id] == undefined) {
|
||||
this.remove(this.players[id]);
|
||||
delete this.players[id];
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Handle player updates
|
||||
@ -86,18 +94,20 @@ class GameScreen extends Container {
|
||||
update(dt, t) {
|
||||
super.update(dt, t);
|
||||
|
||||
// Only send when controls are updated and minify data sent
|
||||
var data = {
|
||||
pos: this.player.pos,
|
||||
rotation: {
|
||||
body: this.player.rotation,
|
||||
barrel: this.player.children[0].rotation
|
||||
if (this.player != undefined) {
|
||||
// Only send when controls are updated and minify data sent
|
||||
var data = {
|
||||
pos: this.player.pos,
|
||||
rotation: {
|
||||
body: this.player.rotation,
|
||||
barrel: this.player.children[0].rotation
|
||||
}
|
||||
};
|
||||
if (JSON.stringify(data) != this.dataBuffer) {
|
||||
console.log("Sending updates");
|
||||
this.socket.emit("update", data);
|
||||
this.dataBuffer = JSON.stringify(data);
|
||||
}
|
||||
};
|
||||
if (JSON.stringify(data) != this.dataBuffer) {
|
||||
console.log("Sending updates");
|
||||
this.socket.emit("update", data);
|
||||
this.dataBuffer = JSON.stringify(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user