Frame 1 (33 B)
Stage.showMenu = false;
stop();
Frame 5 (35 B)
stop();
Name = "Newgrounds User";
Instance of Symbol 23 MovieClip [asteroid] "ast2" in Frame 5 (577 B)
onClipEvent (load) {
asteroiddirection = Math.random() * 360;
asteroidspeed = (Math.random() * 4) + 1;
radians = (Math.PI/180);
update = 0;
}
onClipEvent (enterFrame) {
if (update == 0) {
this._x = this._x + (Math.sin(asteroiddirection * radians) * asteroidspeed);
this._y = this._y + (Math.cos(asteroiddirection * radians) * asteroidspeed);
if (this._x > 512) {
this._x = 0;
}
if (this._x < 0) {
this._x = 512;
}
if (this._y > 448) {
this._y = 0;
}
if (this._y < 0) {
this._y = 448;
}
update = 1;
} else {
update = 0;
}
}
Instance of Symbol 23 MovieClip [asteroid] "ast1" in Frame 5 (577 B)
onClipEvent (load) {
asteroiddirection = Math.random() * 360;
asteroidspeed = (Math.random() * 4) + 1;
radians = (Math.PI/180);
update = 0;
}
onClipEvent (enterFrame) {
if (update == 0) {
this._x = this._x + (Math.sin(asteroiddirection * radians) * asteroidspeed);
this._y = this._y + (Math.cos(asteroiddirection * radians) * asteroidspeed);
if (this._x > 512) {
this._x = 0;
}
if (this._x < 0) {
this._x = 512;
}
if (this._y > 448) {
this._y = 0;
}
if (this._y < 0) {
this._y = 448;
}
update = 1;
} else {
update = 0;
}
}
Instance of Symbol 23 MovieClip [asteroid] "ast3" in Frame 5 (577 B)
onClipEvent (load) {
asteroiddirection = Math.random() * 360;
asteroidspeed = (Math.random() * 4) + 1;
radians = (Math.PI/180);
update = 0;
}
onClipEvent (enterFrame) {
if (update == 0) {
this._x = this._x + (Math.sin(asteroiddirection * radians) * asteroidspeed);
this._y = this._y + (Math.cos(asteroiddirection * radians) * asteroidspeed);
if (this._x > 512) {
this._x = 0;
}
if (this._x < 0) {
this._x = 512;
}
if (this._y > 448) {
this._y = 0;
}
if (this._y < 0) {
this._y = 448;
}
update = 1;
} else {
update = 0;
}
}
Frame 11 (2.39 KiB) ●
function ExplodeAsteroid(i, ast) {
if (ast._xscale > 25) {
if (ast._xscale == 100) {
score = score + 20;
} else if (ast._xscale == 50) {
score = score + 50;
}
ast._xscale = ast._xscale / 2;
ast._yscale = ast._yscale / 2;
asteroidspeed[i] = 0;
_root.attachMovie("asteroid", "asteroid" + asteroids, asteroids);
asteroiddirection[asteroids] = Math.random() * 360;
asteroidspeed[asteroids] = (Math.random() * 7) + 1;
asteroidexplode[asteroids] = false;
eval ("asteroid" + asteroids)._x = ast._x + (Math.random() * 10);
eval ("asteroid" + asteroids)._y = ast._y + (Math.random() * 10);
eval ("asteroid" + asteroids)._xscale = ast._xscale;
eval ("asteroid" + asteroids)._yscale = ast._yscale;
asteroids++;
_root.attachMovie("asteroid", "asteroid" + asteroids, asteroids);
asteroiddirection[asteroids] = Math.random() * 360;
asteroidspeed[asteroids] = (Math.random() * 7) + 1;
asteroidexplode[asteroids] = false;
eval ("asteroid" + asteroids)._x = ast._x + (Math.random() * 10);
eval ("asteroid" + asteroids)._y = ast._y + (Math.random() * 10);
eval ("asteroid" + asteroids)._xscale = ast._xscale;
eval ("asteroid" + asteroids)._yscale = ast._yscale;
asteroids++;
} else {
score = score + 100;
}
ast.gotoAndPlay(2);
asteroidexplode[i] = true;
bgsound = 1;
}
level = 1;
update = 0;
shield._visible = false;
bullets = new Array(false, false, false, false);
bulletx = new Array(0, 0, 0, 0);
bullety = new Array(0, 0, 0, 0);
bulletxtrax = new Array(0, 0, 0, 0);
bulletxtray = new Array(0, 0, 0, 0);
bullettime = new Array(0, 0, 0, 0);
collision = false;
score = 0;
asteroidsremaining = 0;
lives = 3;
gameover = false;
radians = (Math.PI/180);
asteroids = level;
asteroiddirection = new Array();
asteroidspeed = new Array();
asteroidexplode = new Array();
var i = 0;
while (i < asteroids) {
_root.attachMovie("asteroid", "asteroid" + i, i);
asteroiddirection[i] = Math.random() * 360;
asteroidspeed[i] = (Math.random() * 7) + 1;
asteroidexplode[i] = false;
eval ("asteroid" + i)._x = Math.random() * 512;
eval ("asteroid" + i)._y = Math.sqrt(50176 - (eval ("asteroid" + i)._x ^ 2)) + 224;
i++;
}
bulletsfx = new Sound();
bulletsfx.attachSound("shoot");
backgroundsfx1 = new Sound();
backgroundsfx1.attachSound("bip");
backgroundsfx2 = new Sound();
backgroundsfx2.attachSound("bop");
bgsound = 10;
bgsoundselect = 0;
Instance of Symbol 52 MovieClip "shield" in Frame 11 (320 B)
onClipEvent (load) {
timer = 50;
}
onClipEvent (enterFrame) {
if (_root.ship.shieldon == true) {
this._x = _root.ship._x;
this._y = _root.ship._y;
timer = timer - 0.1;
if (timer < 0) {
timer = 0;
_root.ship.shieldon = false;
timer = 50;
}
} else {
this._x = -100;
this._visible = false;
}
}
Instance of Symbol 95 MovieClip "ship" in Frame 11 (3.13 KiB) ●
onClipEvent (load) {
topspeed = 10;
rotate = 0;
keydownright = false;
keydownleft = false;
keydownup = false;
keydowndown = false;
keydownfire = false;
momentumx = 0;
momentumy = 0;
teleported = false;
fired = false;
dead = false;
radians = (Math.PI/180);
}
onClipEvent (keyDown) {
if (Key.getCode() == 39) {
keydownright = true;
}
if (Key.getCode() == 37) {
keydownleft = true;
}
if (Key.getCode() == 38) {
keydownup = true;
if (dead == false) {
gotoAndStop (12);
}
}
if (Key.getCode() == 40) {
keydowndown = true;
}
if (Key.getCode() == 90) {
keydownfire = true;
}
}
onClipEvent (keyUp) {
if (Key.getCode() == 39) {
keydownright = false;
}
if (Key.getCode() == 37) {
keydownleft = false;
}
if (Key.getCode() == 38) {
keydownup = false;
if (dead == false) {
gotoAndStop (11);
}
}
if (Key.getCode() == 40) {
keydowndown = false;
teleported = false;
}
if (Key.getCode() == 90) {
keydownfire = false;
fired = false;
}
}
onClipEvent (enterFrame) {
this._x = this._x + momentumx;
this._y = this._y - momentumy;
this._rotation = rotate;
if (this._x > 512) {
this._x = 0;
}
if (this._x < 0) {
this._x = 512;
}
if (this._y > 448) {
this._y = 0;
}
if (this._y < 0) {
this._y = 448;
}
if (keydownright && (dead == false)) {
rotate = rotate + 8;
if (rotate > 360) {
rotate = rotate - 360;
}
}
if (keydownleft && (dead == false)) {
rotate = rotate - 8;
if (rotate < -360) {
rotate = rotate + 360;
}
}
if (keydownup && (dead == false)) {
momentumx = momentumx + (Math.sin(rotate * radians) / 8);
momentumy = momentumy + (Math.cos(rotate * radians) / 8);
if (momentumx > topspeed) {
momentumx = topspeed;
}
if (momentumx < (-topspeed)) {
momentumx = -topspeed;
}
if (momentumy > topspeed) {
momentumy = topspeed;
}
if (momentumy < (-topspeed)) {
momentumy = -topspeed;
}
}
if ((keydowndown && (teleported == false)) && (dead == false)) {
this._y = Math.random() * 448;
this._x = Math.random() * 512;
teleported = true;
momentumx = 0;
momentumy = 0;
}
if (((keydownfire == true) && (dead == false)) && (_root.gameover == false)) {
var i = 0;
while (i < _root.bullets.length) {
if ((_root.bullets[i] == false) && (fired == false)) {
eval ("_root.abullet" + i)._x = this._x;
eval ("_root.abullet" + i)._y = this._y;
eval ("_root.abullet" + i)._visible = true;
_root.bullets[i] = true;
_root.bulletx[i] = Math.sin(rotate * radians) * 16;
_root.bullety[i] = Math.cos(rotate * radians) * 16;
_root.bulletxtrax[i] = momentumx;
_root.bulletxtray[i] = momentumy;
_root.bullettime[i] = 31;
fired = true;
_root.bulletsfx.stop();
_root.bulletsfx.start();
}
i++;
}
}
var i = 0;
while (i < _root.bullets.length) {
if (_root.bullettime[i] > 0) {
_root.bullettime[i]--;
if (_root.bullettime[i] == 0) {
_root.bullets[i] = false;
eval ("_root.abullet" + i)._visible = false;
}
}
i++;
}
if (keydownup == false) {
momentumx = momentumx / 1.01;
momentumy = momentumy / 1.01;
}
}
Instance of Symbol 97 MovieClip "abullet0" in Frame 11 (530 B)
onClipEvent (enterFrame) {
if (_root.update == 1) {
var i = 0;
if (_root.bullets[i] == true) {
this._x = this._x + (_root.bulletx[i] + _root.bulletxtrax[i]);
this._y = this._y - (_root.bullety[i] + _root.bulletxtray[i]);
if (this._x > 512) {
this._x = 0;
}
if (this._x < 0) {
this._x = 512;
}
if (this._y > 448) {
this._y = 0;
}
if (this._y < 0) {
this._y = 448;
}
}
if ((_root.bullets[i] == false) && (this._visible)) {
this._visible = false;
}
}
}
Instance of Symbol 97 MovieClip "abullet2" in Frame 11 (530 B)
onClipEvent (enterFrame) {
if (_root.update == 1) {
var i = 2;
if (_root.bullets[i] == true) {
this._x = this._x + (_root.bulletx[i] + _root.bulletxtrax[i]);
this._y = this._y - (_root.bullety[i] + _root.bulletxtray[i]);
if (this._x > 512) {
this._x = 0;
}
if (this._x < 0) {
this._x = 512;
}
if (this._y > 448) {
this._y = 0;
}
if (this._y < 0) {
this._y = 448;
}
}
if ((_root.bullets[i] == false) && (this._visible)) {
this._visible = false;
}
}
}
Instance of Symbol 97 MovieClip "abullet1" in Frame 11 (530 B)
onClipEvent (enterFrame) {
if (_root.update == 0) {
var i = 1;
if (_root.bullets[i] == true) {
this._x = this._x + (_root.bulletx[i] + _root.bulletxtrax[i]);
this._y = this._y - (_root.bullety[i] + _root.bulletxtray[i]);
if (this._x > 512) {
this._x = 0;
}
if (this._x < 0) {
this._x = 512;
}
if (this._y > 448) {
this._y = 0;
}
if (this._y < 0) {
this._y = 448;
}
}
if ((_root.bullets[i] == false) && (this._visible)) {
this._visible = false;
}
}
}
Instance of Symbol 97 MovieClip "abullet3" in Frame 11 (530 B)
onClipEvent (enterFrame) {
if (_root.update == 0) {
var i = 3;
if (_root.bullets[i] == true) {
this._x = this._x + (_root.bulletx[i] + _root.bulletxtrax[i]);
this._y = this._y - (_root.bullety[i] + _root.bulletxtray[i]);
if (this._x > 512) {
this._x = 0;
}
if (this._x < 0) {
this._x = 512;
}
if (this._y > 448) {
this._y = 0;
}
if (this._y < 0) {
this._y = 448;
}
}
if ((_root.bullets[i] == false) && (this._visible)) {
this._visible = false;
}
}
}
Frame 12 (3.08 KiB) ●
if (update == 1) {
collision = false;
}
var i = update;
while (i < asteroids) {
ast = eval ("asteroid" + i);
if (ast) {
ast._x = ast._x + (Math.sin(asteroiddirection[i] * radians) * asteroidspeed[i]);
ast._y = ast._y + (Math.cos(asteroiddirection[i] * radians) * asteroidspeed[i]);
if (ast._x > 530) {
ast._x = -20;
}
if (ast._x < -20) {
ast._x = 530;
}
if (ast._y > 470) {
ast._y = -20;
}
if (ast._y < -20) {
ast._y = 470;
}
if (((ast.hitTest(ship) && (ship.dead == false)) && (asteroidexplode[i] == false)) && (ship.shieldon == false)) {
ship.gotoAndPlay(3);
ship.shieldon = true;
ExplodeAsteroid(i, ast);
ship.dead = true;
ship.momentumy = 0;
ship.momentumx = 0;
deadcount = 27;
lives--;
eval ("life" + lives).gotoAndStop(2);
if (lives < 0) {
gameover = true;
gameovercount = 100;
_root.attachMovie("gameover", "gameovermovie", asteroids);
gameovermovie._x = 256;
gameovermovie._y = _root._height / 2;
gameovermovie._width = 168;
gameovermovie._height = 19;
}
}
if ((ast.hitTest(ship) && (ship.dead == true)) && (asteroidexplode[i] == false)) {
collision = true;
}
var j = 0;
while (j < bullets.length) {
if ((ast.hitTest(eval ("abullet" + j)) && (bullets[j] == true)) && (asteroidexplode[i] == false)) {
ExplodeAsteroid(i, ast);
bullets[j] = false;
}
j++;
}
}
i = i + 2;
}
if (asteroidsremaining == asteroids) {
level++;
bullets = new Array(false, false, false, false);
bulletx = new Array(0, 0, 0, 0);
bullety = new Array(0, 0, 0, 0);
bulletxtrax = new Array(0, 0, 0, 0);
bulletxtray = new Array(0, 0, 0, 0);
bullettime = new Array(0, 0, 0, 0);
collision = false;
asteroidsremaining = 0;
asteroids = level;
asteroiddirection = new Array();
asteroidspeed = new Array();
asteroidexplode = new Array();
var i = 0;
while (i < asteroids) {
_root.attachMovie("asteroid", "asteroid" + i, i);
ast = eval ("asteroid" + i);
asteroiddirection[i] = Math.random() * 360;
asteroidspeed[i] = (Math.random() * 2) + 1;
asteroidexplode[i] = false;
ast._x = Math.random() * 512;
ast._y = Math.sqrt(50176 - (ast._x ^ 2)) + 224;
i++;
}
}
if (deadcount > 0) {
deadcount--;
if (deadcount == 0) {
ship.rotate = 0;
ship.momentumx = 0;
ship.momentumy = 0;
ship._y = 224;
ship._x = 256;
ship._visible = false;
}
}
if ((((collision == false) && (deadcount == 0)) && (ship.dead == true)) && (update == 1)) {
ship.dead = false;
ship._visible = true;
ship.gotoAndStop(1);
ship.keydownup = false;
shield._visible = true;
}
if (gameover == true) {
if (deadcount == 0) {
ship.gotoAndStop(26);
}
gameovercount--;
if (gameovercount == 0) {
gameovermovie.removeMovieClip();
var i = 0;
while (i < asteroids) {
eval ("asteroid" + i).removeMovieClip();
i++;
}
stop();
gotoAndStop ("Gameover");
}
}
if (update == 0) {
update = 1;
} else {
update = 0;
}
Instance of Symbol 95 MovieClip "ship" in Frame 12 (3.17 KiB) ●
onClipEvent (load) {
shieldon = false;
topspeed = 10;
rotate = 0;
keydownright = false;
keydownleft = false;
keydownup = false;
keydowndown = false;
keydownfire = false;
momentumx = 0;
momentumy = 0;
teleported = false;
fired = false;
dead = false;
radians = (Math.PI/180);
}
onClipEvent (keyDown) {
if (Key.getCode() == 39) {
keydownright = true;
}
if (Key.getCode() == 37) {
keydownleft = true;
}
if (Key.getCode() == 38) {
keydownup = true;
if (dead == false) {
this.gotoAndStop(2);
}
}
if (Key.getCode() == 40) {
keydowndown = true;
}
if (Key.getCode() == 90) {
keydownfire = true;
}
}
onClipEvent (keyUp) {
if (Key.getCode() == 39) {
keydownright = false;
}
if (Key.getCode() == 37) {
keydownleft = false;
}
if (Key.getCode() == 38) {
keydownup = false;
if (dead == false) {
this.gotoAndStop(1);
}
}
if (Key.getCode() == 40) {
keydowndown = false;
teleported = false;
}
if (Key.getCode() == 90) {
keydownfire = false;
fired = false;
}
}
onClipEvent (enterFrame) {
this._x = this._x + momentumx;
this._y = this._y - momentumy;
this._rotation = rotate;
if (this._x > 512) {
this._x = 0;
}
if (this._x < 0) {
this._x = 512;
}
if (this._y > 448) {
this._y = 0;
}
if (this._y < 0) {
this._y = 448;
}
if (keydownright && (dead == false)) {
rotate = rotate + 8;
if (rotate > 360) {
rotate = rotate - 360;
}
}
if (keydownleft && (dead == false)) {
rotate = rotate - 8;
if (rotate < -360) {
rotate = rotate + 360;
}
}
if (keydownup && (dead == false)) {
momentumx = momentumx + (Math.sin(rotate * radians) / 8);
momentumy = momentumy + (Math.cos(rotate * radians) / 8);
if (momentumx > topspeed) {
momentumx = topspeed;
}
if (momentumx < (-topspeed)) {
momentumx = -topspeed;
}
if (momentumy > topspeed) {
momentumy = topspeed;
}
if (momentumy < (-topspeed)) {
momentumy = -topspeed;
}
}
if ((keydowndown && (teleported == false)) && (dead == false)) {
this._y = Math.random() * 448;
this._x = Math.random() * 512;
teleported = true;
momentumx = 0;
momentumy = 0;
}
if (((keydownfire == true) && (dead == false)) && (_root.gameover == false)) {
var i = 0;
while (i < _root.bullets.length) {
if ((_root.bullets[i] == false) && (fired == false)) {
eval ("_root.abullet" + i)._x = this._x;
eval ("_root.abullet" + i)._y = this._y;
eval ("_root.abullet" + i)._visible = true;
eval ("_root.abullet" + i)._rotation = rotate;
_root.bullets[i] = true;
_root.bulletx[i] = Math.sin(rotate * radians) * 16;
_root.bullety[i] = Math.cos(rotate * radians) * 16;
_root.bulletxtrax[i] = momentumx;
_root.bulletxtray[i] = momentumy;
_root.bullettime[i] = 31;
fired = true;
_root.bulletsfx.start();
}
i++;
}
}
var i = 0;
while (i < _root.bullets.length) {
if (_root.bullettime[i] > 0) {
_root.bullettime[i]--;
if (_root.bullettime[i] == 0) {
_root.bullets[i] = false;
eval ("_root.abullet" + i)._visible = false;
}
}
i++;
}
if (keydownup == false) {
momentumx = momentumx / 1.01;
momentumy = momentumy / 1.01;
}
}
Frame 13 (18 B)
gotoAndPlay (12);
Frame 14 (248 B)
_root.mst.Name = _root.Name;
_root.mst.pass = _root.pass;
_root.mst.score = _root.score;
_root.mst.game = "Asteroids";
_root.mst.loadVariables("http://www.hairybullet.com/hosted/syndicatesdomain/pages/games/scores/submit.php", "GET");
stop();
Symbol 12 MovieClip Frame 1 (8 B)
stop();
Symbol 12 MovieClip Frame 2 (8 B)
stop();
Symbol 12 MovieClip Frame 3 (8 B)
stop();
Symbol 12 MovieClip Frame 4 (8 B)
stop();
Symbol 12 MovieClip Frame 5 (8 B)
stop();
Symbol 12 MovieClip Frame 6 (8 B)
stop();
Symbol 12 MovieClip Frame 7 (8 B)
stop();
Symbol 12 MovieClip Frame 8 (8 B)
stop();
Symbol 23 MovieClip [asteroid] Frame 1 (8 B)
stop();
Instance of Symbol 12 MovieClip in Symbol 23 MovieClip [asteroid] Frame 1 (147 B)
onClipEvent (load) {
speed = random(5) + 1;
this.gotoAndStop(random(9));
}
onClipEvent (enterFrame) {
this._rotation = this._rotation + speed;
}
Symbol 23 MovieClip [asteroid] Frame 15 (53 B)
_root.asteroidsremaining++;
this.removeMovieClip();
Symbol 34 MovieClip Frame 1 (190 B)
_root.stop();
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded != 100) {
setProperty(bar, _xscale , PercentLoaded);
} else {
_root.play();
}
Symbol 34 MovieClip Frame 2 (17 B)
gotoAndPlay (1);
Symbol 39 Button (44 B)
on (release) {
_root.gotoAndPlay("Game");
}
Symbol 46 Button (71 B)
on (release) {
getURL ("http://www.syndicatesdomain.co.uk", _blank);
}
Symbol 56 MovieClip Frame 1 (47 B)
if (random(100) == 10) {
gotoAndPlay (3);
}
Symbol 56 MovieClip Frame 2 (17 B)
gotoAndPlay (1);
Symbol 95 MovieClip Frame 1 (8 B)
stop();
Symbol 95 MovieClip Frame 2 (8 B)
stop();
Symbol 95 MovieClip Frame 3 (85 B)
maxspeed = 0;
_root.levelup = _root.levelup + 1;
_root.score1 = _root.score1 + 10;
Symbol 95 MovieClip Frame 25 (8 B)
stop();
Symbol 95 MovieClip Frame 26 (8 B)
stop();
Symbol 99 MovieClip Frame 1 (8 B)
stop();
Symbol 99 MovieClip Frame 2 (8 B)
stop();
Symbol 106 Button (45 B)
on (release) {
_root.gotoAndStop("Intro");
}