feat: 添加spawner生成器,生成敌人

This commit is contained in:
luke358
2026-05-20 16:13:24 +08:00
parent 5cdcf705f4
commit 651eaf71ee
8 changed files with 159 additions and 0 deletions
+12
View File
@@ -16,6 +16,9 @@
[ext_resource type="PackedScene" uid="uid://ifmw1e7gycc8" path="res://scenes/ui/health_bar/health_bar.tscn" id="14_dh340"]
[ext_resource type="Script" uid="uid://y47blv3332q8" path="res://scenes/unit/enemy/shooting_behavior.gd" id="15_l0cts"]
[ext_resource type="PackedScene" uid="uid://bmhud2e0x287r" path="res://scenes/projectiles/projectile_enemy.tscn" id="16_ybinm"]
[ext_resource type="Script" uid="uid://bd5bscq0u8wld" path="res://scenes/arena/spawner.gd" id="17_rhjlh"]
[ext_resource type="Script" uid="uid://dqhoumuppl4bx" path="res://resources/waves/wave_data.gd" id="18_8kk48"]
[ext_resource type="Resource" uid="uid://cer6rdmxrnenh" path="res://resources/waves/data/wave_1_to_5.tres" id="18_tp84n"]
[sub_resource type="CircleShape2D" id="CircleShape2D_e15k4"]
radius = 4.0
@@ -355,7 +358,16 @@ enemy = NodePath("..")
fire_pos = NodePath("../Visuals/FirePos")
projectile_scene = ExtResource("16_ybinm")
[node name="Spawner" type="Node2D" parent="." unique_id=831614176]
script = ExtResource("17_rhjlh")
waves_data = Array[ExtResource("18_8kk48")]([ExtResource("18_tp84n")])
[node name="SpawnTimer" type="Timer" parent="Spawner" unique_id=1696770444]
[node name="WaveTimer" type="Timer" parent="Spawner" unique_id=2083072683]
[connection signal="on_damaged" from="EnemyShooter/HurtboxComponent" to="EnemyShooter" method="_on_hurtbox_component_on_damaged"]
[connection signal="on_health_changed" from="EnemyShooter/HealthComponent" to="EnemyShooter/HealthBar" method="_on_health_component_on_health_changed"]
[connection signal="timeout" from="EnemyShooter/FlashTimer" to="EnemyShooter" method="_on_flash_timer_timeout"]
[connection signal="timeout" from="EnemyShooter/KnockbackTimer" to="EnemyShooter" method="_on_knockback_timer_timeout"]
[connection signal="timeout" from="Spawner/SpawnTimer" to="Spawner" method="_on_spawn_timer_timeout"]