错误#1009 ActionScript 3

时间:2013-12-15 07:56:34

标签: actionscript-3

任何人都可以帮我解决此错误消息吗?我在这个函数中遇到了一个名为checkZeusToObjects的错误。我让宙斯要么被villian / medusa击中,要么收集卷轴和闪电。除了要求gameOver功能的美杜莎之外,每个对象都要得分,我从舞台上擦除所有对象并转到第5帧并重新开始游戏。当Zeus击中Bolt时,关卡结束并转到第4帧,这是一个闪屏,可以进入下一关。

        'function checkZeusToObjects(event:Event) {
        var BoltScore:int = (500 * BoltHits);
        var ScrollScore:int = ((secondScroll * 10) + (thirdScroll * 10));
        var MedusaScore:int = (MedusaHits * 100);
        var VillianScore:int = (VilliansKilled * 25);
        TotalScore = (VillianScore + CurrentScore + MedusaScore + ScrollScore + BoltScore);

        if (Scroll.hitTestObject(Zeus)) {
            updateScore(1);
            //addScrolls();
        }
        if (SecondScroll.hitTestObject(Zeus)) {
            removeChild(SecondScroll);
            addSecondScroll();
            secondScroll += 1;
        }
        if (ThirdScroll.hitTestObject(Zeus)) {
            removeChild(ThirdScroll);
            addThirdScroll();
            thirdScroll += 1;
        }
        if (Villian.hitTestObject(Zeus)) {
            ZeusHitSound.play();
            checkZeusToVillian();
        }
        if (Villian.hitTestObject(Strike)) {
            removeChild(Villian);
            removeChild(Strike);
            ScreechSound.play();
            addVillian();
            addStrike();
            VilliansKilled += 1;
        }

        if (Medusa.hitTestObject(Strike)) {
            removeChild(Medusa);
            removeChild(Strike);
            ScreechSound.play();
            addStrike();
            addMedusa();
            MedusaHits += 1;
            VilliansKilled += 1;
            }

        if (Medusa.hitTestObject(Zeus)) {
            gotoAndStop(5);
            gameOver();
            startOverBtn.addEventListener(MouseEvent.CLICK, restartGame);
        }
        if (Bolt.hitTestObject(Zeus)) {
            removeChild(Bolt);
            BoltHits += 1;
            gotoAndStop(4);
            txtLevelScore.text = TotalScore.toString();
            addBolt();
            levelComplete();
            btnNext.addEventListener(MouseEvent.CLICK, goBackToGame);
        }

        txtVillian.text = VilliansKilled.toString();
        txtScore.text = TotalScore.toString();
        txtLives.text = numLives.toString();
        txtLevel.text = "Level" + " " + CurrentLevel.toString();
    }'

0 个答案:

没有答案