完善客户端功能并加入40250一致性审计
This commit is contained in:
@@ -34,6 +34,34 @@ func _run() -> void:
|
||||
pc.player = player
|
||||
pc.rotation_speed_deg = 1200.0
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Test 0: 40250 按键事件状态,不继承进入游戏前的系统按键
|
||||
# -------------------------------------------------------------------------
|
||||
print("\n--- Test 0: 进入游戏按键状态与 W/S 优先级 ---")
|
||||
pc.stop()
|
||||
_ck(pc._wasd() == Vector2.ZERO, "fresh/stop state cannot auto-move on game entry")
|
||||
var w_down := InputEventKey.new()
|
||||
w_down.keycode = KEY_W
|
||||
w_down.pressed = true
|
||||
pc.active = false
|
||||
pc._unhandled_input(w_down)
|
||||
pc.active = true
|
||||
_ck(pc._wasd() == Vector2.ZERO, "W pressed during loading is not inherited by the game phase")
|
||||
pc._unhandled_input(w_down)
|
||||
_ck(pc._wasd() == Vector2(0, -1), "W KeyDown starts forward movement")
|
||||
var s_down := InputEventKey.new()
|
||||
s_down.keycode = KEY_S
|
||||
s_down.pressed = true
|
||||
pc._unhandled_input(s_down)
|
||||
_ck(pc._wasd() == Vector2(0, -1), "W keeps priority while W and S overlap")
|
||||
var w_up := InputEventKey.new()
|
||||
w_up.keycode = KEY_W
|
||||
w_up.pressed = false
|
||||
pc._input(w_up)
|
||||
_ck(pc._wasd() == Vector2(0, 1), "releasing W switches cleanly to held S")
|
||||
pc.stop()
|
||||
_ck(pc._wasd() == Vector2.ZERO, "stop clears all latched direction keys")
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Test 1: 边界跨越平滑度与无翻跟头(X/Z 严格为 0)
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user