Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 MovieClip赢得';不换框架_Actionscript 3_Flash_Movieclip - Fatal编程技术网

Actionscript 3 MovieClip赢得';不换框架

Actionscript 3 MovieClip赢得';不换框架,actionscript-3,flash,movieclip,Actionscript 3,Flash,Movieclip,我在一个游戏中得到了一个墙的代码,如果它每25%的生命值(例如75%)是HP,它将改变框架 下面是墙的代码: protected function checkFrame() { if (Math.abs(this.currentDamageCounter) >= this.healthPrFrame) { if (this.currentDamageCounter > 0)

我在一个游戏中得到了一个墙的代码,如果它每25%的生命值(例如75%)是HP,它将改变框架

下面是墙的代码:

protected function checkFrame()
        {
            if (Math.abs(this.currentDamageCounter) >= this.healthPrFrame)
            {
                if (this.currentDamageCounter > 0)
                {
                    trace("Working");
                    nextFrame();
                    this.dispatchEvent(new HeatShockEvent(HeatShockEvent.DATA_OUT));
                    this.currentDamageCounter -=  this.healthPrFrame;
                }
                else
                {
                    this.prevFrame();
                    this.currentDamageCounter +=  this.healthPrFrame;
                }
                checkFrame();
            }
        }
“工作”被追踪

另外,如果我转到构造器中的第2帧:

    public function Wall()
    {
        this.gotoAndStop(2);
    }
这会有用的


提前感谢:)

什么是“nextFrame()”?什么是currentDamageCounter,什么是healtPrFrame?而且,我在任何地方都看不到任何百分比。我想你应该存储它的最大健康度,它的当前健康度,然后计算百分比。然后做不同百分比的事情