-
Notifications
You must be signed in to change notification settings - Fork 0
/
TelaPrincipal.cpp
61 lines (45 loc) · 1.25 KB
/
TelaPrincipal.cpp
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
#include "TelaPrincipal.h"
#include "MenuPrincipal.h"
#include "Jogador.h"
#include "ColecaoInimigo.h"
TelaPrincipal::TelaPrincipal(void)
{
bg.carregar(".//telas/telaPrincipal.png",0,0,1024,768);
carrega();
// altura do HP Y 115
// x do HP 45 x MP 280
}
TelaPrincipal::~TelaPrincipal(void)
{
}
Telas* TelaPrincipal::desenha()
{
bg.desenha(0,0);
player.desenha(Chiyo,705,250);
egl_texto(player.getNome(),200,70);
egl_texto(hp,45,115);
egl_texto(atk,90,355);
egl_texto(def,100,378);
egl_texto(dmg,60,445);
if(key[SDLK_BACKSPACE] )
{
return new MenuPrincipal();
}
return NULL;
}
void TelaPrincipal::carrega() // carrega informações do Jogador || Batalhas || Listas de inimigos etc
{
player.inicializar();
player.setNome("Jogador 1");
itoa(player.getHP(),hp,10); // convert INT para STRING daí da para desenhar com o egl
itoa(player.getDef(),def,10);
itoa(player.getAtk(),atk,10);
itoa(player.getDano(),dmg,10); // Está mostrando um valor alto por que está com sujeira
Inimigo *vektor = new Inimigo(new string("Vektor"),5);
ColecaoInimigo *colecao = new ColecaoInimigo;
colecao->adicionarInimigo(vektor);
// colecao->escrever("Teste.txt"); FUNCIONANDO ISTO GRAVA O QUE ESTIVER NO VETOR DOS INIMIGOS
}
void TelaPrincipal::listaInimigos()
{
}