diff --git a/assets/minigames/caterpillar/graphics/background.png b/assets/minigames/caterpillar/graphics/background.png index 00b123de..c401d83c 100644 Binary files a/assets/minigames/caterpillar/graphics/background.png and b/assets/minigames/caterpillar/graphics/background.png differ diff --git a/assets/minigames/caterpillar/graphics/berry_bue.png b/assets/minigames/caterpillar/graphics/berry_bue.png new file mode 100644 index 00000000..718abd0a Binary files /dev/null and b/assets/minigames/caterpillar/graphics/berry_bue.png differ diff --git a/assets/minigames/caterpillar/graphics/branch_end.png.import b/assets/minigames/caterpillar/graphics/berry_bue.png.import similarity index 72% rename from assets/minigames/caterpillar/graphics/branch_end.png.import rename to assets/minigames/caterpillar/graphics/berry_bue.png.import index 13444848..8fb658bb 100644 --- a/assets/minigames/caterpillar/graphics/branch_end.png.import +++ b/assets/minigames/caterpillar/graphics/berry_bue.png.import @@ -2,16 +2,16 @@ importer="texture" type="CompressedTexture2D" -uid="uid://vc5usf0x7cph" -path="res://.godot/imported/branch_end.png-4f3b4dd90944a434bf873c6c1e2120e4.ctex" +uid="uid://b1psynryycucg" +path="res://.godot/imported/berry_bue.png-65757120b00ae5b74b529e819f4135aa.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/minigames/caterpillar/graphics/branch_end.png" -dest_files=["res://.godot/imported/branch_end.png-4f3b4dd90944a434bf873c6c1e2120e4.ctex"] +source_file="res://assets/minigames/caterpillar/graphics/berry_bue.png" +dest_files=["res://.godot/imported/berry_bue.png-65757120b00ae5b74b529e819f4135aa.ctex"] [params] diff --git a/assets/minigames/caterpillar/graphics/berry_pink.png b/assets/minigames/caterpillar/graphics/berry_pink.png new file mode 100644 index 00000000..840558b2 Binary files /dev/null and b/assets/minigames/caterpillar/graphics/berry_pink.png differ diff --git a/assets/minigames/caterpillar/graphics/berry_pink.png.import b/assets/minigames/caterpillar/graphics/berry_pink.png.import new file mode 100644 index 00000000..51813e69 --- /dev/null +++ b/assets/minigames/caterpillar/graphics/berry_pink.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://3hqfi1r6s4sp" +path="res://.godot/imported/berry_pink.png-1d9fdf90d571920f854a6f8b2b5e2ca1.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/minigames/caterpillar/graphics/berry_pink.png" +dest_files=["res://.godot/imported/berry_pink.png-1d9fdf90d571920f854a6f8b2b5e2ca1.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/minigames/caterpillar/graphics/branch_end.png b/assets/minigames/caterpillar/graphics/branch_end.png deleted file mode 100644 index 3b973ee6..00000000 Binary files a/assets/minigames/caterpillar/graphics/branch_end.png and /dev/null differ diff --git a/assets/minigames/caterpillar/graphics/branch_mid.png b/assets/minigames/caterpillar/graphics/branch_mid.png index b729cb2f..9ad26d30 100644 Binary files a/assets/minigames/caterpillar/graphics/branch_mid.png and b/assets/minigames/caterpillar/graphics/branch_mid.png differ diff --git a/assets/minigames/caterpillar/graphics/caterpillar_body_center.png b/assets/minigames/caterpillar/graphics/caterpillar_body_center.png new file mode 100644 index 00000000..fd261b2e Binary files /dev/null and b/assets/minigames/caterpillar/graphics/caterpillar_body_center.png differ diff --git a/assets/minigames/caterpillar/graphics/caterpillar_body_center.png.import b/assets/minigames/caterpillar/graphics/caterpillar_body_center.png.import new file mode 100644 index 00000000..0ee00ccf --- /dev/null +++ b/assets/minigames/caterpillar/graphics/caterpillar_body_center.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bxqxl2iflusat" +path="res://.godot/imported/caterpillar_body_center.png-3080666b7bd5113b7b0db23940969db1.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/minigames/caterpillar/graphics/caterpillar_body_center.png" +dest_files=["res://.godot/imported/caterpillar_body_center.png-3080666b7bd5113b7b0db23940969db1.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/minigames/caterpillar/graphics/caterpillar_body_left.png b/assets/minigames/caterpillar/graphics/caterpillar_body_left.png new file mode 100644 index 00000000..a2306671 Binary files /dev/null and b/assets/minigames/caterpillar/graphics/caterpillar_body_left.png differ diff --git a/assets/minigames/caterpillar/graphics/caterpillar_tail_2.png.import b/assets/minigames/caterpillar/graphics/caterpillar_body_left.png.import similarity index 76% rename from assets/minigames/caterpillar/graphics/caterpillar_tail_2.png.import rename to assets/minigames/caterpillar/graphics/caterpillar_body_left.png.import index 893eac13..88597cfb 100644 --- a/assets/minigames/caterpillar/graphics/caterpillar_tail_2.png.import +++ b/assets/minigames/caterpillar/graphics/caterpillar_body_left.png.import @@ -2,16 +2,16 @@ importer="texture" type="CompressedTexture2D" -uid="uid://c7noke1ky61q8" -path="res://.godot/imported/caterpillar_tail_2.png-5b41e17389c7c3dd812f28ac9628c688.ctex" +uid="uid://dkc630ptqucrp" +path="res://.godot/imported/caterpillar_body_left.png-6165caba25e9f3f4e675c7023c82db04.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/minigames/caterpillar/graphics/caterpillar_tail_2.png" -dest_files=["res://.godot/imported/caterpillar_tail_2.png-5b41e17389c7c3dd812f28ac9628c688.ctex"] +source_file="res://assets/minigames/caterpillar/graphics/caterpillar_body_left.png" +dest_files=["res://.godot/imported/caterpillar_body_left.png-6165caba25e9f3f4e675c7023c82db04.ctex"] [params] diff --git a/assets/minigames/caterpillar/graphics/caterpillar_body_right.png b/assets/minigames/caterpillar/graphics/caterpillar_body_right.png new file mode 100644 index 00000000..fb9acd87 Binary files /dev/null and b/assets/minigames/caterpillar/graphics/caterpillar_body_right.png differ diff --git a/assets/minigames/caterpillar/graphics/caterpillar_body_right.png.import b/assets/minigames/caterpillar/graphics/caterpillar_body_right.png.import new file mode 100644 index 00000000..c3b83e8c --- /dev/null +++ b/assets/minigames/caterpillar/graphics/caterpillar_body_right.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://df6l2panyr65v" +path="res://.godot/imported/caterpillar_body_right.png-8c6871b503d863d8543caba5e7e7eb2d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/minigames/caterpillar/graphics/caterpillar_body_right.png" +dest_files=["res://.godot/imported/caterpillar_body_right.png-8c6871b503d863d8543caba5e7e7eb2d.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/minigames/caterpillar/graphics/caterpillar_body_side.png b/assets/minigames/caterpillar/graphics/caterpillar_body_side.png new file mode 100644 index 00000000..6569c581 Binary files /dev/null and b/assets/minigames/caterpillar/graphics/caterpillar_body_side.png differ diff --git a/assets/minigames/caterpillar/graphics/caterpillar_tail_1.png.import b/assets/minigames/caterpillar/graphics/caterpillar_body_side.png.import similarity index 76% rename from assets/minigames/caterpillar/graphics/caterpillar_tail_1.png.import rename to assets/minigames/caterpillar/graphics/caterpillar_body_side.png.import index f763ed08..b2abd080 100644 --- a/assets/minigames/caterpillar/graphics/caterpillar_tail_1.png.import +++ b/assets/minigames/caterpillar/graphics/caterpillar_body_side.png.import @@ -2,16 +2,16 @@ importer="texture" type="CompressedTexture2D" -uid="uid://bb3pue3wwsyc0" -path="res://.godot/imported/caterpillar_tail_1.png-9ed5312cd71dd8feb3420a7f630e47b2.ctex" +uid="uid://dbhfoebfy5br4" +path="res://.godot/imported/caterpillar_body_side.png-d62f8a7e868677a8511188ead69b5e72.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/minigames/caterpillar/graphics/caterpillar_tail_1.png" -dest_files=["res://.godot/imported/caterpillar_tail_1.png-9ed5312cd71dd8feb3420a7f630e47b2.ctex"] +source_file="res://assets/minigames/caterpillar/graphics/caterpillar_body_side.png" +dest_files=["res://.godot/imported/caterpillar_body_side.png-d62f8a7e868677a8511188ead69b5e72.ctex"] [params] diff --git a/assets/minigames/caterpillar/graphics/caterpillar_legs_spritesheet.png b/assets/minigames/caterpillar/graphics/caterpillar_legs_spritesheet.png new file mode 100644 index 00000000..cd41502f Binary files /dev/null and b/assets/minigames/caterpillar/graphics/caterpillar_legs_spritesheet.png differ diff --git a/assets/minigames/caterpillar/graphics/caterpillar_legs_spritesheet.png.import b/assets/minigames/caterpillar/graphics/caterpillar_legs_spritesheet.png.import new file mode 100644 index 00000000..f8ce45c9 --- /dev/null +++ b/assets/minigames/caterpillar/graphics/caterpillar_legs_spritesheet.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dg035yddvs04o" +path="res://.godot/imported/caterpillar_legs_spritesheet.png-afcf5a0970c2657ec1d1705d29b658d3.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/minigames/caterpillar/graphics/caterpillar_legs_spritesheet.png" +dest_files=["res://.godot/imported/caterpillar_legs_spritesheet.png-afcf5a0970c2657ec1d1705d29b658d3.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/minigames/caterpillar/graphics/caterpillar_spritesheet.png b/assets/minigames/caterpillar/graphics/caterpillar_spritesheet.png new file mode 100644 index 00000000..af18f5f9 Binary files /dev/null and b/assets/minigames/caterpillar/graphics/caterpillar_spritesheet.png differ diff --git a/assets/minigames/caterpillar/graphics/caterpillar_spritesheet.png.import b/assets/minigames/caterpillar/graphics/caterpillar_spritesheet.png.import new file mode 100644 index 00000000..abe8c9e0 --- /dev/null +++ b/assets/minigames/caterpillar/graphics/caterpillar_spritesheet.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cyxl5ep0vuavl" +path="res://.godot/imported/caterpillar_spritesheet.png-e15320a7c10244419bd956df1a0959b8.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/minigames/caterpillar/graphics/caterpillar_spritesheet.png" +dest_files=["res://.godot/imported/caterpillar_spritesheet.png-e15320a7c10244419bd956df1a0959b8.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/minigames/caterpillar/graphics/caterpillar_tail.png b/assets/minigames/caterpillar/graphics/caterpillar_tail.png new file mode 100644 index 00000000..1c994492 Binary files /dev/null and b/assets/minigames/caterpillar/graphics/caterpillar_tail.png differ diff --git a/assets/minigames/caterpillar/graphics/caterpillar_tail_3.png.import b/assets/minigames/caterpillar/graphics/caterpillar_tail.png.import similarity index 76% rename from assets/minigames/caterpillar/graphics/caterpillar_tail_3.png.import rename to assets/minigames/caterpillar/graphics/caterpillar_tail.png.import index 8b996c33..94e487ad 100644 --- a/assets/minigames/caterpillar/graphics/caterpillar_tail_3.png.import +++ b/assets/minigames/caterpillar/graphics/caterpillar_tail.png.import @@ -2,16 +2,16 @@ importer="texture" type="CompressedTexture2D" -uid="uid://77xcd53bfk3h" -path="res://.godot/imported/caterpillar_tail_3.png-12a76847e51c41e637d74701e9309e1e.ctex" +uid="uid://cmhvrs2jaqhwd" +path="res://.godot/imported/caterpillar_tail.png-ac3f94da8d48763cbedc9b271385c973.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/minigames/caterpillar/graphics/caterpillar_tail_3.png" -dest_files=["res://.godot/imported/caterpillar_tail_3.png-12a76847e51c41e637d74701e9309e1e.ctex"] +source_file="res://assets/minigames/caterpillar/graphics/caterpillar_tail.png" +dest_files=["res://.godot/imported/caterpillar_tail.png-ac3f94da8d48763cbedc9b271385c973.ctex"] [params] diff --git a/assets/minigames/caterpillar/graphics/caterpillar_tail_1.png b/assets/minigames/caterpillar/graphics/caterpillar_tail_1.png deleted file mode 100644 index d9f3b320..00000000 Binary files a/assets/minigames/caterpillar/graphics/caterpillar_tail_1.png and /dev/null differ diff --git a/assets/minigames/caterpillar/graphics/caterpillar_tail_2.png b/assets/minigames/caterpillar/graphics/caterpillar_tail_2.png deleted file mode 100644 index f6b5817d..00000000 Binary files a/assets/minigames/caterpillar/graphics/caterpillar_tail_2.png and /dev/null differ diff --git a/assets/minigames/caterpillar/graphics/caterpillar_tail_3.png b/assets/minigames/caterpillar/graphics/caterpillar_tail_3.png deleted file mode 100644 index e94778e9..00000000 Binary files a/assets/minigames/caterpillar/graphics/caterpillar_tail_3.png and /dev/null differ diff --git a/assets/minigames/caterpillar/graphics/gauge_icon_caterpillar_empty.png b/assets/minigames/caterpillar/graphics/gauge_icon_caterpillar_empty.png index 29828166..f0fa736a 100644 Binary files a/assets/minigames/caterpillar/graphics/gauge_icon_caterpillar_empty.png and b/assets/minigames/caterpillar/graphics/gauge_icon_caterpillar_empty.png differ diff --git a/assets/minigames/caterpillar/graphics/gauge_icon_caterpillar_full.png b/assets/minigames/caterpillar/graphics/gauge_icon_caterpillar_full.png index dd547f99..f64f42c9 100644 Binary files a/assets/minigames/caterpillar/graphics/gauge_icon_caterpillar_full.png and b/assets/minigames/caterpillar/graphics/gauge_icon_caterpillar_full.png differ diff --git a/assets/minigames/caterpillar/graphics/leaf.png b/assets/minigames/caterpillar/graphics/leaf.png index bdded808..8224d786 100644 Binary files a/assets/minigames/caterpillar/graphics/leaf.png and b/assets/minigames/caterpillar/graphics/leaf.png differ diff --git a/resources/themes/minigames_label_settings.tres b/resources/themes/minigames_label_settings.tres index 0079f006..6385f0d0 100644 --- a/resources/themes/minigames_label_settings.tres +++ b/resources/themes/minigames_label_settings.tres @@ -1,11 +1,11 @@ [gd_resource type="LabelSettings" load_steps=2 format=3 uid="uid://bguqnhiblwick"] -[ext_resource type="FontFile" uid="uid://bw8cb4e0a7ayj" path="res://assets/fonts/kalulu_mulish_regular.otf" id="1_o7yiy"] +[ext_resource type="FontFile" uid="uid://bj2rpti6g24kk" path="res://assets/fonts/kalulu_mulish_bold.otf" id="1_o7yiy"] [resource] font = ExtResource("1_o7yiy") -font_size = 96 -outline_size = 8 +font_size = 160 +font_color = Color(0, 0, 0, 1) outline_color = Color(0, 0, 0, 1) -shadow_size = 15 +shadow_size = 0 shadow_color = Color(0, 0, 0, 0.639216) diff --git a/resources/themes/minigames_label_settings_caterpillar.tres b/resources/themes/minigames_label_settings_caterpillar.tres new file mode 100644 index 00000000..ed93745e --- /dev/null +++ b/resources/themes/minigames_label_settings_caterpillar.tres @@ -0,0 +1,11 @@ +[gd_resource type="LabelSettings" load_steps=2 format=3 uid="uid://vk8pnpl5skbd"] + +[ext_resource type="FontFile" uid="uid://bj2rpti6g24kk" path="res://assets/fonts/kalulu_mulish_bold.otf" id="1_x5d5k"] + +[resource] +font = ExtResource("1_x5d5k") +font_size = 90 +font_color = Color(0, 0, 0, 1) +outline_color = Color(0, 0, 0, 1) +shadow_size = 0 +shadow_color = Color(0, 0, 0, 0.639216) diff --git a/sources/menus/settings/teacher_settings.gd b/sources/menus/settings/teacher_settings.gd index f9b0500f..54290a9c 100644 --- a/sources/menus/settings/teacher_settings.gd +++ b/sources/menus/settings/teacher_settings.gd @@ -78,7 +78,7 @@ func refresh_devices_tabs() -> void: devices_tab_container.add_child(device_tab) await get_tree().process_frame # Not optional or an auto-rename bug will occur on the tabs (especiallly if there are a lot of them) device_tab.device_id = device - device_tab.students = UserDataManager.teacher_settings.students[device] + (device_tab as DeviceTab).students = UserDataManager.teacher_settings.students[device] as Array[StudentData] device_tab.name = tr("DEVICE_NUMBER").format({"number": device}) device_tab.student_pressed.connect(_on_student_pressed) device_tab.refresh() diff --git a/sources/minigames/ants/ants_minigame.gd b/sources/minigames/ants/ants_minigame.gd index 6f7b497d..744ea105 100644 --- a/sources/minigames/ants/ants_minigame.gd +++ b/sources/minigames/ants/ants_minigame.gd @@ -1,4 +1,3 @@ -@tool extends Minigame const BLANK_SCENE: PackedScene = preload("res://sources/minigames/ants/blank.tscn") diff --git a/sources/minigames/base/hear_and_find/syllables_minigame.gd b/sources/minigames/base/hear_and_find/syllables_minigame.gd index 260ed69b..d846dfb6 100644 --- a/sources/minigames/base/hear_and_find/syllables_minigame.gd +++ b/sources/minigames/base/hear_and_find/syllables_minigame.gd @@ -1,4 +1,3 @@ -@tool class_name SyllablesMinigame extends Minigame diff --git a/sources/minigames/base/minigame_ui.gd b/sources/minigames/base/minigame_ui.gd index 8a9ce9b5..2d932995 100644 --- a/sources/minigames/base/minigame_ui.gd +++ b/sources/minigames/base/minigame_ui.gd @@ -1,4 +1,3 @@ -@tool class_name MinigameUI extends CanvasLayer diff --git a/sources/minigames/caterpillar/berry.gd b/sources/minigames/caterpillar/berry.gd index ed1307f9..462618f6 100644 --- a/sources/minigames/caterpillar/berry.gd +++ b/sources/minigames/caterpillar/berry.gd @@ -3,6 +3,8 @@ extends Area2D signal pressed(gp: Dictionary) +const BLUE_BERRY: CompressedTexture2D = preload("res://assets/minigames/caterpillar/graphics/berry_bue.png") + var gp: Dictionary = {}: set(value): gp = value @@ -22,6 +24,7 @@ var is_distractor: bool = false @onready var path_follow: PathFollow2D = $Path2D/PathFollow2D @onready var highlight_fx: HighlightFX = $HighlightFX @onready var wrong_fx: WrongFX = $WrongFX +@onready var sprite_2d: Sprite2D = $Path2D/PathFollow2D/Sprite2D func highlight() -> void: diff --git a/sources/minigames/caterpillar/berry.tscn b/sources/minigames/caterpillar/berry.tscn index b360827b..0405bc6a 100644 --- a/sources/minigames/caterpillar/berry.tscn +++ b/sources/minigames/caterpillar/berry.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=8 format=3 uid="uid://b07jfpiwtajh"] -[ext_resource type="Texture2D" uid="uid://cohwkrkiyo5rg" path="res://assets/minigames/caterpillar/graphics/berry.png" id="1_3ncmx"] [ext_resource type="Script" uid="uid://bf2qm2ncit8uq" path="res://sources/minigames/caterpillar/berry.gd" id="1_36web"] [ext_resource type="PackedScene" uid="uid://cge0uyn30tcpv" path="res://sources/utils/fx/highlight.tscn" id="2_4ywgh"] +[ext_resource type="Texture2D" uid="uid://3hqfi1r6s4sp" path="res://assets/minigames/caterpillar/graphics/berry_pink.png" id="3_37fog"] [ext_resource type="PackedScene" uid="uid://dlmbxcgiv8tpr" path="res://sources/utils/fx/wrong.tscn" id="4_gmtk0"] [ext_resource type="LabelSettings" uid="uid://bguqnhiblwick" path="res://resources/themes/minigames_label_settings.tres" id="4_j1h4b"] @@ -25,7 +25,7 @@ offset_right = 33.0 offset_bottom = -136.0 [node name="CollisionShape2D" type="CollisionShape2D" parent="."] -position = Vector2(0, -132) +position = Vector2(-144, -128) shape = SubResource("RectangleShape2D_aq0kv") [node name="Path2D" type="Path2D" parent="."] @@ -37,19 +37,19 @@ rotates = false loop = false [node name="Sprite2D" type="Sprite2D" parent="Path2D/PathFollow2D"] -position = Vector2(1, -65.7778) -scale = Vector2(2, 2) -texture = ExtResource("1_3ncmx") +position = Vector2(8, -81.7778) +scale = Vector2(1.5, 1.5) +texture = ExtResource("3_37fog") [node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="Path2D/PathFollow2D/Sprite2D"] -position = Vector2(90, 0) +position = Vector2(110.66667, -84.51854) [node name="Label" type="Label" parent="Path2D/PathFollow2D"] unique_name_in_owner = true -offset_left = -68.0 -offset_top = -134.0 -offset_right = 70.0 -offset_bottom = 6.0 +offset_left = -112.0 +offset_top = -145.7778 +offset_right = 133.0 +offset_bottom = 55.2222 text = "ent" label_settings = ExtResource("4_j1h4b") horizontal_alignment = 1 @@ -62,10 +62,10 @@ offset_right = 33.0 offset_bottom = -136.0 [node name="Button" type="Button" parent="."] -offset_left = -46.0 -offset_top = -216.0 -offset_right = 107.0 -offset_bottom = -62.0 +offset_left = -127.0 +offset_top = -160.0 +offset_right = 212.0 +offset_bottom = 32.0 theme_type_variation = &"InvisibleButton" [connection signal="screen_exited" from="Path2D/PathFollow2D/Sprite2D/VisibleOnScreenNotifier2D" to="." method="_on_visible_on_screen_notifier_2d_screen_exited"] diff --git a/sources/minigames/caterpillar/branch.gd b/sources/minigames/caterpillar/branch.gd index 7c6d1187..286fb9c5 100644 --- a/sources/minigames/caterpillar/branch.gd +++ b/sources/minigames/caterpillar/branch.gd @@ -1,4 +1,3 @@ -@tool class_name Branch extends Node2D @@ -11,7 +10,13 @@ const BERRY_SCENE: PackedScene = preload("res://sources/minigames/caterpillar/be var velocity: float = 0.0 var is_highlighting: bool = false: set = _set_highlighting -var is_running: bool = true +var is_running: bool = true: + set(value): + is_running = value + if is_running: + leaf_timer.start() + else: + leaf_timer.stop() @onready var leaves: Node2D = $Leaves @onready var berries: Node2D = $Berries @@ -27,15 +32,15 @@ func _set_highlighting(value: bool) -> void: func _ready() -> void: # Adds some leaves from start - var pos: float = -leaves.position.x + velocity * randf_range(0,2) + var pos: float = -leaves.position.x + velocity * randf_range(0,1) while pos < 0: var leaf: Leaf = LEAF_SCENE.instantiate() leaves.add_child(leaf) leaf.position.x = pos - pos = pos + velocity * randf_range(2, 5) + pos = pos + velocity * randf_range(1, 5) if not Engine.is_editor_hint(): - leaf_timer.wait_time = randf_range(2.0, 5.0) + leaf_timer.wait_time = randf_range(1.5, 5.0) leaf_timer.start() @@ -55,17 +60,15 @@ func spawn_berry(gp: Dictionary, is_distractor: bool) -> void: berries.add_child(berry) berry.gp = gp berry.is_distractor = is_distractor + berry.pressed.connect(_on_berry_pressed) if is_highlighting: berry.highlight() - - berry.pressed.connect(_on_berry_pressed) func clear_berries() -> void: for berry: Berry in berries.get_children(): berry.fall() -# ---------- CONNECTIONS ---------- # func _on_button_pressed() -> void: branch_pressed.emit() @@ -75,7 +78,7 @@ func _on_leaf_timer_timeout() -> void: var leaf: Leaf = LEAF_SCENE.instantiate() leaves.add_child(leaf) - leaf_timer.wait_time = randf_range(2.0, 5.0) + leaf_timer.wait_time = randf_range(1.5, 5.0) leaf_timer.start() diff --git a/sources/minigames/caterpillar/caterpillar.gd b/sources/minigames/caterpillar/caterpillar.gd index a77ca5c2..ca3e723b 100644 --- a/sources/minigames/caterpillar/caterpillar.gd +++ b/sources/minigames/caterpillar/caterpillar.gd @@ -1,38 +1,46 @@ -@tool class_name Caterpillar extends Node2D signal berry_eaten(berry: Berry) const BODY_PART_SCENE: PackedScene = preload("res://sources/minigames/caterpillar/caterpillar_body.tscn") -const BODY_PART_WIDTH: int = 128 +const BODY_SIDE_SCENE: PackedScene = preload("res://sources/minigames/caterpillar/caterpillar_body_side.tscn") const BODY_PART_MOVE_TIME: float = 0.25 -const BODY_PART_WAIT_TIME: float = 0.04 +const BODY_PART_WAIT_TIME: float = 0.02 +const SIDE_WIDTH: int = 11 # Side is 11 pixels wide +const BODY_PART_POSITION_X_MARGIN: int = 20 # Equals to the width of the graphics "left" + "right" of the body part, which are 10 pixels each -var is_moving: bool = false +var is_switching_branch: bool = false var is_eating: bool = false @onready var head: CaterpillarHead = $Head @onready var body_parts: Node2D = $BodyParts @onready var tail: Node2D = $Tail +@onready var animated_tail: AnimatedSprite2D = $Tail/AnimatedSprite2D func idle() -> void: - for body_part: CaterpillarBody in body_parts.get_children(): - body_part.idle() + for body_part: Node in body_parts.get_children(): + if body_part is CaterpillarBody: + (body_part as CaterpillarBody).idle() + head.pause_animation() + animated_tail.pause() func walk() -> void: - for body_part: CaterpillarBody in body_parts.get_children(): - body_part.walk() + for body_part: Node in body_parts.get_children(): + if body_part is CaterpillarBody: + (body_part as CaterpillarBody).walk() + head.resume_animation() + animated_tail.play() func move(distance: float) -> void: - if is_moving or is_eating: + if is_switching_branch or is_eating or head.is_paused: return idle() - is_moving = true + is_switching_branch = true var coroutine: Coroutine = Coroutine.new() # Move head @@ -41,8 +49,9 @@ func move(distance: float) -> void: # Move body for index: int in range(body_parts.get_child_count(false)): await get_tree().create_timer(BODY_PART_WAIT_TIME).timeout - var body_part: CaterpillarBody = body_parts.get_child(-index-1) - coroutine.add_future(_tween_body_part(body_part, distance).finished) + var body_part: Node = body_parts.get_child(-index-1) + if body_part is Node2D: + coroutine.add_future(_tween_body_part(body_part as Node2D, distance).finished) # Move tail var scene_tree: SceneTree = get_tree() @@ -52,7 +61,7 @@ func move(distance: float) -> void: coroutine.add_future(_tween_body_part(tail, distance).finished) await coroutine.join_all() - is_moving = false + is_switching_branch = false walk() @@ -68,37 +77,33 @@ func eat_berry(berry: Berry) -> void: var body_part: CaterpillarBody var tween: Tween = create_tween() - # Check if there is only one empty body part - if body_parts.get_child_count() == 1: - var current_body_part: CaterpillarBody = body_parts.get_child(0) as CaterpillarBody - if not current_body_part.gp: - body_part = current_body_part + body_part = BODY_PART_SCENE.instantiate() + body_parts.add_child(body_part) + body_part.gp = berry.gp - if not body_part: - var pos: Vector2 = Vector2(head.position.x + BODY_PART_WIDTH, head.position.y) + var new_body_pos: Vector2 = Vector2(head.position.x, head.position.y) + var new_body_part_size: float = body_part.get_width() + var new_head_pos: Vector2 = Vector2(head.position.x + new_body_part_size + BODY_PART_POSITION_X_MARGIN, head.position.y) + if body_parts.get_child_count() > 1: + var body_side: Node2D = BODY_SIDE_SCENE.instantiate() + body_parts.add_child(body_side) + body_side.position = Vector2(head.position.x, head.position.y) + new_body_pos = new_body_pos + Vector2(SIDE_WIDTH, 0) + new_head_pos = new_head_pos + Vector2(SIDE_WIDTH, 0) + body_part.position = new_body_pos - body_part = BODY_PART_SCENE.instantiate() - body_parts.add_child(body_part) - body_part.position = pos - #body_part.modulate.a = 0 - body_part.scale.x = 0 - - tween.tween_property(head, "position", pos, .2) - tween.parallel().tween_property(berry, "global_position:x",head.global_position.x + BODY_PART_WIDTH * 2, .2) - tween.parallel().tween_property(berry, "modulate:a", 0, .2) - #tween.parallel().tween_property(body_part, "modulate:a", 1, .5) - tween.parallel().tween_property(body_part, "scale:x", 1, .2) - else: - tween.tween_property(berry, "global_position:x", head.global_position.x + BODY_PART_WIDTH * 2, 0.2) - tween.parallel().tween_property(berry, "modulate:a", 0, 1) + tween.tween_property(head, "position", new_head_pos, .3) + tween.parallel().tween_property(berry, "scale:x", 0.1, .25) + tween.parallel().tween_property(berry, "scale:y", 0.1, .25) + tween.parallel().tween_property(berry, "position:y", -100, .25) + tween.parallel().tween_property(berry, "global_position:x", body_part.global_position.x, .6) head.eat() - body_part.gp = berry.gp await tween.finished body_part.right() - + berry.queue_free() is_eating = false @@ -109,20 +114,26 @@ func spit_berry(berry: Berry) -> void: # Eat the berry var tween: Tween = create_tween() - tween.tween_property(berry, "global_position:x",head.global_position.x + BODY_PART_WIDTH * 2, .2) + tween.parallel().tween_property(berry, "scale:x", 0.1, .2) + tween.parallel().tween_property(berry, "scale:y", 0.1, .2) + tween.parallel().tween_property(berry, "position:y", -100, .25) + tween.tween_property(berry, "global_position:x",head.global_position.x, .2) await head.eat() # Spit the berry head.spit() tween = create_tween() tween.tween_property(berry, "global_position:x", pos_x, 0.2) + tween.parallel().tween_property(berry, "scale:x", 1, .2) + tween.parallel().tween_property(berry, "scale:y", 1, .2) + tween.parallel().tween_property(berry, "position:y", 0, .25) await tween.finished await berry.wrong() # Make the berry disappear tween = create_tween() tween.tween_property(berry, "modulate:a", 0, 1) - await tween.finished + await tween.finished is_eating = false @@ -130,24 +141,20 @@ func spit_berry(berry: Berry) -> void: func reset() -> void: # Move the head and the body parts back var tween: Tween = create_tween() - tween.tween_property(head, "position:x", 0, 0.2) + tween.tween_property(head, "position:x", 165, 0.5) - for index: int in range(1, body_parts.get_child_count()): - tween.parallel().tween_property(body_parts.get_child(index), "position:x", 0, 0.2) - - # Clear text on the first body part - var body_part: CaterpillarBody = body_parts.get_child(0) - body_part.gp = {} + for index: int in range(0, body_parts.get_child_count()): + tween.parallel().tween_property(body_parts.get_child(index), "modulate:a", 0, 0.5) await tween.finished # Remove the old parts - for index: int in range(1, body_parts.get_child_count()): + for index: int in range(0, body_parts.get_child_count()): body_parts.get_child(index).queue_free() func _on_eat_area_2d_area_entered(area: Area2D) -> void: - if area is Berry and !is_moving: + if area is Berry and !is_switching_branch: var berry: Berry = area as Berry berry.is_eaten = true berry_eaten.emit(berry) diff --git a/sources/minigames/caterpillar/caterpillar.tscn b/sources/minigames/caterpillar/caterpillar.tscn index bc1f8385..6505f30c 100644 --- a/sources/minigames/caterpillar/caterpillar.tscn +++ b/sources/minigames/caterpillar/caterpillar.tscn @@ -1,47 +1,97 @@ -[gd_scene load_steps=8 format=3 uid="uid://cqx0qux4msnm7"] +[gd_scene load_steps=14 format=3 uid="uid://cqx0qux4msnm7"] [ext_resource type="Script" uid="uid://ui362fnglx0k" path="res://sources/minigames/caterpillar/caterpillar.gd" id="1_addut"] -[ext_resource type="PackedScene" uid="uid://dryu60mtiqv3" path="res://sources/minigames/caterpillar/caterpillar_body.tscn" id="2_vrjdf"] -[ext_resource type="Texture2D" uid="uid://bb3pue3wwsyc0" path="res://assets/minigames/caterpillar/graphics/caterpillar_tail_1.png" id="14_dchxm"] -[ext_resource type="Texture2D" uid="uid://c7noke1ky61q8" path="res://assets/minigames/caterpillar/graphics/caterpillar_tail_2.png" id="15_i1gfi"] -[ext_resource type="Texture2D" uid="uid://77xcd53bfk3h" path="res://assets/minigames/caterpillar/graphics/caterpillar_tail_3.png" id="16_w74x8"] +[ext_resource type="Texture2D" uid="uid://cyxl5ep0vuavl" path="res://assets/minigames/caterpillar/graphics/caterpillar_spritesheet.png" id="3_iusck"] [ext_resource type="PackedScene" uid="uid://cm7e5ir8ykhpv" path="res://sources/minigames/caterpillar/caterpillar_head.tscn" id="17_ty72k"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_6qw72"] size = Vector2(34, 256) +[sub_resource type="AtlasTexture" id="AtlasTexture_noi0q"] +atlas = ExtResource("3_iusck") +region = Rect2(0, 2050, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_nx4nf"] +atlas = ExtResource("3_iusck") +region = Rect2(410, 2050, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ddt3b"] +atlas = ExtResource("3_iusck") +region = Rect2(820, 2050, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_x5c23"] +atlas = ExtResource("3_iusck") +region = Rect2(1230, 2050, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_s16mg"] +atlas = ExtResource("3_iusck") +region = Rect2(1640, 2050, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_q6eh7"] +atlas = ExtResource("3_iusck") +region = Rect2(2050, 2050, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_thukv"] +atlas = ExtResource("3_iusck") +region = Rect2(2460, 2050, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_3nhcw"] +atlas = ExtResource("3_iusck") +region = Rect2(2870, 2050, 410, 410) + +[sub_resource type="SpriteFrames" id="SpriteFrames_2eysc"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_noi0q") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_nx4nf") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ddt3b") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_x5c23") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_s16mg") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_q6eh7") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_thukv") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_3nhcw") +}], +"loop": true, +"name": &"default", +"speed": 12.0 +}] + [node name="Caterpillar" type="Node2D"] script = ExtResource("1_addut") [node name="BodyParts" type="Node2D" parent="."] -position = Vector2(64, 0) -[node name="CaterpillarBody" parent="BodyParts" instance=ExtResource("2_vrjdf")] +[node name="Head" parent="." instance=ExtResource("17_ty72k")] +position = Vector2(165, 0) + +[node name="EatArea2D" type="Area2D" parent="Head"] +position = Vector2(184, -128) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Head/EatArea2D"] +position = Vector2(200, 0) +shape = SubResource("RectangleShape2D_6qw72") [node name="Tail" type="Node2D" parent="."] -[node name="Tail1" type="Sprite2D" parent="Tail"] -position = Vector2(40, -168) -scale = Vector2(2, 2) -texture = ExtResource("14_dchxm") - -[node name="Tail2" type="Sprite2D" parent="Tail"] -position = Vector2(8, -192) -scale = Vector2(2, 2) -texture = ExtResource("15_i1gfi") - -[node name="Tail3" type="Sprite2D" parent="Tail"] -position = Vector2(-16, -192) -scale = Vector2(2, 2) -texture = ExtResource("16_w74x8") - -[node name="Head" parent="." instance=ExtResource("17_ty72k")] - -[node name="EatArea2D" type="Area2D" parent="Head"] - -[node name="CollisionShape2D" type="CollisionShape2D" parent="Head/EatArea2D"] -position = Vector2(416, -128) -shape = SubResource("RectangleShape2D_6qw72") +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="Tail"] +position = Vector2(88, -99) +scale = Vector2(0.48, 0.48) +sprite_frames = SubResource("SpriteFrames_2eysc") +autoplay = "default" [connection signal="area_entered" from="Head/EatArea2D" to="." method="_on_eat_area_2d_area_entered"] -[connection signal="body_entered" from="Head/EatArea2D" to="." method="_on_eat_area_2d_body_entered"] diff --git a/sources/minigames/caterpillar/caterpillar_body.gd b/sources/minigames/caterpillar/caterpillar_body.gd index e077853d..226bb5b4 100644 --- a/sources/minigames/caterpillar/caterpillar_body.gd +++ b/sources/minigames/caterpillar/caterpillar_body.gd @@ -1,4 +1,3 @@ -@tool class_name CaterpillarBody extends Node2D @@ -7,26 +6,82 @@ var gp: Dictionary = {}: gp = value if gp.has("Grapheme"): label.text = gp.Grapheme + resize_body() else: label.text = "" + resize_body() +var margin: float = 1.0 +var base_width: int = 10 # Minimal width of the body -@onready var animated_sprite: AnimatedSprite2D = $AnimatedSprite2D -@onready var label: Label = $Label -@onready var right_FX: RightFX = $RightFX - - -func _ready() -> void: - walk() +# @onready var animated_sprite: AnimatedSprite2D = $AnimatedSprite2D +@onready var label: Label = %Label +@onready var right_FX: RightFX = %RightFX +@onready var body_left: Sprite2D = %Sprite2D_Body_Left +@onready var body_center: TextureRect = %TextureRect_Body_Center +@onready var body_right: Sprite2D = %Sprite2D_Body_Right +@onready var caterpillar_leg_back: AnimatedSprite2D = $Position/AnimatedSprite2D_Leg_Back +@onready var caterpillar_leg_front: AnimatedSprite2D = $Position/AnimatedSprite2D_Leg_Front func idle() -> void: - animated_sprite.play("idle") + caterpillar_leg_front.pause() + caterpillar_leg_back.pause() func walk() -> void: - animated_sprite.play("walk") + caterpillar_leg_front.play() + caterpillar_leg_back.play() func right() -> void: right_FX.play() await right_FX.finished + + +func get_width() -> float: + label.reset_size() + var text_w: float = label.size.x + var end_width: float = max(float(base_width), text_w + float(margin) * 2.0) + return end_width + + +func resize_body() -> void: + var letters_count: int = label.text.length() + if letters_count <= 0: + return + + var end_width: float = get_width() + var center_h: float = float(body_center.texture.get_height()) + + var tween: Tween = get_tree().create_tween() + tween.set_trans(Tween.TRANS_SINE) + tween.set_ease(Tween.EASE_OUT) + + var apply_width: Callable = func(width: float) -> void: + body_center.size = Vector2(width, center_h) + _update_body_layout() + + var start_width: float = body_center.size.x + tween.tween_method(apply_width, start_width, end_width, 0.3) + + await tween.finished + + caterpillar_leg_back.global_position = Vector2(body_center.global_position.x + end_width/2, caterpillar_leg_back.global_position.y) + caterpillar_leg_front.global_position = Vector2(body_center.global_position.x + end_width/2, caterpillar_leg_front.global_position.y) + + +func _update_body_layout() -> void: + var left_width: float = float(body_left.texture.get_width()) + var center_height: float = float(body_center.texture.get_height()) + var current_center_w: float = body_center.size.x + var label_width: float = label.size.x + var label_height: float = label.size.y + + body_left.position = Vector2(0.0, 0.0) + body_center.position = Vector2(left_width, 0.0) + body_right.position = Vector2(left_width + current_center_w, 0.0) + + label.position = Vector2( + left_width + margin + (current_center_w - 2.0 * margin) * 0.5 - label_width * 0.5, + center_height * 0.5 - label_height * 0.5 + ) diff --git a/sources/minigames/caterpillar/caterpillar_body.tscn b/sources/minigames/caterpillar/caterpillar_body.tscn index ba84718e..0011eee9 100644 --- a/sources/minigames/caterpillar/caterpillar_body.tscn +++ b/sources/minigames/caterpillar/caterpillar_body.tscn @@ -1,92 +1,189 @@ -[gd_scene load_steps=17 format=3 uid="uid://dryu60mtiqv3"] +[gd_scene load_steps=26 format=3 uid="uid://dryu60mtiqv3"] -[ext_resource type="Texture2D" uid="uid://b10j7xa7pso3w" path="res://assets/minigames/caterpillar/graphics/caterpillar_body_idle_1_0000.png" id="1_2884l"] [ext_resource type="Script" uid="uid://ynqc2tqeuqt3" path="res://sources/minigames/caterpillar/caterpillar_body.gd" id="1_vvkkg"] -[ext_resource type="Texture2D" uid="uid://kkavneaje7ra" path="res://assets/minigames/caterpillar/graphics/caterpillar_body_idle_1_0001.png" id="2_r8mkw"] -[ext_resource type="Texture2D" uid="uid://ddsgq1gatqu0f" path="res://assets/minigames/caterpillar/graphics/caterpillar_body_idle_1_0002.png" id="3_iyvc5"] -[ext_resource type="Texture2D" uid="uid://bdkcewub7o4bs" path="res://assets/minigames/caterpillar/graphics/caterpillar_body_idle_1_0003.png" id="4_ejyrg"] -[ext_resource type="Texture2D" uid="uid://c36k5xax8ycw8" path="res://assets/minigames/caterpillar/graphics/caterpillar_body_idle_1_0004.png" id="5_wiekb"] -[ext_resource type="Texture2D" uid="uid://cypc4gngcxkl2" path="res://assets/minigames/caterpillar/graphics/caterpillar_body_idle_1_0005.png" id="6_8ul1u"] -[ext_resource type="Texture2D" uid="uid://dnfw1mfbyxr5" path="res://assets/minigames/caterpillar/graphics/caterpillar_body_walk_0001.png" id="7_g82q5"] -[ext_resource type="Texture2D" uid="uid://dpvakr5hu5vpl" path="res://assets/minigames/caterpillar/graphics/caterpillar_body_walk_0002.png" id="8_bhhph"] -[ext_resource type="Texture2D" uid="uid://b2n60a44wnc3l" path="res://assets/minigames/caterpillar/graphics/caterpillar_body_walk_0003.png" id="9_ybl87"] -[ext_resource type="Texture2D" uid="uid://ciyvvrebsilsc" path="res://assets/minigames/caterpillar/graphics/caterpillar_body_walk_0004.png" id="10_yck3v"] -[ext_resource type="Texture2D" uid="uid://dglxepw3sraye" path="res://assets/minigames/caterpillar/graphics/caterpillar_body_walk_0005.png" id="11_tnnjk"] -[ext_resource type="Texture2D" uid="uid://hwk6152g66qr" path="res://assets/minigames/caterpillar/graphics/caterpillar_body_walk_0007.png" id="12_wkhrj"] +[ext_resource type="Texture2D" uid="uid://dg035yddvs04o" path="res://assets/minigames/caterpillar/graphics/caterpillar_legs_spritesheet.png" id="2_20a20"] +[ext_resource type="LabelSettings" uid="uid://vk8pnpl5skbd" path="res://resources/themes/minigames_label_settings_caterpillar.tres" id="7_6wjy7"] [ext_resource type="PackedScene" uid="uid://cn2rw06pltyiu" path="res://sources/utils/fx/right.tscn" id="14_cyw4o"] -[ext_resource type="LabelSettings" uid="uid://bguqnhiblwick" path="res://resources/themes/minigames_label_settings.tres" id="15_7eh5m"] +[ext_resource type="Texture2D" uid="uid://dkc630ptqucrp" path="res://assets/minigames/caterpillar/graphics/caterpillar_body_left.png" id="15_2xyl2"] +[ext_resource type="Texture2D" uid="uid://bxqxl2iflusat" path="res://assets/minigames/caterpillar/graphics/caterpillar_body_center.png" id="16_8jigi"] +[ext_resource type="Texture2D" uid="uid://df6l2panyr65v" path="res://assets/minigames/caterpillar/graphics/caterpillar_body_right.png" id="17_rhhiw"] -[sub_resource type="SpriteFrames" id="SpriteFrames_236fx"] +[sub_resource type="AtlasTexture" id="AtlasTexture_kljk1"] +atlas = ExtResource("2_20a20") +region = Rect2(0, 58, 58, 58) + +[sub_resource type="AtlasTexture" id="AtlasTexture_5x4bm"] +atlas = ExtResource("2_20a20") +region = Rect2(58, 58, 58, 58) + +[sub_resource type="AtlasTexture" id="AtlasTexture_hm3do"] +atlas = ExtResource("2_20a20") +region = Rect2(116, 58, 58, 58) + +[sub_resource type="AtlasTexture" id="AtlasTexture_2kxuy"] +atlas = ExtResource("2_20a20") +region = Rect2(174, 58, 58, 58) + +[sub_resource type="AtlasTexture" id="AtlasTexture_qurmb"] +atlas = ExtResource("2_20a20") +region = Rect2(232, 58, 58, 58) + +[sub_resource type="AtlasTexture" id="AtlasTexture_qcxec"] +atlas = ExtResource("2_20a20") +region = Rect2(290, 58, 58, 58) + +[sub_resource type="AtlasTexture" id="AtlasTexture_xf60k"] +atlas = ExtResource("2_20a20") +region = Rect2(348, 58, 58, 58) + +[sub_resource type="AtlasTexture" id="AtlasTexture_7q7ci"] +atlas = ExtResource("2_20a20") +region = Rect2(406, 58, 58, 58) + +[sub_resource type="SpriteFrames" id="SpriteFrames_xdpna"] animations = [{ "frames": [{ "duration": 1.0, -"texture": ExtResource("1_2884l") +"texture": SubResource("AtlasTexture_kljk1") }, { "duration": 1.0, -"texture": ExtResource("2_r8mkw") +"texture": SubResource("AtlasTexture_5x4bm") }, { "duration": 1.0, -"texture": ExtResource("3_iyvc5") +"texture": SubResource("AtlasTexture_hm3do") }, { "duration": 1.0, -"texture": ExtResource("4_ejyrg") +"texture": SubResource("AtlasTexture_2kxuy") }, { "duration": 1.0, -"texture": ExtResource("5_wiekb") +"texture": SubResource("AtlasTexture_qurmb") }, { "duration": 1.0, -"texture": ExtResource("6_8ul1u") +"texture": SubResource("AtlasTexture_qcxec") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_xf60k") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_7q7ci") }], "loop": true, -"name": &"idle", +"name": &"default", "speed": 12.0 -}, { +}] + +[sub_resource type="AtlasTexture" id="AtlasTexture_mar67"] +atlas = ExtResource("2_20a20") +region = Rect2(0, 0, 58, 58) + +[sub_resource type="AtlasTexture" id="AtlasTexture_qlsel"] +atlas = ExtResource("2_20a20") +region = Rect2(58, 0, 58, 58) + +[sub_resource type="AtlasTexture" id="AtlasTexture_pbqxf"] +atlas = ExtResource("2_20a20") +region = Rect2(116, 0, 58, 58) + +[sub_resource type="AtlasTexture" id="AtlasTexture_trbgy"] +atlas = ExtResource("2_20a20") +region = Rect2(174, 0, 58, 58) + +[sub_resource type="AtlasTexture" id="AtlasTexture_en6ls"] +atlas = ExtResource("2_20a20") +region = Rect2(232, 0, 58, 58) + +[sub_resource type="AtlasTexture" id="AtlasTexture_0aqu6"] +atlas = ExtResource("2_20a20") +region = Rect2(290, 0, 58, 58) + +[sub_resource type="AtlasTexture" id="AtlasTexture_u3ehn"] +atlas = ExtResource("2_20a20") +region = Rect2(348, 0, 58, 58) + +[sub_resource type="AtlasTexture" id="AtlasTexture_wudb4"] +atlas = ExtResource("2_20a20") +region = Rect2(406, 0, 58, 58) + +[sub_resource type="SpriteFrames" id="SpriteFrames_018u2"] +animations = [{ "frames": [{ "duration": 1.0, -"texture": ExtResource("7_g82q5") +"texture": SubResource("AtlasTexture_mar67") }, { "duration": 1.0, -"texture": ExtResource("8_bhhph") +"texture": SubResource("AtlasTexture_qlsel") }, { "duration": 1.0, -"texture": ExtResource("9_ybl87") +"texture": SubResource("AtlasTexture_pbqxf") }, { "duration": 1.0, -"texture": ExtResource("10_yck3v") +"texture": SubResource("AtlasTexture_trbgy") }, { "duration": 1.0, -"texture": ExtResource("11_tnnjk") +"texture": SubResource("AtlasTexture_en6ls") }, { "duration": 1.0, -"texture": ExtResource("12_wkhrj") +"texture": SubResource("AtlasTexture_0aqu6") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_u3ehn") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_wudb4") }], "loop": true, -"name": &"walk", +"name": &"default", "speed": 12.0 }] [node name="CaterpillarBody" type="Node2D"] script = ExtResource("1_vvkkg") -[node name="RightFX" parent="." instance=ExtResource("14_cyw4o")] +[node name="Position" type="Node2D" parent="."] +position = Vector2(0, -150) + +[node name="AnimatedSprite2D_Leg_Back" type="AnimatedSprite2D" parent="Position"] +position = Vector2(40, 140) +sprite_frames = SubResource("SpriteFrames_xdpna") + +[node name="RightFX" parent="Position" instance=ExtResource("14_cyw4o")] +unique_name_in_owner = true offset_left = 64.0 offset_top = -128.0 offset_right = 64.0 offset_bottom = -128.0 -[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] -position = Vector2(0, 16) -scale = Vector2(2, 2) -sprite_frames = SubResource("SpriteFrames_236fx") -animation = &"walk" -frame_progress = 0.801874 -offset = Vector2(32, -64) +[node name="Node2D" type="Node2D" parent="Position"] +position = Vector2(0, -29) +scale = Vector2(1, 1.4) -[node name="Label" type="Label" parent="."] -offset_left = -8.0 -offset_top = -216.0 -offset_right = 136.0 -offset_bottom = -72.0 -label_settings = ExtResource("15_7eh5m") +[node name="Sprite2D_Body_Left" type="Sprite2D" parent="Position/Node2D"] +unique_name_in_owner = true +texture = ExtResource("15_2xyl2") +centered = false + +[node name="TextureRect_Body_Center" type="TextureRect" parent="Position/Node2D"] +unique_name_in_owner = true +offset_right = 9.0 +offset_bottom = 114.0 +texture = ExtResource("16_8jigi") +stretch_mode = 1 + +[node name="Sprite2D_Body_Right" type="Sprite2D" parent="Position/Node2D"] +unique_name_in_owner = true +texture = ExtResource("17_rhhiw") +centered = false + +[node name="Label" type="Label" parent="Position"] +unique_name_in_owner = true +offset_top = -50.0 +offset_right = 88.0 +offset_bottom = 151.0 +text = "e" +label_settings = ExtResource("7_6wjy7") horizontal_alignment = 1 vertical_alignment = 1 + +[node name="AnimatedSprite2D_Leg_Front" type="AnimatedSprite2D" parent="Position"] +position = Vector2(40, 140) +sprite_frames = SubResource("SpriteFrames_018u2") diff --git a/sources/minigames/caterpillar/caterpillar_body_side.tscn b/sources/minigames/caterpillar/caterpillar_body_side.tscn new file mode 100644 index 00000000..3e7c3d59 --- /dev/null +++ b/sources/minigames/caterpillar/caterpillar_body_side.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=2 format=3 uid="uid://sftb8mjylf53"] + +[ext_resource type="Texture2D" uid="uid://dbhfoebfy5br4" path="res://assets/minigames/caterpillar/graphics/caterpillar_body_side.png" id="1_msoev"] + +[node name="Position" type="Node2D"] + +[node name="CaterpillarBodySide" type="Sprite2D" parent="."] +position = Vector2(5.5, -98) +scale = Vector2(1, 1.4) +texture = ExtResource("1_msoev") diff --git a/sources/minigames/caterpillar/caterpillar_head.gd b/sources/minigames/caterpillar/caterpillar_head.gd index bcaebeca..5f12dd25 100644 --- a/sources/minigames/caterpillar/caterpillar_head.gd +++ b/sources/minigames/caterpillar/caterpillar_head.gd @@ -1,7 +1,8 @@ -@tool class_name CaterpillarHead extends Node2D +var is_paused: bool = false + @onready var animated_sprite: AnimatedSprite2D = $AnimatedSprite2D @onready var audio_stream_player: CaterpillarAudioStreamPlayer = $CaterpillarAudioStreamPlayer @onready var spit_vfx: SpitVFX = $SpitFX @@ -13,9 +14,9 @@ func _ready() -> void: func idle() -> void: if randf() < 0.8: - animated_sprite.play("idle1") + animated_sprite.play("idle") else: - animated_sprite.play("idle2") + animated_sprite.play("idle_blink") func eat() -> void: @@ -31,4 +32,17 @@ func spit() -> void: func _on_animation_finished() -> void: + if not is_paused: + idle() + else: + animated_sprite.set_frame_and_progress(0, 0) + + +func pause_animation() -> void: + is_paused = true + animated_sprite.pause() + + +func resume_animation() -> void: + is_paused = false idle() diff --git a/sources/minigames/caterpillar/caterpillar_head.tscn b/sources/minigames/caterpillar/caterpillar_head.tscn index 5cd4e0c7..adb94c58 100644 --- a/sources/minigames/caterpillar/caterpillar_head.tscn +++ b/sources/minigames/caterpillar/caterpillar_head.tscn @@ -1,54 +1,207 @@ -[gd_scene load_steps=30 format=3 uid="uid://cm7e5ir8ykhpv"] +[gd_scene load_steps=45 format=3 uid="uid://cm7e5ir8ykhpv"] [ext_resource type="Script" uid="uid://cnff6x5ax6es" path="res://sources/minigames/caterpillar/caterpillar_head.gd" id="1_775bq"] -[ext_resource type="Texture2D" uid="uid://cm2logtgvc2xj" path="res://assets/minigames/caterpillar/graphics/caterpillar_head_eat_0000.png" id="2_bms4j"] -[ext_resource type="Texture2D" uid="uid://cktwccok14wg" path="res://assets/minigames/caterpillar/graphics/caterpillar_head_eat_0001.png" id="3_b7ria"] -[ext_resource type="Texture2D" uid="uid://dc1daykhulypa" path="res://assets/minigames/caterpillar/graphics/caterpillar_head_eat_0002.png" id="4_o1mx3"] -[ext_resource type="Texture2D" uid="uid://bih660a72lgox" path="res://assets/minigames/caterpillar/graphics/caterpillar_head_eat_0003.png" id="5_4bxl4"] -[ext_resource type="Texture2D" uid="uid://dh5j4wnixs535" path="res://assets/minigames/caterpillar/graphics/caterpillar_head_eat_0004.png" id="6_phfqk"] -[ext_resource type="Texture2D" uid="uid://b4it1ogu1u0xk" path="res://assets/minigames/caterpillar/graphics/caterpillar_head_eat_0005.png" id="7_g2swl"] -[ext_resource type="Texture2D" uid="uid://c3nbblslby5bu" path="res://assets/minigames/caterpillar/graphics/caterpillar_head_idle_1_0000.png" id="8_oceii"] -[ext_resource type="Texture2D" uid="uid://dilxohj0cpgcq" path="res://assets/minigames/caterpillar/graphics/caterpillar_head_idle_1_0001.png" id="9_shkbq"] -[ext_resource type="Texture2D" uid="uid://p88pp7ugc74q" path="res://assets/minigames/caterpillar/graphics/caterpillar_head_idle_1_0002.png" id="10_qqxdf"] -[ext_resource type="Texture2D" uid="uid://cieeg7571ksa" path="res://assets/minigames/caterpillar/graphics/caterpillar_head_idle_1_0003.png" id="11_e6riq"] -[ext_resource type="Texture2D" uid="uid://3w4byuhu5x4o" path="res://assets/minigames/caterpillar/graphics/caterpillar_head_idle_1_0004.png" id="12_0dkir"] -[ext_resource type="Texture2D" uid="uid://be3gtyrvh7ktx" path="res://assets/minigames/caterpillar/graphics/caterpillar_head_idle_1_0005.png" id="13_tueu4"] -[ext_resource type="Texture2D" uid="uid://bguj7bmtcx8nw" path="res://assets/minigames/caterpillar/graphics/caterpillar_head_idle_2_0000.png" id="14_31lhl"] -[ext_resource type="Texture2D" uid="uid://cwd8jj6n5osb5" path="res://assets/minigames/caterpillar/graphics/caterpillar_head_idle_2_0001.png" id="15_eojms"] -[ext_resource type="Texture2D" uid="uid://d4be4pw7dlc1m" path="res://assets/minigames/caterpillar/graphics/caterpillar_head_idle_2_0002.png" id="16_nafi5"] -[ext_resource type="Texture2D" uid="uid://d02mcpcxt8642" path="res://assets/minigames/caterpillar/graphics/caterpillar_head_idle_2_0003.png" id="17_2uw8y"] -[ext_resource type="Texture2D" uid="uid://7ck7wl3paakd" path="res://assets/minigames/caterpillar/graphics/caterpillar_head_idle_2_0004.png" id="18_ur1fa"] -[ext_resource type="Texture2D" uid="uid://bqksaxymxf3jb" path="res://assets/minigames/caterpillar/graphics/caterpillar_head_idle_2_0005.png" id="19_yfbnl"] -[ext_resource type="Texture2D" uid="uid://b2gq7rp00465p" path="res://assets/minigames/caterpillar/graphics/caterpillar_head_spit_0000.png" id="20_m706h"] -[ext_resource type="Texture2D" uid="uid://7dmi0ppf7l14" path="res://assets/minigames/caterpillar/graphics/caterpillar_head_spit_0001.png" id="21_8bqpq"] -[ext_resource type="Texture2D" uid="uid://fuy8gpq16rx0" path="res://assets/minigames/caterpillar/graphics/caterpillar_head_spit_0002.png" id="22_0xvrf"] -[ext_resource type="Texture2D" uid="uid://e7slqekktoy2" path="res://assets/minigames/caterpillar/graphics/caterpillar_head_spit_0003.png" id="23_62scc"] -[ext_resource type="Texture2D" uid="uid://bcb58png710nc" path="res://assets/minigames/caterpillar/graphics/caterpillar_head_spit_0004.png" id="24_njvfl"] -[ext_resource type="Texture2D" uid="uid://fshkh73oisnk" path="res://assets/minigames/caterpillar/graphics/caterpillar_head_spit_0005.png" id="25_g5ryg"] +[ext_resource type="Texture2D" uid="uid://cyxl5ep0vuavl" path="res://assets/minigames/caterpillar/graphics/caterpillar_spritesheet.png" id="9_qh6do"] [ext_resource type="AudioStream" uid="uid://cwq2mee1dy4w7" path="res://assets/minigames/caterpillar/audios/caterpillar_eat_random_01.mp3" id="26_f75m3"] [ext_resource type="Script" uid="uid://b37yj46mbp3s2" path="res://sources/minigames/caterpillar/caterpillar_audio_stream_player.gd" id="27_x0mct"] [ext_resource type="PackedScene" uid="uid://dyn71e3ttv2le" path="res://sources/minigames/caterpillar/spit_fx.tscn" id="28_vojnm"] +[sub_resource type="AtlasTexture" id="AtlasTexture_5v128"] +atlas = ExtResource("9_qh6do") +region = Rect2(0, 820, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_vibkh"] +atlas = ExtResource("9_qh6do") +region = Rect2(410, 820, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_mq30j"] +atlas = ExtResource("9_qh6do") +region = Rect2(820, 820, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_rbtkw"] +atlas = ExtResource("9_qh6do") +region = Rect2(1230, 820, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_8atv4"] +atlas = ExtResource("9_qh6do") +region = Rect2(1640, 820, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_f2eeo"] +atlas = ExtResource("9_qh6do") +region = Rect2(2050, 820, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_68rst"] +atlas = ExtResource("9_qh6do") +region = Rect2(2460, 820, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_uac1u"] +atlas = ExtResource("9_qh6do") +region = Rect2(2870, 820, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_bebcu"] +atlas = ExtResource("9_qh6do") +region = Rect2(0, 1230, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_d2ur7"] +atlas = ExtResource("9_qh6do") +region = Rect2(410, 1230, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_k5lmj"] +atlas = ExtResource("9_qh6do") +region = Rect2(820, 1230, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_aar5i"] +atlas = ExtResource("9_qh6do") +region = Rect2(1230, 1230, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_qh6do"] +atlas = ExtResource("9_qh6do") +region = Rect2(1640, 1230, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_qcwo7"] +atlas = ExtResource("9_qh6do") +region = Rect2(2050, 1230, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_0juk6"] +atlas = ExtResource("9_qh6do") +region = Rect2(0, 0, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_3f424"] +atlas = ExtResource("9_qh6do") +region = Rect2(410, 0, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_daps1"] +atlas = ExtResource("9_qh6do") +region = Rect2(820, 0, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_mttxd"] +atlas = ExtResource("9_qh6do") +region = Rect2(1230, 0, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_duafw"] +atlas = ExtResource("9_qh6do") +region = Rect2(1640, 0, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_fl3sr"] +atlas = ExtResource("9_qh6do") +region = Rect2(2050, 0, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_yn5gx"] +atlas = ExtResource("9_qh6do") +region = Rect2(2460, 0, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_xrnoq"] +atlas = ExtResource("9_qh6do") +region = Rect2(2870, 0, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_qbu41"] +atlas = ExtResource("9_qh6do") +region = Rect2(0, 410, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_t5crg"] +atlas = ExtResource("9_qh6do") +region = Rect2(410, 410, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_j2uob"] +atlas = ExtResource("9_qh6do") +region = Rect2(820, 410, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_juao2"] +atlas = ExtResource("9_qh6do") +region = Rect2(1230, 410, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_jhrxf"] +atlas = ExtResource("9_qh6do") +region = Rect2(1640, 410, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_l7sv6"] +atlas = ExtResource("9_qh6do") +region = Rect2(2050, 410, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_pofaq"] +atlas = ExtResource("9_qh6do") +region = Rect2(2460, 410, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_671tm"] +atlas = ExtResource("9_qh6do") +region = Rect2(2870, 410, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_njy36"] +atlas = ExtResource("9_qh6do") +region = Rect2(0, 1640, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_6lthe"] +atlas = ExtResource("9_qh6do") +region = Rect2(410, 1640, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_3nvlf"] +atlas = ExtResource("9_qh6do") +region = Rect2(820, 1640, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ydhaj"] +atlas = ExtResource("9_qh6do") +region = Rect2(1230, 1640, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_fc32k"] +atlas = ExtResource("9_qh6do") +region = Rect2(1640, 1640, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_q4ia1"] +atlas = ExtResource("9_qh6do") +region = Rect2(2050, 1640, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_uah8d"] +atlas = ExtResource("9_qh6do") +region = Rect2(2460, 1640, 410, 410) + +[sub_resource type="AtlasTexture" id="AtlasTexture_sx40b"] +atlas = ExtResource("9_qh6do") +region = Rect2(2870, 1640, 410, 410) + [sub_resource type="SpriteFrames" id="SpriteFrames_x8rro"] animations = [{ "frames": [{ "duration": 1.0, -"texture": ExtResource("2_bms4j") +"texture": SubResource("AtlasTexture_5v128") }, { "duration": 1.0, -"texture": ExtResource("3_b7ria") +"texture": SubResource("AtlasTexture_vibkh") }, { "duration": 1.0, -"texture": ExtResource("4_o1mx3") +"texture": SubResource("AtlasTexture_mq30j") }, { "duration": 1.0, -"texture": ExtResource("5_4bxl4") +"texture": SubResource("AtlasTexture_rbtkw") }, { "duration": 1.0, -"texture": ExtResource("6_phfqk") +"texture": SubResource("AtlasTexture_8atv4") }, { "duration": 1.0, -"texture": ExtResource("7_g2swl") +"texture": SubResource("AtlasTexture_f2eeo") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_68rst") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_uac1u") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_bebcu") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_d2ur7") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_k5lmj") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_aar5i") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_qh6do") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_qcwo7") }], "loop": false, "name": &"eat", @@ -56,68 +209,86 @@ animations = [{ }, { "frames": [{ "duration": 1.0, -"texture": ExtResource("8_oceii") +"texture": SubResource("AtlasTexture_0juk6") }, { "duration": 1.0, -"texture": ExtResource("9_shkbq") +"texture": SubResource("AtlasTexture_3f424") }, { "duration": 1.0, -"texture": ExtResource("10_qqxdf") +"texture": SubResource("AtlasTexture_daps1") }, { "duration": 1.0, -"texture": ExtResource("11_e6riq") +"texture": SubResource("AtlasTexture_mttxd") }, { "duration": 1.0, -"texture": ExtResource("12_0dkir") +"texture": SubResource("AtlasTexture_duafw") }, { "duration": 1.0, -"texture": ExtResource("13_tueu4") +"texture": SubResource("AtlasTexture_fl3sr") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_yn5gx") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_xrnoq") }], -"loop": false, -"name": &"idle1", +"loop": true, +"name": &"idle", "speed": 12.0 }, { "frames": [{ "duration": 1.0, -"texture": ExtResource("14_31lhl") +"texture": SubResource("AtlasTexture_qbu41") }, { "duration": 1.0, -"texture": ExtResource("15_eojms") +"texture": SubResource("AtlasTexture_t5crg") }, { "duration": 1.0, -"texture": ExtResource("16_nafi5") +"texture": SubResource("AtlasTexture_j2uob") }, { "duration": 1.0, -"texture": ExtResource("17_2uw8y") +"texture": SubResource("AtlasTexture_juao2") }, { "duration": 1.0, -"texture": ExtResource("18_ur1fa") +"texture": SubResource("AtlasTexture_jhrxf") }, { "duration": 1.0, -"texture": ExtResource("19_yfbnl") +"texture": SubResource("AtlasTexture_l7sv6") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_pofaq") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_671tm") }], "loop": false, -"name": &"idle2", +"name": &"idle_blink", "speed": 12.0 }, { "frames": [{ "duration": 1.0, -"texture": ExtResource("20_m706h") +"texture": SubResource("AtlasTexture_njy36") }, { "duration": 1.0, -"texture": ExtResource("21_8bqpq") +"texture": SubResource("AtlasTexture_6lthe") }, { "duration": 1.0, -"texture": ExtResource("22_0xvrf") +"texture": SubResource("AtlasTexture_3nvlf") }, { "duration": 1.0, -"texture": ExtResource("23_62scc") +"texture": SubResource("AtlasTexture_ydhaj") }, { "duration": 1.0, -"texture": ExtResource("24_njvfl") +"texture": SubResource("AtlasTexture_fc32k") }, { "duration": 1.0, -"texture": ExtResource("25_g5ryg") +"texture": SubResource("AtlasTexture_q4ia1") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_uah8d") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_sx40b") }], "loop": false, "name": &"spit", @@ -129,15 +300,16 @@ script = ExtResource("1_775bq") [node name="SpitFX" parent="." instance=ExtResource("28_vojnm")] offset_left = 320.0 -offset_top = -128.0 +offset_top = -120.0 offset_right = 320.0 -offset_bottom = -128.0 +offset_bottom = -120.0 [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] -position = Vector2(296, -176) -scale = Vector2(2, 2) +position = Vector2(184, -184) sprite_frames = SubResource("SpriteFrames_x8rro") -animation = &"idle1" +animation = &"idle" +autoplay = "idle" +frame_progress = 0.6966647 [node name="CaterpillarAudioStreamPlayer" type="AudioStreamPlayer" parent="."] stream = ExtResource("26_f75m3") diff --git a/sources/minigames/caterpillar/caterpillar_leg_back.tscn b/sources/minigames/caterpillar/caterpillar_leg_back.tscn new file mode 100644 index 00000000..b1060a9d --- /dev/null +++ b/sources/minigames/caterpillar/caterpillar_leg_back.tscn @@ -0,0 +1,74 @@ +[gd_scene load_steps=11 format=3 uid="uid://3uwsp0ryoh4r"] + +[ext_resource type="Texture2D" uid="uid://dg035yddvs04o" path="res://assets/minigames/caterpillar/graphics/caterpillar_legs_spritesheet.png" id="1_3346p"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_kljk1"] +atlas = ExtResource("1_3346p") +region = Rect2(0, 58, 58, 58) + +[sub_resource type="AtlasTexture" id="AtlasTexture_5x4bm"] +atlas = ExtResource("1_3346p") +region = Rect2(58, 58, 58, 58) + +[sub_resource type="AtlasTexture" id="AtlasTexture_hm3do"] +atlas = ExtResource("1_3346p") +region = Rect2(116, 58, 58, 58) + +[sub_resource type="AtlasTexture" id="AtlasTexture_2kxuy"] +atlas = ExtResource("1_3346p") +region = Rect2(174, 58, 58, 58) + +[sub_resource type="AtlasTexture" id="AtlasTexture_qurmb"] +atlas = ExtResource("1_3346p") +region = Rect2(232, 58, 58, 58) + +[sub_resource type="AtlasTexture" id="AtlasTexture_qcxec"] +atlas = ExtResource("1_3346p") +region = Rect2(290, 58, 58, 58) + +[sub_resource type="AtlasTexture" id="AtlasTexture_xf60k"] +atlas = ExtResource("1_3346p") +region = Rect2(348, 58, 58, 58) + +[sub_resource type="AtlasTexture" id="AtlasTexture_7q7ci"] +atlas = ExtResource("1_3346p") +region = Rect2(406, 58, 58, 58) + +[sub_resource type="SpriteFrames" id="SpriteFrames_0q0l8"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_kljk1") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_5x4bm") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_hm3do") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_2kxuy") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_qurmb") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_qcxec") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_xf60k") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_7q7ci") +}], +"loop": true, +"name": &"default", +"speed": 5.0 +}] + +[node name="CaterpillarLegBack" type="Node2D"] + +[node name="AnimatedSprite2D_Leg_Back" type="AnimatedSprite2D" parent="."] +sprite_frames = SubResource("SpriteFrames_0q0l8") +autoplay = "default" +speed_scale = 2.0 diff --git a/sources/minigames/caterpillar/caterpillar_leg_front.tscn b/sources/minigames/caterpillar/caterpillar_leg_front.tscn new file mode 100644 index 00000000..bddd96d0 --- /dev/null +++ b/sources/minigames/caterpillar/caterpillar_leg_front.tscn @@ -0,0 +1,75 @@ +[gd_scene load_steps=11 format=3 uid="uid://dpnq3a54okbm7"] + +[ext_resource type="Texture2D" uid="uid://dg035yddvs04o" path="res://assets/minigames/caterpillar/graphics/caterpillar_legs_spritesheet.png" id="1_cf674"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_mar67"] +atlas = ExtResource("1_cf674") +region = Rect2(0, 0, 58, 58) + +[sub_resource type="AtlasTexture" id="AtlasTexture_qlsel"] +atlas = ExtResource("1_cf674") +region = Rect2(58, 0, 58, 58) + +[sub_resource type="AtlasTexture" id="AtlasTexture_pbqxf"] +atlas = ExtResource("1_cf674") +region = Rect2(116, 0, 58, 58) + +[sub_resource type="AtlasTexture" id="AtlasTexture_trbgy"] +atlas = ExtResource("1_cf674") +region = Rect2(174, 0, 58, 58) + +[sub_resource type="AtlasTexture" id="AtlasTexture_en6ls"] +atlas = ExtResource("1_cf674") +region = Rect2(232, 0, 58, 58) + +[sub_resource type="AtlasTexture" id="AtlasTexture_0aqu6"] +atlas = ExtResource("1_cf674") +region = Rect2(290, 0, 58, 58) + +[sub_resource type="AtlasTexture" id="AtlasTexture_u3ehn"] +atlas = ExtResource("1_cf674") +region = Rect2(348, 0, 58, 58) + +[sub_resource type="AtlasTexture" id="AtlasTexture_wudb4"] +atlas = ExtResource("1_cf674") +region = Rect2(406, 0, 58, 58) + +[sub_resource type="SpriteFrames" id="SpriteFrames_odigb"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_mar67") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_qlsel") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_pbqxf") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_trbgy") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_en6ls") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_0aqu6") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_u3ehn") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_wudb4") +}], +"loop": true, +"name": &"default", +"speed": 5.0 +}] + +[node name="CaterpillarLegFront" type="Node2D"] + +[node name="AnimatedSprite2D_Leg_Front" type="AnimatedSprite2D" parent="."] +sprite_frames = SubResource("SpriteFrames_odigb") +autoplay = "default" +frame_progress = 0.22068515 +speed_scale = 2.0 diff --git a/sources/minigames/caterpillar/caterpillar_minigame.gd b/sources/minigames/caterpillar/caterpillar_minigame.gd index 283ed2a1..e489b5ad 100644 --- a/sources/minigames/caterpillar/caterpillar_minigame.gd +++ b/sources/minigames/caterpillar/caterpillar_minigame.gd @@ -1,4 +1,3 @@ -@tool extends WordsMinigame const BRANCH_SCENE: PackedScene = preload("res://sources/minigames/caterpillar/branch.tscn") diff --git a/sources/minigames/crabs/crab/crab.tscn b/sources/minigames/crabs/crab/crab.tscn index 467fc9ae..b2a613b6 100644 --- a/sources/minigames/crabs/crab/crab.tscn +++ b/sources/minigames/crabs/crab/crab.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=51 format=3 uid="uid://bwe3fp0vkpufb"] +[gd_scene load_steps=50 format=3 uid="uid://bwe3fp0vkpufb"] [ext_resource type="Script" uid="uid://dsv0728uv1y5l" path="res://sources/minigames/crabs/crab/crab.gd" id="1_5hgg8"] [ext_resource type="AudioStream" uid="uid://1ibmtydnewa8" path="res://assets/minigames/crabs/audio/sfx/crab_random_6.mp3" id="2_gc7a0"] @@ -8,16 +8,10 @@ [ext_resource type="PackedScene" uid="uid://dlmbxcgiv8tpr" path="res://sources/utils/fx/wrong.tscn" id="5_3sw4w"] [ext_resource type="Texture2D" uid="uid://c34sgkbvr3h8q" path="res://assets/minigames/minigame_ui/graphic/primary_text_box.png" id="7_wj62x"] [ext_resource type="Script" uid="uid://d5qkkg88431w" path="res://sources/utils/percent_margin_container.gd" id="8_6t11r"] +[ext_resource type="LabelSettings" uid="uid://bguqnhiblwick" path="res://resources/themes/minigames_label_settings.tres" id="8_c4r2k"] [ext_resource type="PackedScene" uid="uid://bgio7muqck2bu" path="res://sources/utils/auto_size_label.tscn" id="9_3nie6"] -[ext_resource type="FontFile" uid="uid://bw8cb4e0a7ayj" path="res://assets/fonts/kalulu_mulish_regular.otf" id="10_kdwxe"] [ext_resource type="Texture2D" uid="uid://bbtr0cyiapi3g" path="res://assets/minigames/minigame_ui/graphic/primary_text_box_outline.png" id="11_mgkmu"] -[sub_resource type="LabelSettings" id="LabelSettings_c4r2k"] -font = ExtResource("10_kdwxe") -font_size = 120 -font_color = Color(0.2, 0.2, 0.2, 1) -outline_color = Color(0.2, 0.2, 0.2, 1) - [sub_resource type="AtlasTexture" id="AtlasTexture_c4r2k"] atlas = ExtResource("2_yu4q0") region = Rect2(0, 800, 800, 800) @@ -368,7 +362,7 @@ layout_mode = 2 visible = false theme_override_colors/font_color = Color(0, 0, 0, 1) text = "" -label_settings = SubResource("LabelSettings_c4r2k") +label_settings = ExtResource("8_c4r2k") [node name="TextBox_Outline_Sprite2D" type="Sprite2D" parent="Body/TextBox_Sprite2D"] unique_name_in_owner = true @@ -381,8 +375,7 @@ scale = Vector2(1.8, 1.8) sprite_frames = SubResource("SpriteFrames_g5q5i") animation = &"idle" autoplay = "idle" -frame = 7 -frame_progress = 1.0 +frame_progress = 0.8367004 centered = false [node name="FrontFX" type="Control" parent="."] diff --git a/sources/minigames/crabs/crabs_minigame.gd b/sources/minigames/crabs/crabs_minigame.gd index c0e68c5f..663f6c17 100644 --- a/sources/minigames/crabs/crabs_minigame.gd +++ b/sources/minigames/crabs/crabs_minigame.gd @@ -1,4 +1,3 @@ -@tool extends SyllablesMinigame const HOLE_SCENE: PackedScene = preload("res://sources/minigames/crabs/hole/hole.tscn") diff --git a/sources/minigames/fish/fish_minigame.gd b/sources/minigames/fish/fish_minigame.gd index 440915aa..fad589cd 100644 --- a/sources/minigames/fish/fish_minigame.gd +++ b/sources/minigames/fish/fish_minigame.gd @@ -1,4 +1,3 @@ -@tool extends Minigame signal beacon_fish_dropped(is_answered_real: bool) diff --git a/sources/minigames/frog/frog_minigame.gd b/sources/minigames/frog/frog_minigame.gd index 5f55a064..053c0aa4 100644 --- a/sources/minigames/frog/frog_minigame.gd +++ b/sources/minigames/frog/frog_minigame.gd @@ -1,4 +1,3 @@ -@tool class_name FrogMinigame extends WordsMinigame diff --git a/sources/minigames/jellyfish/jellyfish.tscn b/sources/minigames/jellyfish/jellyfish.tscn index 371c3197..47d550d1 100644 --- a/sources/minigames/jellyfish/jellyfish.tscn +++ b/sources/minigames/jellyfish/jellyfish.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=14 format=3 uid="uid://cpkwyypyikpfc"] +[gd_scene load_steps=13 format=3 uid="uid://cpkwyypyikpfc"] [ext_resource type="Script" uid="uid://bk5oyj8r6aw2h" path="res://sources/utils/sprite_control.gd" id="1_1b85n"] [ext_resource type="Script" uid="uid://b1lfi4hen3e7" path="res://sources/minigames/jellyfish/jellyfish.gd" id="1_06uwq"] @@ -10,27 +10,20 @@ [ext_resource type="SpriteFrames" uid="uid://033w5t1wyg3w" path="res://sources/minigames/jellyfish/blue_jellyfish_animations_arms.tres" id="6_i86t4"] [ext_resource type="SpriteFrames" uid="uid://cyllu3lpjcxej" path="res://sources/minigames/jellyfish/blue_jellyfish_animations_body.tres" id="6_p6hdi"] [ext_resource type="PackedScene" uid="uid://dlmbxcgiv8tpr" path="res://sources/utils/fx/wrong.tscn" id="6_w1tlu"] -[ext_resource type="FontFile" uid="uid://bw8cb4e0a7ayj" path="res://assets/fonts/kalulu_mulish_regular.otf" id="8_p6hdi"] +[ext_resource type="LabelSettings" uid="uid://bguqnhiblwick" path="res://resources/themes/minigames_label_settings.tres" id="9_ah5ir"] [ext_resource type="Texture2D" uid="uid://bbtr0cyiapi3g" path="res://assets/minigames/minigame_ui/graphic/primary_text_box_outline.png" id="10_jfr88"] -[sub_resource type="LabelSettings" id="LabelSettings_qqnw2"] -font = ExtResource("8_p6hdi") -font_size = 120 -font_color = Color(0.2, 0.2, 0.2, 1) -outline_color = Color(0.2, 0.2, 0.2, 1) - [node name="Jellyfish" type="Control"] custom_minimum_size = Vector2(400, 400) layout_mode = 3 anchors_preset = 0 offset_right = 400.0 offset_bottom = 400.0 -scale = Vector2(1.07045, 1.07045) +scale = Vector2(1.0708268, 1.0708268) script = ExtResource("1_06uwq") [node name="BackFX" type="Control" parent="."] custom_minimum_size = Vector2(0, 220) -layout_mode = 2 anchors_preset = 0 anchor_right = 1.0 anchor_bottom = 0.55 @@ -78,7 +71,7 @@ unique_name_in_owner = true scale = Vector2(0.5, 0.5) sprite_frames = ExtResource("6_p6hdi") animation = &"idle" -frame_progress = 0.17636 +frame_progress = 0.7961169 centered = false offset = Vector2(-0.000205994, 0.00019455) @@ -113,8 +106,8 @@ layout_mode = 2 [node name="Label" parent="SpriteControl/TextBox_Sprite2D/PercentMarginContainer/AspectRatioContainer/AutoSizeLabel" index="0"] theme_override_colors/font_color = Color(0, 0, 0, 1) -text = "" -label_settings = SubResource("LabelSettings_qqnw2") +text = "ent" +label_settings = ExtResource("9_ah5ir") [node name="TextBox_Outline_Sprite2D" type="Sprite2D" parent="SpriteControl/TextBox_Sprite2D"] unique_name_in_owner = true @@ -126,13 +119,12 @@ unique_name_in_owner = true scale = Vector2(0.5, 0.5) sprite_frames = ExtResource("6_i86t4") animation = &"idle" -frame_progress = 0.17636 +frame_progress = 0.7961169 centered = false offset = Vector2(-0.000205994, 0.00019455) [node name="FrontFX" type="Control" parent="."] custom_minimum_size = Vector2(0, 220) -layout_mode = 2 anchors_preset = 0 anchor_right = 1.0 anchor_bottom = 0.55 diff --git a/sources/minigames/jellyfish/jellyfish_minigame.gd b/sources/minigames/jellyfish/jellyfish_minigame.gd index 24f0478c..66e51c6a 100644 --- a/sources/minigames/jellyfish/jellyfish_minigame.gd +++ b/sources/minigames/jellyfish/jellyfish_minigame.gd @@ -1,4 +1,3 @@ -@tool extends SyllablesMinigame const JELLYFISH_SCENE: PackedScene = preload("res://sources/minigames/jellyfish/jellyfish.tscn") diff --git a/sources/minigames/monkeys/monkeys_minigame.gd b/sources/minigames/monkeys/monkeys_minigame.gd index 635da579..7321c4ac 100644 --- a/sources/minigames/monkeys/monkeys_minigame.gd +++ b/sources/minigames/monkeys/monkeys_minigame.gd @@ -1,4 +1,3 @@ -@tool extends WordsMinigame enum Audio { diff --git a/sources/minigames/parakeets/parakeets_minigame.gd b/sources/minigames/parakeets/parakeets_minigame.gd index 4aff3eb1..70b5befe 100644 --- a/sources/minigames/parakeets/parakeets_minigame.gd +++ b/sources/minigames/parakeets/parakeets_minigame.gd @@ -1,4 +1,3 @@ -@tool extends Minigame enum State { diff --git a/sources/minigames/penguin/penguin_minigame.gd b/sources/minigames/penguin/penguin_minigame.gd index 953bed24..9f638a50 100644 --- a/sources/minigames/penguin/penguin_minigame.gd +++ b/sources/minigames/penguin/penguin_minigame.gd @@ -1,4 +1,3 @@ -@tool extends Minigame const LABEL_SCENE: PackedScene = preload("res://sources/minigames/penguin/penguin_label.tscn") diff --git a/sources/utils/fx/right.gd b/sources/utils/fx/right.gd index a05b443e..46e36cb7 100644 --- a/sources/utils/fx/right.gd +++ b/sources/utils/fx/right.gd @@ -1,4 +1,3 @@ -@tool class_name RightFX extends Control