Skip to content

Commit d35d68c

Browse files
committed
VERSÃO FINAL!!!
ACABOU!!! ACABOU!!! ACABOU!!! ...
1 parent d3d2d90 commit d35d68c

File tree

9 files changed

+297
-235
lines changed

9 files changed

+297
-235
lines changed

Game-C/Game-C.cbp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@
4444
<Option compilerVar="CC" />
4545
</Unit>
4646
<Unit filename="objects.h" />
47+
<Unit filename="resource.rc">
48+
<Option compilerVar="WINDRES" />
49+
</Unit>
4750
<Extensions>
4851
<code_completion />
4952
<envvars />

Game-C/bin/Debug/allegro.log

Lines changed: 152 additions & 152 deletions
Large diffs are not rendered by default.

Game-C/functions.c

Lines changed: 38 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extern const int GRAVITY = 1; //gravidade padrao em 1
2222
extern const int FPS = 60;
2323
extern int back_x;
2424
extern int back_y;
25-
extern bool keys[8];
25+
2626
extern const int TELA_INICIO = 0;
2727
extern const int TELA_ISNTRU = 1;
2828
extern const int TELA_JOGO = 2;
@@ -45,7 +45,7 @@ void InitPlayer(Player &player, int *text_color)
4545
player.alive = true;
4646
player.shield = false;
4747
player.velx = 0;
48-
player.vely = 0;
48+
player.vely = 1;
4949
player.boundx = 40;
5050
player.boundy = 40;
5151
player.score = 0;
@@ -67,19 +67,19 @@ void InitPlayer(Player &player, int *text_color)
6767

6868
void PlayerSample(Player &player, int letra, ALLEGRO_SAMPLE_ID *musica3id, ALLEGRO_SAMPLE *musica3)
6969
{
70-
if(letra == 4)
70+
if(letra == 3)
7171
{
7272
if(!player.alive)
7373
{
74-
al_stop_sample_instance(player.instance[0]);
75-
al_play_sample(musica3, 1, 0, 1, ALLEGRO_PLAYMODE_LOOP, musica3id);
74+
al_stop_sample_instance(player.instance[1]);
7675
}
7776

7877
if(player.lives == 2)
7978
{
80-
al_stop_sample(musica3id);
79+
//al_stop_sample(musica3id);
8180
al_play_sample_instance(player.instance[0]);
8281
}
82+
8383
if(player.lives == 1)
8484
{
8585
al_stop_sample_instance(player.instance[0]);
@@ -205,7 +205,7 @@ void ResetPlayer(int *tela, Player &player, Enemy_red enemyred[],
205205
Obstacle &obstacle, Boss boss[], int *num_boss, int *text_color,
206206
ALLEGRO_SAMPLE *musica3, ALLEGRO_SAMPLE_ID *musica3id,
207207
ALLEGRO_SAMPLE *musica666, ALLEGRO_SAMPLE_ID *musica666id,
208-
int letra)
208+
int letra, bool *UP, bool *RIGHT, bool *LEFT, bool *Q, bool *W, bool *E)
209209
{
210210
int j;
211211
if(player.lives <= 0)
@@ -220,13 +220,13 @@ void ResetPlayer(int *tela, Player &player, Enemy_red enemyred[],
220220
player.lives = 5;
221221
player.speed = 7;
222222
player.jumpSpeed = 15;
223-
player.jump = false;
223+
player.jump = true;
224224
player.moving = false;
225225
player.colision = false;
226226
player.alive = true;
227227
player.shield = false;
228228
player.velx = 0;
229-
player.vely = 0;
229+
player.vely = 1;
230230
player.boundx = 40;
231231
player.boundy = 50;
232232
player.score = 0;
@@ -263,12 +263,29 @@ void ResetPlayer(int *tela, Player &player, Enemy_red enemyred[],
263263
al_stop_sample_instance(boss[j].instance[0]);
264264
al_stop_sample_instance(boss[j].instance[1]);
265265
if(letra == 666)
266-
al_stop_sample_instance(boss[j].instance[2]);
266+
al_stop_sample_instance(boss[j].instance[2]);
267267
}
268268
obstacle.score = 5;
269+
*UP = false;
270+
*RIGHT = false;
271+
*LEFT = false;
272+
*Q = false;
273+
*W = false;
274+
*E = false;
269275
*tela = TELA_FINAL;
270-
for(j=0; j<8; j++)
271-
keys[j] = false;
276+
}
277+
}
278+
279+
void ResetKeys(struct Player &player, bool *UP, bool *RIGHT, bool *LEFT, bool *Q, bool *W, bool *E)
280+
{
281+
if(player.alive == false)
282+
{
283+
*UP = false;
284+
*RIGHT = false;
285+
*LEFT = false;
286+
*Q = false;
287+
*W = false;
288+
*E = false;
272289
}
273290
}
274291

@@ -957,6 +974,7 @@ void InitBoss(struct Boss boss[], int *num_boss, int letra)
957974
boss[j].sample[2] = al_load_sample("sounds/starwars.ogg");
958975
boss[j].instance[2] = al_create_sample_instance(boss[j].sample[2]);
959976
al_attach_sample_instance_to_mixer(boss[j].instance[2], al_get_default_mixer());
977+
al_set_sample_instance_gain(boss[j].instance[2], 3);
960978
}
961979
boss[j].x = back_x;
962980
boss[j].y = back_y;
@@ -981,6 +999,8 @@ void InitBoss(struct Boss boss[], int *num_boss, int letra)
981999
boss[j].instance[1] = al_create_sample_instance(boss[j].sample[1]);
9821000
al_attach_sample_instance_to_mixer(boss[j].instance[0], al_get_default_mixer());
9831001
al_attach_sample_instance_to_mixer(boss[j].instance[1], al_get_default_mixer());
1002+
al_set_sample_instance_gain(boss[j].instance[0], 2);
1003+
al_set_sample_instance_gain(boss[j].instance[1], 2);
9841004

9851005
}
9861006
}
@@ -1003,7 +1023,7 @@ void UpdateBoss(struct Boss boss[], int *num_boss, int *text_boss, struct Player
10031023
int *num_enemyred, struct Enemy_blue enemyblue[], int *num_enemyblue, int letra)
10041024
{
10051025
*num_boss = 0;
1006-
if(player.score > 2 && boss[0].lived == false)
1026+
if(player.score > 20 && boss[0].lived == false)
10071027
{
10081028
boss[0].alive = true;
10091029
*num_boss = 1;
@@ -1087,7 +1107,6 @@ void BossSample(struct Boss boss[], int *num_boss, int letra, ALLEGRO_SAMPLE_ID
10871107
}
10881108
if(letra == 1)
10891109
{
1090-
al_stop_sample(musica1id);
10911110
al_play_sample_instance(boss[j].instance[1]);
10921111
}
10931112
if(letra == 666)
@@ -1100,19 +1119,18 @@ void BossSample(struct Boss boss[], int *num_boss, int letra, ALLEGRO_SAMPLE_ID
11001119
{
11011120
switch(letra)
11021121
{
1103-
case 1:
1122+
case 1:
11041123
boss[j].instance_played = true;
11051124
al_stop_sample_instance(boss[j].instance[1]);
1106-
al_stop_samples();
1107-
al_play_sample(musica1, 1, 0, 1, ALLEGRO_PLAYMODE_LOOP, musica1id);
11081125
break;
1109-
case 666:
1126+
case 666:
11101127
al_stop_sample_instance(boss[j].instance[2]);
11111128
boss[j].instance_played = true;
11121129
break;
1130+
}
11131131
}
11141132
}
1115-
}}
1133+
}
11161134

11171135
//funcao para colisao de player com boss
11181136
void PlayerColisionBoss(struct Player &player, struct Boss boss[], int *num_boss)
@@ -1195,7 +1213,7 @@ void InitBackground0(struct Sprite &background0, ALLEGRO_SAMPLE *musica0, ALLEGR
11951213
background0.image[12] = al_load_bitmap("images/telas/tela-inicio0.png");
11961214
background0.image[13] = al_load_bitmap("images/telas/tela-instru0.png");
11971215
background0.image[14] = al_load_bitmap("images/telas/tela-final0.png");
1198-
background0.image[15] = al_load_bitmap("images/telas/reprovado.png");
1216+
background0.image[15] = al_load_bitmap("images/reprovado.png");
11991217

12001218
//carregar musica referente
12011219
switch (letra)

Game-C/functions.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ void ResetPlayer(int *tela, Player &player, Enemy_red enemyred[], int *num_enemy
1414
Boss boss[], int *num_boss, int *text_color,
1515
ALLEGRO_SAMPLE *musica3, ALLEGRO_SAMPLE_ID *musica3id,
1616
ALLEGRO_SAMPLE *musica666, ALLEGRO_SAMPLE_ID *musica666id,
17-
int letra);
17+
int letra, bool *UP, bool *RIGHT, bool *LEFT, bool *Q, bool *W, bool *E);
18+
void ResetKeys(struct Player &player, bool *UP, bool *RIGHT, bool *LEFT, bool *Q, bool *W, bool *E);
1819
void TransportPlayer(Player &player);
1920

2021
//Funções shootQ

Game-C/icon.ico

361 KB
Binary file not shown.

0 commit comments

Comments
 (0)