comparison gamelib/engine.py @ 98:725b292ca07b

Added sounds killing foxes and chickens, and nightfall Renamed sounds for clarity
author David Fraser <davidf@sjsoft.com>
date Wed, 02 Sep 2009 12:14:24 +0000
parents fa8d8fc1bf5b
children f5d56688943b
comparison
equal deleted inserted replaced
97:529a4d41c67a 98:725b292ca07b
45 class DayState(State): 45 class DayState(State):
46 def init(self): 46 def init(self):
47 """Add some chickens to the farm""" 47 """Add some chickens to the farm"""
48 self.game.gameboard.tv.sun(True) 48 self.game.gameboard.tv.sun(True)
49 49
50 sound.play_sound("chicken5.ogg") 50 sound.play_sound("daybreak.ogg")
51 # disable timer 51 # disable timer
52 pygame.time.set_timer(MOVE_FOX_ID, 0) 52 pygame.time.set_timer(MOVE_FOX_ID, 0)
53 self.game.gameboard.clear_foxes() 53 self.game.gameboard.clear_foxes()
54 self.game.gameboard.update_chickens() 54 self.game.gameboard.update_chickens()
55 55
79 class NightState(State): 79 class NightState(State):
80 def init(self): 80 def init(self):
81 """Add some foxes to the farm""" 81 """Add some foxes to the farm"""
82 self.game.gameboard.tv.sun(False) 82 self.game.gameboard.tv.sun(False)
83 83
84 sound.play_sound("nightfall.ogg")
84 # Add a timer to the event queue 85 # Add a timer to the event queue
85 self.cycle_count = 0 86 self.cycle_count = 0
86 pygame.time.set_timer(MOVE_FOX_ID, 200) 87 pygame.time.set_timer(MOVE_FOX_ID, 200)
87 self.game.gameboard.spawn_foxes() 88 self.game.gameboard.spawn_foxes()
88 89