package classes.matuto.mtGame
{
	
	
	//Matuto
	import classes.fl.motion.easing.*;
	import classes.fl.transitions.easing.Strong;
	import classes.greensock.*;
	import classes.matuto.core.*;
	import classes.matuto.core.module.*;
	import classes.matuto.events.*;
	import classes.matuto.mtGame.ObjectGame;
	import classes.matuto.interfaces.*;
	import classes.matuto.model.*;
	import classes.matuto.mtween.textinho.*;
	import classes.matuto.ui.*;
	import classes.matuto.utils.display.*;
	import classes.matuto.utils.model.*;
	
	import flash.display.*;
	import flash.events.*;
	import flash.text.*;
	import flash.ui.Keyboard;
	import flash.utils.*;
	
	
	public class ModuleGame extends Module
	{
		
		public var podeRender			:Boolean = true;
		public var key					:uint;
		
		
		public function ModuleGame() 
		{
			super();
		}
		
		public override function init():void
		{				
			Matuto.getStage.addEventListener(KeyboardEvent.KEY_DOWN,down);
			Matuto.getStage.addEventListener(KeyboardEvent.KEY_UP,up);
			addEventListener(Event.ENTER_FRAME,RENDER);
		}
		
		
		//controle
		
		private function down(e:KeyboardEvent):void
		{
			key		   = e.keyCode;
			onSegura();
		}
		
		
		public function onSegura():void
		{
			
		}
		
		private function up(e:KeyboardEvent):void
		{
			onSolta();
		}
		
		public function onSolta():void
		{
			
		}
		
		//end controle

		
		//render
	
		private function RENDER(e:Event):void
		{
			if(podeRender)
			{
				onRender();
			}
		}
		
		public function onRender():void
		{
			return void;
		}
		
		public function addRender():void
		{
			addEventListener(Event.ENTER_FRAME,RENDER);
		}
		
		
		public function removeRender():void
		{
			removeEventListener(Event.ENTER_FRAME,RENDER);
		}
		
		
		//end render

		public override function dispose():void
		{
			
		}
		
	}//end class
	
}