Skip to content

Instantly share code, notes, and snippets.

@KinoAR
Created February 21, 2021 01:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KinoAR/ed36b8adc6398726f2c28cf1f0644547 to your computer and use it in GitHub Desktop.
Save KinoAR/ed36b8adc6398726f2c28cf1f0644547 to your computer and use it in GitHub Desktop.
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