pacman/lib/include/GameState.hpp

43 lines
826 B
C++
Raw Permalink Normal View History

2021-07-08 14:57:18 +00:00
#pragma once
2021-07-28 13:28:36 +00:00
#include "Blinky.hpp"
#include "Dave.hpp"
#include "Fruits.hpp"
2021-07-08 14:57:18 +00:00
#include "Ghost.hpp"
#include "GhostState.hpp"
2021-07-28 13:28:36 +00:00
#include "Inky.hpp"
#include "InputState.hpp"
2021-07-08 14:57:18 +00:00
#include "PacMan.hpp"
#include "PacManAI.hpp"
2021-07-08 14:57:18 +00:00
#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"
namespace pacman {
struct GameState {
void step(std::chrono::milliseconds delta);
GhostState ghosts;
2021-07-08 14:57:18 +00:00
PacMan pacMan;
PacManAI pacManAI;
InputState inputState;
2021-07-08 14:57:18 +00:00
Pellets pellets;
SuperPellets superPellets;
Fruits fruit;
Score score;
std::chrono::milliseconds timeSinceDeath{};
void checkCollision(Ghost & ghost);
void handleDeathAnimation(std::chrono::milliseconds delta);
void eatPellets();
void eatFruit();
void killPacMan();
bool isPacManDying() const;
2021-07-08 14:57:18 +00:00
};
} // namespace pacman