feat: instantiate dragon with drag and drop
This commit is contained in:
parent
610d623653
commit
eb081515c0
2 changed files with 6 additions and 1 deletions
|
@ -12,6 +12,11 @@ func _ready() -> void:
|
||||||
set_process_input(true)
|
set_process_input(true)
|
||||||
|
|
||||||
|
|
||||||
|
func initial_drag():
|
||||||
|
dragging_start_position = get_global_mouse_position()
|
||||||
|
dragging = true
|
||||||
|
|
||||||
|
|
||||||
func _input(event) -> void:
|
func _input(event) -> void:
|
||||||
if event is not InputEventMouseButton:
|
if event is not InputEventMouseButton:
|
||||||
return
|
return
|
||||||
|
|
|
@ -20,7 +20,7 @@ func on_place_back() -> void:
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
_pick_random_screen_position()
|
draggable.initial_drag()
|
||||||
|
|
||||||
|
|
||||||
func _process(delta: float) -> void:
|
func _process(delta: float) -> void:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue