-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGrid.h
More file actions
91 lines (73 loc) · 2.02 KB
/
Copy pathGrid.h
File metadata and controls
91 lines (73 loc) · 2.02 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/********************************
Name: Grid
Copyright:
Author: Martin Cardozo
Date: 09/07/08 15:32
Description: Grid Class
********************************/
/************************
INCLUDES
************************/
/************************
CLASS
************************/
class Grid {
public:
//CONSTRUCTOR
Grid(int XC, int YC, int sizeC);
//FUNCTIONS
void draw(BITMAP *dest);
void fade(int value);
//VARIABLES
int size;
private:
//FUNCTIONS
//VARIABLES
int X;
int Y;
int separation; //CAMBIAR NOMBRE
bool fading;
int fadeValue;
int strenght;
};
/************************
CONSTRUCTOR
************************/
Grid::Grid(int XC, int YC, int sizeC){
X = XC;
Y = YC;
separation = 100;
size = sizeC/separation;
};
/************************
PUBLIC METHODS
************************/
void Grid::draw(BITMAP *dest){
X = X - camera.X;
Y = Y - camera.Y;
if (fading){
if (fadeValue > 0){
fadeValue -= 5;
//if (EFFECTS)fadeValue -= 5; //ESTO POR AHORA ANDA MAL (se desconfigura todo si desactivas los efectos en la mitad de
//if (!EFFECTS)camera.shake(--fadeValue); //una explosion (limitar el F4 si una bomba esta tirada)
}else{
fading = false;
PLAYING = true;
}
}
int color = rand()%255; //JUST FOR THIS FRAME
if (CLEAN_BUFFER)clear_to_color(dest, makecol(fadeValue,fadeValue,fadeValue));
for (int j = 0; j < size; j++){ //HACER QUE EL TAMAÑO SEA DINAMICO (dependiendo de la resolucion)
for (int i = 0; i < size; i++){
putpixel(dest, i*separation+X, j*separation+Y, makecol(color,color,255));
}
}
rect(dest, X, Y, size*separation, size*separation, makecol(color,color,255));
};
void Grid::fade(int value){
fadeValue = value;
fading = true;
};
/************************
PRIVATE METHODS
************************/