Skip to content

Instantly share code, notes, and snippets.

@icefoxen
Created November 29, 2016 01:29
Show Gist options
  • Save icefoxen/607d40278267f51b59a832f00e00c5c3 to your computer and use it in GitHub Desktop.
Save icefoxen/607d40278267f51b59a832f00e00c5c3 to your computer and use it in GitHub Desktop.
fn draw(&mut self, ctx: &mut Context) -> GameResult<()> {
ctx.renderer.clear();
let world = self.planner.mut_world();
let positions = world.read::<CPosition>();
let playermarkers = world.read::<CPlayer>();
let images = world.read::<CImage>();
for (pos, player, image) in (&positions, &playermarkers, &images).iter() {
println!("Position is: {:?}, {:?}, {:?}", pos, player, image);
let kiwi = self.assets.images.get_mut(image.0);
graphics::draw(ctx, kiwi.unwrap(), None, None)?;
}
ctx.renderer.present();
timer::sleep_until_next_frame(ctx, 60);
Ok(())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment