Last active
January 18, 2018 14:42
-
-
Save Geokureli/1534395b5299d386892e14902f98fbfc to your computer and use it in GitHub Desktop.
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 com.geokureli.testbed; | |
import flixel.FlxG; | |
import flixel.FlxState; | |
import flixel.system.replay.FlxReplay; | |
import flixel.ui.FlxButton; | |
class TestBed extends FlxState { | |
var replay:FlxReplay; | |
public function new() { super(); } | |
override public function create():Void { | |
super.create(); | |
replay = new FlxReplay(); | |
replay.load("0\n0km100,100,0,0\n100km178,240,2,0\n101km178,240,1,0\n102km178,240,-1,0\n103km178,240,0,0\n"); | |
add(new FlxButton(50, 30, "test", function(){ trace("click"); })); | |
} | |
override public function update(elapsed:Float):Void { | |
if (replay != null) { | |
replay.playNextFrame(); | |
if (FlxG.mouse.justPressed) | |
trace("replay click"); | |
if (replay.finished) { | |
replay = null; | |
trace("done"); | |
} | |
} | |
// --- REVERT INPUTS HERE | |
super.update(elapsed); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment