diff --git a/entities/player/scripts/player.gd b/entities/player/scripts/player.gd index 8e81655..6cf236f 100644 --- a/entities/player/scripts/player.gd +++ b/entities/player/scripts/player.gd @@ -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")