我一直得到这个错误代码我是动作脚本的新手,我试图让多个物体从右向左移动。如果我采取错误的方法,任何建议都会很棒。
public class MainGame extends MovieClip
{
private var enemy_startx = 600;
private var enemy_starty = Math.floor(Math.random() * (1 + 400 - 1)) + 1;
private var enemy:Timer = new Timer(200);
public function startGame()
{
enemy.addEventListener(TimerEvent.TIMER,enemyHandler);
enemy.start();
}
private function enemyHandler(event:TimerEvent):void
{
var speed = 15;
this.x = enemy_startx;
this.y = enemy_starty;
enemy_startx = enemy_startx + speed;
}
}