comparison gamelib/animal.py @ 130:96c5ef7613b5

NINJA FOXES!
author Jeremy Thurgood <firxen@gmail.com>
date Wed, 02 Sep 2009 21:40:47 +0000
parents 2e3a05b9594d
children 490ede177f50
comparison
equal deleted inserted replaced
129:8837c6eab0c7 130:96c5ef7613b5
128 128
129 class Fox(Animal): 129 class Fox(Animal):
130 """A fox""" 130 """A fox"""
131 131
132 STEALTH = 20 132 STEALTH = 20
133 IMAGE_FILE = 'sprites/fox.png'
133 134
134 costs = { 135 costs = {
135 # weighting for movement calculation 136 # weighting for movement calculation
136 'grassland' : 2, 137 'grassland' : 2,
137 'woodland' : 1, # Try to keep to the woods if possible 138 'woodland' : 1, # Try to keep to the woods if possible
140 'guardtower' : 2, # We can pass under towers 141 'guardtower' : 2, # We can pass under towers
141 'henhouse' : 2, 142 'henhouse' : 2,
142 } 143 }
143 144
144 def __init__(self, pos): 145 def __init__(self, pos):
145 image_left = imagecache.load_image('sprites/fox.png') 146 image_left = imagecache.load_image(self.IMAGE_FILE)
146 image_right = imagecache.load_image('sprites/fox.png', 147 image_right = imagecache.load_image(self.IMAGE_FILE, ("right_facing",))
147 ("right_facing",))
148 Animal.__init__(self, image_left, image_right, pos) 148 Animal.__init__(self, image_left, image_right, pos)
149 self.landmarks = [self.pos] 149 self.landmarks = [self.pos]
150 self.hunting = True 150 self.hunting = True
151 self.dig_pos = None 151 self.dig_pos = None
152 self.tick = 0 152 self.tick = 0
318 318
319 class NinjaFox(Fox): 319 class NinjaFox(Fox):
320 """Ninja foxes are hard to see""" 320 """Ninja foxes are hard to see"""
321 321
322 STEALTH = 60 322 STEALTH = 60
323 IMAGE_FILE = 'sprites/ninja_fox.png'
323 324
324 class DemoFox(Fox): 325 class DemoFox(Fox):
325 """Demolition Foxes destroy fences easily""" 326 """Demolition Foxes destroy fences easily"""
326 327
327 class GreedyFox(Fox): 328 class GreedyFox(Fox):