diff pytouhou/vm/eclrunner.py @ 70:7c1f20407b3e

Add set_random_angle support
author Thibaut Girka <thib@sitedethib.com>
date Sat, 27 Aug 2011 11:24:22 +0200
parents a142e57218a0
children adac26098408
line wrap: on
line diff
--- a/pytouhou/vm/eclrunner.py
+++ b/pytouhou/vm/eclrunner.py
@@ -337,8 +337,14 @@ class ECLRunner(object):
         self._enemy.acceleration = acceleration
 
 
+    @instruction(49)
+    def set_random_angle(self, min_angle, max_angle):
+        angle = self._game_state.prng.rand_double() * (max_angle - min_angle) + min_angle
+        self._enemy.angle = angle
+
+
     @instruction(50)
-    def set_random_angle(self, min_angle, max_angle):
+    def set_random_angle_ex(self, min_angle, max_angle):
         if self._enemy.screen_box:
             minx, miny, maxx, maxy = self._enemy.screen_box
         else: