Replace the firing bullet emitter with static bullet obstacles ringed around (12,12)

The user did not want anything firing: the bullets should simply exist in the air as fixed obstacles. bullet_ring (the emitter) is deleted and bullet_field takes its place. bullet_field generates concentric rings of frozen bullets centred on itself, radii given in cells (default 5/10/15), and skips bullets that fall outside the level bounds or land inside solid tiles so nothing is buried in the terrain. Each bullet is a StaticBody2D on the world layer, so it blocks the player and can be stood on; damage defaults to 0 (pure obstacle) and can be raised to turn them into hazards.
This commit is contained in:
2026-10-07 22:29:12 +08:00
parent 1b3d61793d
commit 35174b67ab
5 changed files with 136 additions and 90 deletions
+3 -5
View File
@@ -19,7 +19,7 @@
[ext_resource type="PackedScene" path="res://scenes/prefabs/collectibles/diamond.tscn" id="17_icuov"]
[ext_resource type="PackedScene" path="res://scenes/prefabs/enemies/walker.tscn" id="18_walker"]
[ext_resource type="PackedScene" path="res://scenes/prefabs/enemies/laser.tscn" id="19_laser"]
[ext_resource type="PackedScene" path="res://scenes/prefabs/enemies/bullet_ring.tscn" id="20_ring"]
[ext_resource type="PackedScene" path="res://scenes/prefabs/enemies/bullet_field.tscn" id="20_field"]
[node name="Main" type="Node2D" unique_id=2061129075]
@@ -249,10 +249,8 @@ rotation = -1.5707964
length = 108.0
start_delay = 2.4
[node name="BulletRing_01" parent="Level/PrefabInstances/Enemies" instance=ExtResource("20_ring")]
position = Vector2(234, 224)
arc_deg = 180.0
base_angle_deg = 270.0
[node name="BulletField_01" parent="Level/PrefabInstances/Enemies" instance=ExtResource("20_field")]
position = Vector2(234, 234)
[node name="Interactables" type="Node2D" parent="Level/PrefabInstances" unique_id=769532488]
+7
View File
@@ -0,0 +1,7 @@
[gd_scene load_steps=2 format=3]
[ext_resource type="Script" path="res://scripts/bullet_field.gd" id="1_field"]
[node name="BulletField" type="Node2D"]
z_index = 5
script = ExtResource("1_field")
-9
View File
@@ -1,9 +0,0 @@
[gd_scene load_steps=3 format=3]
[ext_resource type="Script" path="res://scripts/bullet_ring.gd" id="1_ring"]
[node name="BulletRing" type="Node2D" groups=["emitter"]]
script = ExtResource("1_ring")
[node name="Core" type="Sprite2D" parent="."]
texture_filter = 1