ayuda con punteros y classes
Publicado por leonardo (8 intervenciones) el 02/09/2014 11:11:16
hola necesito que la variable "za1" sume de a 10 cada ves que se repita el bucle. (tengo q usar classes si o si)
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
#include <allegro.h>
void init();
void deinit();
class contador{
public:
int tiempos;
int zetas;
contador (int tiempos, int zetas){
zetas=zetas+tiempos;
}
};
int main() {
init();
bool a1=true;
bool a2=true;
int za1=0;
int za2=0;
int tiempo=10;
while (!key[KEY_ESC]) {
contador cuada1(tiempo,za1);
textprintf_ex(screen,font,20,20, 0x060BB3, -1,"za1 es: ""%d",za1);
}
deinit();
return 0;
}
END_OF_MAIN()
void init() {
int depth, res;
allegro_init();
depth = desktop_color_depth();
if (depth == 0) depth = 32;
set_color_depth(depth);
res = set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0);
if (res != 0) {
allegro_message(allegro_error);
exit(-1);
}
install_timer();
install_keyboard();
install_mouse();
/* add other initializations here */
}
void deinit() {
clear_keybuf();
/* add other deinitializations here */
}
Valora esta pregunta


0