-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtetris.h
45 lines (35 loc) · 811 Bytes
/
tetris.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
#ifndef TETRIS_H
#define TETRIS_H
#include <time.h>
#include <stdlib.h>
#include "block.h"
class Tetris{
public:
Tetris();
void init();
void createBlock();
void createNextBlock();
void createShadowBlock();
bool move(int dx, int dy);
bool moveLeft();
bool moveRight();
bool moveDown();
bool rotate();
bool gameOver();
int getLine();
void killLines();
int getScore();
int getLevel();
Block getBlock();
Block getNextBlock();
Block getShadowBlock();
bool getBox(int x, int y);
private:
int score;
int level;
Block block;
Block nextBlock;
Block shadowBlock;
bool box[10][20];
};
#endif // TETRIS_H