简体   繁体   English

android sdk等待动画完成

[英]android sdk wait for animation to complete

I am making a simple game and I need the game to pause until a falling animation is completed and then call the AI move function. 我正在制作一个简单的游戏,我需要暂停游戏直到动画效果下降为止,然后调用AI移动功能。

Animation animationFalling = AnimationUtils.loadAnimation(this, R.anim.falling);
iv.startAnimation(animationFalling)

then I call the AI's function which does the same command to a different imageview. 然后我调用AI的函数,该函数对不同的imageview执行相同的命令。 The problem is that both the images, the players and the AI's are going at the same time. 问题在于图像,播放器和AI都在同时运行。 How can I make a small delay to let the first animation finish then start the second? 我如何稍作延迟以使第一个动画结束然后开始第二个动画?

Thanks 谢谢

您可以使用AsyncTaskThread来做到这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM