1bit-game-jam/prefabs/enemies/watcher.tscn
2023-08-17 20:39:11 +03:00

58 lines
2.2 KiB
Text

[gd_scene load_steps=7 format=3 uid="uid://ccg3n7sobsvdw"]
[ext_resource type="Script" path="res://scripts/enemies/Watcher.cs" id="1_wfhbm"]
[ext_resource type="SpriteFrames" uid="uid://dlf2p3eragspn" path="res://sprites/enemies/watcher.tres" id="2_757xa"]
[ext_resource type="Texture2D" uid="uid://dlbl6d4yghvht" path="res://sprites/mask.png" id="3_nbgee"]
[ext_resource type="PackedScene" uid="uid://cf0wpahgwygxx" path="res://prefabs/light_sense.tscn" id="4_22lca"]
[sub_resource type="CircleShape2D" id="CircleShape2D_pcaas"]
radius = 100.0
[sub_resource type="RectangleShape2D" id="RectangleShape2D_n43vg"]
size = Vector2(14, 8)
[node name="Watcher" type="Node2D"]
script = ExtResource("1_wfhbm")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
clip_children = 2
z_index = 1
position = Vector2(0, 1)
sprite_frames = ExtResource("2_757xa")
[node name="Sprite2D" type="Sprite2D" parent="AnimatedSprite2D"]
modulate = Color(0, 0, 0, 1)
position = Vector2(0, -2)
scale = Vector2(0.05, 0.05)
texture = ExtResource("3_nbgee")
[node name="LightSense" parent="." instance=ExtResource("4_22lca")]
monitorable = false
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="LightSense"]
position = Vector2(0, 1)
polygon = PackedVector2Array(-4, -5, 4, -5, 7, -3, 7, 0, 4, 2, -4, 2, -7, 0, -7, -3)
[node name="Activation" type="Area2D" parent="."]
collision_layer = 4
collision_mask = 4
input_pickable = false
monitorable = false
[node name="CollisionShape2D" type="CollisionShape2D" parent="Activation"]
shape = SubResource("CircleShape2D_pcaas")
[node name="PlayerCollision" type="Area2D" parent="."]
collision_layer = 4
collision_mask = 4
input_pickable = false
monitorable = false
[node name="CollisionShape2D" type="CollisionShape2D" parent="PlayerCollision"]
shape = SubResource("RectangleShape2D_n43vg")
[connection signal="animation_finished" from="AnimatedSprite2D" to="." method="AnimationEnded"]
[connection signal="area_entered" from="LightSense" to="." method="LightEntered"]
[connection signal="body_entered" from="Activation" to="." method="PlayerActivated"]
[connection signal="body_entered" from="PlayerCollision" to="." method="PlayerEntered"]
[connection signal="body_exited" from="PlayerCollision" to="." method="PlayerLeft"]