feat: instantiate dragons with initial animation
This commit is contained in:
parent
48b6cd42cf
commit
c422a83f59
6 changed files with 62 additions and 9 deletions
|
@ -7,9 +7,13 @@ var dragging_start_position: Vector2i = Vector2i()
|
|||
|
||||
@onready var dragon: Dragon = $".."
|
||||
|
||||
var _initial_drag_requested: bool = false
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
set_process_input(true)
|
||||
if _initial_drag_requested:
|
||||
initial_drag()
|
||||
|
||||
|
||||
func initial_drag():
|
||||
|
@ -17,6 +21,10 @@ func initial_drag():
|
|||
dragging = true
|
||||
|
||||
|
||||
func queue_initial_drag():
|
||||
_initial_drag_requested = true
|
||||
|
||||
|
||||
func _input(event) -> void:
|
||||
if event is not InputEventMouseButton:
|
||||
return
|
||||
|
|
|
@ -23,7 +23,7 @@ func on_place_back() -> void:
|
|||
|
||||
|
||||
func start_dragon_drag()-> void:
|
||||
draggable.initial_drag()
|
||||
draggable.queue_initial_drag()
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if draggable.dragging:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue