var app = new PIXI.Application(600,500);
document.body.appendChild(app.view);
var bg = new PIXI.Sprite.fromImage("res/pao/ground01_2.png");
app.stage.addChild(bg);
bg.y = 300;
var ball = new PIXI.Sprite.fromImage("res/lianxi/llball/ball.png");
app.stage.addChild(ball);
ball.y = 240;
function animate() {
ball.x+=1;
if(ball.x>=280 && ball.x<=440){
ball.y+=;
}
}
app.ticker.add(animate);

请问这个动画效果怎么实现
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
1条回答 默认 最新
- 李筱宝 2021-10-12 16:47关注
function animate() { ball.x+=1; if(ball.x>=280 && ball.x<=440){ ball.y+=1; } }
有用望采纳
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报