Frame 1
function move() {
if (gaz) {
gravity = gravityConstant / getDistanceSquared();
angle = getAngle();
accelX = gravity * Math.cos(angle);
accelY = (-gravity) * Math.sin(angle);
velX = velX + accelX;
velY = velY + accelY;
planet._x = planet._x + velX;
planet._y = planet._y + velY;
}
}
function getAngle() {
var dx = (star._x - planet._x);
var dy = (star._y - planet._y);
return(Math.atan2(-dy, dx));
}
function getDistanceSquared() {
var dx = (star._x - planet._x);
var dy = (star._y - planet._y);
return((dy * dy) + (dx * dx));
}
function coord_null() {
velX = 0;
velY = 0;
accelX = 0;
accelY = 0;
angle = 0;
gravity = 0;
}
function clone_particle() {
attachMovie("particle", "particle" + level, level);
_root["particle" + level]._x = int(planet._x);
_root["particle" + level]._y = int(planet._y);
_root["particle" + level]._rotation = int((planet._rotation + random(90)) - 45);
level++;
}
function kometa_rotate() {
x = random(10) + -5;
if (x == 0) {
x = 5;
}
return(x);
}
function fps_func() {
thisTimer = getTimer();
if ((thisTimer - startTimer) >= 1000) {
fps = fpscounter;
fpscounter = 0;
startTimer = getTimer();
} else {
fpscounter++;
}
return(fps);
}
gaz = true;
gravityConstant = 13000;
kometa_rotate_var = kometa_rotate();
info_panel._visible = false;
lcu_on = false;
velX = 5;
velY = 5;
fps = 50;
startTimer = getTimer();
fps_func();
plx = 200;
ply = 200;
stx = Stage.width / 2;
sty = Stage.height / 2;
onEnterFrame = function () {
if (gaz) {
move();
clone_particle();
fon.useHandCursor = false;
planet.useHandCursor = false;
star.useHandCursor = false;
} else {
fon.useHandCursor = true;
planet.useHandCursor = true;
star.useHandCursor = true;
if (fon.r_over == true) {
start_xmouse = _root._xmouse;
start_ymouse = _root._ymouse;
}
}
if (drg1 == true) {
plx = Math.floor(planet._x);
ply = Math.floor(planet._y);
}
if (drg2 == true) {
stx = Math.floor(star._x);
sty = Math.floor(star._y);
}
if (lcu_on == false) {
lineStyle(1, 7833753, 20);
if (draw) {
lineTo(planet._x, planet._y);
}
moveTo(planet._x, planet._y);
}
LCU = function () {
clear();
lineStyle(1, 7833753, 20);
moveTo(planet._x, planet._y);
lineTo(_xmouse, _ymouse);
};
if (lcu_on == true) {
LCU();
}
if ((lcu_on == true) and (fon.r_over == false)) {
clear();
}
if (gaz == false) {
dist_x_curs = _xmouse - planet._x;
dist_y_curs = _ymouse - planet._y;
planet_dist = Math.sqrt((dist_x_curs * dist_x_curs) + (dist_y_curs * dist_y_curs));
ang_x_curs = planet._x - _xmouse;
ang_y_curs = planet._y - _ymouse;
planet_curs = ((-Math.atan2(ang_x_curs, ang_y_curs)) / (Math.PI/180)) - 90;
x_velocity = Math.cos((planet_curs * Math.PI) / 180) * (planet_dist / 50);
y_velocity = Math.sin((planet_curs * Math.PI) / 180) * (planet_dist / 50);
}
if (info_panel._visible == true) {
info = (((((((((((((((((((((((((((((((((((("start_impulse=" + (Math.round((planet_dist / 50) * 100) / 100)) + "<br>") + "speed_x=") + velX) + "<br>") + "speed_y=") + velY) + "<br>") + "gravity=") + gravity) + "<br>") + "distance=") + Math.sqrt(getDistanceSquared())) + "<br>") + "angle=") + (getAngle() / (Math.PI/180))) + "<br>") + "star_x=") + Math.floor(star._x)) + "<br>") + "star_y=") + Math.floor(star._y)) + "<br>") + "comet_x=") + Math.floor(planet._x)) + "<br>") + "comet_y=") + Math.floor(planet._y)) + "<br>") + "mouse_x=") + Math.floor(start_xmouse)) + "<br>") + "mouse_y=") + Math.floor(start_ymouse)) + "<br>") + "fps=") + fps_func();
}
};
Instance of Symbol 5 MovieClip "fon" in Frame 1
on (release) {
if (_root.gaz == false) {
_root.velX = _root.x_velocity;
_root.velY = _root.y_velocity;
_root.gaz = true;
_root.lcu_on = false;
_root.clear();
}
}
on (rollOver) {
r_over = true;
}
on (rollOut) {
r_over = false;
}
Instance of Symbol 14 MovieClip "planet" in Frame 1
on (press, dragOver) {
if (_root.gaz == false) {
startDrag ("");
_root.drg1 = true;
}
}
on (release, releaseOutside, dragOut) {
stopDrag();
_root.drg1 = false;
}
Instance of Symbol 16 MovieClip "star" in Frame 1
on (press, dragOver) {
if (_root.gaz == false) {
startDrag ("");
_root.drg2 = true;
}
}
on (release, releaseOutside, dragOut) {
stopDrag();
_root.drg2 = false;
}
Symbol 3 MovieClip [particle] Frame 17
this.removeMovieClip();
Symbol 10 MovieClip Frame 1
stop();
Instance of Symbol 13 MovieClip in Symbol 14 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.gaz) {
this._rotation = this._rotation + _root.kometa_rotate_var;
}
}
Symbol 16 MovieClip Frame 1
i = 1;
while (i <= 20) {
duplicateMovieClip ("star_particle", "particle" + i, i + 1);
i++;
i++;
}
Instance of Symbol 15 MovieClip "star_particle" in Symbol 16 MovieClip Frame 1
onClipEvent (load) {
xx = -20;
yy = -20;
speed = 50;
}
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
targetx = (random(20) + xx) + 10;
targety = (random(20) + yy) + 10;
}
_x = (_x + ((targetx - _x) / speed));
_y = (_y + ((targety - _y) / speed));
}
Symbol 17 Button
on (release) {
if (info_panel._visible == false) {
info_panel._visible = true;
} else {
info_panel._visible = false;
}
}
on (rollOver) {
info_text_color = new Color(_root.info_text);
info_text_color.setRGB(7833753);
}
on (rollOut) {
if (info_panel._visible == true) {
info_text_color.setRGB(7833753);
} else {
info_text_color.setRGB(16777215);
}
}
Symbol 18 Button
on (release) {
if (_root.draw == true) {
_root.draw = false;
_root.clear();
} else {
_root.draw = true;
}
}
on (rollOver) {
line_text_color = new Color(_root.line_text);
line_text_color.setRGB(7833753);
}
on (rollOut) {
if (_root.draw == true) {
line_text_color.setRGB(7833753);
} else {
line_text_color.setRGB(16777215);
}
}
Symbol 19 Button
on (release) {
_root.planet._x = _root.plx;
_root.planet._y = _root.ply;
_root.star._x = _root.stx;
_root.star._y = _root.sty;
_root.kometa_rotate_var = _root.kometa_rotate();
_root.gaz = false;
_root.coord_null();
_root.tip1._x = _root.planet._x - 30;
_root.tip1._y = _root.planet._y;
_root.tip1.gotoAndPlay(1);
_root.lcu_on = true;
}
on (rollOver) {
reset_text_color = new Color(_root.reset_text);
reset_text_color.setRGB(7833753);
}
on (rollOut) {
reset_text_color.setRGB(16777215);
}
Symbol 20 Button
on (release) {
fscommand ("quit", true);
}
on (rollOver) {
exit_text_color = new Color(_root.exit_text);
exit_text_color.setRGB(7833753);
}
on (rollOut) {
exit_text_color.setRGB(16777215);
}