Fix mac build (again)
This commit is contained in:
parent
a01f93cc90
commit
b6d0bad21c
1 changed files with 5 additions and 4 deletions
|
@ -1,5 +1,6 @@
|
||||||
#include "Ghost.hpp"
|
#include "Ghost.hpp"
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include <array>
|
||||||
|
|
||||||
Ghost::Ghost(Atlas::Ghost spritesSet, Position startingPosition, Position scatterTarget)
|
Ghost::Ghost(Atlas::Ghost spritesSet, Position startingPosition, Position scatterTarget)
|
||||||
: spritesSet(spritesSet),
|
: spritesSet(spritesSet),
|
||||||
|
@ -44,10 +45,10 @@ void Ghost::reset() {
|
||||||
case State::Frightened:
|
case State::Frightened:
|
||||||
if (timeFrighten < 3500)
|
if (timeFrighten < 3500)
|
||||||
return (animationIndex % 2) == 0 ? Atlas::ghost_frightened2 : Atlas::ghost_frightened1;
|
return (animationIndex % 2) == 0 ? Atlas::ghost_frightened2 : Atlas::ghost_frightened1;
|
||||||
return std::array<PositionInt, 4>{ Atlas::ghost_frightened1,
|
return std::array<PositionInt, 4>{{ Atlas::ghost_frightened1,
|
||||||
Atlas::ghost_frightened2,
|
Atlas::ghost_frightened2,
|
||||||
Atlas::ghost_frightened3,
|
Atlas::ghost_frightened3,
|
||||||
Atlas::ghost_frightened4 }[animationIndex];
|
Atlas::ghost_frightened4 }}[animationIndex];
|
||||||
case State::Eyes:
|
case State::Eyes:
|
||||||
return Atlas::eyeSprite(direction);
|
return Atlas::eyeSprite(direction);
|
||||||
}
|
}
|
||||||
|
@ -123,12 +124,12 @@ void Ghost::updateDirection(const Board & board) {
|
||||||
};
|
};
|
||||||
|
|
||||||
auto [x, y] = cell;
|
auto [x, y] = cell;
|
||||||
std::array<NewDirection, 4> directions = {
|
std::array<NewDirection, 4> directions = {{
|
||||||
NewDirection{ Direction::UP, { x, y - 1 }, 0 },
|
NewDirection{ Direction::UP, { x, y - 1 }, 0 },
|
||||||
NewDirection{ Direction::LEFT, { x - 1, y }, 0 },
|
NewDirection{ Direction::LEFT, { x - 1, y }, 0 },
|
||||||
NewDirection{ Direction::DOWN, { x, y + 1 }, 0 },
|
NewDirection{ Direction::DOWN, { x, y + 1 }, 0 },
|
||||||
NewDirection{ Direction::RIGHT, { x + 1, y }, 0 }
|
NewDirection{ Direction::RIGHT, { x + 1, y }, 0 }
|
||||||
};
|
}};
|
||||||
const Position target = this->target(board);
|
const Position target = this->target(board);
|
||||||
|
|
||||||
for (auto && d : directions) {
|
for (auto && d : directions) {
|
||||||
|
|
Loading…
Reference in a new issue