musique_et_son_niels #36

Merged
zacharie merged 6 commits from musique_et_son_niels into main 2025-08-18 15:28:28 +00:00
Showing only changes of commit a74a19eb2f - Show all commits

View File

@ -37,6 +37,7 @@ func _on_inventory_updated(_inventory: Inventory):
func get_input():
if controlling_player:
var old_velocity=velocity
calculate_direction()
if Input.is_action_just_pressed("action") and energy > 0:
@ -46,6 +47,8 @@ func get_input():
if Input.is_action_just_pressed("drop") and inventory.lenght() > 0:
var item_to_drop = inventory.pop_item()
planet.drop_item(item_to_drop, global_position)
if old_velocity.length()==0 and velocity.length()!=0:
$Audio/AudioStreamPlayer_movement.play()
func calculate_direction():
var input_direction: Vector2 = Input.get_vector("move_left", "move_right", "move_up", "move_down")