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

feat(相机): 改进相机跟随和偏移处理

- 将相机偏移从offset改为constantOffset属性
- 添加鼠标位置对相机偏移的影响
- 为Rooster角色添加脚步粒子效果
- 调整红水晶武器的攻击力从40提升到60
- 移除调试相关的debugRebuild属性
This commit is contained in:
2025-12-16 22:37:04 +08:00
parent 11953fee54
commit 11aee1f370
4 changed files with 32 additions and 6 deletions
+26 -2
View File
@@ -1,4 +1,4 @@
[gd_scene load_steps=14 format=3 uid="uid://bm7ymrri6pykb"]
[gd_scene load_steps=17 format=3 uid="uid://bm7ymrri6pykb"]
[ext_resource type="PackedScene" uid="uid://cvogxi7mktumf" path="res://components/Abstracts/EntityBase.tscn" id="1_e5pl8"]
[ext_resource type="Script" uid="uid://cthtupc6dtbav" path="res://scripts/Contents/Characters/Rooster.gd" id="2_oqdqd"]
@@ -46,6 +46,24 @@ animations = [{
[sub_resource type="CircleShape2D" id="CircleShape2D_h1v0q"]
radius = 61.204575
[sub_resource type="Curve" id="Curve_0omr3"]
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_joj4g"]
curve = SubResource("Curve_0omr3")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_0omr3"]
particle_flag_disable_z = true
angle_min = 1.0728835e-05
angle_max = 360.00003
direction = Vector3(0, -1, 0)
initial_velocity_max = 30.0
gravity = Vector3(0, 0, 0)
scale_min = 5.0
scale_max = 20.0
alpha_curve = SubResource("CurveTexture_joj4g")
[node name="Rooster" instance=ExtResource("1_e5pl8")]
script = ExtResource("2_oqdqd")
displayName = "公鸡"
@@ -58,10 +76,10 @@ process_mode = 4
[node name="RedCrystal" parent="weaponStore" index="0" instance=ExtResource("3_0omr3")]
offset_bottom = 374.0
debugRebuild = false
[node name="PurpleCrystal" parent="weaponStore" index="1" instance=ExtResource("3_jluqw")]
offset_bottom = 350.0
debugRebuild = false
[node name="BlueCrystal" parent="weaponStore" index="2" instance=ExtResource("4_0omr3")]
@@ -95,6 +113,12 @@ shape = SubResource("CircleShape2D_h1v0q")
[node name="normal" type="Node2D" parent="texture/weapons" index="0"]
position = Vector2(54, -45)
[node name="stepParticle" type="GPUParticles2D" parent="texture" index="9"]
z_index = -1
position = Vector2(23, 58)
amount = 20
process_material = SubResource("ParticleProcessMaterial_0omr3")
[node name="statebar" parent="." index="4" node_paths=PackedStringArray("entity")]
position = Vector2(0, -202)
entity = NodePath("..")
+1 -1
View File
@@ -80,10 +80,10 @@ spawn_path = NodePath("..")
[node name="camera" type="Camera2D" parent="."]
process_mode = 3
offset = Vector2(0, -80)
process_callback = 0
position_smoothing_enabled = true
script = ExtResource("5_mk7bv")
constantOffset = Vector2(0, -80)
[node name="animator" type="AnimationPlayer" parent="camera"]
unique_name_in_owner = true
+1 -2
View File
@@ -11,7 +11,7 @@ avatarTexture = ExtResource("2_3e8g7")
displayName = "红水晶簇"
typeTopic = 1
store = {
"atk": 40,
"atk": 60,
"radius": 150.0
}
storeType = {
@@ -20,7 +20,6 @@ storeType = {
}
descriptionTemplate = "发射[b]红水晶[/b],在3秒后以$radius的半径爆炸,造成$atk点伤害。"
cooldown = 2000.0
debugRebuild = true
[node name="attack" parent="sounds" index="0"]
stream = ExtResource("4_qt0vq")
+4 -1
View File
@@ -2,6 +2,8 @@
extends Camera2D
class_name CameraManager
@export var constantOffset: Vector2 = Vector2.ZERO
@onready var animator: AnimationPlayer = $"%animator"
var shakeIntensity: float = 0
@@ -12,8 +14,9 @@ func _ready():
instance = self
func _physics_process(_delta):
if is_instance_valid(UIState.player):
position = UIState.player.position
position = UIState.player.position + constantOffset
position += MathTool.randomVector2In(shakeIntensity)
offset += ((get_global_mouse_position() - UIState.player.position).clampf(0, 100) - offset) * 0.15
static func shake(millseconds: float, intensity: float = 10, steper: Callable = func(currentValue, _totalValue, _restPercent): return currentValue):
var startTime = WorldManager.getTime()