fix: repair parallax collisions and add play guide

This commit is contained in:
wxm
2026-07-06 23:51:59 -07:00
parent 8cca00d0da
commit af7b580691
12 changed files with 921 additions and 618 deletions
+13 -9
View File
@@ -7,9 +7,9 @@ extends SceneTree
## 2. 趔趄门禁:击退滑行期间 Boss/小怪不得起手新动作(EnemyActionDriver
## 钩子),否则动作突进立刻接管 velocity 冲回玩家,把击退整个吃掉
## (真实 stage 实测净位移为负);Boss 受击链强制撤退豁免(清残速标志)。
## 3. 关卡背景单层视差:背景水平速度为相机 0.8 倍(0.92 肉眼难辨已加强),
## 锚点 2047,无相机保持原位;脚下地砖轻微滑动是单张烙死原画的已知
## 取舍,无伤视差待美术拆层
## 3. 关卡背景分层契约:当前整图里的地面/步道先锁在 1:1 世界层,避免脚下
## 地砖相对角色滑动;美术拆出的天空/夕阳放入 SkyParallaxLayer 后继续按
## 0.2 倍世界滚动(相机 0.8 跟随)
## (Boss 击退 ×9 的加码钉在 test_round3_fixes。)
var failures: Array[String] = []
@@ -147,24 +147,28 @@ func _check_background_parallax() -> void:
await process_frame
await process_frame
var art_layer := ground.get_node("ArtLayer") as Node2D
var sky_layer := ground.get_node("SkyParallaxLayer") as Node2D
# 无相机:背景保持原位(headless/菜单兜底)。
_expect_float(art_layer.position.x, 896.5, "无相机时背景保持基准位置")
# 无相机:世界层与可选远景层都保持原位(headless/菜单兜底)。
_expect_float(art_layer.position.x, 896.5, "无相机时地面世界层保持基准位置")
_expect_float(sky_layer.position.x, 896.5, "无相机时远景视差层保持基准位置")
# 有相机:偏移 = (相机中心 - 1734.5) × 0.8——"远景天幕"语义,背景 80%
# 跟随相机,仅 0.2 倍速随世界滚动,保证远景夕阳时刻在画面内(策划定案)
# 有相机:地面/步道保持 1:1 世界坐标;远景容器按
# (相机中心 - 1734.5) × 0.8 视差移动
var camera := Camera2D.new()
root.add_child(camera)
camera.make_current()
camera.global_position = Vector2(2547.0, 395.0)
await process_frame
await process_frame
_expect_float(art_layer.position.x, 896.5 + (2547.0 - 1734.5) * 0.8, "背景 80% 跟随相机(天幕视差")
_expect_float(art_layer.position.x, 896.5, "相机右移时地面世界层不做视差")
_expect_float(sky_layer.position.x, 896.5 + (2547.0 - 1734.5) * 0.8, "相机右移时远景层 80% 跟随")
camera.global_position = Vector2(1547.0, 395.0)
await process_frame
await process_frame
_expect_float(art_layer.position.x, 896.5 + (1547.0 - 1734.5) * 0.8, "相机左移时天幕对称跟随")
_expect_float(art_layer.position.x, 896.5, "相机左移时地面世界层仍不做视差")
_expect_float(sky_layer.position.x, 896.5 + (1547.0 - 1734.5) * 0.8, "相机左移时远景层对称跟随")
camera.free()
ground.free()