diff --git a/src/main.rs b/src/main.rs index 1c74556..4e98854 100644 --- a/src/main.rs +++ b/src/main.rs @@ -120,17 +120,19 @@ fn main() -> Result<()> { .border_style(Style::default().fg(Color::White)) .border_type(BorderType::Rounded) .style(Style::default().bg(Color::Black)); - let paragraph = match game.get_game_state() { + let mut text = match game.get_game_state() { GameState::RUNNING => { - Paragraph::new("Quitting is for cowards! You'll better try again!") + "Quitting is for cowards! You'll better try again!".to_string() } GameState::LOST => { - Paragraph::new("Sorry, you died in the dungeon. Better luck next time!") + "Sorry, you died in the dungeon. Better luck next time!".to_string() } GameState::WON => { - Paragraph::new("Congratulation! You mastered your way through the dungeon and won the game.") + "Congratulation! You mastered your way through the dungeon and won the game.".to_string() } - }.block(block).wrap(Wrap { trim: true }); + }; + text += format!("\nYou collected {} gold.", game.get_player().get_gold()).as_str(); + let paragraph = Paragraph::new(text).block(block).wrap(Wrap { trim: true }); frame.render_widget(paragraph, area); }); if event::poll(std::time::Duration::from_millis(16))? {