Use the correct ghost names

This commit is contained in:
Corentin Jabot 2021-07-16 09:35:32 +02:00
parent 0428366e86
commit d6a046ff47
6 changed files with 11 additions and 11 deletions

View file

@ -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);

View file

@ -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();

View file

@ -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()) {
}

View file

@ -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);

View file

@ -10,7 +10,7 @@ namespace pacman {
struct GameState {
Blinky blinky;
Speedy speedy;
Pinky pinky;
Inky inky;
Clyde clyde;
PacMan pacMan;

View file

@ -59,9 +59,9 @@ public:
explicit Blinky();
};
class Speedy : public Ghost {
class Pinky : public Ghost {
public:
explicit Speedy();
explicit Pinky();
};
class Inky : public Ghost {