Ver Mensaje Individual
  #4 (permalink)  
Antiguo 02/07/2010, 01:26
Avatar de Eskombro
Eskombro
 
Fecha de Ingreso: septiembre-2009
Ubicación: Colombia
Mensajes: 437
Antigüedad: 14 años, 7 meses
Puntos: 22
Respuesta: Movimiento aleatorio

Voy a hacer un ejemplo de un movimiento aleatorio a ver si te sirve. Es as3...

Código actionScript:
Ver original
  1. var velX:Number=Math.random()*5;
  2. var velY:Number=Math.random()*5;
  3.  
  4. addEventListener(Event.EnterFrame, movimientoAleatorio);
  5. function MovimientoAleatorio(e:Event){
  6. objeto.x+=velX;
  7. objeto.y+=velY;
  8. }
__________________
Blog AS3 Ideas -> Programación en ActionScript 3
________
Esk Games | Free online flash games