Advertisement
Guest User

Untitled

a guest
Aug 31st, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. int isBlocked(Game *game, int x, int y)
  2. {
  3. if (game->map.tile[y][x] == TILE_OPEN) {
  4. return 0;
  5. }
  6. if (game->map.tile[y][x] == TILE_ROOM) {
  7. return 0;
  8. }
  9. if (game->map.tile[y][x] == TILE_WALL) {
  10. return 1;
  11. }
  12. for (unsigned int i = 0; i < game->numMonsters; i++) {
  13. if (game->monsters[i].pos.y == y && game->monsters[i].pos.x == x) {
  14. return 0;
  15. }
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement