Skip to content

Instantly share code, notes, and snippets.

@videlais
Created October 22, 2013 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save videlais/7107448 to your computer and use it in GitHub Desktop.
Save videlais/7107448 to your computer and use it in GitHub Desktop.
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