Merge branch 'master' into ewpratten/object_defs

This commit is contained in:
Evan Pratten 2022-04-02 18:48:20 -04:00
commit 6bfeb8ea60
15 changed files with 412 additions and 91 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -1,42 +1,194 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.8" tiledversion="1.8.4" orientation="orthogonal" renderorder="right-down" width="30" height="20" tilewidth="128" tileheight="128" infinite="1" nextlayerid="2" nextobjectid="1">
<tileset firstgid="1" name="env_beachTile" tilewidth="128" tileheight="128" tilecount="2" columns="0">
<grid orientation="orthogonal" width="1" height="1"/>
<tile id="0">
<properties>
<property name="friction" type="float" value="1"/>
<property name="temperature" type="float" value="10"/>
</properties>
<image width="128" height="128" source="assets/env/env_beachTile/env_beachTile.png"/>
</tile>
<tile id="1">
<properties>
<property name="friction" type="float" value="5"/>
<property name="temperature" type="float" value="1"/>
</properties>
<image width="128" height="128" source="assets/env/env_beachTile/env_beachTileSwirly.png"/>
</tile>
</tileset>
<layer id="1" name="Tile Layer 1" width="30" height="20">
<data encoding="csv">
<chunk x="-16" y="0" width="16" height="16">
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,2,2,1,1,2,2,0,0,0,0,
0,0,0,0,0,0,2,2,1,1,2,2,0,0,0,0,
0,0,0,0,0,0,2,1,0,0,1,2,0,0,0,0,
0,0,0,0,0,0,2,2,1,1,2,2,0,0,0,0,
0,0,0,0,0,0,2,2,1,1,2,2,0,0,0,0,
0,0,0,0,0,0,1,1,2,2,1,1,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
</chunk>
</data>
</layer>
</map>
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.8" tiledversion="1.8.4" orientation="orthogonal" renderorder="right-down" width="38" height="128" tilewidth="128" tileheight="128" infinite="0" nextlayerid="2" nextobjectid="1">
<tileset firstgid="1" name="floorTiles" tilewidth="128" tileheight="128" tilecount="8" columns="0">
<grid orientation="orthogonal" width="1" height="1"/>
<tile id="1">
<properties>
<property name="friction" type="float" value="0.25"/>
<property name="temperature" type="float" value="70"/>
</properties>
<image width="128" height="128" source="assets/env/env_roadTile/env_roadTile.png"/>
</tile>
<tile id="2">
<properties>
<property name="friction" type="float" value="0.9"/>
<property name="temperature" type="float" value="20"/>
</properties>
<image width="128" height="128" source="assets/env/env_pavementTile/env_pavementTile.png"/>
</tile>
<tile id="3">
<properties>
<property name="friction" type="float" value="0.9"/>
<property name="temperature" type="float" value="20"/>
</properties>
<image width="128" height="128" source="assets/env/env_pavementTile/env_pavementTileLine.png"/>
</tile>
<tile id="0">
<properties>
<property name="friction" type="float" value="0.9"/>
<property name="temperature" type="float" value="15"/>
</properties>
<image width="128" height="128" source="assets/env/env_sidewalkTile/env_sidewalkTile.png"/>
</tile>
<tile id="6">
<properties>
<property name="friction" type="float" value="0.6"/>
<property name="temperature" type="float" value="15"/>
</properties>
<image width="128" height="128" source="assets/env/env_beachTile/env_beachTile.png"/>
</tile>
<tile id="7">
<properties>
<property name="friction" type="float" value="0.6"/>
<property name="temperature" type="float" value="5"/>
</properties>
<image width="128" height="128" source="assets/env/env_beachTile/env_beachTileWet.png"/>
</tile>
<tile id="5">
<properties>
<property name="friction" type="float" value="1"/>
<property name="temperature" type="float" value="5"/>
</properties>
<image width="128" height="128" source="assets/env/env_boardwalkTile/env_boardwalkTile.png"/>
</tile>
<tile id="4">
<properties>
<property name="friction" type="float" value="0.5"/>
<property name="temperature" type="float" value="5"/>
</properties>
<image width="128" height="128" source="assets/env/env_grassTile/env_grassTile.png"/>
</tile>
</tileset>
<layer id="1" name="Tile Layer 1" width="38" height="128">
<data encoding="csv">
8,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,
8,8,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,7,1073741829,1073741829,7,1073741829,7,1073741829,1073741829,1,2147483652,3,2147483652,3,2147483652,3,2147483652,3,2147483652,3,2147483652,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,1073741829,1073741829,7,7,7,7,7,7,7,1073741829,1073741829,1073741829,1,2147483652,3,2147483652,3,2147483652,3,2147483652,3,2147483652,3,2147483652,2,2,2,2,2,2,
8,7,7,7,7,7,7,7,7,1073741829,1073741829,7,7,7,7,7,7,1073741829,1073741829,1073741829,1,2147483652,3,2147483652,3,2147483652,3,2147483652,3,2147483652,3,2147483652,2,2,2,2,2,2,
8,7,7,7,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,7,7,7,1073741829,1073741829,1073741829,1073741829,1,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,7,1073741829,1073741829,1073741829,1073741829,1073741829,1,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,6,6,6,6,6,6,6,6,6,6,6,6,1,3,3,2147483652,3,2147483652,3,2147483652,3,2147483652,3,2147483652,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,6,6,6,6,6,6,6,6,6,6,6,6,1,3,3,2147483652,3,2147483652,3,2147483652,3,2147483652,3,2147483652,2,2,2,2,2,2,
8,8,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,3,3,2147483652,3,2147483652,3,2147483652,3,2147483652,3,2147483652,2,2,2,2,2,2,
8,8,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,
8,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,
8,7,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,
8,7,7,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,7,7,1073741829,1,2147483652,3,2147483652,3,2147483652,3,2147483652,3,2147483652,3,2147483652,2,2,2,2,2,2,
8,7,7,7,7,7,7,7,1073741829,1073741829,1073741829,7,1073741829,1073741829,7,7,1073741829,1073741829,1073741829,1073741829,1,2147483652,3,2147483652,3,2147483652,3,2147483652,3,2147483652,3,2147483652,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,7,7,1073741829,7,1073741829,1,2147483652,3,2147483652,3,2147483652,3,2147483652,3,2147483652,3,2147483652,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,7,1073741829,1073741829,7,7,7,7,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,
8,8,8,7,7,7,7,1073741829,1073741829,1073741829,7,1073741829,7,1073741829,1073741829,7,7,7,6,6,6,6,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,8,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,7,7,6,6,6,6,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,7,1073741829,1073741829,1073741829,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,7,7,7,7,7,7,7,1073741829,1073741829,1073741829,7,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1073741829,7,7,7,7,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,7,7,7,7,7,7,7,1073741829,1073741829,7,7,7,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,7,7,1073741829,7,1073741829,1073741829,1073741829,1073741829,1073741829,7,7,7,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,7,7,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,8,7,7,7,7,7,7,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,8,7,7,7,7,7,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,8,7,7,7,7,7,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,8,7,7,7,7,7,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,8,7,7,7,7,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,8,7,7,7,7,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,8,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,8,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1,1,1,1,1,1,1,2,2,2,2,2,2,
8,8,8,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,6,6,6,6,6,6,6,6,6,6,6,6,1,3,3,3,3,3,3,2,2,2,2,2,2,
8,8,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,6,6,6,6,6,6,6,6,6,6,6,6,1,3,3,3,3,3,3,2,2,2,2,2,2,
8,8,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,1,1,1,3,3,3,3,3,3,2,2,2,2,2,2,
8,8,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,6,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,536870916,536870916,536870916,3,3,3,536870916,536870916,536870916,2,2,2,2,2,2,
8,8,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,
8,8,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,7,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,536870916,536870916,536870916,3,3,3,536870916,536870916,536870916,2,2,2,2,2,2,
8,8,8,7,7,7,7,7,7,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,
8,8,8,7,7,7,7,7,7,7,7,6,7,1073741829,1073741829,1073741829,1073741829,7,7,1073741829,1073741829,1073741829,1,536870916,536870916,536870916,3,3,3,536870916,536870916,536870916,2,2,2,2,2,2,
8,8,8,7,7,7,7,7,7,7,7,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,7,1073741829,7,1073741829,1,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,
8,8,8,7,7,7,7,7,7,7,7,7,6,1073741829,1073741829,1073741829,7,1073741829,7,7,1073741829,1073741829,1,536870916,536870916,536870916,3,3,3,536870916,536870916,536870916,2,2,2,2,2,2,
8,8,8,7,7,7,7,7,7,7,7,7,6,1073741829,1073741829,1073741829,1073741829,7,6,6,7,1073741829,1,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,7,7,7,6,6,1073741829,1073741829,1073741829,7,1073741829,6,6,1073741829,1073741829,1,536870916,536870916,536870916,3,3,3,536870916,536870916,536870916,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,7,1073741829,1073741829,6,7,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,7,1073741829,1,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,7,7,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1,536870916,536870916,536870916,3,3,3,536870916,536870916,536870916,2,2,2,2,2,2,
8,7,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,7,6,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,
8,8,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1,536870916,536870916,536870916,3,3,3,536870916,536870916,536870916,2,2,2,2,2,2,
8,8,8,7,7,7,7,1073741829,1073741829,1073741829,1073741829,6,6,6,6,6,6,6,6,6,1073741829,1073741829,1,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,
8,8,8,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,6,6,6,6,6,6,6,1073741829,1073741829,1,536870916,536870916,536870916,3,3,3,536870916,536870916,536870916,2,2,2,2,2,2,
8,8,8,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,
8,8,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,536870916,536870916,536870916,3,3,3,536870916,536870916,536870916,2,2,2,2,2,2,
8,8,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,
8,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,536870916,536870916,536870916,3,3,3,536870916,536870916,536870916,2,2,2,2,2,2,
8,8,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1,1,1,1,1,1,1,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,
8,8,8,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1,536870916,536870916,536870916,3,3,3,3,3,3,3,3,3,536870916,536870916,536870916,2,2,2,2,2,2,
8,8,8,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,
8,8,8,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1,536870916,536870916,536870916,3,3,3,536870916,536870916,536870916,3,3,3,536870916,536870916,536870916,2,2,2,2,2,2,
8,8,8,7,7,7,7,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,
8,8,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1,536870916,536870916,536870916,3,3,3,536870916,536870916,536870916,3,3,3,536870916,536870916,536870916,2,2,2,2,2,2,
8,7,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,
8,7,7,7,7,7,7,7,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1,536870916,536870916,536870916,3,3,3,536870916,536870916,536870916,3,3,3,536870916,536870916,536870916,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,1073741829,1,1,6,6,1,1,1,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,1073741829,1,4,3,4,3,4,3,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,1073741829,1,4,3,4,3,4,3,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,7,1,4,3,4,3,4,3,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,
8,7,7,7,7,7,7,7,7,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,7,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,
8,8,8,7,7,7,7,7,7,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,
8,8,8,7,7,7,7,7,7,1,1,6,6,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,
8,8,8,7,7,7,7,7,7,7,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,7,7,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,7,7,1073741829,1073741829,1073741829,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,7,7,7,7,7,7,7,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,7,1073741829,7,7,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,7,7,7,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,7,7,7,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,8,7,7,7,7,7,7,1073741829,1073741829,6,6,1073741829,7,7,7,7,7,7,7,7,1073741829,6,6,6,6,6,6,6,1073741829,1,2,2,2,2,2,2,
8,8,8,7,7,7,7,7,7,1073741829,1073741829,6,6,1073741829,7,7,7,7,7,7,7,7,1073741829,6,6,6,6,6,6,6,1073741829,1,2,2,2,2,2,2,
8,8,8,7,7,7,7,7,7,1073741829,1073741829,6,6,1073741829,1073741829,7,7,7,7,7,7,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,8,7,7,7,7,7,7,1073741829,1073741829,6,6,1073741829,1073741829,7,7,7,7,7,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,8,7,7,7,7,7,6,6,6,6,6,1073741829,1073741829,7,7,1073741829,7,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,8,7,7,7,7,7,6,6,6,6,6,1073741829,1073741829,7,1073741829,1073741829,1073741829,1073741829,6,6,6,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,8,7,7,7,7,7,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,6,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,7,1073741829,1,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,6,6,6,6,6,1073741829,1073741829,1073741829,1073741829,7,7,7,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,6,6,6,6,6,1073741829,1073741829,1073741829,7,1073741829,7,7,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,7,7,1073741829,7,1073741829,1,2,2,2,2,2,2,
8,7,7,7,7,7,7,7,6,6,1073741829,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,7,7,7,1073741829,1073741829,1,2,2,2,2,2,2,
8,7,7,7,7,7,7,7,6,6,1073741829,7,7,7,7,7,7,1073741829,1073741829,1073741829,6,6,6,6,6,1073741829,7,7,7,1073741829,1073741829,1,2,2,2,2,2,2,
8,7,7,7,7,7,7,7,6,6,1073741829,1073741829,7,7,7,7,7,7,1073741829,1073741829,6,6,6,6,6,1073741829,7,1073741829,7,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,6,6,1073741829,7,7,7,7,7,7,7,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,6,6,1073741829,7,7,7,7,7,7,7,7,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,7,1073741829,1,2,2,2,2,2,2,
8,8,8,7,7,7,7,7,6,6,1073741829,1073741829,1073741829,1073741829,7,1073741829,1073741829,7,7,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,8,7,7,7,7,7,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,8,7,7,7,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,8,7,7,7,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,7,7,7,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,7,7,7,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,1,1,1,1,1,1,1,2,2,2,2,2,2,
8,7,7,7,7,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,7,7,7,1073741829,1,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,7,7,7,7,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,7,7,7,7,1073741829,1,1073741829,7,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,7,7,7,7,7,1073741829,6,6,1073741829,7,7,7,7,7,7,1073741829,1,1073741829,1073741829,7,7,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,7,7,7,7,7,1073741829,6,6,1073741829,1073741829,7,7,7,7,1073741829,1073741829,1,1073741829,1073741829,7,1073741829,7,1073741829,1,2,2,2,2,2,2,
8,8,8,7,7,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,7,7,7,7,1073741829,1073741829,1,1073741829,7,7,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,8,7,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,7,7,7,7,1073741829,1073741829,1,1073741829,1073741829,7,7,7,7,1,2,2,2,2,2,2,
8,8,8,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,7,7,1073741829,1073741829,1,7,1073741829,7,1073741829,7,1073741829,1,2,2,2,2,2,2,
8,8,8,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,1073741829,1073741829,1073741829,7,7,1073741829,1,2,2,2,2,2,2,
8,8,7,7,7,7,7,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,1073741829,1073741829,7,1073741829,7,1073741829,1,2,2,2,2,2,2,
8,8,7,7,7,7,7,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,1,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,7,7,7,7,7,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,1,1,1,1,1,1,1,1,2,2,2,2,2,2,
8,8,7,7,7,7,7,6,6,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,1,1,1,1,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,7,7,7,7,7,6,6,1073741829,1073741829,1073741829,1073741829,7,1073741829,1073741829,1073741829,1073741829,1073741829,7,1,1,1,1,1,1073741829,1073741829,1073741829,7,7,1073741829,1,2,2,2,2,2,2,
8,7,7,7,7,7,7,6,6,1073741829,7,1073741829,7,1073741829,7,1073741829,1073741829,1073741829,1073741829,7,1,1,1,1,1,1073741829,1073741829,7,7,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,7,7,7,7,7,6,6,1073741829,1073741829,7,7,7,7,1073741829,7,1073741829,1073741829,1073741829,1,1,1,1,1,1073741829,7,1073741829,7,7,7,1,2,2,2,2,2,2,
8,8,8,7,7,7,7,6,6,1073741829,7,7,7,7,7,7,7,7,1073741829,1073741829,1,1,1,1,1,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,2,2,2,2,2,2,
8,8,8,7,7,7,7,6,6,1073741829,7,7,7,7,7,7,1073741829,1073741829,1073741829,7,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,
8,8,8,7,7,7,7,6,6,1073741829,7,7,7,7,7,7,7,7,7,7,1,1,1,1,1,1073741829,1073741829,1073741829,1073741829,1073741829,7,1,2,2,2,2,2,2,
8,8,8,7,7,7,7,6,6,1073741829,7,1073741829,1073741829,1073741829,7,7,1073741829,7,1073741829,1073741829,1,1,1,1,1,1073741829,1073741829,1073741829,7,7,1073741829,1,2,2,2,2,2,2,
8,8,7,7,7,7,7,6,6,1073741829,1073741829,1073741829,7,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1,1,1,1,1,1073741829,1073741829,1073741829,7,1073741829,7,1,2,2,2,2,2,2,
8,8,7,7,7,7,7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,
8,7,7,7,7,7,7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2
</data>
</layer>
</map>

View File

@ -5,6 +5,7 @@
720
],
"target_fps": 60,
"tile_size": 128,
"discord": {
"app_id": 954413081918857276,
"artwork": {
@ -15,5 +16,11 @@
"details.sm_failure": "Game went FUBAR",
"details.main_menu": "In the main menu"
}
},
"player": {
"max_velocity": 3,
"acceleration": 2,
"deceleration": 1,
"start_size": 0.8
}
}
}

View File

@ -5,6 +5,7 @@ use nalgebra as na;
pub struct Player {
pub position: na::Vector2<f32>,
pub velocity: na::Vector2<f32>,
pub size: f32,
}
impl Player {
@ -14,7 +15,8 @@ impl Player {
Self {
position,
velocity: na::Vector2::zeros(),
size: 1.0,
}
}
}
}

View File

@ -28,6 +28,23 @@ pub struct DiscordConstants {
pub strings: HashMap<String, String>,
}
/// Constants relating to the Player
#[derive(Debug, Deserialize)]
pub struct PlayerConstants {
/// Maximum velocity, tiles per second
pub max_velocity: u32,
/// Acceleration, tiles per second per second
pub acceleration: u32,
/// Deceleration, tiles per second per second
pub deceleration: u32,
/// Starting size of player in tiles
pub start_size: f32,
}
/// This structure is filled with the contents of `dist/project-constants.json` at runtime
#[derive(Debug, Deserialize)]
pub struct ProjectConstants {
@ -40,6 +57,12 @@ pub struct ProjectConstants {
/// The Discord constants
pub discord: DiscordConstants,
/// The Player constants
pub player: PlayerConstants,
/// The target framerate of the game
pub target_fps: u32,
/// The size of the game tiles
pub tile_size: u32,
}

View File

@ -90,7 +90,7 @@ impl MainMenu {
//Insides while make a lil shade for it to look cool
draw.draw_text("Start Game", 103, 191, 34, Color::GRAY);
draw.draw_text("Start Game", 100, 190, 34, Color::BLACK);
if draw.is_mouse_button_down(MouseButton::MOUSE_LEFT_BUTTON) {
if draw.is_mouse_button_pressed(MouseButton::MOUSE_LEFT_BUTTON) {
return MenuStateSignal::StartGame;
}
}
@ -98,7 +98,7 @@ impl MainMenu {
if mouse_x >= 100 && mouse_y >= 250 && mouse_x <= 222 && mouse_y <= 275 {
draw.draw_text("Options", 103, 251, 34, Color::GRAY);
draw.draw_text("Options", 100, 250, 34, Color::BLACK);
if draw.is_mouse_button_down(MouseButton::MOUSE_LEFT_BUTTON) {
if draw.is_mouse_button_pressed(MouseButton::MOUSE_LEFT_BUTTON) {
return MenuStateSignal::DoOptions;
}
}
@ -106,14 +106,14 @@ impl MainMenu {
if mouse_x >= 100 && mouse_y >= 410 && mouse_x <= 222 && mouse_y <= 437 {
draw.draw_text("Credits", 103, 411, 34, Color::GRAY);
draw.draw_text("Credits", 100, 410, 34, Color::BLACK);
if draw.is_mouse_button_down(MouseButton::MOUSE_LEFT_BUTTON) {
if draw.is_mouse_button_pressed(MouseButton::MOUSE_LEFT_BUTTON) {
return MenuStateSignal::DoCredits;
}
}
if mouse_x >= 100 && mouse_y >= 470 && mouse_x <= 316 && mouse_y <= 496 {
draw.draw_text("Leaderboard", 103, 471, 34, Color::GRAY);
draw.draw_text("Leaderboard", 100, 470, 34, Color::BLACK);
if draw.is_mouse_button_down(MouseButton::MOUSE_LEFT_BUTTON) {
if draw.is_mouse_button_pressed(MouseButton::MOUSE_LEFT_BUTTON) {
return MenuStateSignal::DoLeaderboard;
}
}
@ -121,7 +121,7 @@ impl MainMenu {
if mouse_x >= 100 && mouse_y >= 300 && mouse_x <= 215 && mouse_y <= 330 {
draw.draw_text("Volume", 103, 301, 34, Color::GRAY);
draw.draw_text("Volume", 100, 300, 34, Color::BLACK);
if draw.is_mouse_button_down(MouseButton::MOUSE_LEFT_BUTTON) {
if draw.is_mouse_button_pressed(MouseButton::MOUSE_LEFT_BUTTON) {
//Function for Volume here
}
}
@ -130,6 +130,9 @@ impl MainMenu {
if mouse_x >= 100 && mouse_y >= 550 && mouse_x <= 162 && mouse_y <= 575 {
draw.draw_text("Exit", 103, 551, 34, Color::GRAY);
draw.draw_text("Exit", 100, 550, 34, Color::BLACK);
if draw.is_mouse_button_pressed(MouseButton::MOUSE_LEFT_BUTTON) {
return MenuStateSignal::QuitGame;
}
}
@ -161,16 +164,22 @@ impl MainMenu {
//Top Label
draw.draw_text("Options", 25, 30, 55, Color::BLACK);
//Return Button
draw.draw_text("Return", 100, 550, 34, Color::BLACK);
if mouse_x >= 100 && mouse_y >= 550 && mouse_x <= 216 && mouse_y <= 576 {
draw.draw_text("Return", 103, 551, 34, Color::GRAY);
draw.draw_text("Return", 100, 550, 34, Color::BLACK);
//Window size storing variables
let window_height = draw.get_screen_height();
let window_width = draw.get_screen_width();
//Return button variables
let button_pos_x = 100; //116 Wide
let button_pos_y = window_height - (window_height/5); //26 height
draw.draw_text("Return", button_pos_x, button_pos_y, 34, Color::BLACK);
if mouse_x >= 100 && mouse_y >= button_pos_y && mouse_x <= 216 && mouse_y <= (window_height - (window_height/5)) + 26 {
draw.draw_text("Return", button_pos_x + 3, button_pos_y + 1, 34, Color::GRAY);
draw.draw_text("Return", button_pos_x, button_pos_y, 34, Color::BLACK);
if draw.is_mouse_button_down(MouseButton::MOUSE_LEFT_BUTTON) {
return MenuStateSignal::DoMainMenu; //Goes back to main menu
}
}
return MenuStateSignal::DoOptions;
}
@ -192,28 +201,31 @@ impl MainMenu {
draw.draw_text(&mouse_y.to_string(), 70, 5, 20, Color::BLACK);
//Screen Size
// let window_height = draw.get_screen_height();
let window_height = draw.get_screen_height();
let window_width = draw.get_screen_width();
draw.draw_text("Credits", (window_width/2) - 100, 30, 55, Color::BLACK);
draw.draw_text("Carter Tomlenovich", (window_width/2) - 170, 280, 40, Color::DARKBLUE);
draw.draw_text("Emilia Firas", (window_width/2) - 170, 120, 40, Color::DARKBLUE);
draw.draw_text("Emmet Logue", (window_width/2) - 170, 320, 40, Color::DARKBLUE);
draw.draw_text("Evan Pratten", (window_width/2) - 170, 160, 40, Color::DARKBLUE);
draw.draw_text("James Nickoli", (window_width/2) - 170, 240, 40, Color::DARKBLUE);
draw.draw_text("Marcelo Geldres", (window_width/2) - 170, 440, 40, Color::DARKBLUE);
draw.draw_text("Percy", (window_width/2) - 170, 400, 40, Color::DARKBLUE);
draw.draw_text("Silas Bartha", (window_width/2) - 170, 200, 40, Color::DARKBLUE);
draw.draw_text("Taya Armstrong", (window_width/2) - 170, 360, 40, Color::DARKBLUE);
draw.draw_text("Carter Tomlenovich", (window_width/2) - 170, 120, 40, Color::DARKBLUE);
draw.draw_text("Emilia Firas", (window_width/2) - 170, 160, 40, Color::DARKBLUE);
draw.draw_text("Emmet Logue", (window_width/2) - 170, 200, 40, Color::DARKBLUE);
draw.draw_text("Evan Pratten", (window_width/2) - 170, 240, 40, Color::DARKBLUE);
draw.draw_text("James Nickoli", (window_width/2) - 170, 280, 40, Color::DARKBLUE);
draw.draw_text("Marcelo Geldres", (window_width/2) - 170, 320, 40, Color::DARKBLUE);
draw.draw_text("Percy", (window_width/2) - 170, 360, 40, Color::DARKBLUE);
draw.draw_text("Silas Bartha", (window_width/2) - 170, 400, 40, Color::DARKBLUE);
draw.draw_text("Taya Armstrong", (window_width/2) - 170, 440, 40, Color::DARKBLUE);
//Return Button
draw.draw_text("Return", 100, 550, 34, Color::BLACK);
if mouse_x >= 100 && mouse_y >= 550 && mouse_x <= 216 && mouse_y <= 576 {
draw.draw_text("Return", 103, 551, 34, Color::GRAY);
draw.draw_text("Return", 100, 550, 34, Color::BLACK);
//Return button variables
let button_pos_x = 100; //116 Wide
let button_pos_y = window_height - (window_height/5); //26 height
draw.draw_text("Return", button_pos_x, button_pos_y, 34, Color::BLACK);
if mouse_x >= 100 && mouse_y >= button_pos_y && mouse_x <= 216 && mouse_y <= (window_height - (window_height/5)) + 26 {
draw.draw_text("Return", button_pos_x + 3, button_pos_y + 1, 34, Color::GRAY);
draw.draw_text("Return", button_pos_x, button_pos_y, 34, Color::BLACK);
if draw.is_mouse_button_down(MouseButton::MOUSE_LEFT_BUTTON) {
return MenuStateSignal::DoMainMenu;
return MenuStateSignal::DoMainMenu; //Goes back to main menu
}
}
@ -234,6 +246,10 @@ impl MainMenu {
let mouse_x = draw.get_mouse_x();
let mouse_y = draw.get_mouse_y();
//Window size storing variables
let window_height = draw.get_screen_height();
let window_width = draw.get_screen_width();
//Show mouse position
draw.draw_text(&mouse_x.to_string(), 20, 5, 20, Color::BLACK);
draw.draw_text(&mouse_y.to_string(), 70, 5, 20, Color::BLACK);
@ -241,13 +257,16 @@ impl MainMenu {
let window_width = draw.get_screen_width();
draw.draw_text("Leaderboard", (window_width/2) - 176, 30, 55, Color::BLACK);
//Return Button
draw.draw_text("Return", 100, 550, 34, Color::BLACK);
if mouse_x >= 100 && mouse_y >= 550 && mouse_x <= 216 && mouse_y <= 576 {
draw.draw_text("Return", 103, 551, 34, Color::GRAY);
draw.draw_text("Return", 100, 550, 34, Color::BLACK);
//Return button variables
let button_pos_x = 100; //116 Wide
let button_pos_y = window_height - (window_height/5); //26 height
draw.draw_text("Return", button_pos_x, button_pos_y, 34, Color::BLACK);
if mouse_x >= 100 && mouse_y >= button_pos_y && mouse_x <= 216 && mouse_y <= (window_height - (window_height/5)) + 26 {
draw.draw_text("Return", button_pos_x + 3, button_pos_y + 1, 34, Color::GRAY);
draw.draw_text("Return", button_pos_x, button_pos_y, 34, Color::BLACK);
if draw.is_mouse_button_down(MouseButton::MOUSE_LEFT_BUTTON) {
return MenuStateSignal::DoMainMenu;
return MenuStateSignal::DoMainMenu; //Goes back to main menu
}
}

View File

@ -65,13 +65,11 @@ impl SceneRenderDelegate {
// Render the main menu if in it, otherwise, render the game
match self.menu_control_signal {
MenuStateSignal::StartGame => {
// self.scene_playable
// .render_frame(raylib, rl_thread, &discord, global_resources, constants)
// .await;
// TODO: remove this test scene
self.scene_test_fox
.render_frame(raylib, rl_thread, &discord, global_resources)
self.scene_playable
.render_frame(raylib, rl_thread, &discord, global_resources, constants)
.await;
self.scene_playable
.update_physics(raylib, constants)
.await;
}
MenuStateSignal::QuitGame => unimplemented!(),

View File

@ -2,39 +2,60 @@
use nalgebra as na;
use raylib::prelude::*;
use std::time::SystemTime;
use crate::{
discord::{DiscordChannel, DiscordRpcSignal},
global_resource_package::GlobalResources,
model::player::Player,
project_constants::ProjectConstants,
rendering::utilities::anim_texture::AnimatedTexture,
rendering::utilities::{anim_texture::AnimatedTexture, map_render::MapRenderer},
};
#[derive(Debug)]
pub struct PlayableScene {
has_updated_discord_rpc: bool,
player: Player,
world_map: MapRenderer,
camera: raylib::camera::Camera2D,
last_update: SystemTime,
}
impl PlayableScene {
/// Construct a new `PlayableScene`
pub fn new(
raylib_handle: &mut RaylibHandle,
thread: &RaylibThread,
raylib_handle: &mut raylib::RaylibHandle,
thread: & raylib::RaylibThread,
constants: &ProjectConstants,
) -> Self {
let map_renderer = MapRenderer::new("map_gameMap.tmx", raylib_handle, thread).unwrap();
Self {
has_updated_discord_rpc: false,
player: Player::new(na::Vector2::new(10.0, 10.0)),
world_map: map_renderer,
camera: raylib::camera::Camera2D {
target: raylib::math::Vector2 {
x: 0.0,
y: 0.0,
},
offset: raylib::math::Vector2 {
x: (constants.base_window_size.0 as f32 / 2.0),
y: (constants.base_window_size.1 as f32 / 2.0)
},
rotation: 0.0,
zoom: 1.0
},
last_update: SystemTime::UNIX_EPOCH
}
}
/// Handler for each frame
pub async fn render_frame(
&mut self,
raylib: &mut RaylibHandle,
rl_thread: &RaylibThread,
raylib: &mut raylib::RaylibHandle,
rl_thread: &raylib::RaylibThread,
discord: &DiscordChannel,
global_resources: &GlobalResources,
constants: &ProjectConstants,
@ -60,8 +81,107 @@ impl PlayableScene {
// Clear the screen
draw.clear_background(Color::WHITE);
self.draw_world(&mut draw, constants);
// TODO: Render stuff
// self.player. <whatever>
self.draw_ui(&mut draw, constants);
}
pub fn draw_world(
&mut self,
draw: &mut RaylibDrawHandle,
constants: &ProjectConstants,
) {
// Begin camera mode
let mut ctx2d = draw.begin_mode2D(self.camera);
// Render the map
self.world_map.render_map(&mut ctx2d, &self.camera, true);
let player_size = (constants.tile_size as f32 * constants.player.start_size * self.player.size) as i32;
ctx2d.draw_rectangle(
self.player.position[0] as i32 - player_size / 2,
self.player.position[1] as i32 * -1 - player_size / 2,
player_size,
player_size,
Color::LIGHTBLUE
);
}
pub fn draw_ui(
&mut self,
draw: &mut RaylibDrawHandle,
constants: &ProjectConstants,
) {
draw.draw_rectangle(
draw.get_screen_width() / 2 - 225, 0,
450, 40,
Color::WHITE
);
draw.draw_text(
"Unregistered HyperCam 2",
draw.get_screen_width() / 2 - 215, 0,
32, Color::BLACK
);
}
// Physics
pub async fn update_physics(
&mut self,
raylib: & raylib::RaylibHandle,
constants: &ProjectConstants,
) {
// Get time since last physics update
let time = SystemTime::now();
let elapsed = time.duration_since(self.last_update).expect("Time Appears to Have Moved Backwards!");
self.last_update = time;
let delta_time = elapsed.as_millis() as f32 / 1000.0; // Physics will be scaled by this value
let player = &mut self.player;
// Get input direction components
let h_axis = raylib.is_key_down(KeyboardKey::KEY_D) as i8 - raylib.is_key_down(KeyboardKey::KEY_A) as i8;
let v_axis = raylib.is_key_down(KeyboardKey::KEY_W) as i8 - raylib.is_key_down(KeyboardKey::KEY_S) as i8;
if h_axis != 0 || v_axis != 0 {
// Normalize input and accelerate in desired direction
let direction = na::Vector2::new(h_axis as f32, v_axis as f32).normalize();
player.velocity += &direction.xy()
* constants.player.acceleration as f32
* constants.tile_size as f32
* delta_time;
}
if player.velocity.magnitude() != 0.0 {
player.velocity -= player.velocity.normalize()
* constants.player.deceleration as f32
* constants.tile_size as f32
* delta_time;
if player.velocity.magnitude() < 1.0 {
player.velocity.set_magnitude(0.0);
}
}
if ((constants.player.max_velocity * constants.tile_size) as f32)
< player.velocity.magnitude() {
player.velocity.set_magnitude((constants.player.max_velocity * constants.tile_size) as f32);
}
player.position += &player.velocity * delta_time;
self.update_camera(raylib);
}
pub fn update_camera(
&mut self,
raylib: & raylib::RaylibHandle,
) {
self.camera.target = self.player.position.into();
self.camera.target.y *= -1.0;
self.camera.offset.x = raylib.get_screen_width() as f32 / 2.0;
self.camera.offset.y = raylib.get_screen_height() as f32 / 2.0;
}
}