Ver Mensaje Individual
  #2 (permalink)  
Antiguo 24/07/2011, 21:09
Avatar de nes24
nes24
 
Fecha de Ingreso: julio-2005
Mensajes: 746
Antigüedad: 18 años, 9 meses
Puntos: 3
Respuesta: Creando Un juego super simple

Bueno, como nadie me respondio pues yo me respondo solito:

Código HTML:
onClipEvent (load) {

}

onClipEvent (enterFrame) {
	trace("-");
	
		this.pointFront = {x:0, y:-_height/2};
		this.localToGlobal(this.pointFront);
		var fpx = this.pointFront.x;
		var fpy = this.pointFront.y;

		this.pointLeft = {x:-_width/2, y:0};
		this.localToGlobal(this.pointLeft);
		var lpx = this.pointLeft.x;
		var lpy = this.pointLeft.y;
		
		this.pointRight= {x:_width/2, y:0};
		this.localToGlobal(this.pointRight);
		var Rpx = this.pointRight.x;
		var Rpy = this.pointRight.y;
		
		this.pointBack= {x:0, y:_height/2};
		this.localToGlobal(this.pointBack);
		var Bpx = this.pointBack.x;
		var Bpy = this.pointBack.y;		
		

	if( _root.esenario.hitTest(fpx, fpy, true)   ){
		trace("pega Front");
		_y +=15;
	}

	if( _root.esenario.hitTest(lpx, lpy, true)   ){
		trace("pega Left");
		_x +=25;
	}
	
	if( _root.esenario.hitTest(Rpx, Rpy, true)   ){
		trace("pega Right");
		_x -=35;
	}	
	
	if( _root.esenario.hitTest(Bpx, Bpy, true)   ){
		trace("pega Back");
		_y -=30;
	}		
	
		if(Key.isDown(Key.UP)){	_y -= 5; }
		if(Key.isDown(Key.DOWN)){	_y +=5;}	
		if(Key.isDown(Key.LEFT)){	_x -=5;}	
		if(Key.isDown(Key.RIGHT)){	_x +=5;}	
	
}

Esto me funciono muy bien
__________________
No hay nada que foros del web no sepa!!!!

Peca tanto quien presume de su belleza como de su inteligencia, ya que la brevedad de la vida aunque distorcionada siempre estara presente.