Mercurial > rinkhals
changeset 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 | 8a46055c7d08 |
files | gamelib/constants.py gamelib/gameboard.py |
diffstat | 2 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/gamelib/constants.py Tue Sep 01 11:20:14 2009 +0000 +++ b/gamelib/constants.py Tue Sep 01 11:21:43 2009 +0000 @@ -21,6 +21,7 @@ STARTING_CASH = 1000 SELL_PRICE_CHICKEN = 10 +SELL_PRICE_DEAD_FOX = 5 BUY_PRICE_FENCE = 50 SELL_PRICE_FENCE = 25 REPAIR_PRICE_FENCE = 25
--- a/gamelib/gameboard.py Tue Sep 01 11:20:14 2009 +0000 +++ b/gamelib/gameboard.py Tue Sep 01 11:21:43 2009 +0000 @@ -243,6 +243,13 @@ def clear_foxes(self): for fox in self.foxes: self.tv.sprites.remove(fox) + # Any foxes that didn't make it to the woods are automatically + # killed + if self.in_bounds(fox.pos) and self.tv.get(fox.pos.to_tuple()) \ + != self.WOODLAND: + self.killed_foxes += 1 + self.toolbar.update_fox_counter(self.killed_foxes) + self.add_cash(constants.SELL_PRICE_DEAD_FOX) self.foxes = [] # Remove all the foxes def move_foxes(self):