#57 rework des inputs et actions

This commit is contained in:
2025-09-05 15:11:29 +02:00
parent 3d0104ed4a
commit 2dc365736f
21 changed files with 490 additions and 358 deletions

View File

@@ -7,6 +7,8 @@ func _on_player_updated(player:Player):
%EnergyCount.text = str(player.energy) + "/" + str(player.max_energy)
%EnergyInfo.modulate = Color.WHITE if player.energy > 0 else Color.RED
update_no_energy_left_info(player.energy)
%ItemInfo.visible = player.inventory.get_item() != null
if player.inventory.get_item():
var item : Item = player.inventory.get_item()
@@ -34,14 +36,17 @@ func _on_pause_pressed():
func _on_player_upgraded():
$AnimationPlayer.play("upgrade")
func _on_player_action_not_permitted():
$AnimationPlayer.play("not_permitted")
$EffectAnimation.play("upgrade")
func _on_planet_pass_day_started(planet):
$AnimationPlayer.speed_scale = 1/(planet.PASS_DAY_ANIMATION_TIME)
$AnimationPlayer.play("pass_day")
await $AnimationPlayer.animation_finished
$AnimationPlayer.speed_scale = 1
$PassDayAnimation.speed_scale = 1/(planet.PASS_DAY_ANIMATION_TIME)
$PassDayAnimation.play("pass_day")
await $PassDayAnimation.animation_finished
$PassDayAnimation.speed_scale = 1
func update_no_energy_left_info(energy):
if energy == 0 and not %NoEnergyLeft.visible:
%NoEnergyLeft.visible = true
$NoEnergyLeftAnimation.play("no_energy_left_appear")
elif energy != 0 and %NoEnergyLeft.visible:
%NoEnergyLeft.visible = false