comparison gamelib/gameboard.py @ 80:ad9d1bc7ef0c

Kill foxes that don't reach safety
author Neil Muller <drnlmuller@gmail.com>
date Tue, 01 Sep 2009 11:21:43 +0000
parents 8241386a1651
children 9bd2c22e1746
comparison
equal deleted inserted replaced
79:8241386a1651 80:ad9d1bc7ef0c
241 self.disp.event(e) 241 self.disp.event(e)
242 242
243 def clear_foxes(self): 243 def clear_foxes(self):
244 for fox in self.foxes: 244 for fox in self.foxes:
245 self.tv.sprites.remove(fox) 245 self.tv.sprites.remove(fox)
246 # Any foxes that didn't make it to the woods are automatically
247 # killed
248 if self.in_bounds(fox.pos) and self.tv.get(fox.pos.to_tuple()) \
249 != self.WOODLAND:
250 self.killed_foxes += 1
251 self.toolbar.update_fox_counter(self.killed_foxes)
252 self.add_cash(constants.SELL_PRICE_DEAD_FOX)
246 self.foxes = [] # Remove all the foxes 253 self.foxes = [] # Remove all the foxes
247 254
248 def move_foxes(self): 255 def move_foxes(self):
249 for fox in self.foxes: 256 for fox in self.foxes:
250 fox.move(self) 257 fox.move(self)