class flixel.system.replay.FlxReplay

Available on all platforms

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.

Instance Fields

var finished:Bool

Whether the replay has finished playing or not.

var frame:Int

The current frame for this recording.

var frameCount:Int

The number of frames in this recording.

var seed:Int

The random number generator seed value for this recording.

function new():Void

Instantiate a new replay object. Doesn't actually do much until you call create() or load().

function create(Seed:Int):Void

Create a new gameplay recording. Requires the current random number generator seed. * *

Seed

The current seed from the random number generator.

function destroy():Void

Clean up memory.

function 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. *

FileContents

A String object containing a gameplay recording.

function playNextFrame():Void

Get the current frame record data and load it into the input managers.

function recordFrame():Void

Get the current input data from the input managers and store it in a new frame record.

function rewind():Void

Reset the replay back to the first frame.

function save():String

Save the current recording data off to a String object. * Basically goes through and calls FrameRecord.save() on each frame in the replay. * return The gameplay recording in simple ASCII format.