Example prototype for monster spawning management added in 1-1.

pull/28/head
sigonasr2 1 year ago
parent 6b81cd6e84
commit 85af67fa60
  1. 68
      Crawler/Crawler.tiled-project
  2. 2
      Crawler/Pathfinding.cpp
  3. 44
      Crawler/assets/Campaigns/1_1.tmx

@ -98,6 +98,11 @@
"propertyType": "MonsterName",
"type": "int",
"value": 0
},
{
"name": "spawner",
"type": "object",
"value": 0
}
],
"name": "Monster",
@ -140,69 +145,6 @@
"drawFill": true,
"id": 2,
"members": [
{
"name": "Monster1",
"propertyType": "Monster",
"type": "class",
"value": {
}
},
{
"name": "Monster2",
"propertyType": "Monster",
"type": "class",
"value": {
}
},
{
"name": "Monster3",
"propertyType": "Monster",
"type": "class",
"value": {
}
},
{
"name": "Monster4",
"propertyType": "Monster",
"type": "class",
"value": {
}
},
{
"name": "Monster5",
"propertyType": "Monster",
"type": "class",
"value": {
}
},
{
"name": "Monster6",
"propertyType": "Monster",
"type": "class",
"value": {
}
},
{
"name": "Monster7",
"propertyType": "Monster",
"type": "class",
"value": {
}
},
{
"name": "Monster8",
"propertyType": "Monster",
"type": "class",
"value": {
}
},
{
"name": "Monster9",
"propertyType": "Monster",
"type": "class",
"value": {
}
}
],
"name": "SpawnGroup",
"type": "class",

@ -40,7 +40,7 @@ void Pathfinding::Initialize(){
nodes[y*game->WORLD_SIZE.x + x].vecNeighbours.push_back(&nodes[(y + 1) * game->WORLD_SIZE.x + (x + 1)]);
}
// Manually positio the start and end markers so they are not nullptr
// Manually position the start and end markers so they are not nullptr
nodeStart = &nodes[(game->WORLD_SIZE.y / 2) * game->WORLD_SIZE.x + 1];
nodeEnd = &nodes[(game->WORLD_SIZE.y / 2) * game->WORLD_SIZE.x + game->WORLD_SIZE.x-2];
}

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.10.1" orientation="orthogonal" renderorder="right-down" width="64" height="64" tilewidth="24" tileheight="24" infinite="1" nextlayerid="5" nextobjectid="33">
<map version="1.10" tiledversion="1.10.1" orientation="orthogonal" renderorder="right-down" width="64" height="64" tilewidth="24" tileheight="24" infinite="1" nextlayerid="5" nextobjectid="40">
<tileset firstgid="1" source="../maps/grass_tiles_24x24.tsx"/>
<tileset firstgid="784" source="../maps/grass_tiles_modded.tsx"/>
<layer id="1" name="Layer 1" width="64" height="64">
@ -3956,5 +3956,47 @@
<ellipse/>
</object>
<object id="32" name="Spawn Group 19" type="SpawnGroup" x="3473.33" y="-2041.33" width="320" height="376"/>
<object id="33" name="Green Slime" type="Monster" x="396" y="-168">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="spawner" type="object" value="5"/>
</properties>
<point/>
</object>
<object id="34" name="Blue Slime" type="Monster" x="684" y="-150">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="2"/>
<property name="spawner" type="object" value="5"/>
</properties>
<point/>
</object>
<object id="35" name="Yellow Slime" type="Monster" x="474" y="36">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="4"/>
<property name="spawner" type="object" value="5"/>
</properties>
<point/>
</object>
<object id="37" name="Blue Slime" type="Monster" x="756" y="102">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="2"/>
<property name="spawner" type="object" value="5"/>
</properties>
<point/>
</object>
<object id="38" name="Green Slime" type="Monster" x="342" y="-144">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="spawner" type="object" value="5"/>
</properties>
<point/>
</object>
<object id="39" name="Green Slime" type="Monster" x="420" y="-108">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="spawner" type="object" value="5"/>
</properties>
<point/>
</object>
</objectgroup>
</map>

Loading…
Cancel
Save