Source

ld3k / MenuWorld.as

package
{
	import net.flashpunk.Entity;
	import net.flashpunk.FP;
	import net.flashpunk.World;
	import net.flashpunk.graphics.Canvas;
	import net.flashpunk.graphics.Image;
	import net.flashpunk.graphics.Text;
	import net.flashpunk.utils.Input;
	import net.flashpunk.utils.Key;
	
	
	public class MenuWorld extends World
	{
		[Embed(source = 'data/logo.png')]
		public static const ImgLogo:Class;
		
		[Embed(source = 'data/isolated.png')]
		public static const ImgIso:Class;
		
		private var _iso:Entity;
		private var _logo:Entity;
		private var _text:Entity;
		private var _textcnter:int;
		
		override public function begin():void
		{
			_iso  = new Entity(88, 88, new Image(ImgIso));
			_logo = new Entity(8, 12, new Image(ImgLogo));
			_text = new Entity(0, 40, new Text("WSAD/Arrows : move\nSHIFT : slow\n   ! DODGE LASERS !\n\npress SHIFT to start"));
			Text(_text.graphic).size = 8;
			Text(_text.graphic).color = Au.HEADCOLOR;
//			_text.visible = false;
			_textcnter = 0;
			
			add(_logo);
			add(_text);
			add(_iso);
		}
		
		override public function update():void
		{
			if (Input.pressed(Key.SHIFT)) {
				FP.world = new GameWorld;
			}
			super.update();
		}
	}
}