limbo hsm

This commit is contained in:
2026-10-15 16:56:45 +08:00
parent 18e7b2daa8
commit a76c4aebef
30 changed files with 665 additions and 121 deletions
+17
View File
@@ -0,0 +1,17 @@
extends LimboHSM
## 空中子机(挂在 HSM/Airborne 上)。
##
## Jump(上升段)→ Fall(越过顶点开始下落)。进入时按当前竖直速度挑初始子状态:
## 起跳进来 vy > 0 → Jump;踏空掉进来 vy ≈ 0 → Fall(vy ≤ 0 一律算 Fall)。
@onready var jump: LimboState = $Jump
@onready var fall: LimboState = $Fall
func _setup() -> void:
add_transition(jump, fall, &"falling")
func _enter() -> void:
var player := get_agent() as Player
set_initial_state(fall if player == null or player.velocity.y <= 0.0 else jump)