pacman/lib/Clyde.cpp

33 lines
549 B
C++
Raw Normal View History

2021-07-28 13:28:36 +00:00
#include "Clyde.hpp"
namespace pacman {
Clyde::Clyde()
: Ghost(Atlas::Ghost::clyde) {
2021-07-28 13:28:36 +00:00
}
double Clyde::speed(const GameState & gameState) const {
if (state == State::Eyes)
return 2;
if (state == State::Frightened)
return 0.5;
return 0.75;
}
Position Clyde::target(const GameState & gameState) const {
if (state == State::Eyes)
return initialClydePosition();
2021-07-28 13:28:36 +00:00
if (isInPen())
return penDoorPosition();
return clydeScatterTarget();
}
Position Clyde::initialPosition() const {
return initialClydePosition();
}
}