Add Watcher
This commit is contained in:
parent
6514ce3c54
commit
d1536529e4
9 changed files with 448 additions and 10 deletions
58
prefabs/enemies/watcher.tscn
Normal file
58
prefabs/enemies/watcher.tscn
Normal file
|
@ -0,0 +1,58 @@
|
|||
[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"]
|
|
@ -3,3 +3,4 @@
|
|||
[node name="LightSense" type="Area2D"]
|
||||
collision_layer = 2
|
||||
collision_mask = 2
|
||||
input_pickable = false
|
||||
|
|
|
@ -8,6 +8,8 @@ size = Vector2(15, 15)
|
|||
|
||||
[node name="Player" type="CharacterBody2D"]
|
||||
y_sort_enabled = true
|
||||
collision_layer = 5
|
||||
collision_mask = 5
|
||||
script = ExtResource("1_1vpun")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue