Bull roll ability, console screen, tests
This commit is contained in:
+2
-17
@@ -94,18 +94,14 @@ func _setup_tail() -> void:
|
||||
_tail_parent_idx = _skeleton.get_bone_parent(_tail_idx[0])
|
||||
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
if event is InputEventKey and event.pressed and not event.echo:
|
||||
if event.physical_keycode == KEY_QUOTELEFT:
|
||||
_dbg_toggle()
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if not _skeleton:
|
||||
return
|
||||
_wobble_body(delta)
|
||||
_update_tail(delta)
|
||||
_apply_tail()
|
||||
if DP.b("show_tail") != _dbg_on:
|
||||
_dbg_toggle()
|
||||
if _dbg_on:
|
||||
_dbg_update()
|
||||
|
||||
@@ -243,12 +239,9 @@ func _dbg_toggle() -> void:
|
||||
n.queue_free()
|
||||
_dbg_nodes.clear()
|
||||
_dbg_on = false
|
||||
print("TailDebug OFF")
|
||||
else:
|
||||
_dbg_build()
|
||||
_dbg_on = true
|
||||
var pname := _skeleton.get_bone_name(_tail_parent_idx) if _tail_parent_idx >= 0 else "none"
|
||||
print("TailDebug ON parent_bone=", pname, " bull_pos=", _bull.global_position)
|
||||
|
||||
|
||||
func _dbg_build() -> void:
|
||||
@@ -275,14 +268,6 @@ func _dbg_build() -> void:
|
||||
func _dbg_update() -> void:
|
||||
for i: int in _dbg_nodes.size():
|
||||
_dbg_nodes[i].global_position = _tail_world[i]
|
||||
# Print positions every ~60 frames
|
||||
if Engine.get_process_frames() % 60 == 0:
|
||||
var parent_y := 0.0
|
||||
if _tail_parent_idx >= 0:
|
||||
parent_y = _skeleton.to_global(_skeleton.get_bone_global_pose(_tail_parent_idx).origin).y
|
||||
print("anchor_Y=%.2f parent_bone_Y=%.2f player_Y=%.2f on_floor=%s" % [
|
||||
_tail_world[0].y, parent_y, _player.global_position.y,
|
||||
str(_player.is_on_floor())])
|
||||
|
||||
|
||||
# ── Utility ───────────────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user