added sounds to ui and game, prepared interaction with character
This commit is contained in:
parent
b5ace17da9
commit
21d7cf417a
42 changed files with 450 additions and 155 deletions
|
|
@ -1,5 +1,7 @@
|
|||
extends Panel
|
||||
|
||||
signal on_interact
|
||||
|
||||
@onready var talk_a_texture: CompressedTexture2D = preload("res://assets/textures/Xbox Series/Vector/xbox_button_a.svg")
|
||||
@onready var drag_texture: CompressedTexture2D = preload("res://assets/textures/Generic/Vector/generic_button_circle.svg")
|
||||
@onready var thumbstick: TextureRect = %Thumbstick
|
||||
|
|
@ -30,7 +32,8 @@ func _on_gui_input(event: InputEvent) -> void:
|
|||
thumbstick.texture = talk_a_texture
|
||||
|
||||
if event is InputEventScreenTouch and pressed == true:
|
||||
Input.action_press("ui_select")
|
||||
SoundManager.play_sound_effect("ui_click", "UI")
|
||||
on_interact.emit()
|
||||
pressed = false
|
||||
|
||||
if event is InputEventScreenTouch and event.is_pressed():
|
||||
|
|
@ -46,8 +49,10 @@ func _on_gui_input(event: InputEvent) -> void:
|
|||
|
||||
# visual thumbstick movement
|
||||
var thumbstick_position: Vector2 = touch_position - thumbstick.size / 2.0
|
||||
#var clamped_thumbstick_position = thumbstick_position.clampf(-40.0, 40.0)
|
||||
thumbstick.position = thumbstick_position
|
||||
var thumbstick_center: Vector2 = middle - thumbstick.size / 2.0
|
||||
|
||||
var clamped_thumbstick_position: Vector2 = thumbstick_position.clamp(thumbstick_center - Vector2(50.0, 50.0), thumbstick_center + Vector2(50.0, 50.0))
|
||||
thumbstick.position = clamped_thumbstick_position
|
||||
|
||||
# actual value
|
||||
var _delta: Vector2 = middle - touch_position
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue