Added Ghost animation, removed leech debug material

This commit is contained in:
RealMelwei 2025-09-18 02:57:31 +02:00
parent 434fc41db4
commit ad2e1bc692
3 changed files with 33 additions and 10 deletions

View file

@ -12,6 +12,7 @@ var chase_range = 1400
func _ready() -> void: func _ready() -> void:
player = get_tree().get_root().get_node_or_null("main/Player") player = get_tree().get_root().get_node_or_null("main/Player")
$AnimatedSprite2D.play("default")
func _physics_process(delta: float) -> void: func _physics_process(delta: float) -> void:
if !is_instance_valid(player): if !is_instance_valid(player):

View file

@ -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="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="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="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="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="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"] [node name="Ghost" type="Area2D"]
z_index = 1 z_index = 1
scale = Vector2(0.8, 0.8) scale = Vector2(0.8, 0.8)
@ -21,8 +48,9 @@ max_hp = 50
scale = Vector2(6, 6) scale = Vector2(6, 6)
shape = SubResource("CircleShape2D_6attn") shape = SubResource("CircleShape2D_6attn")
[node name="Sprite2D" type="Sprite2D" parent="."] [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
texture = ExtResource("3_34o1m") sprite_frames = SubResource("SpriteFrames_je28r")
frame_progress = 0.0063938
[node name="CollisionShape2D" type="CollisionShape2D" parent="."] [node name="CollisionShape2D" type="CollisionShape2D" parent="."]
scale = Vector2(5, 5) scale = Vector2(5, 5)

View file

@ -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="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://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="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"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_cq6dk"]
size = Vector2(2, 24) size = Vector2(2, 24)
@ -38,11 +37,6 @@ position = Vector2(248, 31.2)
collision_layer = 0 collision_layer = 0
collision_mask = 8 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"] [node name="CollisionShape2D" type="CollisionShape2D" parent="RayCast2D"]
position = Vector2(0, 14.8) position = Vector2(0, 14.8)
shape = SubResource("RectangleShape2D_cq6dk") shape = SubResource("RectangleShape2D_cq6dk")