From ad2e1bc6927e7ad5516e4d70a7558598fda81fc7 Mon Sep 17 00:00:00 2001 From: RealMelwei Date: Thu, 18 Sep 2025 02:57:31 +0200 Subject: [PATCH] Added Ghost animation, removed leech debug material --- enemies/ghost.gd | 1 + enemies/ghost.tscn | 34 +++++++++++++++++++++++++++++++--- enemies/leech.tscn | 8 +------- 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/enemies/ghost.gd b/enemies/ghost.gd index 775716a..e6dbd20 100644 --- a/enemies/ghost.gd +++ b/enemies/ghost.gd @@ -12,6 +12,7 @@ var chase_range = 1400 func _ready() -> void: player = get_tree().get_root().get_node_or_null("main/Player") + $AnimatedSprite2D.play("default") func _physics_process(delta: float) -> void: if !is_instance_valid(player): diff --git a/enemies/ghost.tscn b/enemies/ghost.tscn index 154c54a..04b7daa 100644 --- a/enemies/ghost.tscn +++ b/enemies/ghost.tscn @@ -1,12 +1,39 @@ -[gd_scene load_steps=6 format=3 uid="uid://chu67ci7sl488"] +[gd_scene load_steps=11 format=3 uid="uid://chu67ci7sl488"] [ext_resource type="Script" uid="uid://12jns4dppxxj" path="res://enemies/ghost.gd" id="1_6attn"] [ext_resource type="PackedScene" uid="uid://mtfsdd4cdf3a" path="res://utils/enemy_hurtbox.tscn" id="2_34o1m"] [ext_resource type="Texture2D" uid="uid://d3b5hmhjw2jyc" path="res://enemies/ghost animation/Ghost 1.png" id="3_34o1m"] [ext_resource type="PackedScene" uid="uid://chs0u61f45nau" path="res://utils/earth_aligner.tscn" id="3_obmiq"] +[ext_resource type="Texture2D" uid="uid://dfhxhum8lek56" path="res://enemies/ghost animation/Ghost 2.png" id="4_4awot"] +[ext_resource type="Texture2D" uid="uid://ve5px6ib45g" path="res://enemies/ghost animation/Ghost 3.png" id="5_etobg"] +[ext_resource type="Texture2D" uid="uid://cmg8yws3gwx6u" path="res://enemies/ghost animation/Ghost 4.png" id="6_kbrsm"] +[ext_resource type="Texture2D" uid="uid://bs3lt13umfxu8" path="res://enemies/ghost animation/Ghost 5.png" id="7_a4rx2"] [sub_resource type="CircleShape2D" id="CircleShape2D_6attn"] +[sub_resource type="SpriteFrames" id="SpriteFrames_je28r"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("3_34o1m") +}, { +"duration": 1.0, +"texture": ExtResource("4_4awot") +}, { +"duration": 1.0, +"texture": ExtResource("5_etobg") +}, { +"duration": 1.0, +"texture": ExtResource("6_kbrsm") +}, { +"duration": 1.0, +"texture": ExtResource("7_a4rx2") +}], +"loop": true, +"name": &"default", +"speed": 5.0 +}] + [node name="Ghost" type="Area2D"] z_index = 1 scale = Vector2(0.8, 0.8) @@ -21,8 +48,9 @@ max_hp = 50 scale = Vector2(6, 6) shape = SubResource("CircleShape2D_6attn") -[node name="Sprite2D" type="Sprite2D" parent="."] -texture = ExtResource("3_34o1m") +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +sprite_frames = SubResource("SpriteFrames_je28r") +frame_progress = 0.0063938 [node name="CollisionShape2D" type="CollisionShape2D" parent="."] scale = Vector2(5, 5) diff --git a/enemies/leech.tscn b/enemies/leech.tscn index 09a5bc0..f377f49 100644 --- a/enemies/leech.tscn +++ b/enemies/leech.tscn @@ -1,9 +1,8 @@ -[gd_scene load_steps=6 format=3 uid="uid://b62xcg0dd3vct"] +[gd_scene load_steps=5 format=3 uid="uid://b62xcg0dd3vct"] [ext_resource type="Script" uid="uid://b70f2ylbb3btt" path="res://enemies/leech.gd" id="1_6u582"] [ext_resource type="PackedScene" uid="uid://cvoicwo2xnf7e" path="res://segment.tscn" id="2_oqch2"] [ext_resource type="PackedScene" uid="uid://chs0u61f45nau" path="res://utils/earth_aligner.tscn" id="3_0r7dp"] -[ext_resource type="Texture2D" uid="uid://djfc7sdc8wxp6" path="res://player/Heart_cut.png" id="4_cq6dk"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_cq6dk"] size = Vector2(2, 24) @@ -38,11 +37,6 @@ position = Vector2(248, 31.2) collision_layer = 0 collision_mask = 8 -[node name="Sprite2D" type="Sprite2D" parent="RayCast2D"] -position = Vector2(0, 15) -scale = Vector2(0.05, 0.5) -texture = ExtResource("4_cq6dk") - [node name="CollisionShape2D" type="CollisionShape2D" parent="RayCast2D"] position = Vector2(0, 14.8) shape = SubResource("RectangleShape2D_cq6dk")