Skip to content

Instantly share code, notes, and snippets.

@KinoAR

KinoAR/State.hx

Created Feb 21, 2021
Embed
What would you like to do?
State machine in HaxeFlixel
package game;
class State {
public var currentState:Float -> Void;
public function new(initialState:Float -> Void) {
currentState = initialState;
}
public function update(elapsed:Float) {
currentState(elapsed);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment