Frame 1
game.main(this);
Symbol 20480 MovieClip [__Packages.vehicle] Frame 0
class vehicle
{
var mymc, masses, springs;
function vehicle () {
mymc = _root.createEmptyMovieClip("vehiclemc", 3);
masses = new Array();
springs = new Array();
}
function kill() {
mymc.removeMovieClip();
}
function swap() {
}
function control() {
}
//ASSetPropFlags(_local1, null, 1);
var dir = 1;
var alive = true;
}
Symbol 20481 MovieClip [__Packages.mtb] Frame 0
#initclip
if (!mtb) {
//(_global.mtb = function () {
super();
this.pedala = 0;
this.crashed = false;
this.masses.push(new mass(new cartesian(2, -3), this));
this.masses.push(new wheel(new cartesian(-23, 35), this));
this.masses.push(new wheel(new cartesian(23, 35), this));
this.springs.push(new spring(this.masses[0], this.masses[1], this));
this.springs.push(new spring(this.masses[1], this.masses[2], this));
this.springs.push(new spring(this.masses[2], this.masses[0], this));
this.rearWheel = this.masses[1];
this.frontWheel = this.masses[2];
this.head = this.masses[0];
this.rearSpring = this.springs[0];
this.frontSpring = this.springs[2];
this.chasse = this.springs[1];
this.head.drive = function () {
_root.player.createRagDoll();
};
this.chasse.lrest = (this.chasse.leff = 45);
this.rearSpring.lrest = (this.rearSpring.leff = 47);
this.frontSpring.lrest = (this.frontSpring.leff = 45);
this.rearWheel.radius = 14;
this.frontWheel.radius = 14;
this.head.radius = 14;
for (var i in this.springs) {
this.springs[i].springConstant = 0.2;
}
for (var i in this.springs) {
this.springs[i].dampConstant = 0.3;
}
this.myTrick = new trick(this.rearWheel, this.frontWheel);
}) extends vehicle
var _local1 = (_global.mtb /* register */).prototype;
_local1.kill = function () {
this.mymc.removeMovieClip();
};
_local1.swap = function () {
this.dir = this.dir * -1;
this.chasse.swap();
var _local2 = this.springs[0].leff;
this.rearSpring.leff = this.springs[2].leff;
this.frontSpring.leff = _local2;
this.myTrick = new trick();
};
_local1.control = function () {
if (_root.key.swap) {
this.swap();
_root.key.swap = false;
}
if (_root.key.bail) {
this.createRagDoll();
}
var _local2 = (_root.key.accelerate ? 1 : 0);
this.rearWheel.motor = this.rearWheel.motor + (((_local2 * 1) - this.masses[1].motor) / 10);
if (_root.key.accelerate) {
this.pedala = this.pedala + (this.rearWheel.speed / 5);
}
this.rearWheel.brake = _root.key.brake;
this.frontWheel.brake = _root.key.brake;
var _local3 = (_root.key.left ? 1 : 0);
_local3 = _local3 + (_root.key.right ? -1 : 0);
this.rearSpring.contract((_local3 * 5) * this.dir, 5);
this.frontSpring.contract(((-_local3) * 5) * this.dir, 5);
this.chasse.rotate(_local3 / 8);
if ((_local3 == 0) && (_root.key.accelerate)) {
this.rearSpring.contract(-7, 5);
this.frontSpring.contract(7, 5);
}
};
_local1.drawBike = function () {
var _local2 = this.rearWheel.pos.toScreen();
var _local3 = this.frontWheel.pos.toScreen();
var _local4 = this.head.pos.toScreen();
var _local5 = _local3.sub(_local2);
var _local6 = new cartesian((_local3.y - _local2.y) * this.dir, (_local2.x - _local3.x) * this.dir);
var _local7 = _local4.sub(_local2.add(_local5.factor(0.5)));
plot.wheel(this.mymc, _local2.x, _local2.y, this.rearWheel.radius * _root.cam.zoom, this.rearWheel.angle, 4);
plot.wheel(this.mymc, _local3.x, _local3.y, this.frontWheel.radius * _root.cam.zoom, this.frontWheel.angle, 4);
plot.circle(this.mymc, _local3.x, _local3.y, 4 * _root.cam.zoom, 1 * _root.cam.zoom, 8947848);
plot.circle(this.mymc, _local2.x, _local2.y, 3 * _root.cam.zoom, 3 * _root.cam.zoom, 8947848);
this.mymc.lineStyle(5 * _root.cam.zoom, 0);
this.mymc.moveTo(_local2.x, _local2.y);
this.mymc.lineTo((_local2.x + (_local5.x * 0.4)) + (_local6.x * 0.05), (_local2.y + (_local5.y * 0.4)) + (_local6.y * 0.05));
this.mymc.lineStyle(5 * _root.cam.zoom, 0);
this.mymc.moveTo((_local2.x + (_local5.x * 0.72)) + (_local7.x * 0.64), (_local2.y + (_local5.y * 0.72)) + (_local7.y * 0.64));
this.mymc.lineTo((_local2.x + (_local5.x * 0.46)) + (_local7.x * 0.4), (_local2.y + (_local5.y * 0.46)) + (_local7.y * 0.4));
this.mymc.lineTo((_local2.x + (_local5.x * 0.4)) + (_local6.x * 0.05), (_local2.y + (_local5.y * 0.4)) + (_local6.y * 0.05));
this.mymc.lineStyle(2 * _root.cam.zoom, 0);
this.mymc.moveTo((_local2.x + (_local5.x * 0.72)) + (_local7.x * 0.64), (_local2.y + (_local5.y * 0.72)) + (_local7.y * 0.64));
this.mymc.lineTo((_local2.x + (_local5.x * 0.43)) + (_local6.x * 0.05), (_local2.y + (_local5.y * 0.43)) + (_local6.y * 0.05));
this.mymc.lineStyle(2 * _root.cam.zoom, 16711680);
this.mymc.moveTo((_local2.x + (_local5.x * 0.71)) + (_local7.x * 0.73), (_local2.y + (_local5.y * 0.71)) + (_local7.y * 0.73));
this.mymc.lineStyle(1 * _root.cam.zoom, 0);
this.mymc.moveTo((_local2.x + (_local5.x * 0.46)) + (_local7.x * 0.4), (_local2.y + (_local5.y * 0.46)) + (_local7.y * 0.4));
this.mymc.lineTo((_local2.x + (_local5.x * 0.28)) + (_local7.x * 0.5), (_local2.y + (_local5.y * 0.28)) + (_local7.y * 0.5));
this.mymc.lineStyle(2 * _root.cam.zoom, 0);
this.mymc.moveTo((_local2.x + (_local5.x * 0.45)) + (_local7.x * 0.3), (_local2.y + (_local5.y * 0.45)) + (_local7.y * 0.3));
this.mymc.lineTo((_local2.x + (_local5.x * 0.3)) + (_local7.x * 0.4), (_local2.y + (_local5.y * 0.3)) + (_local7.y * 0.4));
this.mymc.lineTo((_local2.x + (_local5.x * 0.25)) + (_local7.x * 0.6), (_local2.y + (_local5.y * 0.25)) + (_local7.y * 0.6));
this.mymc.moveTo((_local2.x + (_local5.x * 0.17)) + (_local7.x * 0.6), (_local2.y + (_local5.y * 0.17)) + (_local7.y * 0.6));
this.mymc.lineTo((_local2.x + (_local5.x * 0.3)) + (_local7.x * 0.6), (_local2.y + (_local5.y * 0.3)) + (_local7.y * 0.6));
this.mymc.lineStyle(3 * _root.cam.zoom, 0);
this.mymc.moveTo(_local3.x, _local3.y);
this.mymc.lineTo((_local2.x + (_local5.x * 0.71)) + (_local7.x * 0.73), (_local2.y + (_local5.y * 0.71)) + (_local7.y * 0.73));
this.mymc.lineTo((_local2.x + (_local5.x * 0.73)) + (_local7.x * 0.77), (_local2.y + (_local5.y * 0.73)) + (_local7.y * 0.77));
this.mymc.lineTo((_local2.x + (_local5.x * 0.7)) + (_local7.x * 0.8), (_local2.y + (_local5.y * 0.7)) + (_local7.y * 0.8));
this.mymc.lineStyle(1 * _root.cam.zoom, 0);
var _local8 = new cartesian((6 * Math.cos(this.pedala)) * _root.cam.zoom, (6 * Math.sin(this.pedala)) * _root.cam.zoom);
this.mymc.moveTo(((_local2.x + (_local5.x * 0.43)) + (_local6.x * 0.05)) + _local8.x, ((_local2.y + (_local5.y * 0.43)) + (_local6.y * 0.05)) + _local8.y);
this.mymc.lineTo(((_local2.x + (_local5.x * 0.43)) + (_local6.x * 0.05)) - _local8.x, ((_local2.y + (_local5.y * 0.43)) + (_local6.y * 0.05)) - _local8.y);
if (this.crashed) {
return(undefined);
}
_local6 = _local4.sub(_local2.add(_local5.factor(0.5)));
var _local9 = _local2.add(_local5.factor(0.3)).add(_local6.factor(0.25));
var _local10 = _local2.add(_local5.factor(0.4)).add(_local6.factor(0.05));
var _local11 = _local10.add(_local8);
var _local12 = _local10.sub(_local8);
var _local13 = _local2.add(_local5.factor(0.67)).add(_local6.factor(0.8));
var _local14 = _local9.add(_local5.factor(-0.05)).add(_local6.factor(0.42));
var _local15 = _local11.sub(_local14);
_local7 = new cartesian(_local15.y * this.dir, (-_local15.x) * this.dir);
_local7 = _local7.factor(_root.cam.zoom * _root.cam.zoom);
var _local16 = _local14.add(_local15.factor(0.5)).add(_local7.factor(200 / _local15.lenSqr()));
var _local17 = _local11.add(_local15.factor(0.12)).add(_local7.factor(50 / _local15.lenSqr()));
_local15 = _local12.sub(_local14);
_local7 = new cartesian(_local15.y * this.dir, (-_local15.x) * this.dir);
_local7 = _local7.factor(_root.cam.zoom * _root.cam.zoom);
var _local18 = _local14.add(_local15.factor(0.5)).add(_local7.factor(200 / _local15.lenSqr()));
var _local19 = _local12.add(_local15.factor(0.12)).add(_local7.factor(50 / _local15.lenSqr()));
this.mymc.lineStyle(6 * _root.cam.zoom, 0, 40);
this.mymc.moveTo(_local12.x, _local12.y);
this.mymc.lineTo(_local18.x, _local18.y);
this.mymc.lineTo(_local14.x, _local14.y);
this.mymc.lineStyle(4 * _root.cam.zoom, 0, 40);
this.mymc.moveTo(_local12.x, _local12.y);
this.mymc.lineTo(_local19.x, _local19.y);
this.mymc.lineStyle(6 * _root.cam.zoom, 0);
this.mymc.moveTo(_local11.x, _local11.y);
this.mymc.lineTo(_local16.x, _local16.y);
this.mymc.lineTo(_local14.x, _local14.y);
this.mymc.lineStyle(4 * _root.cam.zoom, 0);
this.mymc.moveTo(_local11.x, _local11.y);
this.mymc.lineTo(_local17.x, _local17.y);
var _local20 = _local9.add(_local5.factor(0.1)).add(_local6.factor(0.95));
this.mymc.lineStyle(8 * _root.cam.zoom, 0);
this.mymc.moveTo(_local14.x, _local14.y);
this.mymc.lineTo(_local20.x, _local20.y);
var _local21 = _local9.add(_local5.factor(0.2)).add(_local6.factor(1.09));
plot.circle(this.mymc, _local21.x, _local21.y, 2 * _root.cam.zoom, 4 * _root.cam.zoom, 16777215);
plot.circle(this.mymc, _local21.x, _local21.y, 5 * _root.cam.zoom, 2 * _root.cam.zoom, 0);
this.mymc.lineStyle(2 * _root.cam.zoom, 0);
var _local22 = _local9.add(_local5.factor(0.4)).add(_local6.factor(1.15));
var _local23 = _local9.add(_local5.factor(0.1)).add(_local6.factor(1.05));
this.mymc.moveTo(_local22.x, _local22.y);
this.mymc.lineTo(_local23.x, _local23.y);
_local5 = _local20.sub(_local13);
_local6 = new cartesian(_local5.y * this.dir, (-_local5.x) * this.dir);
_local6 = _local6.factor(_root.cam.zoom * _root.cam.zoom);
var _local24 = _local13.add(_local5.factor(0.3)).add(_local6.factor(80 / _local5.lenSqr()));
this.mymc.lineStyle(5 * _root.cam.zoom, 0);
this.mymc.moveTo(_local20.x, _local20.y);
this.mymc.lineTo(_local24.x, _local24.y);
this.mymc.lineTo(_local13.x, _local13.y);
};
_local1.getStick = function () {
var _local2 = this.frontWheel.pos.sub(this.rearWheel.pos);
var _local3 = this.head.pos.sub(this.frontWheel.pos.add(this.rearWheel.pos).factor(0.5));
var _local4 = new cartesian(_local2.y * this.dir, (-_local2.x) * this.dir);
var _local5 = new Object();
_local5.head = this.rearWheel.pos.add(_local2.factor(0.35)).add(_local3.factor(1.2));
_local5.lHand = (_local5.rHand = this.rearWheel.pos.add(_local2.factor(0.8)).add(_local4.factor(0.68)));
var _local6 = _local5.head.sub(_local5.lHand);
_local6 = new cartesian(_local6.y * this.dir, (-_local6.x) * this.dir);
_local5.lElbow = (_local5.rElbow = _local5.head.add(_local5.lHand).factor(0.5).add(_local6.factor(130 / _local6.lenSqr())));
_local5.waist = this.rearWheel.pos.add(_local2.factor(0.2)).add(_local4.factor(0.5));
var _local7 = new cartesian(6 * Math.cos(this.pedala), 6 * Math.sin(this.pedala));
_local5.lFoot = this.rearWheel.pos.add(_local2.factor(0.4)).add(_local4.factor(0.05)).add(_local7);
_local6 = _local5.waist.sub(_local5.lFoot);
_local6 = new cartesian((-_local6.y) * this.dir, _local6.x * this.dir);
_local5.lKnee = _local5.waist.add(_local5.lFoot).factor(0.5).add(_local6.factor(160 / _local6.lenSqr()));
_local5.rFoot = this.rearWheel.pos.add(_local2.factor(0.4)).add(_local4.factor(0.05)).sub(_local7);
_local6 = _local5.waist.sub(_local5.rFoot);
_local6 = new cartesian((-_local6.y) * this.dir, _local6.x * this.dir);
_local5.rKnee = _local5.waist.add(_local5.rFoot).factor(0.5).add(_local6.factor(160 / _local6.lenSqr()));
return(_local5);
};
_local1.draw = function () {
this.mymc.clear();
this.drawBike();
};
_local1.createRagDoll = function () {
_root.gui.message("Ouch! [Press Enter]", 16764108);
this.crashed = true;
this.myTrick = undefined;
this.head.drive = undefined;
this.rearWheel.motor = 0;
this.rearWheel.brake = false;
this.frontWheel.brake = false;
this.head.collide = false;
_root.player = new splitBike(this, this.getStick());
};
_local1.update = function () {
if (!this.crashed) {
this.control();
}
for (var i in this.springs) {
this.springs[i].update();
}
for (var i in this.masses) {
this.masses[i].update();
}
if (this.rearWheel.contact && (this.frontWheel.contact)) {
_root.slow = false;
}
this.myTrick.update(this.rearWheel, this.frontWheel, this.dir);
if ((!_root.slow) && (!this.crashed)) {
this.control();
for (var i in this.springs) {
this.springs[i].update();
}
for (var i in this.masses) {
this.masses[i].update();
}
this.myTrick.update(this.rearWheel, this.frontWheel, this.dir);
}
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20482 MovieClip [__Packages.powerup] Frame 0
class powerup
{
var remove, p, mymc;
function powerup (pX, pY, pMC) {
remove = false;
}
function getCode() {
return(undefined);
}
function draw(pMC) {
var _local3 = p.toScreen();
mymc._visible = true;
mymc._x = _local3.x;
mymc._y = _local3.y;
mymc._xscale = (mymc._yscale = _root.cam.zoom * 70);
}
function erase(pPos) {
var _local3 = pPos.sub(p).lenSqr();
if (_local3 < 500) {
mymc.removeMovieClip();
remove = true;
_root.sectors.remove(p, p);
}
}
function collide(pObj) {
}
//ASSetPropFlags(_local1, null, 1);
}
Symbol 20483 MovieClip [__Packages.target] Frame 0
#initclip
if (!target) {
//(_global.target = function (pX, pY, pMC) {
super();
this.p = new cartesian(Math.round(pX), Math.round(pY));
var _local6 = pMC.getNextHighestDepth();
this.mymc = pMC.attachMovie("pu_star", "pu_" + _local6, _local6, {_visible:false});
this.hit = false;
_root.targetCount++;
}) extends powerup
var _local1 = (_global.target /* register */).prototype;
_local1.getCode = function () {
return("T " + parser.point(this.p));
};
_local1.collide = function (pObj) {
var _local3 = pObj.pos.sub(this.p).lenSqr();
if ((!this.hit) && (_local3 < 500)) {
_root.targetHit++;
if (_root.targetHit == _root.targetCount) {
var _local4 = (getTimer() - _root.targetTime) / 1000;
_root.gui.message(("Level Complete! (" + _local4) + "s)", 14548957);
} else {
_root.gui.message(((("Goal " + _root.targetHit) + " of ") + _root.targetCount) + "!", 14548957);
}
this.mymc._alpha = 20;
this.hit = true;
}
};
_local1.erase = function (pPos) {
var _local3 = pPos.sub(this.p).lenSqr();
if (_local3 < 500) {
this.mymc.removeMovieClip();
_root.targetCount = _root.targetCount + -1;
this.remove = true;
_root.sectors.remove(this.p);
}
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20484 MovieClip [__Packages.bresenham] Frame 0
class bresenham
{
function bresenham () {
}
static function getSectors(p1, p2, sectorSize) {
var _local5 = new Array();
var _local6 = new cartesian(p1.x, p1.y);
var _local7 = (p2.y - p1.y) / (p2.x - p1.x);
var _local8 = new cartesian(((p1.x < p2.x) ? 1 : -1), ((p1.y < p2.y) ? 1 : -1));
var _local9 = Math.round;
var _local10 = Math.floor;
var _local11 = Math.ceil;
var _local12 = Math.pow;
var _local13 = true;
if (_local10((_local6.x - 1) / sectorSize) != _local10(p2.x / sectorSize)) {
_local13 = false;
}
if (_local10((_local6.y - 1) / sectorSize) != _local10(p2.y / sectorSize)) {
_local13 = false;
}
var _local14 = 0;
_local5.push(p1);
do {
var _local15 = _local10(_local6.x / sectorSize) == _local10(p2.x / sectorSize);
var _local16 = _local10(_local6.y / sectorSize) == _local10(p2.y / sectorSize);
if (_local15 && (_local16)) {
break;
}
var _local17 = new cartesian();
_local17.x = _local9(_local10((_local6.x / sectorSize) + _local8.x) * sectorSize);
if (_local8.x < 0) {
_local17.x = _local9(_local11(((_local6.x + 1) / sectorSize) + _local8.x) * sectorSize) - 1;
}
_local17.y = _local9(p1.y + ((_local17.x - p1.x) * _local7));
var _local18 = new cartesian();
_local18.y = _local9(_local10((_local6.y / sectorSize) + _local8.y) * sectorSize);
if (_local8.y < 0) {
_local18.y = _local9(_local11(((_local6.y + 1) / sectorSize) + _local8.y) * sectorSize) - 1;
}
_local18.x = _local9(p1.x + ((_local18.y - p1.y) / _local7));
if ((_local12(_local17.x - p1.x, 2) + _local12(_local17.y - p1.y, 2)) < (_local12(_local18.x - p1.x, 2) + _local12(_local18.y - p1.y, 2))) {
_local6 = _local17;
_local5.push(_local6);
} else {
_local6 = _local18;
_local5.push(_local6);
}
} while ((_local14++) < 5000);
return(_local5);
}
//ASSetPropFlags(_local1, null, 1);
}
Symbol 20485 MovieClip [__Packages.keyHandler] Frame 0
class keyHandler
{
var bail, swap, swap_lg, accelerate, left, right, brake, camera, quick, grid_lg, w, s, a, d;
function keyHandler () {
}
function update() {
if (Key.isDown(Key.ENTER)) {
console.action("restart");
}
bail = Key.isDown(66);
swap = false;
if (Key.isDown(90)) {
if (swap_lg) {
swap = true;
}
swap_lg = false;
} else {
swap_lg = true;
}
accelerate = Key.isDown(Key.UP);
left = Key.isDown(Key.LEFT);
right = Key.isDown(Key.RIGHT);
brake = Key.isDown(Key.DOWN);
camera = Key.isDown(Key.CONTROL);
quick = Key.isDown(Key.SHIFT);
if (Key.isDown(71)) {
if (grid_lg) {
_root.mouse.grid = !_root.mouse.grid;
}
grid_lg = false;
_root.gui.message((_root.mouse.grid ? "Grid on" : "Grid off"));
} else {
grid_lg = true;
}
w = Key.isDown(87);
s = Key.isDown(83);
a = Key.isDown(65);
d = Key.isDown(68);
}
//ASSetPropFlags(_local1, null, 1);
}
Symbol 20486 MovieClip [__Packages.sline] Frame 0
class sline
{
var p1, p2, remove, drawn;
function sline (pX1, pY1, pX2, pY2) {
p1 = new cartesian(pX1, pY1);
p2 = new cartesian(pX2, pY2);
var _local6 = p2.sub(p1);
var _local7 = _local6.length();
remove = (_local7 < 3) || (_local7 > 100000);
}
function getCode() {
drawn = true;
var _local2 = " " + parser.point(p2);
var _local3 = _root.sectors.search(p2);
if (_local3 != undefined) {
_local2 = _local2 + _local3.getCode();
}
return(_local2);
}
function draw(pMC) {
if (drawn) {
return(undefined);
}
drawn = true;
var _local3 = p1.toScreen();
var _local4 = p2.toScreen();
pMC.lineStyle(1, 11184810, 100);
pMC.moveTo(_local3.x, _local3.y);
pMC.lineTo(_local4.x, _local4.y);
}
function erase(m) {
var _local3 = 15;
var _local4 = new cartesian(0, 0);
var _local5 = 0;
var _local6 = m.sub(p1);
var _local7 = p2.sub(p1);
var _local8 = _local7.length();
var _local9 = (_local6.dot(_local7) / _local8) / _local8;
if ((_local9 >= 0) && (_local9 <= 1)) {
_local4 = _local6.sub(_local7.factor(_local9));
_local5 = _local4.length();
if (_local5 < _local3) {
remove = true;
_root.sectors.remove(p1, p2);
}
}
}
//ASSetPropFlags(_local1, null, 1);
}
Symbol 20487 MovieClip [__Packages.mass] Frame 0
class mass
{
var pos, old, vel, parent, radius, friction, collide, grav, contact;
function mass (pPos, pParent) {
pos = new cartesian(pPos.x, pPos.y);
old = new cartesian(pPos.x, pPos.y);
vel = new cartesian(0, 0);
parent = pParent;
radius = 10;
friction = 0;
collide = true;
grav = true;
}
function drive(pDir) {
pos.inc(pDir.factor((-pDir.dot(vel)) * friction));
contact = true;
}
function update() {
if (grav) {
vel.inc(_root.grav);
}
vel = vel.factor(0.99);
pos.inc(vel);
contact = false;
if (collide) {
_root.sectors.collide(this);
}
vel = pos.sub(old);
old.equ(pos);
}
//ASSetPropFlags(_local1, null, 1);
}
Symbol 20488 MovieClip [__Packages.debris] Frame 0
#initclip
if (!debris) {
//(_global.debris = function (pPos, pParent) {
super();
this.pos = new cartesian(pPos.x + (5 * (Math.random() - Math.random())), pPos.y + (5 * (Math.random() - Math.random())));
this.old = new cartesian(this.pos.x, this.pos.y);
this.vel = new cartesian(11 * (Math.random() - Math.random()), 11 * (Math.random() - Math.random()));
this.parent = pParent;
this.radius = 2 + (Math.random() * 9);
this.angle = Math.random() * 6.2;
this.speed = (Math.random() * 1) - (Math.random() * 1);
this.friction = 0.05;
}) extends mass
var _local1 = (_global.debris /* register */).prototype;
_local1.draw = function () {
var _local2 = this.pos.toScreen();
var _local3 = 0;
this.angle = this.angle + this.speed;
this.parent.mymc.lineStyle(0 * _root.cam.zoom, 0);
var _local4 = (this.shape[0] * _root.cam.zoom) * this.radius;
var _local5 = _local2.x + (_local4 * Math.cos(this.angle));
var _local6 = _local2.y + (_local4 * Math.sin(this.angle));
this.parent.mymc.moveTo(_local5, _local6);
this.parent.mymc.beginFill(0, 100);
while ((_local3++) < 8) {
_local4 = (this.shape[_local3 - 1] * _root.cam.zoom) * this.radius;
_local5 = _local2.x + (_local4 * Math.cos(this.angle + ((6.283 * _local3) / 8)));
_local6 = _local2.y + (_local4 * Math.sin(this.angle + ((6.283 * _local3) / 8)));
this.parent.mymc.lineTo(_local5, _local6);
}
this.parent.mymc.endFill();
};
_local1.drive = function (pDir) {
this.speed = pDir.dot(this.vel) / this.radius;
this.pos.inc(pDir.factor((-pDir.dot(this.vel)) * this.friction));
this.angle = this.angle + this.speed;
var _local3 = pDir.length();
if (_local3 > 0) {
var _local4 = new cartesian((-pDir.y) / _local3, pDir.x / _local3);
this.old.inc(_local4.factor(_local4.dot(this.vel) * 0.8));
}
};
ASSetPropFlags(_local1, null, 1);
_local1.shape = [1, 0.7, 0.8, 0.9, 0.5, 1, 0.7, 1];
}
#endinitclip
Symbol 20489 MovieClip [__Packages.cartesian] Frame 0
class cartesian
{
var x, y;
function cartesian (pX, pY) {
x = pX;
y = pY;
}
function toScreen() {
return(new cartesian(((x - _root.cam.pos.x) * _root.cam.zoom) + 250, ((y - _root.cam.pos.y) * _root.cam.zoom) + 200));
}
function toReal() {
return(new cartesian(((x - 250) / _root.cam.zoom) + _root.cam.pos.x, ((y - 200) / _root.cam.zoom) + _root.cam.pos.y));
}
function equ(p) {
x = p.x;
y = p.y;
}
function add(p) {
return(new cartesian(x + p.x, y + p.y));
}
function sub(p) {
return(new cartesian(x - p.x, y - p.y));
}
function inc(p) {
x = x + p.x;
y = y + p.y;
}
function factor(p) {
return(new cartesian(x * p, y * p));
}
function dot(p) {
return((x * p.x) + (y * p.y));
}
function length() {
return(Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2)));
}
function lenSqr() {
return(Math.pow(x, 2) + Math.pow(y, 2));
}
//ASSetPropFlags(_local1, null, 1);
}
Symbol 20490 MovieClip [__Packages.parser] Frame 0
class parser
{
function parser () {
}
static function point(p) {
return((p.x.toString(32) + " ") + p.y.toString(32));
}
static function getCode(p) {
var _local3 = p.lines;
var _local4 = p.slines;
var _local5 = p.powerups;
var _local6 = "";
var _local7 = _local3.length;
var _local8 = _local4.length;
if (_local7 == undefined) {
return("error: unknown");
}
for (var i in _local3) {
_local3[i].drawn = false;
}
var _local9 = 0;
while (_local9 < _local7) {
_local9 = 0;
while (_local3[_local9].drawn && (_local9 < _local7)) {
_local9++;
}
_root.halt = 0;
if (_local9 < _local7) {
_local6 = _local6 + ((point(_local3[_local9].p1) + _local3[_local9].getCode()) + ",");
}
}
_local6 = _local6.slice(0, _local6.length - 1);
_local6 = _local6 + "#";
if (_local8 > 0) {
for (_local9 in _local4) {
_local4[_local9].drawn = false;
}
_local9 = 0;
while (_local9 < _local8) {
_local9 = 0;
while (_local4[_local9].drawn && (_local9 < _local8)) {
_local9++;
}
if (_local9 < _local8) {
_local6 = _local6 + ((point(_local4[_local9].p1) + _local4[_local9].getCode()) + ",");
}
}
_local6 = _local6.slice(0, _local6.length - 1);
}
_local6 = _local6 + "#";
if (_local5.length > 0) {
for (var j in _local5) {
_local6 = _local6 + (_local5[j].getCode() + ",");
}
_local6 = _local6.slice(0, _local6.length - 1);
}
return(_local6);
}
static function loadMap(p) {
var _local3 = false;
var _local4 = p.split("#")[0].split(" ");
var _local5 = p.split("#")[0].split(",");
if ((_local4.length < _local5.length) && (_local4.length > 3)) {
_local3 = true;
var _local6 = "";
var _local7 = 0;
for ( ; _local7 < _local4.length ; _local7++) {
var _local8 = _local4[_local7].split(",");
var _local9 = 0;
for ( ; _local9 < _local8.length ; _local9++) {
_local6 = _local6 + (_local8[_local9] + " ");
}
_local6 = _local6 + ",";
}
_local6 = _local6 + "##";
var _local10 = p.split("#")[1].split(" ");
var _local11 = 0;
for ( ; _local11 < _local10.length ; _local11++) {
_local6 = _local6 + "T ";
var _local12 = _local10[_local11].split(",");
var _local13 = 0;
for ( ; _local13 < _local12.length ; _local13++) {
_local6 = _local6 + (_local12[_local13] + " ");
}
_local6 = _local6 + ",";
}
p = _local6;
}
var _local14 = new sectorHandler();
_local4 = p.split("#");
var _local15 = _local4[0].split(",");
var _local16 = _local4[1].split(",");
var _local17 = _local4[2].split(",");
var _local18 = 0;
for ( ; _local18 < _local15.length ; _local18++) {
_local4 = _local15[_local18].split(" ");
if (_local4.length >= 4) {
var _local19 = new Array();
var _local20 = 0;
for ( ; _local20 < _local4.length ; _local20++) {
_local19.push(_global.parseInt(_local4[_local20], 32));
}
var _local21 = _local19[0];
var _local22 = _local19[1];
var _local23 = 2;
while (_local23 < (_local19.length - 1)) {
_local14.newLine(_local21, _local22, _local19[_local23], _local19[_local23 + 1]);
_local21 = _local19[_local23];
_local22 = _local19[_local23 + 1];
_local23 = _local23 + 2;
}
}
}
var _local24 = 0;
for ( ; _local24 < _local16.length ; _local24++) {
_local4 = _local16[_local24].split(" ");
if (_local4.length >= 4) {
var _local25 = new Array();
var _local26 = 0;
for ( ; _local26 < _local4.length ; _local26++) {
_local25.push(_global.parseInt(_local4[_local26], 32));
}
var _local27 = _local25[0];
var _local28 = _local25[1];
var _local29 = 2;
while (_local29 < (_local25.length - 1)) {
_local14.sceneryLine(_local27, _local28, _local25[_local29], _local25[_local29 + 1]);
_local27 = _local25[_local29];
_local28 = _local25[_local29 + 1];
_local29 = _local29 + 2;
}
}
}
var _local30 = 0;
for ( ; _local30 < _local17.length ; _local30++) {
_local4 = _local17[_local30].split(" ");
if (_local4.length >= 2) {
var _local31 = new Array();
var _local32 = 1;
for ( ; _local32 < _local4.length ; _local32++) {
_local31.push(_global.parseInt(_local4[_local32], 32));
}
if (_local4[0] == "T") {
_local14.newTarget(_local31[0], _local31[1]);
}
if (_local4[0] == "S") {
_local14.newPowerup(_local31[0], _local31[1], 1);
}
if (_local4[0] == "G") {
_local14.newPowerup(_local31[0], _local31[1], 2, _local31[2] + 180);
}
if (_local4[0] == "B") {
_local14.newPowerup(_local31[0], _local31[1], 3, _local31[2] + 180);
}
if (_local4[0] == "O") {
_local14.newPowerup(_local31[0], _local31[1], 4);
}
}
}
return(_local14);
}
//ASSetPropFlags(_local1, null, 1);
}
Symbol 20491 MovieClip [__Packages.sector] Frame 0
class sector
{
var lines, powerups;
function sector (pI, pJ) {
lines = new Array();
powerups = new Array();
}
function addLine(pObj) {
lines.push(pObj);
}
function addPowerup(pObj) {
powerups.push(pObj);
}
function resetDrawn() {
for (var k in lines) {
lines[k].drawn = false;
}
}
function search(p) {
for (var k in lines) {
if ((lines[k].p1.x == p.x) && ((lines[k].p1.y == p.y) && (!lines[k].drawn))) {
return(lines[k]);
}
}
return(undefined);
}
function resetCollided() {
for (var k in lines) {
lines[k].collided = false;
}
}
function hidePowerups() {
for (var k in powerups) {
powerups[k].mymc._visible = false;
}
}
function erase(p) {
for (var k in lines) {
lines[k].erase(p);
}
for (var k in powerups) {
powerups[k].erase(p);
}
}
function remove() {
for (var i in lines) {
if (lines[i].remove) {
lines[i] = undefined;
}
}
for (var i in powerups) {
if (powerups[i].remove) {
powerups[i] = undefined;
}
}
}
function collide(pObj) {
for (var i in lines) {
lines[i].collide(pObj);
}
if (_root.player.alive) {
for (var i in powerups) {
powerups[i].collide(pObj);
}
}
}
function draw(pMC) {
for (var i in lines) {
lines[i].draw(pMC);
}
for (var i in powerups) {
powerups[i].draw(pMC);
}
}
//ASSetPropFlags(_local1, null, 1);
}
Symbol 20492 MovieClip [__Packages.helicopter] Frame 0
#initclip
if (!helicopter) {
//(_global.helicopter = function () {
super();
this.masses.push(new prop(new cartesian(0, 18), this));
this.masses.push(new mass(new cartesian(-17, 42), this));
this.masses.push(new mass(new cartesian(17, 42), this));
this.masses.push(new mass(new cartesian(-40, 15), this));
this.masses.push(new mass(new cartesian(40, 15), this));
this.springs.push(new spring(this.masses[0], this.masses[1], this));
this.springs.push(new spring(this.masses[2], this.masses[0], this));
this.springs.push(new spring(this.masses[2], this.masses[1], this));
this.springs.push(new spring(this.masses[0], this.masses[3], this));
this.springs.push(new spring(this.masses[1], this.masses[3], this));
this.springs.push(new spring(this.masses[0], this.masses[4], this));
this.springs.push(new spring(this.masses[2], this.masses[4], this));
this.springs[0].leff = (this.springs[4].lrest = 30);
this.springs[1].leff = (this.springs[4].lrest = 30);
this.springs[2].leff = (this.springs[4].lrest = 35);
this.springs[4].leff = (this.springs[4].lrest = 35);
this.springs[6].leff = (this.springs[4].lrest = 35);
this.masses[0].radius = 18;
this.masses[1].radius = 8;
this.masses[2].radius = 8;
this.masses[3].grav = false;
this.masses[4].grav = (this.masses[4].collide = false);
this.masses[1].friction = 0.2;
this.masses[2].friction = 0.2;
for (var i in this.springs) {
this.springs[i].dampConstant = 0.4;
}
for (var i in this.springs) {
this.springs[i].springConstant = 0.5;
}
this.head = this.masses[0];
this.rotor = 0;
this.head.drive = function () {
_root.player.explode();
};
this.masses[3].drive = function () {
_root.player.explode();
};
this.dir = 1;
}) extends vehicle
var _local1 = (_global.helicopter /* register */).prototype;
_local1.kill = function () {
this.mymc.removeMovieClip();
};
_local1.swap = function () {
this.dir = this.dir * -1;
this.springs[2].swap();
var _local2 = new cartesian(0, 0);
var _local3 = new cartesian(0, 0);
var _local4 = new cartesian(0, 0);
_local2.equ(this.masses[3].pos);
_local3.equ(this.masses[3].old);
_local4.equ(this.masses[3].vel);
this.masses[3].pos.equ(this.masses[4].pos);
this.masses[3].old.equ(this.masses[4].old);
this.masses[3].vel.equ(this.masses[4].vel);
this.masses[4].pos.equ(_local2);
this.masses[4].old.equ(_local3);
this.masses[4].vel.equ(_local4);
};
_local1.control = function () {
if (_root.key.swap) {
this.swap();
_root.key.swap = false;
}
var _local2 = this.masses[1].pos.add(this.masses[2].pos).factor(0.5);
_local2 = this.masses[0].pos.sub(_local2);
_local2 = _local2.factor(1 / _local2.length());
this.masses[0].angle.equ(_local2);
var _local3 = (_root.key.accelerate ? 1 : 0);
this.masses[0].motor = this.masses[0].motor + ((_local3 - this.masses[0].motor) / 10);
var _local4 = (_root.key.left ? 1 : 0);
_local4 = _local4 + (_root.key.right ? -1 : 0);
this.springs[2].rotate(_local4 / 6);
};
_local1.draw = function () {
this.mymc.clear();
var _local2 = this.masses[1].pos.add(this.masses[2].pos).factor(0.5);
_local2 = this.masses[0].pos.sub(_local2).factor(_root.cam.zoom);
var _local3 = new cartesian((-_local2.y) * this.dir, _local2.x * this.dir);
var _local4 = this.masses[0].pos.toScreen();
this.rotor = this.rotor + ((this.masses[0].motor * 0.5) + 0.05);
if (this.rotor > 6.2831) {
this.rotor = this.rotor - 6.2831;
}
this.rotor2 = this.rotor2 + 0.5;
if (this.rotor2 > 6.2831) {
this.rotor2 = this.rotor2 - 6.2831;
}
this.mymc.moveTo(_local4.x + (_local2.x * 0.5), _local4.y + (_local2.y * 0.5));
this.mymc.lineStyle(5 * _root.cam.zoom, 0);
this.mymc.lineTo(_local4.x + (_local2.x * 1), _local4.y + (_local2.y * 1));
this.mymc.lineStyle(3 * _root.cam.zoom, 0);
var _local5 = Math.cos(this.rotor) * 0.7;
this.mymc.moveTo((_local4.x + (_local2.x * 0.9)) + (_local3.x * _local5), (_local4.y + (_local2.y * 0.9)) + (_local3.y * _local5));
this.mymc.lineTo((_local4.x + (_local2.x * 0.9)) - (_local3.x * _local5), (_local4.y + (_local2.y * 0.9)) - (_local3.y * _local5));
var _local6 = this.masses[1].pos.toScreen();
var _local7 = this.masses[2].pos.toScreen();
this.mymc.lineStyle(4 * _root.cam.zoom, 6710886);
this.mymc.moveTo((_local6.x - (_local3.x * 0.2)) - (_local2.x * 0.1), (_local6.y - (_local3.y * 0.2)) - (_local2.y * 0.1));
this.mymc.lineTo(_local6.x - (_local2.x * 0.25), _local6.y - (_local2.y * 0.25));
this.mymc.lineTo(_local7.x - (_local2.x * 0.25), _local7.y - (_local2.y * 0.25));
this.mymc.lineTo((_local7.x + (_local3.x * 0.2)) - (_local2.x * 0.1), (_local7.y + (_local3.y * 0.2)) - (_local2.y * 0.1));
this.mymc.lineStyle(3 * _root.cam.zoom, 6710886);
this.mymc.moveTo(_local6.x - (_local2.x * 0.2), _local6.y - (_local2.y * 0.2));
this.mymc.lineTo(_local4.x, _local4.y);
this.mymc.lineTo(_local7.x - (_local2.x * 0.2), _local7.y - (_local2.y * 0.2));
this.mymc.lineStyle(6 * _root.cam.zoom, 0);
var _local8 = this.masses[3].pos.toScreen();
this.mymc.moveTo(_local4.x, _local4.y);
this.mymc.lineTo(_local8.x, _local8.y);
this.mymc.lineTo(_local4.x - (_local2.x * 0.1), _local4.y - (_local2.y * 0.3));
this.mymc.lineStyle(2 * _root.cam.zoom, 0);
var _local9 = 7 * _root.cam.zoom;
var _local10 = new cartesian(_local9 * Math.sin(-this.rotor2), _local9 * Math.cos(-this.rotor2));
this.mymc.moveTo(_local8.x + _local10.x, _local8.y + _local10.y);
this.mymc.lineTo(_local8.x - _local10.x, _local8.y - _local10.y);
this.mymc.moveTo(_local8.x - _local10.y, _local8.y + _local10.x);
this.mymc.lineTo(_local8.x + _local10.y, _local8.y - _local10.x);
plot.circle(this.mymc, _local8.x, _local8.y, 10 * _root.cam.zoom, 2 * _root.cam.zoom, 11184810);
plot.cockpit(this.mymc, _local4.x, _local4.y, this.masses[0].radius * _root.cam.zoom);
plot.circle(this.mymc, (_local4.x + (_local2.x * 0.05)) + (_local3.x * 0.2), (_local4.y + (_local2.y * 0.05)) + (_local3.y * 0.2), 4 * _root.cam.zoom, 9 * _root.cam.zoom, 7829367);
};
_local1.update = function () {
this.control();
for (var i in this.springs) {
this.springs[i].update();
}
for (var i in this.masses) {
this.masses[i].update();
}
if (this.masses[1].contact || (this.masses[2].contact)) {
_root.slow = false;
}
if (!_root.slow) {
this.control();
for (var i in this.springs) {
this.springs[i].update();
}
for (var i in this.masses) {
this.masses[i].update();
}
}
};
_local1.explode = function () {
_root.gui.message("Ouch! [Press Enter]", 16764108);
this.kill();
_root.player = new explosion(this.head.pos);
};
ASSetPropFlags(_local1, null, 1);
_local1.rotor2 = 0;
}
#endinitclip
Symbol 20493 MovieClip [__Packages.bmx] Frame 0
#initclip
if (!bmx) {
//(_global.bmx = function () {
super();
this.pedala = 0;
this.crashed = false;
this.masses.push(new mass(new cartesian(0, -1), this));
this.masses.push(new wheel(new cartesian(-21, 38), this));
this.masses.push(new wheel(new cartesian(21, 38), this));
this.springs.push(new spring(this.masses[0], this.masses[1], this));
this.springs.push(new spring(this.masses[1], this.masses[2], this));
this.springs.push(new spring(this.masses[2], this.masses[0], this));
this.rearWheel = this.masses[1];
this.frontWheel = this.masses[2];
this.head = this.masses[0];
this.rearSpring = this.springs[0];
this.frontSpring = this.springs[2];
this.chasse = this.springs[1];
this.head.drive = function () {
_root.player.createRagDoll();
};
this.chasse.lrest = (this.chasse.leff = 42);
this.rearSpring.lrest = (this.rearSpring.leff = 45);
this.frontSpring.lrest = (this.frontSpring.leff = 45);
this.rearWheel.radius = 11.7;
this.frontWheel.radius = 11.7;
this.head.radius = 14;
for (var i in this.springs) {
this.springs[i].springConstant = 0.35;
}
for (var i in this.springs) {
this.springs[i].dampConstant = 0.3;
}
this.myTrick = new trick(this.rearWheel, this.frontWheel);
}) extends vehicle
var _local1 = (_global.bmx /* register */).prototype;
_local1.kill = function () {
this.mymc.removeMovieClip();
};
_local1.swap = function () {
this.dir = this.dir * -1;
this.chasse.swap();
var _local2 = this.springs[0].leff;
this.rearSpring.leff = this.springs[2].leff;
this.frontSpring.leff = _local2;
this.myTrick.swap = true;
};
_local1.control = function () {
if (_root.key.swap) {
this.swap();
_root.key.swap = false;
}
if (_root.key.bail) {
this.createRagDoll();
}
var _local2 = (_root.key.accelerate ? 1 : 0);
this.rearWheel.motor = this.rearWheel.motor + (((_local2 * 1) - this.masses[1].motor) / 10);
if (_root.key.accelerate) {
this.pedala = this.pedala + (this.rearWheel.speed / 5);
}
this.rearWheel.brake = _root.key.brake;
this.frontWheel.brake = _root.key.brake;
var _local3 = (_root.key.left ? 1 : 0);
_local3 = _local3 + (_root.key.right ? -1 : 0);
this.rearSpring.contract((_local3 * 5) * this.dir, 5);
this.frontSpring.contract(((-_local3) * 5) * this.dir, 5);
this.chasse.rotate(_local3 / 6);
if ((_local3 == 0) && (_root.key.accelerate)) {
this.rearSpring.contract(-7, 5);
this.frontSpring.contract(7, 5);
}
};
_local1.drawBike = function () {
var _local2 = this.rearWheel.pos.toScreen();
var _local3 = this.frontWheel.pos.toScreen();
var _local4 = this.head.pos.toScreen();
var _local5 = _local3.sub(_local2);
var _local6 = new cartesian((_local3.y - _local2.y) * this.dir, (_local2.x - _local3.x) * this.dir);
this.mymc.lineStyle(3 * _root.cam.zoom, 0);
plot.wheel(this.mymc, _local2.x, _local2.y, 12 * _root.cam.zoom, this.rearWheel.angle);
plot.wheel(this.mymc, _local3.x, _local3.y, 12 * _root.cam.zoom, this.frontWheel.angle);
var _local7 = _local2.add(_local5.factor(0.3)).add(_local6.factor(0.25));
var _local8 = _local2.add(_local5.factor(0.4)).add(_local6.factor(0.05));
var _local9 = _local2.add(_local5.factor(0.84)).add(_local6.factor(0.42));
var _local10 = _local2.add(_local5.factor(0.84)).add(_local6.factor(0.37));
this.mymc.moveTo(_local2.x, _local2.y);
this.mymc.lineTo(_local7.x, _local7.y);
this.mymc.lineTo(_local9.x, _local9.y);
this.mymc.moveTo(_local10.x, _local10.y);
this.mymc.lineTo(_local8.x, _local8.y);
this.mymc.lineTo(_local2.x, _local2.y);
if (_root.cam.zoom > 1) {
plot.circle(this.mymc, _local8.x, _local8.y, 3 * _root.cam.zoom, 1 * _root.cam.zoom, 0);
}
var _local11 = new cartesian((6 * Math.cos(this.pedala)) * _root.cam.zoom, (6 * Math.sin(this.pedala)) * _root.cam.zoom);
var _local12 = _local8.add(_local11);
var _local13 = _local8.sub(_local11);
this.mymc.moveTo(_local12.x, _local12.y);
this.mymc.lineTo(_local13.x, _local13.y);
var _local14 = _local2.add(_local5.factor(0.25)).add(_local6.factor(0.4));
var _local15 = _local2.add(_local5.factor(0.17)).add(_local6.factor(0.38));
var _local16 = _local2.add(_local5.factor(0.3)).add(_local6.factor(0.45));
this.mymc.lineStyle(3 * _root.cam.zoom, 0);
this.mymc.moveTo(_local15.x, _local15.y);
this.mymc.lineTo(_local16.x, _local16.y);
this.mymc.lineStyle(3 * _root.cam.zoom, 0);
this.mymc.moveTo(_local8.x, _local8.y);
this.mymc.lineTo(_local14.x, _local14.y);
var _local17 = _local2.add(_local5.factor(1)).add(_local6.factor(0));
var _local18 = _local2.add(_local5.factor(0.97)).add(_local6.factor(0));
var _local19 = _local2.add(_local5.factor(0.8)).add(_local6.factor(0.48));
this.mymc.moveTo(_local17.x, _local17.y);
this.mymc.lineTo(_local18.x, _local18.y);
this.mymc.lineTo(_local19.x, _local19.y);
var _local20 = _local2.add(_local5.factor(0.86)).add(_local6.factor(0.5));
var _local21 = _local2.add(_local5.factor(0.82)).add(_local6.factor(0.65));
var _local22 = _local2.add(_local5.factor(0.78)).add(_local6.factor(0.67));
this.mymc.moveTo(_local19.x, _local19.y);
this.mymc.lineTo(_local20.x, _local20.y);
this.mymc.lineTo(_local21.x, _local21.y);
this.mymc.lineTo(_local22.x, _local22.y);
if (this.crashed) {
return(undefined);
}
_local6 = _local4.sub(_local2.add(_local5.factor(0.5)));
var _local23 = _local7.add(_local5.factor(-0.1)).add(_local6.factor(0.3));
var _local24 = _local12.sub(_local23);
var _local25 = new cartesian(_local24.y * this.dir, (-_local24.x) * this.dir);
_local25 = _local25.factor(_root.cam.zoom * _root.cam.zoom);
var _local26 = _local23.add(_local24.factor(0.5)).add(_local25.factor(200 / _local24.lenSqr()));
var _local27 = _local12.add(_local24.factor(0.12)).add(_local25.factor(50 / _local24.lenSqr()));
_local24 = _local13.sub(_local23);
_local25 = new cartesian(_local24.y * this.dir, (-_local24.x) * this.dir);
_local25 = _local25.factor(_root.cam.zoom * _root.cam.zoom);
var _local28 = _local23.add(_local24.factor(0.5)).add(_local25.factor(200 / _local24.lenSqr()));
var _local29 = _local13.add(_local24.factor(0.12)).add(_local25.factor(50 / _local24.lenSqr()));
this.mymc.lineStyle(6 * _root.cam.zoom, 0, 50);
this.mymc.moveTo(_local13.x, _local13.y);
this.mymc.lineTo(_local28.x, _local28.y);
this.mymc.lineTo(_local23.x, _local23.y);
this.mymc.lineStyle(4 * _root.cam.zoom, 0, 50);
this.mymc.moveTo(_local13.x, _local13.y);
this.mymc.lineTo(_local29.x, _local29.y);
this.mymc.lineStyle(6 * _root.cam.zoom, 0);
this.mymc.moveTo(_local12.x, _local12.y);
this.mymc.lineTo(_local26.x, _local26.y);
this.mymc.lineTo(_local23.x, _local23.y);
this.mymc.lineStyle(4 * _root.cam.zoom, 0);
this.mymc.moveTo(_local12.x, _local12.y);
this.mymc.lineTo(_local27.x, _local27.y);
var _local30 = _local7.add(_local5.factor(0.05)).add(_local6.factor(0.9));
this.mymc.lineStyle(8 * _root.cam.zoom, 0);
this.mymc.moveTo(_local23.x, _local23.y);
this.mymc.lineTo(_local30.x, _local30.y);
var _local31 = _local7.add(_local5.factor(0.15)).add(_local6.factor(1.05));
plot.circle(this.mymc, _local31.x, _local31.y, 2 * _root.cam.zoom, 4 * _root.cam.zoom, 16777215);
plot.circle(this.mymc, _local31.x, _local31.y, 5 * _root.cam.zoom, 2 * _root.cam.zoom, 0);
this.mymc.lineStyle(2 * _root.cam.zoom, 0);
var _local32 = _local7.add(_local5.factor(0.4)).add(_local6.factor(1.1));
var _local33 = _local7.add(_local5.factor(0.05)).add(_local6.factor(1.05));
this.mymc.moveTo(_local32.x, _local32.y);
this.mymc.lineTo(_local33.x, _local33.y);
_local5 = _local30.sub(_local22);
_local6 = new cartesian(_local5.y * this.dir, (-_local5.x) * this.dir);
_local6 = _local6.factor(_root.cam.zoom * _root.cam.zoom);
var _local34 = _local22.add(_local5.factor(0.4)).add(_local6.factor(130 / _local5.lenSqr()));
this.mymc.lineStyle(5 * _root.cam.zoom, 0);
this.mymc.moveTo(_local30.x, _local30.y);
this.mymc.lineTo(_local34.x, _local34.y);
this.mymc.lineTo(_local22.x, _local22.y);
};
_local1.getStick = function () {
var _local2 = this.frontWheel.pos.sub(this.rearWheel.pos);
var _local3 = this.head.pos.sub(this.frontWheel.pos.add(this.rearWheel.pos).factor(0.5));
var _local4 = new cartesian(_local2.y * this.dir, (-_local2.x) * this.dir);
var _local5 = new Object();
_local5.head = this.rearWheel.pos.add(_local2.factor(0.35)).add(_local3.factor(1.2));
_local5.lHand = (_local5.rHand = this.rearWheel.pos.add(_local2.factor(0.8)).add(_local4.factor(0.68)));
var _local6 = _local5.head.sub(_local5.lHand);
_local6 = new cartesian(_local6.y * this.dir, (-_local6.x) * this.dir);
_local5.lElbow = (_local5.rElbow = _local5.head.add(_local5.lHand).factor(0.5).add(_local6.factor(130 / _local6.lenSqr())));
_local5.waist = this.rearWheel.pos.add(_local2.factor(0.2)).add(_local4.factor(0.5));
var _local7 = new cartesian(6 * Math.cos(this.pedala), 6 * Math.sin(this.pedala));
_local5.lFoot = this.rearWheel.pos.add(_local2.factor(0.4)).add(_local4.factor(0.05)).add(_local7);
_local6 = _local5.waist.sub(_local5.lFoot);
_local6 = new cartesian((-_local6.y) * this.dir, _local6.x * this.dir);
_local5.lKnee = _local5.waist.add(_local5.lFoot).factor(0.5).add(_local6.factor(160 / _local6.lenSqr()));
_local5.rFoot = this.rearWheel.pos.add(_local2.factor(0.4)).add(_local4.factor(0.05)).sub(_local7);
_local6 = _local5.waist.sub(_local5.rFoot);
_local6 = new cartesian((-_local6.y) * this.dir, _local6.x * this.dir);
_local5.rKnee = _local5.waist.add(_local5.rFoot).factor(0.5).add(_local6.factor(160 / _local6.lenSqr()));
return(_local5);
};
_local1.draw = function () {
this.mymc.clear();
this.drawBike();
};
_local1.createRagDoll = function () {
_root.gui.message("Ouch! [Press Enter]", 16764108);
this.crashed = true;
this.myTrick = undefined;
this.head.drive = undefined;
this.rearWheel.motor = 0;
this.rearWheel.brake = false;
this.frontWheel.brake = false;
this.head.collide = false;
_root.player = new splitBike(this, this.getStick());
};
_local1.update = function () {
if (!this.crashed) {
this.control();
}
for (var i in this.springs) {
this.springs[i].update();
}
for (var i in this.masses) {
this.masses[i].update();
}
this.myTrick.update(this.rearWheel, this.frontWheel, this.dir);
if (this.rearWheel.contact && (this.frontWheel.contact)) {
_root.slow = false;
}
if ((_root.slow <= 0) && (!this.crashed)) {
this.control();
for (var i in this.springs) {
this.springs[i].update();
}
for (var i in this.masses) {
this.masses[i].update();
}
this.myTrick.update(this.rearWheel, this.frontWheel, this.dir);
}
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20494 MovieClip [__Packages.boost] Frame 0
#initclip
if (!boost) {
//(_global.boost = function (pX, pY, pMC, pA) {
super();
this.a = pA + 180;
var _local7 = ((pA / 360) * 2) * Math.PI;
this.p = new cartesian(Math.round(pX), Math.round(pY));
var _local8 = pMC.getNextHighestDepth();
this.mymc = pMC.attachMovie("pu_arrow", "pu_" + _local8, _local8, {_visible:false});
this.mymc._rotation = this.a;
this.dir = new cartesian(-Math.sin(_local7), Math.cos(_local7));
}) extends powerup
var _local1 = (_global.boost /* register */).prototype;
_local1.getCode = function () {
return((("B " + parser.point(this.p)) + " ") + this.a.toString(32));
};
_local1.collide = function (pObj) {
var _local3 = pObj.pos.sub(this.p).lenSqr();
if (_local3 < 1000) {
for (var i in _root.player.masses) {
_root.player.masses[i].pos.inc(this.dir);
}
}
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20495 MovieClip [__Packages.blackBox] Frame 0
#initclip
if (!blackBox) {
//(_global.blackBox = function () {
super();
this.masses.push(new wheel(new cartesian(15, 40), this));
this.masses.push(new wheel(new cartesian(-15, 40), this));
this.masses.push(new wheel(new cartesian(-15, 10), this));
this.masses.push(new wheel(new cartesian(15, 10), this));
this.springs.push(new spring(this.masses[0], this.masses[1], this));
this.springs.push(new spring(this.masses[1], this.masses[2], this));
this.springs.push(new spring(this.masses[2], this.masses[3], this));
this.springs.push(new spring(this.masses[3], this.masses[0], this));
this.springs.push(new spring(this.masses[0], this.masses[2], this));
this.springs.push(new spring(this.masses[1], this.masses[3], this));
this.head = new Object();
this.head.pos = new cartesian(0, 0);
this.head.vel = new cartesian(0, 0);
for (var i in this.springs) {
this.springs[i].springConstant = 0.2;
this.springs[i].dampConstant = 0.2;
}
}) extends vehicle
var _local1 = (_global.blackBox /* register */).prototype;
_local1.kill = function () {
this.mymc.removeMovieClip();
};
_local1.control = function () {
if (_root.key.right) {
this.dir = 1;
} else {
this.dir = -1;
}
var _local2 = ((_root.key.right || (_root.key.left)) ? 1 : 0);
if (_root.key.brake) {
_local2 = 0;
}
for (var i in this.masses) {
this.masses[i].motor = this.masses[i].motor + (((_local2 * 1) - this.masses[i].motor) / 10);
if (_local2 == 0) {
this.masses[i].motor = 0;
}
this.masses[i].brake = _root.key.brake;
}
var _local3 = (_root.key.left ? 1 : 0);
_local3 = _local3 + (_root.key.right ? -1 : 0);
this.springs[4].rotate(_local3 / 9);
this.springs[5].rotate(_local3 / 9);
if (_root.key.swap) {
for (var i in this.springs) {
this.springs[i].contract(30, 10);
}
_root.key.swap_lg = true;
return(undefined);
}
for (var i in this.springs) {
this.springs[i].contract(0, 1.5);
}
};
_local1.draw = function () {
this.mymc.clear();
var _local2 = this.masses[0].pos.toScreen();
var _local3 = this.masses[1].pos.toScreen();
var _local4 = this.masses[2].pos.toScreen();
var _local5 = this.masses[3].pos.toScreen();
this.mymc.lineStyle(20 * _root.cam.zoom, 0);
this.mymc.moveTo(_local2.x, _local2.y);
this.mymc.lineTo(_local3.x, _local3.y);
this.mymc.lineTo(_local4.x, _local4.y);
this.mymc.lineTo(_local5.x, _local5.y);
this.mymc.lineTo(_local2.x, _local2.y);
this.mymc.lineTo(_local4.x, _local4.y);
this.mymc.lineTo(_local3.x, _local3.y);
this.mymc.lineTo(_local5.x, _local5.y);
this.mymc.lineTo(_local2.x, _local2.y);
};
_local1.update = function () {
this.control();
for (var i in this.springs) {
this.springs[i].update();
}
for (var i in this.masses) {
this.masses[i].update();
}
if (this.masses[0].contact || (this.masses[1].contact || (this.masses[2].contact || (this.masses[3].contact)))) {
_root.slow = false;
}
if (!_root.slow) {
this.control();
for (var i in this.springs) {
this.springs[i].update();
}
for (var i in this.masses) {
this.masses[i].update();
}
}
var _local2 = new cartesian(0, 0);
for (var i in this.masses) {
_local2.inc(this.masses[i].pos);
}
this.head.pos = _local2.factor(0.25);
this.head.vel = this.masses[0].vel;
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20496 MovieClip [__Packages.cameraHandler] Frame 0
class cameraHandler
{
var pos, steady;
function cameraHandler () {
pos = new cartesian(0, 0);
}
function update() {
if (_root.key.accelerate || (_root.key.swap || (_root.key.jump || (_root.key.up || (_root.key.down || (_root.key.left || (_root.key.right))))))) {
auto = true;
}
if (_root.key.w || (_root.key.s || (_root.key.a || (_root.key.d)))) {
auto = false;
}
if (auto) {
pos.x = pos.x + ((_root.player.head.pos.x - pos.x) / 5);
pos.y = pos.y + ((_root.player.head.pos.y - pos.y) / 5);
if (steady) {
} else {
tzoom = 10 / (_root.player.head.vel.length() + 9);
}
if (_root.settings.vehicle == 2) {
tzoom = 0.5;
}
if (Key.isDown(187) || (Key.isDown(189))) {
auto = false;
}
} else {
if (Key.isDown(187)) {
tzoom = tzoom + ((2 - tzoom) / 20);
}
if (Key.isDown(189)) {
tzoom = tzoom + ((0.4 - tzoom) / 5);
}
if (_root.key.a) {
pos.x = pos.x + (-10 / zoom);
}
if (_root.key.d) {
pos.x = pos.x + (10 / zoom);
}
if (_root.key.w) {
pos.y = pos.y + (-10 / zoom);
}
if (_root.key.s) {
pos.y = pos.y + (10 / zoom);
}
}
zoom = zoom + ((tzoom - zoom) / 5);
if (_global.isNaN(pos.x) || (_global.isNaN(pos.y))) {
pos = new cartesian(0, 0);
zoom = 1;
}
if (_global.isNaN(zoom)) {
zoom = 1;
}
}
//ASSetPropFlags(_local1, null, 1);
var zoom = 2;
var auto = false;
var tzoom = 0.6;
}
Symbol 20497 MovieClip [__Packages.unicycle] Frame 0
#initclip
if (!unicycle) {
//(_global.unicycle = function () {
super();
this.masses.push(new mass(new cartesian(0, -15), this));
this.masses.push(new wheel(new cartesian(0, 35), this));
this.masses.push(new mass(new cartesian(10, 15), this));
this.springs.push(new spring(this.masses[0], this.masses[1], this));
this.springs.push(new rope(this.masses[2], this.masses[0], this));
this.springs[0].leff = (this.springs[0].lrest = 50);
this.springs[1].leff = (this.springs[1].lrest = 25);
this.masses[0].radius = 13;
this.masses[1].radius = 13;
this.masses[2].radius = 4;
this.head = this.masses[0];
this.rearWheel = this.masses[1];
this.head.drive = function () {
_root.player.createRagDoll();
};
}) extends vehicle
var _local1 = (_global.unicycle /* register */).prototype;
_local1.kill = function () {
this.mymc.removeMovieClip();
};
_local1.swap = function () {
this.dir = this.dir * -1;
};
_local1.control = function () {
if (_root.key.swap) {
this.swap();
_root.key.swap = false;
}
if (_root.key.bail) {
this.createRagDoll();
}
this.rearWheel.brake = _root.key.brake;
var _local2 = 0;
_local2 = _local2 + (_root.key.left ? 1 : 0);
_local2 = _local2 + (_root.key.right ? -1 : 0);
this.masses[1].motor = this.masses[1].motor + ((((_local2 * 0.5) * this.dir) - this.masses[1].motor) / 5);
var _local3 = (_root.key.left ? 1 : 0);
_local3 = _local3 + (_root.key.right ? -1 : 0);
this.springs[0].rotate(_local3 / 7);
};
_local1.draw = function () {
this.mymc.clear();
var _local2 = this.masses[1].pos.toScreen();
var _local3 = this.masses[0].pos.sub(this.masses[1].pos).factor(_root.cam.zoom);
var _local4 = new cartesian((-_local3.y) * this.dir, _local3.x * this.dir);
plot.wheel(this.mymc, _local2.x, _local2.y, 13 * _root.cam.zoom, this.masses[1].angle);
this.mymc.lineStyle(3 * _root.cam.zoom, 0);
this.mymc.moveTo(_local2.x, _local2.y);
this.mymc.lineTo(_local2.x + (_local3.x * 0.5), _local2.y + (_local3.y * 0.5));
this.mymc.lineStyle(4 * _root.cam.zoom, 0);
this.mymc.moveTo((_local2.x + (_local3.x * 0.52)) - (_local4.x * 0.1), (_local2.y + (_local3.y * 0.52)) - (_local4.y * 0.1));
this.mymc.lineTo(_local2.x + (_local3.x * 0.5), _local2.y + (_local3.y * 0.5));
this.mymc.lineTo((_local2.x + (_local3.x * 0.52)) + (_local4.x * 0.1), (_local2.y + (_local3.y * 0.52)) + (_local4.y * 0.1));
var _local5 = new cartesian(5 * Math.cos(this.masses[1].angle), 5 * Math.sin(this.masses[1].angle));
_local5 = _local5.factor(_root.cam.zoom);
var _local6 = _local2.add(_local5);
var _local7 = _local2.sub(_local5);
this.mymc.lineStyle(2 * _root.cam.zoom, 0);
this.mymc.moveTo(_local6.x, _local6.y);
this.mymc.lineTo(_local7.x, _local7.y);
if (this.crashed) {
return(undefined);
}
_local2 = _local2.add(_local3.factor(0.6));
var _local8 = _local6.sub(_local2);
var _local9 = _local8.lenSqr();
var _local10 = _local7.sub(_local2);
var _local11 = _local10.lenSqr();
this.mymc.lineStyle(6 * _root.cam.zoom, 0);
this.mymc.moveTo(_local6.x, _local6.y);
this.mymc.lineTo((_local2.x + (_local8.x * 0.5)) + (((((_local8.y * 170) / _local9) * _root.cam.zoom) * _root.cam.zoom) * this.dir), (_local2.y + (_local8.y * 0.5)) - (((((_local8.x * 170) / _local9) * _root.cam.zoom) * _root.cam.zoom) * this.dir));
this.mymc.lineTo(_local2.x, _local2.y);
this.mymc.lineStyle(6 * _root.cam.zoom, 0, 40);
this.mymc.moveTo(_local7.x, _local7.y);
this.mymc.lineTo((_local2.x + (_local10.x * 0.5)) + (((((_local10.y * 170) / _local9) * _root.cam.zoom) * _root.cam.zoom) * this.dir), (_local2.y + (_local10.y * 0.5)) - (((((_local10.x * 170) / _local9) * _root.cam.zoom) * _root.cam.zoom) * this.dir));
this.mymc.lineTo(_local2.x, _local2.y);
this.mymc.lineStyle(3 * _root.cam.zoom, 0);
this.mymc.moveTo(_local6.x, _local6.y);
this.mymc.lineTo((_local6.x + (_local8.x * 0.1)) + ((_local8.y * 0.2) * this.dir), (_local6.y + (_local8.y * 0.1)) - ((_local8.x * 0.2) * this.dir));
this.mymc.lineStyle(3 * _root.cam.zoom, 0, 40);
this.mymc.moveTo(_local7.x, _local7.y);
this.mymc.lineTo((_local7.x + (_local10.x * 0.1)) + ((_local10.y * 0.2) * this.dir), (_local7.y + (_local10.y * 0.1)) - ((_local10.x * 0.2) * this.dir));
this.mymc.lineStyle(7 * _root.cam.zoom, 0);
this.mymc.moveTo(_local2.x, _local2.y);
this.mymc.lineTo(_local2.x + (_local3.x * 0.42), _local2.y + (_local3.y * 0.42));
this.mymc.lineStyle(4 * _root.cam.zoom, 0);
this.mymc.moveTo(_local2.x + (_local3.x * 0.46), _local2.y + (_local3.y * 0.46));
var _local12 = this.masses[2].pos.toScreen();
this.mymc.lineTo(_local12.x, _local12.y);
plot.circle(this.mymc, (_local2.x + (_local3.x * 0.56)) - ((_local3.y * 0.04) * this.dir), (_local2.y + (_local3.y * 0.56)) + ((_local3.x * 0.04) * this.dir), 2 * _root.cam.zoom, 4 * _root.cam.zoom, 16777215);
plot.circle(this.mymc, (_local2.x + (_local3.x * 0.56)) - ((_local3.y * 0.04) * this.dir), (_local2.y + (_local3.y * 0.56)) + ((_local3.x * 0.04) * this.dir), 5 * _root.cam.zoom, 2 * _root.cam.zoom, 0);
this.mymc.lineStyle(2 * _root.cam.zoom, 0);
this.mymc.moveTo((_local2.x + (_local3.x * 0.56)) + ((_local3.y * 0.03) * this.dir), (_local2.y + (_local3.y * 0.56)) - ((_local3.x * 0.03) * this.dir));
this.mymc.lineTo((_local2.x + (_local3.x * 0.62)) - ((_local3.y * 0.23) * this.dir), (_local2.y + (_local3.y * 0.62)) + ((_local3.x * 0.23) * this.dir));
};
_local1.update = function () {
if (!this.crashed) {
this.control();
}
for (var i in this.springs) {
this.springs[i].update();
}
for (var i in this.masses) {
this.masses[i].update();
}
_root.slow = false;
};
_local1.getStick = function () {
var _local2 = this.masses[0].pos.sub(this.masses[1].pos);
var _local3 = new cartesian(-_local2.y, _local2.x);
var _local4 = new Object();
_local4.head = this.masses[1].pos.add(_local2);
_local4.lHand = this.masses[2].pos;
_local4.lElbow = this.masses[2].pos.add(this.masses[0].pos).factor(0.5);
_local4.rHand = this.masses[2].pos;
_local4.rElbow = this.masses[2].pos.add(this.masses[0].pos).factor(0.5);
_local4.waist = this.masses[1].pos.add(_local2.factor(0.5));
var _local5 = new cartesian(6 * Math.cos(this.masses[1].angle), 6 * Math.sin(this.masses[1].angle));
_local4.lFoot = this.masses[1].pos.add(_local5);
_local4.lKnee = _local4.waist.add(_local4.lFoot).factor(0.5);
_local4.rFoot = this.masses[1].pos.sub(_local5);
_local4.rKnee = _local4.waist.add(_local4.rFoot).factor(0.5);
return(_local4);
};
_local1.createRagDoll = function () {
_root.gui.message("Ouch! [Press Enter]", 16764108);
this.crashed = true;
this.head.collide = false;
this.masses[1].motor = 0;
_root.player = new splitBike(this, this.getStick());
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20498 MovieClip [__Packages.panel] Frame 0
class panel
{
var visible, align, structure, arrowx1, arrowx2, hover, mymc, tipmc, iconmc, arrowmc;
function panel (pMC, pName, pAlign, pStructure) {
visible = false;
align = pAlign;
structure = pStructure;
arrowx1 = ((align == "left") ? 24 : -6);
arrowx2 = ((align == "left") ? 1 : 18);
hover = 0;
mymc = pMC.createEmptyMovieClip(pName, pMC.getNextHighestDepth());
mymc._x = ((align == "left") ? 0 : (_root._width - 27));
tipmc = mymc.createEmptyMovieClip("tipmc", mymc.getNextHighestDepth());
if (align == "right") {
plot.tipRight(tipmc, 0, 0, tipWidth, 25);
} else {
plot.tipLeft(tipmc, 0, 0, tipWidth, 25);
}
tipmc._x = ((align == "left") ? 25 : (-tipWidth));
plot.labelTip(tipmc, 0, 2, tipWidth);
iconmc = mymc.createEmptyMovieClip("iconmc", mymc.getNextHighestDepth());
iconmc._visible = false;
plot.rect(iconmc, 0, 0, 24, 399);
drawIcons();
var _local6 = ((align == "right") ? "smallArrow_l" : "smallArrow_r");
arrowmc = mymc.attachMovie(_local6, "arrow", mymc.getNextHighestDepth());
arrowmc._y = 200 - 4;
}
function animate() {
iconmc._visible = visible;
var _local2 = Math.floor(_root.mouse.pos.y / 25);
tipmc._y = _local2 * 25;
tipmc._visible = visible && ((hover > 30) && (structure[_local2] != undefined));
tipmc.label.text = structure[_local2].tip;
arrowmc._x = (visible ? (arrowx1) : (arrowx2));
arrowmc._alpha = arrowmc._alpha + (visible ? ((-arrowmc._alpha) / 4) : ((100 - arrowmc._alpha) / 15));
if (_root.gui.dialog) {
arrowmc._alpha = 0;
}
}
function update() {
if (visible) {
hover = ((hover < 100) ? (hover + 1) : (hover));
} else {
hover = 0;
}
animate();
var _local2 = Math.floor(_root.mouse.pos.y / 25);
if (_root.mouse.press && (visible)) {
console.action(structure[_local2].action);
}
}
function drawIcons() {
var _local2 = 1;
var _local3 = 0;
for ( ; _local3 <= 15 ; _local3++) {
if (structure[_local3] != undefined) {
var _local4 = iconmc.attachMovie(structure[_local3].image, "i_" + _local2, _local2);
_local4._x = -2;
_local4._y = ((_local2 - 1) * 25) - 2;
_local4.stop();
}
_local2++;
}
}
//ASSetPropFlags(_local1, null, 1);
var tipWidth = 110;
}
Symbol 20499 MovieClip [__Packages.spring] Frame 0
class spring
{
var m1, m2, parent, lrest, leff, dampConstant, springConstant;
function spring (pm1, pm2, pParent) {
m1 = pm1;
m2 = pm2;
parent = pParent;
lrest = 40;
leff = 40;
dampConstant = 0.5;
springConstant = 0.7;
}
function contract(p1, p2) {
leff = leff + (((lrest - p1) - leff) / p2);
}
function rotate(p) {
var _local3 = m2.pos.sub(m1.pos);
var _local4 = new cartesian((-_local3.y) / leff, _local3.x / leff);
m1.pos.inc(_local4.factor(p));
m2.pos.inc(_local4.factor(-p));
}
function update() {
var _local2 = m2.pos.sub(m1.pos);
var _local3 = _local2.length();
if (_local3 < 1) {
return(undefined);
}
_local2 = _local2.factor(1 / _local3);
var _local4 = _local2.factor((_local3 - leff) * springConstant);
var _local5 = m2.vel.sub(m1.vel).dot(_local2) * dampConstant;
_local4.inc(_local2.factor(_local5));
m2.vel.inc(_local4.factor(-1));
m1.vel.inc(_local4);
}
function swap() {
var _local2 = new cartesian();
_local2.equ(m1.pos);
m1.pos.equ(m2.pos);
m2.pos.equ(_local2);
_local2.equ(m1.old);
m1.old.equ(m2.old);
m2.old.equ(_local2);
_local2.equ(m1.vel);
m1.vel.equ(m2.vel);
m2.vel.equ(_local2);
var _local3 = m1.angle;
m1.angle = m2.angle;
m2.angle = _local3;
}
//ASSetPropFlags(_local1, null, 1);
}
Symbol 20500 MovieClip [__Packages.msg] Frame 0
class msg
{
var visible, time, mymc2, mymc1;
function msg (pMC, pName) {
visible = false;
time = 0;
mymc2 = pMC.createEmptyMovieClip(pName, pMC.getNextHighestDepth(), {_visible:false});
mymc2._x = 250;
mymc2._y = 1;
mymc1 = pMC.createEmptyMovieClip(pName, pMC.getNextHighestDepth());
mymc1._x = 250;
mymc1._y = 1;
plot.rect(mymc1, -100, 0, 100, 20, 16777181, 16777181);
plot.labelMsg(mymc1, -100);
plot.rect(mymc2, -100, 0, 100, 20, 15658734, 15658734);
plot.labelMsg(mymc2, -100);
}
function message(p, pCol) {
if ((mymc1.label.text != p) || (!visible)) {
visible = true;
mymc1.clear();
if (pCol == undefined) {
pCol = 16777147 /* 0xFFFFBB */;
}
plot.rect(mymc1, -100, 0, 100, 20, pCol, pCol);
mymc1.label.text = p;
time = 70;
}
}
function animate() {
mymc2.label.text = "Slow Motion";
mymc2._visible = _root.slow;
mymc1._visible = visible;
mymc1._y = (mymc2._visible ? 21 : 1);
if (time > 0) {
time--;
}
visible = time > 0;
}
function update() {
animate();
}
//ASSetPropFlags(_local1, null, 1);
}
Symbol 20501 MovieClip [__Packages.rope] Frame 0
#initclip
if (!rope) {
//(_global.rope = function (pm1, pm2, pParent) {
super();
this.m1 = pm1;
this.m2 = pm2;
this.parent = pParent;
this.lrest = 40;
this.leff = 40;
this.dampConstant = 0.5;
this.springConstant = 0.7;
}) extends spring
var _local1 = (_global.rope /* register */).prototype;
_local1.update = function () {
var _local2 = this.m2.pos.sub(this.m1.pos);
var _local3 = _local2.length();
if (_local3 < 1) {
return(undefined);
}
_local2 = _local2.factor(1 / _local3);
var _local4 = _local2.factor((_local3 - this.leff) * this.springConstant);
var _local5 = this.m2.vel.sub(this.m1.vel).dot(_local2) * this.dampConstant;
_local4.inc(_local2.factor(_local5));
this.m1.vel.inc(_local4);
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20502 MovieClip [__Packages.splitBike] Frame 0
class splitBike
{
var myRagdoll, head, myBike;
function splitBike (pBike, pStick) {
myRagdoll = new ragdoll(pStick, pBike.mymc);
myRagdoll.zero(pBike.head.vel, pBike.rearWheel.vel);
myRagdoll.dir = pBike.dir;
head = myRagdoll.head;
myBike = pBike;
}
function kill() {
myBike.kill();
myRagdoll.kill();
}
function draw() {
myBike.draw();
myRagdoll.draw();
}
function update() {
myBike.update();
myRagdoll.update();
}
//ASSetPropFlags(_local1, null, 1);
}
Symbol 20503 MovieClip [__Packages.plot] Frame 0
class plot
{
function plot () {
}
static function rect(pMC, x1, y1, x2, y2, col, col2) {
if (col == undefined) {
col = 0;
}
if (col2 == undefined) {
col2 = 0;
}
pMC.lineStyle(1, col2);
pMC.beginFill(col);
pMC.moveTo(x1, y1);
pMC.lineTo(x2, y1);
pMC.lineTo(x2, y2);
pMC.lineTo(x1, y2);
pMC.lineTo(x1, y1);
pMC.endFill();
}
static function circle(pMC, cx, cy, r, thick, col) {
pMC.lineStyle(thick, col);
pMC.moveTo(cx + r, cy);
var _local8 = 0;
while ((_local8++) < 16) {
pMC.lineTo(cx + (r * kx[_local8]), cy + (r * ky[_local8]));
}
}
static function canopy(pMC, cx, cy, r) {
pMC.lineStyle(0, 0);
pMC.moveTo(cx + r, cy);
pMC.beginFill(0);
var _local6 = 0;
while ((_local6++) < 16) {
pMC.lineTo(cx + (r * kx[_local6]), cy + (r * ky[_local6]));
}
pMC.endFill();
}
static function wheel(pMC, cx, cy, r, angle, thick) {
if (thick == undefined) {
thick = 3.5;
}
r = r - (1.5 * _root.cam.zoom);
if (r > 5) {
pMC.lineStyle(1 * _root.cam.zoom, 7829367, 50);
var _local8 = 0;
while ((_local8++) < 16) {
pMC.moveTo(cx, cy);
pMC.lineTo(cx + (r * Math.cos(angle + ((6.283 * _local8) / 16))), cy + (r * Math.sin(angle + ((6.283 * _local8) / 16))));
}
}
circle(pMC, cx, cy, r, thick * _root.cam.zoom, 0);
}
static function cockpit(pMC, cx, cy, r) {
pMC.lineStyle(0, 0);
pMC.moveTo(cx + r, cy);
pMC.beginFill(0);
var _local6 = 0;
while ((_local6++) < 15) {
pMC.lineTo(cx + (r * kx[_local6]), cy + (r * ky[_local6]));
}
pMC.endFill();
}
static function tipLeft(pMC) {
pMC.lineStyle(1, 16777130);
pMC.beginFill(16777130);
pMC.moveTo(12, 1);
pMC.lineTo(110, 1);
pMC.lineTo(110, 23);
pMC.lineTo(12, 23);
pMC.lineTo(0, 12);
pMC.lineTo(12, 1);
pMC.endFill();
}
static function tipRight(pMC) {
pMC.lineStyle(1, 16777130);
pMC.beginFill(16777130);
pMC.moveTo(0, 1);
pMC.lineTo(98, 1);
pMC.lineTo(110, 12);
pMC.lineTo(98, 23);
pMC.lineTo(0, 23);
pMC.lineTo(0, 1);
pMC.endFill();
}
static function standardFormat() {
var _local2 = new TextFormat();
_local2.font = "_sans";
_local2.size = 14;
_local2.align = "center";
_local2.color = 0;
return(_local2);
}
static function labelMsg(pMC, x, y) {
pMC.createTextField("label", 1, x, y, 200, 20);
var _local5 = pMC.label;
_local5.selectable = false;
_local5.setNewTextFormat(standardFormat());
_local5.text = "";
return(_local5);
}
static function labelTip(pMC, x, y, pWidth) {
pMC.createTextField("label", 2, x, y, pWidth, 20);
var _local6 = pMC.label;
_local6.selectable = false;
_local6.setNewTextFormat(standardFormat());
_local6.text = "";
return(_local6);
}
static function button(pMC, p) {
rect(pMC, 0, 0, 150, 30, 0, 8947848);
pMC.createTextField("label", 2, 0, 5, 150, 25);
var _local4 = pMC.label;
_local4.selectable = false;
var _local5 = standardFormat();
_local5.color = 16777215 /* 0xFFFFFF */;
_local5.bold = true;
_local4.setNewTextFormat(_local5);
_local4.text = p;
}
static function closeButton(pMC, p) {
rect(pMC, 0, 0, 20, 20, 0, 0);
pMC.lineStyle(5, 16777215);
pMC.moveTo(0, 0);
pMC.lineTo(20, 20);
pMC.moveTo(20, 0);
pMC.lineTo(0, 20);
}
static function tire(pMC, cx, cy, r, angle) {
var _local7 = 0;
pMC.lineStyle(6 * _root.cam.zoom, 0);
pMC.moveTo(cx + r, cy);
pMC.beginFill(8947848);
while ((_local7++) < 15) {
pMC.lineTo(cx + (r * kx[_local7]), cy + (r * ky[_local7]));
}
pMC.endFill();
pMC.lineStyle(3 * _root.cam.zoom, 0);
_local7 = 0;
r = r + (3 * _root.cam.zoom);
while ((_local7++) < 8) {
pMC.moveTo(cx + (r * Math.cos(angle + ((6.283 * _local7) / 8))), cy + (r * Math.sin(angle + ((6.283 * _local7) / 8))));
pMC.lineTo(cx + (r * Math.cos(angle + ((6.283 * (_local7 + 0.5)) / 8))), cy + (r * Math.sin(angle + ((6.283 * (_local7 + 0.5)) / 8))));
}
pMC.lineStyle(2 * _root.cam.zoom, 0);
_local7 = 0;
r = r + (-9 * _root.cam.zoom);
while ((_local7++) < 5) {
pMC.moveTo(cx + (r * Math.cos(angle + ((6.283 * _local7) / 5))), cy + (r * Math.sin(angle + ((6.283 * _local7) / 5))));
pMC.lineTo(cx + (r * Math.cos(angle + ((6.283 * (_local7 + 0.2)) / 5))), cy + (r * Math.sin(angle + ((6.283 * (_local7 + 0.2)) / 5))));
}
}
//ASSetPropFlags(_local1, null, 1);
static var kx = new Array(1, 0.924, 0.707, 0.383, 0, -0.383, -0.707, -0.924, -1, -0.924, -0.707, -0.383, 0, 0.383, 0.707, 0.924, 1);
static var ky = new Array(0, 0.383, 0.707, 0.924, 1, 0.924, 0.707, 0.383, 0, -0.383, -0.707, -0.924, -1, -0.924, -0.707, -0.383, 0);
}
Symbol 20504 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.1");
}
static function showPreGameAd(options) {
var _local2 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local2);
var _local3 = options.clip;
var _local4 = 11000;
var _local5 = options.ad_timeout;
delete options.ad_timeout;
var _local6 = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var _local7 = _local3._mochiad;
_local7.onUnload = function () {
options.ad_finished();
};
var _local8 = _getRes(options);
var _local9 = _local8[0];
var _local10 = _local8[1];
_local7._x = _local9 * 0.5;
_local7._y = _local10 * 0.5;
var chk = _local7.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local9 * -0.5;
chk._y = _local10 * -0.5;
var _local11 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local11._x = 10;
_local11._y = _local10 - 20;
var _local12 = options.color;
delete options.color;
var _local13 = options.background;
delete options.background;
var _local14 = options.outline;
delete options.outline;
var _local15 = _local11.createEmptyMovieClip("_outline", 1);
_local15.beginFill(_local13);
_local15.moveTo(0, 0);
_local15.lineTo(_local9 - 20, 0);
_local15.lineTo(_local9 - 20, 10);
_local15.lineTo(0, 10);
_local15.lineTo(0, 0);
_local15.endFill();
var _local16 = _local11.createEmptyMovieClip("_inside", 2);
_local16.beginFill(_local12);
_local16.moveTo(0, 0);
_local16.lineTo(_local9 - 20, 0);
_local16.lineTo(_local9 - 20, 10);
_local16.lineTo(0, 10);
_local16.lineTo(0, 0);
_local16.endFill();
_local16._xscale = 0;
var _local17 = _local11.createEmptyMovieClip("_outline", 3);
_local17.lineStyle(0, _local14, 100);
_local17.moveTo(0, 0);
_local17.lineTo(_local9 - 20, 0);
_local17.lineTo(_local9 - 20, 10);
_local17.lineTo(0, 10);
_local17.lineTo(0, 0);
chk.ad_msec = _local4;
chk.ad_timeout = _local5;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = _local6;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
_local7.lc.adLoaded = function (width, height) {
};
_local7.lc.adjustProgress = function (msec) {
var _local3 = this.mc._mochiad_wait;
_local3.server_control = true;
_local3.started = getTimer();
_local3.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local2 = this._parent._parent;
var _local3 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local5 = false;
var _local6 = _local2.getBytesTotal();
var _local7 = _local2.getBytesLoaded();
var _local8 = (100 * _local7) / _local6;
var _local9 = (100 * _local4) / chk.ad_msec;
var _local10 = this._mochiad_bar._inside;
var _local11 = Math.min(100, Math.min(_local8 || 0, _local9));
_local11 = Math.max(this.last_pcnt, _local11);
this.last_pcnt = _local11;
_local10._xscale = _local11;
if (!chk.showing) {
var _local12 = _local3.getBytesTotal();
if ((_local12 > 0) || (typeof(_local12) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
_local5 = true;
}
}
if (_local4 > chk.ad_msec) {
_local5 = true;
}
if ((_local6 > 0) && ((_local7 >= _local6) && (_local5))) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showInterLevelAd(options) {
var _local2 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local2);
var _local3 = options.clip;
var _local4 = 11000;
var _local5 = options.ad_timeout;
delete options.ad_timeout;
var _local6 = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var _local7 = _local3._mochiad;
_local7.onUnload = function () {
options.ad_finished();
};
var _local8 = _getRes(options);
var _local9 = _local8[0];
var _local10 = _local8[1];
_local7._x = _local9 * 0.5;
_local7._y = _local10 * 0.5;
var chk = _local7.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local4;
chk.ad_timeout = _local5;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = _local6;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
_local7.lc.adLoaded = function (width, height) {
};
_local7.lc.adjustProgress = function (msec) {
var _local3 = this.mc._mochiad_wait;
_local3.server_control = true;
_local3.started = getTimer();
_local3.ad_msec = msec - 250;
};
chk.onEnterFrame = function () {
var _local2 = this._parent._mochiad_ctr;
var _local3 = getTimer() - this.started;
var _local4 = false;
if (!chk.showing) {
var _local5 = _local2.getBytesTotal();
if ((_local5 > 0) || (typeof(_local5) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local3 > chk.ad_timeout) {
_local4 = true;
}
}
if (_local3 > chk.ad_msec) {
_local4 = true;
}
if (_local4) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showTimedAd(options) {
showInterLevelAd(options);
}
static function showPreloaderAd(options) {
showPreGameAd(options);
}
static function _allowDomains(server) {
var _local3 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local3);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local3);
}
}
return(_local3);
}
static function _loadCommunicator(options) {
var _local3 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local3);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local4 = options.clip;
var _local5 = "_mochiad_com_" + options.id;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local4[_local5]) {
return(_local4[_local5].lc);
}
var _local6 = options.com_server + options.id;
_allowDomains(_local6);
delete options.id;
delete options.com_server;
var _local7 = options.depth;
delete options.depth;
var _local8 = _local4.createEmptyMovieClip(_local5, _local7);
var _local9 = _local8.createEmptyMovieClip("_mochiad_com", 1);
for (var k in options) {
_local9[k] = options[k];
}
var _local10 = new LocalConnection();
var _local11 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local10.mc = _local8;
_local10.name = _local11;
_local10.allowDomain = function (d) {
return(true);
};
_local10.allowInsecureDomain = _local10.allowDomain;
_local10.connect(_local11);
_local8.lc = _local10;
_local9.lc = _local11;
_local10._id = 0;
_local10._queue = [];
_local10.rpcResult = function (cb_arg) {
var _local3 = _global.parseInt(cb_arg);
var _local4 = this._callbacks[_local3];
if (!_local4) {
return(undefined);
}
delete this._callbacks[_local3];
var _local5 = [];
var _local6 = 2;
for ( ; _local6 < _local4.length ; _local6++) {
_local5.push(_local4[_local6]);
}
var _local7 = 1;
for ( ; _local7 < arguments.length ; _local7++) {
_local5.push(arguments[_local7]);
}
var _local8 = _local4[1];
var _local9 = _local4[0];
if (_local9 && (typeof(_local8) == "string")) {
_local8 = _local9[_local8];
}
if (_local8) {
_local8.apply(_local9, _local5);
}
};
_local10._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local3 = this._queue;
delete this._queue;
var _local4 = this.doSend;
var _local5 = 0;
for ( ; _local5 < _local3.length ; _local5++) {
var _local6 = _local3[_local5];
_local4.apply(this, _local6);
}
};
_local10.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local5 = [];
var _local6 = 0;
for ( ; _local6 < arguments.length ; _local6++) {
_local5.push(arguments[_local6]);
}
this._queue.push(_local5);
return(undefined);
}
this._id = this._id + 1;
var _local7 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local7] = [cbobj, cbfn];
var _local8 = new LocalConnection();
var _local9 = _local8.send(this._endpoint, "rpc", _local7, args);
};
_local10._callbacks = {};
_local10._callbacks[0] = [_local10, "_didConnect"];
_local9.st = getTimer();
_local9.loadMovie(_local6 + ".swf", "POST");
return(_local10);
}
static function fetchHighScores(options, callbackObj, callbackMethod) {
var _local5 = _loadCommunicator({id:options.id});
if (!_local5) {
return(false);
}
var _local6 = ["fetchHighScores", options];
_local5.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}
static function sendHighScore(options, callbackObj, callbackMethod) {
var _local5 = _loadCommunicator({id:options.id});
if (!_local5) {
return(false);
}
var _local6 = ["sendHighScore", options];
_local5.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}
static function load(options) {
var _local3 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local3);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local4 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local4._mochiad_loaded) {
return(null);
}
var _local5 = options.depth;
delete options.depth;
var _local6 = _local4.createEmptyMovieClip("_mochiad", _local5);
var _local7 = _getRes(options);
options.res = (_local7[0] + "x") + _local7[1];
options.server = options.server + options.id;
delete options.id;
_local4._mochiad_loaded = true;
var _local8 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var k in options) {
_local8[k] = options[k];
}
var _local9 = _local8.server;
delete _local8.server;
var _local10 = _allowDomains(_local9);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local11 = new LocalConnection();
var _local12 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local11.mc = _local6;
_local11.name = _local12;
_local11.hostname = _local10;
_local11.allowDomain = function (d) {
return(true);
};
_local11.allowInsecureDomain = _local11.allowDomain;
_local11.connect(_local12);
_local6.lc = _local11;
_local8.lc = _local12;
_local8.st = getTimer();
_local8.loadMovie(_local9 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local2 = System.security;
if (_local2.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local4 = 0;
var _local5 = 0;
if (typeof(options.res) != "undefined") {
var _local6 = options.res.split("x");
_local4 = _global.parseFloat(_local6[0]);
_local5 = _global.parseFloat(_local6[1]);
} else {
_local4 = _local3.xMax - _local3.xMin;
_local5 = _local3.yMax - _local3.yMin;
}
if ((_local4 == 0) || (_local5 == 0)) {
_local4 = Stage.width;
_local5 = Stage.height;
}
return([_local4, _local5]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var k in defaults) {
_local4[k] = defaults[k];
}
if (options) {
for (var k in options) {
_local4[k] = options[k];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local6 = 0;
for ( ; _local6 < _local5.length ; _local6++) {
var _local7 = _local5[_local6].split("=");
_local4[_global.unescape(_local7[0])] = _global.unescape(_local7[1]);
}
}
return(_local4);
}
//ASSetPropFlags(_local1, null, 1);
}
Symbol 20505 MovieClip [__Packages.trick] Frame 0
class trick
{
var swap;
function trick (pRear, pFront) {
var _local4 = pRear.pos.sub(pFront.pos);
angle_old = Math.atan2(_local4.y, _local4.x);
swap = false;
}
function update(pRear, pFront, dir) {
rearTime++;
frontTime++;
wheelie++;
endo++;
jump++;
if (pFront.contact) {
frontTime = 0;
}
if (pRear.contact) {
rearTime = 0;
}
if (pFront.contact || ((rearTime > 20) || (swap))) {
if (wheelie > 40) {
var _local5 = ((_root.scores.wheelie > wheelie) ? (_root.scores.wheelie) : "TOP SCORE!");
_root.scores.wheelie = Math.max(_root.scores.wheelie, wheelie);
_root.gui.message(((("Wheelie " + wheelie) + " (") + _local5) + ")", 14548957);
}
wheelie = 0;
}
if (pRear.contact || ((frontTime > 20) || (swap))) {
if (endo > 40) {
var _local6 = ((_root.scores.endo > endo) ? (_root.scores.endo) : "TOP SCORE!");
_root.scores.endo = Math.max(_root.scores.endo, endo);
_root.gui.message(((("Endo " + endo) + " (") + _local6) + ")", 14548957);
}
endo = 0;
}
if (pRear.contact || (pFront.contact || (swap))) {
if (jump > 100) {
var _local7 = ((_root.scores.jump > jump) ? (_root.scores.jump) : "TOP SCORE!");
_root.scores.jump = Math.max(_root.scores.jump, jump);
_root.gui.message(((("Jump " + jump) + " (") + _local7) + ")", 14548957);
}
jump = 0;
}
var _local8 = pRear.pos.sub(pFront.pos);
var _local9 = Math.atan2(_local8.y, _local8.x);
_local9 = (((_local9 / (Math.PI * 2)) - Math.floor(_local9 / (Math.PI * 2))) * Math.PI) * 2;
var _local10 = _local9 - angle_old;
if (_local10 > Math.PI) {
_local10 = ((-Math.PI) * 2) + _local10;
}
if (_local10 < (-Math.PI)) {
_local10 = (Math.PI * 2) + _local10;
}
rotation = rotation + _local10;
angle_old = _local9;
if (((_local10 * rotation) < 0) || (pRear.contact || (pFront.contact || ((Math.abs(rotation) > (2 * Math.PI)) || (swap))))) {
if ((rotation * dir) > 4) {
_root.gui.message("Frontflip!", 14548957);
}
if ((rotation * dir) < -4) {
_root.gui.message("Backflip!", 14548957);
}
rotation = 0;
}
swap = false;
}
//ASSetPropFlags(_local1, null, 1);
var rearTime = 0;
var frontTime = 0;
var wheelie = 0;
var endo = 0;
var jump = 0;
var rotation = 0;
var angle_old = 0;
var rdir = 0;
}
Symbol 20506 MovieClip [__Packages.prop] Frame 0
#initclip
if (!prop) {
//(_global.prop = function (pPos, pParent) {
super();
this.pos = new cartesian(pPos.x, pPos.y);
this.old = new cartesian(pPos.x, pPos.y);
this.vel = new cartesian(0, 0);
this.parent = pParent;
this.radius = 10;
this.angle = new cartesian(0, 0);
this.motor = 0;
}) extends mass
var _local1 = (_global.prop /* register */).prototype;
_local1.update = function () {
this.vel.y = this.vel.y + 0;
this.vel.inc(this.angle.factor(this.motor * 1.5));
this.vel = this.vel.factor(0.99);
this.pos.inc(this.vel);
this.contact = false;
if (this.collide) {
_root.sectors.collide(this);
}
this.vel = this.pos.sub(this.old);
this.old.equ(this.pos);
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20507 MovieClip [__Packages.toolHandler] Frame 0
class toolHandler
{
var mymc, tool, puindex, old, p1, p2, last, quick, drawing, t;
function toolHandler () {
mymc = _root.createEmptyMovieClip("toolmc", 4);
tool = 0;
puindex = 1;
old = 0;
p1 = new cartesian(40, 50);
p2 = new cartesian(0, 0);
last = new cartesian(0, 0);
}
function press() {
quick = ((tool == 0) || ((tool == 4) || (tool == 6))) && (_root.key.quick);
drawing = true;
t = 0;
_root.cam.auto = false;
if (_root.key.camera) {
tool = 2;
}
if ((!quick) && ((tool != 2) && ((tool != 1) && (tool != 5)))) {
p1.equ(p2);
}
last = new cartesian(0, 0);
}
function hold() {
t++;
if ((tool != 2) && (!quick)) {
var _local2 = _root.mouse.pos.sub(_root.center);
_local2.x = _local2.x * 0.8;
if ((_local2.lenSqr() > 30000) && (t > 20)) {
_root.cam.pos.inc(_local2.factor(0.08));
}
}
if ((tool == 0) || ((tool == 4) || (tool == 6))) {
p2.equ(_root.mouse.real);
}
if (tool == 1) {
_root.sectors.erase(_root.mouse.real);
}
if (tool == 3) {
p2.inc(_root.mouse.real.sub(p2).factor(0.04));
var _local3 = 200 + (6 * _root.mouse.real.sub(p2).length());
if (p2.sub(p1).lenSqr() > _local3) {
_root.sectors.newLine(p1.x, p1.y, p2.x, p2.y);
last = p2.sub(p1);
p1.equ(p2);
}
}
if (tool == 2) {
_root.cam.pos.inc(_root.mouse.old.pos.sub(_root.mouse.pos).factor(1 / _root.cam.zoom));
}
}
function release() {
p2 = _root.mouse.real;
drawing = false;
if (tool == 0) {
_root.sectors.newLine(p1.x, p1.y, p2.x, p2.y);
}
if (tool == 4) {
_root.sectors.sceneryLine(p1.x, p1.y, p2.x, p2.y);
}
if (tool == 5) {
_root.sectors.newTarget(p2.x, p2.y);
}
if (tool == 6) {
var _local2 = Math.round((360 * Math.atan2(-(p2.x - p1.x), p2.y - p1.y)) / (2 * Math.PI));
_root.sectors.newPowerup(p1.x, p1.y, puindex, _local2);
}
if ((tool != 3) && ((tool != 2) && ((tool != 1) && ((tool != 5) && (tool != 6))))) {
p1.equ(p2);
}
tool = old;
}
function update() {
quick = ((tool == 0) || (tool == 4)) && (_root.key.quick);
if (!_root.gui.hover) {
if (_root.mouse.press) {
press();
}
}
if (drawing) {
if (_root.mouse.down) {
hold();
}
if (_root.mouse.release) {
release();
}
} else {
p2 = _root.mouse.real;
}
}
function draw() {
mymc.clear();
if (_root.cam.auto) {
return(undefined);
}
var _local2 = p1.toScreen();
mymc.lineStyle(0, 240);
mymc.moveTo(_local2.x - 2, _local2.y - 2);
mymc.lineTo(_local2.x + 2, _local2.y + 2);
mymc.moveTo(_local2.x - 2, _local2.y + 2);
mymc.lineTo(_local2.x + 2, _local2.y - 2);
if (((tool == 0) || ((tool == 3) || ((tool == 4) || (tool == 6)))) && (drawing || (quick))) {
mymc.lineStyle(1, lineCol[tool]);
var _local3 = p1.toScreen();
var _local4 = p2.toScreen();
mymc.moveTo(_local3.x, _local3.y);
mymc.lineTo(_local4.x, _local4.y);
}
if (_root.mouse.grid) {
_local2 = _root.mouse.real.toScreen();
mymc.lineStyle(0, 10486000);
mymc.moveTo(_local2.x - 3, _local2.y - 3);
mymc.lineTo(_local2.x + 3, _local2.y + 3);
mymc.moveTo(_local2.x - 3, _local2.y + 3);
mymc.lineTo(_local2.x + 3, _local2.y - 3);
}
}
function action(p) {
if (_root.cam.auto) {
_root.cam.tzoom = 0.6;
}
_root.cam.auto = false;
if (p == "pencil") {
tool = 0;
_root.gui.message("Tool: Line");
}
if (p == "rubber") {
tool = 1;
_root.gui.message("Tool: Eraser");
}
if (p == "camera") {
tool = 2;
_root.gui.message("Tip: Press and hold CTRL");
}
if (p == "curve") {
tool = 3;
_root.gui.message("Tool: Curve");
}
if (p == "scenery") {
tool = 4;
_root.gui.message("Tool: Scenery");
}
if (p == "goal") {
tool = 5;
_root.gui.message("Tool: Goal");
}
if (p == "powerup") {
if (tool == 6) {
puindex++;
if (puindex > 4) {
puindex = 1;
}
}
tool = 6;
if (puindex == 1) {
_root.gui.message("Tool: Slow Motion");
}
if (puindex == 2) {
_root.gui.message("Tool: Gravity");
}
if (puindex == 3) {
_root.gui.message("Tool: Boost");
}
if (puindex == 4) {
_root.gui.message("Tool: Bomb");
}
_root.gui.changePowerup(puindex);
}
old = tool;
}
//ASSetPropFlags(_local1, null, 1);
var lineCol = [16711680, 255, 0, 16711935, 65535, 16776960, 16755200];
}
Symbol 20508 MovieClip [__Packages.canopy] Frame 0
#initclip
if (!canopy) {
//(_global.canopy = function (pPos, pParent) {
super();
this.pos = new cartesian(pPos.x, pPos.y);
this.old = new cartesian(pPos.x, pPos.y);
this.vel = new cartesian(0, 0);
this.parent = pParent;
this.radius = 10;
this.collide = true;
}) extends mass
var _local1 = (_global.canopy /* register */).prototype;
_local1.draw = function () {
var _local2 = this.pos.toScreen();
plot.canopy(this.parent.mymc, _local2.x, _local2.y, this.radius * _root.cam.zoom, 1);
};
_local1.drive = function (pDir) {
this.pos.inc(pDir.factor((-pDir.dot(this.vel)) * 0.05));
this.contact = true;
};
_local1.update = function () {
this.vel = this.vel.factor(0.9);
if (_root.key.left) {
this.pos.x = this.pos.x + -0.05;
}
if (_root.key.right) {
this.pos.x = this.pos.x + 0.05;
}
this.pos.y = this.pos.y + -0.1;
if (_root.key.accelerate) {
this.pos.y = this.pos.y + -0.4;
}
if (this.wind) {
this.pos.x = this.pos.x + 0.3;
}
this.pos.inc(this.vel);
this.contact = false;
if (this.collide) {
_root.sectors.collide(this);
}
this.vel = this.pos.sub(this.old);
this.old.equ(this.pos);
};
ASSetPropFlags(_local1, null, 1);
_local1.wind = true;
}
#endinitclip
Symbol 20509 MovieClip [__Packages.gravity] Frame 0
#initclip
if (!gravity) {
//(_global.gravity = function (pX, pY, pMC, pA) {
super();
this.a = pA + 180;
var _local7 = ((pA / 360) * 2) * Math.PI;
this.p = new cartesian(Math.round(pX), Math.round(pY));
var _local8 = pMC.getNextHighestDepth();
this.mymc = pMC.attachMovie("pu_arrow2", "pu_" + _local8, _local8, {_visible:false});
this.mymc._rotation = this.a;
this.dir = new cartesian(-0.3 * Math.sin(_local7), 0.3 * Math.cos(_local7));
}) extends powerup
var _local1 = (_global.gravity /* register */).prototype;
_local1.getCode = function () {
return((("G " + parser.point(this.p)) + " ") + this.a.toString(32));
};
_local1.collide = function (pObj) {
var _local3 = pObj.pos.sub(this.p).lenSqr();
if (_local3 < 1000) {
_root.grav.equ(this.dir);
_root.gui.message("Gravity Modified", 15658734);
}
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20510 MovieClip [__Packages.balloon] Frame 0
#initclip
if (!balloon) {
//(_global.balloon = function () {
super();
this.masses.push(new canopy(new cartesian(0, -10), this));
this.masses.push(new mass(new cartesian(0, 35), this));
this.springs.push(new spring(this.masses[0], this.masses[1], this));
this.head = this.masses[0];
this.basket = this.masses[1];
this.head.radius = 30;
this.basket.friction = 0.1;
this.springs[0].springConstant = 0.2;
this.springs[0].dampConstant = 0.2;
this.springs[0].lrest = (this.springs[0].leff = 45);
this.head.drive = function () {
_root.player.explode();
};
}) extends vehicle
var _local1 = (_global.balloon /* register */).prototype;
_local1.kill = function () {
this.mymc.removeMovieClip();
};
_local1.control = function () {
};
_local1.draw = function () {
this.mymc.clear();
var _local2 = this.basket.pos.toScreen();
var _local3 = this.head.pos.toScreen();
var _local4 = _local3.sub(_local2);
var _local5 = new cartesian(-_local4.y, _local4.x);
this.mymc.lineStyle(0, 10066329);
this.mymc.moveTo(_local2.x + (_local5.x * 0.1), _local2.y + (_local5.y * 0.1));
this.mymc.lineTo((_local2.x + (_local4.x * 0.5)) + (_local5.x * 0.4), (_local2.y + (_local4.y * 0.5)) + (_local5.y * 0.4));
this.mymc.moveTo(_local2.x - (_local5.x * 0.1), _local2.y - (_local5.y * 0.1));
this.mymc.lineTo((_local2.x + (_local4.x * 0.5)) - (_local5.x * 0.4), (_local2.y + (_local4.y * 0.5)) - (_local5.y * 0.4));
this.mymc.moveTo(_local2.x + (_local5.x * 0.1), _local2.y + (_local5.y * 0.1));
this.mymc.lineTo((_local2.x + (_local4.x * 0.36)) + (_local5.x * 0.2), (_local2.y + (_local4.y * 0.36)) + (_local5.y * 0.2));
this.mymc.moveTo(_local2.x - (_local5.x * 0.1), _local2.y - (_local5.y * 0.1));
this.mymc.lineTo((_local2.x + (_local4.x * 0.36)) - (_local5.x * 0.2), (_local2.y + (_local4.y * 0.36)) - (_local5.y * 0.2));
this.head.draw();
if (_root.key.accelerate) {
this.mymc.lineStyle(8 * _root.cam.zoom, 16776960);
this.mymc.moveTo(_local2.x, _local2.y);
this.mymc.lineTo(_local2.x + (_local4.x * 0.1), _local2.y + (_local4.y * 0.1));
this.mymc.lineStyle(3 * _root.cam.zoom, 16755200);
this.mymc.moveTo(_local2.x, _local2.y);
this.mymc.lineTo(_local2.x + (_local4.x * 0.1), _local2.y + (_local4.y * 0.1));
}
this.mymc.lineStyle(0, 0);
this.mymc.moveTo(_local2.x + (_local5.x * 0.1), _local2.y + (_local5.y * 0.1));
this.mymc.beginFill(0);
this.mymc.lineTo(_local2.x - (_local5.x * 0.1), _local2.y - (_local5.y * 0.1));
this.mymc.lineTo((_local2.x - (_local4.x * 0.22)) - (_local5.x * 0.1), (_local2.y - (_local4.y * 0.22)) - (_local5.y * 0.1));
this.mymc.lineTo((_local2.x - (_local4.x * 0.22)) + (_local5.x * 0.1), (_local2.y - (_local4.y * 0.22)) + (_local5.y * 0.1));
this.mymc.lineTo(_local2.x + (_local5.x * 0.1), _local2.y + (_local5.y * 0.1));
this.mymc.endFill();
};
_local1.update = function () {
this.control();
this.head.wind = !this.basket.contact;
for (var i in this.springs) {
this.springs[i].update();
}
for (var i in this.masses) {
this.masses[i].update();
}
_root.slow = false;
this.control();
for (var i in this.springs) {
this.springs[i].update();
}
for (var i in this.masses) {
this.masses[i].update();
}
_root.slow = false;
};
_local1.explode = function () {
_root.gui.message("Ouch! [Press Enter]", 16764108);
this.kill();
_root.player = new explosion(this.head.pos);
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20511 MovieClip [__Packages.truck] Frame 0
#initclip
if (!truck) {
//(_global.truck = function () {
super();
this.masses.push(new mass(new cartesian(-15, 7), this));
this.masses.push(new mass(new cartesian(15, 7), this));
this.masses.push(new wheel(new cartesian(-20, 35), this));
this.masses.push(new wheel(new cartesian(20, 35), this));
this.masses[0].friction = 0.1;
this.masses[1].friction = 0.1;
this.springs.push(new spring(this.masses[0], this.masses[1], this));
this.springs[0].leff = (this.springs[0].lrest = 30);
this.springs.push(new spring(this.masses[0], this.masses[2], this));
this.springs.push(new spring(this.masses[1], this.masses[3], this));
this.springs[1].leff = (this.springs[1].lrest = 30);
this.springs[2].leff = (this.springs[2].lrest = 30);
this.springs.push(new spring(this.masses[0], this.masses[3], this));
this.springs.push(new spring(this.masses[1], this.masses[2], this));
this.springs[3].leff = (this.springs[3].lrest = 45);
this.springs[4].leff = (this.springs[4].lrest = 45);
this.springs.push(new spring(this.masses[2], this.masses[3], this));
for (var i in this.springs) {
this.springs[i].springConstant = 0.3;
}
this.head = this.masses[0];
this.rearWheel = this.masses[2];
this.frontWheel = this.masses[3];
this.rearWheel.radius = (this.frontWheel.radius = 14);
this.masses[0].radius = (this.masses[1].radius = 7);
}) extends vehicle
var _local1 = (_global.truck /* register */).prototype;
_local1.kill = function () {
this.mymc.removeMovieClip();
};
_local1.swap = function () {
this.dir = this.dir * -1;
this.springs[0].swap();
this.springs[5].swap();
};
_local1.control = function () {
if (_root.key.swap) {
this.swap();
_root.key.swap = false;
}
var _local2 = (_root.key.accelerate ? 1 : 0);
this.rearWheel.motor = this.rearWheel.motor + (((_local2 * 0.8) - this.rearWheel.motor) / 10);
this.frontWheel.motor = this.frontWheel.motor + (((_local2 * 0.8) - this.frontWheel.motor) / 10);
this.rearWheel.brake = _root.key.brake;
this.frontWheel.brake = _root.key.brake;
var _local3 = (_root.key.left ? 1 : 0);
_local3 = _local3 + (_root.key.right ? -1 : 0);
this.springs[0].rotate(_local3 / 8);
this.springs[5].rotate(_local3 / 8);
};
_local1.draw = function () {
this.mymc.clear();
var _local2 = this.rearWheel.pos.toScreen();
var _local3 = this.head.pos.toScreen();
var _local4 = this.masses[1].pos.sub(this.masses[0].pos).factor(_root.cam.zoom);
var _local5 = this.masses[0].pos.add(this.masses[1].pos).factor(0.5).sub(this.masses[2].pos.add(this.masses[3].pos).factor(0.5));
_local5 = _local5.factor(_root.cam.zoom);
this.mymc.lineStyle(2 * _root.cam.zoom, 4473924);
this.mymc.beginFill(7829367, 100);
this.mymc.moveTo((_local3.x - (_local4.x * 0.4)) - (_local5.x * 0.7), (_local3.y - (_local4.y * 0.4)) - (_local5.y * 0.7));
this.mymc.lineTo((_local3.x - (_local4.x * 0.35)) + (_local5.x * 0.2), (_local3.y - (_local4.y * 0.35)) + (_local5.y * 0.2));
this.mymc.lineTo((_local3.x + (_local4.x * 0.8)) + (_local5.x * 0.2), (_local3.y + (_local4.y * 0.8)) + (_local5.y * 0.2));
this.mymc.lineTo((_local3.x + (_local4.x * 0.9)) - (_local5.x * 0.1), (_local3.y + (_local4.y * 0.9)) - (_local5.y * 0.1));
this.mymc.lineTo((_local3.x + (_local4.x * 1.35)) - (_local5.x * 0.2), (_local3.y + (_local4.y * 1.35)) - (_local5.y * 0.2));
this.mymc.lineTo((_local3.x + (_local4.x * 1.4)) - (_local5.x * 0.7), (_local3.y + (_local4.y * 1.4)) - (_local5.y * 0.7));
this.mymc.lineTo((_local3.x - (_local4.x * 0.4)) - (_local5.x * 0.7), (_local3.y - (_local4.y * 0.4)) - (_local5.y * 0.7));
this.mymc.endFill();
this.mymc.moveTo((_local3.x - (_local4.x * 0.4)) - (_local5.x * 0.9), (_local3.y - (_local4.y * 0.4)) - (_local5.y * 0.9));
this.mymc.lineTo((_local3.x + (_local4.x * 0.8)) - (_local5.x * 0.9), (_local3.y + (_local4.y * 0.8)) - (_local5.y * 0.9));
this.mymc.lineStyle(1 * _root.cam.zoom, 4473924);
this.mymc.moveTo((_local3.x + (_local4.x * 0.5)) - (_local5.x * 0.1), (_local3.y + (_local4.y * 0.5)) - (_local5.y * 0.1));
this.mymc.lineTo((_local3.x + (_local4.x * 0.9)) - (_local5.x * 0.1), (_local3.y + (_local4.y * 0.9)) - (_local5.y * 0.1));
this.mymc.lineTo((_local3.x + (_local4.x * 0.8)) + (_local5.x * 0.2), (_local3.y + (_local4.y * 0.8)) + (_local5.y * 0.2));
this.mymc.lineTo((_local3.x + (_local4.x * 0.5)) + (_local5.x * 0.2), (_local3.y + (_local4.y * 0.5)) + (_local5.y * 0.2));
this.mymc.lineTo((_local3.x + (_local4.x * 0.5)) - (_local5.x * 0.1), (_local3.y + (_local4.y * 0.5)) - (_local5.y * 0.1));
_local2 = this.rearWheel.pos.toScreen();
plot.tire(this.mymc, _local2.x, _local2.y, 10 * _root.cam.zoom, this.rearWheel.angle);
_local2 = this.frontWheel.pos.toScreen();
plot.tire(this.mymc, _local2.x, _local2.y, 10 * _root.cam.zoom, this.frontWheel.angle);
};
_local1.update = function () {
this.control();
for (var i in this.springs) {
this.springs[i].update();
}
for (var i in this.masses) {
this.masses[i].update();
}
if (this.rearWheel.contact && (this.frontWheel.contact)) {
_root.slow = false;
}
if (!_root.slow) {
this.control();
for (var i in this.springs) {
this.springs[i].update();
}
for (var i in this.masses) {
this.masses[i].update();
}
}
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20512 MovieClip [__Packages.console] Frame 0
class console
{
function console () {
}
static function restart() {
_root.gamePause = false;
_root.player.kill();
_root.sectors.resetPowerups();
_root.targetTime = getTimer();
_root.grav = new cartesian(0, 0.3);
_root.slow = false;
if (_root.settings.vehicle == 1) {
_root.player = new bmx();
}
if (_root.settings.vehicle == 2) {
_root.player = new balloon();
}
if (_root.settings.vehicle == 3) {
_root.player = new blackBox();
}
if (_root.settings.vehicle == 4) {
_root.player = new mtb();
}
if (_root.settings.vehicle == 5) {
_root.player = new helicopter();
}
if (_root.settings.vehicle == 6) {
_root.player = new unicycle();
}
if (_root.settings.vehicle == 7) {
_root.player = new truck();
}
_root.cam.auto = true;
}
static function action(p) {
if (p == undefined) {
return(undefined);
}
if (p.slice(0, 2) == "t:") {
_root.tools.action(p.slice(2));
}
if (p == "pause") {
_root.gamePause = !_root.gamePause;
}
if (p == "restart") {
restart();
_root.gui.msgPanel.time = 0;
}
if (p == "grid") {
_root.mouse.grid = !_root.mouse.grid;
_root.gui.message((_root.mouse.grid ? "Grid on" : "Grid off"));
}
if (p == "steadycam") {
_root.cam.steady = !_root.cam.steady;
_root.gui.message((_root.cam.steady ? "Steady Cam on" : "Steady Cam off"));
}
if (p == "quality") {
if (_root._quality == "HIGH") {
_root._quality = "LOW";
} else {
_root._quality = "HIGH";
}
}
if (p == "share") {
getURL ("http://forums.onemorelevel.com/forumdisplay.php?f=9", "_blank");
}
if (p == "d:clear") {
_root.gui.clearDialog();
}
if (p == "d:save") {
_root.gui.saveDialog();
}
if (p == "d:load") {
_root.gui.loadDialog();
}
if (p == "d:help") {
_root.gui.helpDialog();
}
if (p == "d:vehicle") {
_root.settings.vehicle = _root.settings.vehicle + -1;
if (_root.settings.vehicle < 1) {
_root.settings.vehicle = _root.settings.vehicle_max;
}
restart();
var _local3 = ["BMX", "Balloon", "???", "Mountain Bike", "Helicopter", "Unicycle", "Truck"];
_root.gui.message(_local3[_root.settings.vehicle - 1], 15659007);
}
if (p == "d:theme") {
_root.settings.theme = _root.settings.theme + -1;
if (_root.settings.theme < 1) {
_root.settings.theme = _root.settings.theme_max;
}
var _local4 = ["None", "Clouds", "City", "Hills"];
_root.gui.message(_local4[_root.settings.theme - 1], 15659007);
_root.bg.removeMovieClip();
if (_root.settings.theme == 1) {
_root.createEmptyMovieClip("bg", 1);
} else {
var _local5 = ["", "bg1", "bg2", "bg3"];
_root.attachMovie(_local5[_root.settings.theme - 1], "bg", 1);
}
}
}
//ASSetPropFlags(_local1, null, 1);
}
Symbol 20513 MovieClip [__Packages.ragdoll] Frame 0
#initclip
if (!ragdoll) {
//(_global.ragdoll = function (pStick, pmc) {
super();
this.mymc = pmc;
var _local5 = new cartesian(0, 0);
this.masses.push(new mass(_local5, this));
this.head = this.masses[0];
this.masses.push(new mass(_local5, this));
this.waist = this.masses[1];
this.springs.push(new spring(this.head, this.waist, this));
this.masses.push(new mass(_local5, this));
this.lElbow = this.masses[2];
this.masses.push(new mass(_local5, this));
this.rElbow = this.masses[3];
this.masses.push(new mass(_local5, this));
this.lHand = this.masses[4];
this.masses.push(new mass(_local5, this));
this.rHand = this.masses[5];
this.springs.push(new spring(this.head, this.lElbow, this));
this.springs.push(new spring(this.lElbow, this.lHand, this));
this.springs.push(new spring(this.head, this.rElbow, this));
this.springs.push(new spring(this.rElbow, this.rHand, this));
this.masses.push(new mass(_local5, this));
this.lKnee = this.masses[6];
this.masses.push(new mass(_local5, this));
this.rKnee = this.masses[7];
this.masses.push(new mass(_local5, this));
this.lFoot = this.masses[8];
this.masses.push(new mass(_local5, this));
this.rFoot = this.masses[9];
this.springs.push(new spring(this.waist, this.lKnee, this));
this.springs.push(new spring(this.lKnee, this.lFoot, this));
this.springs.push(new spring(this.waist, this.rKnee, this));
this.springs.push(new spring(this.rKnee, this.rFoot, this));
for (var i in this.masses) {
this.masses[i].radius = 3;
}
for (var i in this.masses) {
this.masses[i].friction = 0.05;
}
this.head.radius = (this.waist.radius = 8);
for (var i in this.springs) {
this.springs[i].springConstant = 0.4;
}
for (var i in this.springs) {
this.springs[i].dampConstant = 0.7;
}
for (var i in pStick) {
this[i].pos.equ(pStick[i]);
}
}) extends vehicle
var _local1 = (_global.ragdoll /* register */).prototype;
_local1.kill = function () {
this.mymc.removeMovieClip();
};
_local1.draw = function () {
var _local2 = this.head.pos.toScreen();
this.mymc.lineStyle(5 * _root.cam.zoom, 0);
this.mymc.moveTo(_local2.x, _local2.y);
var _local3 = this.lElbow.pos.toScreen();
this.mymc.lineTo(_local3.x, _local3.y);
var _local4 = this.lHand.pos.toScreen();
this.mymc.lineTo(_local4.x, _local4.y);
this.mymc.lineStyle(5 * _root.cam.zoom, 0, 50);
this.mymc.moveTo(_local2.x, _local2.y);
var _local5 = this.rElbow.pos.toScreen();
this.mymc.lineTo(_local5.x, _local5.y);
var _local6 = this.rHand.pos.toScreen();
this.mymc.lineTo(_local6.x, _local6.y);
this.mymc.lineStyle(8 * _root.cam.zoom, 0);
this.mymc.moveTo(_local2.x, _local2.y);
var _local7 = this.waist.pos.toScreen();
this.mymc.lineTo(_local7.x, _local7.y);
this.mymc.lineStyle(5 * _root.cam.zoom, 0);
var _local8 = this.lKnee.pos.toScreen();
this.mymc.lineTo(_local8.x, _local8.y);
var _local9 = this.lFoot.pos.toScreen();
this.mymc.lineTo(_local9.x, _local9.y);
this.mymc.lineStyle(5 * _root.cam.zoom, 0, 50);
this.mymc.moveTo(_local7.x, _local7.y);
var _local10 = this.rKnee.pos.toScreen();
this.mymc.lineTo(_local10.x, _local10.y);
var _local11 = this.rFoot.pos.toScreen();
this.mymc.lineTo(_local11.x, _local11.y);
_local2.inc(_local2.sub(_local7).factor(0.25));
plot.circle(this.mymc, _local2.x, _local2.y, 2 * _root.cam.zoom, 4 * _root.cam.zoom, 16777215);
plot.circle(this.mymc, _local2.x, _local2.y, 5 * _root.cam.zoom, 2 * _root.cam.zoom, 0);
this.mymc.lineStyle(2 * _root.cam.zoom, 0);
var _local12 = _local2.sub(_local7);
var _local13 = new cartesian(_local12.y, -_local12.x);
var _local14 = new cartesian(0, 0);
var _local15 = new cartesian(0, 0);
if (this.dir == 1) {
_local14 = _local2.add(_local13.factor(0.15)).add(_local12.factor(-0.05));
_local15 = _local2.add(_local13.factor(-0.35)).add(_local12.factor(0.15));
} else {
_local14 = _local2.add(_local13.factor(-0.15)).add(_local12.factor(0.15));
_local15 = _local2.add(_local13.factor(0.35)).add(_local12.factor(-0.05));
}
_local14 = _local2.add(_local13.factor(0.15 * this.dir)).add(_local12.factor(-0.05));
_local15 = _local2.add(_local13.factor(-0.35 * this.dir)).add(_local12.factor(0.15));
this.mymc.moveTo(_local14.x, _local14.y);
this.mymc.lineTo(_local15.x, _local15.y);
};
_local1.update = function () {
for (var i in this.springs) {
this.springs[i].update();
}
for (var i in this.masses) {
this.masses[i].update();
}
};
_local1.zero = function (pVel1, pVel2) {
pVel1 = pVel1.factor(0.7);
pVel2 = pVel2.factor(0.7);
for (var i in this.springs) {
this.springs[i].lrest = (this.springs[i].leff = this.springs[i].m2.pos.sub(this.springs[i].m1.pos).length());
}
var _local4 = 1;
for ( ; _local4 <= 4 ; _local4++) {
this.springs[_local4].lrest = 13;
this.springs[_local4].leff = 13;
}
for (var i in this.springs) {
if (this.springs[i].leff > 20) {
this.springs[i].lrest = (this.springs[i].leff = 20);
}
}
var _local5 = new Array(this.head, this.lElbow, this.rElbow, this.lHand, this.rHand);
var _local6 = new Array(this.waist, this.lKnee, this.rKnee, this.lFoot, this.rFoot);
for (var i in _local5) {
_local5[i].old = _local5[i].pos.sub(pVel1);
}
for (var i in _local6) {
_local6[i].old = _local6[i].pos.sub(pVel2);
}
for (var i in this.masses) {
this.masses[i].vel.equ(this.masses[i].pos.sub(this.masses[i].old));
this.masses[i].vel.x = this.masses[i].vel.x + ((Math.random() - Math.random()) * 1);
this.masses[i].vel.y = this.masses[i].vel.y + ((Math.random() - Math.random()) * 1);
}
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20514 MovieClip [__Packages.mouseHandler] Frame 0
class mouseHandler
{
var pos, real, old, grid, down, press, release;
function mouseHandler () {
pos = new cartesian(0, 0);
real = new cartesian(0, 0);
old = new Object();
grid = false;
Mouse.addListener(this);
}
function onMouseDown() {
down = true;
}
function onMouseUp() {
down = false;
}
function onMouseWheel(delta) {
_root.cam.auto = false;
_root.cam.tzoom = _root.cam.tzoom + (delta / 8);
if (_root.cam.tzoom < 0.4) {
_root.cam.tzoom = 0.4;
}
if (_root.cam.tzoom > 2) {
_root.cam.tzoom = 2;
}
}
function update() {
old.pos = new cartesian(pos.x, pos.y);
pos.x = _root._xmouse;
pos.y = _root._ymouse;
real = pos.toReal();
if (grid) {
real.x = Math.round(real.x / 10) * 10;
real.y = Math.round(real.y / 10) * 10;
}
if ((!old.down) && (down)) {
press = true;
}
if (old.down && (!down)) {
release = true;
}
if (old.press) {
press = false;
}
if (old.release) {
release = false;
}
old.down = down;
old.press = press;
old.release = release;
}
//ASSetPropFlags(_local1, null, 1);
}
Symbol 20515 MovieClip [__Packages.bomb] Frame 0
#initclip
if (!bomb) {
//(_global.bomb = function (pX, pY, pMC) {
super();
this.p = new cartesian(Math.round(pX), Math.round(pY));
var _local6 = pMC.getNextHighestDepth();
this.mymc = pMC.attachMovie("pu_bomb", "pu_" + _local6, _local6, {_visible:false});
}) extends powerup
var _local1 = (_global.bomb /* register */).prototype;
_local1.getCode = function () {
return("O " + parser.point(this.p));
};
_local1.collide = function (pObj) {
var _local3 = pObj.pos.sub(this.p).lenSqr();
if (_local3 < 500) {
_root.gui.message("Ouch! [Press Enter]", 16764108);
_root.player.kill();
_root.player = new explosion(this.p);
this.mymc._alpha = 20;
}
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20516 MovieClip [__Packages.game] Frame 0
class game
{
function game () {
}
static function begin(didLoad) {
Stage.showMenu = false;
Stage.scaleMode = "noScale";
_root._quality = "HIGH";
plot.rect(_root, 0, 0, 499, 399, 16777215);
_root.createEmptyMovieClip("bg", 1);
_root.size = new cartesian(500, 400);
_root.center = new cartesian(250, 200);
_root.gamePause = false;
_root.dialog = false;
_root.scores = new Object();
_root.scores.wheelie = 0;
_root.scores.endo = 0;
_root.scores.jump = 0;
_root.settings = new Object();
_root.settings.vehicle = 1;
_root.settings.vehicle_max = 7;
_root.settings.theme = 1;
_root.settings.theme_max = 4;
_root.targetCount = 0;
_root.targetHit = 0;
_root.targetTime = getTimer();
_root.grav = new cartesian(0, 0.3);
_root.slow = false;
_root.mouse = new mouseHandler();
_root.key = new keyHandler();
_root.cam = new cameraHandler();
_root.sectors = new sectorHandler();
_root.sectors.newLine(-40, 50, 40, 50);
_root.player = new bmx();
_root.tools = new toolHandler();
_root.gui = new guiHandler();
_root.onEnterFrame = function () {
if (_root.dialog) {
return(undefined);
}
_root.sectors.hidePowerups();
_root.mouse.update();
_root.key.update();
if (!_root.gamePause) {
_root.player.update();
}
_root.cam.update();
_root.tools.update();
_root.gui.update();
_root.sectors.draw();
_root.player.draw();
_root.tools.draw();
};
}
static function main() {
var did_load = false;
_root.play = function () {
game.begin(did_load);
};
_root.stop = function () {
did_load = true;
};
MochiAd.showPreGameAd({id:"0033a3ceeafb3062", res:"500x400"});
}
//ASSetPropFlags(_local1, null, 1);
}
Symbol 20517 MovieClip [__Packages.slomo] Frame 0
#initclip
if (!slomo) {
//(_global.slomo = function (pX, pY, pMC) {
super();
this.p = new cartesian(Math.round(pX), Math.round(pY));
var _local6 = pMC.getNextHighestDepth();
this.mymc = pMC.attachMovie("pu_clock", "pu_" + _local6, _local6, {_visible:false});
}) extends powerup
var _local1 = (_global.slomo /* register */).prototype;
_local1.getCode = function () {
return("S " + parser.point(this.p));
};
_local1.collide = function (pObj) {
var _local3 = pObj.pos.sub(this.p).lenSqr();
if (_local3 < 500) {
_root.slow = true;
}
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20518 MovieClip [__Packages.wheel] Frame 0
#initclip
if (!wheel) {
//(_global.wheel = function (pPos, pParent) {
super();
this.pos = new cartesian(pPos.x, pPos.y);
this.old = new cartesian(pPos.x, pPos.y);
this.vel = new cartesian(0, 0);
this.parent = pParent;
this.radius = 10;
this.motor = 0;
this.angle = 0;
this.speed = 0;
}) extends mass
var _local1 = (_global.wheel /* register */).prototype;
_local1.drive = function (pDir) {
this.pos.inc(pDir.factor(this.motor * this.parent.dir));
if (this.brake) {
this.pos.inc(pDir.factor((-pDir.dot(this.vel)) * 0.3));
}
this.speed = pDir.dot(this.vel) / this.radius;
this.angle = this.angle + this.speed;
this.contact = true;
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20519 MovieClip [__Packages.guiHandler] Frame 0
class guiHandler
{
var mymc, leftPanel, rightPanel, msgPanel, hover;
function guiHandler () {
mymc = _root.createEmptyMovieClip("guimc", 5);
var _local2 = new Array(15);
_local2[0] = new menuItem("pencil", "Draw lines", "t:pencil");
_local2[1] = new menuItem("rubber", "Eraser", "t:rubber");
_local2[2] = new menuItem("magnify", "Move camera", "t:camera");
_local2[3] = new menuItem("scenery", "Draw scenery", "t:scenery");
_local2[4] = new menuItem("curve", "Draw curves", "t:curve");
_local2[5] = new menuItem("star", "Goals", "t:goal");
_local2[6] = new menuItem("apple", "Powerups", "t:powerup");
_local2[7] = new menuItem("grid", "Grid", "grid");
_local2[13] = new menuItem("camera", "Steady Cam", "steadycam");
_local2[14] = new menuItem("pause", "Pause", "pause");
_local2[15] = new menuItem("restart", "Restart", "restart");
leftPanel = new panel(mymc, "leftPanel", "left", _local2);
_local2 = new Array(15);
_local2[0] = new menuItem("theme", "Theme", "d:theme");
_local2[1] = new menuItem("vehicle", "Vehicle", "d:vehicle");
_local2[2] = new menuItem("quality", "Quality", "quality");
_local2[11] = new menuItem("clear", "Clear Map", "d:clear");
_local2[12] = new menuItem("save", "Save Map", "d:save");
_local2[13] = new menuItem("load", "Load Map", "d:load");
_local2[14] = new menuItem("share", "Share Maps", "share");
_local2[15] = new menuItem("help", "Help", "d:help");
rightPanel = new panel(mymc, "rightPanel", "right", _local2);
msgPanel = new msg(mymc, "msgPanel");
mymc.createEmptyMovieClip("pausemc", mymc.getNextHighestDepth());
plot.rect(mymc.pausemc, 242, 190, 247, 210, 11206400, 11206400, 60);
plot.rect(mymc.pausemc, 253, 190, 258, 210, 11206400, 11206400, 60);
mymc.attachMovie("splash", "splash", mymc.getNextHighestDepth(), {_x:131, _y:20});
}
function message(p, pCol) {
msgPanel.message(p, pCol);
}
function changePowerup(p) {
leftPanel.mymc.iconmc.i_7.gotoAndStop(p);
}
function standardFormat() {
var _local2 = new TextFormat();
_local2.font = "_sans";
_local2.size = 14;
_local2.align = "left";
_local2.color = 16777215 /* 0xFFFFFF */;
return(_local2);
}
function formatLabel(p, b) {
p.selectable = false;
p.wordWrap = true;
var _local4 = standardFormat();
if (b) {
_local4.bold = true;
}
p.setNewTextFormat(_local4);
}
function formatTextBox(p) {
p.selectable = true;
p.wordWrap = true;
p.border = true;
p.borderColor = 8947848 /* 0x888888 */;
p.background = true;
p.backgroundColor = 7829367 /* 0x777777 */;
var _local3 = standardFormat();
_local3.size = 10;
_local3.font = "_typewriter";
p.setNewTextFormat(_local3);
}
function clearDialog() {
_root.dialog = true;
mymc.splash.removeMovieClip();
mymc.splash = undefined;
var _local2 = mymc.createEmptyMovieClip("dialog", mymc.getNextHighestDepth());
plot.rect(_local2, 95, 145, 405, 255, 14540253, 15658734);
plot.rect(_local2, 100, 150, 400, 250, 0, 8947848);
_local2.createTextField("title", 1, 110, 160, 280, 20);
_local2.createTextField("label", 2, 110, 180, 280, 20);
formatLabel(_local2.title, true);
formatLabel(_local2.label);
_local2.title.text = "Clear Map";
_local2.label.text = "Are you sure you want to clear this map?";
_local2.createEmptyMovieClip("yes", 3);
_local2.createEmptyMovieClip("no", 4);
plot.button(_local2.yes, "Yes");
plot.button(_local2.no, "No");
_local2.yes._x = 100;
_local2.no._x = 250;
_local2.yes._y = (_local2.no._y = 220);
_local2.yes.onPress = function () {
_root.gui.mymc.dialog.removeMovieClip();
_root.dialog = false;
_root.targetCount = 0;
_root.sectors.kill();
_root.sectors = new sectorHandler();
_root.sectors.newLine(-40, 50, 40, 50);
console.restart();
_root.gui.msgPanel.time = 0;
_root.tools.tool = (_root.tools.old = 0);
_root.tools.p1 = new cartesian(40, 50);
};
_local2.no.onPress = function () {
_root.gui.mymc.dialog.removeMovieClip();
_root.dialog = false;
};
}
function saveDialog() {
_root.dialog = true;
mymc.splash.removeMovieClip();
mymc.splash = undefined;
var _local2 = mymc.createEmptyMovieClip("dialog", mymc.getNextHighestDepth());
plot.rect(_local2, 95, 95, 405, 305, 14540253, 15658734);
plot.rect(_local2, 100, 100, 400, 300, 0, 8947848);
_local2.createTextField("title", 1, 110, 110, 280, 20);
_local2.createTextField("label", 2, 110, 130, 280, 55);
formatLabel(_local2.title, true);
formatLabel(_local2.label);
_local2.title.text = "Save Map";
_local2.label.text = "Press 'Copy' and then paste the code into a forum, instant message, or email to share your map with friends.";
_local2.createTextField("output", 3, 110, 190, 280, 70);
formatTextBox(_local2.output);
_local2.output.text = parser.getCode(_root.sectors);
Selection.setFocus(_local2.output);
_local2.createEmptyMovieClip("yes", 4);
_local2.createEmptyMovieClip("no", 5);
plot.button(_local2.yes, "Copy");
plot.button(_local2.no, "Done");
_local2.yes._x = 100;
_local2.no._x = 250;
_local2.yes._y = (_local2.no._y = 270);
_local2.yes.onPress = function () {
System.setClipboard(parser.getCode(_root.sectors));
_root.gui.mymc.dialog.removeMovieClip();
_root.dialog = false;
_root.gui.message("Code was copied to clipboard");
};
_local2.no.onPress = function () {
_root.gui.mymc.dialog.removeMovieClip();
_root.dialog = false;
};
}
function loadDialog() {
_root.dialog = true;
mymc.splash.removeMovieClip();
mymc.splash = undefined;
var _local2 = mymc.createEmptyMovieClip("dialog", mymc.getNextHighestDepth());
plot.rect(_local2, 95, 95, 405, 305, 14540253, 15658734);
plot.rect(_local2, 100, 100, 400, 300, 0, 8947848);
_local2.createTextField("title", 1, 110, 110, 280, 20);
_local2.createTextField("label", 2, 110, 130, 280, 55);
formatLabel(_local2.title, true);
formatLabel(_local2.label);
_local2.title.text = "Load Map";
_local2.label.text = "Copy a map code from a forum, instant message, or email, and then paste it into this box. (Ctrl-V)";
_local2.createTextField("input", 3, 110, 190, 280, 70);
formatTextBox(_local2.input);
_local2.input.type = "input";
_local2.input.text = "";
Selection.setFocus(_local2.input);
_local2.createEmptyMovieClip("yes", 4);
_local2.createEmptyMovieClip("no", 5);
plot.button(_local2.yes, "Load");
plot.button(_local2.no, "Cancel");
_local2.yes._x = 100;
_local2.no._x = 250;
_local2.yes._y = (_local2.no._y = 270);
_local2.yes.onPress = function () {
_root.targetCount = 0;
_root.sectors.kill();
_root.sectors = parser.loadMap(_root.gui.mymc.dialog.input.text);
_root.gui.mymc.dialog.removeMovieClip();
_root.dialog = false;
console.restart();
_root.gui.msgPanel.time = 0;
_root.tools.tool = (_root.tools.old = 0);
_root.tools.p1 = new cartesian(40, 50);
};
_local2.no.onPress = function () {
_root.gui.mymc.dialog.removeMovieClip();
_root.dialog = false;
};
}
function helpDialog() {
_root.dialog = true;
mymc.splash.removeMovieClip();
mymc.splash = undefined;
var _local2 = mymc.createEmptyMovieClip("dialog", mymc.getNextHighestDepth());
plot.rect(_local2, 0, 0, 500, 400, 0, 0);
_local2.createTextField("title", 1, 20, 15, 280, 20);
_local2.createTextField("label", 2, 20, 35, 280, 150);
formatLabel(_local2.title, true);
formatLabel(_local2.label);
_local2.title.text = "Controls";
_local2.label.text = "Accelerate:\t\t\tUP\nBrake:\t\t\t\tDOWN\nLean Left:\t\t\tLEFT\nLean Right:\t\t\tRIGHT\nTurn Around:\t\tZ\nRestart:\t\t\tENTER\n";
_local2.label.text = _local2.label.text + "Move Camera:\t\tCTRL + Click + Drag\nQuick Draw:\t\tShift + Click\n";
_local2.label.text = _local2.label.text + "Zoom in / out:\t\tScroll wheel or + / - keys";
_local2.createTextField("title2", 3, 20, 200, 280, 20);
_local2.createTextField("label2", 4, 20, 220, 460, 130);
formatLabel(_local2.title2, true);
formatLabel(_local2.label2);
_local2.title2.text = "Credits";
_local2.label2.text = "Developed by Pete (http://www.parroe.devisland.net/)\nSponsored by onemorelevel.com";
_local2.attachMovie("pglogo", "logo1", 5, {_x:20, _y:270});
_local2.logo1.onPress = function () {
getURL ("http://www.parroe.devisland.net/", "_blank");
};
_local2.attachMovie("omllogo", "logo2", 6, {_x:100, _y:270});
_local2.logo2.onPress = function () {
getURL ("http://www.onemorelevel.com/", "_blank");
};
_local2.attachMovie("cmlogo", "logo3", 7, {_x:150, _y:278});
_local2.logo3.onPress = function () {
getURL ("http://www.cinnaminta.com/", "_blank");
};
_local2.createEmptyMovieClip("no", 8);
plot.closeButton(_local2.no, "X");
_local2.no._x = 460;
_local2.no._y = 20;
_local2.no.onPress = function () {
_root.gui.mymc.dialog.removeMovieClip();
_root.dialog = false;
};
}
function update() {
leftPanel.visible = (_root.mouse.pos.x < 30) && ((!_root.tools.drawing) && (!_root.tools.quick));
rightPanel.visible = (_root.mouse.pos.x > 470) && ((!_root.tools.drawing) && (!_root.tools.quick));
if ((_root.targetHit == _root.targetCount) && ((_root.targetCount > 0) && (!msgPanel.visible))) {
message("Level Complete!", 14548957);
}
leftPanel.update();
rightPanel.update();
msgPanel.update();
hover = leftPanel.visible || (rightPanel.visible);
hover = hover || ((_root.mouse.pos.y < 20) && (msgPanel.visible));
mymc.pausemc._visible = _root.gamePause;
if (splashTime < 100) {
splashTime++;
}
if ((splashTime == 100) && (mymc.splash != undefined)) {
mymc.splash._alpha = mymc.splash._alpha + -1;
if (mymc.splash._alpha < 2) {
mymc.splash.removeMovieClip();
mymc.splash = undefined;
}
}
}
//ASSetPropFlags(_local1, null, 1);
var splashTime = 0;
}
Symbol 20520 MovieClip [__Packages.sectorHandler] Frame 0
class sectorHandler
{
var mymc, sectorSize, sectors, lines, slines, powerups, onScreen;
function sectorHandler () {
mymc = _root.createEmptyMovieClip("linemc", 2);
sectorSize = 100;
sectors = new Array();
lines = new Array();
slines = new Array();
powerups = new Array();
onScreen = new Array();
}
function kill() {
mymc.removeMovieClip();
}
function addRef(pX, pY, pObj, pMode) {
if (pObj.length < 3) {
return(undefined);
}
var _local6 = Math.floor(pX / sectorSize);
var _local7 = Math.floor(pY / sectorSize);
if (sectors[_local6] == undefined) {
sectors[_local6] = new Array();
}
if (sectors[_local6][_local7] == undefined) {
sectors[_local6][_local7] = new sector(_local6, _local7);
}
if (pMode == 1) {
sectors[_local6][_local7].addLine(pObj);
}
if (pMode == 2) {
sectors[_local6][_local7].addPowerup(pObj);
}
}
function newLine(pX1, pY1, pX2, pY2) {
var _local6 = new line(pX1, pY1, pX2, pY2);
if (!_local6.remove) {
var _local7 = bresenham.getSectors(new cartesian(pX1, pY1), new cartesian(pX2, pY2), sectorSize);
for (var i in _local7) {
addRef(_local7[i].x, _local7[i].y, _local6, 1);
}
lines.push(_local6);
}
}
function sceneryLine(pX1, pY1, pX2, pY2) {
var _local6 = new sline(pX1, pY1, pX2, pY2);
if (!_local6.remove) {
var _local7 = bresenham.getSectors(new cartesian(pX1, pY1), new cartesian(pX2, pY2), sectorSize);
for (var i in _local7) {
addRef(_local7[i].x, _local7[i].y, _local6, 1);
}
slines.push(_local6);
}
}
function newTarget(pX, pY) {
var _local4 = new target(pX, pY, mymc);
addRef(pX, pY, _local4, 2);
powerups.push(_local4);
}
function newPowerup(pX, pY, pType, pAngle) {
var _local6;
if (pType == 1) {
_local6 = new slomo(pX, pY, mymc);
}
if (pType == 2) {
_local6 = new gravity(pX, pY, mymc, pAngle);
}
if (pType == 3) {
_local6 = new boost(pX, pY, mymc, pAngle);
}
if (pType == 4) {
_local6 = new bomb(pX, pY, mymc);
}
addRef(pX, pY, _local6, 2);
powerups.push(_local6);
}
function remove(p1, p2) {
if (p2 == undefined) {
p2 = new cartesian(p1.x, p1.y);
}
var _local4 = 0;
while (_local4 < lines.length) {
if (lines[_local4].remove) {
lines.splice(_local4, 1);
}
_local4++;
}
_local4 = 0;
while (_local4 < slines.length) {
if (slines[_local4].remove) {
slines.splice(_local4, 1);
}
_local4++;
}
_local4 = 0;
while (_local4 < powerups.length) {
if (powerups[_local4].remove) {
powerups.splice(_local4, 1);
}
_local4++;
}
var _local5 = bresenham.getSectors(p1, p2, sectorSize);
for (var s in _local5) {
var _local6 = Math.floor(_local5[s].x / sectorSize);
var _local7 = Math.floor(_local5[s].y / sectorSize);
sectors[_local6][_local7].remove();
}
}
function resetPowerups() {
for (var p in powerups) {
if (powerups[p].hit != undefined) {
powerups[p].hit = false;
}
powerups[p].mymc._alpha = 100;
}
_root.targetHit = 0;
}
function collide(pObj) {
var _local3 = Math.floor((pObj.pos.x / sectorSize) - 0.5);
var _local4 = Math.floor((pObj.pos.y / sectorSize) - 0.5);
sectors[_local3][_local4].resetCollided();
sectors[_local3 + 1][_local4].resetCollided();
sectors[_local3 + 1][_local4 + 1].resetCollided();
sectors[_local3][_local4 + 1].resetCollided();
sectors[_local3][_local4].collide(pObj);
sectors[_local3 + 1][_local4].collide(pObj);
sectors[_local3 + 1][_local4 + 1].collide(pObj);
sectors[_local3][_local4 + 1].collide(pObj);
}
function erase(p) {
var _local3 = Math.floor((p.x / sectorSize) - 0.5);
var _local4 = Math.floor((p.y / sectorSize) - 0.5);
sectors[_local3][_local4].erase(p);
sectors[_local3 + 1][_local4].erase(p);
sectors[_local3 + 1][_local4 + 1].erase(p);
sectors[_local3][_local4 + 1].erase(p);
}
function search(p) {
var _local3 = Math.floor(p.x / sectorSize);
var _local4 = Math.floor(p.y / sectorSize);
return(sectors[_local3][_local4].search(p));
}
function hidePowerups() {
for (var i in onScreen) {
onScreen[i].hidePowerups();
}
}
function draw() {
mymc.clear();
var _local2 = new cartesian(0, 0);
_local2 = _local2.toReal();
var _local3 = new cartesian(500, 400);
_local3 = _local3.toReal();
_local2.x = Math.floor(_local2.x / sectorSize);
_local2.y = Math.floor(_local2.y / sectorSize);
_local3.x = Math.floor(_local3.x / sectorSize);
_local3.y = Math.floor(_local3.y / sectorSize);
onScreen = new Array();
var _local4 = _local2.x;
for ( ; _local4 <= _local3.x ; _local4++) {
var _local5 = _local2.y;
for ( ; _local5 <= _local3.y ; _local5++) {
onScreen.push(sectors[_local4][_local5]);
}
}
for (var i in onScreen) {
onScreen[i].resetDrawn(mymc);
}
for (var i in onScreen) {
onScreen[i].draw(mymc);
}
}
//ASSetPropFlags(_local1, null, 1);
}
Symbol 20521 MovieClip [__Packages.explosion] Frame 0
#initclip
if (!explosion) {
//(_global.explosion = function (p) {
super();
console.write((p.x + ",") + p.y, "explosion::explosion", "C:\\Documents and Settings\\abk\\My Documents\\Flash\\FR2\\classes\\vehicle/explosion.as", 60);
this.t = 30 + (20 * Math.random());
this.fade = 0;
this.masses.push(new debris(p, this));
this.masses.push(new debris(p, this));
this.masses.push(new debris(p, this));
this.masses.push(new debris(p, this));
this.masses.push(new debris(p, this));
this.c = new cartesian(p.x, p.y);
this.head = new mass(p, this);
this.head.vel.x = 20;
this.alive = false;
}) extends vehicle
var _local1 = (_global.explosion /* register */).prototype;
_local1.kill = function () {
this.mymc.removeMovieClip();
};
_local1.draw = function () {
this.mymc.clear();
if (this.t > 0) {
this.t = this.t + -10;
var _local2 = this.c.toScreen();
var _local3 = 0;
var _local4 = Math.random() * 6.2;
var _local5 = this.t * _root.cam.zoom;
var _local6 = _local2.x + (_local5 * Math.cos(_local4));
var _local7 = _local2.y + (_local5 * Math.sin(_local4));
this.mymc.moveTo(_local6, _local7);
this.mymc.lineStyle(0 * _root.cam.zoom, 16768256, 50);
this.mymc.beginFill(16768256, 50);
while ((_local3++) < 16) {
_local5 = (this.t + (30 * Math.random())) * _root.cam.zoom;
_local6 = _local2.x + (_local5 * Math.cos(_local4 + ((6.283 * _local3) / 16)));
_local7 = _local2.y + (_local5 * Math.sin(_local4 + ((6.283 * _local3) / 16)));
this.mymc.lineTo(_local6, _local7);
}
this.mymc.endFill();
}
for (var i in this.masses) {
this.masses[i].draw();
}
};
_local1.update = function () {
if ((this.fade++) > 200) {
this.mymc._alpha = this.mymc._alpha + -2;
}
if (this.fade > 250) {
for (var i in this.masses) {
this.masses[i].kill();
}
this.masses = new Array();
}
for (var i in this.springs) {
this.springs[i].update();
}
for (var i in this.masses) {
this.masses[i].update();
}
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20522 MovieClip [__Packages.line] Frame 0
class line
{
var p1, p2, pp, length, remove, drawn, collided;
function line (pX1, pY1, pX2, pY2) {
p1 = new cartesian(Math.round(pX1), Math.round(pY1));
p2 = new cartesian(Math.round(pX2), Math.round(pY2));
pp = p2.sub(p1);
length = pp.length();
remove = (length < 3) || (length > 100000);
}
function getCode() {
drawn = true;
_root.halt++;
var _local2 = " " + parser.point(p2);
var _local3 = _root.sectors.search(p2);
if ((_local3 != undefined) && (_root.halt < 50)) {
_local2 = _local2 + _local3.getCode();
}
return(_local2);
}
function draw(pMC) {
if (drawn) {
return(undefined);
}
drawn = true;
var _local3 = p1.toScreen();
var _local4 = p2.toScreen();
pMC.lineStyle(2 * _root.cam.zoom, 0, 100);
pMC.moveTo(_local3.x, _local3.y);
pMC.lineTo(_local4.x, _local4.y);
}
function collide(pMass) {
if (collided) {
return(undefined);
}
collided = true;
var _local3 = pMass.pos;
var _local4 = pMass.vel;
var _local5 = pMass.radius;
var _local6 = new cartesian(0, 0);
var _local7 = 0;
var _local8 = _local3.sub(p1);
var _local9 = (_local8.dot(pp) / length) / length;
if ((_local9 >= 0) && (_local9 <= 1)) {
var _local10 = (((((_local8.x * pp.y) - (_local8.y * pp.x)) * (((_local8.x - _local4.x) * pp.y) - ((_local8.y - _local4.y) * pp.x))) < 0) ? -1 : 1);
_local6 = _local8.sub(pp.factor(_local9));
_local7 = _local6.length();
if ((_local7 < _local5) || (_local10 < 0)) {
_local3.inc(_local6.factor(((_local5 * _local10) - _local7) / _local7));
pMass.drive(new cartesian((-_local6.y) / _local7, _local6.x / _local7));
return(undefined);
}
}
if (((_local9 * length) < (-_local5)) || ((_local9 * length) > (length + _local5))) {
return(undefined);
}
var _local11 = ((_local9 > 0) ? (p2) : (p1));
_local6 = _local3.sub(_local11);
_local7 = _local6.length();
if (_local7 < _local5) {
_local3.inc(_local6.factor((_local5 - _local7) / _local7));
pMass.drive(new cartesian((-_local6.y) / _local7, _local6.x / _local7));
return(undefined);
}
}
function erase(m) {
var _local3 = 15;
var _local4 = new cartesian(0, 0);
var _local5 = 0;
var _local6 = m.sub(p1);
var _local7 = (_local6.dot(pp) / length) / length;
if ((_local7 >= 0) && (_local7 <= 1)) {
_local4 = _local6.sub(pp.factor(_local7));
_local5 = _local4.length();
if (_local5 < _local3) {
remove = true;
_root.sectors.remove(p1, p2);
}
}
}
//ASSetPropFlags(_local1, null, 1);
}
Symbol 20523 MovieClip [__Packages.menuItem] Frame 0
class menuItem
{
var image, tip, action;
function menuItem (pImage, pTip, pAction) {
image = pImage;
tip = pTip;
action = pAction;
}
//ASSetPropFlags(_local1, null, 1);
}