pacman/lib/include/Game.hpp

30 lines
577 B
C++
Raw Normal View History

2021-06-10 12:42:51 +00:00
#pragma once
2020-11-27 13:10:09 +00:00
2021-07-08 14:57:18 +00:00
#include "GameState.hpp"
#include "InputState.hpp"
2021-09-06 13:38:40 +00:00
#include "Canvas.hpp"
2021-07-05 12:10:01 +00:00
namespace pacman {
2020-11-27 13:10:09 +00:00
class Game {
public:
Game();
void run();
private:
Canvas canvas;
2021-07-08 14:57:18 +00:00
GameState gameState;
2021-06-24 08:32:54 +00:00
Score score;
2021-07-01 08:02:53 +00:00
std::chrono::milliseconds timeSinceDeath{};
2020-11-27 13:10:09 +00:00
2021-06-24 11:32:52 +00:00
void step(std::chrono::milliseconds delta, InputState inputState);
2021-06-16 11:59:16 +00:00
void eatPellets();
void processEvents(InputState & inputState);
2021-07-28 13:28:36 +00:00
void checkCollision(Ghost & ghost);
2021-07-13 12:26:57 +00:00
void killPacMan();
bool pacManDying() const;
void handleDeathAnimation(std::chrono::milliseconds delta);
2020-11-27 13:10:09 +00:00
};
2021-07-05 12:10:01 +00:00
} // namespace pacman