Skip to content

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