first draft y-wing and turret

This commit is contained in:
zerothelootrat
2024-06-05 05:05:56 -04:00
parent eb7bca8ad2
commit f8a23dbd96
3 changed files with 150 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
[gd_scene load_steps=5 format=3 uid="uid://6xeat2a1yr6k"]
[gd_scene load_steps=6 format=3 uid="uid://6xeat2a1yr6k"]
[ext_resource type="Texture2D" uid="uid://bayc56dplo4ub" path="res://Assets/Y-Wing_Draft.png" id="1_i65b5"]
[ext_resource type="Script" path="res://Scripts/enemy_ywing.gd" id="1_ox3kv"]
[ext_resource type="Texture2D" uid="uid://drtiwwj2pa73x" path="res://Assets/Y-Wing_Turret.png" id="2_wt4e7"]
[sub_resource type="AtlasTexture" id="AtlasTexture_7hq4j"]
@@ -18,7 +19,10 @@ animations = [{
"speed": 5.0
}]
[node name="enemy_ywing" type="Area2D"]
[node name="enemy_ywing" type="Area2D" groups=["enemies"]]
collision_layer = 4
collision_mask = 11
script = ExtResource("1_ox3kv")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
texture_filter = 1
@@ -30,6 +34,11 @@ polygon = PackedVector2Array(13, 140, 25, 122, 28, 111, 28, 66, 23, 61, 18, 61,
[node name="Muzzle1" type="Marker2D" parent="."]
position = Vector2(0, 146)
[node name="RayCast2D" type="RayCast2D" parent="."]
position = Vector2(0, 141)
target_position = Vector2(1, 821)
collision_mask = 11
[node name="Turret" type="Sprite2D" parent="."]
texture_filter = 1
position = Vector2(1, 10)
@@ -42,7 +51,9 @@ offset = Vector2(0, 5.2)
position = Vector2(0, 21)
[node name="target_confirm" type="RayCast2D" parent="Turret"]
position = Vector2(0, -1)
target_position = Vector2(-1, 873)
collision_mask = 11
[node name="refire_timer1" type="Timer" parent="."]
@@ -50,3 +61,7 @@ target_position = Vector2(-1, 873)
[node name="death_timer" type="Timer" parent="."]
wait_time = 0.5
[connection signal="area_entered" from="." to="." method="_on_area_entered"]
[connection signal="timeout" from="refire_timer1" to="." method="_on_refire_timer_1_timeout"]
[connection signal="timeout" from="death_timer" to="." method="_on_death_timer_timeout"]