comparison pytouhou/vm/eclrunner.py @ 128:8ba018617829

Fix Cirno's freezing bullets
author Thibaut Girka <thib@sitedethib.com>
date Sat, 10 Sep 2011 16:21:59 +0200
parents 5d9052b9a4e8
children e9ac3640280b
comparison
equal deleted inserted replaced
127:81e05aed8db5 128:8ba018617829
767 def call_special_function(self, function, arg): 767 def call_special_function(self, function, arg):
768 if function == 0: # Cirno 768 if function == 0: # Cirno
769 if arg == 0: 769 if arg == 0:
770 for bullet in self._game_state.bullets: 770 for bullet in self._game_state.bullets:
771 bullet.speed = bullet.angle = 0. 771 bullet.speed = bullet.angle = 0.
772 bullet.set_anim(sprite_idx_offset=0) #TODO: check 772 bullet.delta = (0., 0.)
773 bullet.set_anim(sprite_idx_offset=15) #TODO: check
773 else: 774 else:
774 for bullet in self._game_state.bullets: 775 for bullet in self._game_state.bullets:
775 bullet.speed = 2.0 #TODO 776 bullet.speed = 2.0 #TODO
776 bullet.angle = self._game_state.prng.rand_double() * pi #TODO 777 bullet.angle = self._game_state.prng.rand_double() * pi #TODO
778 bullet.delta = (cos(bullet.angle) * bullet.speed, sin(bullet.angle) * bullet.speed)
777 else: 779 else:
778 logger.warn("Unimplemented special function %d!", function) 780 logger.warn("Unimplemented special function %d!", function)
779 781
780 782
781 @instruction(123) 783 @instruction(123)