From 3bc58b12a69b0bdc5187b022c439e972aa58e1b7 Mon Sep 17 00:00:00 2001 From: Persson-dev Date: Sun, 19 Sep 2021 18:15:36 +0200 Subject: [PATCH] feat: add tower ticks --- include/game/World.h | 2 ++ src/game/World.cpp | 3 +++ 2 files changed, 5 insertions(+) diff --git a/include/game/World.h b/include/game/World.h index 316afa9..d78503b 100644 --- a/include/game/World.h +++ b/include/game/World.h @@ -124,6 +124,8 @@ protected: MobList m_Mobs; + std::vector m_Towers; + Game* m_Game; public: World(Game* game); diff --git a/src/game/World.cpp b/src/game/World.cpp index d5b1d05..3938abe 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -321,6 +321,9 @@ bool World::saveMap(const std::string& fileName) const { void World::tick(std::uint64_t delta) { moveMobs(delta); + for(Tower& tower : m_Towers){ + tower.tick(delta); + } } void World::spawnMobAt(MobID id, MobType type, std::uint8_t level, PlayerID sender, float x, float y, Direction dir) {