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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user