From d1db41c89afa29a3ee90a6b0b18ffeb9bf3fa4d7 Mon Sep 17 00:00:00 2001 From: Dustin Date: Sat, 15 Mar 2025 16:05:51 -0700 Subject: [PATCH] Comment some no longer needed code. --- lib/classes/actor.gd | 31 ++++++++++++++++--------------- lib/classes/state.gd | 17 +++++++++-------- lib/classes/state_machine.gd | 29 +++++++++++++++-------------- 3 files changed, 40 insertions(+), 37 deletions(-) diff --git a/lib/classes/actor.gd b/lib/classes/actor.gd index 81f9781..3e66132 100644 --- a/lib/classes/actor.gd +++ b/lib/classes/actor.gd @@ -42,21 +42,22 @@ func _ready() -> void: sound_effects_dict[i.animation_name + str(i.frame_number)] = i.sound print (sound_effects_dict) -func _unhandled_input(event: InputEvent) -> void: - if actor_type == "Player": - movement_component.process_input(event) - movement_state_machine.process_input(event) - -func _physics_process(delta: float) -> void: - movement_component.process_physics(delta) - movement_state_machine.process_physics(delta) - -func _process(delta: float) -> void: - if actor_type == "NPC" or actor_type == "Enemy": - movement_component.process(delta) - movement_state_machine.process_frame(delta) -# PlayerInfo.player_position = global_position - #play_sound_frame(movement_animations.animation , movement_animations.frame) +# Disable to test whether actually needed. +#func _unhandled_input(event: InputEvent) -> void: +# if actor_type == "Player": +# movement_component.process_input(event) +# movement_state_machine.process_input(event) +# +#func _physics_process(delta: float) -> void: +# movement_component.process_physics(delta) +# movement_state_machine.process_physics(delta) +# +#func _process(delta: float) -> void: +# if actor_type == "NPC" or actor_type == "Enemy": +# movement_component.process(delta) +# movement_state_machine.process_frame(delta) +## PlayerInfo.player_position = global_position +# #play_sound_frame(movement_animations.animation , movement_animations.frame) var last_sound_frame_animation: String = '' diff --git a/lib/classes/state.gd b/lib/classes/state.gd index 3ee7924..3c18c00 100644 --- a/lib/classes/state.gd +++ b/lib/classes/state.gd @@ -54,11 +54,12 @@ func enter() -> void: func exit() -> void: pass -func process_input(_event: InputEvent) -> String: - return '' - -func process_frame(_delta: float) -> String: - return '' - -func process_physics(_delta: float) -> String: - return '' +# Disable to test whether actually needed. +#func process_input(_event: InputEvent) -> String: +# return '' +# +#func process_frame(_delta: float) -> String: +# return '' +# +#func process_physics(_delta: float) -> String: +# return '' diff --git a/lib/classes/state_machine.gd b/lib/classes/state_machine.gd index 32814ae..0241648 100644 --- a/lib/classes/state_machine.gd +++ b/lib/classes/state_machine.gd @@ -74,18 +74,19 @@ func change_to_known_state(new_state_name: String) -> void: else: push_warning(get_parent().name + ": Attempt to switch state to unknown: " + new_state_name) change_state(states_index["default"]) - -# Pass through functions for the Player to call, -# handling state changes as needed. -func process_physics(delta: float) -> void: - change_to_known_state( current_state.process_physics(delta) ) -func process_input(event: InputEvent) -> void: - var new_state = current_state.process_input(event) - if new_state: - change_state(new_state) - -func process_frame(delta: float) -> void: - var new_state = current_state.process_frame(delta) - if new_state: - change_state(new_state) +# Disable to test whether actually needed. +## Pass through functions for the Player to call, +## handling state changes as needed. +#func process_physics(delta: float) -> void: +# change_to_known_state( current_state.process_physics(delta) ) +# +#func process_input(event: InputEvent) -> void: +# var new_state = current_state.process_input(event) +# if new_state: +# change_state(new_state) +# +#func process_frame(delta: float) -> void: +# var new_state = current_state.process_frame(delta) +# if new_state: +# change_state(new_state)