答案 0 :(得分:0)
这是一种简单的方法:
var timer:Timer = new Timer(1000);
timer.addEventListener(TimerEvent.TIMER, spawnMeteor);
timer.start();
function spawnMeteor(e:Event):void{
const SCREEN_WIDTH:Number = 480;
var randomX:Number = Math.random() * SCREEN_WIDTH;
var meteor:Meteor = new Meteor(randomX, -85);
world.add(meteor);
}