Mercurial > touhou
comparison 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 |
comparison
equal
deleted
inserted
replaced
657:ff7b6355cdf1 | 658:3a9d82a02c88 |
---|---|
248 sprite_index_offset: sprite_index_offset, | 248 sprite_index_offset: sprite_index_offset, |
249 }; | 249 }; |
250 runner.run_frame(); | 250 runner.run_frame(); |
251 runner.sprite_index_offset = 0; | 251 runner.sprite_index_offset = 0; |
252 runner | 252 runner |
253 } | |
254 | |
255 /// Get a Rc from the inner Sprite. | |
256 pub fn get_sprite(&self) -> Rc<RefCell<Sprite>> { | |
257 self.sprite.clone() | |
253 } | 258 } |
254 | 259 |
255 /// Trigger an interrupt. | 260 /// Trigger an interrupt. |
256 pub fn interrupt(&mut self, interrupt: i32) -> bool { | 261 pub fn interrupt(&mut self, interrupt: i32) -> bool { |
257 let mut new_ip = self.script.interrupts.get(&interrupt); | 262 let mut new_ip = self.script.interrupts.get(&interrupt); |