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

@@ -168,6 +168,10 @@ impl Game {
// TODO fight the monster
self.player.change_life(-1);
m.decrease_life(1);
// monster died, player gains experience
if m.is_dead() {
self.player.gain_experience(m.get_experience_gain());
}
return m.is_dead();
}
};