-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmapa.h
45 lines (35 loc) · 768 Bytes
/
mapa.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
#ifndef MAPA_H
#define MAPA_H
#define HEROI '@'
#define VAZIO '.'
#define PAREDE_VERTICAL '|'
#define PAREDE_HORIZONTAL '-'
#define FANTASMA 'F'
#define BOMBA 'B'
#define PILULA 'P'
typedef struct{
char** matriz;
int linhas;
int colunas;
}MAPA;
MAPA m;
typedef struct{
int x;
int y;
}POS;
POS p;
void alocaMapa(MAPA* m);
void lerMapa(MAPA* m);
void liberaMapa(MAPA* m);
void copiaMapa(MAPA* destino,MAPA* origem);
int podeIr(MAPA* m, int x, int y);
int ehParede(MAPA* m, int x, int y);
int ehPersonagem(MAPA* m,char personagem,int x,int y);
int podeAndar(MAPA* m,char personagem,int x, int y);
int encontraMapa(MAPA* m, POS* p, char c);
void andaMapa(MAPA* m,
int xOrigem,
int yOrigem,
int xDestino,
int yDestino);
#endif