comparison gamelib/gameboard.py @ 94:fa8d8fc1bf5b

Added some sounds
author David Fraser <davidf@sjsoft.com>
date Wed, 02 Sep 2009 11:25:42 +0000
parents bea1b9364583
children a851461d345e
comparison
equal deleted inserted replaced
93:1fd56b625b24 94:fa8d8fc1bf5b
9 import icons 9 import icons
10 import constants 10 import constants
11 import buildings 11 import buildings
12 import animal 12 import animal
13 import equipment 13 import equipment
14 import sound
14 15
15 class OpaqueLabel(gui.Label): 16 class OpaqueLabel(gui.Label):
16 def paint(self, s): 17 def paint(self, s):
17 s.fill(self.style.background) 18 s.fill(self.style.background)
18 gui.Label.paint(self, s) 19 gui.Label.paint(self, s)
192 return 193 return
193 if len(self.chickens) == 1: 194 if len(self.chickens) == 1:
194 print "You can't sell your last chicken!" 195 print "You can't sell your last chicken!"
195 return 196 return
196 self.add_cash(constants.SELL_PRICE_CHICKEN) 197 self.add_cash(constants.SELL_PRICE_CHICKEN)
198 sound.play_sound("chicken4.ogg")
197 self.remove_chicken(chick) 199 self.remove_chicken(chick)
198 200
199 def buy_fence(self, tile_pos): 201 def buy_fence(self, tile_pos):
200 this_tile = self.tv.get(tile_pos) 202 this_tile = self.tv.get(tile_pos)
201 if this_tile not in [self.GRASSLAND, self.BROKEN_FENCE]: 203 if this_tile not in [self.GRASSLAND, self.BROKEN_FENCE]: