generated from pimoroni/picosystem-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGame.h
64 lines (49 loc) · 1013 Bytes
/
Game.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#pragma once
#include <stdint.h>
#include "Defines.h"
#include "Player.h"
#include "Enemy.h"
#include "Menu.h"
class Entity;
struct Stats
{
EnemyType killedBy;
uint8_t enemyKills[(int)EnemyType::NumEnemyTypes];
uint8_t chestsOpened;
uint8_t crownsCollected;
uint8_t scrollsCollected;
uint8_t coinsCollected;
void Reset();
};
class Game
{
public:
static uint8_t globalTickFrame;
enum class State : uint8_t
{
Menu,
EnteringLevel,
InGame,
GameOver,
FadeOut
};
static void Init();
static void Tick();
static void Draw();
static void StartGame();
static void StartLevel();
static void NextLevel();
static void GameOver();
static void SwitchState(State newState);
static State GetState() { return state; }
static void ShowMessage(const char* message);
static Player player;
static const char* displayMessage;
static uint8_t displayMessageTime;
static uint8_t floor;
static Stats stats;
private:
static void TickInGame();
static Menu menu;
static State state;
};