comparison pytouhou/vm/eclrunner.py @ 183:b6d7ce644f34

Implement two new ECL instructions.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Wed, 26 Oct 2011 02:27:00 -0700
parents 20843875ad8f
children 68e6d3faeee6
comparison
equal deleted inserted replaced
182:20843875ad8f 183:b6d7ce644f34
513 #TODO: unknown 513 #TODO: unknown
514 self._enemy.speed = speed 514 self._enemy.speed = speed
515 self._enemy.angle = self._enemy.get_player_angle() 515 self._enemy.angle = self._enemy.get_player_angle()
516 516
517 517
518 @instruction(52)
519 def move_in_decel(self, duration, angle, speed):
520 self._enemy.angle, self._enemy.speed = angle, speed
521 self._enemy.stop_in(duration, lambda x: 2. * x - x ** 2)
522
523
518 @instruction(56) 524 @instruction(56)
519 def move_to_linear(self, duration, x, y, z): 525 def move_to_linear(self, duration, x, y, z):
520 self._enemy.move_to(duration, 526 self._enemy.move_to(duration,
521 self._getval(x), self._getval(y), self._getval(z), 527 self._getval(x), self._getval(y), self._getval(z),
522 lambda x: x) 528 lambda x: x)
921 @instruction(126) 927 @instruction(126)
922 def set_remaining_lives(self, lives): 928 def set_remaining_lives(self, lives):
923 self._enemy.remaining_lives = lives 929 self._enemy.remaining_lives = lives
924 930
925 931
932 @instruction(132)
933 def set_visible(self, value):
934 self._enemy._visible = bool(value)
935 if self._enemy._sprite:
936 self._enemy._sprite._removed = bool(value)
937
938
926 @instruction(131) 939 @instruction(131)
927 def set_difficulty_coeffs(self, speed_a, speed_b, nb_a, nb_b, shots_a, shots_b): 940 def set_difficulty_coeffs(self, speed_a, speed_b, nb_a, nb_b, shots_a, shots_b):
928 self._enemy.difficulty_coeffs = (speed_a, speed_b, nb_a, nb_b, shots_a, shots_b) 941 self._enemy.difficulty_coeffs = (speed_a, speed_b, nb_a, nb_b, shots_a, shots_b)
929 942