diff src/th06/anm0_vm.rs @ 658:3a9d82a02c88

Add a contructor for enemy, and a new example.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 10 Aug 2019 12:48:01 +0200
parents 988e5130fb00
children 598f3125cbac
line wrap: on
line diff
--- a/src/th06/anm0_vm.rs
+++ b/src/th06/anm0_vm.rs
@@ -252,6 +252,11 @@ impl AnmRunner {
         runner
     }
 
+    /// Get a Rc from the inner Sprite.
+    pub fn get_sprite(&self) -> Rc<RefCell<Sprite>> {
+        self.sprite.clone()
+    }
+
     /// Trigger an interrupt.
     pub fn interrupt(&mut self, interrupt: i32) -> bool {
         let mut new_ip = self.script.interrupts.get(&interrupt);