diff --git a/lib/Canvas.cpp b/lib/Canvas.cpp index 8985e24..eefb371 100644 --- a/lib/Canvas.cpp +++ b/lib/Canvas.cpp @@ -84,7 +84,7 @@ void Canvas::renderScore(int score) { window.draw(text); } -Rect Canvas::windowDimensions() const { +Rect Canvas::windowDimensions() { return { 0, 0, LEFT_MARGIN + MAZE_WIDTH + SCORE_WIDTH, TOP_MARGIN + MAZE_HEIGHT + BOTTOM_MARGIN }; } diff --git a/lib/Canvas.hpp b/lib/Canvas.hpp index 0ced7a0..5ccf394 100644 --- a/lib/Canvas.hpp +++ b/lib/Canvas.hpp @@ -33,10 +33,9 @@ private: void renderScore(int score); - Rect windowDimensions() const; - - sf::Texture loadTexture(std::string_view path); - sf::Font loadFont(std::string_view path); + static Rect windowDimensions() ; + static sf::Texture loadTexture(std::string_view path); + static sf::Font loadFont(std::string_view path); Sprite getSprite(PositionInt rect) const; diff --git a/lib/PacMan.cpp b/lib/PacMan.cpp index 3cb1eff..6701297 100644 --- a/lib/PacMan.cpp +++ b/lib/PacMan.cpp @@ -2,7 +2,7 @@ #include PacMan::PacMan(const Board & board) - : pos(board.initialPacManPosition()) {} + : pos(Board::initialPacManPosition()) {} PositionInt PacMan::currentSprite() const { return pacManAnimation.animationFrame(direction); diff --git a/lib/SuperPellets.hpp b/lib/SuperPellets.hpp index bda304f..343241e 100644 --- a/lib/SuperPellets.hpp +++ b/lib/SuperPellets.hpp @@ -2,6 +2,7 @@ #include "Board.hpp" #include "Position.hpp" + class SuperPellets { public: explicit SuperPellets(const Board & board);