game: add xp bar
This commit is contained in:
@@ -96,11 +96,12 @@ func toggle_god_mode(value: bool):
|
||||
|
||||
func add_xp(amount: float) -> void:
|
||||
player_stats.current_xp += amount
|
||||
main_ui.player_ui.update_xp()
|
||||
_check_level_up()
|
||||
|
||||
|
||||
func _check_level_up() -> void:
|
||||
var required_for_level = 25.0
|
||||
var required_for_level = player_stats.xp_required_for_level()
|
||||
if player_stats.current_xp >= required_for_level:
|
||||
player_stats.current_level += 1
|
||||
player_stats.current_xp -= required_for_level
|
||||
|
Reference in New Issue
Block a user