mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 15:38:14 +00:00
added the game
This commit is contained in:
17
Scripts/Classes/States/StateMachine.gd
Executable file
17
Scripts/Classes/States/StateMachine.gd
Executable file
@@ -0,0 +1,17 @@
|
||||
class_name StateMachine
|
||||
extends Node
|
||||
|
||||
@export var state: State = null
|
||||
|
||||
func transition_to(state_name := "", state_msg := {}) -> void:
|
||||
state.exit()
|
||||
state.state_exited.emit()
|
||||
state = get_node(state_name)
|
||||
state.enter(state_msg)
|
||||
state.state_entered.emit()
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
state.physics_update(delta)
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
state.update(delta)
|
Reference in New Issue
Block a user