diff options
author | Steph Enders <smenders@gmail.com> | 2022-06-16 16:14:18 -0400 |
---|---|---|
committer | Steph Enders <smenders@gmail.com> | 2022-06-16 16:16:34 -0400 |
commit | c57ae8c42c1f2f2ed576719c00cff5cf613fe650 (patch) | |
tree | 0e0c6533b099edbe2c283a8961b1b240d29ad904 /src/Level.h | |
parent | 750b308d70cf1c903812316deeb0a8c4befa37ce (diff) |
Added onUpdate logic to move the enemies etc
Created some algorithm logic for enemy movement
Allowed for default overrides
Diffstat (limited to 'src/Level.h')
-rw-r--r-- | src/Level.h | 16 |
1 files changed, 9 insertions, 7 deletions
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 <memory> #include <vector> -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<std::vector<char>> map; Pos player; std::vector<Pos> enemyPositions; + std::vector<Pos> treasurePositions; private: |