对于学校,我正在为移动设备创建一个基本的 AS3 游戏,基本上你需要知道的是我需要一个舞台宽度的矩形(380)(高度无关紧要)然后在几秒钟后生成顶部另一个产生,这个过程无限重复,直到另有说明。我还没有做太多,所以我没有太多代码要显示,但如果有人能告诉我如何将不胜感激。
我有向下的运动,只是没有产卵
var rectangle:Shape = new Shape;
var RecTimer:Timer = new Timer(10,10000);
RecTimer.addEventListener(TimerEvent.TIMER, fRecMovement);
RecTimer.start()
function fRecMovement (e:TimerEvent):void {
rectangle.graphics.beginFill(0xFF0000); // choosing the colour for the fill, here it is red
rectangle.graphics.drawRect(0, 0, 480,45.49); // (x spacing, y spacing, width, height)
rectangle.graphics.endFill();
addChild(rectangle); // adds the rectangle to the stage
rectangle.y +=1
}