diff --git a/lib/Canvas.cpp b/lib/Canvas.cpp index e61cd49..db365c3 100644 --- a/lib/Canvas.cpp +++ b/lib/Canvas.cpp @@ -38,7 +38,7 @@ void Canvas::update(const GameState & gameState, const Score & score) { renderSuperPellets(gameState.superPellets); renderGhost(gameState.blinky); - renderGhost(gameState.speedy); + renderGhost(gameState.pinky); renderGhost(gameState.inky); renderGhost(gameState.clyde); diff --git a/lib/Game.cpp b/lib/Game.cpp index 5910c81..aac710e 100644 --- a/lib/Game.cpp +++ b/lib/Game.cpp @@ -53,7 +53,7 @@ void Game::handleDeathAnimation(std::chrono::milliseconds delta) { if (timeSinceDeath.count() > 1000) { gameState.blinky.reset(); - gameState.speedy.reset(); + gameState.pinky.reset(); gameState.inky.reset(); gameState.clyde.reset(); gameState.pacMan.reset(); @@ -74,12 +74,12 @@ void Game::step(std::chrono::milliseconds delta, InputState inputState) { return; gameState.blinky.update(delta); - gameState.speedy.update(delta); + gameState.pinky.update(delta); gameState.inky.update(delta); gameState.clyde.update(delta); checkCollision(gameState.blinky); - checkCollision(gameState.speedy); + checkCollision(gameState.pinky); checkCollision(gameState.inky); checkCollision(gameState.clyde); @@ -87,7 +87,7 @@ void Game::step(std::chrono::milliseconds delta, InputState inputState) { eatPellets(); } -void Game::checkCollision(Ghost & ghost) { +void Game::checkCollision(Ghost ghost) { if (pacManDying() || ghost.isEyes()) return; @@ -114,7 +114,7 @@ void Game::eatPellets() { score.points += POWER_PELLET_POINTS; gameState.blinky.frighten(); - gameState.speedy.frighten(); + gameState.pinky.frighten(); gameState.inky.frighten(); gameState.clyde.frighten(); diff --git a/lib/Ghost.cpp b/lib/Ghost.cpp index 0997049..fc0c996 100644 --- a/lib/Ghost.cpp +++ b/lib/Ghost.cpp @@ -199,7 +199,7 @@ Blinky::Blinky() : Ghost(Atlas::Ghost::blinky, pacman::initialBlinkyPosition(), pacman::blinkyScatterTarget()) { } -Speedy::Speedy() +Pinky::Pinky() : Ghost(Atlas::Ghost::speedy, pacman::initialSpeedyPosition(), pacman::speedyScatterTarget()) { } diff --git a/lib/include/Game.hpp b/lib/include/Game.hpp index 74d7d48..d23b263 100644 --- a/lib/include/Game.hpp +++ b/lib/include/Game.hpp @@ -20,7 +20,7 @@ private: void step(std::chrono::milliseconds delta, InputState inputState); void eatPellets(); void processEvents(InputState & inputState); - void checkCollision(Ghost & ghost); + void checkCollision(Ghost ghost); void killPacMan(); bool pacManDying() const; void handleDeathAnimation(std::chrono::milliseconds delta); diff --git a/lib/include/GameState.hpp b/lib/include/GameState.hpp index 8141f6e..e46fea1 100644 --- a/lib/include/GameState.hpp +++ b/lib/include/GameState.hpp @@ -10,7 +10,7 @@ namespace pacman { struct GameState { Blinky blinky; - Speedy speedy; + Pinky pinky; Inky inky; Clyde clyde; PacMan pacMan; diff --git a/lib/include/Ghost.hpp b/lib/include/Ghost.hpp index d6c9ea9..b3e2c51 100644 --- a/lib/include/Ghost.hpp +++ b/lib/include/Ghost.hpp @@ -59,9 +59,9 @@ public: explicit Blinky(); }; -class Speedy : public Ghost { +class Pinky : public Ghost { public: - explicit Speedy(); + explicit Pinky(); }; class Inky : public Ghost {