diff options
Diffstat (limited to 'Enemies/WalkingEnemy.tscn')
-rw-r--r-- | Enemies/WalkingEnemy.tscn | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/Enemies/WalkingEnemy.tscn b/Enemies/WalkingEnemy.tscn new file mode 100644 index 0000000..28ce169 --- /dev/null +++ b/Enemies/WalkingEnemy.tscn @@ -0,0 +1,51 @@ +[gd_scene load_steps=6 format=3 uid="uid://6d20yrqejxs8"] + +[ext_resource type="Script" path="res://Enemies/walking_enemy.gd" id="1_kngny"] +[ext_resource type="Texture2D" uid="uid://cduruhn8mecgn" path="res://Assets/Enemies/enemy-walk-01.png" id="1_v3aim"] +[ext_resource type="Texture2D" uid="uid://ysaejkoo1bnw" path="res://Assets/Enemies/enemy-walk-02.png" id="2_madb5"] + +[sub_resource type="CircleShape2D" id="CircleShape2D_p646n"] +radius = 8.0 + +[sub_resource type="SpriteFrames" id="SpriteFrames_n2gm8"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("1_v3aim") +}, { +"duration": 1.0, +"texture": ExtResource("2_madb5") +}], +"loop": true, +"name": &"default", +"speed": 4.0 +}] + +[node name="WalkingEnemy" type="CharacterBody2D" groups=["enemy"]] +collision_layer = 2 +collision_mask = 17 +script = ExtResource("1_kngny") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("CircleShape2D_p646n") + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +texture_filter = 1 +sprite_frames = SubResource("SpriteFrames_n2gm8") + +[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."] +process_mode = 3 + +[node name="RayLeft" type="RayCast2D" parent="."] +target_position = Vector2(-9, 0) +collision_mask = 16 + +[node name="RayRight" type="RayCast2D" parent="."] +target_position = Vector2(9, 0) +collision_mask = 16 + +[node name="BackForthTimer" type="Timer" parent="."] + +[connection signal="screen_entered" from="VisibleOnScreenNotifier2D" to="." method="_on_visible_on_screen_notifier_2d_screen_entered"] +[connection signal="screen_exited" from="VisibleOnScreenNotifier2D" to="." method="_on_visible_on_screen_notifier_2d_screen_exited"] +[connection signal="timeout" from="BackForthTimer" to="." method="_on_back_forth_timer_timeout"] |