The replay object both records and replays game recordings, as well as handle saving and loading replays to and from files. Gameplay recordings are essentially a list of keyboard and mouse inputs, but since Flixel is fairly deterministic, we can use these to play back recordings of gameplay with a decent amount of fidelity.
Constructor
Variables
frameCount:Int
The number of frames in this recording.
* **Note:** This doesn't include empty records, unlike `getDuration()`
Methods
create(Seed:Int):Void
Create a new gameplay recording. Requires the current random number generator seed.
Parameters:
Seed | The current seed from the random number generator. |
---|
getDuration():Int
The duration of this replay, in frames. Note: this is different from frameCount
, which
is the number of unique records, which doesn't count frames with no input
5.9.0
.load(FileContents:String):Void
Load replay data from a String object. Strings can come from embedded assets or external files loaded through the debugger overlay.
Parameters:
FileContents | A String object containing a gameplay recording. |
---|
recordFrame():Void
Get the current input data from the input managers and store it in a new frame record.