(&mut self, ctx: &mut Context)
| 62 | } |
| 63 | |
| 64 | fn draw(&mut self, ctx: &mut Context) -> tetra::Result { |
| 65 | graphics::clear(ctx, Color::BLACK); |
| 66 | |
| 67 | self.console.clear(); |
| 68 | |
| 69 | for (x, y, tile) in self.resources.map.tile_positions() { |
| 70 | self.console.set_bg(x, y, tile.color); |
| 71 | } |
| 72 | |
| 73 | let mut sprite_query = self |
| 74 | .world |
| 75 | .query::<(&components::Position, &components::Sprite)>(); |
| 76 | |
| 77 | for (_, (position, sprite)) in sprite_query.iter() { |
| 78 | self.console |
| 79 | .set_char(position.x, position.y, sprite.character); |
| 80 | self.console.set_fg(position.x, position.y, sprite.color); |
| 81 | } |
| 82 | |
| 83 | self.console.draw(ctx); |
| 84 | |
| 85 | Ok(()) |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | fn main() -> tetra::Result { |
nothing calls this directly
no test coverage detected