Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add player_state dictionary to manage player state names for FSM demo #1143

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Yaxian
Copy link
Contributor

@Yaxian Yaxian commented Dec 3, 2024

Add player_state to manage player state.

static var player_state := {
	"previous": "previous",
	"jump": "jump",
	"idle": "idle",
	"move": "move",
	"stagger": "stagger",
	"attack": "attack",
	"die": "die",
	"dead": "dead",
	"walk": "walk",
}

I tried to use enum, like

state.gd

enum BaseState {
 	PREVIOUS
}

player_state.gd

extends "res://state_machine/state.gd"

enum PlayerState {
	JUMP
}

But the function signature verification fails. Is there a good way to manage state in state machine, like type check, code hints?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants