diff gamelib/gameboard.py @ 92:bea1b9364583

Refactor Fox so we can have different types. Add a greedy fox
author Neil Muller <drnlmuller@gmail.com>
date Wed, 02 Sep 2009 10:47:46 +0000
parents 5494af02a0e8
children fa8d8fc1bf5b
line wrap: on
line diff
--- a/gamelib/gameboard.py	Wed Sep 02 10:45:33 2009 +0000
+++ b/gamelib/gameboard.py	Wed Sep 02 10:47:46 2009 +0000
@@ -374,7 +374,11 @@
                     skip = True # Choose a new position
                     break
             if not skip:
-                fox = animal.Fox((x, y))
+                roll = random.randint(0, 10)
+                if roll < 9:
+                    fox = animal.Fox((x, y))
+                else:
+                    fox = animal.GreedyFox((x, y))
                 self.add_fox(fox)
 
     def fix_buildings(self):