From a8b292aa0342ee737b8780682c336bfe9b76601f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerard=20Gasc=C3=B3n?= <52170489+GerardGascon@users.noreply.github.com> Date: Sat, 12 Apr 2025 20:35:40 +0200 Subject: [PATCH] chore: dragon editor --- scenes/dragon_editor/dragon_editor.gd | 60 +- scenes/dragon_editor/dragon_editor.tscn | 1152 +---------------------- src/dragon_outfit.gd | 12 +- 3 files changed, 70 insertions(+), 1154 deletions(-) diff --git a/scenes/dragon_editor/dragon_editor.gd b/scenes/dragon_editor/dragon_editor.gd index 64d111f..73470ed 100644 --- a/scenes/dragon_editor/dragon_editor.gd +++ b/scenes/dragon_editor/dragon_editor.gd @@ -2,14 +2,14 @@ extends Window class_name DragonEditor -@onready var hat: TextureRect = $CanvasLayer/Dragon/Hat -@onready var shirt: TextureRect = $CanvasLayer/Dragon/Shirt -@onready var shoes: TextureRect = $CanvasLayer/Dragon/Shoes -@onready var dragon: TextureRect = $CanvasLayer/Dragon +@onready var hat: AnimatedSprite2D = $CanvasLayer/Dragon/Hat +@onready var shirt: AnimatedSprite2D = $CanvasLayer/Dragon/Shirt +@onready var decor: AnimatedSprite2D = $CanvasLayer/Dragon/Decor +@onready var dragon: AnimatedSprite2D = $CanvasLayer/Dragon @export var hat_outfits: DragonOutfit @export var shirt_outfits: DragonOutfit -@export var shoes_outfits: DragonOutfit +@export var decor_outfits: DragonOutfit @export var dragon_colors: DragonOutfit @onready var dragon_name: LineEdit = $CanvasLayer/NameLabel/LineEdit @@ -20,9 +20,15 @@ signal on_create_dragon(properties: DragonProperties) func _ready() -> void: - hat.texture = null - shirt.texture = null - shoes.texture = null + hat.visible = false + shirt.visible = false + decor.visible = false + dragon.play('idle') + + hat_outfits.index = 0 + shirt_outfits.index = 0 + decor_outfits.index = 0 + dragon_colors.index = 0 dragger.on_drag.connect(_on_drag) @@ -32,34 +38,50 @@ func _on_drag(offset: Vector2i): func _on_next_color_pressed() -> void: - dragon.texture = dragon_colors.pick_next() + _pick_next_animation(dragon, dragon_colors) func _on_previous_color_pressed() -> void: - dragon.texture = dragon_colors.pick_previous() + _pick_previous_animation(dragon, dragon_colors) func _on_change_hat_pressed() -> void: - hat.texture = hat_outfits.pick_next() + _pick_next_animation(hat, hat_outfits) func _on_change_shirt_pressed() -> void: - shirt.texture = shirt_outfits.pick_next() + _pick_next_animation(shirt, shirt_outfits) func _on_change_shoes_pressed() -> void: - shoes.texture = shoes_outfits.pick_next() + _pick_next_animation(decor, decor_outfits) + + +func _pick_next_animation(sprite: AnimatedSprite2D, outfits: DragonOutfit): + var animation: SpriteFrames = outfits.pick_next() + if animation == null: + sprite.visible = false + return + sprite.visible = true + sprite.set_sprite_frames(animation) + sprite.play('idle') + + +func _pick_previous_animation(sprite: AnimatedSprite2D, outfits: DragonOutfit): + var animation: SpriteFrames = outfits.pick_previous() + if animation == null: + sprite.visible = false + return + sprite.visible = true + sprite.set_sprite_frames(animation) + sprite.play('idle') func _on_create_pressed() -> void: if dragon_name.text.is_empty(): return - - var hat_index: int = hat_outfits.get_index(hat.texture) - var shirt_index: int = shirt_outfits.get_index(shirt.texture) - var decor_index: int = shoes_outfits.get_index(shoes.texture) - var color_index: int = dragon_colors.get_index(dragon.texture) - var properties = DragonProperties.new(dragon_name.text, "tower", color_index, hat_index, shirt_index, decor_index) + + var properties = DragonProperties.new(dragon_name.text, "tower", hat_outfits.index, shirt_outfits.index, decor_outfits.index, dragon_colors.index) on_create_dragon.emit(properties) queue_free() diff --git a/scenes/dragon_editor/dragon_editor.tscn b/scenes/dragon_editor/dragon_editor.tscn index 31fa960..600ae81 100644 --- a/scenes/dragon_editor/dragon_editor.tscn +++ b/scenes/dragon_editor/dragon_editor.tscn @@ -1,1092 +1,21 @@ -[gd_scene load_steps=165 format=3 uid="uid://fut42ruut302"] +[gd_scene load_steps=23 format=3 uid="uid://fut42ruut302"] [ext_resource type="Script" uid="uid://bfuos2kgfgber" path="res://scenes/dragon_editor/dragon_editor.gd" id="1_8vkll"] [ext_resource type="SpriteFrames" uid="uid://ccxyplt2t7t6y" path="res://assets/animations/hats/barretina.tres" id="2_aystc"] -[ext_resource type="Script" uid="uid://rw26nny160xh" path="res://src/dragon_outfit.gd" id="3_x0448"] -[ext_resource type="Texture2D" uid="uid://c7nmelv0lx3i3" path="res://assets/sprites/decor/DP_acc_escut_Anim.png" id="4_aystc"] -[ext_resource type="Texture2D" uid="uid://drnel2cjwf5dr" path="res://assets/sprites/decor/DP_acc_espasa_Anim.png" id="5_x0448"] -[ext_resource type="Texture2D" uid="uid://dbbcv076jh4ep" path="res://assets/sprites/decor/DP_acc_rosa_Anim.png" id="6_hukd7"] +[ext_resource type="Resource" uid="uid://x063x858re3f" path="res://assets/outfits/hats.tres" id="2_vvtct"] +[ext_resource type="Resource" uid="uid://bsydervvb1jpe" path="res://assets/outfits/shirts.tres" id="3_xhgxf"] +[ext_resource type="Resource" uid="uid://dkm7d10c1lp2n" path="res://assets/outfits/decor.tres" id="4_1ivi1"] +[ext_resource type="Resource" uid="uid://c03ejnvavmcj5" path="res://assets/outfits/dragons.tres" id="5_1ivi1"] +[ext_resource type="SpriteFrames" uid="uid://c5rqqy7b5ihi5" path="res://assets/animations/decor/rosa.tres" id="6_c4sli"] [ext_resource type="Texture2D" uid="uid://dceoy4417v83e" path="res://assets/sprites/ui/DP_UI_CharCreation_BG.png" id="6_udwtk"] [ext_resource type="Script" uid="uid://dxl7onk7x6h8b" path="res://src/draggable.gd" id="7_1vw8k"] -[ext_resource type="Texture2D" uid="uid://clp02nlyac2g8" path="res://assets/sprites/dragons/DP_drac02_Anim.png" id="7_6eo4l"] [ext_resource type="Texture2D" uid="uid://bu5xa7tgfk3h3" path="res://assets/sprites/ui/DP_UI_Buttons01.png" id="7_qppok"] -[ext_resource type="Texture2D" uid="uid://c0ix7r57l1swx" path="res://assets/sprites/dragons/DP_drac06_Anim.png" id="8_c4sli"] [ext_resource type="Texture2D" uid="uid://bgpbbkmwt8ysq" path="res://assets/sprites/ui/DP_UI_Button_Text.png" id="8_ofxsr"] [ext_resource type="Script" uid="uid://mhudiyt5gnt1" path="res://scenes/dragon_editor/line_edit.gd" id="9_xhgxf"] -[ext_resource type="Texture2D" uid="uid://f4c3ib4p7gcy" path="res://assets/sprites/dragons/DP_drac01_Anim.png" id="9_xxrn0"] -[ext_resource type="Texture2D" uid="uid://blej4jyd3oup1" path="res://assets/sprites/dragons/DP_drac04_Anim.png" id="10_q2c4g"] -[ext_resource type="Texture2D" uid="uid://ig3pbqrpnm7u" path="res://assets/sprites/dragons/DP_drac03_Anim.png" id="11_tjfw2"] -[ext_resource type="Texture2D" uid="uid://d21m7gvjn7t2w" path="res://assets/sprites/dragons/DP_drac05_Anim.png" id="12_53w5y"] [ext_resource type="Texture2D" uid="uid://bdrm1nxydvf5t" path="res://assets/sprites/ui/DP_UI_Label_Big.png" id="12_qppok"] +[ext_resource type="SpriteFrames" uid="uid://duxxw4mfxql3c" path="res://assets/animations/dragons/verd.tres" id="14_aystc"] [ext_resource type="StyleBox" uid="uid://bhe580k04w6ve" path="res://assets/styles/style_box_empty.tres" id="14_bh8dj"] - -[sub_resource type="Resource" id="Resource_nlx3a"] -script = ExtResource("3_x0448") -allow_null = true -outfits = Array[SpriteFrames]([ExtResource("2_aystc")]) -metadata/_custom_type_script = "uid://rw26nny160xh" - -[sub_resource type="Resource" id="Resource_1dq4x"] -script = ExtResource("3_x0448") -allow_null = true -outfits = Array[SpriteFrames]([ExtResource("2_aystc")]) -metadata/_custom_type_script = "uid://rw26nny160xh" - -[sub_resource type="AtlasTexture" id="AtlasTexture_n1vju"] -atlas = ExtResource("4_aystc") -region = Rect2(0, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_m1nfd"] -atlas = ExtResource("4_aystc") -region = Rect2(108, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_3fnsk"] -atlas = ExtResource("4_aystc") -region = Rect2(216, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_njuvk"] -atlas = ExtResource("4_aystc") -region = Rect2(324, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_mq26c"] -atlas = ExtResource("4_aystc") -region = Rect2(0, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_p6fb4"] -atlas = ExtResource("4_aystc") -region = Rect2(108, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_fwa0p"] -atlas = ExtResource("4_aystc") -region = Rect2(216, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_26ptf"] -atlas = ExtResource("4_aystc") -region = Rect2(324, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_amy8y"] -atlas = ExtResource("4_aystc") -region = Rect2(432, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_knwp6"] -atlas = ExtResource("4_aystc") -region = Rect2(540, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_yfy00"] -atlas = ExtResource("4_aystc") -region = Rect2(0, 108, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_bnccx"] -atlas = ExtResource("4_aystc") -region = Rect2(108, 108, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_hc8ch"] -atlas = ExtResource("4_aystc") -region = Rect2(216, 108, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_0nuxw"] -atlas = ExtResource("4_aystc") -region = Rect2(324, 108, 108, 108) - -[sub_resource type="SpriteFrames" id="SpriteFrames_gqmmt"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_n1vju") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_m1nfd") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_3fnsk") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_njuvk") -}], -"loop": true, -"name": &"fly", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_mq26c") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_p6fb4") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_fwa0p") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_26ptf") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_amy8y") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_knwp6") -}], -"loop": true, -"name": &"idle", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_yfy00") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_bnccx") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_hc8ch") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_0nuxw") -}], -"loop": true, -"name": &"walk", -"speed": 5.0 -}] - -[sub_resource type="AtlasTexture" id="AtlasTexture_qwppa"] -atlas = ExtResource("5_x0448") -region = Rect2(0, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_1uixo"] -atlas = ExtResource("5_x0448") -region = Rect2(108, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_xccp0"] -atlas = ExtResource("5_x0448") -region = Rect2(216, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_nyede"] -atlas = ExtResource("5_x0448") -region = Rect2(324, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_cxse4"] -atlas = ExtResource("5_x0448") -region = Rect2(0, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_edjcl"] -atlas = ExtResource("5_x0448") -region = Rect2(108, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_jhak8"] -atlas = ExtResource("5_x0448") -region = Rect2(216, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_t2351"] -atlas = ExtResource("5_x0448") -region = Rect2(324, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_uw07h"] -atlas = ExtResource("5_x0448") -region = Rect2(432, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_xcrai"] -atlas = ExtResource("5_x0448") -region = Rect2(540, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_tywya"] -atlas = ExtResource("5_x0448") -region = Rect2(0, 108, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_7pu4u"] -atlas = ExtResource("5_x0448") -region = Rect2(108, 108, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_i1w1o"] -atlas = ExtResource("5_x0448") -region = Rect2(216, 108, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_xsi0i"] -atlas = ExtResource("5_x0448") -region = Rect2(324, 108, 108, 108) - -[sub_resource type="SpriteFrames" id="SpriteFrames_yc10j"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_qwppa") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_1uixo") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_xccp0") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_nyede") -}], -"loop": true, -"name": &"fly", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_cxse4") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_edjcl") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_jhak8") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_t2351") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_uw07h") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_xcrai") -}], -"loop": true, -"name": &"idle", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_tywya") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_7pu4u") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_i1w1o") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_xsi0i") -}], -"loop": true, -"name": &"walk", -"speed": 5.0 -}] - -[sub_resource type="AtlasTexture" id="AtlasTexture_ifv4k"] -atlas = ExtResource("6_hukd7") -region = Rect2(0, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_uera2"] -atlas = ExtResource("6_hukd7") -region = Rect2(108, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_0q8tn"] -atlas = ExtResource("6_hukd7") -region = Rect2(216, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_f2bes"] -atlas = ExtResource("6_hukd7") -region = Rect2(324, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_albls"] -atlas = ExtResource("6_hukd7") -region = Rect2(0, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_mlrdx"] -atlas = ExtResource("6_hukd7") -region = Rect2(108, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_dipuj"] -atlas = ExtResource("6_hukd7") -region = Rect2(216, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_d0xss"] -atlas = ExtResource("6_hukd7") -region = Rect2(324, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_mpdbr"] -atlas = ExtResource("6_hukd7") -region = Rect2(432, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_dy3ut"] -atlas = ExtResource("6_hukd7") -region = Rect2(540, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_gi66g"] -atlas = ExtResource("6_hukd7") -region = Rect2(0, 108, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_am77p"] -atlas = ExtResource("6_hukd7") -region = Rect2(108, 108, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_asxml"] -atlas = ExtResource("6_hukd7") -region = Rect2(216, 108, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_pral7"] -atlas = ExtResource("6_hukd7") -region = Rect2(324, 108, 108, 108) - -[sub_resource type="SpriteFrames" id="SpriteFrames_rhebu"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_ifv4k") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_uera2") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_0q8tn") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_f2bes") -}], -"loop": true, -"name": &"fly", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_albls") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_mlrdx") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_dipuj") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_d0xss") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_mpdbr") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_dy3ut") -}], -"loop": true, -"name": &"idle", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_gi66g") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_am77p") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_asxml") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_pral7") -}], -"loop": true, -"name": &"walk", -"speed": 5.0 -}] - -[sub_resource type="Resource" id="Resource_if2jb"] -script = ExtResource("3_x0448") -allow_null = true -outfits = Array[SpriteFrames]([SubResource("SpriteFrames_gqmmt"), SubResource("SpriteFrames_yc10j"), SubResource("SpriteFrames_rhebu")]) -metadata/_custom_type_script = "uid://rw26nny160xh" - -[sub_resource type="AtlasTexture" id="AtlasTexture_mmj1o"] -atlas = ExtResource("7_6eo4l") -region = Rect2(0, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_biwbj"] -atlas = ExtResource("7_6eo4l") -region = Rect2(108, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_e86o5"] -atlas = ExtResource("7_6eo4l") -region = Rect2(216, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_5exht"] -atlas = ExtResource("7_6eo4l") -region = Rect2(324, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_62vta"] -atlas = ExtResource("7_6eo4l") -region = Rect2(0, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_ijluj"] -atlas = ExtResource("7_6eo4l") -region = Rect2(108, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_t186t"] -atlas = ExtResource("7_6eo4l") -region = Rect2(216, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_iei0t"] -atlas = ExtResource("7_6eo4l") -region = Rect2(324, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_u1l6v"] -atlas = ExtResource("7_6eo4l") -region = Rect2(432, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_bk2js"] -atlas = ExtResource("7_6eo4l") -region = Rect2(540, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_11k2n"] -atlas = ExtResource("7_6eo4l") -region = Rect2(0, 108, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_m3pae"] -atlas = ExtResource("7_6eo4l") -region = Rect2(108, 108, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_wfq62"] -atlas = ExtResource("7_6eo4l") -region = Rect2(216, 108, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_0yic0"] -atlas = ExtResource("7_6eo4l") -region = Rect2(324, 108, 108, 108) - -[sub_resource type="SpriteFrames" id="SpriteFrames_0hqgm"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_mmj1o") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_biwbj") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_e86o5") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_5exht") -}], -"loop": true, -"name": &"fly", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_62vta") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_ijluj") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_t186t") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_iei0t") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_u1l6v") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_bk2js") -}], -"loop": true, -"name": &"idle", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_11k2n") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_m3pae") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_wfq62") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_0yic0") -}], -"loop": true, -"name": &"walk", -"speed": 5.0 -}] - -[sub_resource type="AtlasTexture" id="AtlasTexture_vs0c3"] -atlas = ExtResource("8_c4sli") -region = Rect2(0, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_wiled"] -atlas = ExtResource("8_c4sli") -region = Rect2(108, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_3qimm"] -atlas = ExtResource("8_c4sli") -region = Rect2(216, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_pgupe"] -atlas = ExtResource("8_c4sli") -region = Rect2(324, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_nmisb"] -atlas = ExtResource("8_c4sli") -region = Rect2(0, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_ply4o"] -atlas = ExtResource("8_c4sli") -region = Rect2(108, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_uldnr"] -atlas = ExtResource("8_c4sli") -region = Rect2(216, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_cuv31"] -atlas = ExtResource("8_c4sli") -region = Rect2(324, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_68pbo"] -atlas = ExtResource("8_c4sli") -region = Rect2(432, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_sh07d"] -atlas = ExtResource("8_c4sli") -region = Rect2(540, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_qc1gi"] -atlas = ExtResource("8_c4sli") -region = Rect2(0, 108, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_58c6e"] -atlas = ExtResource("8_c4sli") -region = Rect2(108, 108, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_lvnxr"] -atlas = ExtResource("8_c4sli") -region = Rect2(216, 108, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_6ndl6"] -atlas = ExtResource("8_c4sli") -region = Rect2(324, 108, 108, 108) - -[sub_resource type="SpriteFrames" id="SpriteFrames_o77k0"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_vs0c3") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_wiled") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_3qimm") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_pgupe") -}], -"loop": true, -"name": &"fly", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_nmisb") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_ply4o") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_uldnr") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_cuv31") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_68pbo") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_sh07d") -}], -"loop": true, -"name": &"idle", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_qc1gi") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_58c6e") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_lvnxr") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_6ndl6") -}], -"loop": true, -"name": &"walk", -"speed": 5.0 -}] - -[sub_resource type="AtlasTexture" id="AtlasTexture_7wf4o"] -atlas = ExtResource("9_xxrn0") -region = Rect2(0, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_06adf"] -atlas = ExtResource("9_xxrn0") -region = Rect2(108, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_r1nr2"] -atlas = ExtResource("9_xxrn0") -region = Rect2(216, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_ob486"] -atlas = ExtResource("9_xxrn0") -region = Rect2(324, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_vxc6x"] -atlas = ExtResource("9_xxrn0") -region = Rect2(0, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_jbw75"] -atlas = ExtResource("9_xxrn0") -region = Rect2(108, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_ei2lw"] -atlas = ExtResource("9_xxrn0") -region = Rect2(216, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_q6cr0"] -atlas = ExtResource("9_xxrn0") -region = Rect2(324, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_m3lw6"] -atlas = ExtResource("9_xxrn0") -region = Rect2(432, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_kdf45"] -atlas = ExtResource("9_xxrn0") -region = Rect2(540, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_1w6rw"] -atlas = ExtResource("9_xxrn0") -region = Rect2(0, 108, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_80v1m"] -atlas = ExtResource("9_xxrn0") -region = Rect2(108, 108, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_nv7os"] -atlas = ExtResource("9_xxrn0") -region = Rect2(216, 108, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_ly6pi"] -atlas = ExtResource("9_xxrn0") -region = Rect2(324, 108, 108, 108) - -[sub_resource type="SpriteFrames" id="SpriteFrames_7b2ll"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_7wf4o") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_06adf") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_r1nr2") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_ob486") -}], -"loop": true, -"name": &"fly", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_vxc6x") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_jbw75") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_ei2lw") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_q6cr0") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_m3lw6") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_kdf45") -}], -"loop": true, -"name": &"idle", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_1w6rw") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_80v1m") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_nv7os") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_ly6pi") -}], -"loop": true, -"name": &"walk", -"speed": 5.0 -}] - -[sub_resource type="AtlasTexture" id="AtlasTexture_ub7hq"] -atlas = ExtResource("10_q2c4g") -region = Rect2(0, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_frclk"] -atlas = ExtResource("10_q2c4g") -region = Rect2(108, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_55hsi"] -atlas = ExtResource("10_q2c4g") -region = Rect2(216, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_dhrkn"] -atlas = ExtResource("10_q2c4g") -region = Rect2(324, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_7h6a8"] -atlas = ExtResource("10_q2c4g") -region = Rect2(0, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_hk7mw"] -atlas = ExtResource("10_q2c4g") -region = Rect2(108, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_4rwpa"] -atlas = ExtResource("10_q2c4g") -region = Rect2(216, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_p1ygt"] -atlas = ExtResource("10_q2c4g") -region = Rect2(324, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_3tl36"] -atlas = ExtResource("10_q2c4g") -region = Rect2(432, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_oqwn7"] -atlas = ExtResource("10_q2c4g") -region = Rect2(540, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_21i6q"] -atlas = ExtResource("10_q2c4g") -region = Rect2(0, 108, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_as7nj"] -atlas = ExtResource("10_q2c4g") -region = Rect2(108, 108, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_m3eui"] -atlas = ExtResource("10_q2c4g") -region = Rect2(216, 108, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_i7kqd"] -atlas = ExtResource("10_q2c4g") -region = Rect2(324, 108, 108, 108) - -[sub_resource type="SpriteFrames" id="SpriteFrames_4orem"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_ub7hq") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_frclk") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_55hsi") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_dhrkn") -}], -"loop": true, -"name": &"fly", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_7h6a8") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_hk7mw") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_4rwpa") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_p1ygt") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_3tl36") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_oqwn7") -}], -"loop": true, -"name": &"idle", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_21i6q") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_as7nj") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_m3eui") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_i7kqd") -}], -"loop": true, -"name": &"walk", -"speed": 5.0 -}] - -[sub_resource type="AtlasTexture" id="AtlasTexture_x6jc7"] -atlas = ExtResource("11_tjfw2") -region = Rect2(0, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_jouv2"] -atlas = ExtResource("11_tjfw2") -region = Rect2(108, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_hyevi"] -atlas = ExtResource("11_tjfw2") -region = Rect2(216, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_hym2s"] -atlas = ExtResource("11_tjfw2") -region = Rect2(324, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_4jy8g"] -atlas = ExtResource("11_tjfw2") -region = Rect2(0, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_kupkf"] -atlas = ExtResource("11_tjfw2") -region = Rect2(108, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_jtr4g"] -atlas = ExtResource("11_tjfw2") -region = Rect2(216, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_m55cp"] -atlas = ExtResource("11_tjfw2") -region = Rect2(324, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_r3mni"] -atlas = ExtResource("11_tjfw2") -region = Rect2(432, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_ncrm1"] -atlas = ExtResource("11_tjfw2") -region = Rect2(540, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_r4roq"] -atlas = ExtResource("11_tjfw2") -region = Rect2(0, 108, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_bobdh"] -atlas = ExtResource("11_tjfw2") -region = Rect2(108, 108, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_wem1g"] -atlas = ExtResource("11_tjfw2") -region = Rect2(216, 108, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_tedt2"] -atlas = ExtResource("11_tjfw2") -region = Rect2(324, 108, 108, 108) - -[sub_resource type="SpriteFrames" id="SpriteFrames_xqwu6"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_x6jc7") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_jouv2") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_hyevi") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_hym2s") -}], -"loop": true, -"name": &"fly", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_4jy8g") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_kupkf") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_jtr4g") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_m55cp") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_r3mni") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_ncrm1") -}], -"loop": true, -"name": &"idle", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_r4roq") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_bobdh") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_wem1g") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_tedt2") -}], -"loop": true, -"name": &"walk", -"speed": 5.0 -}] - -[sub_resource type="AtlasTexture" id="AtlasTexture_tey01"] -atlas = ExtResource("12_53w5y") -region = Rect2(0, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_e3p4x"] -atlas = ExtResource("12_53w5y") -region = Rect2(108, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_kxp1n"] -atlas = ExtResource("12_53w5y") -region = Rect2(216, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_c6xgx"] -atlas = ExtResource("12_53w5y") -region = Rect2(324, 216, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_anvkt"] -atlas = ExtResource("12_53w5y") -region = Rect2(0, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_r2n4o"] -atlas = ExtResource("12_53w5y") -region = Rect2(108, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_gfwqi"] -atlas = ExtResource("12_53w5y") -region = Rect2(216, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_vglir"] -atlas = ExtResource("12_53w5y") -region = Rect2(324, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_8p844"] -atlas = ExtResource("12_53w5y") -region = Rect2(432, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_6j6s6"] -atlas = ExtResource("12_53w5y") -region = Rect2(540, 0, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_yy5o8"] -atlas = ExtResource("12_53w5y") -region = Rect2(0, 108, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_df7rw"] -atlas = ExtResource("12_53w5y") -region = Rect2(108, 108, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_j0r56"] -atlas = ExtResource("12_53w5y") -region = Rect2(216, 108, 108, 108) - -[sub_resource type="AtlasTexture" id="AtlasTexture_vkmfp"] -atlas = ExtResource("12_53w5y") -region = Rect2(324, 108, 108, 108) - -[sub_resource type="SpriteFrames" id="SpriteFrames_y4fkp"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_tey01") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_e3p4x") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_kxp1n") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_c6xgx") -}], -"loop": true, -"name": &"fly", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_anvkt") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_r2n4o") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_gfwqi") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_vglir") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_8p844") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_6j6s6") -}], -"loop": true, -"name": &"idle", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_yy5o8") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_df7rw") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_j0r56") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_vkmfp") -}], -"loop": true, -"name": &"walk", -"speed": 5.0 -}] - -[sub_resource type="Resource" id="Resource_ttj25"] -script = ExtResource("3_x0448") -allow_null = false -outfits = Array[SpriteFrames]([SubResource("SpriteFrames_0hqgm"), SubResource("SpriteFrames_o77k0"), SubResource("SpriteFrames_7b2ll"), SubResource("SpriteFrames_4orem"), SubResource("SpriteFrames_xqwu6"), SubResource("SpriteFrames_y4fkp")]) -metadata/_custom_type_script = "uid://rw26nny160xh" +[ext_resource type="SpriteFrames" uid="uid://dsxhfu2ekw7j" path="res://assets/animations/shirts/traje.tres" id="15_x0448"] [sub_resource type="AtlasTexture" id="AtlasTexture_ofxsr"] atlas = ExtResource("7_qppok") @@ -1122,10 +51,10 @@ borderless = true always_on_top = true transparent = true script = ExtResource("1_8vkll") -hat_outfits = SubResource("Resource_nlx3a") -shirt_outfits = SubResource("Resource_1dq4x") -shoes_outfits = SubResource("Resource_if2jb") -dragon_colors = SubResource("Resource_ttj25") +hat_outfits = ExtResource("2_vvtct") +shirt_outfits = ExtResource("3_xhgxf") +decor_outfits = ExtResource("4_1ivi1") +dragon_colors = ExtResource("5_1ivi1") [node name="CanvasLayer" type="CanvasLayer" parent="."] @@ -1134,53 +63,22 @@ offset_right = 40.0 offset_bottom = 40.0 texture = ExtResource("6_udwtk") -[node name="Dragon" type="TextureRect" parent="CanvasLayer"] -offset_left = 76.0 -offset_top = 120.0 -offset_right = 152.0 -offset_bottom = 208.0 +[node name="Dragon" type="AnimatedSprite2D" parent="CanvasLayer"] +position = Vector2(112, 154) +sprite_frames = ExtResource("14_aystc") +animation = &"idle" -[node name="Hat" type="TextureRect" parent="CanvasLayer/Dragon"] -layout_mode = 1 -anchors_preset = 8 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -offset_left = -38.0 -offset_top = -44.0 -offset_right = 38.0 -offset_bottom = 44.0 -grow_horizontal = 2 -grow_vertical = 2 +[node name="Hat" type="AnimatedSprite2D" parent="CanvasLayer/Dragon"] +sprite_frames = ExtResource("2_aystc") +animation = &"idle" -[node name="Shirt" type="TextureRect" parent="CanvasLayer/Dragon"] -layout_mode = 1 -anchors_preset = 8 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -offset_left = -38.0 -offset_top = -44.0 -offset_right = 38.0 -offset_bottom = 44.0 -grow_horizontal = 2 -grow_vertical = 2 +[node name="Shirt" type="AnimatedSprite2D" parent="CanvasLayer/Dragon"] +sprite_frames = ExtResource("15_x0448") +animation = &"idle" -[node name="Shoes" type="TextureRect" parent="CanvasLayer/Dragon"] -layout_mode = 1 -anchors_preset = 8 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -offset_left = -38.0 -offset_top = -44.0 -offset_right = 38.0 -offset_bottom = 44.0 -grow_horizontal = 2 -grow_vertical = 2 +[node name="Decor" type="AnimatedSprite2D" parent="CanvasLayer/Dragon"] +sprite_frames = ExtResource("6_c4sli") +animation = &"idle" [node name="Dragger" type="Control" parent="CanvasLayer"] layout_mode = 3 diff --git a/src/dragon_outfit.gd b/src/dragon_outfit.gd index 092f480..964b716 100644 --- a/src/dragon_outfit.gd +++ b/src/dragon_outfit.gd @@ -11,7 +11,7 @@ func _init(outfits: Array[SpriteFrames] = []): self.outfits = outfits -func pick_next() -> Texture2D: +func pick_next() -> SpriteFrames: index += 1 if allow_null: return _pick_nullable() @@ -19,7 +19,7 @@ func pick_next() -> Texture2D: return _pick_non_nullable() -func pick_previous() -> Texture2D: +func pick_previous() -> SpriteFrames: index -= 1 if allow_null: return _pick_nullable() @@ -27,7 +27,7 @@ func pick_previous() -> Texture2D: return _pick_non_nullable() -func _pick_nullable(): +func _pick_nullable() -> SpriteFrames: index %= (len(outfits) + 1) if index == 0: return null @@ -35,15 +35,11 @@ func _pick_nullable(): return outfits[index - 1] -func _pick_non_nullable(): +func _pick_non_nullable() -> SpriteFrames: index %= len(outfits) return outfits[index] -func get_index(texture: Texture2D) -> int: - return outfits.find(texture) - - func get_texture(index: int) -> SpriteFrames: if index < 0 or index >= len(outfits): return null