【发布时间】:2013-09-07 14:18:16
【问题描述】:
我想在跑步和跳跃动画之间切换,但我有一些问题: 如果播放器运行并且我在屏幕上点击,播放器开始跳跃(一次),并且 Jumpanimation 开始但不结束,因此播放器正在运行 Jumpanimation。
你知道我的错在哪里吗? 我的代码:
// Runanimation + Player Run
public void setRunning()
{
canRun = true;
final long[] PLAYER_ANIMATE = new long[] { 100, 100, 100,};
animate(PLAYER_ANIMATE, 0, 2, true);
}
// Jumpanimation + Player Jump
public void jump()
{
if (footContacts < 1)
{
return;
}
body.setLinearVelocity(new Vector2(body.getLinearVelocity().x, 10));
final long[] PLAYER_JUMP_ANIMATE = new long[] { 100, 100, 100, 100, 100, 100};
animate(PLAYER_JUMP_ANIMATE, 0, 5,true);
}
感谢Seref
【问题讨论】:
标签: animation switch-statement andengine animated