-
Notifications
You must be signed in to change notification settings - Fork 0
/
auxiliars.c
29 lines (24 loc) · 821 Bytes
/
auxiliars.c
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
#include "main.h"
int checaVitoria(HEROI* heroi, SAIDA* saida){
return (heroi->x == saida->x && heroi->y == saida->y);
}
void colisaoPontos(HEROI* heroi, char mapa[HEIGHT][WIDTH], CHAVE chave, SAIDA* saida){
//Colisão com o Refém
if(mapa[heroi->y][heroi->x] == '0'){
mapa[heroi->y][heroi->x] = ' ';
heroi->pontos+=100;
}
//Colisão com o Bonus de tiros
if(mapa[heroi->y][heroi->x] == '%'){
mapa[heroi->y][heroi->x] = ' ';
heroi->dardos+=2;
}
//Colisão com a chave
if(mapa[heroi->y][heroi->x] == 'K'){
mapa[heroi->y][heroi->x] = ' ';
mapa[saida->y][saida->x] = ' ';
putchxy(saida->x, saida->y, ' ');
if(mapa[heroi->y][heroi->x+1]!= '#')
putchxy(heroi->x+1, heroi->y, ' '); //Apaga a ponta da chave
}
}