Created
February 21, 2021 01:47
-
-
Save KinoAR/ed36b8adc6398726f2c28cf1f0644547 to your computer and use it in GitHub Desktop.
State machine in HaxeFlixel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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