comparison src/th06/enemy.rs @ 698:05e0425a8bc5

ecl_vm: enable SetDeathCallback.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Fri, 23 Aug 2019 02:37:21 +0200
parents 14fddc27e6f5
children 2a60f12bd5bd
comparison
equal deleted inserted replaced
697:600eb0a69b25 698:05e0425a8bc5
55 dy: other.y - self.y, 55 dy: other.y - self.y,
56 } 56 }
57 } 57 }
58 } 58 }
59 59
60 #[derive(Debug, Clone)] 60 type Callback = i32;
61 struct Callback;
62 61
63 #[derive(Debug, Clone)] 62 #[derive(Debug, Clone)]
64 /// XXX 63 /// XXX
65 pub struct Laser { 64 pub struct Laser {
66 /// XXX 65 /// XXX
249 pub(crate) bullet_offset: Offset, 248 pub(crate) bullet_offset: Offset,
250 pub(crate) movement_dependant_sprites: Option<(u8, u8, u8, u8)>, 249 pub(crate) movement_dependant_sprites: Option<(u8, u8, u8, u8)>,
251 pub(crate) screen_box: Option<(f32, f32, f32, f32)>, 250 pub(crate) screen_box: Option<(f32, f32, f32, f32)>,
252 251
253 // Callbacks. 252 // Callbacks.
254 death_callback: Option<Callback>, 253 pub(crate) death_callback: Option<Callback>,
255 boss_callback: Option<Callback>, 254 pub(crate) boss_callback: Option<Callback>,
256 low_life_callback: Option<Callback>, 255 pub(crate) low_life_callback: Option<Callback>,
257 timeout_callback: Option<Callback>, 256 pub(crate) timeout_callback: Option<Callback>,
258 257
259 // Laser. 258 // Laser.
260 pub(crate) laser_by_id: HashMap<u32, Laser>, 259 pub(crate) laser_by_id: HashMap<u32, Laser>,
261 260
262 // Options. 261 // Options.