pacman/lib/include/GameState.hpp

45 lines
840 B
C++
Raw 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 "Clyde.hpp"
#include "Fruits.hpp"
2021-07-08 14:57:18 +00:00
#include "Ghost.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);
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-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