ésta se mueva a cualquier angulo..!
no se como conseguirlo alguien me podria ayudar..!?
la bola solo se mueve a una direccion y dandole doble click al palo, lo hice con macrome flah 8..!
Código ActionScript :
import mx.transitions.Tween;
import mx.transitions.easing.*;
var stickStart:Number = stick._x-200;
var stickStop:Number = stick._x + 200;
//Posicion del Palo: se mantiene cerca a la bola
stick._x = ball._x+203;
stick._y = ball._y+4;
ball.onPress = function() {
this.startDrag(false, 12, 20, 490,362);
};
ball.onRelease = function() {
this.stopDrag();
}
stick.onPress = function() {
this.startDrag(false, 180, 380, 690,10);
};
//Se mueve el palo simulando el golpe de atras hacia adelante
stick.onRelease = function() {
this.stopDrag();
if(stick._x<=ball._x+203 and stick._x>=ball._x+169 and stick._y<=ball._y+20 and stick._y>=ball._y-12){
stick.gotoAndPlay(2);
}
};
function go_ball() {
//La bola se empieza a mover: se empieza a mover cuando termina el movimiento del palo
if(ball._x>12){
var tween_ball:Tween = new Tween(ball, "_x", Regular.easeOut, ball._x, ball._x-60, 0.6, true);
}
tween_ball.onMotionFinished = function() {
var tween_palox:Tween = new Tween(stick, "_x", Regular.easeOut, stick._x, ball._x+203, 0.7, true);
var tween_paloy:Tween = new Tween(stick, "_y", Regular.easeOut, stick._y, ball._y+4, 0.7, true);
};
} 