diff pytouhou/vm/eclrunner.py @ 77:6fa6d74a049a

Handle a new ECL instruction, and add some names.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Tue, 30 Aug 2011 18:44:58 -0700
parents f305c0e406d6
children bcf965ede96c
line wrap: on
line diff
--- a/pytouhou/vm/eclrunner.py
+++ b/pytouhou/vm/eclrunner.py
@@ -245,6 +245,12 @@ class ECLRunner(object):
         self._setval(variable_id, self._getval(a) / self._getval(b))
 
 
+    @instruction(25)
+    def get_direction(self, variable_id, x1, y1, x2, y2):
+        #TODO: takes only floats.
+        self._setval(variable_id, math.atan2(self._getval(y2) - self._getval(y1), self._getval(x2) - self._getval(x1)))
+
+
     @instruction(27)
     @instruction(28)
     def compare(self, a, b):