package gameStates 
{

	import org.flixel.*;
	/**
	 * ...
	 * @author 
	 */
	public class StoryState extends FlxState
	{
		[Embed(source="../../assets/images/Vineta1.png")]public var scene1:Class;
		[Embed(source = "../../assets/images/Vineta3.png")]public var scene3:Class;
		[Embed(source="../../assets/images/Vineta2.png")]public var scene2:Class;
		[Embed(source = "../../assets/audio/robotito-base 4-Vibes2 Metal.mp3")]public var snd1:Class;
		
		public var sceneNum:int = 0;
		private var spriteScene1:FlxSprite;
		private var spriteScene2:FlxSprite;
		private var spriteScene3:FlxSprite;
		
		public function StoryState() 
		{
			FlxG.playMusic(snd1, 1);
			spriteScene3 = new FlxSprite(0, 0, scene3);
			add(spriteScene3); 
			spriteScene2 = new FlxSprite(0, 0, scene2);
			add(spriteScene2);
			spriteScene1 = new FlxSprite(0, 0, scene1);
			add(spriteScene1); 

		}
		
		override public function update():void
		{
			
			
			if (FlxG.keys.justPressed("SPACE"))
			{
				onButton();
			}
			super.update();
		}
		
		private function onButton():void
		{
			FlxG.flash(0xffc2c2c2, 0.5);
			sceneNum++
			if(sceneNum == 1)
				spriteScene1.kill();
			else if (sceneNum == 2)
				spriteScene2.kill();
			else if (sceneNum > 2)
				FlxG.switchState(new PlayState);
		}
		
		private function onFade():void
		{
			
		}
		
	}

}