ActionScript Code:
//
//
function makeAsteroid(name, depth){
with(this){
var ast = createEmptyMovieClip(name, depth);
ast.lineStyle(100, Math.random()*0xFFFFFF);
ast.lineTo(.5, 0);
ast._x = 275;
ast._y = 200;
ast.xStep = Math.random()*5;
ast.yStep = Math.random()*5;
ast.onEnterFrame = drift;
}
}
function drift (){
with(this){
_x += xStep;
_y += yStep;
if(_x>550){
_x -= 550;
}else if(_x<0){
_x += 550;
}
if(_y>400){
_y -= 400;
}else if(_y<0){
_y += 400;
}
}
}
for(var i=1; i<6; i++){
makeAsteroid("Asteroid"+i, i)
}
lineStyle(0);
lineTo(550, 0);
lineTo(550, 400);
lineTo(0, 400);
lineTo(0, 0);
moveTo(50, 50);
lineTo(500, 50);
lineTo(500, 350);
lineTo(50, 350);
lineTo(50, 50);
//
//
-PiXELWiT
http://www.pixelwit.com