-
Notifications
You must be signed in to change notification settings - Fork 0
/
textos.h
103 lines (94 loc) · 2.37 KB
/
textos.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#ifndef TEXTOS_H
#define TEXTOS_H
#include "mapa.h"
void desenhaVidasJogador(int vidas){
char texto1[19] = "Vidas do Jogador: ";
glPushMatrix();
glTranslatef(15.6, -6, 0);
glColor3f(1.0, 1.0, 1.0);
glRasterPos2f(0.0,15);
for(int i = 0; i<=static_cast<int>(strlen(texto1)); i++){
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18,texto1[i]);
}
glPopMatrix();
glPushMatrix();
glTranslatef(15.5, 7.0, 0.5);
glScalef(0.8, 0.8, 0.8);
float espaco = 1.5;
for (int i = 0; i < vidas; i++){
glPushMatrix();
glTranslatef(i * espaco, 0.0, 0.0);
desenhaTank(0.0, 0.0, 180, 1.0, 1.0, 0.0);
glPopMatrix();
}
glPopMatrix();
}
void desenhaVidasInimigo(int vidas){
char texto[25] = "Inimigos: ";
glPushMatrix();
glTranslatef(16, -2, 0);
glColor3f(1.0, 1.0, 1.0);
glRasterPos2f(0.0,15);
for(int i = 0; i<=static_cast<int>(strlen(texto)); i++){
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18,texto[i]);
}
glPopMatrix();
glPushMatrix();
glTranslatef(15.8, 10.5, 0.5);
glScalef(0.8, 0.8, 0.8);
float espaco = 1.5;
for (int i = 0; i < vidas; i++){
glPushMatrix();
glTranslatef(i * espaco, 0.0, 0.0);
desenhaTank(0.0, 0.0, 180, 1.0, 0.0, 0.0);
glPopMatrix();
}
glPopMatrix();
}
void desenhaPlacarBonus(){
char texto[25] = "Bonus Ativos:";
glPushMatrix();
glTranslatef(15.5, -9.5, 0);
glColor3f(1.0, 1.0, 1.0);
glRasterPos2f(0.0,15);
for(int i = 0; i<=static_cast<int>(strlen(texto)); i++){
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18,texto[i]);
}
glPopMatrix();
glPushMatrix();
glTranslatef(15.4, 4.0, 0.5);
glScalef(0.8, 0.8, 0.8);
float espaco = 1.5;
if (bonus_wall){
glPushMatrix();
glTranslatef(0 * espaco, 0.0, 0.0);
desenhaBonus(1, 0, 0, 0);
glPopMatrix();
}
if (bonus_vida){
glPushMatrix();
glTranslatef(1 * espaco, 0.0, 0.0);
desenhaBonus(2, 0, 0, 0);
glPopMatrix();
}
if (bonus_estrela){
glPushMatrix();
glTranslatef(2 * espaco, 0.0, 0.0);
desenhaBonus(3, 0, 0, 0);
glPopMatrix();
}
if (bonus_boat){
glPushMatrix();
glTranslatef(3 * espaco, 0.0, 0.0);
desenhaBonus(4, 0, 0, 0);
glPopMatrix();
}
if (bonus_gun){
glPushMatrix();
glTranslatef(4 * espaco, 0.0, 0.0);
desenhaBonus(5, 0, 0, 0);
glPopMatrix();
}
glPopMatrix();
}
#endif