17 lines
322 B
GDScript
17 lines
322 B
GDScript
extends Area2D
|
|
class_name DragonEntity
|
|
|
|
|
|
signal on_pick(position)
|
|
|
|
|
|
func _ready() -> void:
|
|
set_process_input(true)
|
|
|
|
|
|
func _input_event(viewport, event, shape_idx) -> void:
|
|
if event is InputEventMouseButton \
|
|
and event.button_index == MOUSE_BUTTON_LEFT \
|
|
and event.is_pressed():
|
|
on_pick.emit(position)
|
|
queue_free()
|