step to xp

This commit is contained in:
2023-12-22 20:10:30 +01:00
parent 6082a740e9
commit de5ea76913
4 changed files with 24 additions and 1 deletions

View File

@@ -67,10 +67,11 @@ fn main() -> Result<()> {
height: 25,
};
frame.render_widget(
Paragraph::new(format!("{}\nHealth: {}/{}\nGold: {}\nLevel: {}",
Paragraph::new(format!("{}\nHealth: {}/{}\nExp: {}\nGold: {}\nLevel: {}",
game.get_player().get_name(),
game.get_player().get_life(),
game.get_player().get_max_life(),
game.get_player().get_experience(),
game.get_player().get_gold(),
game.get_player().get_immutable_position().get_level()))
.white()
@@ -131,6 +132,7 @@ fn main() -> Result<()> {
"Congratulation! You mastered your way through the dungeon and won the game.".to_string()
}
};
text += format!("\nYou gained {} experience.", game.get_player().get_experience()).as_str();
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);