var bulletSpeed = 9; var bulletReady = true; var bulletDelay = 150; var bulletArray = []; var bulletCount = 0; var stars = 100; var maxSpeed = 16; var minSpeed = 2; for (var i = 0; i-50) { b._y -= bulletSpeed; } else { removeMovieClip(b); bulletArray.splice(i, 1); } if (!hit) { if(b.hitTest(ob)) { hit = true; ob.play(); removeMovieClip(b); bulletArray.splice(i, 1); } } } } var hit = false; var obSpeed = 2; function createObject(o) { ob = this.attachMovie(o, o, 100); ob._x = random(180)+20; } function resetObject() { ob._x = random(180)+20; ob._y = -40; ob.gotoAndStop(1); ob.restart = false; hit = false } function moveObject() { if (ob._y<250) { ob._y += obSpeed; } else { resetObject(); } if (ob.restart) { resetObject(); } } createObject("asteroid"); this.onEnterFrame = function(){ moveStars(); moveShip(); moveBullets(); moveObject(); for (var j = 0; j0) { mc._y -= mc.speed; }else { mc._y = Stage.height; mc.speed = random(maxSpeed-minSpeed)+minSpeed mc._x = random(Stage.width); } } };