comparison pytouhou/game/enemy.py @ 343:94fdb6c782c1

Implement sfx for player and enemies.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Wed, 04 Jul 2012 23:41:28 +0200
parents 2350147cf043
children 2c4589370cc6
comparison
equal deleted inserted replaced
342:83c9354ff3ef 343:94fdb6c782c1
88 88
89 def objects(self): 89 def objects(self):
90 return [anm for anm in self.aux_anm if anm] 90 return [anm for anm in self.aux_anm if anm]
91 91
92 92
93 def play_sound(self, index):
94 name = {
95 5: 'power0',
96 6: 'power1',
97 7: 'tan00',
98 8: 'tan01',
99 9: 'tan02',
100 14: 'cat00',
101 16: 'lazer00',
102 17: 'lazer01',
103 18: 'enep01',
104 22: 'tan00', #XXX
105 24: 'tan02', #XXX
106 25: 'kira00',
107 26: 'kira01',
108 27: 'kira02'
109 }[index]
110 self._game.enemy_sfx.play('%s.wav' % name)
111
112
93 def set_bullet_attributes(self, type_, anim, sprite_idx_offset, 113 def set_bullet_attributes(self, type_, anim, sprite_idx_offset,
94 bullets_per_shot, number_of_shots, speed, speed2, 114 bullets_per_shot, number_of_shots, speed, speed2,
95 launch_angle, angle, flags): 115 launch_angle, angle, flags):
96 116
97 # Apply difficulty-specific modifiers 117 # Apply difficulty-specific modifiers