2021-07-08 14:57:18 +00:00
|
|
|
#pragma once
|
|
|
|
|
2021-07-28 13:28:36 +00:00
|
|
|
#include "Blinky.hpp"
|
|
|
|
#include "Clyde.hpp"
|
2021-07-08 14:57:18 +00:00
|
|
|
#include "Ghost.hpp"
|
2021-07-28 13:28:36 +00:00
|
|
|
#include "Inky.hpp"
|
2021-07-08 14:57:18 +00:00
|
|
|
#include "PacMan.hpp"
|
|
|
|
#include "Pellets.hpp"
|
2021-07-28 13:28:36 +00:00
|
|
|
#include "Pinky.hpp"
|
2021-07-08 14:57:18 +00:00
|
|
|
#include "Score.hpp"
|
|
|
|
#include "SuperPellets.hpp"
|
2021-09-07 14:00:19 +00:00
|
|
|
#include "InputState.hpp"
|
2021-07-08 14:57:18 +00:00
|
|
|
|
|
|
|
namespace pacman {
|
|
|
|
|
|
|
|
struct GameState {
|
2021-09-07 14:00:19 +00:00
|
|
|
void step(std::chrono::milliseconds delta);
|
|
|
|
|
2021-07-15 07:14:25 +00:00
|
|
|
Blinky blinky;
|
2021-07-16 07:35:32 +00:00
|
|
|
Pinky pinky;
|
2021-07-15 07:14:25 +00:00
|
|
|
Inky inky;
|
|
|
|
Clyde clyde;
|
2021-09-07 14:00:19 +00:00
|
|
|
|
2021-07-08 14:57:18 +00:00
|
|
|
PacMan pacMan;
|
2021-09-07 14:00:19 +00:00
|
|
|
InputState inputState;
|
2021-07-08 14:57:18 +00:00
|
|
|
Pellets pellets;
|
|
|
|
SuperPellets superPellets;
|
2021-09-07 14:00:19 +00:00
|
|
|
|
|
|
|
Score score;
|
|
|
|
std::chrono::milliseconds timeSinceDeath{};
|
|
|
|
|
|
|
|
void checkCollision(Ghost & ghost);
|
|
|
|
void handleDeathAnimation(std::chrono::milliseconds delta);
|
|
|
|
void eatPellets();
|
|
|
|
void killPacMan();
|
|
|
|
bool isPacManDying() const;
|
2021-07-08 14:57:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace pacman
|