feat: place towers
This commit is contained in:
@@ -299,7 +299,7 @@ bool World::loadMapFromFile(const std::string& fileName) {
|
||||
m_Chunks.insert({ {3, 0}, std::make_shared<Chunk>(chunk11) });
|
||||
m_Chunks.insert({ {3, 1}, std::make_shared<Chunk>(chunk21) });
|
||||
|
||||
return saveMap("tdmap_linux.tdmap");
|
||||
return saveMap("tdmap_debug.tdmap");
|
||||
#endif
|
||||
|
||||
}
|
||||
@@ -334,6 +334,11 @@ void World::spawnMobAt(MobID id, MobType type, std::uint8_t level, PlayerID send
|
||||
m_Mobs.push_back(mob);
|
||||
}
|
||||
|
||||
void World::placeTowerAt(TowerType type, std::int32_t x, std::int32_t y, PlayerID builder) {
|
||||
TowerPtr tower = TowerFactory::createTower(type, x, y, builder);
|
||||
m_Towers.push_back(tower);
|
||||
}
|
||||
|
||||
void World::moveMobs(std::uint64_t delta) {
|
||||
for (MobPtr mob : m_Mobs) {
|
||||
TilePtr tile = getTile(mob->getX(), mob->getY());
|
||||
|
||||
Reference in New Issue
Block a user