Frame 2
function stageResize() {
solarSystem._x = Stage.width / 2;
solarSystem._y = Stage.height / 2;
background._width = Stage.width;
background._height = Stage.height;
background._x = Stage.width / 2;
background._y = Stage.height / 2;
}
var stageListener = new Object();
Stage.scaleMode = "noScale";
Stage.align = "tl";
Stage.addListener(stageListener);
stageListener.onResize = function () {
stageResize();
};
Color.prototype.setTint = function (r, g, b, amount) {
var _local2 = new Object();
_local2.ra = (_local2.ga = (_local2.ba = 100 - amount));
var _local3 = amount / 100;
_local2.rb = r * _local3;
_local2.gb = g * _local3;
_local2.bb = b * _local3;
this.setTransform(_local2);
};
Frame 4
stageResize();
stop();
Symbol 59 MovieClip [core] Frame 1
function acc(dir) {
if (dir == "down") {
if (_root.solarSystem.observer.rVelocity > 0) {
_root.solarSystem.observer.rVelocity = _root.solarSystem.observer.rVelocity - 3E-6;
} else {
clearInterval(accITVL);
_root.solarSystem.observer.rVelocity = 0;
}
} else if (dir == "up") {
if (_root.solarSystem.observer.rVelocity < 5E-5) {
_root.solarSystem.observer.rVelocity = _root.solarSystem.observer.rVelocity + 1E-6;
} else {
clearInterval(accITVL);
_root.solarSystem.observer.rVelocity = _root.solarSystem.observerInitRVelocity;
}
}
}
soronj = this._parent._name.split("_");
id = Number(soronj[1]);
this.onRollOver = function () {
if (_root.solarSystem.followingPlanet == false) {
_root.solarSystem.flashMapIcon(id);
clearInterval(accITVL);
accITVL = setInterval(this, "acc", 10, "down");
}
};
this.onRollOut = function () {
if (_root.solarSystem.followingPlanet == false) {
_root.solarSystem.unflashMapIcon(id);
_root.solarSystem.mouseMoveOn = true;
clearInterval(accITVL);
accITVL = setInterval(this, "acc", 10, "up");
}
};
this.onRelease = function () {
_root.solarSystem.gotoPlanet(id);
_root.solarSystem.unflashMapIcon(id);
};
Symbol 74 Button
on (release) {
getURL ("http://www.newgrounds.com", "blank");
}
Symbol 79 Button
on (release) {
_root.play();
}
Symbol 80 MovieClip Frame 1
_root.stop();
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded != 100) {
bar._xscale = PercentLoaded;
} else {
gotoAndStop ("loaded");
}
Symbol 80 MovieClip Frame 2
gotoAndPlay (1);
Symbol 88 MovieClip Frame 1
function slide(dir) {
if (dir == "down") {
if (_parent._y < (_parent.initY + 118)) {
_parent._y = _parent._y + ((((_parent.initY + 120) - _parent._y) / 10) + 1);
} else {
clearInterval(slideITVL);
icon._rotation = 180;
_parent._y = _parent.initY + 120;
}
} else if (_parent._y > (_parent.initY + 2)) {
_parent._y = _parent._y - (((_parent._y - _parent.initY) / 10) + 1);
} else {
clearInterval(slideITVL);
icon._rotation = 0;
_parent._y = _parent.initY;
}
}
this.onRelease = function () {
if (_parent.status == "hidden") {
_parent.status = "shown";
clearInterval(slideITVL);
slideITVL = setInterval(this, "slide", 10, "down");
} else {
_parent.status = "hidden";
clearInterval(slideITVL);
slideITVL = setInterval(this, "slide", 10, "up");
}
};
Symbol 96 MovieClip Frame 1
stop();
Symbol 96 MovieClip Frame 15
stop();
Symbol 100 MovieClip Frame 1
function buildMap() {
i = 1;
while (i < _parent.planets.length) {
orbitClip = this["o" + i];
orbitClip._width = (2 * _parent.planets[i].r) / _parent.mapScale;
orbitClip._height = orbitClip._width;
i++;
}
}
status = "hidden";
initY = this._y;
Symbol 119 MovieClip Frame 1
placeLocators = false;
timeFactor = 1;
sizeCat1 = 10;
sizeCat2 = 30;
sizeCat3 = 50;
mouseMoveOn = false;
mapScale = 20;
zOffset = 500;
parallaxOffset = 1000;
observerInitX = 0;
observerInitZ = 1100;
observerInitXAngle = -0.01;
observerInitVelocity = 0.3;
observerInitRVelocity = 5E-5;
galaxyRadius = 1200;
cumulusNumber = 6;
cumulusStarNumber = 100;
cumulusXSpreading = 1200;
cumulusYSpreading = 350;
starAlpha = 70;
minStarSize = 20;
maxStarSize = 60;
eclipseDisOffset = 15;
eclipseTopAlpha = 90;
flareReactionDistance = 250;
flareAperture = 0.5;
flareInclination = 5;
flareTopAlpha = 50;
flareAlphaFactor = 0.25;
flareTopScale = 250;
flareScaleFactor = 3;
glowTopScale = 300;
glowScaleFactor = 1.2;
followingPlanet = false;
timeMultiplyer = 1;
pi = Math.PI;
var mouseListener = new Object();
Mouse.addListener(mouseListener);
mouseListener.onMouseWheel = function (delta) {
observer.velocity = observer.velocity + (delta / 20);
};
this.onMouseMove = function () {
};
var rListener = new Object();
Key.addListener(rListener);
rListener.onKeyDown = function () {
if (Key.getCode() == 39) {
observer.X = observer.X + 10;
}
if (Key.getCode() == 37) {
observer.X = observer.X - 10;
}
if (Key.getCode() == 38) {
observer.yAngle = observer.yAngle - 0.05;
}
if (Key.getCode() == 40) {
observer.yAngle = observer.yAngle + 0.05;
}
if (Key.getCode() == 32) {
observer.velocity = 0;
}
if (Key.getCode() == 65) {
observer.velocity = observer.velocity + 0.1;
}
if (Key.getCode() == 90) {
observer.velocity = observer.velocity - 0.1;
}
if (Key.getCode() == 83) {
}
if (Key.getCode() == 88) {
}
if (Key.getCode() == 68) {
}
if (Key.getCode() == 67) {
}
if (Key.getCode() == 86) {
}
if (Key.getCode() == 81) {
if (mouseMoveOn) {
mouseMoveOn = false;
} else {
mouseMoveOn = true;
}
}
};
rListener.onKeyUp = function () {
};
function placeClip(obj) {
difX = observer.X - obj.X;
difZ = observer.Z - obj.Z;
obj.distanceToObserver = Math.sqrt((difX * difX) + (difZ * difZ));
obj.xAngle = Math.atan(difX / difZ);
obj.difZ = difZ;
difX = ((difZ / Math.abs(difZ)) * obj.distanceToObserver) * Math.sin(observer.xAngle + obj.xAngle);
difZ = ((difZ / Math.abs(difZ)) * obj.distanceToObserver) * Math.cos(observer.xAngle + obj.xAngle);
parallaxMultiplyer = parallaxOffset / difZ;
obj.clip._x = (-difX) * parallaxMultiplyer;
if (((difZ > minDifZ) && ((obj.clip._x - (obj.clip._xscale / 2)) < (background._width / 2))) && ((obj.clip._x + (obj.clip._xscale / 2)) > ((-background._width) / 2))) {
magnitudeMultiplyer = zOffset / difZ;
obj.clip._visible = true;
obj.clip._xscale = obj.scale * magnitudeMultiplyer;
obj.clip._yscale = obj.clip._xscale;
obj.clip.swapDepths(Math.round(10000 - obj.distanceToObserver));
} else {
obj.clip._visible = false;
}
}
minDifZ = 1;
var observer = new Object();
observer.X = observerInitX;
observer.Z = observerInitZ;
observer.vX = 0;
observer.vZ = 0;
observer.xAngle = observerInitXAngle;
observer.zAngle = observerInitZAngle;
observer.velocity = observerInitVelocity;
observer.rVelocity = observerInitRVelocity;
function observerMotion() {
if (mouseMoveOn) {
observer.xAngle = observer.xAngle + (this._xmouse * observer.rVelocity);
}
observer.vX = observer.velocity * Math.sin(observer.xAngle);
observer.vZ = (-observer.velocity) * Math.cos(observer.xAngle);
observer.X = observer.X + observer.vX;
observer.Z = observer.Z + observer.vZ;
moveStars();
}
function startAngleFollow(id, type) {
mouseMoveOn = false;
followCounter = 0;
clearInterval(angleFollowITVL);
angleFollowITVL = setInterval(this, "angleFollow", 10, id, type);
}
function endAngleFollow() {
clearInterval(angleFollowITVL);
mouseMoveOn = true;
}
function angleFollow(id, type) {
if (type != "permanent") {
followCounter++;
}
if ((Math.abs(planets[id].clip._x) > 5) || (followCounter < 25)) {
observer.xAngle = observer.xAngle + (planets[id].clip._x / 20000);
} else {
endAngleFollow();
}
}
followCounter = 0;
function gotoPlanet(id) {
followingPlanet = true;
clearInterval(gotoITVL);
gotoITVL = setInterval(this, "goto", 10, id);
endAngleFollow();
startAngleFollow(id, "permanent");
}
function goto(id) {
if (planets[id].clip._xscale < 150) {
observer.velocity = observer.velocity + (Math.abs(planets[id].difZ) / 5000);
} else {
observer.velocity = 0;
clearInterval(gotoITVL);
}
}
function loadPlanet(name, clipName, scale, vR, gamma, r, axisInclination) {
box.createEmptyMovieClip((clipName + "_") + planetNextClip, planetNextClip);
clip = box[(clipName + "_") + planetNextClip];
clip._quality = "HIGH";
planetNextClip++;
clip.attachMovie(clipName, "planet", 1);
clip.planet._rotation = axisInclination;
clip.attachMovie("core", "core", 200);
clip.core._alpha = 0;
clip.attachMovie("eclipser", "eclipser", 0);
clip.eclipser._visible = false;
if (name == "Saturno") {
clip.attachMovie("rings", "rings", 170);
clip.eclipser._visible = false;
}
if (name != "Sol") {
clip.attachMovie("contour", "contour", 150);
clip.attachMovie("sombraMask", "sombraPositivaMask", 21);
clip.attachMovie("sombraPositiva", "sombraPositiva", 20);
clip.sombraPositiva.setMask(clip.sombraPositivaMask);
clip.attachMovie("sombraMask", "sombraNegativaMask", 11);
clip.attachMovie("sombraNegativa", "sombraNegativa", 10);
clip.sombraNegativa.setMask(clip.sombraNegativaMask);
}
if (placeLocators) {
clip.attachMovie("locator", "locator", 500);
clip.locator._xscale = 50000 / scale;
clip.locator._yscale = clip.locator._xscale;
clip.locator.labelTT.text = name;
}
if (planets.length == 0) {
id = 0;
} else {
id = planets.length;
}
planets.push({id:id, name:name, clip:clip, X:0, Z:0, scale:scale, vR:vR, gamma:gamma, r:r, distanceToObserver:0, axisInclination:axisInclination});
placeClip(planets[planets.length - 1]);
}
planetNextClip = 0;
planets = [];
function placePlanets() {
i = 0;
while (i < planets.length) {
placeClip(planets[i]);
i++;
}
}
function planetaryMotion() {
map.observer._x = observer.X / mapScale;
map.observer._y = observer.Z / mapScale;
map.observer._rotation = (observer.xAngle * 180) / pi;
map.speed.text = Math.round(observer.velocity) + (0.1 * Math.round((10 * observer.velocity) % 10));
i = 1;
while (i < planets.length) {
planets[i].gamma = planets[i].gamma + (planets[i].vR * timeMultiplyer);
planets[i].X = planets[i].r * Math.cos(planets[i].gamma);
planets[i].Z = planets[i].r * Math.sin(planets[i].gamma);
clipIcon = map["p" + i];
clipIcon._x = planets[i].X / mapScale;
clipIcon._y = planets[i].Z / mapScale;
i++;
}
placePlanets();
}
function loadStar(position) {
box.createEmptyMovieClip("cumulus_" + starNextClip, -99999 - starNextClip);
cumulus = box["cumulus_" + starNextClip];
starNextClip++;
i = 0;
while (i < cumulusStarNumber) {
cumulus.attachMovie("star", "star_" + i, i);
clip = cumulus["star_" + i];
clip._x = ((0.5 * cumulusXSpreading) * Math.random()) - ((0.5 * cumulusXSpreading) * Math.random());
clip._y = ((0.5 * cumulusYSpreading) * Math.random()) - ((0.5 * cumulusYSpreading) * Math.random());
clip._xscale = minStarSize + ((maxStarSize - minStarSize) * Math.random());
clip._yscale = clip._xscale;
clip._alpha = starAlpha;
starColorer = new Color(clip);
r = Math.round(255 * Math.random());
g = Math.round(255 * Math.random());
b = Math.round(255 * Math.random());
starColorer.setTint(r, g, b, 25);
i++;
}
gamma = position;
stars.push({clip:cumulus, gamma:gamma});
}
starNextClip = 0;
stars = [];
function loadStarfield(amount) {
angleOffset = (2 * pi) / amount;
j = 0;
while (j < amount) {
loadStar(j * angleOffset);
j++;
}
moveStars();
}
function moveStars() {
s = 0;
while (s < stars.length) {
stars[s].clip._x = galaxyRadius * Math.cos(stars[s].gamma - observer.xAngle);
Z = galaxyRadius * Math.sin(stars[s].gamma - observer.xAngle);
if (Z < 0) {
stars[s].clip._visible = true;
} else {
stars[s].clip._visible = false;
}
s++;
}
}
function lightEffects() {
i = 1;
while (i < planets.length) {
shadows(planets[i]);
eclipse(planets[i]);
i++;
}
lensFlare();
}
function eclipse(obj) {
if ((obj.clip.core.hitTest(planets[0].clip.planet.luz) && (obj.clip._xscale > planets[0].clip._xscale)) && (obj.clip._visible == true)) {
obj.clip.eclipser._visible = true;
difX = planets[0].clip._x - obj.clip._x;
obj.clip.eclipser._x = (eclipseDisOffset * difX) / obj.clip._xscale;
obj.clip.eclipser._alpha = eclipseTopAlpha - Math.abs((180 * difX) / obj.clip._xscale);
flare._alpha = 100 - obj.clip.eclipser._alpha;
} else {
obj.clip.eclipser._visible = false;
}
}
function lensFlare() {
flare._x = planets[0].clip._x;
sunGlow._x = flare._x;
if ((Math.abs(planets[0].clip._x) < flareReactionDistance) && (planets[0].clip._visible)) {
flare._visible = true;
sunGlow._visible = true;
sunGlow._alpha = 100000 / Math.abs(planets[0].difZ);
sunGlow._xscale = glowTopScale - (Math.abs(flare._x) * glowScaleFactor);
sunGlow._yscale = sunGlow._xscale;
sunGlow.radials._rotation = flare._x;
flare.halo._xscale = flareTopScale - (Math.abs(flare._x) * flareScaleFactor);
flare.halo._yscale = flare.halo._xscale;
flare.halo._alpha = flareTopAlpha - (Math.abs(flare._x) * flareAlphaFactor);
i = 1;
while (i < 10) {
clip = flare.halo[i];
clip._x = ((-flare._x) * i) * flareAperture;
clip._y = (-i) * flareInclination;
i++;
}
} else {
flare._visible = false;
sunGlow._visible = false;
}
}
function shadows(obj) {
if (obj.clip.hitTest(background)) {
obj.clip.sombraNegativa._x = ((obj.difZ / Math.abs(obj.difZ)) * Math.sin((obj.gamma + (pi / 2)) + obj.xAngle)) * 50;
obj.clip.sombraNegativa._alpha = ((obj.difZ / Math.abs(obj.difZ)) * Math.cos((obj.gamma + ((3 * pi) / 2)) + obj.xAngle)) * 100;
obj.clip.sombraPositiva._x = -obj.clip.sombraNegativa._x;
obj.clip.sombraPositiva._alpha = 100 - obj.clip.sombraNegativa._alpha;
if (obj.id == 6) {
obj.clip.rings._rotation = obj.axisInclination;
obj.clip.rings.disc._yscale = 15;
}
}
}
function flashMapIcon(id) {
clip = map["p" + id];
clip.gotoAndPlay(2);
}
function unflashMapIcon(id) {
clip = map["p" + id];
clip.gotoAndPlay(1);
}
function chopAngle(angle) {
if (angle <= (2 * pi)) {
return(angle);
}
return(chopAngle(angle - (2 * pi)));
}
Symbol 119 MovieClip Frame 2
loadStarfield(cumulusNumber);
loadPlanet("Sol", "Sol", 6.96 + sizeCat3, 0, 0, 0, 0);
loadPlanet("Mercurio", "Mercurio", 2.42 + sizeCat1, (-timeFactor) / 87.97, (2 * pi) * Math.random(), 40, 180 * Math.random());
loadPlanet("Venus", "Venus", 6.085 + sizeCat1, (-timeFactor) / 224.7, (2 * pi) * Math.random(), 120, 180 * Math.random());
loadPlanet("Tierra", "Tierra", 6.738 + sizeCat1, (-timeFactor) / 365.3, (2 * pi) * Math.random(), 170, 23);
loadPlanet("Marte", "Marte", 3.375 + sizeCat1, (-timeFactor) / 687, (2 * pi) * Math.random(), 250, 180 * Math.random());
loadPlanet("Jupiter", "Jupiter", 7.14 + sizeCat2, (-timeFactor) / 4328.9, (2 * pi) * Math.random(), 380, 180 * Math.random());
loadPlanet("Saturno", "Saturno", 6.04 + sizeCat2, (-timeFactor) / 10752.9, (pi / 2) + 0.5, 500, 180 * Math.random());
loadPlanet("Urano", "Urano", 2.36 + sizeCat2, (-timeFactor) / 30667.3, (2 * pi) * Math.random(), 650, 180 * Math.random());
loadPlanet("Neptuno", "Neptuno", 2.23 + sizeCat2, (-timeFactor) / 60152, (2 * pi) * Math.random(), 800, 180 * Math.random());
loadPlanet("Pluton", "Pluton", 3 + sizeCat1, (-timeFactor) / 90520, pi / 2, 980, 0);
map.buildMap();
Symbol 119 MovieClip Frame 3
planetaryMotionITVL = setInterval(this, "planetaryMotion", 24);
observerMotionITVL = setInterval(this, "observerMotion", 24);
lightEffectsITVL = setInterval(this, "lightEffects", 24);
stop();