Closed paxer closed 10 months ago
It is less likely for state-specific variables to be a thing in SnowState. You have to use instance variables instead.
There is a workaround though, which I highly discourage. You can declare instance variables in the enter
event and use it in the state.
fsm = new SnowState("walk");
fsm.add("walk", {
enter: function() {
__walk_internal_var = 123;
},
step: function() {
show_debug_message(__walk_internal_var);
}
}
It would be useful to have states' own internal state variables, e.g., the variable that is available only within this state and accessible and can be mutated by all state events.
currently, this will be an error