diff 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
line wrap: on
line diff
--- a/pytouhou/vm/eclrunner.py
+++ b/pytouhou/vm/eclrunner.py
@@ -515,6 +515,12 @@ class ECLRunner(object):
         self._enemy.angle = self._enemy.get_player_angle()
 
 
+    @instruction(52)
+    def move_in_decel(self, duration, angle, speed):
+        self._enemy.angle, self._enemy.speed = angle, speed
+        self._enemy.stop_in(duration, lambda x: 2. * x - x ** 2)
+
+
     @instruction(56)
     def move_to_linear(self, duration, x, y, z):
         self._enemy.move_to(duration,
@@ -923,6 +929,13 @@ class ECLRunner(object):
         self._enemy.remaining_lives = lives
 
 
+    @instruction(132)
+    def set_visible(self, value):
+        self._enemy._visible = bool(value)
+        if self._enemy._sprite:
+            self._enemy._sprite._removed = bool(value)
+
+
     @instruction(131)
     def set_difficulty_coeffs(self, speed_a, speed_b, nb_a, nb_b, shots_a, shots_b):
         self._enemy.difficulty_coeffs = (speed_a, speed_b, nb_a, nb_b, shots_a, shots_b)