feat: improved dragon walking behaviour
This commit is contained in:
parent
b4594bdd43
commit
d8419cb9a4
8 changed files with 150 additions and 66 deletions
|
@ -9,6 +9,9 @@ var dragging_start_position: Vector2i = Vector2i()
|
|||
|
||||
var _initial_drag_requested: bool = false
|
||||
|
||||
signal on_drag()
|
||||
signal on_drop()
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
set_process_input(true)
|
||||
|
@ -33,9 +36,11 @@ func _input(event) -> void:
|
|||
|
||||
if event.pressed:
|
||||
dragging = true
|
||||
on_drag.emit()
|
||||
dragging_start_position = Vector2i(get_global_mouse_position())
|
||||
else:
|
||||
dragging = false
|
||||
on_drop.emit()
|
||||
if _is_inside_main_window():
|
||||
_destroy_dragon()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue