feat: choose outfit from library when creating a dragon

This commit is contained in:
Gerard Gascón 2025-04-08 23:02:17 +02:00
parent fd8609c0ab
commit f07b28d2dc
22 changed files with 370 additions and 17 deletions

View file

@ -2,7 +2,9 @@ extends Area2D
class_name DragonEntity
signal on_pick(position)
@export var dragon: DragonSprite
signal on_pick(position: Vector2, hat: Texture2D, shirt: Texture2D, shoes: Texture2D)
func _ready() -> void:
@ -13,5 +15,9 @@ 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)
on_pick.emit(position, dragon.hat.texture, dragon.shirt.texture, dragon.shoes.texture)
queue_free()
func dress(hat: Texture2D, shirt: Texture2D, shoes: Texture2D):
dragon.dress(hat, shirt, shoes)