use crate::DrawContext; use crate::Drawable; use crate::SpriteAtlas; use crate::WorldPosition; pub struct Doodad { pub sprite: String, pub pos: WorldPosition, pub scale: u32, pub angle: f64, } impl Drawable for Doodad { fn draw(&self, dc: &mut DrawContext, sa: &SpriteAtlas) -> Result<(), String> { let pos = self.pos.screen_position(dc); let sprite = sa.get(&self.sprite); sprite.draw(dc.canvas, pos, self.angle, 1.0)?; return Ok(()); } }