动画&线程睡眠?

时间:2014-01-02 03:11:51

标签: java

过去几个月我一直在玩游戏。在挖掘时遇到了烦人的'问题'。

这是我的代码:

public void DigTeleport(Client c, int X, int Y, int H, String Message) {
    c.forceAnim(830);
    c.sendMessage(Message);
    try {
        Thread.sleep(1000);
        c.getPA().movePlayer(X, Y, H);
        c.correctCoordinates();
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
}

它应该做的是做动画然后等待1秒&然后调用我把它放在Thread.sleep(1000);

之下的方法

我已经尝试过将这些方法放在try {}之下(外部),但仍然是相同的。 显然我做错了,有人会给我一个我错的指针吗?

抱歉对不起。

它正在使用上面的代码做什么等待1秒然后做动画&调用方法。

/**
 * Animations
 **/
@Override
public void forceAnim(int animId) {
    if (isNpc) {
        return;
    }
    animationRequest = animId;
    animationWaitCycles = 0;
    updateRequired = true;
}

public void forceAnim(int animId, int time) {
    animationRequest = animId;
    animationWaitCycles = time;
    updateRequired = true;
}

0 个答案:

没有答案