Buenas! Después de haber hecho animaciones y webs, estoy tratando de crear mi primer juego en flash. Es el típico juego donde una bolita tiene que seguir un camino sin tocar los laterales del mismo.
 
Mi pregunta es: como puedo hacer para que cuando la "bolita" toque un lateral, automaticamente vuelva a la posición inicial, osea al principio del circuito.
 
Supongo que se hará tambien con el hittest pero no averiguo como. El código hasta ahora va así:
 
 onEnterFrame = function() {
	var velocidad:Number = 7;
 
	if (Key.isDown(Key.DOWN)) {
		if (!(fondo.hitTest(bolita.getBounds(_root).xMin, bolita.getBounds(_root).yMax+velocidad, true) || fondo.hitTest(bolita.getBounds(_root).xMax, bolita.getBounds(_root).yMax+velocidad, true))) {
			bolita._y += velocidad;
		}            
	}
	if (Key.isDown(Key.UP)) {
		if (!(fondo.hitTest(bolita.getBounds(_root).xMin, bolita.getBounds(_root).yMin-velocidad, true) || fondo.hitTest(bolita.getBounds(_root).xMax, bolita.getBounds(_root).yMin-velocidad, true))) {
			bolita._y -= velocidad;
		}			
	}
	if (Key.isDown(Key.LEFT)) {
		if (!(fondo.hitTest(bolita.getBounds(_root).xMin-velocidad, bolita.getBounds(_root).yMin, true) || fondo.hitTest(bolita.getBounds(_root).xMin-velocidad, bolita.getBounds(_root).yMax, true))) {
			bolita._x -= velocidad;
		}			
	}
	if (Key.isDown(Key.RIGHT)) {
		if (!(fondo.hitTest(bolita.getBounds(_root).xMax+velo  cidad, bolita.getBounds(_root).yMin, true) || fondo.hitTest(bolita.getBounds(_root).xMax+velocid  ad, bolita.getBounds(_root).yMax, true))) {
			bolita._x += velocidad;
		}		
	}
	}
 
 
Alguien puede decirme cual sería el actionscript, o alguna solución.
Gracias! 
   
 

