From 99e23cf34b7527995cdada52543e898e10ad6a6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=A8=E8=90=BD=E5=9F=BA=E5=9B=B4=E8=99=BE?= <3161880837@qq.com> Date: Thu, 30 Apr 2026 21:24:59 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=AD=90=E5=BC=B9):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=8C=A5=E5=89=91=E5=AD=90=E5=BC=B9=E5=9F=BA=E7=A1=80=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 实现挥剑子弹的基础逻辑,包括继承BulletBase类并添加锁定发射器的AI功能 --- components/Bullets/SwingSword.tscn | 7 ++----- scripts/Contents/Bullets/SwingSword.gd | 5 +++++ scripts/Contents/Bullets/SwingSword.gd.uid | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 scripts/Contents/Bullets/SwingSword.gd create mode 100644 scripts/Contents/Bullets/SwingSword.gd.uid diff --git a/components/Bullets/SwingSword.tscn b/components/Bullets/SwingSword.tscn index 982ad32..6100436 100644 --- a/components/Bullets/SwingSword.tscn +++ b/components/Bullets/SwingSword.tscn @@ -1,6 +1,7 @@ [gd_scene format=3 uid="uid://b7yp28gfrqj5w"] [ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_f7kh1"] +[ext_resource type="Script" uid="uid://baqbg743uf156" path="res://scripts/Contents/Bullets/SwingSword.gd" id="2_23nu4"] [ext_resource type="AudioStream" uid="uid://cer3lxbxqw5pq" path="res://resources/sounds/effect/sword1.mp3" id="2_ccsa1"] [ext_resource type="Texture2D" uid="uid://caf67vt47y180" path="res://resources/bullets/swords/broom.svg" id="2_nqryj"] [ext_resource type="AudioStream" uid="uid://bm2o8hu7nyqh1" path="res://resources/sounds/effect/sword3.mp3" id="3_23nu4"] @@ -238,11 +239,7 @@ alpha_curve = SubResource("CurveTexture_2tlcd") size = Vector2(259.81308, 36.189156) [node name="SwingSword" unique_id=5571707 instance=ExtResource("1_f7kh1")] -displayName = "扫帚" -motionType = 0 -penerate = 1.0 -autoSpawnAnimation = true -freeAfterSpawn = true +script = ExtResource("2_23nu4") [node name="texture" parent="." index="0" unique_id=162977358] scale = Vector2(2, 2) diff --git a/scripts/Contents/Bullets/SwingSword.gd b/scripts/Contents/Bullets/SwingSword.gd new file mode 100644 index 0000000..0c8bd0a --- /dev/null +++ b/scripts/Contents/Bullets/SwingSword.gd @@ -0,0 +1,5 @@ +extends BulletBase +class_name SwingSwordBullet + +func ai(): + PresetBulletAI.lockLauncher(self , launcher, true) diff --git a/scripts/Contents/Bullets/SwingSword.gd.uid b/scripts/Contents/Bullets/SwingSword.gd.uid new file mode 100644 index 0000000..57b678e --- /dev/null +++ b/scripts/Contents/Bullets/SwingSword.gd.uid @@ -0,0 +1 @@ +uid://baqbg743uf156