From 85af67fa604ccf3587b9b4303bc0c406dc4696f9 Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Fri, 7 Jul 2023 06:48:17 -0500 Subject: [PATCH] Example prototype for monster spawning management added in 1-1. --- Crawler/Crawler.tiled-project | 68 +++----------------------------- Crawler/Pathfinding.cpp | 2 +- Crawler/assets/Campaigns/1_1.tmx | 44 ++++++++++++++++++++- 3 files changed, 49 insertions(+), 65 deletions(-) diff --git a/Crawler/Crawler.tiled-project b/Crawler/Crawler.tiled-project index ad3085de..517e35d1 100644 --- a/Crawler/Crawler.tiled-project +++ b/Crawler/Crawler.tiled-project @@ -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", diff --git a/Crawler/Pathfinding.cpp b/Crawler/Pathfinding.cpp index 30d53615..8ced2246 100644 --- a/Crawler/Pathfinding.cpp +++ b/Crawler/Pathfinding.cpp @@ -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]; } diff --git a/Crawler/assets/Campaigns/1_1.tmx b/Crawler/assets/Campaigns/1_1.tmx index b17606e9..f0fb4494 100644 --- a/Crawler/assets/Campaigns/1_1.tmx +++ b/Crawler/assets/Campaigns/1_1.tmx @@ -1,5 +1,5 @@ - + @@ -3956,5 +3956,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +