mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 15:38:14 +00:00
[QoL] Noclip can be toggled, works w/o debug in leveltesting, some convenience functions. (#621)
* Some state machine functions to make code tidier in the future * Added a function to Global to check if we're playtesting, for convenience * Only allow noclip w/o debug in leveltesting, toggling added, kept jump key to exit
This commit is contained in:
@@ -280,9 +280,16 @@ func editor_level_start() -> void:
|
||||
func _physics_process(delta: float) -> void:
|
||||
if Input.is_action_just_pressed("debug_reload"):
|
||||
set_power_state_frame()
|
||||
if Input.is_action_just_pressed("debug_noclip") and Global.debug_mode:
|
||||
state_machine.transition_to("NoClip")
|
||||
Global.log_comment("NOCLIP Enabled")
|
||||
|
||||
# guzlad: noclip without dev only works while playtesting.
|
||||
if (Input.is_action_just_pressed("debug_noclip") or Input.is_action_just_pressed("jump_0")) and ((Global.debug_mode) or (Global.level_editor_is_playtesting())):
|
||||
if state_machine.is_state("NoClip"):
|
||||
state_machine.transition_to("Normal")
|
||||
Global.log_comment("NOCLIP Disabled")
|
||||
elif !Input.is_action_just_pressed("jump_0") and !state_machine.is_state("NoClip"):
|
||||
state_machine.transition_to("NoClip")
|
||||
Global.log_comment("NOCLIP Enabled")
|
||||
|
||||
up_direction = -gravity_vector
|
||||
handle_directions()
|
||||
handle_block_collision_detection()
|
||||
|
Reference in New Issue
Block a user