Skip to content

Commit

Permalink
Zombies block player
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Rosén committed May 13, 2011
1 parent 19b31ab commit 3bf9838
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/agents/survivor.py
Expand Up @@ -181,6 +181,7 @@ def movePredicate(self,new_loc):
if i.getId() == 'player':
continue
if i.isBlocking():
return
return False
return True


3 changes: 3 additions & 0 deletions scripts/movable.py
Expand Up @@ -69,6 +69,9 @@ def move(self):
new_loc = fife.Location(cur_loc.getLayer())
new_loc.setExactLayerCoordinates(new_cord)

if not self.movePredicate(new_loc):
return

# Update location
self.instance.setLocation(new_loc)

Expand Down

0 comments on commit 3bf9838

Please sign in to comment.