Implemented reading spawn zones on maps. Monsters now spawn according to spawn zones.

This commit is contained in:
2023-07-07 21:35:44 -05:00
parent 9a2af45245
commit 57d7f3344b
6 changed files with 141 additions and 81 deletions
+1 -1
View File
@@ -392,7 +392,7 @@ Key Player::GetFacingDirection(){
void Player::Moved(){
for(MonsterSpawner&spawner:SPAWNER_LIST){
if(!spawner.SpawnTriggered()&&geom2d::contains(geom2d::ellipse<float>{spawner.GetPos(),spawner.GetRange()},pos)){
if(!spawner.SpawnTriggered()&&geom2d::contains(geom2d::rect<float>{spawner.GetPos(),spawner.GetRange()},pos)){
spawner.SetTriggered(true);
}
}