feat: implement movement state machine ground/air states and initialize weapon manager system
This commit is contained in:
@@ -140,8 +140,14 @@ func update(delta: float) -> void:
|
||||
# Fallback to wall run
|
||||
var wall_n := machine.detect_wall_horizontal()
|
||||
if wall_n != Vector3.ZERO:
|
||||
machine.switch_to("wall_run")
|
||||
return
|
||||
var w_look_dir := -player.global_transform.basis.z
|
||||
var h_look := Vector3(w_look_dir.x, 0.0, w_look_dir.z).normalized()
|
||||
|
||||
# Require looking mostly along the wall (angle > 41 degrees from normal)
|
||||
# and inputting mostly along the wall (angle > 31 degrees from normal, allows W+A/D diagonally into wall)
|
||||
if absf(h_look.dot(wall_n)) < 0.75 and absf(wish_dir.dot(wall_n)) < 0.85:
|
||||
machine.switch_to("wall_run")
|
||||
return
|
||||
|
||||
# ── Dash ──────────────────────────────────────────────────────────────
|
||||
if machine.input_dash:
|
||||
|
||||
Reference in New Issue
Block a user