Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool sonAdyacentes(Personaje* p, Enemigo* e){
- if (p->x >= MAP_SIZE)
- return false;
- if ( p->x == e -> x){
- if (p->y == e->y+1)
- return true;
- if (p->y == e->y-1)
- return true;
- }
- if ( p->y == e -> y){
- if (p->x == e->x+1)
- return true;
- if (p->x == e->x-1)
- return true;
- }
- //diag izq
- if ( p->x == e -> x+1){
- if (p->y == e->y+1)
- return true;
- if (p->y == e->y-1)
- return true;
- }
- //diag der
- if ( p->x == e -> x-1){
- if (p->y == e->y+1)
- return true;
- if (p->y == e->y-1)
- return true;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement