comparison pytouhou/game/game.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 61caded6b4f5
children 488c094ed51d
comparison
equal deleted inserted replaced
342:83c9354ff3ef 343:94fdb6c782c1
326 if player.state.invulnerable_time == 0: 326 if player.state.invulnerable_time == 0:
327 player.collide() 327 player.collide()
328 elif laser.check_grazing((px, py)): 328 elif laser.check_grazing((px, py)):
329 player.state.graze += 1 #TODO 329 player.state.graze += 1 #TODO
330 player.state.score += 500 #TODO 330 player.state.score += 500 #TODO
331 player.play_sound('graze')
331 self.modify_difficulty(+6) #TODO 332 self.modify_difficulty(+6) #TODO
332 self.new_particle((px, py), 0, .8, 192) #TODO 333 self.new_particle((px, py), 0, .8, 192) #TODO
333 334
334 for bullet in self.bullets: 335 for bullet in self.bullets:
335 if bullet.state != LAUNCHED: 336 if bullet.state != LAUNCHED:
349 elif not bullet.grazed and not (bx2 < gx1 or bx1 > gx2 350 elif not bullet.grazed and not (bx2 < gx1 or bx1 > gx2
350 or by2 < gy1 or by1 > gy2): 351 or by2 < gy1 or by1 > gy2):
351 bullet.grazed = True 352 bullet.grazed = True
352 player.state.graze += 1 353 player.state.graze += 1
353 player.state.score += 500 # found experimentally 354 player.state.score += 500 # found experimentally
355 player.play_sound('graze')
354 self.modify_difficulty(+6) 356 self.modify_difficulty(+6)
355 self.new_particle((px, py), 0, .8, 192) #TODO: find the real size and range. 357 self.new_particle((px, py), 0, .8, 192) #TODO: find the real size and range.
356 #TODO: display a static particle during one frame at 358 #TODO: display a static particle during one frame at
357 # 12 pixels of the player, in the axis of the “collision”. 359 # 12 pixels of the player, in the axis of the “collision”.
358 360