diff --git a/scripts/player/player.gd b/scripts/player/player.gd index d4a27a1..5ebcc32 100644 --- a/scripts/player/player.gd +++ b/scripts/player/player.gd @@ -39,6 +39,12 @@ func change_state(new_state): new_state.enter_from(state) state = new_state +func _process(delta): + if health > 0: + var hunger_timer = $"%hunger_timer" + var stomach = $"%stomachs".get_child(health - 1) + stomach.material.set_shader_param("percent", 1.0 - hunger_timer.time_left / hunger_timer.wait_time) + func _physics_process(delta): state.physics_process(delta)