Add current level to HUD

This commit is contained in:
Daniel Lynn 2021-07-10 21:40:51 -05:00
parent 5d22e4d1dc
commit bcf373b84a

View File

@ -30,10 +30,16 @@ pub fn hud(ecs: &SubWorld) {
ColorPair::new(WHITE, RED),
);
let player = <(Entity, &Player)>::query()
let (player, map_level) = <(Entity, &Player)>::query()
.iter(ecs)
.find_map(|(entity, _player)| Some(*entity))
.find_map(|(entity, player)| Some((*entity, player.map_level)))
.unwrap();
draw_batch.print_color_right(
Point::new(SCREEN_WIDTH * 2, 1),
format!("Dungeon Level: {}", map_level + 1),
ColorPair::new(YELLOW, BLACK),
);
let mut item_query = <(&Item, &Name, &Carried)>::query();
let mut y = 3;
item_query