I had to use DrawBatch to get the game over screen to display:
fn game_over(&mut self, ctx: &mut BTerm) {
let mut draw_batch = DrawBatch::new();
draw_batch.target(2);
draw_batch.print_color_centered(2,
“Your quest has ended.”,
ColorPair::new(RED, BLACK));
draw_batch.print_color_centered(4,
“Slain by a monster, your hero’s journey has come to a premature end.”,
ColorPair::new(WHITE, BLACK));
draw_batch.print_color_centered(5,
“The Amulet of Yala remains unclaimed, and your home town is not saved.”,
ColorPair::new(WHITE, BLACK));
draw_batch.print_color_centered(8,
“Don’t worry, you can always try again with a new hero.”,
ColorPair::new(YELLOW, BLACK));
draw_batch.print_color_centered(9,
“Press 1 to play agin.”,
ColorPair::new(GREEN, BLACK));
draw_batch.submit(12000).expect(“Batch error”);
if let Some(VirtualKeyCode::Key1) = ctx.key {
self.ecs = World::default();
self.resources = Resources::default();
let mut rng = RandomNumberGenerator::new();
let map_builder = MapBuilder::new(&mut rng);
spawn_player(&mut self.ecs, map_builder.player_start);
map_builder.rooms
.iter()
.skip(1)
.map(|r| r.center())
.for_each(|pos| spawn_monster(&mut self.ecs, &mut rng, pos));
self.resources.insert(map_builder.map);
self.resources.insert(Camera::new(map_builder.player_start));
self.resources.insert(TurnState::AwaitingInput);
}
}