输入Frame Loop正在更新敌人类,但敌人没有移动

时间:2014-04-01 20:59:36

标签: actionscript-3 flash flash-cs5

    public function Goblin()
    {
        move = true;
        nTimer = 0;
        speed = 1;
        this.addEventListener(Event.ADDED_TO_STAGE, onAdd)
    }

    private function onAdd(e:Event):void 
    {
        trace("added Goblin");
        removeEventListener(Event.ADDED_TO_STAGE, onAdd);
    }

    public function goblinLoop() 
    {
        trace("yes");
        //trace(nTimer);

        this.x -= 4;


    }

这是敌人类,你可以看到我没有使用输入框来移动它。相反,从主要课程我... ...

    private function updatePlayer():void 
    {
        character.keyListner();
        character.movementChar();
        goblin1.goblinLoop();
        goblin2.goblinLoop();

    }

我不明白的是它的痕迹"是"在输出面板中,尽管调用了函数,但妖精不会移动。

1 个答案:

答案 0 :(得分:0)

我现在已经回到了enterFrame,我将在开发技能时使用更新方法,并在进入框架中研究更多为什么不使用它们(多线程游戏)。

感谢您的投入。