From c57ae8c42c1f2f2ed576719c00cff5cf613fe650 Mon Sep 17 00:00:00 2001 From: Steph Enders Date: Thu, 16 Jun 2022 16:14:18 -0400 Subject: Added onUpdate logic to move the enemies etc Created some algorithm logic for enemy movement Allowed for default overrides --- src/Level.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/Level.h') diff --git a/src/Level.h b/src/Level.h index 1607f0c..7791ab6 100644 --- a/src/Level.h +++ b/src/Level.h @@ -12,30 +12,32 @@ static const char WALL_SPACE = '#'; #include #include -struct Pos -{ +struct Pos { int id; int x; int y; } typedef Coord; -class Level -{ +class Level { public: - void loadLevelFromFile(const char* filePath); + void loadLevelFromFile(const char *filePath); bool isEmpty(int x, int y); - bool canStep(int dx, int dy); + bool playerCanStep(int dx, int dy); + + int getEnemyIndex(int id); + + bool enemyCanStep(Pos pos, int dx, int dy); void print(); int nextId(); - std::vector> map; Pos player; std::vector enemyPositions; + std::vector treasurePositions; private: -- cgit v1.2.3-54-g00ecf