-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGameBoard.h
70 lines (48 loc) · 1.12 KB
/
GameBoard.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
65
66
67
68
69
70
#pragma once
#include "BlockSwapper.h"
#include "BlockTransition.h"
#include "Cube.h"
#include "Engine.h"
#include "GameBoardData.h"
#include "NumberDisplay.h"
enum BOARD_ID { BOARD_1, BOARD_2, BOARD_MAX };
class CGameBoard {
enum KEYCFG {
KEY_UP,
KEY_DOWN,
KEY_LEFT,
KEY_RIGHT,
KEY_NEWLINE,
KEY_SWAP,
KEYCFG_MAX
};
CCube box;
CBlockSwapper blockSwapper;
CBlockTransition blockTransition;
CNumberDisplay numberDisplay;
CGameBoardData boardData;
BOARD_ID ID;
int keyCfg[KEYCFG_MAX];
// scroll amount per second
float scrollSpeed;
// scrollAcceleration per second;
float scrollAcceleration;
// scroll value (0.f - 1.f)
float scroll;
float scrollPause;
int score;
bool active;
void setColor(int color);
public:
CGameBoard(BOARD_ID ID);
~CGameBoard();
void draw();
bool lost();
void addLine();
void setActive(bool active);
bool isActive();
void control(float deltaTime);
void setup(uint32_t seed);
void setDifficulty(int difficulty);
int getScore();
};