Mercurial > rinkhals
comparison gamelib/gameboard.py @ 96:a851461d345e
Iterate over a copy of the loop when changing it
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Wed, 02 Sep 2009 11:40:51 +0000 |
parents | fa8d8fc1bf5b |
children | 725b292ca07b |
comparison
equal
deleted
inserted
replaced
95:d0e32062b497 | 96:a851461d345e |
---|---|
248 self.tvw.move_view(self.TILE_DIMENSIONS[0], 0) | 248 self.tvw.move_view(self.TILE_DIMENSIONS[0], 0) |
249 else: | 249 else: |
250 self.disp.event(e) | 250 self.disp.event(e) |
251 | 251 |
252 def clear_foxes(self): | 252 def clear_foxes(self): |
253 for fox in self.foxes: | 253 for fox in self.foxes[:]: |
254 # Any foxes that didn't make it to the woods are automatically | 254 # Any foxes that didn't make it to the woods are automatically |
255 # killed | 255 # killed |
256 if self.in_bounds(fox.pos) and self.tv.get(fox.pos.to_tuple()) \ | 256 if self.in_bounds(fox.pos) and self.tv.get(fox.pos.to_tuple()) \ |
257 != self.WOODLAND: | 257 != self.WOODLAND: |
258 self.kill_fox(fox) | 258 self.kill_fox(fox) |