Mercurial > touhou
diff pytouhou/vm/anmrunner.py @ 240:02de1563fa18
Fix ANM wait, translation/rotation order, and partially implement ANM0 instruction 24
author | Thibaut Girka <thib@sitedethib.com> |
---|---|
date | Sun, 01 Jan 2012 23:51:01 +0100 |
parents | 901489c21d19 |
children | 3893a6fc66f1 |
line wrap: on
line diff
--- a/pytouhou/vm/anmrunner.py +++ b/pytouhou/vm/anmrunner.py @@ -58,12 +58,9 @@ class ANMRunner(object): if not self._running: return False - if self.waiting: - return True - sprite = self._sprite - while self._running: + while self._running and not self.waiting: frame, opcode, args = self.script[self.instruction_pointer] if frame > self.frame: @@ -79,6 +76,10 @@ class ANMRunner(object): else: callback(self, *args) sprite._changed = True + + if self.waiting: + return True + self.frame += 1 # Update sprite @@ -230,6 +231,14 @@ class ANMRunner(object): self._sprite.corner_relative_placement = True #TODO + @instruction(24) + def wait_ex(self): + """Hide/delete the sprite and wait for an interrupt. + """ + #TODO: Hide/delete the sprite and figure what happens exactly + self.waiting = True + + @instruction(25) def set_allow_dest_offset(self, value): self._sprite.allow_dest_offset = bool(value)