-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTetris.hpp
75 lines (61 loc) · 1.2 KB
/
Tetris.hpp
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
71
72
73
74
75
//
// Tetris.hpp
// Tetris_2
//
// Created by Rahul Raina on 11/19/17.
// Copyright © 2017 CMU. All rights reserved.
//
#ifndef Tetris_hpp
#define Tetris_hpp
#include <stdio.h>
class Piece{
public:
char *str;
int size;
int xstart;
int ystart;
int state;
int xLeft;
int xRight;
public:
Piece();
Piece(int length);
void Set(int length);
~Piece();
void DrawPiece(int x, int y, int r, int g, int b);
void Draw(int r, int g, int b);
void Rotate();
void Create();
int Height();
int Width();
void Cleanup();
};
class Board
{
public:
char *board;
int *red;
int *blue;
int *green;
int size;
int wid;
int hei;
public:
Board();
~Board();
int Check(int x, int y,char matrix[],int mat_size);
void Add(int xstart, int ystart,char matrix[],int mat_size,int r, int g, int b);
void Initialize();
void DrawBoard(int x, int y,int r, int g, int b);
void Draw(int r, int g, int b);
void DrawGrid();
void ClearOut();
};
class Tetris
{
public:
void Draw_Box(int total_score, int pause, int over);
int Play();
void Draw_Help(int pause);
};
#endif /* Tetris_hpp */