isometric cam

This commit is contained in:
2026-05-25 20:22:43 +03:00
parent 174b14fa61
commit 85b9c86164
3 changed files with 35 additions and 27 deletions
+10 -11
View File
@@ -8,7 +8,7 @@ const HOOF_OFFSETS: Array = [
Vector3( 0.30, -0.25, 0.60),
]
@onready var camera_pivot: Node3D = $SpringArmPivot
@onready var camera_pivot: Node3D = $Camera3D
@onready var cube_guy: Node3D = $bull_v10
var _hoof_emitters: Array[CPUParticles3D] = []
@@ -177,18 +177,17 @@ func _physics_process(delta: float) -> void:
var charging := Input.is_action_pressed(&"charge")
var on_floor := is_on_floor()
# ── Left / right click thrust (only when mouse is captured) ─────────────
# ── Left / right click thrust ─────────────────────────────────────────────
# Left click → thrust NE (forward-right diagonal)
# Right click → thrust NW (forward-left diagonal)
if Input.mouse_mode == Input.MOUSE_MODE_CAPTURED:
if Input.is_action_just_pressed(&"thrust_left") or Input.is_action_just_pressed(&"thrust_right"):
var raw := cube_guy.global_transform.basis.z
var bull_fwd := Vector3(raw.x, 0.0, raw.z).normalized()
var bull_right := bull_fwd.cross(Vector3.UP)
if Input.is_action_just_pressed(&"thrust_left"):
_apply_thrust((bull_fwd + bull_right).normalized())
else:
_apply_thrust((bull_fwd - bull_right).normalized())
if Input.is_action_just_pressed(&"thrust_left") or Input.is_action_just_pressed(&"thrust_right"):
var raw := cube_guy.global_transform.basis.z
var bull_fwd := Vector3(raw.x, 0.0, raw.z).normalized()
var bull_right := bull_fwd.cross(Vector3.UP)
if Input.is_action_just_pressed(&"thrust_left"):
_apply_thrust((bull_fwd + bull_right).normalized())
else:
_apply_thrust((bull_fwd - bull_right).normalized())
# Reset kick timer on landing so the first kick after a bounce is immediate
if on_floor and not _was_on_floor and direction: