Created
November 13, 2017 19:04
-
-
Save gltovar/61a8eaef0b4d2e91feb701f0a781db7d 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; | |
import flixel.FlxState; | |
import flixel.FlxG; | |
import flixel.input.keyboard.FlxKey; | |
import flixel.ui.FlxButton; | |
class PlayState extends FlxState | |
{ | |
var button:FlxButton; | |
override public function create():Void | |
{ | |
super.create(); | |
button = new FlxButton(); | |
add(button); | |
button.setPosition(100,100); | |
} | |
override public function update(elapsed:Float):Void | |
{ | |
super.update(elapsed); | |
if(/*FlxG.keys.anyJustPressed([FlxKey.Z]) ||*/ button.justPressed) | |
{ | |
FlxG.log.add("z just pressed. " + FlxG.game.ticks); // this gets hit twice | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment