Frame 2
if (_root.getBytesLoaded() < _root.getBytesTotal()) {
gotoAndPlay (1);
}
Frame 4
function vecAdd(v0, v1) {
return([v0[0] + v1[0], v0[1] + v1[1]]);
}
function vecSub(v0, v1) {
return([v0[0] - v1[0], v0[1] - v1[1]]);
}
function vecDot(v0, v1) {
return((v0[0] * v1[0]) + (v0[1] * v1[1]));
}
function vecCross(v0, v1) {
return((v0[0] * v1[1]) - (v0[1] * v1[0]));
}
function vecLen(v0) {
return(msqrt(vecLenSq(v0)));
}
function vecLenSq(v0) {
return((v0[0] * v0[0]) + (v0[1] * v0[1]));
}
function vecScale(v, sc) {
return([v[0] * sc, v[1] * sc]);
}
function vecNorm(v) {
var _local1 = vecLen(v);
return([v[0] / _local1, v[1] / _local1]);
}
function vecClip(cl) {
return([cl._x, cl._y]);
}
function vecClipGlob(cl) {
var _local1 = {x:0, y:0};
cl.localToGlobal(_local1);
return([_local1.x, _local1.y]);
}
function vec90(v) {
return([-v[1], v[0]]);
}
function vecRot(v, a) {
var _local2 = sin(a);
var _local3 = cos(a);
var _local5 = (v[0] * _local3) - (v[1] * _local2);
var _local4 = (v[0] * _local2) + (v[1] * _local3);
return([_local5, _local4]);
}
function range() {
return([null, null]);
}
function rangePush(r, n) {
if (r[0] == null) {
r[0] = n;
r[1] = n;
} else {
if (n < r[0]) {
r[0] = n;
}
if (n > r[1]) {
r[1] = n;
}
}
}
function rangeIntersect(r0, r1) {
if (r0[1] < r1[0]) {
return(false);
}
if (r1[1] < r0[0]) {
return(false);
}
var _local1 = r0[1] - r1[0];
var _local3 = r0[0] - r1[1];
if (_local1 < (-_local3)) {
return(_local1);
}
return(_local3);
}
function pjCircle(axis, cc, cr) {
var _local1 = vecDot(axis, cc);
var _local3 = _local1 - cr;
var _local2 = _local1 + cr;
return([_local3, _local2]);
}
function pjSquare(axis, sq0, sq1) {
var _local1 = [null, null];
rangePush(_local1, pjPoint(axis, sq0));
rangePush(_local1, pjPoint(axis, sq1));
rangePush(_local1, pjPoint(axis, [sq0[0], sq1[1]]));
rangePush(_local1, pjPoint(axis, [sq1[0], sq0[1]]));
return(_local1);
}
function pjRotSquare(axis, sq0, sq1, sq2, sq3) {
var _local1 = [null, null];
rangePush(_local1, pjPoint(axis, sq0));
rangePush(_local1, pjPoint(axis, sq1));
rangePush(_local1, pjPoint(axis, sq2));
rangePush(_local1, pjPoint(axis, sq3));
return(_local1);
}
function pjLine(axis, p0, p1) {
var _local1 = [null, null];
rangePush(_local1, pjPoint(axis, p0));
rangePush(_local1, pjPoint(axis, p1));
return(_local1);
}
function colRotSquareCircle(sq0, sq1, sq2, sq3, cc, cr) {
var _local18 = vecSub(sq0, cc);
var _local17 = vecSub(sq1, cc);
var _local16 = vecSub(sq2, cc);
var _local15 = vecSub(sq3, cc);
var _local14 = vecSub(sq1, sq0);
var _local13 = vecSub(sq2, sq0);
var _local6 = [_local14, _local13, _local18, _local17, _local16, _local15];
var _local3 = [null, null];
for (a in _local6) {
var _local2 = vecNorm(_local6[a]);
var _local5 = pjRotSquare(_local2, sq0, sq1, sq2, sq3);
var _local4 = pjCircle(_local2, cc, cr);
var _local1 = rangeIntersect(_local5, _local4);
if (_local1 == false) {
return(false);
}
if ((_local3[0] == null) || ((_local1 * _local1) < vecLenSq(_local3))) {
_local3 = vecScale(_local2, _local1);
}
}
return(_local3);
}
function colSquareCircle(sq0, sq1, cc, cr) {
var _local14 = vecSub(sq0, cc);
var _local13 = vecSub(sq1, cc);
var _local12 = vecSub([sq0[0], sq1[1]], cc);
var _local11 = vecSub([sq1[0], sq0[1]], cc);
var _local6 = [[0, 1], [1, 0], _local14, _local13, _local12, _local11];
var _local3 = [null, null];
for (a in _local6) {
var _local2 = vecNorm(_local6[a]);
var _local5 = pjSquare(_local2, sq0, sq1);
var _local4 = pjCircle(_local2, cc, cr);
var _local1 = rangeIntersect(_local5, _local4);
if (_local1 == false) {
return(false);
}
if ((_local3[0] == null) || ((_local1 * _local1) < vecLenSq(_local3))) {
_local3 = vecScale(_local2, _local1);
}
}
return(_local3);
}
function colCircleCircle(c0, r0, c1, r1) {
var _local1 = vecNorm(vecSub(c1, c0));
var _local4 = pjCircle(_local1, c0, r0);
var _local3 = pjCircle(_local1, c1, r1);
var _local2 = rangeIntersect(_local4, _local3);
if (_local2 == false) {
return(false);
}
return(vecScale(_local1, _local2));
}
function colLineCircle(p0, p1, cc, cr) {
var _local14 = vecSub(p0, cc);
var _local13 = vecSub(p1, cc);
var _local11 = vecSub(p1, p0);
var _local12 = vec90(_local11);
var _local6 = [_local11, _local12, _local14, _local13];
var _local3 = [null, null];
for (a in _local6) {
var _local2 = vecNorm(_local6[a]);
var _local5 = pjLine(_local2, p0, p1);
var _local4 = pjCircle(_local2, cc, cr);
var _local1 = rangeIntersect(_local5, _local4);
if (_local1 == false) {
return(false);
}
if ((_local3[0] == null) || ((_local1 * _local1) < vecLenSq(_local3))) {
_local3 = vecScale(_local2, _local1);
}
}
return(_local3);
}
function nextLevel() {
setLevel(level + 1);
}
function explode(cl) {
lev.fade.gotoAndPlay("flash");
spawn("Explosion", cl.pos);
}
function debris(num, id, nvel, pos0, pos1, scale) {
if (!scale) {
scale = 1;
}
var _local4 = 0;
while (_local4 < num) {
var _local5 = Math.random() * 10;
var _local3 = (Math.random() * 2) * Math.PI;
var _local7 = [_local5 * Math.cos(_local3), _local5 * Math.sin(_local3)];
var _local9 = vecAdd(pos0, _local7);
var _local2 = _root.spawn(id, _local9);
_local2.shape = "circle";
_local2.radius = 10;
_local2.no_actors = true;
_root.pushActor(_local2);
_local2.va = Math.random() * 90;
var _local8 = vecSub(pos0, pos1);
var _local6 = ((Math.random() * Math.PI) / 2) - (Math.PI/4);
_local2.vel = vecScale(vecRot(_local8, _local6), scale * ((Math.random() / 2) + 0.5));
_local2.vel = vecAdd(_local2.vel, nvel);
_local4++;
}
}
function setLevel(n) {
fade.gotoAndPlay(1);
_root.gotoAndStop("level");
level = n;
levnum.display = n;
num_items = 0;
finished = false;
youwin.gotoAndStop(1);
lev.gotoAndStop(1);
lev.onEnterFrame = function () {
clearLevel();
lev.gotoAndStop(n + 1);
lev.onEnterFrame = function () {
cursor._visible = true;
started = false;
numballs.gotoAndStop(lev.numballs);
balls_to_place = lev.numballs;
cursor.gotoAndStop(balls_to_place);
delete this.onEnterFrame;
};
};
}
function pushItem(cl) {
cl.no_walls = true;
cl.weightless = true;
cl.onHit = function (b) {
if (b.is_wall) {
return(true);
}
_root.killActor(this);
_root.popItem();
var _local3 = new Sound(this);
_local3.attachSound("boop");
_local3.start();
return(false);
};
pushActor(cl);
num_items++;
}
function popItem() {
num_items--;
if (num_items <= 0) {
finished = true;
if (!save.data.completed[level]) {
save.data.completed[level] = true;
if (save.data.unlocked == 17) {
var _local2 = true;
var _local1 = 1;
while (_local1 <= 17) {
if (!save.data.completed[_local1]) {
_local2 = false;
break;
}
_local1++;
}
if (_local2) {
save.data.unlocked = 18;
}
} else {
save.data.unlocked++;
if (level == 3) {
save.data.unlocked = save.data.unlocked + 2;
}
}
}
if (level == 18) {
youwin.gotoAndPlay("game");
} else {
youwin.play();
}
}
}
function clearLevel() {
for (i in actors) {
actors[i].removeMovieClip();
}
targets = [];
actors = [];
groups = [];
}
function spawn(id, at) {
var _local2 = lev.getNextHighestDepth();
var _local3 = "s" + _local2;
var _local1 = lev.attachMovie(id, _local3, _local2);
_local1.pos = at;
_local1._x = at[0];
_local1._y = at[1];
return(_local1);
}
function pushActor(a) {
a.id = next_id++;
a.vel = [0, 0];
a.pos = [a._x, a._y];
if ((a.shape == "circle") && (!a.radius)) {
a.radius = a._width / 2;
}
actors.push(a);
}
function pushColTarget(cl) {
cl.is_wall = true;
if (cl.shape == "circle") {
cl.radius = cl._width / 2;
} else if (cl.shape == "rect") {
cl.s0.gp = vecClipGlob(cl.s0);
cl.s1.gp = vecClipGlob(cl.s1);
cl.s2.gp = vecClipGlob(cl.s2);
cl.s3.gp = vecClipGlob(cl.s3);
}
cl.pos = [cl._x, cl._y];
targets.push(cl);
}
function nogo(cl) {
cl._visible = false;
cl.onGameStart = function () {
killTarget(this);
};
}
function pushGroup(cl) {
for (var _local2 in cl) {
cl[_local2].group = cl;
}
if (!cl.moi) {
cl.moi = 1;
}
cl.pos = [cl._x, cl._y];
cl.avel = 0;
groups.push(cl);
}
function doPinwheel(group, p, f, td) {
var _local3 = vecSub(p, group.pos);
var _local1 = vecCross(_local3, f) / group.moi;
group.avel = group.avel + (0.003 * _local1);
}
function collideRectCircle(a, b) {
return(colRotSquareCircle(a.s0.gp, a.s1.gp, a.s2.gp, a.s3.gp, b.pos, b.radius));
}
function collide(a, b) {
if (a.shape != "circle") {
return(undefined);
}
if (b.shape == "circle") {
return(colCircleCircle(b.pos, b.radius, a.pos, a.radius));
}
if (b.shape == "rect") {
return(collideRectCircle(b, a));
}
if (b.shape == "line") {
if (vecDot(a.vel, b.normal) < 0) {
return(colLineCircle(b.s0.gp, b.s1.gp, a.pos, a.radius));
}
return(false);
}
trace((("Collision warning: " + a.shape) + " x ") + b.shape);
return(false);
}
function react(actor, other, col_res) {
actor.pos = vecAdd(actor.pos, col_res);
var _local3 = vecNorm(col_res);
var _local4 = vecScale(_local3, vecDot(actor.vel, _local3));
var _local5 = vecSub(actor.vel, _local4);
if (other.id) {
other.pos = vecSub(other.pos, col_res);
var _local6 = vecScale(_local3, vecDot(other.vel, _local3));
var _local8 = vecSub(other.vel, _local6);
actor.vel = vecAdd(_local5, _local6);
other.vel = vecAdd(_local8, _local4);
} else {
actor.vel = vecAdd(vecScale(_local4, -bounce), vecScale(_local5, 1 - friction));
}
}
function killActor(ac) {
ac.dead = true;
ac._visible = false;
}
function killTarget(tg) {
tg.dead = true;
tg._visible = false;
}
function onMouseDown() {
if (started) {
return(undefined);
}
if (!cursor.ok) {
return(undefined);
}
balls_to_place--;
var _local2 = lev.getNextHighestDepth();
var _local1 = lev.attachMovie("Ball", "b" + _local2, _local2);
_local1._x = lev._xmouse;
_local1._y = lev._ymouse;
_local1.cacheAsBitmap = true;
_local1.shape = "circle";
_local1.is_ball = true;
pushActor(_local1);
cursor.gotoAndStop(balls_to_place);
if (balls_to_place <= 0) {
cursor._visible = false;
started = true;
for (i in targets) {
targets[i].onGameStart();
}
}
onMouseMove();
}
function onMouseMove() {
if (_root._currentframe == 1) {
return(undefined);
}
if (started) {
return(undefined);
}
cursor._x = _xmouse;
cursor._y = _ymouse;
cursor.pos = [cursor._x, cursor._y];
cursor.vel = [0, 0];
cursor.ok = true;
for (i in actors) {
var _local2 = collide(cursor, actors[i]);
if ((_local2 != false) && (!isNaN(_local2[0]))) {
cursor.ok = false;
}
}
if (cursor.ok) {
for (i in targets) {
var _local2 = collide(cursor, targets[i]);
if ((_local2 != false) && (!isNaN(_local2[0]))) {
cursor.ok = false;
}
}
}
cursor.update();
updateAfterEvent();
}
function onEnterFrame() {
if (fade2._alpha <= 0) {
return(undefined);
}
if (lev._currentframe == 1) {
fade2._alpha = fade2._alpha - 4;
} else {
fade2._alpha = fade2._alpha - 25;
}
}
function makeKicker(tg, force) {
tg.onHit = function (by) {
if (finished) {
return(true);
}
var _local3 = vecNorm(vecSub(by.pos, this.pos));
by.vel = vecAdd(by.vel, vecScale(_local3, force));
tg.onKick();
return(true);
};
}
msqrt = Math.sqrt;
cos = Math.cos;
sin = Math.sin;
var vroo = 0;
pjPoint = vecDot;
start_level = 1;
next_id = 0;
gravity = [0, 0.8];
bounce = 0.8;
friction = 0.03;
terminal_velocity = 25;
terminal_velocity_sq = terminal_velocity * terminal_velocity;
_root.scrollRect = new flash.geom.Rectangle(0, 0, Stage.width, Stage.height);
fooner.onRelease = function () {
getURL ("http://foon.co.uk/farcade", "_top");
};
stop();
lev.stop();
save = SharedObject.getLocal("bobteds", "/");
if (!save.data.completed) {
save.data.completed = {};
}
if (!save.data.unlocked) {
save.data.unlocked = 1;
}
var m = new ContextMenu();
m.customItems.push(new ContextMenuItem("Start Again", function () {
save.clear();
gotoAndPlay ("pre");
}));
m.hideBuiltInItems();
_root.menu = m;
Frame 5
function onEnterFrame() {
if (_root.finished) {
passes = 1;
} else {
passes = 2;
}
var _local7 = 1 / passes;
var _local11 = 0;
while (_local11 < passes) {
for (var _local13 in targets) {
targets[_local13].process();
}
if (!started) {
return(undefined);
}
for (var _local13 in groups) {
var _local5 = groups[_local13];
_local5.process();
_local5.avel = _local5.avel * 0.99;
_local5._rotation = _local5._rotation - _local5.avel;
if (_local5.com) {
doPinwheel(_local5, vecClipGlob(_local5.com), [0, -_local7], _local7);
}
}
for (var _local13 in actors) {
var _local2 = actors[_local13];
if (_local2.dead) {
continue;
}
if (!_local2.weightless) {
_local2.vel = vecAdd(_local2.vel, vecScale(gravity, _local7));
}
if (!_local2.fixed) {
_local2.pos = vecAdd(_local2.pos, vecScale(_local2.vel, _local7));
}
if (_local2.va) {
_local2._rotation = _local2._rotation + (_local2.va * _local7);
}
if (!_local2.no_walls) {
for (var _local12 in targets) {
var _local3 = targets[_local12];
if (_local3.dead) {
continue;
}
var _local6 = collide(_local2, _local3, null);
if (_local6 != false) {
react(_local2, _local3, _local6);
if (_local3.kick && (!finished)) {
_local2.vel = vecAdd(_local2.vel, _local3.kick);
if (_local3.red && (_local2.is_ball)) {
_local2.play();
}
}
if (_local3.onHit) {
_local3.onHit(_local2);
}
if (_local2.onHit) {
_local2.onHit(_local3);
}
if (_local3.group.pinwheel) {
doPinwheel(_local3.group, _local2.pos, _local6, _local7);
}
}
}
}
if (!_local2.no_actors) {
for (var _local12 in actors) {
if (_local12 == _local13) {
continue;
}
var _local4 = actors[_local12];
if (_local4.id > _local2.id) {
continue;
}
if (_local4.no_actors) {
continue;
}
var _local8 = collide(_local2, _local4);
if (_local8 != false) {
var _local9 = (_local2.onHit ? (_local2.onHit(_local4)) : true);
var _local10 = (_local4.onHit ? (_local4.onHit(_local2)) : true);
if (_local9 && (_local10)) {
react(_local2, _local4, _local8);
}
}
}
}
while (_local2.pos[1] > Stage.height) {
_local2.pos[1] = _local2.pos[1] - Stage.height;
}
while (_local2.pos[0] > Stage.width) {
_local2.pos[0] = _local2.pos[0] - Stage.width;
}
while (_local2.pos[0] < 0) {
_local2.pos[0] = _local2.pos[0] + Stage.width;
}
if (vecLenSq(_local2.vel) > terminal_velocity_sq) {
_local2.vel = vecScale(_local2.vel, terminal_velocity / vecLen(_local2.vel));
}
_local2._x = _local2.pos[0];
_local2._y = _local2.pos[1];
}
for (var _local13 in actors) {
if (actors[_local13].dead) {
actors[_local13].removeMovieClip();
actors.splice(_local13, 1);
}
}
_local11++;
}
}
brestart.onRelease = function () {
setLevel(level);
};
bquit.onRelease = function () {
clearLevel();
lev.gotoAndStop(1);
gotoAndStop ("menu");
};
Symbol 4 MovieClip [Ball] Frame 1
stop();
Symbol 7 MovieClip [Mario Coin] Frame 1
shape = "circle";
radius = 19;
_root.pushItem(this);
this.weightless = false;
this.no_walls = false;
this.cacheAsBitmap = true;
Symbol 9 MovieClip [WShard] Frame 1
shape = "circle";
radius = 10;
no_actors = true;
gotoAndStop(random(_totalframes) + 1);
onHit = function () {
this._xscale = this._xscale - 8;
this._yscale = this._yscale - 8;
this.radius = this.radius - 1;
if (this._xscale < 1) {
_root.killActor(this);
}
};
Symbol 13 MovieClip [Shard] Frame 1
gotoAndStop(random(_totalframes) + 1);
onHit = function (ot) {
this._xscale = this._xscale - 10;
this._yscale = this._yscale - 10;
this.radius = this.radius - 1;
if (this._xscale < 10) {
_root.killActor(this);
}
};
Symbol 15 MovieClip [Explosion] Frame 4
this.removeMovieClip();
Symbol 19 MovieClip Frame 11
stop();
Symbol 19 MovieClip Frame 30
stop();
Symbol 27 MovieClip Frame 1
shape = "rect";
_root.pushColTarget(this);
Symbol 30 MovieClip Frame 1
shape = "circle";
radius = 20;
_root.pushItem(this);
Symbol 35 MovieClip Frame 1
shape = "circle";
_root.pushColTarget(this);
Symbol 39 MovieClip Frame 1
shape = "circle";
_root.pushItem(this);
Symbol 44 MovieClip Frame 101
gotoAndPlay (1);
Symbol 48 MovieClip Frame 1
shape = "rect";
_root.pushColTarget(this);
_root.nogo(this);
Symbol 50 MovieClip Frame 1
function vecAdd(v0, v1) {
return([v0[0] + v1[0], v0[1] + v1[1]]);
}
function vecSub(v0, v1) {
return([v0[0] - v1[0], v0[1] - v1[1]]);
}
function vecDot(v0, v1) {
return((v0[0] * v1[0]) + (v0[1] * v1[1]));
}
function vecCross(v0, v1) {
return((v0[0] * v1[1]) - (v0[1] * v1[0]));
}
function vecLen(v0) {
return(msqrt(vecLenSq(v0)));
}
function vecLenSq(v0) {
return((v0[0] * v0[0]) + (v0[1] * v0[1]));
}
function vecScale(v, sc) {
return([v[0] * sc, v[1] * sc]);
}
function vecNorm(v) {
var _local1 = vecLen(v);
return([v[0] / _local1, v[1] / _local1]);
}
function vecClip(cl) {
return([cl._x, cl._y]);
}
function vecClipGlob(cl) {
var _local1 = {x:0, y:0};
cl.localToGlobal(_local1);
return([_local1.x, _local1.y]);
}
function vec90(v) {
return([-v[1], v[0]]);
}
function vecRot(v, a) {
var _local2 = sin(a);
var _local3 = cos(a);
var _local5 = (v[0] * _local3) - (v[1] * _local2);
var _local4 = (v[0] * _local2) + (v[1] * _local3);
return([_local5, _local4]);
}
function range() {
return([null, null]);
}
function rangePush(r, n) {
if (r[0] == null) {
r[0] = n;
r[1] = n;
} else {
if (n < r[0]) {
r[0] = n;
}
if (n > r[1]) {
r[1] = n;
}
}
}
function rangeIntersect(r0, r1) {
if (r0[1] < r1[0]) {
return(false);
}
if (r1[1] < r0[0]) {
return(false);
}
var _local1 = r0[1] - r1[0];
var _local3 = r0[0] - r1[1];
if (_local1 < (-_local3)) {
return(_local1);
}
return(_local3);
}
function pjCircle(axis, cc, cr) {
var _local1 = vecDot(axis, cc);
var _local3 = _local1 - cr;
var _local2 = _local1 + cr;
return([_local3, _local2]);
}
function pjSquare(axis, sq0, sq1) {
var _local1 = [null, null];
rangePush(_local1, pjPoint(axis, sq0));
rangePush(_local1, pjPoint(axis, sq1));
rangePush(_local1, pjPoint(axis, [sq0[0], sq1[1]]));
rangePush(_local1, pjPoint(axis, [sq1[0], sq0[1]]));
return(_local1);
}
function pjRotSquare(axis, sq0, sq1, sq2, sq3) {
var _local1 = [null, null];
rangePush(_local1, pjPoint(axis, sq0));
rangePush(_local1, pjPoint(axis, sq1));
rangePush(_local1, pjPoint(axis, sq2));
rangePush(_local1, pjPoint(axis, sq3));
return(_local1);
}
function pjLine(axis, p0, p1) {
var _local1 = [null, null];
rangePush(_local1, pjPoint(axis, p0));
rangePush(_local1, pjPoint(axis, p1));
return(_local1);
}
function colRotSquareCircle(sq0, sq1, sq2, sq3, cc, cr) {
var _local18 = vecSub(sq0, cc);
var _local17 = vecSub(sq1, cc);
var _local16 = vecSub(sq2, cc);
var _local15 = vecSub(sq3, cc);
var _local14 = vecSub(sq1, sq0);
var _local13 = vecSub(sq2, sq0);
var _local6 = [_local14, _local13, _local18, _local17, _local16, _local15];
var _local3 = [null, null];
for (a in _local6) {
var _local2 = vecNorm(_local6[a]);
var _local5 = pjRotSquare(_local2, sq0, sq1, sq2, sq3);
var _local4 = pjCircle(_local2, cc, cr);
var _local1 = rangeIntersect(_local5, _local4);
if (_local1 == false) {
return(false);
}
if ((_local3[0] == null) || ((_local1 * _local1) < vecLenSq(_local3))) {
_local3 = vecScale(_local2, _local1);
}
}
return(_local3);
}
function colSquareCircle(sq0, sq1, cc, cr) {
var _local14 = vecSub(sq0, cc);
var _local13 = vecSub(sq1, cc);
var _local12 = vecSub([sq0[0], sq1[1]], cc);
var _local11 = vecSub([sq1[0], sq0[1]], cc);
var _local6 = [[0, 1], [1, 0], _local14, _local13, _local12, _local11];
var _local3 = [null, null];
for (a in _local6) {
var _local2 = vecNorm(_local6[a]);
var _local5 = pjSquare(_local2, sq0, sq1);
var _local4 = pjCircle(_local2, cc, cr);
var _local1 = rangeIntersect(_local5, _local4);
if (_local1 == false) {
return(false);
}
if ((_local3[0] == null) || ((_local1 * _local1) < vecLenSq(_local3))) {
_local3 = vecScale(_local2, _local1);
}
}
return(_local3);
}
function colCircleCircle(c0, r0, c1, r1) {
var _local1 = vecNorm(vecSub(c1, c0));
var _local4 = pjCircle(_local1, c0, r0);
var _local3 = pjCircle(_local1, c1, r1);
var _local2 = rangeIntersect(_local4, _local3);
if (_local2 == false) {
return(false);
}
return(vecScale(_local1, _local2));
}
function colLineCircle(p0, p1, cc, cr) {
var _local14 = vecSub(p0, cc);
var _local13 = vecSub(p1, cc);
var _local11 = vecSub(p1, p0);
var _local12 = vec90(_local11);
var _local6 = [_local11, _local12, _local14, _local13];
var _local3 = [null, null];
for (a in _local6) {
var _local2 = vecNorm(_local6[a]);
var _local5 = pjLine(_local2, p0, p1);
var _local4 = pjCircle(_local2, cc, cr);
var _local1 = rangeIntersect(_local5, _local4);
if (_local1 == false) {
return(false);
}
if ((_local3[0] == null) || ((_local1 * _local1) < vecLenSq(_local3))) {
_local3 = vecScale(_local2, _local1);
}
}
return(_local3);
}
function process() {
s0.gp = vecClipGlob(s0);
s1.gp = vecClipGlob(s1);
s2.gp = vecClipGlob(s2);
s3.gp = vecClipGlob(s3);
pos = vecClipGlob(this);
vel = vecSub(pos, pold);
pold = pos;
}
msqrt = Math.sqrt;
cos = Math.cos;
sin = Math.sin;
var vroo = 0;
pjPoint = vecDot;
shape = "rect";
_root.pushColTarget(this);
Symbol 51 MovieClip Frame 1
_root.pushGroup(this);
this.pinwheel = true;
Symbol 53 MovieClip Frame 1
shape = "circle";
_root.pushItem(this);
Symbol 66 MovieClip Frame 1
shape = "circle";
radius = 20;
_root.pushItem(this);
Symbol 69 MovieClip Frame 1
function onHit(by) {
by.vel[1] = by.vel[1] / 2;
_root.killTarget(this);
return(true);
}
shape = "rect";
_root.pushColTarget(this);
Symbol 76 MovieClip Frame 1
function onHit(by) {
if (Math.abs(by.vel[1]) <= 6) {
return(true);
}
by.vel[1] = by.vel[1] / 2;
gotoAndStop (2);
var _local5 = _parent.getNextHighestDepth();
var _local4 = _parent.attachMovie("Mario Coin", "c" + _local5, _local5);
_local4.onEnterFrame = function () {
_root.num_items--;
delete this.onEnterFrame;
};
_local4._x = this._x;
_local4._y = this._y + 40;
delete onHit;
return(true);
}
shape = "rect";
_root.pushColTarget(this);
stop();
_root.num_items++;
Symbol 87 MovieClip Frame 1
shape = "circle";
_root.pushColTarget(this);
_root.nogo(this);
Symbol 89 MovieClip Frame 1
shape = "circle";
radius = 20;
_root.pushItem(this);
Symbol 92 MovieClip Frame 1
this.weightless = true;
this.shape = "circle";
this.cacheAsBitmap = true;
_root.pushActor(this);
Symbol 99 MovieClip Frame 1
function vecAdd(v0, v1) {
return([v0[0] + v1[0], v0[1] + v1[1]]);
}
function vecSub(v0, v1) {
return([v0[0] - v1[0], v0[1] - v1[1]]);
}
function vecDot(v0, v1) {
return((v0[0] * v1[0]) + (v0[1] * v1[1]));
}
function vecCross(v0, v1) {
return((v0[0] * v1[1]) - (v0[1] * v1[0]));
}
function vecLen(v0) {
return(msqrt(vecLenSq(v0)));
}
function vecLenSq(v0) {
return((v0[0] * v0[0]) + (v0[1] * v0[1]));
}
function vecScale(v, sc) {
return([v[0] * sc, v[1] * sc]);
}
function vecNorm(v) {
var _local1 = vecLen(v);
return([v[0] / _local1, v[1] / _local1]);
}
function vecClip(cl) {
return([cl._x, cl._y]);
}
function vecClipGlob(cl) {
var _local1 = {x:0, y:0};
cl.localToGlobal(_local1);
return([_local1.x, _local1.y]);
}
function vec90(v) {
return([-v[1], v[0]]);
}
function vecRot(v, a) {
var _local2 = sin(a);
var _local3 = cos(a);
var _local5 = (v[0] * _local3) - (v[1] * _local2);
var _local4 = (v[0] * _local2) + (v[1] * _local3);
return([_local5, _local4]);
}
function range() {
return([null, null]);
}
function rangePush(r, n) {
if (r[0] == null) {
r[0] = n;
r[1] = n;
} else {
if (n < r[0]) {
r[0] = n;
}
if (n > r[1]) {
r[1] = n;
}
}
}
function rangeIntersect(r0, r1) {
if (r0[1] < r1[0]) {
return(false);
}
if (r1[1] < r0[0]) {
return(false);
}
var _local1 = r0[1] - r1[0];
var _local3 = r0[0] - r1[1];
if (_local1 < (-_local3)) {
return(_local1);
}
return(_local3);
}
function pjCircle(axis, cc, cr) {
var _local1 = vecDot(axis, cc);
var _local3 = _local1 - cr;
var _local2 = _local1 + cr;
return([_local3, _local2]);
}
function pjSquare(axis, sq0, sq1) {
var _local1 = [null, null];
rangePush(_local1, pjPoint(axis, sq0));
rangePush(_local1, pjPoint(axis, sq1));
rangePush(_local1, pjPoint(axis, [sq0[0], sq1[1]]));
rangePush(_local1, pjPoint(axis, [sq1[0], sq0[1]]));
return(_local1);
}
function pjRotSquare(axis, sq0, sq1, sq2, sq3) {
var _local1 = [null, null];
rangePush(_local1, pjPoint(axis, sq0));
rangePush(_local1, pjPoint(axis, sq1));
rangePush(_local1, pjPoint(axis, sq2));
rangePush(_local1, pjPoint(axis, sq3));
return(_local1);
}
function pjLine(axis, p0, p1) {
var _local1 = [null, null];
rangePush(_local1, pjPoint(axis, p0));
rangePush(_local1, pjPoint(axis, p1));
return(_local1);
}
function colRotSquareCircle(sq0, sq1, sq2, sq3, cc, cr) {
var _local18 = vecSub(sq0, cc);
var _local17 = vecSub(sq1, cc);
var _local16 = vecSub(sq2, cc);
var _local15 = vecSub(sq3, cc);
var _local14 = vecSub(sq1, sq0);
var _local13 = vecSub(sq2, sq0);
var _local6 = [_local14, _local13, _local18, _local17, _local16, _local15];
var _local3 = [null, null];
for (a in _local6) {
var _local2 = vecNorm(_local6[a]);
var _local5 = pjRotSquare(_local2, sq0, sq1, sq2, sq3);
var _local4 = pjCircle(_local2, cc, cr);
var _local1 = rangeIntersect(_local5, _local4);
if (_local1 == false) {
return(false);
}
if ((_local3[0] == null) || ((_local1 * _local1) < vecLenSq(_local3))) {
_local3 = vecScale(_local2, _local1);
}
}
return(_local3);
}
function colSquareCircle(sq0, sq1, cc, cr) {
var _local14 = vecSub(sq0, cc);
var _local13 = vecSub(sq1, cc);
var _local12 = vecSub([sq0[0], sq1[1]], cc);
var _local11 = vecSub([sq1[0], sq0[1]], cc);
var _local6 = [[0, 1], [1, 0], _local14, _local13, _local12, _local11];
var _local3 = [null, null];
for (a in _local6) {
var _local2 = vecNorm(_local6[a]);
var _local5 = pjSquare(_local2, sq0, sq1);
var _local4 = pjCircle(_local2, cc, cr);
var _local1 = rangeIntersect(_local5, _local4);
if (_local1 == false) {
return(false);
}
if ((_local3[0] == null) || ((_local1 * _local1) < vecLenSq(_local3))) {
_local3 = vecScale(_local2, _local1);
}
}
return(_local3);
}
function colCircleCircle(c0, r0, c1, r1) {
var _local1 = vecNorm(vecSub(c1, c0));
var _local4 = pjCircle(_local1, c0, r0);
var _local3 = pjCircle(_local1, c1, r1);
var _local2 = rangeIntersect(_local4, _local3);
if (_local2 == false) {
return(false);
}
return(vecScale(_local1, _local2));
}
function colLineCircle(p0, p1, cc, cr) {
var _local14 = vecSub(p0, cc);
var _local13 = vecSub(p1, cc);
var _local11 = vecSub(p1, p0);
var _local12 = vec90(_local11);
var _local6 = [_local11, _local12, _local14, _local13];
var _local3 = [null, null];
for (a in _local6) {
var _local2 = vecNorm(_local6[a]);
var _local5 = pjLine(_local2, p0, p1);
var _local4 = pjCircle(_local2, cc, cr);
var _local1 = rangeIntersect(_local5, _local4);
if (_local1 == false) {
return(false);
}
if ((_local3[0] == null) || ((_local1 * _local1) < vecLenSq(_local3))) {
_local3 = vecScale(_local2, _local1);
}
}
return(_local3);
}
function onHit(by) {
if (by.no_actors || (_root.finished)) {
return(true);
}
if (_root.level != 13) {
_root.finished = true;
}
_root.debris(7, "Shard", by.vel, by.pos, this.pos);
_root.explode(this);
var _local3 = new Sound(this);
_local3.attachSound("burst");
_local3.start();
_root.killActor(by);
_root.killTarget(this);
}
msqrt = Math.sqrt;
cos = Math.cos;
sin = Math.sin;
var vroo = 0;
pjPoint = vecDot;
shape = "circle";
radius = 20;
_root.pushColTarget(this);
Symbol 101 MovieClip Frame 1
_root.pushGroup(this);
pinwheel = true;
Symbol 103 MovieClip Frame 1
k.kick = [0, -12];
k.red = true;
Symbol 104 MovieClip Frame 1
_root.pushGroup(this);
this.pinwheel = true;
Symbol 106 MovieClip Frame 1
function vecAdd(v0, v1) {
return([v0[0] + v1[0], v0[1] + v1[1]]);
}
function vecSub(v0, v1) {
return([v0[0] - v1[0], v0[1] - v1[1]]);
}
function vecDot(v0, v1) {
return((v0[0] * v1[0]) + (v0[1] * v1[1]));
}
function vecCross(v0, v1) {
return((v0[0] * v1[1]) - (v0[1] * v1[0]));
}
function vecLen(v0) {
return(msqrt(vecLenSq(v0)));
}
function vecLenSq(v0) {
return((v0[0] * v0[0]) + (v0[1] * v0[1]));
}
function vecScale(v, sc) {
return([v[0] * sc, v[1] * sc]);
}
function vecNorm(v) {
var _local1 = vecLen(v);
return([v[0] / _local1, v[1] / _local1]);
}
function vecClip(cl) {
return([cl._x, cl._y]);
}
function vecClipGlob(cl) {
var _local1 = {x:0, y:0};
cl.localToGlobal(_local1);
return([_local1.x, _local1.y]);
}
function vec90(v) {
return([-v[1], v[0]]);
}
function vecRot(v, a) {
var _local2 = sin(a);
var _local3 = cos(a);
var _local5 = (v[0] * _local3) - (v[1] * _local2);
var _local4 = (v[0] * _local2) + (v[1] * _local3);
return([_local5, _local4]);
}
function range() {
return([null, null]);
}
function rangePush(r, n) {
if (r[0] == null) {
r[0] = n;
r[1] = n;
} else {
if (n < r[0]) {
r[0] = n;
}
if (n > r[1]) {
r[1] = n;
}
}
}
function rangeIntersect(r0, r1) {
if (r0[1] < r1[0]) {
return(false);
}
if (r1[1] < r0[0]) {
return(false);
}
var _local1 = r0[1] - r1[0];
var _local3 = r0[0] - r1[1];
if (_local1 < (-_local3)) {
return(_local1);
}
return(_local3);
}
function pjCircle(axis, cc, cr) {
var _local1 = vecDot(axis, cc);
var _local3 = _local1 - cr;
var _local2 = _local1 + cr;
return([_local3, _local2]);
}
function pjSquare(axis, sq0, sq1) {
var _local1 = [null, null];
rangePush(_local1, pjPoint(axis, sq0));
rangePush(_local1, pjPoint(axis, sq1));
rangePush(_local1, pjPoint(axis, [sq0[0], sq1[1]]));
rangePush(_local1, pjPoint(axis, [sq1[0], sq0[1]]));
return(_local1);
}
function pjRotSquare(axis, sq0, sq1, sq2, sq3) {
var _local1 = [null, null];
rangePush(_local1, pjPoint(axis, sq0));
rangePush(_local1, pjPoint(axis, sq1));
rangePush(_local1, pjPoint(axis, sq2));
rangePush(_local1, pjPoint(axis, sq3));
return(_local1);
}
function pjLine(axis, p0, p1) {
var _local1 = [null, null];
rangePush(_local1, pjPoint(axis, p0));
rangePush(_local1, pjPoint(axis, p1));
return(_local1);
}
function colRotSquareCircle(sq0, sq1, sq2, sq3, cc, cr) {
var _local18 = vecSub(sq0, cc);
var _local17 = vecSub(sq1, cc);
var _local16 = vecSub(sq2, cc);
var _local15 = vecSub(sq3, cc);
var _local14 = vecSub(sq1, sq0);
var _local13 = vecSub(sq2, sq0);
var _local6 = [_local14, _local13, _local18, _local17, _local16, _local15];
var _local3 = [null, null];
for (a in _local6) {
var _local2 = vecNorm(_local6[a]);
var _local5 = pjRotSquare(_local2, sq0, sq1, sq2, sq3);
var _local4 = pjCircle(_local2, cc, cr);
var _local1 = rangeIntersect(_local5, _local4);
if (_local1 == false) {
return(false);
}
if ((_local3[0] == null) || ((_local1 * _local1) < vecLenSq(_local3))) {
_local3 = vecScale(_local2, _local1);
}
}
return(_local3);
}
function colSquareCircle(sq0, sq1, cc, cr) {
var _local14 = vecSub(sq0, cc);
var _local13 = vecSub(sq1, cc);
var _local12 = vecSub([sq0[0], sq1[1]], cc);
var _local11 = vecSub([sq1[0], sq0[1]], cc);
var _local6 = [[0, 1], [1, 0], _local14, _local13, _local12, _local11];
var _local3 = [null, null];
for (a in _local6) {
var _local2 = vecNorm(_local6[a]);
var _local5 = pjSquare(_local2, sq0, sq1);
var _local4 = pjCircle(_local2, cc, cr);
var _local1 = rangeIntersect(_local5, _local4);
if (_local1 == false) {
return(false);
}
if ((_local3[0] == null) || ((_local1 * _local1) < vecLenSq(_local3))) {
_local3 = vecScale(_local2, _local1);
}
}
return(_local3);
}
function colCircleCircle(c0, r0, c1, r1) {
var _local1 = vecNorm(vecSub(c1, c0));
var _local4 = pjCircle(_local1, c0, r0);
var _local3 = pjCircle(_local1, c1, r1);
var _local2 = rangeIntersect(_local4, _local3);
if (_local2 == false) {
return(false);
}
return(vecScale(_local1, _local2));
}
function colLineCircle(p0, p1, cc, cr) {
var _local14 = vecSub(p0, cc);
var _local13 = vecSub(p1, cc);
var _local11 = vecSub(p1, p0);
var _local12 = vec90(_local11);
var _local6 = [_local11, _local12, _local14, _local13];
var _local3 = [null, null];
for (a in _local6) {
var _local2 = vecNorm(_local6[a]);
var _local5 = pjLine(_local2, p0, p1);
var _local4 = pjCircle(_local2, cc, cr);
var _local1 = rangeIntersect(_local5, _local4);
if (_local1 == false) {
return(false);
}
if ((_local3[0] == null) || ((_local1 * _local1) < vecLenSq(_local3))) {
_local3 = vecScale(_local2, _local1);
}
}
return(_local3);
}
msqrt = Math.sqrt;
cos = Math.cos;
sin = Math.sin;
var vroo = 0;
pjPoint = vecDot;
shape = "line";
_root.pushColTarget(this);
s0.gp = vecClipGlob(s0);
s1.gp = vecClipGlob(s1);
normal = vec90(vecSub(s0.gp, s1.gp));
Symbol 111 MovieClip Frame 1
function onHit(by) {
by.vel[1] = by.vel[1] / 2;
_root.killTarget(this);
return(true);
}
shape = "rect";
_root.pushColTarget(this);
this.cacheAsBitmap = true;
Symbol 114 MovieClip Frame 1
shape = "circle";
radius = 20;
_root.pushItem(this);
Symbol 114 MovieClip Frame 24
gotoAndPlay (2);
Symbol 117 MovieClip Frame 1
shape = "circle";
_root.pushColTarget(this);
Symbol 118 MovieClip Frame 1
_root.pushGroup(this);
this.pinwheel = true;
Symbol 124 MovieClip Frame 1
_root.pushGroup(this);
for (i in this) {
this[i]._visible = false;
}
this.pinwheel = true;
this.moi = 16;
Symbol 125 MovieClip Frame 1
_root.pushGroup(this);
this.pinwheel = true;
moi = 0.125;
Symbol 187 MovieClip Frame 1
_root.pushItem(this);
shape = "circle";
radius = 20;
Symbol 188 MovieClip Frame 1
stop();
this.scrollRect = new flash.geom.Rectangle(0, 0, Stage.width, Stage.height);
Symbol 188 MovieClip Frame 2
numballs = 1;
Symbol 188 MovieClip Frame 3
numballs = 1;
Symbol 188 MovieClip Frame 4
numballs = 1;
Symbol 188 MovieClip Frame 5
numballs = 2;
_root.makeKicker(kicker, 30);
Symbol 188 MovieClip Frame 6
numballs = 2;
Symbol 188 MovieClip Frame 7
numballs = 3;
Symbol 188 MovieClip Frame 8
numballs = 2;
ring.onHit = function (b) {
if ((b._x == 74.95) || (b._x == 582.95)) {
_root.debris(4, "WShard", this.vel, this.pos, b.pos, 0.5);
_root.killActor(this);
}
return(true);
};
Symbol 188 MovieClip Frame 9
numballs = 1;
Symbol 188 MovieClip Frame 10
numballs = 1;
_root.makeKicker(kicker, 10);
Symbol 188 MovieClip Frame 11
numballs = 1;
Symbol 188 MovieClip Frame 12
numballs = 2;
Symbol 188 MovieClip Frame 13
numballs = 1;
paddle.onMouseMove = function () {
this._x = this._parent._xmouse;
if (this._x < 130) {
this._x = 130;
}
if (this._x > 510) {
this._x = 510;
}
updateAfterEvent();
};
Symbol 188 MovieClip Frame 14
numballs = 1;
ring.onHit = function (b) {
if ((b._x == 74.95) || (b._x == 582.95)) {
_root.debris(4, "WShard", this.vel, this.pos, b.pos, 0.5);
_root.killActor(this);
}
return(true);
};
Symbol 188 MovieClip Frame 15
numballs = 1;
Symbol 188 MovieClip Frame 16
numballs = 2;
ring2.onHit = function (by) {
if (by == ring1) {
_root.killTarget(ring2);
}
return(true);
};
Symbol 188 MovieClip Frame 17
numballs = 2;
ring2.onHit = function (by) {
if (by == ring1) {
_root.killTarget(ring2);
}
return(true);
};
Symbol 188 MovieClip Frame 18
numballs = 2;
Symbol 188 MovieClip Frame 19
numballs = 1;
Symbol 195 MovieClip Frame 1
stop();
Symbol 197 MovieClip Frame 1
stop();
Symbol 198 MovieClip Frame 1
var levels = [];
for (i in this) {
levels.push(this[i]);
}
levels.sort(function (a, b) {
if (a._y < b._y) {
return(-1);
}
if (a._y > b._y) {
return(1);
}
if (a._x < b._x) {
return(-1);
}
if (a._x > b._x) {
return(1);
}
return(0);
});
for (i in levels) {
var l = levels[i];
l.display = i;
if (_root.save.data.completed[i]) {
l.tick.gotoAndStop(2);
} else {
if (_root.save.data.unlocked < i) {
l.gotoAndStop(2);
continue;
}
l.tick.gotoAndStop(1);
}
l.onRollOver = function () {
_root.lev.gotoAndStop(Number(this.display) + 1);
_root.fade2._alpha = 100;
};
l.onRollOut = function () {
_root.lev.gotoAndStop(1);
_root.fade2._alpha = 100;
};
l.onRelease = function () {
_root.setLevel(Number(this.display));
};
}
Symbol 205 MovieClip Frame 1
stop();
Symbol 207 MovieClip Frame 1
function update() {
nball._visible = ok;
}
stop();
shape = "circle";
radius = 10;
Symbol 219 MovieClip Frame 1
stop();
Symbol 219 MovieClip Frame 15
stop();
hit.onPress = function () {
_root.bquit.onRelease();
};
Symbol 219 MovieClip Frame 25
stop();