-enum CameraInput {MOUSE, JOYSTICK}
-var _camera_input_method := CameraInput.MOUSE
-
-
-func _ready() -> void:
- _camera_spring.spring_length = camera_distance
-
-
-
-#######
-# input
-#######
-
-func _unhandled_input(event: InputEvent) -> void:
- # If user clicks on the window, capture the mouse and direct the camera with it
- if Input.get_mouse_mode() != Input.MOUSE_MODE_CAPTURED:
- return
-
- #_camera_input_direction *= mouse_sensitivity
- if event is InputEventMouseMotion:
- _camera_input_method = CameraInput.MOUSE
- _camera_input_direction = event.screen_relative * mouse_sensitivity
- elif event is InputEventJoypadMotion:
- # TODO: add these settings!
- _camera_input_method = CameraInput.JOYSTICK
- _camera_input_direction = Input.get_vector("camera-left", "camera-right", "camera-up", "camera-down")
- _camera_input_direction *= Vector2(joystick_sensitivity_x, -joystick_sensitivity_y)
-
-
-func _input(event: InputEvent):
- if event.is_action_pressed("player-dash"):
- _skin.transition_dash()
- _player_dash()
- elif event.is_action_pressed("player-slash"):
- _skin.sword_visible()
- _skin.transition_slash()
- elif event.is_action_pressed("player-shoot"):
- _skin.gun_visible()
- _skin.transition_gunfire()
-