Mercurial > rinkhals
comparison gamelib/gameboard.py @ 239:8224d1ac99c7
Foxes tend to increase with time
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Sat, 05 Sep 2009 10:04:32 +0000 |
parents | 1a7097c0fc8f |
children | 1a7000c8211c |
comparison
equal
deleted
inserted
replaced
238:1a7097c0fc8f | 239:8224d1ac99c7 |
---|---|
816 def spawn_foxes(self): | 816 def spawn_foxes(self): |
817 """The foxes come at night, and this is where they come from.""" | 817 """The foxes come at night, and this is where they come from.""" |
818 # Foxes spawn just outside the map | 818 # Foxes spawn just outside the map |
819 x, y = 0, 0 | 819 x, y = 0, 0 |
820 width, height = self.tv.size | 820 width, height = self.tv.size |
821 new_foxes = random.randint(3, 7) | 821 min_foxes = (self.days+3)/2 # always more than one fox |
822 new_foxes = random.randint(min_foxes, min_foxes*2) | |
822 while len(self.foxes) < new_foxes: | 823 while len(self.foxes) < new_foxes: |
823 side = random.randint(0, 3) | 824 side = random.randint(0, 3) |
824 if side == 0: | 825 if side == 0: |
825 # top | 826 # top |
826 y = -1 | 827 y = -1 |