Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ActionScript 3 Example 7 MenuState Version 1
package
{
/**
* ...
* @author Dan Cox
*/
import org.flixel.*;
public class MenuState extends FlxState
{
[Embed(source="data/MenuBackground.png")]
private var MenuBackgroundPng:Class;
public function MenuState()
{
var background:FlxSprite = new FlxSprite();
background.loadGraphic(MenuBackgroundPng);
add(background);
}
override public function update():void
{
super.update();
if (FlxG.keys.ENTER)
{
FlxG.fade(0xff000000, 1, startPlay);
}
}
private function startPlay():void
{
FlxG.switchState(new PlayState);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment