Alright.
_root.createEmptyMovieClip("screen_mc", 1);
with (screen_mc) {
moveTo(0, 0);
lineStyle(0, 000000, 100);
beginFill(000000);
lineTo(0, 400);
lineTo(550, 400);
lineTo(550, 0);
lineTo(0, 0);
endFill();
}
This makes the black background.
_root.createEmptyMovieClip("star_mc", 2);
with (star_mc) {
lineStyle(0, 0xFFFFFF, 100);
beginFill(0xFFFFFF);
moveTo(0, 0);
lineTo(1, 0);
lineTo(1, 1);
lineTo(0, 1);
lineTo(0, 0);
endFill();
}
This makes one star.
inc = 1;
Sets the speed of movement.
for (i=1; i<250; i++) {
duplicateMovieClip(star_mc, "star_mc"+i, 2+i);
_root["star_mc"+i]._x = random(550);
_root["star_mc"+i]._y = random(400);
_root["star_mc"+i]._xscale = _root["star_mc"+i]._yscale=random(200);
_root["star_mc"+i]._alpha = random(50)+50;
}
Duplicates the movie clip 250 times, and gives each star a random x and y position, a random size, and a random brightness.
createEmptyMovieClip("text_mc", 300);
with (text_mc) {
moveTo(0, 0);
lineStyle(0, 000000, 100);
beginFill(0x27D341);
lineTo(25, 0);
lineTo(25, 20);
lineTo(0, 20);
lineTo(0, 0);
endFill();
Makes the reset button.
_root["text_mc"].onPress = function() {
for (i=1; i<250; i++) {
_root["star_mc"+i]._x = random(550);
_root["star_mc"+i]._y = random(400);
}
};
Makes it so that each star has a random position when the button is pressed.
}
_root.onEnterFrame = function() {
if (Key.isDown(Key.LEFT)) {
if (inc>0) {
inc--;
}
Lowers the speed.
} else if (Key.isDown(Key.RIGHT)) {
inc++;
}
Raises the speed.
for (i=1; i<250; i++) {
_root["star_mc"+i]._y += inc;
if (_root["star_mc"+i]._y>=400) {
_root["star_mc"+i]._y = 0;
}
}
If a star gets to the bottom of the stage, it goes back to the top.
if (Key.isDown(Key.ENTER)) {
for (i=1; i<250; i++) {
_root["star_mc"+i]._x = random(550);
_root["star_mc"+i]._y = random(400);
}
}
Resets when enter is pressed, like reset button.
};