Combined Code
movieClip 2 {
}
movieClip 3 star1ID {
}
movieClip 5 spaceBeepID {
frame 1 {
stop();
}
}
movieClip 7 songID {
}
movieClip 9 {
}
movieClip 10 {
}
movieClip 12 {
}
movieClip 13 {
}
movieClip 15 {
}
movieClip 16 {
}
movieClip 18 {
}
movieClip 19 {
}
movieClip 21 {
}
movieClip 22 {
}
movieClip 24 {
}
movieClip 25 {
}
movieClip 27 {
}
movieClip 28 {
}
movieClip 32 {
}
movieClip 33 {
}
movieClip 37 {
}
movieClip 38 {
}
movieClip 42 {
}
movieClip 43 {
}
movieClip 47 {
}
movieClip 48 {
}
movieClip 49 m2ID {
frame 1 {
stop();
}
}
frame 1 {
_global.starChoice = 4;
m1Mass = 10;
distx = 0;
disty = 0;
distJx = 0;
distJy = 0;
tintFlux = 0;
dist = 0;
a = 0;
b = 0;
c = 0;
distJ = 0;
aJ = 0;
bJ = 0;
cJ = 0;
n = 0;
nn = 0;
s = 0;
ss = 0;
G = 200;
force = 0;
forceJ = 0;
dx = 0;
dy = 0;
i = 0;
j = 0;
cc = 0;
wPer = 0;
hPer = 0;
randMass = 0;
randPosx = 0;
randPosy = 0;
randx = 0;
randy = 0;
xx = 0;
yy = 0;
spawnBuffer = 0;
camBoundsLeft = 0;
camBoundsRight = 0;
camBoundsTop = 0;
camBoundsBot = 0;
oldPosx = 0;
oldPosy = 0;
newPosx = 0;
newPosy = 0;
v = 0;
timer = 0;
m2Array = new Array();
_root.attachMovie('songID', 'songMC', 1);
Mouse.hide();
m1._width = m1Mass;
m1._height = m1Mass;
onEnterFrame = function () {
if (m1._width > 50) {
m1.gotoAndStop(2);
}
if (m1._width > 100) {
m1.gotoAndStop(3);
}
if (m1._width > 200) {
m1.gotoAndStop(4);
}
if (m1._width > 500) {
m1.gotoAndStop(5);
}
if (m1._width > 1000) {
m1.gotoAndStop(6);
}
if (m1._width > 1700) {
m1.gotoAndStop(7);
}
if (m1._width > 3000) {
m1.gotoAndStop(8);
}
if (m1._width > 4000) {
m1.gotoAndStop(9);
}
if (m1._width > 5000) {
m1.gotoAndStop(10);
}
if (m1._width > 8000) {
m1.gotoAndStop(11);
}
G += cam._height / 1000;
newPosx = m1._x;
newPosy = m1._y;
side1 = newPosx - oldPosx;
side2 = newPosy - oldPosy;
m1Speed = Math.sqrt(side1 * side1 + side2 * side2);
if (oldPosx < m1._x) {
xSpeedPos = oldPosx - m1Mass;
} else {
xSpeedPos = oldPosx + m1Mass;
}
if (oldPosy < m1._y) {
ySpeedPos = oldPosy - m1Mass;
} else {
ySpeedPos = oldPosy + m1Mass;
}
oldPosx = newPosx;
oldPosy = newPosy;
speedMass = m1Mass / 10;
trace(m1Speed + ' ' + m1Mass);
++timer;
if (timer > 150) {
if (m2Array.length < 10) {
if (m1Speed >= cam._width / 50) {
++nn;
if (nn > 3) {
m1._width -= speedMass;
m1._height -= speedMass;
nn = 0;
ss += 1;
spawn = _root.attachMovie('m2ID', 'm2' + ss, ss, {'_x': xSpeedPos, '_y': ySpeedPos, '_width': speedMass, '_height': speedMass});
m2Array.push(spawn);
}
}
}
}
dx = m1._x - _xmouse;
dy = m1._y - _ymouse;
m1._x -= dx / 10;
m1._y -= dy / 10;
wPer = m1._width / cam._width;
if (wPer > 0.06) {
cc += 0.4;
cam._width += 4 * (cc + m1Mass / 100);
cam._height += 3 * (cc + m1Mass / 100);
}
if (wPer < 0.02) {
cam._width -= 4 * m1Mass;
cam._height -= 3 * m1Mass;
}
randMass = random(m1Mass * 1.7);
camBoundsLeft = cam._x - cam._width / 2;
camBoundsRight = cam._x + cam._width / 2;
camBoundsTop = cam._y - cam._height / 2;
camBoundsBot = cam._y + cam._height / 2;
randx = Math.floor(Math.random() * (1 + camBoundsRight - camBoundsLeft)) + camBoundsLeft;
randy = Math.floor(Math.random() * (1 + camBoundsBot - camBoundsTop)) + camBoundsTop;
spawnBuffer = random(10) * m1._width;
if (randx >= cam._x) {
xx = camBoundsRight - randx;
randPosx = randx + xx + spawnBuffer;
} else {
xx = camBoundsLeft - randx;
randPosx = randx + xx - spawnBuffer;
}
if (randy >= cam._y) {
yy = camBoundsBot - randy;
randPosy = randy + yy + spawnBuffer;
} else {
yy = camBoundsTop - randy;
randPosy = randy + yy - spawnBuffer;
}
m1Mass = m1._width;
m1Mass = m1._height;
++n;
if (n > 10) {
n = 0;
if (m2Array.length < 15) {
s += 1;
spawn = _root.attachMovie('m2ID', 'm2' + s, s, {'_x': randx, '_y': randPosy, '_width': randMass, '_height': randMass});
m2Array.push(spawn);
}
}
i = 0;
while (i < m2Array.length) {
m2Array[i]._width = m2Mass;
m2Array[i]._height = m2Mass;
distx = m1._x - m2Array[i]._x;
disty = m1._y - m2Array[i]._y;
a = distx * distx;
b = disty * disty;
c = a + b;
dist = Math.sqrt(c);
force = G * (m1Mass * m2Array[i]._width) / dist * dist / m2Array[i]._width;
if (distx > 0) {
m2Array[i]._x += force * (0.01 * distx);
} else {
m2Array[i]._x -= force * (0.01 * -distx);
}
if (disty > 0) {
m2Array[i]._y += force * (0.01 * disty);
} else {
m2Array[i]._y -= force * (0.01 * -disty);
}
if (m2Array[i]._width > 50) {
m2Array[i].gotoAndStop(2);
}
if (m2Array[i]._width > 100) {
m2Array[i].gotoAndStop(3);
}
if (m2Array[i]._width > 200) {
m2Array[i].gotoAndStop(4);
}
if (m2Array[i]._width > 500) {
m2Array[i].gotoAndStop(5);
}
if (m2Array[i]._width > 1000) {
m2Array[i].gotoAndStop(6);
}
if (m2Array[i]._width > 1700) {
m2Array[i].gotoAndStop(7);
}
if (m2Array[i]._width > 3000) {
m2Array[i].gotoAndStop(8);
}
if (m2Array[i]._width > 4000) {
m2Array[i].gotoAndStop(9);
}
if (m2Array[i]._width > 5000) {
m2Array[i].gotoAndStop(10);
}
if (m2Array[i]._width > 8000) {
m2Array[i].gotoAndStop(11);
}
if (dist > cam._width * 1.5) {
loadMovie('', m2Array[i]);
m2Array.splice(i, 1);
}
if (m1.hitTest(m2Array[i])) {
if (m1Mass >= m2Array[i]._width) {
if (m1Mass < m1Mass + m2Array[i]._width) {
m1._width += m1._width / 20;
m1._height += m1._height / 20;
m2Array[i]._width -= m1._width / 20;
m2Array[i]._height -= m1._height / 20;
}
if (m2Array[i]._width < m1Mass / 20) {
loadMovie('', m2Array[i]);
m2Array.splice(i, 1);
}
if (dist < m1Mass / 2) {
loadMovie('', m2Array[i]);
m2Array.splice(i, 1);
}
_root.attachMovie('spaceBeepID', 'spaceBeepMC', 1);
} else {
m1._width -= m1._width / 10;
m1._height -= m1._height / 10;
}
}
if (m1Mass < m2Array[i]._width / 20) {
loadMovie('', m1);
Mouse.show();
cam.gotoAndStop(2);
}
if (m1Mass == 0.4) {
loadMovie('', m1);
Mouse.show();
cam.gotoAndStop(2);
}
if (_global.starChoice == 1) {
if (m1Mass > 2000) {
m2Array.splice(i, 1);
Mouse.show();
cam.gotoAndStop(3);
}
}
if (_global.starChoice == 2) {
if (m1Mass > 4000) {
m2Array.splice(i, 1);
Mouse.show();
cam.gotoAndStop(3);
}
}
if (_global.starChoice == 3) {
if (m1Mass > 6000) {
m2Array.splice(i, 1);
Mouse.show();
cam.gotoAndStop(3);
}
}
if (_global.starChoice == 5) {
if (m1Mass > 9000) {
m2Array.splice(i, 1);
Mouse.show();
cam.gotoAndStop(3);
}
}
if (_global.starChoice == 4) {
if (m1Mass > 10000) {
m2Array.splice(i, 1);
Mouse.show();
cam.gotoAndStop(3);
}
}
j = 0;
while (j < m2Array.length) {
distJx = m2Array[i]._x - m2Array[j]._x;
distJy = m2Array[i]._y - m2Array[j]._y;
aJ = distJx * distJx;
bJ = distJy * distJy;
cJ = aJ + bJ;
distJ = Math.sqrt(cJ);
forceJ = G * (m2Array[j]._width * m2Array[i]._width) / distJ * distJ / m2Array[j]._width;
if (distJx > 0) {
m2Array[j]._x += forceJ * (0.01 * distJx);
} else {
m2Array[j]._x -= forceJ * (0.01 * -distJx);
}
if (distJy > 0) {
m2Array[j]._y += forceJ * (0.01 * distJy);
} else {
m2Array[j]._y -= forceJ * (0.01 * -distJy);
}
if (m2Array[i] != m2Array[j]) {
if (m2Array[i].hitTest(m2Array[j])) {
if (m2Array[j]._width <= m2Array[i]._width) {
if (m2Array[i]._width < m2Array[j]._width + m2Array[i]._width) {
m2Array[i]._width += m2Array[j]._width / 20;
m2Array[i]._height += m2Array[j]._width / 20;
m2Array[j]._width -= m2Array[j]._width / 20;
m2Array[j]._height -= m2Array[j]._width / 20;
if (m2Array[j]._width < m2Array[i]._width / 20) {
loadMovie('', m2Array[j]);
m2Array.splice(j, 1);
}
if (distJ < m2Array[i]._width / 2) {
loadMovie('', m2Array[j]);
m2Array.splice(j, 1);
}
}
} else {
if (m2Array[j]._width < m2Array[i]._width + m2Array[j]._width) {
m2Array[j]._width += m2Array[i]._width / 20;
m2Array[j]._height += m2Array[i]._width / 20;
m2Array[i]._width -= m2Array[i]._width / 20;
m2Array[i]._height -= m2Array[i]._width / 20;
if (m2Array[i]._width < m2Array[j]._width / 20) {
loadMovie('', m2Array[i]);
m2Array.splice(i, 1);
}
if (distJ < m2Array[j]._width / 2) {
loadMovie('', m2Array[i]);
m2Array.splice(i, 1);
}
}
}
}
}
++j;
}
++i;
}
};
}
movieClip 50 {
frame 1 {
stop();
}
}
// unknown tag 88 length 64
movieClip 57 {
frame 1 {
function camControl() {
parentColor.setTransform(camColor.getTransform());
var v3 = sX / this._width;
var v4 = sY / this._height;
_parent._x = cX - this._x * v3;
_parent._y = cY - this._y * v4;
_parent._xscale = 100 * v3;
_parent._yscale = 100 * v4;
}
function resetStage() {
var v2 = {'ra': 100, 'rb': 0, 'ga': 100, 'gb': 0, 'ba': 100, 'bb': 0, 'aa': 100, 'ab': 0};
parentColor.setTransform(v2);
_parent._xscale = 100;
_parent._yscale = 100;
_parent._x = 0;
_parent._y = 0;
}
stop();
this._visible = true;
var oldMode = Stage.scaleMode;
Stage.scaleMode = 'exactFit';
var cX = Stage.width / 2;
var cY = Stage.height / 2;
var sX = Stage.width;
var sY = Stage.height;
Stage.scaleMode = oldMode;
var camColor = new Color(this);
var parentColor = new Color(_parent);
this.onEnterFrame = camControl;
this.onUnload = resetStage;
onMouseMove = function () {
txt_mass.text = _root.m1._width;
};
}
}
instance cam of movieClip 57 {
onClipEvent (enterFrame) {
_x = _x + (_root.m1._x - _x) / 20;
_y = _y + (_root.m1._y - _y) / 20;
}
}