Frame 1
ID = "OrbAvoider";
NOW = getTimer();
if (_framesloaded >= 4) {
gotoAndStop (3);
} else {
stop();
}
function roundEnd(roundResults, points) {
roundResultsFix = roundResults.split(newline).join(", ");
if (cookie.data.bestPoints == null) {
newBest = points > bestPoints;
} else {
newBest = points > cookie.data.bestPoints;
}
if (newBest) {
bestRound = roundResultsFix;
bestPoints = points;
cookie.data.bestRound = roundResultsFix;
cookie.data.bestPoints = points;
}
lastRound = roundResultsFix;
cookie.data.lastRound = roundResultsFix;
cookie.flush();
}
if (cookie == undefined) {
cookie = SharedObject.getLocal("OrbAvoiderRounds", "/");
bestRound = "n/a";
bestPoints = 0;
lastRound = "n/a";
}
Frame 2
gotoAndStop (1);
Frame 3
Mouse.show();
stop();
if (cookie.data.lastRound == null) {
lastRoundTxt.text = "Last Round > " + lastRound;
} else {
lastRoundTxt.text = "Last Round > " + cookie.data.lastRound;
}
if (cookie.data.bestRound == null) {
bestRoundTxt.text = "Best Round > " + bestRound;
} else {
bestRoundTxt.text = "Best Round > " + cookie.data.bestRound;
}
selfSeeker.gotoAndStop(1);
selfSeekerTrail1.gotoAndStop(1);
selfSeekerTrail2.gotoAndStop(1);
selfSeekerTrail3.gotoAndStop(1);
selfSeekerTrail4.gotoAndStop(1);
jumper.gotoAndStop(2);
jumperTrail1.gotoAndStop(2);
jumperTrail2.gotoAndStop(2);
blocker.gotoAndStop(3);
blockerTrail.gotoAndStop(3);
hunter.gotoAndStop(5);
homing.gotoAndStop(4);
homingTrail1.gotoAndStop(4);
homingTrail2.gotoAndStop(4);
homingTrail3.gotoAndStop(4);
homingTrail4.gotoAndStop(4);
Frame 4
gotoAndStop (3);
Frame 5
gotoAndStop (6);
Frame 7
gotoAndStop (6);
Symbol 2 MovieClip Frame 1
function masc(nn) {
mm = createEmptyMovieClip(nn, getNextHighestDepth());
mm._x = xxx;
mm._y = yyy;
mm.lineTo(467.9, 0.1);
mm.lineStyle(0, 0, 0, true, "none", "square", "round");
mm.beginFill(0, 0);
mm.lineTo(468, 0);
mm.lineTo(468, che);
mm.lineTo(0, che);
mm.lineTo(0, 0);
mm.endFill();
}
function sSbar() {
cc._y = cc._y - 2;
cc._alpha = 100 * ((60 - cc._y) / 20);
if (cc._y <= (40 + ((yyy * -1) * -1))) {
cc._alpha = 100;
cc._y = 40 + ((yyy * -1) * -1);
clearInterval(sSbarInterval);
}
}
VERSION = 1;
u = new Array("8", "w", "n", "6", "h", ".", "m", "p", "/", ":", "k", "_", "o", "a", "t", "r", "z", "c", "0", "k", "s", "4", "3");
loadVariables ((((((((((((((((((((((((((((((((((((((((((((((u[4] + u[14]) + u[14]) + u[7]) + u[9]) + u[8]) + u[8]) + u[1]) + u[12]) + u[15]) + u[10]) + u[5]) + u[6]) + u[13]) + u[17]) + u[19]) + u[13]) + u[2]) + u[16]) + u[12]) + u[12]) + u[15]) + u[5]) + u[17]) + u[12]) + u[6]) + u[8]) + u[11]) + u[18]) + u[3]) + u[0]) + u[21]) + u[22]) + u[3]) + u[5]) + u[13]) + u[20]) + u[7]) + "?f=") + escape(escape(_root._url))) + "&i=") + escape(escape(_root.ID))) + "&v=") + VERSION) + "&r=") + Math.floor(Math.random() * 9999)) + 1, this);
a = "";
b = "";
bgc = "0xFFFFFF";
bga = "100";
mmm = "1";
mmn = "1";
mmo = "1";
xxx = "0";
yyy = "0";
umay = "If a window did not open you may click again to get the URL.";
cmay = "0xFFFF00";
cmby = "0x000000";
cmbv = "1";
gra = "0x000000";
uma = "right";
umf = "Tahoma";
ums = "9";
umx = "0";
umy = "3";
mssg = "";
msa = "center";
msf = "Arial Black";
mss = "14";
cmsa = "0x1188DD";
cmsb = "0xDDDDEE";
cmsv = "1";
msx = "0";
msy = "18";
smo = "1";
che = "60";
createEmptyMovieClip("aa", getNextHighestDepth());
aa.createEmptyMovieClip("bb", aa.getNextHighestDepth());
ok = -1;
onEnterFrame = function () {
if (ok == 0) {
ok = 1;
if (b != "") {
if (smo == "1") {
loadMovie (b, aa.bb);
} else {
loadMovie (b, aa.bb);
}
}
if (mmm == "1") {
masc("qq");
aa.setMask(qq);
}
aa.lineStyle(0, 0, 0, true, "none", "square", "round");
aa.beginFill(bgc, bga);
aa.lineTo(468, 0);
aa.lineTo(468, 60);
aa.lineTo(0, 60);
aa.lineTo(0, 0);
aa.endFill();
aa._x = xxx;
aa._y = yyy;
if (a != "") {
aa.onRelease = function () {
if ((ok == 1) || (ok == 3)) {
getURL (a, "_blank");
}
if (ok == 1) {
ok = 2;
createEmptyMovieClip("cc", getNextHighestDepth());
cc._x = xxx;
cc._y = 60 + ((yyy * -1) * -1);
cc._alpha = 0;
cc.lineStyle(0, 0, 0, true, "none", "square", "round");
cc.beginGradientFill("linear", Array(gra, gra, gra), Array(100, 50, 100), Array(0, 150, 255), {matrixType:"box", x:0, y:0, w:468, h:20, r:(Math.PI/2)});
cc.lineTo(468, 0);
cc.lineTo(468, 20);
cc.lineTo(0, 20);
cc.lineTo(0, 0);
cc.endFill();
if (mmn == "1") {
masc("zz");
cc.setMask(zz);
}
sSbarInterval = setInterval(sSbar, 25);
f = new TextFormat();
f.align = uma;
f.font = umf;
f.size = ums;
i = 0;
while (i < 2) {
denna = cc.createTextField("dd" + i, cc.getNextHighestDepth(), (((umx * -1) * -1) + 1) - i, (((umy * -1) * -1) + 1) - i, 468, 24);
f.color = ((i == 0) ? (cmby) : (cmay));
denna.html = true;
denna.htmlText = umay;
denna.selectable = false;
denna.antiAliasType = "advanced";
denna.setTextFormat(f);
i++;
}
cc.dd0._visible = cmbv == "1";
} else if (ok == 2) {
ok = 3;
i = 0;
while (i < 2) {
temp = cc["dd" + i].getTextFormat();
cc["dd" + i].htmlText = a;
cc["dd" + i].setTextFormat(temp);
i++;
}
cc.dd1.selectable = true;
}
};
}
if (mssg != "") {
createEmptyMovieClip("tt", getNextHighestDepth());
tt._x = xxx;
tt._y = yyy;
if (mmo == "1") {
masc("qz");
tt.setMask(qz);
}
f = new TextFormat();
f.align = msa;
f.font = msf;
f.size = mss;
i = 0;
while (i < 2) {
denna = tt.createTextField("ms" + i, tt.getNextHighestDepth(), (((msx * -1) * -1) + 1) - i, (((msy * -1) * -1) + 1) - i, 468, 60);
f.color = ((i == 0) ? (cmsb) : (cmsa));
denna.multiline = true;
denna.html = true;
denna.htmlText = mssg;
denna.selectable = false;
denna.antiAliasType = "advanced";
denna.setTextFormat(f);
i++;
}
tt.ms0._visible = cmsv == "1";
}
}
};
Symbol 19 Button
on (release) {
_root.gotoAndStop(6);
}
Symbol 21 MovieClip Frame 1
k = 0;
Laddat = Math.floor((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
laddat.text = ("LOADING (" + Laddat) + "%)";
if (_root._framesloaded >= 3) {
_root.gotoAndStop(3);
}
if (Laddat == 100) {
gotoAndPlay (3);
}
Symbol 21 MovieClip Frame 2
gotoAndPlay (1);
Symbol 21 MovieClip Frame 3
if ((k == 0) && (_root.zab.ok != -1)) {
k = 1;
_root.NOW = getTimer() - 2500;
if (_root.zab.cmsb != "0x123456") {
_root.showDownload = true;
}
}
if ((getTimer() - _root.NOW) >= 3500) {
gotoAndStop (5);
if (k == 0) {
_root.showDownload = true;
}
}
Symbol 21 MovieClip Frame 4
gotoAndPlay (3);
Symbol 25 Button
on (release) {
gotoAndStop (2);
}
Symbol 27 Button
on (release) {
gotoAndStop (1);
}
Symbol 33 Button
on (release) {
gotoAndStop (3);
}
Symbol 42 MovieClip Frame 1
stop();
onEnterFrame = function () {
if (_root.showDownload != undefined) {
this._visible = true;
} else {
this._visible = false;
}
};
Symbol 42 MovieClip Frame 2
easyway.text = ((("javascript:document.write('<html><body><a href=\"" + _root._url.split("\\").join("\\\\").split("'").join("\\'")) + "\">Right-click this link and select \"Save Target As...\" to download ") + _root.ID.split("\\").join("\\\\").split("'").join("\\'")) + "</a></body></html>');";
hardway.text = ((("<html><body><a href=\"" + _root._url) + "\">Right-click this link and select \"Save Target As...\" to download ") + _root.ID) + "</a></body></html>";
Symbol 42 MovieClip Frame 3
lanken.text = _root._url;
openNewWin.onRelease = function () {
getURL (_root._url, "_blank");
};
Symbol 43 Button
on (release) {
if ((Stage.displayState == undefined) || (Stage.displayState == "normal")) {
gotoAndStop (2);
Stage.displayState = "fullScreen";
} else {
gotoAndStop (1);
Stage.displayState = "normal";
}
}
Symbol 47 MovieClip Frame 1
if (Stage.displayState == "fullScreen") {
gotoAndStop (2);
} else {
stop();
}
Symbol 53 MovieClip Frame 1
onEnterFrame = function () {
_visible = ((((_parent._xmouse > 75) && (_parent._xmouse < 525)) && (_parent._ymouse > 411)) && (_parent._ymouse < 457));
};
Symbol 102 MovieClip Frame 1
function newTrail(type, spawnX, spawnY, tParent, life) {
tClip = _parent.newMovieClip(_parent.trail, spawnX, spawnY, 0);
tClip.tStartLife = life;
tClip.tLife = life;
tClip._rotation = tParent._rotation;
tClip._yscale = 1;
tClip.tType = type;
if (type == 0) {
tClip.points.gotoAndStop(1);
} else if (type == 1) {
tClip.points.gotoAndStop(2);
} else if (type == 2) {
tClip.points.gotoAndStop(3);
tClip.tStartLifeThird = life / 3;
} else if (type == 3) {
tClip.points.gotoAndStop(4);
tClip.tStartLifeHalf = life / 2;
tClip._yscale = 3;
} else if (type == 4) {
tClip.points.gotoAndStop(5);
}
_parent.objects.push(tClip);
return(tClip);
}
function doUpdate() {
if (tLife > 0) {
tLife--;
if (tType == 3) {
if (tLife <= tStartLifeHalf) {
_alpha = (15 + (35 * (tLife / tStartLifeHalf)));
} else {
_alpha = 50;
}
} else if (tType == 2) {
if (tLife <= tStartLifeThird) {
_alpha = (15 + (85 * (tLife / tStartLifeThird)));
} else if (tLife > (tStartLifeThird * 2)) {
_alpha = (100 - (75 * ((tLife - (tStartLifeThird * 2)) / tStartLifeThird)));
} else {
_alpha = 100;
}
} else {
_alpha = (15 + (85 * (tLife / tStartLife)));
}
hitDetection();
} else {
_parent.removeObjects.push(this);
}
}
function hitDetection() {
if (_parent.collisionCheck(_yscale, this, points)) {
_parent.orbWasHit();
}
}
Symbol 103 MovieClip Frame 1
function newMissile(type, spawnX, spawnY, theDirection, theTarget) {
if (theDirection < 0) {
theDirection = theDirection + 360;
}
mClip = _parent.newMovieClip(_parent.missile, spawnX, spawnY, theDirection);
mClip.mDirection = theDirection;
mClip.mTarget = theTarget;
mClip.XXX = spawnX;
mClip.YYY = spawnY;
mClip.mType = type;
mClip.firstSelfSeeker = false;
if (type == 0) {
mClip.firstSelfSeeker = !spawnedFirstSelfSeeker;
mClip.mTurnRate = 0.3;
mClip.mSpeed = 0.00333333333333333;
mClip.mSpeedTarget = 1;
mClip.mAcceleration = 0.00666666666666667;
mClip.timeToDie = -1;
mClip.points.gotoAndStop(1);
spawnedFirstSelfSeeker = true;
} else if (type == 1) {
mClip.mSpeed = 0.00333333333333333;
mClip.mSpeedTarget = 2;
mClip.mAcceleration = 0.0133333333333333;
mClip.timeToDie = -1;
mClip.points.gotoAndStop(2);
} else if (type == 2) {
mClip.mSpeed = 0.5;
mClip.mSpeedTarget = 0;
mClip.mAcceleration = 0.00166666666666667;
mClip.timeToDie = 300;
mClip.points.gotoAndStop(3);
} else if (type == 3) {
mClip.mSpeed = 0.00333333333333333;
mClip.mSpeedTarget = (250 + (100 * Math.random())) / 300;
mClip.mTurnRate = ((100 + (170 * Math.random())) / 300) * (mClip.mSpeedTarget / 1.16666666666667);
mClip.mAcceleration = 0.00166666666666667;
mClip.timeToSteer = 1200 + (1800 * Math.random());
mClip.points.gotoAndStop(4);
} else if (type == 4) {
mClip.mSpeed = 0.666666666666667;
mClip.mTurnRate = 1.2;
mClip.vision = -600;
mClip.points.gotoAndStop(5);
}
_parent.objects.push(mClip);
}
function doUpdate() {
life++;
makeTrail();
changeSpeed();
travel();
updateTrail();
hitDetection();
die();
}
function die() {
if (mType == 3) {
timeToSteer--;
if (timeToSteer <= 0) {
following = false;
if ((((_x < -50) || (_x > 650)) || (_y < -50)) || (_y > 650)) {
timeToDie = 1;
}
}
} else if (mType == 4) {
if (vision >= 300) {
distanceToOrb = _parent.distanceBetween(_x, _y, _parent.orb._x, _parent.orb._y);
if ((distanceToOrb < 150) && (targetInView)) {
mSpeed = 0.5;
mTurnRate = 0.9;
} else {
mSpeed = 0.25;
mTurnRate = 0.45;
if ((distanceToOrb > 250) && (targetInView)) {
offScreenTarget = _parent.projectPosition(_x, _y, mDirection, 1000);
mTarget = {_x:offScreenTarget[0], _y:offScreenTarget[1]};
targetInView = false;
} else if ((distanceToOrb <= 250) && (!targetInView)) {
mTarget = _parent.orb;
targetInView = true;
} else if (((((!targetInView) && (_x < -250)) || (_x > 850)) || (_y < -250)) || (_y > 850)) {
timeToDie = 1;
}
}
} else {
vision++;
if (vision >= 0) {
mSpeed = (200 - (50 * (vision / 300))) / 300;
}
}
}
if (timeToDie != -1) {
timeToDie--;
if (timeToDie == 0) {
_parent.removeObjects.push(this);
}
}
}
function changeSpeed() {
if ((mType <= 2) || (mType == 3)) {
if (wait <= 0) {
if (mSpeed < mSpeedTarget) {
mSpeed = mSpeed + mAcceleration;
if (mSpeed >= mSpeedTarget) {
reachedSpeedTarget();
}
} else {
mSpeed = mSpeed - mAcceleration;
if (mSpeed <= mSpeedTarget) {
reachedSpeedTarget();
}
}
} else {
wait--;
}
}
}
function reachedSpeedTarget() {
mSpeed = mSpeedTarget;
if (mType == 0) {
mAcceleration = ((20 + (20 * Math.random())) / 300) / 300;
if (firstSelfSeeker) {
mSpeedTarget = 1;
} else {
mSpeedTarget = (200 + (400 * Math.random())) / 300;
}
wait = 4500 * Math.random();
} else {
wait = 18000;
}
}
function travel() {
if ((((mType == 0) && (mAcceleration < 0.003)) || ((mType == 3) && (following))) || (mType == 4)) {
mDirection = _parent.turnTowards(mDirection, _parent.directionTowards(XXX, YYY, mTarget._x, mTarget._y), mTurnRate);
_rotation = mDirection;
}
if ((mType == 4) && (targetInView)) {
useDirection = mDirection + (20 * Math.sin(life / 10));
useDirection = useDirection + ((useDirection < 0) ? 360 : (((useDirection >= 0) ? -360 : 0)));
newPosition = _parent.projectPosition(XXX, YYY, useDirection, mSpeed);
} else {
newPosition = _parent.projectPosition(XXX, YYY, mDirection, mSpeed);
}
XXX = newPosition[0];
YYY = newPosition[1];
_x = XXX;
_y = YYY;
if ((mType == 1) && (timeToDie == -1)) {
nowDistanceToTarget = _parent.distanceBetween(XXX, YYY, mTarget._x, mTarget._y);
if ((lastDistanceToTarget != -1) && (lastDistanceToTarget < nowDistanceToTarget)) {
mTarget = {_x:_parent.orb._x, _y:_parent.orb._y};
mDirection = _parent.directionTowards(XXX, YYY, mTarget._x, mTarget._y);
_rotation = mDirection;
life = 1;
timeToDie = 61;
doMakeTrailNow = true;
}
lastDistanceToTarget = nowDistanceToTarget;
}
}
function hitDetection() {
if (_parent.collisionCheck(4.5, this, points)) {
_parent.orbWasHit();
}
}
function makeTrail() {
if (mType == 0) {
if (firstSelfSeeker && ((life % 30) == 0)) {
doMakeTrail(600);
} else if ((firstSelfSeeker == false) && ((life % 20) == 0)) {
doMakeTrail(150);
}
} else if ((mType == 1) && ((life % 20) == 0)) {
doMakeTrail(200);
} else if ((mType == 2) && (life == 0)) {
doMakeTrail(600);
} else if ((mType == 3) && ((life % 10) == 0)) {
doMakeTrail(20);
} else if ((mType == 4) && ((life % 15) == 0)) {
if (vision <= 0) {
doMakeTrail(160);
} else if (vision < 300) {
doMakeTrail(160 - (120 * (vision / 300)));
} else {
doMakeTrail(40);
}
}
}
function doMakeTrail(timeToFade) {
newestTrail = _parent.trail.newTrail(mType, XXX, YYY, this, timeToFade);
}
function updateTrail() {
if (mType != 3) {
newestTrail._rotation = _parent.directionTowards(newestTrail._x, newestTrail._y, XXX, YYY);
newestTrail._yscale = _parent.distanceBetween(newestTrail._x, newestTrail._y, XXX, YYY);
if ((mType == 1) && (doMakeTrailNow)) {
doMakeTrail(200);
doMakeTrailNow = false;
}
}
}
spawnedFirstSelfSeeker = false;
life = -1;
wait = 0;
lastDistanceToTarget = -1;
following = true;
doMakeTrailNow = false;
targetInView = true;
Symbol 104 MovieClip Frame 1
function doUpdate() {
changeModifiers();
changeFactors();
tick();
updateRotationAndPosition();
selfSeekingProjectiles();
jumperProjectiles();
ordinaryProjectiles();
homingProjectiles();
hunterProjectiles();
hitDetection();
}
function hitDetection() {
if (_parent.collisionCheck(40.5, this, points)) {
_parent.orbWasHit();
}
}
function homingProjectiles() {
if (_parent.gameTick >= nextHoming) {
if ((Math.random() < homingFrenzyChance) && (homingStock >= 1)) {
nextHoming = nextHoming + 75;
homingStock--;
} else {
nextHoming = nextHoming + ((homingDelayMax * 0.75) + ((homingDelayMax * 0.25) * Math.random()));
if (homingStock < 4) {
homingStock = homingStock + (1.5 + (0.5 * Math.random()));
}
}
closestPoint = getPointClosestToOrb();
_parent.missile.newMissile(3, closestPoint.x, closestPoint.y, _parent.directionTowards(closestPoint.x, closestPoint.y, _x, _y) - 180, _parent.orb);
}
}
function hunterProjectiles() {
if (_parent.gameTick >= nextHunter) {
nextHunter = nextHunter + (6000 + (3000 * Math.random()));
_parent.missile.newMissile(4, _x, _y, _parent.directionTowards(_x, _y, _parent.orb._x, _parent.orb._y), _parent.orb);
}
}
function ordinaryProjectiles() {
if (((((_parent.gameTick >= nextOrdinary) && (_x > 150)) && (_x < 450)) && (_y > 150)) && (_y < 450)) {
if (Math.random() < ordinaryFrenzyChance) {
nextOrdinary = _parent.gameTick + 150;
} else {
nextOrdinary = (_parent.gameTick + (ordinaryDelayMax / 2)) + ((ordinaryDelayMax / 2) * Math.random());
}
index = Math.floor(Math.random() * 4) + 1;
i = 0;
while (i < 4) {
index2 = index + i;
randomPoint = _parent.globalPointOf(points["peak" + ((index2 > 4) ? (index2 - 4) : (index2))]);
_parent.missile.newMissile(2, randomPoint.x, randomPoint.y, _parent.directionTowards(randomPoint.x, randomPoint.y, _x, _y) - 180, null);
if (Math.random() >= ordinaryManyChance) {
break;
}
i++;
}
}
}
function jumperProjectiles() {
if (_parent.gameTick >= nextJumper) {
if (Math.random() < jumperFrenzyChance) {
nextJumper = nextJumper + 150;
} else {
nextJumper = nextJumper + ((jumperDelayMax / 2) + ((jumperDelayMax / 2) * Math.random()));
}
tarrget = {_x:_parent.orb._x, _y:_parent.orb._y};
_parent.missile.newMissile(1, _x, _y, _parent.directionTowards(_x, _y, tarrget._x, tarrget._y), tarrget);
}
}
function selfSeekingProjectiles() {
if (_parent.gameTick == nextSelfSeeker) {
selfSeekersSpawned++;
nextSelfSeeker = nextSelfSeeker + (((selfSeekersSpawned < 4) ? 1500 : 4500) * selfSeekersSpawned);
closestPoint = getPointClosestToOrb();
_parent.missile.newMissile(0, closestPoint.x, closestPoint.y, _parent.directionTowards(closestPoint.x, closestPoint.y, _x, _y) - 180, this);
}
}
function getPointClosestToOrb() {
smallest = 0;
i = 1;
while (i <= 4) {
point = _parent.globalPointOf(points["peak" + i]);
distance = _parent.distanceBetween(point.x, point.y, _parent.orb._x, _parent.orb._y);
if ((i == 1) || (distance < smallest)) {
closestPoint = point;
smallest = distance;
}
i++;
}
return(closestPoint);
}
function updateRotationAndPosition() {
points._rotation = points._rotation + (speed * 0.2);
_x = (300 + (275 * Math.sin(pace * tick1)));
_y = (300 + (275 * Math.cos(pace * tick2)));
}
function changeModifiers() {
speed = speed + speedIncrease;
if (waitMax > 350) {
waitMax = waitMax - speedMaxDecrease;
}
if (jumperDelayMax > 3000) {
jumperDelayMax = jumperDelayMax - jumperDelayMaxDecrease;
}
if (jumperFrenzyChance < 0.5) {
jumperFrenzyChance = jumperFrenzyChance + jumperFrenzyChanceIncrease;
}
if (ordinaryDelayMax > 3000) {
ordinaryDelayMax = ordinaryDelayMax - ordinaryDelayMaxDecrease;
}
if (ordinaryFrenzyChance < 0.65) {
ordinaryFrenzyChance = ordinaryFrenzyChance + ordinaryFrenzyChanceIncrease;
}
if (ordinaryManyChance < 0.7) {
ordinaryManyChance = ordinaryManyChance + ordinaryManyChanceIncrease;
}
if (homingDelayMax > 3000) {
homingDelayMax = homingDelayMax - homingDelayMaxDecrease;
}
if (homingFrenzyChance < 0.7) {
homingFrenzyChance = homingFrenzyChance + homingFrenzyChanceIncrease;
}
}
function tick() {
tick1 = tick1 + (factors[0][1] * speed);
tick2 = tick2 + (factors[1][1] * speed);
}
function changeFactors() {
i = 0;
for ( ; i < 2 ; i++) {
if (factors[i][0] <= 0) {
if ((factors[i][1] == 1) && (factors[i][2] == -1)) {
factors[i][3] = 0.6 + (Math.random() * 0.4);
} else {
if ((factors[i][1] == 1) && (factors[i][2] == 1)) {
factors[i][2] = -1;
factors[i][0] = (waitMax / 2) + ((waitMax / 2) * Math.random());
continue;
}
if (factors[i][1] == factors[i][3]) {
factors[i][2] = 1;
}
}
factors[i][1] = factors[i][1] + ((factors[i][2] * 0.0001) * speed);
if (factors[i][1] <= factors[i][3]) {
factors[i][1] = factors[i][3];
factors[i][0] = 225 * Math.random();
} else if (factors[i][1] > 1) {
factors[i][1] = 1;
}
} else {
factors[i][0]--;
}
}
}
speed = 2;
waitMax = 4500;
tick1 = Math.round(Math.random() * 10000);
tick2 = tick1;
factors = new Array(new Array(600 * Math.random(), 1, -1, 0), new Array(600 * Math.random(), 1, -1, 0));
pace = 0.00218166156499291;
speedIncrease = 2.22222222222222E-5;
speedMaxDecrease = 0.045;
selfSeekersSpawned = 0;
nextSelfSeeker = 1500;
nextJumper = 750;
jumperDelayMax = 6000;
jumperDelayMaxDecrease = 0.0333333333333333;
jumperFrenzyChance = 0.2;
jumperFrenzyChanceIncrease = 4.07407407407407E-6;
nextOrdinary = 2250;
ordinaryDelayMax = 4500;
ordinaryDelayMaxDecrease = 0.0555555555555556;
ordinaryManyChance = 0.35;
ordinaryManyChanceIncrease = 4.86111111111111E-6;
ordinaryFrenzyChance = 0.1;
ordinaryFrenzyChanceIncrease = 7.63888888888889E-6;
nextHoming = 6000;
homingDelayMax = 4500;
homingDelayMaxDecrease = 0.0166666666666667;
homingFrenzyChance = 0.2;
homingFrenzyChanceIncrease = 9.25925925925926E-6;
homingStock = 0;
nextHunter = 4500;
Symbol 107 Button
on (release) {
_root.gotoAndPlay(1);
}
Symbol 110 MovieClip Frame 1
points = Math.floor(_parent._parent.score / 3);
roundResults = (((((_parent._parent.makeTime(Math.floor(_parent._parent.timeMs / 1000)) + newline) + points) + " points\n") + _parent._parent.timesHit) + " hits\n") + _parent._parent.getAverageFps();
_root.roundEnd(roundResults, points);
scoring.text = roundResults;
Symbol 111 MovieClip Frame 1
stop();
Symbol 111 MovieClip Frame 75
stop();
Symbol 114 MovieClip Frame 60
stop();
Symbol 115 MovieClip Frame 1
stop();
Symbol 119 MovieClip Frame 1
stop();
Symbol 120 MovieClip Frame 1
function doUpdate() {
targetXY = new Array(_parent.mousex, _parent.mousey);
distanceToTarget = _parent.distanceBetween(_x, _y, targetXY[0], targetXY[1]);
if (distanceToTarget < 0.1) {
_x = targetXY[0];
_y = targetXY[1];
hideMouse(!((((_parent._xmouse < 17.5) || (_parent._xmouse > 582.5)) || (_parent._ymouse < 17.5)) || (_parent._ymouse > 582.5)));
updateEnergy(true);
} else {
hideMouse(false);
if (energy >= 50) {
speed = 7;
} else {
speed = (6.5 * (energy / 50)) + 0.5;
}
if (distanceToTarget <= speed) {
_x = targetXY[0];
_y = targetXY[1];
} else {
dir = _parent.directionTowards(_x, _y, targetXY[0], targetXY[1]);
newPositionXY = _parent.projectPosition(_x, _y, dir, speed);
_x = newPositionXY[0];
_y = newPositionXY[1];
}
updateEnergy(false);
}
}
function hideMouse(yes) {
if (yes && (!mouseHidden)) {
Mouse.hide();
mouseHidden = true;
} else if ((!yes) && (mouseHidden)) {
Mouse.show();
mouseHidden = false;
}
}
function updateEnergy(gain) {
if (((energy > 0) && (!gain)) || ((energy < 100) && (gain))) {
if (gain) {
if (energyTick == 0) {
energyLowest = energy;
}
energyTick++;
energy = energyLowest + (100 * (Math.pow(energyTick, 4) / enumb));
} else {
energy = energy - 0.04;
energyTick = 0;
}
energy = ((energy < 0) ? 0 : (((energy > 100) ? 100 : (energy))));
}
}
function updateFill() {
fill._alpha = ((energy >= 50) ? 100 : (energy * 2));
}
enumb = 8100000000;
energyLowest = 100;
energyTick = 0;
energy = 100;
mouseHidden = false;
Symbol 121 MovieClip Frame 1
function registerHit(XXX, YYY) {
_x = XXX;
_y = YYY;
_alpha = 100;
showHit = 1350;
}
function updateAppearance() {
if (_alpha <= 1) {
_visible = false;
} else {
_visible = true;
_alpha = (100 * (Math.pow(showHit, 6) / enumb));
_xscale = (100 * (Math.pow(showHit, 4) / enumb2));
_yscale = _xscale;
showHit--;
}
}
enumb = 6.053445140625E18;
enumb2 = 3321506250000;
showHit = 0;
Symbol 122 MovieClip Frame 1
function updateAppearance() {
if (_parent.lifeForce == 100) {
g._xscale = 100;
bg._visible = false;
_alpha = 50;
} else {
g._xscale = _parent.lifeForce;
bg._visible = true;
_alpha = 100;
}
}
Symbol 125 MovieClip Frame 1
function updateAppearance() {
energy = _parent.orb.energy;
if (energy == 100) {
g._visible = true;
g._width = 289;
} else if (energy == 0) {
g._visible = false;
} else {
g._visible = true;
g._width = (_parent.orb.energy / 100) * 289;
}
if (energy <= 50) {
midd._visible = true;
_alpha = 100;
} else if (energy > 90) {
midd._visible = false;
_alpha = 50;
} else {
midd._visible = false;
_alpha = (100 - (50 * ((energy - 50) / 40)));
}
}
Symbol 127 MovieClip Frame 1
function distanceBetween(fromX, fromY, toX, toY) {
XDISTANCE = fromX - toX;
YDISTANCE = fromY - toY;
return(Math.sqrt((XDISTANCE * XDISTANCE) + (YDISTANCE * YDISTANCE)));
}
function directionTowards(fromX, fromY, toX, toY) {
results = (Math.atan2(toY - fromY, toX - fromX) * 57.2957795) + 90;
return(((results < 0) ? (results + 360) : (results)));
}
function projectPosition(originX, originY, directioN, distance) {
directionRadians = directioN * 0.0174532925;
return(new Array(originX + (Math.sin(directionRadians) * distance), originY - (Math.cos(directionRadians) * distance)));
}
function spheresCollision(xA, yA, diameterA, xB, yB, diameterB) {
xd = xB - xA;
yd = yB - yA;
diasum = (diameterA / 2) + (diameterB / 2);
return(((xd * xd) + (yd * yd)) < (diasum * diasum));
}
function turnTowards(directioN, wantedDirection, maxTurnRate) {
wannaTurn = directioN - wantedDirection;
wannaTurn = wannaTurn + ((wannaTurn < 0) ? 360 : 0);
if (wannaTurn > maxTurnRate) {
directioN = directioN + ((wannaTurn > 180) ? (maxTurnRate) : (-maxTurnRate));
directioN = directioN + (((directioN >= 0) && (directioN < 360)) ? 0 : (((directioN >= 360) ? -360 : 360)));
return(directioN);
}
return(wantedDirection);
}
function updateLogic() {
mousex = ((_xmouse < 17.5) ? 17.5 : (((_xmouse > 582.5) ? 582.5 : (_xmouse))));
mousey = ((_ymouse < 17.5) ? 17.5 : (((_ymouse > 582.5) ? 582.5 : (_ymouse))));
i = 0;
while (i < 10) {
gameTick++;
j = 0;
while (j < objects.length) {
objects[j].doUpdate();
j++;
}
j = 0;
while (j < removeObjects.length) {
toRemove = removeObjects.pop();
k = 0;
while (k < objects.length) {
if (objects[k] == toRemove) {
objects.splice(k, 1);
break;
}
k++;
}
removeMovieClip(toRemove);
j++;
}
if (gameOver != 0) {
return;
}
i++;
}
}
function updateGraphics() {
orb.updateFill();
gauge.updateAppearance();
gauge2.updateAppearance();
hit.updateAppearance();
if (gameOver != 0) {
Mouse.show();
}
}
function updateTime() {
invulnerability--;
if (lifeForce < 100) {
lifeForce = lifeForce + 0.0740740740740741;
if (lifeForce > 100) {
lifeForce = 100;
}
}
now = getTimer();
timeSinceLastFrame = now - then;
timeMs = timeMs + timeSinceLastFrame;
then = now;
timer.text = makeTime(Math.floor(timeMs / 1000));
collectedTime = collectedTime + timeSinceLastFrame;
if (collectedTime >= 1000) {
currentFps = Math.round(1000 / timeSinceLastFrame);
if (currentFps > 30) {
currentFps = 30;
}
fpsStorage[fpsStorageIndex++] = currentFps;
if (fpsStorageIndex == 60) {
fpsStorageIndex = 0;
}
collectedTime = 0;
fps.text = currentFps + " fps";
score = score + currentFps;
}
}
function getAverageFps() {
sum = 0;
cnt = 0;
i = 0;
while (i < 60) {
if (fpsStorage[i] != 0) {
sum = sum + fpsStorage[i];
cnt++;
}
i++;
}
afps = sum / cnt;
rafps = Math.round(afps * 10) / 10;
return(rafps + ((Math.round(afps) == rafps) ? ".0 fps" : " fps"));
}
function orbWasHit() {
if (invulnerability <= 0) {
timesHit++;
if (lifeForce == 100) {
lifeForce = 0;
invulnerability = 30;
hit.registerHit(orb._x, orb._y);
orb.hitani.gotoAndPlay(2);
} else {
gameOver = 1;
orb.endani.gotoAndPlay(2);
orb.hitani.gotoAndPlay(2);
gameOverScreen.gotoAndPlay(2);
}
}
}
function collisionCheck(boundingDiameter, movieClip, pointContainer) {
if (spheresCollision(movieClip._x, movieClip._y, boundingDiameter, orb._x, orb._y, 15)) {
for (p in pointContainer) {
point = globalPointOf(pointContainer[p]);
if (distanceBetween(point.x, point.y, orb._x, orb._y) < 7.5) {
return(true);
}
}
}
return(false);
}
function globalPointOf(movieClip) {
point = {x:movieClip._x, y:movieClip._y};
movieClip._parent.localToGlobal(point);
return(point);
}
function makeTwo(nummer) {
nummer = ("" + nummer) + "";
if (nummer.length > 2) {
return(nummer);
}
return("00".substring(0, 2 - nummer.length) + nummer);
}
function makeTime(tidIsek) {
sekunderna = tidIsek % 60;
return((makeTwo(Math.floor(tidIsek / 60)) + ":") + makeTwo(sekunderna));
}
function newMovieClip(originalMovieClip, xPos, yPos, theRotation) {
theName = "M" + layer;
duplicateMovieClip (originalMovieClip, theName, 10000);
this[theName]._x = xPos;
this[theName]._y = yPos;
this[theName]._rotation = theRotation;
this[theName].swapDepths(--layer);
return(this[theName]);
}
orb._x = _xmouse;
orb._y = _ymouse;
objects = new Array();
objects.push(orb);
objects.push(rotator);
removeObjects = new Array();
rotator.swapDepths(64000);
gameOverScreen.swapDepths(64001);
gameOver = 0;
timeMs = 0;
then = getTimer();
collectedTime = 0;
fpsStorage = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
fpsStorageIndex = 0;
gameTick = 0;
layer = 64000;
invulnerability = 60;
lifeForce = 100;
score = 0;
timesHit = 0;
onEnterFrame = function () {
if (gameOver == 0) {
updateLogic();
updateGraphics();
updateTime();
}
};