mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-07-02 08:12:12 +08:00
feat(相机): 改进相机跟随和偏移处理
- 将相机偏移从offset改为constantOffset属性 - 添加鼠标位置对相机偏移的影响 - 为Rooster角色添加脚步粒子效果 - 调整红水晶武器的攻击力从40提升到60 - 移除调试相关的debugRebuild属性
This commit is contained in:
@@ -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="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"]
|
[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"]
|
[sub_resource type="CircleShape2D" id="CircleShape2D_h1v0q"]
|
||||||
radius = 61.204575
|
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")]
|
[node name="Rooster" instance=ExtResource("1_e5pl8")]
|
||||||
script = ExtResource("2_oqdqd")
|
script = ExtResource("2_oqdqd")
|
||||||
displayName = "公鸡"
|
displayName = "公鸡"
|
||||||
@@ -58,10 +76,10 @@ process_mode = 4
|
|||||||
|
|
||||||
[node name="RedCrystal" parent="weaponStore" index="0" instance=ExtResource("3_0omr3")]
|
[node name="RedCrystal" parent="weaponStore" index="0" instance=ExtResource("3_0omr3")]
|
||||||
offset_bottom = 374.0
|
offset_bottom = 374.0
|
||||||
debugRebuild = false
|
|
||||||
|
|
||||||
[node name="PurpleCrystal" parent="weaponStore" index="1" instance=ExtResource("3_jluqw")]
|
[node name="PurpleCrystal" parent="weaponStore" index="1" instance=ExtResource("3_jluqw")]
|
||||||
offset_bottom = 350.0
|
offset_bottom = 350.0
|
||||||
|
debugRebuild = false
|
||||||
|
|
||||||
[node name="BlueCrystal" parent="weaponStore" index="2" instance=ExtResource("4_0omr3")]
|
[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"]
|
[node name="normal" type="Node2D" parent="texture/weapons" index="0"]
|
||||||
position = Vector2(54, -45)
|
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")]
|
[node name="statebar" parent="." index="4" node_paths=PackedStringArray("entity")]
|
||||||
position = Vector2(0, -202)
|
position = Vector2(0, -202)
|
||||||
entity = NodePath("..")
|
entity = NodePath("..")
|
||||||
|
|||||||
@@ -80,10 +80,10 @@ spawn_path = NodePath("..")
|
|||||||
|
|
||||||
[node name="camera" type="Camera2D" parent="."]
|
[node name="camera" type="Camera2D" parent="."]
|
||||||
process_mode = 3
|
process_mode = 3
|
||||||
offset = Vector2(0, -80)
|
|
||||||
process_callback = 0
|
process_callback = 0
|
||||||
position_smoothing_enabled = true
|
position_smoothing_enabled = true
|
||||||
script = ExtResource("5_mk7bv")
|
script = ExtResource("5_mk7bv")
|
||||||
|
constantOffset = Vector2(0, -80)
|
||||||
|
|
||||||
[node name="animator" type="AnimationPlayer" parent="camera"]
|
[node name="animator" type="AnimationPlayer" parent="camera"]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ avatarTexture = ExtResource("2_3e8g7")
|
|||||||
displayName = "红水晶簇"
|
displayName = "红水晶簇"
|
||||||
typeTopic = 1
|
typeTopic = 1
|
||||||
store = {
|
store = {
|
||||||
"atk": 40,
|
"atk": 60,
|
||||||
"radius": 150.0
|
"radius": 150.0
|
||||||
}
|
}
|
||||||
storeType = {
|
storeType = {
|
||||||
@@ -20,7 +20,6 @@ storeType = {
|
|||||||
}
|
}
|
||||||
descriptionTemplate = "发射[b]红水晶[/b],在3秒后以$radius的半径爆炸,造成$atk点伤害。"
|
descriptionTemplate = "发射[b]红水晶[/b],在3秒后以$radius的半径爆炸,造成$atk点伤害。"
|
||||||
cooldown = 2000.0
|
cooldown = 2000.0
|
||||||
debugRebuild = true
|
|
||||||
|
|
||||||
[node name="attack" parent="sounds" index="0"]
|
[node name="attack" parent="sounds" index="0"]
|
||||||
stream = ExtResource("4_qt0vq")
|
stream = ExtResource("4_qt0vq")
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
extends Camera2D
|
extends Camera2D
|
||||||
class_name CameraManager
|
class_name CameraManager
|
||||||
|
|
||||||
|
@export var constantOffset: Vector2 = Vector2.ZERO
|
||||||
|
|
||||||
@onready var animator: AnimationPlayer = $"%animator"
|
@onready var animator: AnimationPlayer = $"%animator"
|
||||||
|
|
||||||
var shakeIntensity: float = 0
|
var shakeIntensity: float = 0
|
||||||
@@ -12,8 +14,9 @@ func _ready():
|
|||||||
instance = self
|
instance = self
|
||||||
func _physics_process(_delta):
|
func _physics_process(_delta):
|
||||||
if is_instance_valid(UIState.player):
|
if is_instance_valid(UIState.player):
|
||||||
position = UIState.player.position
|
position = UIState.player.position + constantOffset
|
||||||
position += MathTool.randomVector2In(shakeIntensity)
|
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):
|
static func shake(millseconds: float, intensity: float = 10, steper: Callable = func(currentValue, _totalValue, _restPercent): return currentValue):
|
||||||
var startTime = WorldManager.getTime()
|
var startTime = WorldManager.getTime()
|
||||||
|
|||||||
Reference in New Issue
Block a user