1
我想在我已經制作的Actionscript 3遊戲中限制我的子彈的射擊速度。任何幫助將非常感激。以下是我的代碼。在Actionscript 3遊戲中設置子彈的射擊速度
//shooting bullet
function shoot(Evt:MouseEvent)
{
var sound2 = new bullet_shoot();
sound2.play();
if (bulletCounter < 5)
{
bulletCounter++;
}
else
{
bulletCounter = 0;
}
shootmc(bulletArray[bulletCounter]);
}
function shootmc(mc:MovieClip)
{
mc.visible = true;
mc.x = spaceman_mc.x;
mc.y = spaceman_mc.y;
mc.gotoAndPlay(2);
}
更多的有用將比ENTER_FRAME setInterval,因爲事件取決於幀率 – turbosqel 2012-04-23 08:45:13