-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFaseFinal.cpp
More file actions
171 lines (129 loc) · 3.88 KB
/
Copy pathFaseFinal.cpp
File metadata and controls
171 lines (129 loc) · 3.88 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
#include "FaseFinal.hpp"
#include <thread> // Adiciona essa linha no topo do arquivo
#include <chrono> // Para definir a duração do sleep
#include "ASCII_Engine/TextBox.hpp"
#include <iostream>
void FaseFinal::init()
{
//Objetos de jogo
hero = new ObjetoDeJogo("Hero",SpriteAnimado("rsc/heroWalkingBack.anm",1),40,136);
objs.push_back(hero);
tapeteFase = new ObjetoDeJogo("tapeteFase",SpriteBuffer(5,2),19,149);
objs.push_back(tapeteFase);
}
unsigned FaseFinal::run(SpriteBuffer &screen)
{
std::string ent;
//padrão
draw(screen);
system("clear");
show(screen);
int teste = 0;
while (true)
{
//lendo entrada
getline(std::cin,ent);
TextBox caixaTexto(50, 3); // Largura 30, Altura 3
//processando entradas
int posL = hero->getPosL(), posC = hero->getPosC();
if (hero->colideCom(*tapeteFase)){
caixaTexto.setText("Olá querido humano... Sou a borboleta rainha daqui... vejo que você possui alguma das minhas súditas contigo...");
caixaTexto.show();
update();
draw(screen);
system("clear");
show(screen);
screen.clear();
caixaTexto.setText("A borboleta da percepção.. A borboleta da interação.. A borboleta dos limites.. A borboleta do sentir..");
caixaTexto.show();
update();
draw(screen);
system("clear");
show(screen);
screen.clear();
caixaTexto.setText("Obrigada por trazê-las de volta....");
caixaTexto.show();
update();
draw(screen);
system("clear");
show(screen);
screen.clear();
caixaTexto.setText("*Você devolve as borboletas *ruídos* -exames- para a rainha borboleta*");
caixaTexto.show();
update();
draw(screen);
system("clear");
show(screen);
screen.clear();
caixaTexto.setText("E então...?");
caixaTexto.show();
update();
draw(screen);
system("clear");
show(screen);
screen.clear();
caixaTexto.setText("Essa é nossa oitava sessão *ruídos* -encontro- o que você conseguiu perceber até agora?");
caixaTexto.show();
update();
draw(screen);
system("clear");
show(screen);
screen.clear();
caixaTexto.setText("Exames? Sessão? Do que você está falando rainha borboleta???");
caixaTexto.show();
update();
draw(screen);
system("clear");
show(screen);
screen.clear();
caixaTexto.setText("Hahaha! Não sabia que hoje eu estava tão linda para você me chamar de Rainha Ron!");
caixaTexto.show();
update();
draw(screen);
system("clear");
show(screen);
screen.clear();
caixaTexto.setText("Calma... onde estou mesmo????");
caixaTexto.show();
system("clear");
screen.clear();
show(screen);
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
draw(screen);
system("clear");
show(screen);
screen.clear();
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
system("clear");
screen.clear();
show(screen);
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
draw(screen);
system("clear");
show(screen);
screen.clear();
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
system("clear");
show(screen);
screen.clear();
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
return Fase::LEVEL_COMPLETE; // O jogador atravessa o rio!
}
if (ent == "w" && hero->getPosL() > 10 && teste == 0)
hero->moveUp(2);
else if (ent == "s" && hero->getPosL() < screen.getAltura() - 15 && teste == 0)
hero->moveDown(2);
else if (ent == "a" && hero->getPosC() > 12 && teste == 0)
hero->moveLeft(7);
else if (ent == "d" && hero->getPosC() < screen.getLargura() - hero->getSprite()->getLargura() - 13 && teste == 0)
hero->moveRight(8);
else if (ent == "q")
return Fase::END_GAME;
update();
draw(screen);
system("clear");
show(screen);
screen.clear();
}
return Fase::END_GAME; // não necessário
}