From 09266bd67af0e3a5f62e53f91435e270fca4b93c Mon Sep 17 00:00:00 2001 From: Jaro Date: Tue, 14 Apr 2026 13:22:19 +0200 Subject: [PATCH] added blue slime and fitting death animation for the directions off travel --- .gitignore | 3 + scenes/blue_slime.tscn | 625 ++++++++++++++++++++++++++++++++++++++ scenes/slime.tscn | 303 +++++++++++++++++- scripts/blue_slime.gd | 22 ++ scripts/blue_slime.gd.uid | 1 + scripts/enemy_base.gd | 21 +- 6 files changed, 968 insertions(+), 7 deletions(-) create mode 100644 scenes/blue_slime.tscn create mode 100644 scripts/blue_slime.gd create mode 100644 scripts/blue_slime.gd.uid diff --git a/.gitignore b/.gitignore index 0af181c..c27061c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ # Godot 4+ specific ignores .godot/ /android/ + +# Claude Code +.claude/worktrees/ diff --git a/scenes/blue_slime.tscn b/scenes/blue_slime.tscn new file mode 100644 index 0000000..3670fb7 --- /dev/null +++ b/scenes/blue_slime.tscn @@ -0,0 +1,625 @@ +[gd_scene format=3 uid="uid://cj83ht5o2l8c1"] + +[ext_resource type="Script" uid="uid://bm4wewhu4hpte" path="res://scripts/blue_slime.gd" id="1_ds7cs"] +[ext_resource type="Texture2D" uid="uid://dx1ipffjtn8we" path="res://assets/Slime2/With_shadow/Slime2_Death_with_shadow.png" id="2_7qf5q"] +[ext_resource type="Texture2D" uid="uid://bn44pxk3l7j1c" path="res://assets/Slime2/With_shadow/Slime2_Idle_with_shadow.png" id="3_xfb3o"] +[ext_resource type="Texture2D" uid="uid://b33awo7oiotwo" path="res://assets/Slime2/With_shadow/Slime2_Walk_with_shadow.png" id="4_ullxd"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_vx4o0"] +atlas = ExtResource("2_7qf5q") +region = Rect2(0, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_i8e30"] +atlas = ExtResource("2_7qf5q") +region = Rect2(64, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_igu51"] +atlas = ExtResource("2_7qf5q") +region = Rect2(128, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_vwtyt"] +atlas = ExtResource("2_7qf5q") +region = Rect2(192, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_xro7v"] +atlas = ExtResource("2_7qf5q") +region = Rect2(256, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_rkabi"] +atlas = ExtResource("2_7qf5q") +region = Rect2(320, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_myx1i"] +atlas = ExtResource("2_7qf5q") +region = Rect2(384, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_r7blx"] +atlas = ExtResource("2_7qf5q") +region = Rect2(448, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_adrbw"] +atlas = ExtResource("2_7qf5q") +region = Rect2(512, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_1a634"] +atlas = ExtResource("2_7qf5q") +region = Rect2(576, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_74rww"] +atlas = ExtResource("2_7qf5q") +region = Rect2(0, 128, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_vjxvc"] +atlas = ExtResource("2_7qf5q") +region = Rect2(64, 128, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_mlq4j"] +atlas = ExtResource("2_7qf5q") +region = Rect2(128, 128, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_awut0"] +atlas = ExtResource("2_7qf5q") +region = Rect2(192, 128, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_gn472"] +atlas = ExtResource("2_7qf5q") +region = Rect2(256, 128, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_1k6yh"] +atlas = ExtResource("2_7qf5q") +region = Rect2(320, 128, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_7mkkd"] +atlas = ExtResource("2_7qf5q") +region = Rect2(384, 128, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_qrmvm"] +atlas = ExtResource("2_7qf5q") +region = Rect2(448, 128, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_f0quj"] +atlas = ExtResource("2_7qf5q") +region = Rect2(512, 128, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_umvfq"] +atlas = ExtResource("2_7qf5q") +region = Rect2(576, 128, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_cewq7"] +atlas = ExtResource("2_7qf5q") +region = Rect2(0, 192, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_vnv5t"] +atlas = ExtResource("2_7qf5q") +region = Rect2(64, 192, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_lm1am"] +atlas = ExtResource("2_7qf5q") +region = Rect2(128, 192, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_cukff"] +atlas = ExtResource("2_7qf5q") +region = Rect2(192, 192, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_0qdu6"] +atlas = ExtResource("2_7qf5q") +region = Rect2(256, 192, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_f0ekc"] +atlas = ExtResource("2_7qf5q") +region = Rect2(320, 192, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_pr23g"] +atlas = ExtResource("2_7qf5q") +region = Rect2(384, 192, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_3y6ej"] +atlas = ExtResource("2_7qf5q") +region = Rect2(448, 192, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_je3gg"] +atlas = ExtResource("2_7qf5q") +region = Rect2(512, 192, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_l3405"] +atlas = ExtResource("2_7qf5q") +region = Rect2(576, 192, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_dqovg"] +atlas = ExtResource("2_7qf5q") +region = Rect2(0, 64, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_8xq4a"] +atlas = ExtResource("2_7qf5q") +region = Rect2(64, 64, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_u6a7r"] +atlas = ExtResource("2_7qf5q") +region = Rect2(128, 64, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_mgl7q"] +atlas = ExtResource("2_7qf5q") +region = Rect2(192, 64, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_k7imm"] +atlas = ExtResource("2_7qf5q") +region = Rect2(256, 64, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_nfh76"] +atlas = ExtResource("2_7qf5q") +region = Rect2(320, 64, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_peh4k"] +atlas = ExtResource("2_7qf5q") +region = Rect2(384, 64, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_0bxwx"] +atlas = ExtResource("2_7qf5q") +region = Rect2(448, 64, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_f854e"] +atlas = ExtResource("2_7qf5q") +region = Rect2(512, 64, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_3en1k"] +atlas = ExtResource("2_7qf5q") +region = Rect2(576, 64, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_bkann"] +atlas = ExtResource("3_xfb3o") +region = Rect2(0, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_bskkt"] +atlas = ExtResource("3_xfb3o") +region = Rect2(64, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_8yvtq"] +atlas = ExtResource("3_xfb3o") +region = Rect2(128, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_tntsw"] +atlas = ExtResource("3_xfb3o") +region = Rect2(192, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_gfc54"] +atlas = ExtResource("3_xfb3o") +region = Rect2(256, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_k7on2"] +atlas = ExtResource("3_xfb3o") +region = Rect2(320, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_df7iv"] +atlas = ExtResource("4_ullxd") +region = Rect2(0, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_yti30"] +atlas = ExtResource("4_ullxd") +region = Rect2(64, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_schxy"] +atlas = ExtResource("4_ullxd") +region = Rect2(128, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_a3laa"] +atlas = ExtResource("4_ullxd") +region = Rect2(192, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ow25x"] +atlas = ExtResource("4_ullxd") +region = Rect2(256, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_rktn4"] +atlas = ExtResource("4_ullxd") +region = Rect2(320, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_c66f5"] +atlas = ExtResource("4_ullxd") +region = Rect2(384, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_knsw2"] +atlas = ExtResource("4_ullxd") +region = Rect2(448, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_yayj6"] +atlas = ExtResource("4_ullxd") +region = Rect2(0, 128, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_x1i5a"] +atlas = ExtResource("4_ullxd") +region = Rect2(64, 128, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_pybuk"] +atlas = ExtResource("4_ullxd") +region = Rect2(128, 128, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_s3guc"] +atlas = ExtResource("4_ullxd") +region = Rect2(192, 128, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_rjwua"] +atlas = ExtResource("4_ullxd") +region = Rect2(256, 128, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_rodje"] +atlas = ExtResource("4_ullxd") +region = Rect2(320, 128, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_xorrf"] +atlas = ExtResource("4_ullxd") +region = Rect2(384, 128, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_15rci"] +atlas = ExtResource("4_ullxd") +region = Rect2(448, 128, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_yhn32"] +atlas = ExtResource("4_ullxd") +region = Rect2(0, 192, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_xo0le"] +atlas = ExtResource("4_ullxd") +region = Rect2(64, 192, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_n8jtr"] +atlas = ExtResource("4_ullxd") +region = Rect2(128, 192, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_f3hc1"] +atlas = ExtResource("4_ullxd") +region = Rect2(192, 192, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_qmngr"] +atlas = ExtResource("4_ullxd") +region = Rect2(256, 192, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ydils"] +atlas = ExtResource("4_ullxd") +region = Rect2(320, 192, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_owfss"] +atlas = ExtResource("4_ullxd") +region = Rect2(384, 192, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_y74nx"] +atlas = ExtResource("4_ullxd") +region = Rect2(448, 192, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_d3pdm"] +atlas = ExtResource("4_ullxd") +region = Rect2(0, 64, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_hpdme"] +atlas = ExtResource("4_ullxd") +region = Rect2(64, 64, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_nrn7c"] +atlas = ExtResource("4_ullxd") +region = Rect2(128, 64, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_56e7h"] +atlas = ExtResource("4_ullxd") +region = Rect2(192, 64, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_rq1sp"] +atlas = ExtResource("4_ullxd") +region = Rect2(256, 64, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_hkiwi"] +atlas = ExtResource("4_ullxd") +region = Rect2(320, 64, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_huwhc"] +atlas = ExtResource("4_ullxd") +region = Rect2(384, 64, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_emump"] +atlas = ExtResource("4_ullxd") +region = Rect2(448, 64, 64, 64) + +[sub_resource type="SpriteFrames" id="SpriteFrames_324m8"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_vx4o0") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_i8e30") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_igu51") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_vwtyt") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_xro7v") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_rkabi") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_myx1i") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_r7blx") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_adrbw") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_1a634") +}], +"loop": true, +"name": &"death_down", +"speed": 10.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_74rww") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_vjxvc") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_mlq4j") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_awut0") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_gn472") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_1k6yh") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_7mkkd") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_qrmvm") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_f0quj") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_umvfq") +}], +"loop": true, +"name": &"death_left", +"speed": 10.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_cewq7") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_vnv5t") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_lm1am") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_cukff") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_0qdu6") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_f0ekc") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_pr23g") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_3y6ej") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_je3gg") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_l3405") +}], +"loop": true, +"name": &"death_right", +"speed": 10.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_dqovg") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_8xq4a") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_u6a7r") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_mgl7q") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_k7imm") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_nfh76") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_peh4k") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_0bxwx") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_f854e") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_3en1k") +}], +"loop": true, +"name": &"death_up", +"speed": 10.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_bkann") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_bskkt") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_8yvtq") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_tntsw") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_gfc54") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_k7on2") +}], +"loop": true, +"name": &"default", +"speed": 10.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_df7iv") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_yti30") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_schxy") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_a3laa") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ow25x") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_rktn4") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_c66f5") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_knsw2") +}], +"loop": true, +"name": &"walk_down", +"speed": 10.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_yayj6") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_x1i5a") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_pybuk") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_s3guc") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_rjwua") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_rodje") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_xorrf") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_15rci") +}], +"loop": true, +"name": &"walk_left", +"speed": 10.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_yhn32") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_xo0le") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_n8jtr") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_f3hc1") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_qmngr") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ydils") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_owfss") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_y74nx") +}], +"loop": true, +"name": &"walk_right", +"speed": 10.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_d3pdm") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_hpdme") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_nrn7c") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_56e7h") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_rq1sp") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_hkiwi") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_huwhc") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_emump") +}], +"loop": true, +"name": &"walk_up", +"speed": 10.0 +}] + +[sub_resource type="CircleShape2D" id="CircleShape2D_pc1ox"] +radius = 7.071068 + +[sub_resource type="CircleShape2D" id="CircleShape2D_sw8n0"] +radius = 8.062258 + +[node name="BlueSlime" type="CharacterBody2D" unique_id=2087784997] +script = ExtResource("1_ds7cs") +metadata/_custom_type_script = "uid://c0uv02nt5ocvg" + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=840021107] +texture_filter = 1 +sprite_frames = SubResource("SpriteFrames_324m8") +animation = &"walk_right" + +[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=535646718] +position = Vector2(0, 1) +shape = SubResource("CircleShape2D_pc1ox") + +[node name="Area2D" type="Area2D" parent="." unique_id=1079733998] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D" unique_id=817490269] +position = Vector2(0, 1) +shape = SubResource("CircleShape2D_sw8n0") diff --git a/scenes/slime.tscn b/scenes/slime.tscn index bc63989..8de1a65 100644 --- a/scenes/slime.tscn +++ b/scenes/slime.tscn @@ -6,6 +6,7 @@ [ext_resource type="PackedScene" uid="uid://dm6d2jg52vi41" path="res://scenes/apple.tscn" id="3_fd6lc"] [ext_resource type="Texture2D" uid="uid://cxddvfs2wfwcl" path="res://assets/Slime1/Without_shadow/Slime1_Idle_without_shadow.png" id="3_rrqju"] [ext_resource type="Texture2D" uid="uid://b2bmw70co6noy" path="res://assets/Slime1/Without_shadow/Slime1_Walk_without_shadow.png" id="4_wyhst"] +[ext_resource type="Texture2D" uid="uid://bshpjl3w1n0y1" path="res://assets/Slime1/With_shadow/Slime1_Death_with_shadow.png" id="5_gstla"] [sub_resource type="Resource" id="Resource_gstla"] script = ExtResource("2_2npkn") @@ -53,6 +54,166 @@ region = Rect2(512, 0, 64, 64) atlas = ExtResource("2_kjhlw") region = Rect2(576, 0, 64, 64) +[sub_resource type="AtlasTexture" id="AtlasTexture_w3drt"] +atlas = ExtResource("5_gstla") +region = Rect2(0, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_h6uvq"] +atlas = ExtResource("5_gstla") +region = Rect2(64, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_g7btj"] +atlas = ExtResource("5_gstla") +region = Rect2(128, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_4yj7m"] +atlas = ExtResource("5_gstla") +region = Rect2(192, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_i2qrb"] +atlas = ExtResource("5_gstla") +region = Rect2(256, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_oir2r"] +atlas = ExtResource("5_gstla") +region = Rect2(320, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_krpmv"] +atlas = ExtResource("5_gstla") +region = Rect2(384, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_xpvd1"] +atlas = ExtResource("5_gstla") +region = Rect2(448, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_xl3w4"] +atlas = ExtResource("5_gstla") +region = Rect2(512, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_nmc6m"] +atlas = ExtResource("5_gstla") +region = Rect2(576, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_6220k"] +atlas = ExtResource("5_gstla") +region = Rect2(0, 128, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_yuttx"] +atlas = ExtResource("5_gstla") +region = Rect2(64, 128, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_k7t3r"] +atlas = ExtResource("5_gstla") +region = Rect2(128, 128, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ahgoc"] +atlas = ExtResource("5_gstla") +region = Rect2(192, 128, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_qtwdv"] +atlas = ExtResource("5_gstla") +region = Rect2(256, 128, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_nlacn"] +atlas = ExtResource("5_gstla") +region = Rect2(320, 128, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_tldbr"] +atlas = ExtResource("5_gstla") +region = Rect2(384, 128, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_qywsl"] +atlas = ExtResource("5_gstla") +region = Rect2(448, 128, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_vn3xq"] +atlas = ExtResource("5_gstla") +region = Rect2(512, 128, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_tf7j4"] +atlas = ExtResource("5_gstla") +region = Rect2(576, 128, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_03wpl"] +atlas = ExtResource("5_gstla") +region = Rect2(0, 192, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_spjol"] +atlas = ExtResource("5_gstla") +region = Rect2(64, 192, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_3ouno"] +atlas = ExtResource("5_gstla") +region = Rect2(128, 192, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_jvq7p"] +atlas = ExtResource("5_gstla") +region = Rect2(192, 192, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_npop4"] +atlas = ExtResource("5_gstla") +region = Rect2(256, 192, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_d3put"] +atlas = ExtResource("5_gstla") +region = Rect2(320, 192, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_aniwa"] +atlas = ExtResource("5_gstla") +region = Rect2(384, 192, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_6a0rh"] +atlas = ExtResource("5_gstla") +region = Rect2(448, 192, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_s58c6"] +atlas = ExtResource("5_gstla") +region = Rect2(512, 192, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_66t2l"] +atlas = ExtResource("5_gstla") +region = Rect2(576, 192, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_4m7av"] +atlas = ExtResource("5_gstla") +region = Rect2(0, 64, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_u0jn8"] +atlas = ExtResource("5_gstla") +region = Rect2(64, 64, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_61qqo"] +atlas = ExtResource("5_gstla") +region = Rect2(128, 64, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_0gflb"] +atlas = ExtResource("5_gstla") +region = Rect2(192, 64, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_wvv21"] +atlas = ExtResource("5_gstla") +region = Rect2(256, 64, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_fn805"] +atlas = ExtResource("5_gstla") +region = Rect2(320, 64, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_b2hyl"] +atlas = ExtResource("5_gstla") +region = Rect2(384, 64, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_0lb6u"] +atlas = ExtResource("5_gstla") +region = Rect2(448, 64, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_3pcti"] +atlas = ExtResource("5_gstla") +region = Rect2(512, 64, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_wcjn7"] +atlas = ExtResource("5_gstla") +region = Rect2(576, 64, 64, 64) + [sub_resource type="AtlasTexture" id="AtlasTexture_p2gj0"] atlas = ExtResource("3_rrqju") region = Rect2(0, 0, 64, 64) @@ -244,6 +405,146 @@ animations = [{ }, { "frames": [{ "duration": 1.0, +"texture": SubResource("AtlasTexture_w3drt") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_h6uvq") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_g7btj") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_4yj7m") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_i2qrb") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_oir2r") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_krpmv") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_xpvd1") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_xl3w4") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_nmc6m") +}], +"loop": true, +"name": &"death_down", +"speed": 10.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_6220k") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_yuttx") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_k7t3r") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ahgoc") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_qtwdv") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_nlacn") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_tldbr") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_qywsl") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_vn3xq") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_tf7j4") +}], +"loop": true, +"name": &"death_left", +"speed": 10.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_03wpl") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_spjol") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_3ouno") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_jvq7p") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_npop4") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_d3put") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_aniwa") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_6a0rh") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_s58c6") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_66t2l") +}], +"loop": true, +"name": &"death_right", +"speed": 10.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_4m7av") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_u0jn8") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_61qqo") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_0gflb") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_wvv21") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_fn805") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_b2hyl") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_0lb6u") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_3pcti") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_wcjn7") +}], +"loop": true, +"name": &"death_up", +"speed": 10.0 +}, { +"frames": [{ +"duration": 1.0, "texture": SubResource("AtlasTexture_p2gj0") }, { "duration": 1.0, @@ -395,7 +696,7 @@ drop_table = Array[ExtResource("2_2npkn")]([SubResource("Resource_gstla")]) [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=752118449] texture_filter = 1 sprite_frames = SubResource("SpriteFrames_cbi0b") -animation = &"death" +animation = &"walk_right" [node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=769710804] position = Vector2(0, 1) diff --git a/scripts/blue_slime.gd b/scripts/blue_slime.gd new file mode 100644 index 0000000..520a4ef --- /dev/null +++ b/scripts/blue_slime.gd @@ -0,0 +1,22 @@ +extends EnemyBase + + +# Called when the node enters the scene tree for the first time. + +# Called every frame. 'delta' is the elapsed time since the previous frame.+ +func _ready() -> void: + super() + speed = 0.1 + +func _process(delta: float) -> void: + if is_dying: + return + _chase_witch() + pass + +func _on_area_2d_body_entered(body: Node2D) -> void: + if is_dying: + return + if body == player: + die() + pass # Replace with function body. diff --git a/scripts/blue_slime.gd.uid b/scripts/blue_slime.gd.uid new file mode 100644 index 0000000..93123ab --- /dev/null +++ b/scripts/blue_slime.gd.uid @@ -0,0 +1 @@ +uid://bm4wewhu4hpte diff --git a/scripts/enemy_base.gd b/scripts/enemy_base.gd index 66fe4fc..cabb8ce 100644 --- a/scripts/enemy_base.gd +++ b/scripts/enemy_base.gd @@ -5,10 +5,11 @@ extends CharacterBody2D @export var drop_table: Array[DropTable] var is_dying = false -var speed +var speed var witch var player var death_sound = preload("res://assets/music&sfx/sfx/hit2.wav") +var last_direction := Vector2.DOWN signal died func _ready() -> void: @@ -17,11 +18,17 @@ func _ready() -> void: witch = get_node("/root/Game/Witch") player = get_node("/root/Game/Player") pass # Replace with function body - + func die(): is_dying = true collision_layer = 0 - animated_sprite_2d.play("death") + var death_anim: String + if abs(last_direction.x) >= abs(last_direction.y): + death_anim = "death_left" if last_direction.x < 0 else "death_right" + else: + death_anim = "death_up" if last_direction.y < 0 else "death_down" + animated_sprite_2d.sprite_frames.set_animation_loop(death_anim, false) + animated_sprite_2d.play(death_anim) var player = AudioStreamPlayer.new() add_child(player) player.stream = death_sound @@ -30,18 +37,20 @@ func die(): died.emit(self) await animated_sprite_2d.animation_finished queue_free() - + # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta: float) -> void: pass - + func _chase_witch() -> void: var direction = Vector2(witch.global_position - global_position) + if direction != Vector2.ZERO: + last_direction = direction velocity = direction * speed velocity = direction * speed - + if direction == Vector2.ZERO: animated_sprite_2d.play("idle") elif abs(direction.x) >= abs(direction.y):