1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 06:51:54 +08:00

feat(Arrow): 添加箭头子弹的动画效果

为箭头子弹添加生成、循环和销毁动画,并移除初始位置偏移逻辑
This commit is contained in:
2025-11-19 22:12:38 +08:00
parent 1347d79423
commit 6ea494be33
2 changed files with 87 additions and 2 deletions
+87 -1
View File
@@ -1,9 +1,89 @@
[gd_scene load_steps=13 format=3 uid="uid://wy8wqwhwr4fb"]
[gd_scene load_steps=18 format=3 uid="uid://wy8wqwhwr4fb"]
[ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_0wuio"]
[ext_resource type="Texture2D" uid="uid://dadbn306owsy3" path="res://resources/bullets/arrow/arrow.png" id="2_b2ohg"]
[ext_resource type="Script" uid="uid://u5x40y0cvqq2" path="res://scripts/Contents/Bullets/Arrow.gd" id="2_qddg0"]
[sub_resource type="Animation" id="Animation_oinqg"]
resource_name = "destroy"
length = 0.5
step = 0.1
[sub_resource type="Animation" id="Animation_ynxlt"]
resource_name = "loop"
loop_mode = 1
step = 0.1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:rotation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [0.0, 6.28319]
}
[sub_resource type="Animation" id="Animation_kmogx"]
resource_name = "spawn"
tracks/0/type = "bezier"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("static:position:x")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"handle_modes": PackedInt32Array(0, 2),
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0, 200, -0.16666667, -33.333336, 0, 0),
"times": PackedFloat32Array(0, 1)
}
tracks/1/type = "bezier"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("%hitbox:position:x")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"handle_modes": PackedInt32Array(0, 2),
"points": PackedFloat32Array(8, -0.25, 0, 0.25, 0, 208, -0.16666667, -33.333336, 0, 0),
"times": PackedFloat32Array(0, 1)
}
[sub_resource type="Animation" id="Animation_qddg0"]
length = 0.001
tracks/0/type = "bezier"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("static:position:x")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"handle_modes": PackedInt32Array(0),
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0)
}
tracks/1/type = "bezier"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("%hitbox:position:x")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"handle_modes": PackedInt32Array(0),
"points": PackedFloat32Array(8, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0)
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_qddg0"]
_data = {
&"RESET": SubResource("Animation_qddg0"),
&"destroy": SubResource("Animation_oinqg"),
&"loop": SubResource("Animation_ynxlt"),
&"spawn": SubResource("Animation_kmogx")
}
[sub_resource type="Curve" id="Curve_uu3a4"]
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 2
@@ -55,6 +135,12 @@ displayName = "鸡毛箭"
speed = 50.0
penerate = 1.0
lifeDistance = 2000.0
autoSpawnAnimation = true
[node name="animator" parent="texture" index="0"]
libraries = {
&"": SubResource("AnimationLibrary_qddg0")
}
[node name="static" type="Sprite2D" parent="texture" index="1"]
position = Vector2(0, -3)
-1
View File
@@ -13,7 +13,6 @@ func ai():
if timeLived() < waitTime:
PresetBulletAI.lockLauncher(self, launcher, true)
rotation = position.angle_to_point(get_global_mouse_position())
position += Vector2.from_angle(rotation) * 200
return
else:
trail.emitting = true