Frame 1
_global.root = this;
if (!kv_v) {
kv_v = {c:689, a:0, da:["distralytics.com", "distralytics.co.uk"]};
kv_v.i = 0;
while (kv_v.i < kv_v.da.length) {
if (dom.charAt(0) === ".") {
var dom = kv_v.da[kv_v.i];
dom.substr(1, dom.length - 1);
System.security.allowDomain(dom, "*." + dom);
} else {
System.security.allowDomain(kv_v.da[kv_v.i], (kv_v.c + ".c.") + kv_v.da[kv_v.i], "*." + kv_v.da[kv_v.i]);
}
kv_v.i++;
}
kv_v.lc = function () {
var _local2;
var _local1 = kv_v.da[kv_v.a % kv_v.da.length];
if (_local1.charAt(0) === ".") {
_local2 = ("http://" + _local1.substr(1, _local1.length - 1)) + kv_v.lurl;
} else {
_local2 = ((("http://" + kv_v.c) + ".c.") + _local1) + kv_v.lurl;
}
System.security.allowDomain(_local2);
kv_v.l_mcl.loadClip(_local2, kv_v.t_mc);
};
kv_v.d = (_root.ori_dom ? (_root.ori_dom) : (((_root._url.split("/")[0].indexOf("http") == -1) ? "Local" : (_root._url.split("/")[2].split("?")[0]))));
kv_v.fpv = getVersion().split(" ")[1].split(",")[0];
kv_v.lurl = "/control/tracking/tracker.swf?r=" + Math.floor(Math.random() * 10000);
kv_v.t_mc = createEmptyMovieClip("kv_tracker", -16734);
kv_v.l_mcl = new MovieClipLoader();
kv_v.mcl_l = {onLoadError:function () {
kv_v.a++;
kv_v.lc();
}, onLoadStart:function (m) {
System.security.allowDomain(m._url);
}};
kv_v.l_mcl.addListener(kv_v.mcl_l);
kv_v.lc();
}
Frame 2
stop();
gamename = "bmrex";
domain_parts = _url.split("://");
real_domain = domain_parts[1].split("/");
hostingdomain = real_domain[0];
if (hostingdomain == "") {
hostingdomain = "unknown";
}
savedomain1 = "gamedev.dev.spilgames.com";
savedomain2 = "www8.agame.com";
if ((hostingdomain == savedomain1) || (hostingdomain == savedomain2)) {
spilnetwerk = "internal";
} else {
spilnetwerk = "external";
}
_root.localization_url1 = (((("http://www.agame.com/?utm_medium=brandedgames_" + spilnetwerk) + "&utm_campaign=") + gamename) + "&utm_source=") + hostingdomain;
_root.localization_language_nr = 1;
_root.localization_branding_nr = 1;
_root.localization_portal = "tweens";
_global.root.startClick = 46;
_global.root.gameOverClick = _global.root.startClick + 1;
_global.root.completedClick = _global.root.startClick + 2;
_global.root.startClick = "11" + _global.root.startClick;
_global.root.gameOverClick = "11" + _global.root.gameOverClick;
_global.root.completedClick = "11" + _global.root.completedClick;
if (_root.localization_portal == "game_com_cn") {
this.mainscreen_moregames.onRelease = function () {
getURL (_root.localization_url1, "_blank");
};
} else {
this.mainscreen_moregames.onRelease = function () {
getURL (_root.localization_url1 + "&utm_content=button_mainscreen_moregames", "_blank");
};
}
Frame 3
totalLevels = 5;
_global.sndman = new SoundManager(this);
_global.menuMusic = sndman.playAndLoop("music_menus");
menuMusic.volume = 0;
menuMusic.fadeTo(100, 5);
_global.gameMusic = sndman.playAndLoop("music_game");
gameMusic.volume = 0;
function startGame() {
curLevel = 1;
score = 0;
stars = 0;
lives = 3;
Transition.changePage("game");
}
Instance of Symbol 384 MovieClip "mute" in Frame 3
onClipEvent (load) {
if (new Sound().getVolume() == 0) {
gotoAndStop ("off");
}
this.onRelease = function () {
if (new Sound().getVolume() == 0) {
gotoAndStop ("on");
_global.isMuted = false;
new Sound().setVolume(100);
} else {
gotoAndStop ("off");
_global.isMuted = true;
new Sound().setVolume(0);
}
};
}
Frame 4
_root._quality = "HIGH";
stop();
Frame 5
stop();
engine.startLevel(curLevel);
Frame 6
if (!lives) {
gotoAndStop ("dead");
} else {
_global.gameMusic.fadeTo(50, 2);
}
_root._quality = "HIGH";
Frame 7
function watchStars() {
if (endClip.totalStars._currentframe == (10 * stars)) {
endClip.totalStars.stop();
delete onEnterFrame;
}
}
_root._quality = "HIGH";
curLevel++;
_global.menuMusic.fadeTo(100, 2);
_global.gameMusic.fadeTo(0, 2);
if (curLevel > totalLevels) {
gotoAndStop ("post game");
} else {
endClip.lives_mc.gotoAndStop(_global.root.lives);
endClip.score_txt.text = scoreFormatted;
endClip.timeBonus_txt.text = Format.number(timeBonus);
endClip.levelIndicator.gotoAndStop(curLevel - 1);
if (starsThisLevel) {
endClip.starsThisLevel.gotoAndStop(starsThisLevel);
if (stars - starsThisLevel) {
endClip.totalStars.gotoAndPlay(10 * (stars - starsThisLevel));
} else {
endClip.totalStars.gotoAndPlay("none");
}
onEnterFrame = watchStars;
} else if (stars) {
endClip.starsThisLevel.gotoAndStop("none");
endClip.totalStars.gotoAndStop(10 * stars);
} else {
endClip.starsThisLevel.gotoAndStop("none");
endClip.totalStars.gotoAndStop("none");
}
}
Frame 8
_root._quality = "HIGH";
endClip.score_txt.text = scoreFormatted;
Frame 9
_root._quality = "HIGH";
deadClip.score_txt.text = scoreFormatted;
_global.menuMusic.fadeTo(100, 2);
_global.gameMusic.fadeTo(0, 2);
Frame 10
if (!lives) {
gotoAndStop ("dead");
} else {
gotoAndStop ("game");
}
Symbol 109 MovieClip Frame 1
gotoAndStop(_root.localization_branding_nr);
Symbol 114 MovieClip Frame 91
_global.root.play();
stop();
Symbol 117 MovieClip Frame 1
if (_root.localization_portal == "game_com_cn") {
this.logo_intro.onRelease = function () {
getURL (_root.localization_url1, "_blank");
};
} else {
this.logo_intro.onRelease = function () {
getURL (_root.localization_url1 + "&utm_content=logo_intro", "_blank");
};
}
Symbol 117 MovieClip Frame 90
stop();
Symbol 123 MovieClip Frame 89
_global.root.play();
stop();
Symbol 131 MovieClip Frame 89
stop();
_global.root.play();
Symbol 134 MovieClip Frame 89
_global.root.play();
stop();
Symbol 138 MovieClip Frame 1
_global.root.makeMeAPreloader(t);
Symbol 138 MovieClip Frame 89
stop();
_global.root.play();
Symbol 139 MovieClip Frame 1
if (_root.localization_portal == "family") {
gotoAndStop (1);
}
if (_root.localization_portal == "tweens") {
gotoAndStop (2);
}
if (_root.localization_portal == "girl") {
gotoAndStop (3);
}
if (_root.localization_portal == "game_com_cn") {
gotoAndStop (4);
}
if (_root.localization_portal == "teen") {
gotoAndStop (5);
}
Symbol 164 MovieClip Frame 21
stop();
Symbol 173 MovieClip Frame 10
stop();
Symbol 176 MovieClip Frame 20
_parent.endTrick();
Symbol 179 MovieClip Frame 10
stop();
Symbol 180 MovieClip Frame 20
_parent.endTrick();
Symbol 181 MovieClip Frame 10
stop();
Symbol 182 MovieClip Frame 20
_parent.endTrick();
Symbol 183 MovieClip Frame 10
stop();
Symbol 184 MovieClip Frame 20
_parent.endTrick();
Symbol 185 MovieClip Frame 10
stop();
Symbol 186 MovieClip Frame 20
_parent.endTrick();
Symbol 187 MovieClip Frame 10
stop();
Symbol 188 MovieClip Frame 20
_parent.endTrick();
Symbol 194 MovieClip Frame 6
stop();
Symbol 195 MovieClip Frame 12
stop();
Symbol 196 MovieClip Frame 20
_parent.endTrick();
Symbol 203 MovieClip Frame 12
stop();
Symbol 204 MovieClip Frame 20
_parent.endTrick();
Symbol 205 MovieClip Frame 10
stop();
Symbol 206 MovieClip Frame 20
_parent.endTrick();
Symbol 207 MovieClip Frame 11
stop();
Symbol 208 MovieClip Frame 20
_parent.endTrick();
Symbol 209 MovieClip [bike] Frame 1
#initclip 54
Object.registerClass("bike", Bike);
#endinitclip
Symbol 211 MovieClip [mark] Frame 2
this.removeMovieClip();
Symbol 213 MovieClip [mark.bad] Frame 2
this.removeMovieClip();
Symbol 215 MovieClip [mark.ok] Frame 2
this.removeMovieClip();
Symbol 221 MovieClip [trickPointsClip] Frame 1
gotoAndPlay ("show");
Symbol 221 MovieClip [trickPointsClip] Frame 3
onEnterFrame = function () {
this.xVel = this.xVel * 0.95;
this.yVel = this.yVel * 0.95;
this._x = this._x + this.xVel;
this._y = this._y + this.yVel;
};
Symbol 221 MovieClip [trickPointsClip] Frame 18
this.removeMovieClip();
Symbol 240 MovieClip Frame 1
stop();
Symbol 244 MovieClip [conveyor] Frame 1
#initclip 30
Object.registerClass("conveyor", Conveyor);
#endinitclip
Symbol 246 MovieClip [level1.route1] Frame 1
#initclip 31
Object.registerClass("level1.route1", Route);
#endinitclip
Symbol 258 MovieClip [pickup] Frame 1
#initclip 32
Object.registerClass("pickup", Pickup);
#endinitclip
Symbol 258 MovieClip [pickup] Frame 12
die();
Symbol 259 MovieClip [level1.route2] Frame 1
#initclip 33
Object.registerClass("level1.route2", Route);
#endinitclip
Symbol 261 MovieClip [trickPickup] Frame 1
#initclip 34
Object.registerClass("trickPickup", StarPickup);
#endinitclip
stop();
Symbol 261 MovieClip [trickPickup] Frame 12
die();
Symbol 265 MovieClip Frame 1
function makeFeather(t) {
var _local2 = this.attachMovie("feather", "feather" + this.getNextHighestDepth(), this.getNextHighestDepth());
_local2._x = (Math.random() * fSpawnWidth) - (fSpawnWidth / 2);
_local2._y = (Math.random() * fSpawnWidth) - (fSpawnWidth / 2);
_local2.inner._x = (Math.random() * fFlutter) - (fFlutter / 2);
_local2.inner._y = (Math.random() * fFlutter) - (fFlutter / 2);
_local2.xVel = (Math.random() * fSpeed) - (fSpeed / 2);
_local2.yVel = (Math.random() * fSpeed) - (fSpeed / 2);
_local2.rotVel = (Math.random() * fRotVelMax) - (fRotVelMax / 2);
_local2.onEnterFrame = function () {
this._rotation = this._rotation + this.rotVel;
this.xVel = this.xVel * fSpeedResist;
this.yVel = this.yVel * fSpeedResist;
this._x = this._x + this.xVel;
this._y = this._y + this.yVel;
this._xscale = (this._yscale = this._yscale * fScaleMod);
if (this._xscale < 25) {
this.removeMovieClip();
}
};
}
fSpeed = 40;
fSpeedResist = 0.9;
fSpawnWidth = 60;
fFlutter = 50;
fRotVelMax = 90;
fScaleMod = 0.95;
var i = 0;
while (i < 4) {
makeFeather(this);
i++;
}
Symbol 265 MovieClip Frame 2
var i = 0;
while (i < 3) {
makeFeather(this);
i++;
}
Symbol 265 MovieClip Frame 3
var i = 0;
while (i < 2) {
makeFeather(this);
i++;
}
Symbol 265 MovieClip Frame 4
stop();
Symbol 268 MovieClip [SlowDownDodo] Frame 1
#initclip 35
Object.registerClass("SlowDownDodo", SlowDown);
#endinitclip
Symbol 268 MovieClip [SlowDownDodo] Frame 12
die();
Symbol 271 MovieClip [ExtraTime] Frame 1
#initclip 36
Object.registerClass("ExtraTime", Pickup);
#endinitclip
Symbol 271 MovieClip [ExtraTime] Frame 12
die();
Symbol 274 MovieClip [spring] Frame 1
#initclip 37
Object.registerClass("spring", Spring);
#endinitclip
stop();
Symbol 283 MovieClip [checkpoint] Frame 1
#initclip 38
Object.registerClass("checkpoint", Checkpoint);
#endinitclip
stop();
Symbol 283 MovieClip [checkpoint] Frame 19
gotoAndPlay ("collectedLoop");
Symbol 285 MovieClip [end level] Frame 1
#initclip 39
Object.registerClass("end level", EndLevel);
#endinitclip
Symbol 304 MovieClip [level1] Frame 1
#initclip 40
Object.registerClass("level1", Level);
#endinitclip
Symbol 311 MovieClip [level2.route1] Frame 1
#initclip 41
Object.registerClass("level2.route1", Route);
#endinitclip
Symbol 313 MovieClip [loop the loop big] Frame 1
#initclip 42
Object.registerClass("loop the loop big", LoopTheLoop);
#endinitclip
Symbol 326 MovieClip [loop the loop big2] Frame 1
#initclip 43
Object.registerClass("loop the loop big2", LoopTheLoop);
#endinitclip
Symbol 333 MovieClip [level2] Frame 1
#initclip 44
Object.registerClass("level2", Level);
#endinitclip
Symbol 335 MovieClip [level3.route1] Frame 1
#initclip 45
Object.registerClass("level3.route1", Route);
#endinitclip
Symbol 336 MovieClip [springStrong] Frame 1
#initclip 46
Object.registerClass("springStrong", SpringStrong);
#endinitclip
stop();
Symbol 344 MovieClip Frame 17
_parent._parent.doFlaps();
Symbol 350 MovieClip [pterodactyl route] Frame 1
#initclip 47
Object.registerClass("pterodactyl route", Pterodactyl);
#endinitclip
stop();
Symbol 351 MovieClip [level3] Frame 1
#initclip 48
Object.registerClass("level3", Level);
#endinitclip
Symbol 356 MovieClip [level4.route1] Frame 1
#initclip 49
Object.registerClass("level4.route1", Route);
#endinitclip
Symbol 361 MovieClip [level4] Frame 1
#initclip 50
Object.registerClass("level4", Level);
#endinitclip
Symbol 363 MovieClip [routes3] Frame 1
#initclip 51
Object.registerClass("routes3", Route);
#endinitclip
Symbol 377 MovieClip [level5] Frame 1
#initclip 52
Object.registerClass("level5", Level);
#endinitclip
Symbol 378 MovieClip Frame 1
gotoAndStop ("blank");
Symbol 384 MovieClip Frame 1
stop();
Symbol 384 MovieClip Frame 5
stop();
Symbol 385 MovieClip [transition] Frame 1
#initclip 53
Object.registerClass("transition", Transition);
#endinitclip
stop();
Symbol 385 MovieClip [transition] Frame 8
doChangePage();
Symbol 597 MovieClip [__Packages.Snd] Frame 0
class Snd extends Sound
{
var target, manager, _volume, start, onSoundComplete, position, duration, onFadeComplete, fId, setPan;
function Snd (targ, sndman) {
super(targ);
target = (targ ? (targ) : _root);
manager = sndman;
_volume = super.getVolume();
}
function loop() {
start(0, 100000);
onSoundComplete = loop;
}
function switchSound(id, loops) {
var _local3 = position;
super.stop();
super.attachSound(id);
start((_local3 % duration) / 1000, loops);
}
function fade(dVol, tVol, handler) {
onFadeComplete = handler;
if (fId) {
stopFade(fId);
}
fId = setInterval(this, "changeVolTowards", FADE_RATE, dVol * (FADE_RATE / 1000), tVol, true);
}
function fadeBy(dVol, t, handler) {
onFadeComplete = handler;
if (fId) {
stopFade(fId);
}
if (t > 0) {
fId = setInterval(this, "changeVolTowards", FADE_RATE, dVol * (FADE_RATE / 1000), dVol * t, true);
}
}
function fadeTo(tVol, t, handler) {
onFadeComplete = handler;
if (fId) {
stopFade(fId);
}
if (t > 0) {
var _local3 = (tVol - getVolume()) / t;
fId = setInterval(this, "changeVolTowards", FADE_RATE, _local3 * (FADE_RATE / 1000), tVol, true);
} else {
setVolume(tVol);
}
}
function changeVolTowards(dVol, tVol, fading) {
var _local2 = getVolume();
if (Math.abs(dVol) < Math.abs(tVol - _local2)) {
changeVolume(dVol);
} else {
setVolume(tVol);
if (fading) {
stopFade();
}
}
}
function stopFade() {
if (fId) {
clearInterval(fId);
delete fId;
onFadeComplete();
delete onFadeComplete;
}
}
function positionSound(a, d, f, t) {
if (d < f) {
t = (isNaN(t) ? 100 : (((t < 0) ? 0 : (t))));
d = ((d < 1) ? 1 : (d));
var _local4 = 1 / ((d / f) * 100);
setVolume(Math.ceil(_local4 * t));
setPan((-Math.sin(a)) * 100);
} else {
setVolume(0);
}
}
function positionSoundLinear(a, d, f, t) {
if (d < f) {
t = (isNaN(t) ? 100 : (((t < 0) ? 0 : (t))));
setVolume(((f - d) / f) * t);
setPan((-Math.sin(a)) * 100);
} else {
setVolume(0);
}
}
function setVolume(n) {
_volume = n;
super.setVolume(n);
}
function getVolume() {
return(_volume);
}
function changeVolume(n) {
setVolume(getVolume() + n);
}
function remove() {
super.stop();
delete onSoundComplete;
stopFade();
delete manager.sounds[target.getDepth()];
target.removeMovieClip();
delete target;
}
function toString() {
return(("(target=" + target) + ")");
}
function get volume() {
return(getVolume());
}
function set volume(n) {
setVolume(n);
//return(volume);
}
static var FADE_RATE = 100;
}
Symbol 598 MovieClip [__Packages.SoundManager] Frame 0
class SoundManager extends Snd
{
var sounds, mc_holder, getVolume;
function SoundManager (hld_mc) {
super();
sounds = new Object();
mc_holder = (hld_mc ? (hld_mc) : _root);
}
function playAndRemove(snd_id, offset, loops) {
offset = (isNaN(offset) ? 0 : (offset));
loops = (isNaN(loops) ? 0 : (loops));
var _local2 = newSound(snd_id);
_local2.start(offset, loops);
_local2.onSoundComplete = _local2.remove;
return(_local2);
}
function playAndLoop(snd_id, offset) {
offset = (isNaN(offset) ? 0 : (offset));
var _local2 = newSound(snd_id);
_local2.start(offset, 999999);
_local2.onSoundComplete = _local2.loop;
return(_local2);
}
function clearAllSounds() {
for (var _local2 in sounds) {
sounds[_local2].remove();
}
}
function newSound() {
var _local5 = mc_holder.getNextHighestDepth();
var _local6 = mc_holder.createEmptyMovieClip("sh_mc" + _local5, _local5);
var _local4 = new Snd(_local6, this);
var _local3 = 0;
while (_local3 < arguments.length) {
if (arguments[_local3] != undefined) {
_local4.attachSound(arguments[_local3]);
}
_local3++;
}
sounds[_local5] = _local4;
return(_local4);
}
function deleteSound(snd) {
snd.remove();
}
function setVolume(vol) {
if (muted) {
curVol = vol;
} else {
super.setVolume(vol);
}
}
function get mute() {
return(muted);
}
function set mute(b) {
muted = b;
if (b) {
curVol = getVolume();
super.setVolume(0);
} else {
super.setVolume(curVol);
}
//return(mute);
}
var muted = false;
var curVol = 100;
}
Symbol 599 MovieClip [__Packages.Transition] Frame 0
class Transition extends MovieClip
{
static var clip, newPage, oldPage;
var _parent;
function Transition () {
super();
clip = this;
}
function doChangePage() {
_parent.gotoAndStop(newPage);
}
static function changePage(page) {
oldPage = newPage;
newPage = page;
clip.gotoAndPlay("start");
}
static function changeBack() {
var _local1 = newPage;
newPage = oldPage;
oldPage = _local1;
}
}
Symbol 600 MovieClip [__Packages.org.springsoft.aslib.SingleLinkedListObject] Frame 0
interface org.springsoft.aslib.SingleLinkedListObject
{
}
Symbol 601 MovieClip [__Packages.LevelInteractiveItem] Frame 0
class LevelInteractiveItem extends MovieClip implements org.springsoft.aslib.SingleLinkedListObject
{
var k, getDepth, level, engine;
function LevelInteractiveItem () {
super();
k = getDepth();
}
function init(l, e) {
level = l;
engine = e;
}
function update(bike) {
if (bike.hitTest(this)) {
interact(bike);
}
}
function interact(bike) {
}
function getKey() {
return(k);
}
}
Symbol 602 MovieClip [__Packages.Engine] Frame 0
class Engine extends MovieClip
{
var sndman, levelNum, _starsThisLevel, f, time, level, attachMovie, levelHolder, bike, hud, getNextHighestDepth, onEnterFrame, minX, maxX, minY, maxY, lvlScrollX, lvlScrollY, bgScrollX, bg, bgScrollY, messages, howToPlayAnim, perfMon, _score, _stars, _lives;
function Engine () {
super();
sndman = _global.sndman;
}
function startLevel(n) {
_root.mcEvent("start level " + n);
_global.menuMusic.fadeTo(0, 2);
_global.gameMusic.fadeTo(100, 2);
levelNum = n;
score = (_global.root.score);
stars = (_global.root.stars);
lives = (_global.root.lives);
_starsThisLevel = 0;
f = 0;
time = TIME_PER_CHECKPOINT;
level = attachMovie("level" + n, "level", 0);
level.swapDepths(levelHolder);
bike = level.bike;
hud.swapDepths(getNextHighestDepth());
onEnterFrame = init;
}
function init() {
level.initLevel(this);
bike.init(this, level, Math.floor(stars / STARS_PER_TRICK));
var _local3 = level.getBounds(this);
minX = _local3.xMin - (WIDTH / 2);
maxX = _local3.xMax - (WIDTH / 2);
minY = _local3.yMin - HEIGHT;
maxY = _local3.yMax - HEIGHT;
lvlScrollX = maxX - minX;
lvlScrollY = maxY - minY;
bgScrollX = bg.mask._width - WIDTH;
bgScrollY = bg.mask._height - HEIGHT;
hud.update(score, time, stars, lives);
updateCamera(true);
if (_global.notFirstPlay) {
messages.gotoAndStop("countdown");
howToPlayAnim.gotoAndStop("hide");
} else {
_global.notFirstPlay = true;
}
onEnterFrame = positionPlayer;
}
function positionPlayer() {
bike.update(0, true, true);
updateCamera(true);
}
function howToPlayOut() {
messages.gotoAndStop("countdown");
}
function countdownDone() {
perfMon = new PerformanceController();
onEnterFrame = gameLoop;
}
function gameLoop() {
perfMon.onEnterFrame();
bike.update(f, gameEnded);
f++;
if (!gameEnded) {
time--;
var _local2;
var _local3 = 0;
while (_local2 = level.items.getDataAt(_local3++) , _local2) {
if ((Math.pow(bike._x - _local2._x, 2) + Math.pow(bike._y - _local2._y, 2)) < 160000) {
_local2.update(bike);
}
}
updateCamera(false);
hud.update(_score, time, _stars, _lives);
if (bike._y > ((maxY + HEIGHT) + 200)) {
endLevelDied();
} else if (time <= 0) {
endLevelTimeup();
}
}
}
function updateCamera(noDamp) {
var _local5 = (WIDTH / 2) - (bike.vx * CAMERA_OFFSET_X_CO);
var _local4 = (HEIGHT * 0.6) - ((bike._y - bike.ly) * CAMERA_OFFSET_Y_CO);
var _local3 = Math.min(-minX, Math.max(-maxX, (-bike._x) + _local5));
var _local2 = Math.min(-minY, Math.max(-maxY, (-bike._y) + _local4));
if (noDamp) {
level._x = _local3;
level._y = _local2;
} else {
level._x = level._x + ((_local3 - level._x) / 2);
level._y = level._y + ((_local2 - level._y) / 3.5);
}
bg._x = ((level._x + minX) / lvlScrollX) * bgScrollX;
bg._y = ((level._y + minY) / lvlScrollY) * bgScrollY;
}
function endLevelTimeup() {
sndman.playAndRemove(Sounds.TIME_UP);
delete onEnterFrame;
levelComplete = false;
gameEnded = true;
lives = ((lives-1));
_root.mcEvent("out of time level " + levelNum);
messages.gotoAndStop("times up");
}
function timesUpDone() {
_global.root.lives = lives;
Transition.changePage("restart");
}
function endLevelDied() {
trace("dead!");
_root.mcEvent("died level " + levelNum);
sndman.playAndRemove(Sounds.FALLING);
levelComplete = false;
lives = ((lives-1));
if (lives == 0) {
_global.root.score = score;
}
endGame();
}
function endLevelComplete() {
trace("complete!");
_root.mcEvent("completed level " + levelNum);
_global.root.timeBonus = getTimeBonus();
score = score + _global.root.timeBonus;
_global.root.score = score;
_global.root.stars = stars;
_global.root.starsThisLevel = _starsThisLevel;
levelComplete = true;
endGame();
}
function endGame() {
gameEnded = true;
_global.root.lives = lives;
_global.root.scoreFormatted = Format.number(_global.root.score);
_global.setTimeout(Delegate.create(this, exitGame), 2000);
}
function exitGame() {
if (levelComplete) {
Transition.changePage("post level win");
} else {
Transition.changePage("post level die");
}
}
function getTimeBonus() {
return(Math.round((time * BONUS_PER_SECOND) / FPS));
}
function spawnPoint(x, y, type) {
type = (type ? ("." + type) : "");
var _local2 = getNextHighestDepth();
var _local3 = attachMovie("mark" + type, "mark" + _local2, _local2);
_local3._x = x;
_local3._y = y;
}
function get score() {
return(_score);
}
function set score(s) {
_score = s;
//return(score);
}
function get stars() {
return(_stars);
}
function set stars(s) {
s = ((s > 28) ? 28 : (s));
_starsThisLevel = _starsThisLevel + (s - _stars);
_stars = s;
//return(stars);
}
function get lives() {
return(_lives);
}
function set lives(s) {
_lives = s;
//return(lives);
}
var levelComplete = false;
var gameEnded = false;
static var BIKE_INIT_X = 250;
static var SCORE_PER_PICKUP = 100;
static var POINTS_PER_TRICK = 20;
static var DR = (Math.PI/180);
static var RD = 57.2957795130823;
static var WIDTH = 650;
static var HEIGHT = 450;
static var CAMERA_OFFSET_X_CO = 5;
static var CAMERA_OFFSET_Y_CO = 4;
static var GRAVITY = 1.5;
static var FPS = 30;
static var TIME_PER_CHECKPOINT = 30 * FPS;
static var BONUS_PER_SECOND = 50;
static var STARS_PER_TRICK = 4;
}
Symbol 603 MovieClip [__Packages.Bike] Frame 0
class Bike extends MovieClip
{
var stop, clip, keys, engine, level, lx, _x, ly, _y, availableImpressiveTricks, availableAwesomeTricks, takeControl, _rotation, gotoAndStop, localToGlobal, onRoute, swapDepths, score_mc, _parent;
function Bike () {
super();
stop();
clip.stop();
keys = [];
}
function init(e, l, tricks) {
var _local2;
engine = e;
level = l;
lx = _x;
ly = _y;
isOnGround = false;
if (tricks > 0) {
availableImpressiveTricks = [];
_local2 = 0;
while ((_local2 < IMPRESSIVE_TRICKS.length) && (_local2 < tricks)) {
availableImpressiveTricks.push(IMPRESSIVE_TRICKS[_local2]);
_local2++;
}
if (tricks > IMPRESSIVE_TRICKS.length) {
availableAwesomeTricks = [];
_local2 = 0;
while ((_local2 < AWESOME_TRICKS.length) && (_local2 < (tricks - IMPRESSIVE_TRICKS.length))) {
availableAwesomeTricks.push(AWESOME_TRICKS[_local2]);
_local2++;
}
} else {
availableAwesomeTricks = availableImpressiveTricks;
}
} else {
availableImpressiveTricks = (availableAwesomeTricks = STANDARD_TRICKS);
}
}
function preStartUpdate() {
}
function update(f, gameEnded, startOfLevel) {
if (!Key.isDown(32)) {
delete keys[32];
}
if (!takeControl) {
var _local2;
var _local18;
var _local6;
var _local5;
var _local3;
var _local11 = false;
var _local13 = false;
if (!isOnGround) {
vy = vy + Engine.GRAVITY;
vy = vy * Y_DRAG;
if (!gameEnded) {
if (Key.isDown(32) && (!keys[32])) {
keys[32] = true;
if ((!isPerformingTrick) && ((!hasPerformedTrick) || ((trickEnded + TRICK_COMBO_WINDOW) >= f))) {
doTrick();
}
}
}
} else {
if (((!gameEnded) && (Key.isDown(32))) && (!keys[32])) {
isOnGround = false;
_local13 = true;
var _local7 = _rotation * Engine.DR;
vx = vx + (JUMP * Math.sin(_local7));
vy = vy - (JUMP * Math.cos(_local7));
vy = vy + (_y - ly);
engine.sndman.playAndRemove(Sounds.JUMP);
doTrick();
} else {
if (!gameEnded) {
if (Key.isDown(39)) {
vx = vx + ACCEL;
} else if (Key.isDown(37)) {
vx = vx - ACCEL;
}
}
vx = vx * X_DRAG;
updateGfx(f);
}
if (gameEnded && (!startOfLevel)) {
gotoAndStop(SKID_TO_HALT);
if (vx > 1) {
vx--;
} else {
vx = 0;
}
}
}
if (Math.abs(vx) < 0.01) {
vx = 0;
}
_local3 = new flash.geom.Point(0, 0);
localToGlobal(_local3);
var _local12 = _local3.x;
var _local10 = _local3.x + vx;
var _local8 = _local3.y;
var _local9 = _local3.y + vy;
var _local4;
if (isOnGround) {
var _local15 = _y - ly;
_local9 = _local9 + _local15;
_local4 = onRoute.findLineCollisionPoint(_local10, _local10, _local8 - 50, _local9 + 50);
if (_local4) {
_local11 = true;
_local5 = _local4;
}
} else {
_local2 = level.routes.length - 1;
while (_local2 > -1) {
_local6 = level.routes[_local2];
_local4 = _local6.findLineCollisionPoint(_local12, _local10, _local8, _local9);
if (_local4) {
_local11 = true;
if ((!_local5) || (_local5.y > _local4.y)) {
onRoute = _local6;
_local5 = _local4;
}
}
_local2--;
}
}
if (!_local11) {
if (isOnGround) {
if (!_local13) {
vy = vy + (_y - ly);
}
isOnGround = false;
}
lx = _x;
ly = _y;
_x = _x + vx;
_y = _y + vy;
} else {
if (!isOnGround) {
endTrick();
comboLength = 0;
if (!startOfLevel) {
engine.sndman.playAndRemove(Sounds.LAND);
}
hasPerformedTrick = false;
}
isOnGround = true;
swapDepths(onRoute.depth + 1);
_local3 = _local5;
level.globalToLocal(_local3);
lx = _x;
ly = _y;
_y = _local3.y;
_x = _local3.x;
vy = 0;
if (vx != 0) {
_local2 = 0;
while (_local2 > -180) {
var _local7 = (_local2 - 92) * Engine.DR;
_local3.x = _x + (BACK_WHEEL_DIST * Math.cos(_local7));
_local3.y = (_y + (BACK_WHEEL_DIST * Math.sin(_local7))) - 21;
level.localToGlobal(_local3);
if (onRoute.checkCollisionPoint(_local3.x, _local3.y)) {
_local2 = _local2 * 1.06;
_rotation = _local2 + 130;
break;
}
_local2--;
}
vx = vx + (Math.sin((_rotation + 2.01) * Engine.DR) * Engine.GRAVITY);
}
}
} else {
takeControl();
}
}
function slow() {
vx = vx * 0.5;
vy = vy * 0.5;
}
function doTrick() {
switch (comboLength) {
case 0 :
gotoAndStop(Rand.value.apply(null, STANDARD_TRICKS));
break;
case 1 :
gotoAndStop(Rand.value.apply(null, availableImpressiveTricks));
break;
default :
gotoAndStop(Rand.value.apply(null, availableAwesomeTricks));
}
isPerformingTrick = true;
hasPerformedTrick = true;
var _local2 = Engine.POINTS_PER_TRICK * (++comboLength);
engine.sndman.playAndRemove(Sounds.JUMP);
score_mc = _parent.attachMovie("trickPointsClip", "points" + _parent.getNextHighestDepth(), _parent.getNextHighestDepth());
score_mc._x = _x;
score_mc._y = _y;
score_mc.xVel = vx;
score_mc.yVel = -5;
score_mc.scores_txt_mc.score_txt.text = String(_local2);
engine.score = engine.score + _local2;
}
function endTrick() {
gotoAndStop(PEDALLING);
isPerformingTrick = false;
trickEnded = engine.f;
engine.sndman.playAndRemove(Sounds.TRICK);
}
function updateGfx(f) {
var _local3 = Math.ceil(10 / Math.abs(vx));
if ((f - _local3) >= lastAnimFrame) {
var _local2;
if (vx > 0) {
_local2 = (clip._currentframe % clip._totalframes) + 1;
} else {
_local2 = clip._currentframe - 1;
if (_local2 == 0) {
_local2 = clip._totalframes;
}
}
clip.gotoAndStop(_local2);
lastAnimFrame = f;
}
}
var route = 0;
var vx = 0;
var vy = 0;
var lastAnimFrame = 0;
var isOnGround = true;
var isPerformingTrick = false;
var hasPerformedTrick = false;
var trickEnded = 0;
var comboLength = 0;
static var ACCEL = 1;
static var X_DRAG = 0.97;
static var Y_DRAG = 0.999;
static var BACK_WHEEL_DIST = 33;
static var JUMP = 15;
static var PEDALLING = "pedalling";
static var STANDARD_TRICKS = ["trick1", "trick2", "trick3"];
static var IMPRESSIVE_TRICKS = ["trick4", "trick5", "trick6", "trick7"];
static var AWESOME_TRICKS = ["trick8", "trick9", "trick10"];
static var TRICK_COMBO_WINDOW = 10;
static var SKID_TO_HALT = "skidToHalt";
}
Symbol 604 MovieClip [__Packages.Level] Frame 0
class Level extends MovieClip
{
var engine, routes, items;
function Level () {
super();
}
function initLevel(e) {
engine = e;
routes = [];
items = new org.springsoft.aslib.SingleLinkedList();
var _local3 = [];
for (var _local6 in this) {
if (this[_local6] instanceof Route) {
routes.push(this[_local6]);
this[_local6].init(engine);
_local3.push({r:this[_local6], d:this[_local6].getDepth()});
} else if (this[_local6] instanceof LevelInteractiveItem) {
items.insert(this[_local6]);
this[_local6].init(this, engine);
}
}
_local3.sortOn("d", Array.NUMERIC);
var _local2 = 0;
while (_local2 < _local3.length) {
_local3[_local2].r.depth = _local2 * 2;
_local3[_local2].r.swapDepths(_local2 * 2);
_local2++;
}
}
}
Symbol 605 MovieClip [__Packages.org.springsoft.aslib.SingleLinkedList] Frame 0
class org.springsoft.aslib.SingleLinkedList
{
var head_;
function SingleLinkedList () {
head_ = null;
}
function isEmpty(Void) {
return(((null == head_) ? true : false));
}
function insert(data) {
insertFront(new org.springsoft.aslib.ObjectListNode(data));
}
function insertTail(data) {
if (isEmpty()) {
insert(data);
} else {
var _local3 = null;
var _local2 = head_;
while (_local2 != null) {
_local3 = _local2;
_local2 = _local2.getNext();
}
insertEnd(new org.springsoft.aslib.ObjectListNode(data), _local3);
}
}
function get(key) {
var _local2 = head_;
while (_local2 != null) {
if (key == _local2.getKey()) {
break;
}
_local2 = _local2.getNext();
}
return(_local2);
}
function getData(key) {
return(get(key).get());
}
function getAt(index) {
var _local2 = head_;
var _local3 = 0;
while (_local2 != null) {
if (index == _local3) {
break;
}
_local3++;
_local2 = _local2.getNext();
}
return(_local2);
}
function getDataAt(index) {
return(getAt(index).get());
}
function remove(key) {
var _local3 = head_;
var _local2 = head_;
while (_local2 != null) {
if (key == _local2.getKey()) {
if (isFront(_local2)) {
return(removeFront());
}
if (isEnd(_local2)) {
return(removeEnd(_local3));
}
return(removeMiddle(_local3));
}
_local3 = _local2;
_local2 = _local2.getNext();
}
return(null);
}
function removeData(key) {
return(remove(key).get());
}
function removeAt(index) {
var _local3 = head_;
var _local4 = 0;
var _local2 = head_;
while (_local2 != null) {
if (index == _local4) {
if (isFront(_local2)) {
return(removeFront());
}
if (isEnd(_local2)) {
return(removeEnd(_local3));
}
return(removeMiddle(_local3));
}
_local4++;
_local3 = _local2;
_local2 = _local2.getNext();
}
return(null);
}
function removeDataAt(index) {
return(removeAt(index).get());
}
function removeAll() {
var _local3 = head_;
var _local2 = head_;
while (_local2 != null) {
if ((null == _local2.getNext()) && (null != _local3.getNext())) {
_local2 = null;
}
if (_local3 != _local2) {
_local3.setNext(null);
_local3 = null;
}
_local3 = _local2;
_local2 = _local2.getNext();
}
if (null != head_) {
head_.setNext(null);
head_ = null;
}
}
function getFront(canDelete) {
var _local2 = head_;
if (canDelete) {
removeFront();
}
return(_local2);
}
function getFrontData(canDelete) {
return(getFront(canDelete).get());
}
function print(Void) {
trace("=======================");
trace("Single Linked List HEAD");
var _local2 = head_;
while (_local2 != null) {
trace(_local2.toString());
_local2 = _local2.getNext();
}
trace("Single Linked List TAIL");
trace("=======================");
}
function size(Void) {
var _local2 = head_;
var _local3 = 0;
while (_local2 != null) {
_local3++;
_local2 = _local2.getNext();
}
return(_local3);
}
function isFront(node) {
return(((head_ == node) ? true : false));
}
function isEnd(node) {
return(((null == node.getNext()) ? true : false));
}
function hasOneNode(Void) {
if ((null == head_.getNext()) && (isEmpty())) {
return(true);
}
return(false);
}
function insertFront(node) {
if (isEmpty()) {
head_ = node;
node.setNext(null);
} else {
node.setNext(head_);
head_ = node;
}
}
function removeFront() {
var _local2 = null;
if (isEmpty()) {
} else if (hasOneNode()) {
_local2 = head_;
head_ = null;
} else {
_local2 = head_;
head_ = head_.getNext();
}
return(_local2);
}
function insertMiddle(node, targetNode) {
node.setNext(targetNode.getNext());
targetNode.setNext(node);
}
function removeMiddle(previous) {
var _local1 = previous.getNext();
previous.setNext(_local1.getNext());
return(_local1);
}
function insertEnd(node, targetNode) {
targetNode.setNext(node);
node.setNext(null);
}
function removeEnd(previous) {
var _local1 = previous.getNext();
previous.setNext(null);
return(_local1);
}
}
Symbol 606 MovieClip [__Packages.org.springsoft.aslib.ListNode] Frame 0
interface org.springsoft.aslib.ListNode
{
}
Symbol 607 MovieClip [__Packages.org.springsoft.aslib.ObjectListNode] Frame 0
class org.springsoft.aslib.ObjectListNode implements org.springsoft.aslib.ListNode
{
var next_, data_;
function ObjectListNode (data) {
next_ = null;
data_ = data;
}
function get(Void) {
return(data_);
}
function getNext(Void) {
return(next_);
}
function setNext(node) {
next_ = org.springsoft.aslib.ObjectListNode(node);
}
function set(data) {
data_ = data;
}
function toString(Void) {
return(data_.toString());
}
function getKey(Void) {
return(data_.getKey());
}
}
Symbol 608 MovieClip [__Packages.Route] Frame 0
class Route extends MovieClip
{
var engine, cacheAsBitmap, _visible, hitTest;
function Route () {
super();
}
function init(e) {
engine = e;
cacheAsBitmap = true;
_visible = false;
}
function checkCollisionPoint(px, py) {
return(hitTest(px, py, true));
}
function findLineCollisionPoint(sx, ex, sy, ey) {
var _local2 = new flash.geom.Point(sx, sy);
var _local13 = ex - sx;
var _local12 = ey - sy;
var _local6 = Math.sqrt((_local13 * _local13) + (_local12 * _local12));
var _local7 = Math.atan2(_local12, _local13);
var _local5 = Math.cos(_local7) * HIT_TEST_STEP;
var _local4 = Math.sin(_local7) * HIT_TEST_STEP;
var _local14;
var _local3;
do {
_local2.x = _local2.x + _local5;
_local2.y = _local2.y + _local4;
_local3 = Math.sqrt(Math.pow(sx - _local2.x, 2) + Math.pow(sy - _local2.y, 2));
if (_local3 > _local6) {
_local2.x = ex;
_local2.y = ey;
_local3 = _local6;
}
if (hitTest(_local2.x, _local2.y, true)) {
_local5 = Math.cos(_local7);
_local4 = Math.sin(_local7);
while (true) {
_local2.x = _local2.x - _local5;
_local2.y = _local2.y - _local4;
if (!hitTest(_local2.x, _local2.y, true)) {
return(_local2);
}
}
}
} while (_local3 < _local6);
return(null);
}
static var HIT_TEST_STEP = 4;
}
Symbol 609 MovieClip [__Packages.Sounds] Frame 0
class Sounds
{
function Sounds () {
}
static var PICKUP = "gulp";
static var STAR_PICKUP = "thub";
static var BOING = "boing";
static var CHECKPOINT = "checkpoint_snd";
static var SPLAT = "splat";
static var TIME_UP = "timeup";
static var THUD = "thud";
static var ARG = "arg";
static var LOW_BEEP = "lowbeep";
static var HIGH_BEEP = "highbeep";
static var SPEED_UP = "speedup";
static var JUMP = "jump";
static var TRICK = "trick";
static var FALLING = "falling";
static var LAND = "land";
static var FLAP = "flap";
}
Symbol 610 MovieClip [__Packages.Rand] Frame 0
class Rand
{
function Rand () {
}
static function midBias(min, max, i, p) {
min = (isNaN(min) ? 0 : (min));
max = (isNaN(max) ? 1 : (max));
i = (isNaN(i) ? 2 : (i + 1));
var _local3 = 0;
var _local1 = 0;
while (_local1 < i) {
_local3 = _local3 + ((v() * (max - min)) + min);
_local1++;
}
_local3 = _local3 / i;
if (p != undefined) {
p = 1 / Math.pow(10, p);
var _local7 = _local3 % p;
if (_local7 <= (p / 2)) {
_local3 = _local3 - _local7;
} else {
_local3 = _local3 + (p - _local7);
}
}
return(_local3);
}
static function minBias(min, max, i, p) {
min = (isNaN(min) ? 0 : (min));
max = (isNaN(max) ? 1 : (max));
i = (isNaN(i) ? 1 : (i));
var _local1 = ((1 - Math.pow(v(), 1 / (i + 1))) * (max - min)) + min;
if (p != undefined) {
p = 1 / Math.pow(10, p);
var _local3 = _local1 % p;
if (_local3 <= (p / 2)) {
_local1 = _local1 - _local3;
} else {
_local1 = _local1 + (p - _local3);
}
}
return(_local1);
}
static function maxBias(min, max, i, p) {
min = (isNaN(min) ? 0 : (min));
max = (isNaN(max) ? 1 : (max));
i = (isNaN(i) ? 1 : (i));
var _local1 = (Math.pow(v(), 1 / (i + 1)) * (max - min)) + min;
if (p != undefined) {
p = 1 / Math.pow(10, p);
var _local3 = _local1 % p;
if (_local3 <= (p / 2)) {
_local1 = _local1 - _local3;
} else {
_local1 = _local1 + (p - _local3);
}
}
return(_local1);
}
static function value() {
if (arguments.length > 0) {
var _local2 = v() * arguments.length;
_local2 = _local2 - (_local2 % 1);
return(arguments[_local2]);
}
}
static function get number() {
return(v());
}
static function random(min, max, p) {
min = (isNaN(min) ? 0 : (min));
max = (isNaN(max) ? 1 : (max));
if (!isNaN(p)) {
p = 1 / Math.pow(10, p);
max = max + p;
} else {
}
var _local3 = (v() * (max - min)) + min;
if (p) {
_local3 = _local3 - (_local3 % p);
}
return(_local3);
}
static function shuffle(arr) {
var _local3;
var _local4;
var _local2 = 0;
while (_local2 < arr.length) {
_local3 = random(0, arr.length - 1, 0);
_local4 = arr[_local3];
arr[_local3] = arr[_local2];
arr[_local2] = _local4;
_local2++;
}
return(arr);
}
static var v = Math.random;
}
Symbol 611 MovieClip [__Packages.HUD] Frame 0
class HUD extends MovieClip
{
var score_txt, stars_txt, lives_mc, time_txt, timeSmall_txt;
function HUD () {
super();
}
function update(score, time, stars, lives) {
score_txt.text = Format.number(score);
stars_txt.text = Format.number(stars);
lives_mc.gotoAndStop(lives);
time_txt.text = String(Math.floor(time / 30));
timeSmall_txt.text = String(Format.zerofill(Math.floor(((time / 30) % 1) * 100), 2));
}
}
Symbol 612 MovieClip [__Packages.Format] Frame 0
class Format
{
function Format () {
}
static function strReplace(f, r, s) {
var _local1 = 0;
while (_local1 = s.indexOf(f, _local1) , _local1 != -1) {
s = (s.substring(0, _local1) + r) + s.substr(_local1 + f.length);
_local1 = _local1 + r.length;
}
return(s);
}
static function numberFormat(n, decimalPlaces) {
var _local7 = n < 0;
var _local3 = Math.floor(Math.abs(n)) + "";
var _local4 = Math.abs(n % 1);
var _local6 = Math.pow(10, decimalPlaces);
var _local5 = zerofill(Math.round(_local4 * _local6), decimalPlaces);
var _local2 = "";
var _local1 = _local3.length - 1;
while (_local1 >= 0) {
if (((_local3.length - _local1) % 3) == 1) {
_local2 = " " + _local2;
}
_local2 = _local3.charAt(_local1) + _local2;
_local1--;
}
_local2 = _local2.substr(0, _local2.length - 1);
return((((_local7 ? "-" : "") + _local2) + ".") + _local5);
}
static function zerofill(n, z) {
var _local2 = String(n);
var _local1 = _local2.length;
while (_local1 < z) {
_local2 = "0" + _local2;
_local1++;
}
return(_local2);
}
static function time(t, minp, maxp) {
var _local1 = (isNaN(t) ? (new Date()) : (new Date(t)));
var _local2 = _local1.getSeconds();
var _local3 = Math.round(_local1.getMilliseconds() / 10);
var _local4 = (((_local1.getMinutes() + ":") + ((_local2 < 10) ? ("0" + _local2) : (_local2))) + ":") + ((_local3 < 10) ? ("0" + _local3) : (_local3));
return(_local4);
}
static function date(f, t) {
var _local2 = (isNaN(t) ? (new Date()) : (new Date(t)));
var _local6 = _local2.getSeconds();
_local6 = ((_local6 < 10) ? ("0" + _local6) : (_local6));
var _local10 = _local2.getMinutes();
_local10 = ((_local10 < 10) ? ("0" + _local10) : (_local10));
var _local8 = _local2.getHours() % 12;
_local8 = ((_local8 < 10) ? ("0" + _local8) : (_local8));
var _local11 = _local2.getHours();
_local11 = ((_local11 < 10) ? ("0" + _local11) : (_local11));
var _local7 = _local2.getDate();
_local7 = ((_local7 < 10) ? ("0" + _local7) : (_local7));
var _local9 = _local2.getMonth();
_local9 = ((_local9 < 10) ? ("0" + _local9) : (_local9));
var _local1 = "";
var _local5 = false;
var _local3 = 0;
while (_local3 < f.length) {
if (_local5) {
_local5 = false;
_local1 = _local1 + f[_local3];
}
switch (f[_local3]) {
case "/" :
_local5 = true;
break;
case "s" :
_local1 = _local1 + _local6;
break;
case "i" :
_local1 = _local1 + _local10;
break;
case "h" :
_local1 = _local1 + _local8;
break;
case "H" :
_local1 = _local1 + _local11;
break;
case "g" :
_local1 = _local1 + String(_local2.getHours() % 12);
break;
case "G" :
_local1 = _local1 + String(_local2.getHours());
break;
case "d" :
_local1 = _local1 + _local7;
break;
case "j" :
_local1 = _local1 + String(_local2.getDate());
break;
case "m" :
_local1 = _local1 + _local9;
break;
case "n" :
_local1 = _local1 + String(_local2.getMonth());
break;
case "y" :
_local1 = _local1 + String(_local2.getFullYear() % 100);
break;
case "Y" :
_local1 = _local1 + String(_local2.getFullYear());
break;
default :
_local1 = _local1 + f[_local3];
}
_local3++;
}
return(_local1);
}
static function number(n, d, c, l) {
d = (isNaN(d) ? undefined : (d));
c = ((c == undefined) ? "," : (c));
var _local1 = String(n).split(".");
if (!(d === undefined)) {
if (_local1[1]) {
var _local3 = String(Math.round(Number("." + _local1[1]) * Math.pow(10, d)) * Math.pow(10, -d));
_local3 = ((_local3.indexOf(".") < 0) ? (_local3) : (_local3.split(".")[1]));
} else {
var _local3 = "";
}
var _local2 = 0;
while (_local3.length < d) {
var _local3 = _local3 + "0";
_local2++;
}
_local1[1] = _local3;
}
var _local6 = false;
if (_local1[0].charAt(0) == "-") {
_local6 = true;
_local1[0] = _local1[0].substr(1);
}
var _local2 = 3;
while (_local1[0].length > _local2) {
_local1[0] = (_local1[0].substring(0, _local1[0].length - _local2) + c) + _local1[0].substring(_local1[0].length - _local2);
_local2 = _local2 + 4;
}
if (!isNaN(l)) {
_local1[0] = zerofill(_local1[0], l);
}
if (_local6) {
_local1[0] = "-" + _local1[0];
}
if ((_local1.length > 1) && (d > 0)) {
return((_local1[0] + ".") + _local1[1]);
}
return(_local1[0]);
}
static function ordinal(n) {
if (((n % 100) >= 11) && ((n % 100) <= 13)) {
return("th");
}
if ((n % 10) == 1) {
return("st");
}
if ((n % 10) == 2) {
return("nd");
}
if ((n % 10) == 3) {
return("rd");
}
return("th");
}
static function truncate(s, l, r) {
l = (isNaN(l) ? 20 : (l));
r = ((r == undefined) ? "..." : (r));
if (s.length > l) {
s = s.substr(0, l - r.length);
s = s + r;
}
return(s);
}
}
Symbol 613 MovieClip [__Packages.PerformanceController] Frame 0
class PerformanceController
{
var aFrmTms;
function PerformanceController () {
aFrmTms = [];
nLFT = getTimer();
}
function onEnterFrame() {
var _local4 = getTimer();
aFrmTms.push(_local4 - nLFT);
if (aFrmTms.length > nFA) {
var _local3 = 1000 / arrMean(aFrmTms);
_global.root.performanceDisplay.text = ((("fps=" + Math.round(_local3)) + newline) + "detailLevel=") + cdl;
if (_local3 > uf) {
if (cdl < mdl) {
setDetailLvl(cdl + 1);
}
} else if (_local3 < lf) {
if (cdl > 1) {
setDetailLvl(cdl - 1);
}
}
aFrmTms.length = 0;
}
nLFT = _local4;
}
function arrMean(arr) {
var _local3 = 0;
var _local1 = 0;
while (_local1 < arr.length) {
_local3 = _local3 + arr[_local1];
_local1++;
}
return(_local3 / arr.length);
}
function setDetailLvl(l) {
switch (l) {
case 1 :
_root._quality = "LOW";
break;
case 2 :
_root._quality = "MEDIUM";
break;
case 3 :
_root._quality = "HIGH";
}
cdl = l;
}
static var nFA = 30;
var nLFT = 0;
var cdl = 3;
static var lf = 14;
static var uf = 30;
static var mdl = 3;
}
Symbol 614 MovieClip [__Packages.Delegate] Frame 0
class Delegate
{
function Delegate () {
}
static function create(target, handler) {
var _local3 = arguments.slice(2);
var _local2 = function () {
return(arguments.callee.handler.apply(arguments.callee.target, arguments.concat(arguments.callee.extraArgs)));
};
_local2.extraArgs = _local3;
_local2.handler = handler;
_local2.target = target;
return(_local2);
}
}
Symbol 615 MovieClip [__Packages.Conveyor] Frame 0
class Conveyor extends LevelInteractiveItem
{
var cacheAsBitmap, _visible, engine;
function Conveyor () {
super();
cacheAsBitmap = true;
_visible = false;
}
function interact(bike) {
if (!engine.speedUpSnd.target) {
engine.speedUpSnd = engine.sndman.playAndRemove(Sounds.SPEED_UP);
}
bike.vx = bike.vx + POWER;
}
static var POWER = 2;
}
Symbol 616 MovieClip [__Packages.Pickup] Frame 0
class Pickup extends LevelInteractiveItem
{
var stop, gotoAndPlay, engine, level, k, _visible;
function Pickup () {
super();
stop();
}
function interact() {
gotoAndPlay("collected");
engine.sndman.playAndRemove(Sounds.PICKUP);
level.items.remove(k);
engine.score = engine.score + Engine.SCORE_PER_PICKUP;
}
function die() {
_visible = false;
}
}
Symbol 617 MovieClip [__Packages.StarPickup] Frame 0
class StarPickup extends LevelInteractiveItem
{
var stop, gotoAndPlay, engine, level, k, _visible;
function StarPickup () {
super();
stop();
}
function interact() {
gotoAndPlay("collected");
engine.sndman.playAndRemove(Sounds.STAR_PICKUP);
level.items.remove(k);
engine.__set__stars((engine.__get__stars()+1));
}
function die() {
_visible = false;
}
}
Symbol 618 MovieClip [__Packages.SlowDown] Frame 0
class SlowDown extends LevelInteractiveItem
{
var stop, gotoAndPlay, engine, level, k, _visible;
function SlowDown () {
super();
stop();
}
function interact() {
gotoAndPlay("collected");
engine.sndman.playAndRemove(Sounds.SPLAT);
level.items.remove(k);
engine.bike.slow();
}
function die() {
_visible = false;
}
}
Symbol 619 MovieClip [__Packages.Spring] Frame 0
class Spring extends LevelInteractiveItem
{
var hit, gotoAndPlay, engine, _rotation, _visible;
function Spring () {
super();
}
function update(bike) {
if (bike.isOnGround) {
if (bike.hitTest(hit)) {
interact(bike);
}
}
}
function interact(bike) {
gotoAndPlay("sprung");
engine.sndman.playAndRemove(Sounds.BOING);
trace("spring");
bike.isOnGround = false;
var _local2 = (_rotation - 90) * Engine.DR;
bike.vx = bike.vx + (FORCE * Math.cos(_local2));
bike.vy = bike.vy + (FORCE * Math.sin(_local2));
trace((Math.cos(_local2) + ", ") + Math.sin(_local2));
engine.score = engine.score + Engine.SCORE_PER_PICKUP;
}
function die() {
_visible = false;
}
var FORCE = 30;
}
Symbol 620 MovieClip [__Packages.Checkpoint] Frame 0
class Checkpoint extends LevelInteractiveItem
{
var cacheAsBitmap, level, k, engine, gotoAndPlay;
function Checkpoint () {
super();
cacheAsBitmap = true;
}
function interact() {
trace("CheckpointInteract");
cacheAsBitmap = true;
level.items.remove(k);
engine.sndman.playAndRemove(Sounds.CHECKPOINT);
engine.time = engine.time + Engine.TIME_PER_CHECKPOINT;
gotoAndPlay("collected");
}
}
Symbol 621 MovieClip [__Packages.EndLevel] Frame 0
class EndLevel extends LevelInteractiveItem
{
var cacheAsBitmap, engine;
function EndLevel () {
super();
cacheAsBitmap = true;
}
function interact() {
engine.sndman.playAndRemove(Sounds.CHECKPOINT);
engine.endLevelComplete();
}
}
Symbol 622 MovieClip [__Packages.TweenControllingItem] Frame 0
class TweenControllingItem extends LevelInteractiveItem
{
var gotoAndStop, _currentframe, endFrame, _totalframes, hit, mark, interact, b, engine, level, nextFrame;
function TweenControllingItem () {
super();
gotoAndStop("end");
if (_currentframe != 1) {
endFrame = _currentframe;
} else {
endFrame = _totalframes;
}
trace(endFrame);
gotoAndStop(1);
hit._visible = false;
mark._visible = false;
}
function update(bike) {
var _local2 = new flash.geom.Point(0, 0);
bike.localToGlobal(_local2);
if (hit.hitTest(_local2.x, _local2.y)) {
interact(bike);
}
}
function bikeControl() {
if (_currentframe < endFrame) {
gotoNextFrame();
} else {
trace("end!");
delete b.takeControl;
b.update(engine.f);
endTween();
}
var _local2 = new flash.geom.Point(0, 0);
mark.localToGlobal(_local2);
level.globalToLocal(_local2);
b.lx = b._x;
b.ly = b._y;
b._x = _local2.x;
b._y = _local2.y;
b._rotation = mark._rotation;
}
function gotoNextFrame() {
nextFrame();
}
function endTween() {
}
}
Symbol 623 MovieClip [__Packages.LoopTheLoop] Frame 0
class LoopTheLoop extends TweenControllingItem
{
var _visible, _x, b, bikeControl, gotoAndStop, _currentframe, engine;
function LoopTheLoop () {
super();
_visible = false;
}
function interact(bike) {
if ((bike.vx > MIN_SPEED) && ((_x - bike._x) <= (bike.vx + 0.2))) {
b = bike;
bike.takeControl = Delegate.create(this, bikeControl);
}
}
function gotoNextFrame() {
gotoAndStop(_currentframe + Math.round(b.vx / 5));
b.updateGfx(engine.f);
}
function endTween() {
gotoAndStop(1);
}
static var MIN_SPEED = 15;
}
Symbol 624 MovieClip [__Packages.SpringStrong] Frame 0
class SpringStrong extends LevelInteractiveItem
{
var hit, gotoAndPlay, engine, _rotation, _visible;
function SpringStrong () {
super();
}
function update(bike) {
if (bike.isOnGround) {
if (bike.hitTest(hit)) {
interact(bike);
}
}
}
function interact(bike) {
gotoAndPlay("sprung");
engine.sndman.playAndRemove(Sounds.BOING);
trace("spring");
bike.isOnGround = false;
var _local2 = (_rotation - 90) * Engine.DR;
bike.vx = bike.vx + (FORCE * Math.cos(_local2));
bike.vy = bike.vy + (FORCE * Math.sin(_local2));
trace((Math.cos(_local2) + ", ") + Math.sin(_local2));
engine.score = engine.score + Engine.SCORE_PER_PICKUP;
}
function die() {
_visible = false;
}
static var FORCE = 45;
}
Symbol 625 MovieClip [__Packages.Pterodactyl] Frame 0
class Pterodactyl extends TweenControllingItem
{
var pterodactyl, b, bikeControl, play, getBounds, engine;
function Pterodactyl () {
super();
pterodactyl.rightLeg.gotoAndStop("open");
pterodactyl.leftLeg.gotoAndStop("open");
}
function interact(bike) {
pterodactyl.rightLeg.gotoAndStop("closed");
pterodactyl.leftLeg.gotoAndStop("closed");
b = bike;
bike.vy = 0;
bike.gotoAndStop(Bike.PEDALLING);
bike.takeControl = Delegate.create(this, bikeControl);
}
function endTween() {
play();
pterodactyl.rightLeg.gotoAndStop("open");
pterodactyl.leftLeg.gotoAndStop("open");
}
function doFlaps() {
var _local3 = getBounds(_global.root);
var _local5 = new flash.geom.Rectangle(_local3.xMin, _local3.yMin, _local3.xMax - _local3.xMin, _local3.yMax - _local3.yMin);
var _local4 = new flash.geom.Rectangle(0, 0, 650, 450);
if (_local4.intersects(_local5)) {
engine.sndman.playAndRemove(Sounds.FLAP);
}
}
}
Symbol 422 Button
on (release, keyPress "<Space>") {
_parent.startGame();
}
Symbol 443 MovieClip Frame 1
gotoAndStop(_root.localization_language_nr);
Symbol 444 MovieClip Frame 1
if (_root.localization_portal == "game_com_cn") {
this.gameover_moregames.onRelease = function () {
_root.kvClick(_global.root.startClick);
getURL (_root.localization_url1, "_blank");
};
} else {
this.gameover_moregames.onRelease = function () {
_root.kvClick(_global.root.startClick);
getURL (_root.localization_url1 + "&utm_content=button_gameover_moregames", "_blank");
};
}
Symbol 448 MovieClip Frame 8
stop();
Symbol 486 MovieClip Frame 1
stop();
Symbol 491 Button
on (release, keyPress "<Space>") {
_parent.gotoAndPlay("out");
}
Symbol 495 MovieClip Frame 2
stop();
Symbol 495 MovieClip Frame 12
_parent.howToPlayOut();
Symbol 495 MovieClip Frame 13
stop();
Symbol 506 MovieClip [hud] Frame 1
#initclip 56
Object.registerClass("hud", HUD);
#endinitclip
Symbol 511 MovieClip Frame 40
_parent._parent.timesUpDone();
Symbol 520 MovieClip Frame 1
_global.sndman.playAndRemove(Sounds.LOW_BEEP);
Symbol 520 MovieClip Frame 13
_global.sndman.playAndRemove(Sounds.LOW_BEEP);
Symbol 520 MovieClip Frame 25
_global.sndman.playAndRemove(Sounds.LOW_BEEP);
Symbol 520 MovieClip Frame 37
_global.sndman.playAndRemove(Sounds.HIGH_BEEP, 0, 5);
_parent._parent.countdownDone();
Symbol 520 MovieClip Frame 50
stop();
_parent.gotoAndStop(1);
Symbol 521 MovieClip Frame 1
stop();
Symbol 522 MovieClip [engine] Frame 1
#initclip 55
Object.registerClass("engine", Engine);
#endinitclip
Symbol 542 MovieClip Frame 12
Symbol 543 MovieClip Frame 21
_global.sndman.playAndRemove(Sounds.BOING);
Symbol 543 MovieClip Frame 33
_global.sndman.playAndRemove(Sounds.THUD);
Symbol 543 MovieClip Frame 55
_global.sndman.playAndRemove(Sounds.ARG);
Symbol 543 MovieClip Frame 91
stop();
Transition.changePage("game");
Symbol 546 Button
on (release, keyPress "<Space>") {
Transition.changePage("game");
}
Symbol 554 MovieClip Frame 1
stop();
Symbol 555 MovieClip Frame 1
stop();
Symbol 556 MovieClip Frame 1
stop();
Symbol 557 MovieClip Frame 1
stop();
Symbol 558 MovieClip Frame 1
stop();
Symbol 559 MovieClip Frame 1
stop();
Symbol 564 MovieClip Frame 1
stop();
Symbol 567 MovieClip Frame 1
stop();
Symbol 570 MovieClip Frame 1
stop();
Symbol 573 MovieClip Frame 1
stop();
Symbol 576 MovieClip Frame 1
stop();
Symbol 586 Button
on (release, keyPress "<Space>") {
Transition.changePage("startpage");
}
Symbol 588 MovieClip Frame 1
if (_root.localization_portal == "game_com_cn") {
this.gameover_moregames.onRelease = function () {
getURL (_root.localization_url1, "_blank");
_root.kvClick(_global.root.completedClick);
};
} else {
this.gameover_moregames.onRelease = function () {
_root.kvClick(_global.root.completedClick);
getURL (_root.localization_url1 + "&utm_content=button_gameover_moregames", "_blank");
};
}
Symbol 589 MovieClip Frame 15
stop();
Symbol 593 MovieClip Frame 13
stop();
Symbol 595 MovieClip Frame 1
if (_root.localization_portal == "game_com_cn") {
this.gameover_moregames.onRelease = function () {
_root.kvClick(_global.root.gameOverClick);
getURL (_root.localization_url1, "_blank");
};
} else {
this.gameover_moregames.onRelease = function () {
getURL (_root.localization_url1 + "&utm_content=button_gameover_moregames", "_blank");
_root.kvClick(_global.root.gameOverClick);
};
}