Skip to content

Commit

Permalink
no running into other creatures
Browse files Browse the repository at this point in the history
  • Loading branch information
sirvaulterscoff committed Mar 25, 2011
1 parent e6a4afa commit 1cd953f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
recompute_fov = True
def can_pass(x, y):
global recompute_fov
recompute_fov = map.map[y][x].passable()
recompute_fov = map.can_walk(x, y)
return recompute_fov

def main_loop():
Expand Down
3 changes: 3 additions & 0 deletions map.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,6 @@ def find_random_square(self, occupied):
return x, y
#if nothing found - let's try once again
return self.find_random_square(occupied)

def can_walk(self, x, y):
return self.map[y][x].passable() and not self.has_critter_at( (x, y))

0 comments on commit 1cd953f

Please sign in to comment.