当我的球被动画时,我有一些屏幕撕裂,但不确定是否有人可以做任何事情。但我的主要问题是试图在3d空间中制作动画。有这个公式吗?
var xPos:Number = tennis_ball.x;
var yPos:Number = tennis_ball.y;
var xVel:Number = (Math.random() * 10) - 5;
var yVel:Number = (Math.random() * -10) - 10;
var gravity:Number = 1;
addEventListener(Event.ENTER_FRAME, onLoop, false,0,true);
function onLoop(evt:Event):void {
yVel += gravity;
xPos += xVel;
yPos += yVel;
if(yPos > 400 - tennis_ball.height){
yPos = 400 - tennis_ball.height;
yVel *= -.75;
}
tennis_ball.x = xPos;
tennis_ball.y = yPos;
}