pacman/lib/include/GameState.hpp

40 lines
738 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"
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"
#include "InputState.hpp"
2021-07-08 14:57:18 +00:00
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;
InputState inputState;
2021-07-08 14:57:18 +00:00
Pellets pellets;
SuperPellets superPellets;
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