world_generator/queued/DungeonStartRoom.cpp

23 lines
897 B
C++
Raw Normal View History

2019-04-20 14:51:33 +02:00
#include "DungeonStartRoom.h"
namespace BS {
2020-01-09 04:28:08 +01:00
namespace Levels {
namespace Generator {
DungeonStartRoom::DungeonStartRoom(int x, int y, int width, int height) :
DungeonRoom(x, y, 8, 8) {
}
void DungeonStartRoom::GenerateSpawnPoint(GameObject *startPositionPrefab) {
bool flag = false;
while (!flag) {
int num = DungeonRoom::getX() + UnityEngine::Random::Range(1, DungeonRoom::getWidth() - 2);
int num2 = DungeonRoom::getY() + UnityEngine::Random::Range(1, DungeonRoom::getHeight() - 2);
flag = true;
UnityEngine::Object::Instantiate<GameObject>(startPositionPrefab, Vector3::zero, Quaternion::identity)->transform->position = new Vector3((float)(num)*Voxelizzer::world->voxelScale, Voxelizzer::world->voxelScale, (float)(num2)*Voxelizzer::world->voxelScale);
2019-04-20 14:51:33 +02:00
}
}
2020-01-09 04:28:08 +01:00
void DungeonStartRoom::GenerateAIPlayers(int level) {
}
} // namespace Generator
} // namespace Levels
} // namespace BS