Frame 1
function SaveUserData() {
_root.user.data.chosenFace = _root.chosenFace;
_root.user.data.chosenHair = _root.chosenHair;
_root.user.data.chosenHat = _root.chosenHat;
_root.user.data.chosenBody = _root.chosenBody;
_root.user.data.unlockedFaces = _root.unlockedFaces;
_root.user.data.unlockedHairs = _root.unlockedHairs;
_root.user.data.unlockedHats = _root.unlockedHats;
_root.user.data.unlockedBodies = _root.unlockedBodies;
_root.user.data.bMute = _root.bMute;
_root.user.data.difficulty = _root.difficulty;
user.data.myTopScore = myTopScore;
user.data.myNextMedal = myNextMedal;
user.data.myProgress = myProgress;
user.data.bUnlockedBronze = bUnlockedBronze;
user.data.bUnlockedSilver = bUnlockedSilver;
user.data.bUnlockedGold = bUnlockedGold;
user.data.bUnlocked1Star = bUnlocked1Star;
user.data.bUnlocked2Star = bUnlocked2Star;
user.data.bUnlocked3Star = bUnlocked3Star;
user.data.bUnlocked4Star = bUnlocked4Star;
user.data.bUnlocked5Star = bUnlocked5Star;
user.data.bUnlockedGoldStar = bUnlockedGoldStar;
user.data.bUnlockedLevel2 = bUnlockedLevel2;
user.data.bUnlockedLevel3 = bUnlockedLevel3;
user.data.bUnlockedLevel4 = bUnlockedLevel4;
user.data.bUnlockedLevel5 = bUnlockedLevel5;
user.data.bPlayedLevel2 = bPlayedLevel2;
user.data.bPlayedLevel3 = bPlayedLevel3;
user.data.bPlayedLevel4 = bPlayedLevel4;
user.data.unicycle = unicycle;
user.data.bUnlockedUnicycle2 = bUnlockedUnicycle2;
user.data.bUnlockedUnicycle3 = bUnlockedUnicycle3;
user.data.credits = credits;
user.data.unlocked = unlocked;
user.data.bUnlockedMedium = bUnlockedMedium;
user.data.bUnlockedHard = bUnlockedHard;
user.data.bUnlockedBG2 = bUnlockedBG2;
user.data.bUnlockedBG3 = bUnlockedBG3;
user.data.bg = bg;
user.data.bPlayedTimeAttackOnce = bPlayedTimeAttackOnce;
user.data.InputLeftCode = InputLeftCode;
user.data.InputRightCode = InputRightCode;
user.data.InputHipLeftCode = InputHipLeftCode;
user.data.InputHipRightCode = InputHipRightCode;
_root.user.flush();
}
stop();
chosenFace = 0;
chosenHair = 0;
chosenHat = 9;
chosenBody = 23;
unlockedFaces = 1;
unlockedHairs = 1;
unlockedHats = 1;
unlockedBodies = 1;
bg = 1;
var unlocked = [];
bMute = false;
difficulty = 1;
unicycle = 1;
myTopScore = 0;
myNextMedal = "0.30";
myProgress = 0;
bUnlockedBronze = false;
bUnlockedSilver = false;
bUnlockedGold = false;
bUnlocked1Star = false;
bUnlocked2Star = false;
bUnlocked3Star = false;
bUnlocked4Star = false;
bUnlocked5Star = false;
bUnlockedGoldStar = false;
bUnlockedMedium = false;
bUnlockedHard = false;
bUnlockedBG2 = false;
bUnlockedBG3 = false;
bUnlockedLevel2 = false;
bUnlockedLevel3 = false;
bUnlockedLevel4 = true;
bUnlockedUnicycle2 = false;
bUnlockedUnicycle3 = false;
bPlayedLevel1 = false;
bPlayedLevel2 = false;
bPlayedLevel3 = false;
bPlayedTimeAttackOnce = false;
InputLeftCode = 37;
InputRightCode = 39;
InputHipLeftCode = 65;
InputHipRightCode = 68;
credits = 0;
user = SharedObject.getLocal("user_profile");
if (user.data.unlockedFaces != undefined) {
unlockedFaces = user.data.unlockedFaces;
unlockedHairs = user.data.unlockedHairs;
unlockedHats = user.data.unlockedHats;
unlockedBodies = user.data.unlockedBodies;
chosenFace = user.data.chosenFace;
chosenHair = user.data.chosenHair;
chosenHat = user.data.chosenHat;
chosenBody = user.data.chosenBody;
if (user.data.bMute != undefined) {
bMute = user.data.bMute;
}
if (user.data.difficulty != undefined) {
difficulty = user.data.difficulty;
}
if (user.data.myTopScore != undefined) {
myTopScore = user.data.myTopScore;
myNextMedal = user.data.myNextMedal;
myProgress = user.data.myProgress;
bUnlockedBronze = user.data.bUnlockedBronze;
bUnlockedSilver = user.data.bUnlockedSilver;
bUnlockedGold = user.data.bUnlockedGold;
bUnlocked1Star = user.data.bUnlocked1Star;
bUnlocked2Star = user.data.bUnlocked2Star;
bUnlocked3Star = user.data.bUnlocked3Star;
bUnlocked4Star = user.data.bUnlocked4Star;
bUnlocked5Star = user.data.bUnlocked5Star;
bUnlockedGoldStar = user.data.bUnlockedGoldStar;
}
if (user.data.bUnlockedLevel2 != undefined) {
bUnlockedLevel2 = user.data.bUnlockedLevel2;
bUnlockedLevel3 = user.data.bUnlockedLevel3;
bUnlockedLevel4 = user.data.bUnlockedLevel4;
bUnlockedLevel5 = user.data.bUnlockedLevel5;
}
if (user.data.bPlayedLevel2 != undefined) {
bPlayedLevel2 = user.data.bPlayedLevel2;
bPlayedLevel3 = user.data.bPlayedLevel3;
bPlayedLevel4 = user.data.bPlayedLevel4;
}
if (user.data.unicycle != undefined) {
unicycle = user.data.unicycle;
bUnlockedUnicycle2 = user.data.bUnlockedUnicycle2;
bUnlockedUnicycle3 = user.data.bUnlockedUnicycle3;
}
if (user.data.credits != undefined) {
credits = user.data.credits;
}
if (user.data.unlocked != undefined) {
unlocked = user.data.unlocked;
}
if (user.data.bUnlockedMedium != undefined) {
bUnlockedMedium = user.data.bUnlockedMedium;
bUnlockedHard = user.data.bUnlockedHard;
bUnlockedBG2 = user.data.bUnlockedBG2;
bUnlockedBG3 = user.data.bUnlockedBG3;
}
if (user.data.bg != undefined) {
bg = user.data.bg;
}
if (user.data.bPlayedTimeAttackOnce != undefined) {
bPlayedTimeAttackOnce = user.data.bPlayedTimeAttackOnce;
}
if (user.data.InputLeftCode != undefined) {
InputLeftCode = user.data.InputLeftCode;
InputRightCode = user.data.InputRightCode;
InputHipLeftCode = user.data.InputHipLeftCode;
InputHipRightCode = user.data.InputHipRightCode;
}
}
Frame 30
function adFin() {
gotoAndStop (62);
}
mochi.as2.MochiServices.connect("4e77a76d255b9c78");
mochi.as2.MochiAd.showPreGameAd({id:"4e77a76d255b9c78", res:"600x600", no_bg:false, ad_finished:adFin});
Frame 60
trace("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
Frame 62
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = ((fv == 5) ? (getVersion()) : (System.capabilities.version));
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=8&fv=") + fv) + "&v=") + escape(pv)) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("58532e4b", this, 10301, true);
function DisplayInput() {
_root.disp_txt.text = "" + keyCode[InputLeftCode];
_root.disp_txt.text = _root.disp_txt.text + (newline + keyCode[InputRightCode]);
_root.disp_txt.text = _root.disp_txt.text + (newline + keyCode[InputHipLeftCode]);
_root.disp_txt.text = _root.disp_txt.text + (newline + keyCode[InputHipRightCode]);
}
function onEnterFrame() {
if (bAllowSetInputLeft) {
if ((Key.getCode() != 0) && (Key.isDown(Key.getCode()))) {
InputLeftCode = Key.getCode();
bAllowSetInputLeft = false;
DisplayInput();
}
}
if (bAllowSetInputRight) {
if ((Key.getCode() != 0) && (Key.isDown(Key.getCode()))) {
InputRightCode = Key.getCode();
bAllowSetInputRight = false;
DisplayInput();
}
}
if (bAllowSetInputHipLeft) {
if ((Key.getCode() != 0) && (Key.isDown(Key.getCode()))) {
InputHipLeftCode = Key.getCode();
bAllowSetInputHipLeft = false;
DisplayInput();
}
}
if (bAllowSetInputHipRight) {
if ((Key.getCode() != 0) && (Key.isDown(Key.getCode()))) {
InputHipRightCode = Key.getCode();
bAllowSetInputHipRight = false;
DisplayInput();
}
}
}
function WaitForInput(iType) {
if (iType == "LEFT") {
bAllowSetInputLeft = true;
InputLeftCode = 109;
DisplayInput();
}
if (iType == "RIGHT") {
bAllowSetInputRight = true;
InputRightCode = 109;
DisplayInput();
}
if (iType == "HIPLEFT") {
bAllowSetInputHipLeft = true;
InputHipLeftCode = 109;
DisplayInput();
}
if (iType == "HIPRIGHT") {
bAllowSetInputHipRight = true;
InputHipRightCode = 109;
DisplayInput();
}
}
function NextHair() {
i = currentHair;
while (i <= hairEnd) {
currentHair++;
if (currentHair > hairEnd) {
currentHair = hairBegin;
}
if (unlockables[currentHair].bUnlocked) {
return;
}
i++;
}
}
function NextHat() {
i = currentHat;
while (i <= hatEnd) {
currentHat++;
if (currentHat > hatEnd) {
currentHat = hatBegin;
}
if (unlockables[currentHat].bUnlocked) {
return;
}
i++;
}
}
function NextBody() {
i = currentBody;
while (i <= bodyEnd) {
currentBody++;
if (currentBody > bodyEnd) {
currentBody = bodyBegin;
}
if (unlockables[currentBody].bUnlocked) {
return;
}
i++;
}
}
function NextFace() {
currentFace++;
if (currentFace > (allFaces.length - 1)) {
currentFace = 0;
}
}
function FillUnlockables() {
hairBegin = 0;
CreateUnlockable("Blonde", "Hair1", 0, "Hair", true);
CreateUnlockable("Bald", "Hair2", 50, "Hair", false);
CreateUnlockable("Mullet", "Hair3", 50, "Hair", false);
CreateUnlockable("Brown", "Hair4", 50, "Hair", false);
CreateUnlockable("Afro", "Hair5", 70, "Hair", false);
CreateUnlockable("Curly", "Hair6", 50, "Hair", false);
CreateUnlockable("Bald (Dark)", "Hair7", 50, "Hair", false);
CreateUnlockable("Rasta", "Hair8", 70, "Hair", false);
CreateUnlockable("Mickey", "Hair9", 100, "Hair", false);
hairEnd = unlockables.length - 1;
hatBegin = unlockables.length;
CreateUnlockable("No Accessory", "", 0, "Hat", true);
CreateUnlockable("Beard", "Hoed1", 50, "Hat", false);
CreateUnlockable("Goggles", "Hoed2", 50, "Hat", false);
CreateUnlockable("Party Hat", "Hoed3", 70, "Hat", false);
CreateUnlockable("Hat", "Hoed4", 70, "Hat", false);
CreateUnlockable("Shades", "Hoed5", 70, "Hat", false);
CreateUnlockable("Eye Patch", "Hoed6", 100, "Hat", false);
CreateUnlockable("Glasses", "Hoed7", 100, "Hat", false);
CreateUnlockable("Baseball Cap", "Hoed8", 100, "Hat", false);
CreateUnlockable("Rice Hat", "Hoed9", 100, "Hat", false);
CreateUnlockable("Bling", "Hoed10", 100, "Hat", false);
CreateUnlockable("Pirate Hat", "Hoed11", 100, "Hat", false);
CreateUnlockable("Astronaut Helmet", "Hoed12", 150, "Hat", false);
CreateUnlockable("King's Crown", "Hoed13", 250, "Hat", false);
hatEnd = unlockables.length - 1;
bodyBegin = unlockables.length;
CreateUnlockable("Black Tee", "Body1", 0, "Body", true);
CreateUnlockable("Vest", "Body2", 100, "Body", false);
CreateUnlockable("Sweater", "Body3", 100, "Body", false);
CreateUnlockable("Superman", "Body4", 200, "Body", false);
CreateUnlockable("Office Drone", "Body5", 100, "Body", false);
CreateUnlockable("Mr. C", "Body6", 100, "Body", false);
CreateUnlockable("Pirate Suit", "Body7", 200, "Body", false);
CreateUnlockable("King's Suit", "Body8", 250, "Body", false);
bodyEnd = unlockables.length - 1;
}
function CreateUnlockable(naam, reference, cost, type, unlocked) {
var _local1 = new MovieClip();
_local1.naam = naam;
_local1.reference = reference;
_local1.cost = cost;
_local1.type = type;
_local1.bUnlocked = unlocked;
unlockables.push(_local1);
}
function UpdateUnlockables() {
i = 0;
while (i < unlockables.length) {
if (unlocked[i] == 1) {
unlockables[i].bUnlocked = true;
}
i++;
}
}
function CollectLeader(boardID) {
trace("Collecting Leader..");
mochi.as2.MochiScores.setBoardID(boardID);
mochi.as2.MochiScores.requestList(this, "onScoresReceived");
}
function onScoresReceived(args) {
if (args.scores != null) {
var _local2 = mochi.as2.MochiScores.scoresArrayToObjects(args.scores);
if (_local2.daily[0].score != undefined) {
_root.leaderScore = _local2.daily[0].score;
_root.leaderName = _local2.daily[0].name;
} else if (_local2.weekly[0].score != undefined) {
_root.leaderScore = _local2.weekly[0].score;
_root.leaderName = _local2.weekly[0].name;
} else if (_local2.monthly[0].score != undefined) {
_root.leaderScore = _local2.monthly[0].score;
_root.leaderName = _local2.monthly[0].name;
} else {
_root.scoreLeader = 0;
}
} else {
if (args.error) {
trace("Error: " + args.errorCode);
}
_root.scoreLeader = -1;
}
}
function SubmitScore(mboardID, mScore) {
mochi.as2.MochiScores.showLeaderboard({boardID:mBoardID, score:mScore, width:400, height:300, preloaderDisplay:false, onClose:function () {
_root.gameover_mc.loading_mc._alpha = 0;
}, clip:_root.leaderboard_mc});
}
function ViewInstructions() {
gotoAndStop (147);
}
function BuyItem(index) {
if (unlockables[index + itemsIndex].naam == undefined) {
return(undefined);
}
if (unlockables[index + itemsIndex].bUnlocked) {
_root.bought_txt.text = "You already own this item";
} else if (credits >= unlockables[index + itemsIndex].cost) {
unlocked[index + itemsIndex] = 1;
credits = credits - unlockables[index + itemsIndex].cost;
_root.bought_txt.text = "Bought: " + unlockables[index + itemsIndex].naam;
} else {
_root.bought_txt.text = "Not enough credits";
}
UpdateUnlockables();
SetCredits();
SaveUserData();
}
function DisplayItems() {
SetCredits();
currentItems = unlockables.slice(itemsIndex, Math.min(itemsIndex + 6, unlockables.length));
i = 0;
while (i < currentItems.length) {
disp_mc = _root.attachMovie(currentItems[i].reference, "dispMC" + i, 200 + i);
disp_mc._x = 303 + (90 * (i % 3));
disp_mc._y = ((i > 2) ? 310 : 159);
disp_mc._xscale = 50;
disp_mc._yscale = 50;
showItems.push(disp_mc);
i++;
}
}
function ClearItems() {
Len = showItems.length;
i = 0;
while (i < Len) {
showItems[0]._alpha = 0;
showItems[0].removeMovieClip;
showItems.shift();
i++;
}
}
function NextItems() {
ClearItems();
itemsIndex = itemsIndex + 6;
if (itemsIndex > unlockables.length) {
itemsIndex = 0;
}
DisplayItems();
}
function PrevItems() {
ClearItems();
itemsIndex = itemsIndex - 6;
if (itemsIndex < 0) {
if (itemsIndex == -6) {
itemsIndex = unlockables.length - 6;
} else {
itemsIndex = 0;
}
} else {
offset = 0;
}
DisplayItems();
}
function StartTutorial() {
gotoAndPlay ("overgang");
_root.initValues.bltFadeOut = 1;
_root.initValues.bTutorial = true;
initValues.gameType = PRACTICE;
}
function StartLevel1() {
gotoAndPlay ("overgang");
_root.initValues.bLevel1 = true;
_root.initValues.bLevel2 = false;
_root.initValues.bLevel3 = false;
_root.initValues.bLevel4 = false;
initValues.gameType = TIMEATTACK;
}
function StartLevel2() {
gotoAndPlay ("overgang");
_root.initValues.bLevel1 = false;
_root.initValues.bLevel2 = true;
_root.initValues.bLevel3 = false;
_root.initValues.bLevel4 = false;
initValues.gameType = TIMEATTACK;
}
function StartLevel3() {
gotoAndPlay ("overgang");
_root.initValues.bLevel1 = false;
_root.initValues.bLevel2 = false;
_root.initValues.bLevel3 = true;
_root.initValues.bLevel4 = false;
initValues.gameType = COLLECTION;
}
function StartLevel4() {
gotoAndPlay ("overgang");
_root.initValues.bLevel1 = false;
_root.initValues.bLevel2 = false;
_root.initValues.bLevel3 = false;
_root.initValues.bLevel4 = true;
initValues.gameType = COLLECTION;
}
function Quit() {
gotoAndPlay (149);
}
function StartTimeAttack() {
gotoAndPlay ("overgang");
_root.initValues.bLevel1 = false;
_root.initValues.bLevel2 = false;
_root.initValues.bLevel3 = false;
_root.initValues.bLevel4 = false;
initValues.gameType = TIMEATTACK;
}
function LevelSelect() {
gotoAndStop ("levelselect");
UpdateBackground();
SetDifficultyText();
}
function UpdateBackground() {
if (_root.bg == 1) {
_root.backgr_txt.text = "Mountains";
} else if (_root.bg == 2) {
_root.backgr_txt.text = "Urban";
} else {
_root.backgr_txt.text = "Clouds";
}
}
function NextBackground() {
if (_root.bg == 1) {
if (_root.bUnlockedBG2) {
_root.bg = 2;
}
} else if (_root.bg == 2) {
if (_root.bUnlockedBG3) {
_root.bg = 3;
} else {
_root.bg = 1;
}
} else {
_root.bg = 1;
}
UpdateBackground();
}
function QuitToMenu() {
gotoAndPlay (62);
}
function UpdateUnicycle() {
name1 = "Hot Red";
name2 = "Brown Sugar";
name3 = "Blue Steel";
_root.locked_txt.text = "";
if (_root.pre_unicycle == 1) {
statSpeed = 20;
statHandling = 80;
statAccel = 30;
cycle1 = name1;
cycle2 = name2;
cycle3 = name3;
_root.cycle1_mc.gotoAndStop("two");
_root.cycle2_mc.gotoAndStop("one");
_root.cycle3_mc.gotoAndStop("three");
_root.descr_txt.text = "Brown Sugar is a beginner's unicycle: it's pretty slow, and it won't do anything fancy, but it's good to learn the basics on!";
} else if (_root.pre_unicycle == 2) {
statSpeed = 50;
statHandling = 50;
statAccel = 50;
cycle1 = name3;
cycle2 = name1;
cycle3 = name2;
_root.cycle1_mc.gotoAndStop("three");
_root.cycle2_mc.gotoAndStop("two");
_root.cycle3_mc.gotoAndStop("one");
_root.descr_txt.text = "Hot Red is a decent unicycle: it's not the fastest, but offers enough handling and precision for the the intermediate unicyclist";
if (!_root.bUnlockedUnicycle2) {
_root.locked_txt.text = "LOCKED!";
}
} else {
statSpeed = 80;
statHandling = 20;
statAccel = 80;
cycle1 = name2;
cycle2 = name3;
cycle3 = name1;
_root.cycle1_mc.gotoAndStop("one");
_root.cycle2_mc.gotoAndStop("three");
_root.cycle3_mc.gotoAndStop("two");
_root.descr_txt.text = "Blue Steel is the most powerful unicycle: it offers the greatest speed and precision, but requires advanced unicycling skills";
if (!_root.bUnlockedUnicycle3) {
_root.locked_txt.text = "LOCKED!";
}
}
_root.speedBar_mc._xscale = statSpeed;
_root.handleBar_mc._xscale = statHandling;
_root.accelBar_mc._xscale = statAccel;
_root.cycle1_txt.text = cycle1;
_root.cycle2_txt.text = cycle2;
_root.cycle3_txt.text = cycle3;
}
function UpdateFace() {
face_mc.removeMovieClip();
face_mc = attachMovie(allFaces[currentFace], "faceMC", 10);
face_mc._x = previewX - 1;
face_mc._y = previewY + 3;
face_mc._xscale = 50;
face_mc._yscale = 50;
lefthand_mc.removeMovieClip();
lefthand_mc = attachMovie(allSkins[currentFace], "lefthandMC", 6);
lefthand_mc._x = previewX - 33;
lefthand_mc._y = previewY + 97;
lefthand_mc._xscale = 50;
lefthand_mc._yscale = 50;
lefthand_mc._rotation = 88;
righthand_mc.removeMovieClip();
righthand_mc = attachMovie(allSkins[currentFace], "righthandMC", 5);
righthand_mc._x = previewX + 70;
righthand_mc._y = previewY + 48;
righthand_mc._xscale = 45;
righthand_mc._yscale = 45;
righthand_mc._rotation = -30;
smile_mc.removeMovieClip();
smile_mc = attachMovie("SmilePreviewMC", "SmileMC", 12);
smile_mc._x = previewX + 20;
smile_mc._y = previewY + 31;
faces_txt.text = (unlockedFaces + " / ") + allFaces.length;
}
function UpdateHair() {
hair_mc.removeMovieClip();
hair_mc = attachMovie(unlockables[currentHair].reference, "hairMC", 11);
hair_mc._x = previewX - 0;
hair_mc._y = previewY + 3;
hair_mc._xscale = 50;
hair_mc._yscale = 50;
_root.hairs_txt.text = (unlockedHairs + " / ") + allHairs.length;
}
function UpdateHats() {
hat_mc.removeMovieClip();
hat_mc = attachMovie(unlockables[currentHat].reference, "hatMC", 13);
hat_mc._x = previewX - 1;
hat_mc._y = previewY + 3;
hat_mc._xscale = 50;
hat_mc._yscale = 50;
hats_txt.text = (unlockedHats + " / ") + allHats.length;
}
function UpdateBody() {
body_mc.removeMovieClip();
body_mc = attachMovie(unlockables[currentBody].reference, "bodyMC", 8);
body_mc._x = previewX - 15;
body_mc._y = previewY + 43;
body_mc._xscale = 50;
body_mc._yscale = 50;
leftarm_mc.removeMovieClip();
leftarm_mc = attachMovie(lArms[currentBody - bodyBegin], "leftArmMC", 9);
leftarm_mc._x = previewX - 10;
leftarm_mc._y = previewY + 53;
leftarm_mc._xscale = 50;
leftarm_mc._yscale = 50;
rightarm_mc.removeMovieClip();
rightarm_mc = attachMovie(rArms[currentBody - bodyBegin], "rightArmMC", 7);
rightarm_mc._x = previewX + 20;
rightarm_mc._y = previewY + 53;
rightarm_mc._xscale = 50;
rightarm_mc._yscale = 50;
bodies_txt.text = (unlockedBodies + " / ") + allBodies.length;
}
function RemovePreview() {
_root.face_mc.removeMovieClip();
_root.hair_mc.removeMovieClip();
_root.hat_mc.removeMovieClip();
_root.body_mc.removeMovieClip();
leftarm_mc.removeMovieClip();
rightarm_mc.removeMovieClip();
lefthand_mc.removeMovieClip();
righthand_mc.removeMovieClip();
smile_mc.removeMovieClip();
_root.chosenFace = _root.currentFace;
_root.chosenHair = _root.currentHair;
_root.chosenHat = _root.currentHat;
_root.chosenBody = _root.currentBody;
}
function SetDifficultyText() {
if (_root.difficulty == 1) {
_root.diff_txt.text = "easy";
} else if (_root.difficulty == 2) {
_root.diff_txt.text = "medium";
} else {
_root.diff_txt.text = "hard";
}
}
function UnlockAll() {
_root.unlockedFaces = _root.allFaces.length;
_root.unlockedBodies = _root.allBodies.length;
_root.unlockedHats = _root.allHats.length;
_root.unlockedHairs = _root.allHairs.length;
_root.faces = _root.allFaces;
_root.hairs = _root.allHairs;
_root.hats = _root.allHats;
_root.bodies = _root.allBodies;
_root.SaveUserData();
}
function UnlockContent() {
item = "skin";
_root.unlockedFaces++;
if (_root.unlockedFaces > _root.allFaces.length) {
_root.unlockedFaces--;
tempR = Math.random();
if (tempR < 0.37) {
item = "hairstyle";
_root.unlockedHairs++;
if (_root.unlockedHairs > _root.allHairs.length) {
_root.unlockedHairs--;
item = "accessory";
_root.unlockedHats++;
if (_root.unlockedHats > _root.allHats.length) {
_root.unlockedHats--;
item = "outfit";
_root.unlockedBodies++;
if (_root.unlockedBodies > _root.allBodies.length) {
_root.unlockedBodies--;
item = "none";
}
}
}
} else if (tempR < 0.74) {
item = "accessory";
_root.unlockedHats++;
if (_root.unlockedHats > _root.allHats.length) {
_root.unlockedHats--;
item = "outfit";
_root.unlockedBodies++;
if (_root.unlockedBodies > _root.allBodies.length) {
_root.unlockedBodies--;
item = "hairstyle";
_root.unlockedHairs++;
if (_root.unlockedHairs > _root.allHairs.length) {
_root.unlockedHairs--;
item = "none";
}
}
}
} else {
item = "outfit";
_root.unlockedBodies++;
if (_root.unlockedBodies > _root.allBodies.length) {
_root.unlockedBodies--;
item = "hairstyle";
_root.unlockedHairs++;
if (_root.unlockedHairs > _root.allHairs.length) {
_root.unlockedHairs--;
item = "accessory";
_root.unlockedHats++;
if (_root.unlockedHats > _root.allHats.length) {
_root.unlockedHats--;
item = "none";
}
}
}
}
}
return(item);
}
function SetCredits() {
_root.credits_txt.text = "" + _root.credits;
}
function SetProgressText() {
_root.progress_txt.text = ("Best score: " + _root.myTopScore) + newline;
_root.progress_txt.text = _root.progress_txt.text + (("Next medal at: " + _root.myNextMedal) + newline);
_root.progressbar_mc._xscale = _root.myProgress;
_root.quote_txt.text = quotes[Math.floor(Math.random() * 4)];
bronzePre_mc._alpha = 25;
silverPre_mc._alpha = 25;
goldPre_mc._alpha = 25;
oneStar_mc._alpha = 25;
twoStar_mc._alpha = 25;
twoStar2_mc._alpha = 25;
threeStar_mc._alpha = 25;
threeStar2_mc._alpha = 25;
threeStar3_mc._alpha = 25;
fourStar_mc._alpha = 25;
fourStar2_mc._alpha = 25;
fourStar3_mc._alpha = 25;
fourStar4_mc._alpha = 25;
fiveStar_mc._alpha = 25;
fiveStar2_mc._alpha = 25;
fiveStar3_mc._alpha = 25;
fiveStar4_mc._alpha = 25;
fiveStar5_mc._alpha = 25;
goldStar_mc._alpha = 25;
goldStar2_mc._alpha = 25;
goldStar3_mc._alpha = 25;
goldStar4_mc._alpha = 25;
goldStar5_mc._alpha = 25;
goldStar_mc.gotoAndStop(2);
goldStar2_mc.gotoAndStop(2);
goldStar3_mc.gotoAndStop(2);
goldStar4_mc.gotoAndStop(2);
goldStar5_mc.gotoAndStop(2);
if (_root.bUnlockedBronze) {
bronzePre_mc._alpha = 100;
}
if (_root.bUnlockedSilver) {
silverPre_mc._alpha = 100;
}
if (_root.bUnlockedGold) {
goldPre_mc._alpha = 100;
}
if (_root.bUnlocked1Star) {
oneStar_mc._alpha = 100;
}
if (_root.bUnlocked2Star) {
twoStar_mc._alpha = 100;
twoStar2_mc._alpha = 100;
}
if (_root.bUnlocked3Star) {
threeStar_mc._alpha = 100;
threeStar2_mc._alpha = 100;
threeStar3_mc._alpha = 100;
}
if (_root.bUnlocked4Star) {
fourStar_mc._alpha = 100;
fourStar2_mc._alpha = 100;
fourStar3_mc._alpha = 100;
fourStar4_mc._alpha = 100;
}
if (_root.bUnlocked5Star) {
fiveStar_mc._alpha = 100;
fiveStar2_mc._alpha = 100;
fiveStar3_mc._alpha = 100;
fiveStar4_mc._alpha = 100;
fiveStar5_mc._alpha = 100;
}
if (_root.bUnlockedGoldStar) {
goldStar_mc._alpha = 100;
goldStar2_mc._alpha = 100;
goldStar3_mc._alpha = 100;
goldStar4_mc._alpha = 100;
goldStar5_mc._alpha = 100;
}
}
stop();
var keyCode = [];
keyCode[65] = "A";
keyCode[66] = "B";
keyCode[67] = "C";
keyCode[68] = "D";
keyCode[69] = "E";
keyCode[70] = "F";
keyCode[71] = "G";
keyCode[72] = "H";
keyCode[73] = "I";
keyCode[74] = "J";
keyCode[75] = "K";
keyCode[76] = "L";
keyCode[77] = "M";
keyCode[78] = "N";
keyCode[79] = "O";
keyCode[80] = "P";
keyCode[81] = "Q";
keyCode[82] = "R";
keyCode[83] = "S";
keyCode[84] = "T";
keyCode[85] = "U";
keyCode[86] = "V";
keyCode[87] = "W";
keyCode[88] = "X";
keyCode[89] = "Y";
keyCode[90] = "Z";
keyCode[45] = "Insert";
keyCode[46] = "Delete";
keyCode[47] = "";
keyCode[48] = "ZERO";
keyCode[49] = "ONE";
keyCode[50] = "TWO";
keyCode[51] = "THREE";
keyCode[52] = "FOUR";
keyCode[53] = "FIVE";
keyCode[54] = "SIX";
keyCode[55] = "SEVEN";
keyCode[56] = "EIGHT";
keyCode[57] = "NINE";
keyCode[96] = "NUM0";
keyCode[97] = "NUM1";
keyCode[98] = "NUM2";
keyCode[99] = "NUM3";
keyCode[100] = "NUM4";
keyCode[101] = "NUM5";
keyCode[102] = "NUM6";
keyCode[103] = "NUM7";
keyCode[104] = "NUM8";
keyCode[105] = "NUM9";
keyCode[106] = "*";
keyCode[107] = "+";
keyCode[108] = "";
keyCode[109] = "-";
keyCode[110] = ".";
keyCode[111] = "/";
keyCode[33] = "PgUp";
keyCode[34] = "PgDown";
keyCode[35] = "End";
keyCode[36] = "Home";
keyCode[37] = "Left";
keyCode[38] = "Up";
keyCode[39] = "Right";
keyCode[40] = "Down";
keyCode[186] = ":";
keyCode[187] = "+";
keyCode[188] = "<";
keyCode[189] = "_";
keyCode[190] = ">";
keyCode[191] = "?";
keyCode[192] = "~";
keyCode[219] = "{";
keyCode[220] = "|";
keyCode[221] = "}";
keyCode[222] = "\"";
keyCode[8] = "Backspace";
keyCode[13] = "Enter";
keyCode[16] = "Shift";
keyCode[17] = "Ctrl";
keyCode[18] = "Alt";
keyCode[20] = "CapsLock";
keyCode[27] = "Esc";
keyCode[32] = "Space";
_root.Scr.setVolume(100);
_root.Scr.stop();
leaderScore = 0;
leaderName = "";
_root.display_txt.text = "";
quotes = ["We can be sure that the greatest hope for maintaining equilibrium in the face of any situation rests within ourselves. - Francis J. Braceland", "Fortunate indeed, is the man who takes exactly the right measure of himself, and holds a just balance between what he can acquire and what he can use. - Peter M. Latham", "Balance. The Ultimate Goal. - Ricky Lankford", "At times, it is difficult to keep a proper balance in our lives. But, over time, an improper balance will lead to problems. - Catherine Pulsifer"];
_root.muteLine_mc._alpha = (_root.bMute ? 100 : 0);
SetProgressText();
currentTopScore = -1;
pre_unicycle = 1;
SetCredits();
faces_txt.text = "";
hats_txt.text = "";
hairs_txt.text = "";
bodies_txt.text = "";
initValues = new Object();
initValues.bltFadeOut = 50;
COLLECTION = 1;
TIMEATTACK = 2;
PRACTICE = 3;
allFaces = ["Face1", "Face2"];
allHairs = ["Hair1", "Hair2", "Hair3", "Hair4", "Hair5", "Hair6", "Hair7", "Hair8", "Hair9"];
allHats = ["none", "Hoed1", "Hoed2", "Hoed3", "Hoed4", "Hoed5", "Hoed6", "Hoed7", "Hoed8", "Hoed9", "Hoed10", "Hoed11", "Hoed12"];
allBodies = ["Body1", "Body2", "Body3", "Body4", "Body5", "Body6", "Body7"];
lArms = ["LeftArm1", "LeftArm2", "LeftArm3", "LeftArm4", "LeftArm5", "LeftArm6", "LeftArm7", "LeftArm8"];
rArms = ["RightArm1", "RightArm2", "RightArm3", "RightArm4", "RightArm5", "RightArm6", "RightArm7", "RightArm8"];
allSkins = ["Hand1", "Hand2"];
var unlockables = [];
FillUnlockables();
UpdateUnlockables();
var allDisplays = ["Body2", "Body3", "Body4", "Body5", "Body6", "Body7"];
var allItems = ["Vest\n200", "Sweater\n200", "Superman\n300", "Office Drone\n300", "Mr. C\n300", "Pirate\n600"];
currentDisplays = allDisplays.slice(0, 6);
currentItems = allItems.slice(0, 6);
itemsIndex = 0;
showItems = [];
currentFace = chosenFace;
currentHair = chosenHair;
currentHat = chosenHat;
currentBody = chosenBody;
faces = allFaces.slice(0, unlockedFaces);
hairs = allHairs.slice(0, unlockedHairs);
hats = allHats.slice(0, unlockedHats);
bodies = allBodies.slice(0, unlockedBodies);
bAllowSetInputLeft = false;
bAllowSetInputRight = false;
bAllowSetInputHipLeft = false;
bAllowSetInputHipRight = false;
previewX = 118;
previewY = 193;
Instance of Symbol 212 MovieClip "loading_mc" in Frame 62
onClipEvent (load) {
_alpha = 0;
}
Frame 63
_root.BackupCurrentBody = currentBody;
_root.BackupCurrentHair = currentHair;
_root.BackupCurrentHat = currentHat;
_root.BackupCurrentFace = currentFace;
Instance of Symbol 258 MovieClip "congrats_mc" in Frame 63
onClipEvent (load) {
_alpha = 0;
}
Frame 65
if (!_root.bUnlockedLevel2) {
_root.level2_btn.enabled = false;
_root.level2_btn._alpha = 50;
}
if (!_root.bUnlockedLevel3) {
_root.level3_btn.enabled = false;
_root.level3_btn._alpha = 50;
}
if (!_root.bUnlockedLevel4) {
_root.level5_btn.enabled = false;
_root.level5_btn._alpha = 50;
}
Frame 66
SetProgressText();
Frame 69
_root.DisplayInput();
BackupInputLeftCode = _root.InputLeftCode;
BackupInputRightCode = _root.InputRightCode;
BackupInputHipLeftCode = _root.InputHipLeftCode;
BackupInputHipRightCode = _root.InputHipRightCode;
Frame 108
gotoAndPlay (149);
Frame 147
stop();
Frame 148
function onEnterFrame() {
currentT = getTimer();
deltaT = (currentT - prevT) / 1000;
prevT = currentT;
cntDwn = cntDwn - deltaT;
if (cntDwn <= 0) {
DisplayMessage("");
}
}
function DisplayMessage(displayText) {
_root.unlocked_txt.text = displayText;
cntDwn = 2;
}
function PlayImpact() {
_root.impact_mc.gotoAndPlay(1);
}
currentT = getTimer();
deltaT = 0;
prevT = getTimer() - 33;
cntDwn = 0;
_root.unlocked_txt.text = "";
stop();
Instance of Symbol 428 MovieClip "clouds1_mc" in Frame 148
onClipEvent (enterFrame) {
this._x = this._x + 0.1;
if (this._x > 800) {
this._x = this._x - (this._width + 800);
}
}
Instance of Symbol 430 MovieClip "clouds2_mc" in Frame 148
onClipEvent (enterFrame) {
this._x = this._x + 0.4;
if (this._x > 800) {
this._x = this._x - (this._width + 800);
}
}
Instance of Symbol 353 MovieClip "stok_mc" in Frame 148
onClipEvent (load) {
maxUitwijk = 150;
_root.fg_mc.gotoAndStop(_root.bg);
_root.bg_mc.gotoAndStop(_root.bg);
if (_root.bg == 3) {
_root.clouds1_mc._y = 450;
_root.clouds2_mc._y = 450;
}
acceleration = 0;
velocity = 0.1;
prevRot = 0;
grav = -20;
bFalling = false;
bPause = false;
bGameOver = false;
trophyScore = 0;
pickupScore = 0;
EqScore = 0;
pickupValue = 50;
totalScore = 0;
unlockedContent = [];
if (_root.bUnlocked4Star) {
maxHealth = 120;
} else if (_root.bUnlocked3Star) {
maxHealth = 100;
} else {
maxHealth = 80;
}
health = maxHealth;
_root.healthbg_mc._xscale = maxHealth;
if (_root.unicycle == 1) {
bodySpeed = 4;
bodyAccel = 4;
bodyMoveDecel = 4;
movementSpeed = 12;
movementAccel = 4;
movementDecel = 1.5;
velocityToWheelRotation = 0.5;
velocityToStickRot = 3;
rotationInputMP = 3;
rotationMultiplier = 1.05;
timeScore = 10;
bodyVel = 0.1;
velocity = -0.2;
gotoAndStop ("one");
} else if (_root.unicycle == 2) {
bodySpeed = 10;
bodyAccel = 6;
bodyMoveDecel = 3;
bodyVel = 0.1;
movementSpeed = 12;
movementAccel = 8;
movementDecel = 3;
velocityToWheelRotation = 0.5;
velocityToStickRot = 4;
rotationInputMP = 4;
rotationMultiplier = 1.075;
timeScore = 10;
velocity = -0.2;
gotoAndStop ("two");
} else {
bodySpeed = 13;
bodyAccel = 13;
bodyMoveDecel = 7;
bodyVel = 0.1;
movementSpeed = 15;
movementAccel = 15;
movementDecel = 8;
velocityToWheelRotation = 0.5;
velocityToStickRot = 6;
rotationInputMP = 6;
timeScore = 20;
rotationMultiplier = 1.1;
gotoAndStop ("three");
}
maxRotAngle = 85;
fallSpeed = 400;
beginT = getTimer();
currentT = getTimer();
deltaT = 0;
prevT = getTimer() - 33;
pauseTime = 0;
normalY = this._y;
voet1OffsetX = _root.ob1_mc._x - _x;
voet1OffsetY = _root.ob1_mc._y - _y;
bb1OffsetX = _root.bb1_mc._x - _x;
bb1OffsetY = _root.bb1_mc._y - _y;
bb1LengthSq = 900;
voet2OffsetX = _root.ob2_mc._x - _x;
voet2OffsetY = _root.ob2_mc._y - _y;
bb2OffsetX = _root.bb2_mc._x - _x;
bb2OffsetY = _root.bb2_mc._y - _y;
bb2LengthSq = 900;
bDoIK = true;
bHipMovement = true;
bDoPostProcess = true;
fxValue = 0;
_root.layover_mc._alpha = 0;
bLoopLevel = true;
totalXAdjust = 0;
smallXAdjust = 0;
_root.tutorialtxt_mc._alpha = 0;
tutorial = [];
tutorial[0] = ["Welcome, aspriring Prince! \nThis tutorial will teach you about the basics of balancing, so you can begin your path to becoming the Unicycle King! \n(Press space to continue)", 3];
tutorial[1] = ["Use the left and right arrow keys to move the wheel of your unicycle around. Notice that you have to keep your wheel under your body for perfect balance, so keep your focus on the wheel \n(Press space to continue)", 0.1];
tutorial[2] = ["Try it out! The goal is to keep balanced for 10 seconds and advance to the next level! \n Oh, and try not to go out of the screen!\n(Press space to start)", 0.1];
tutorial[3] = ["Great! Now you're ready to advance to the next level and learn about hip control! \n(Press space to finish)", 10];
tutorial[4] = ["", 20];
tutorial[5] = ["Now, you'll learn the second element of balancing your unicycle: Hip Control! \n(Press space to continue)", 0.1];
tutorial[6] = ["Using the A and D keys, you can move your hips left and right, this is another way to stay in balance. \nThis time, it's best to focus on your hips \n(Press space to continue)", 0.1];
tutorial[7] = ["A good combination of hip control and normal movement gives you full control over your unicycle! \nTry to stay up using only hip control for 10 seconds \n(Press space to start)", 0.1];
tutorial[8] = ["Great job! In the next level, you'll have to combine everything you've learned so far, I hope you're ready! Oh, and if you want, you can edit the controls in the main menu \n(Press space to finish)", 10];
tutorial[9] = ["", 20];
tutorial[10] = ["This level presents your final test: \nCollect three blue balls within 20 seconds to advance! \nUse your movement skills and combine them with hip control to move smoothly from one end of the level to the other \n(Press space to start)", 0.1];
tutorial[11] = ["Congratulations! You finished the tutorial mode! Now you can go on to the Time Attack mode, in which you can unlock new unicycles, outfits and accessories and set highscores to compete with your friends, ultimately becoming the King of Unicycling! \n(Press space to finish)", 20];
tutorial[12] = ["Sorry, you failed to collect three balls withing the time limit! Try again, combining hip control and normal movement! \n(Press space to finish)", 20];
tutorial[13] = ["", 20];
tutorial[14] = ["Welcome to Time Attack mode. The goal is to stay balanced as long as possible and earn the highest score. Watch out for red balls and birds; they'll make you lose health. Regain health and get bonus score with blue and gold balls. Collect green balls for credits, to buy new outfits! \nGood luck!\n(Press space to start)", 1];
tutorial[15] = ["", 1000000];
bLevel1 = _root.initValues.bLevel1;
bLevel2 = _root.initValues.bLevel2;
bLevel3 = _root.initValues.bLevel3;
bLevel4 = _root.initValues.bLevel4;
bLevelFinished = false;
TimeGoal = -1;
if (bLevel1) {
TimeGoal = 10;
bDoTutorial = true;
tutorialEndIndex = 3;
if (!_root.bPlayedLevel1) {
bPause = true;
bDoTutorial = true;
tutorialTextIndex = 0;
_root.tutorial_txt.text = tutorial[tutorialTextIndex][0];
tutorialTextCntDwn = 0;
} else {
tutorialTextIndex = 3;
_root.tutorial_txt.text = "";
tutorialTextCntDwn = 10;
}
_root.medal_txt.text = "";
_root.topscore_txt.text = "";
_root.myscore_txt.text = "";
_root.time_txt.text = "";
_root.equilibrium_mc.gotoAndStop("practice");
} else if (bLevel2) {
TimeGoal = 10;
bDoTutorial = true;
tutorialEndIndex = 8;
if (!_root.bPlayedLevel2) {
bPause = true;
tutorialTextIndex = 5;
_root.tutorial_txt.text = tutorial[tutorialTextIndex][0];
tutorialTextCntDwn = 0;
} else {
_root.tutorial_txt.text = "";
tutorialTextIndex = 8;
tutorialTextCntDwn = 10;
}
_root.medal_txt.text = "";
_root.topscore_txt.text = "";
_root.myscore_txt.text = "";
_root.equilibrium_mc.gotoAndStop("practice2");
} else if (bLevel3) {
TimeGoal = 20;
bDoTutorial = true;
tutorialTextIndex = 10;
tutorialEndIndex = 13;
TimeLimit = 19;
if (!_root.bPlayedLevel3) {
bPause = true;
_root.tutorial_txt.text = tutorial[tutorialTextIndex][0];
tutorialTextCntDwn = 0;
} else {
_root.tutorial_txt.text = "";
tutorialTextIndex = 11;
tutorialTextCntDwn = 20;
}
_root.medal_txt.text = "";
_root.topscore_txt.text = "";
_root.myscore_txt.text = "";
_root.equilibrium_mc._alpha = 0;
bFinishedLevel3 = false;
} else {
_root.equilibrium_mc._alpha = 0;
if (!_root.bPlayedTimeAttackOnce) {
bPause = true;
bDoTutorial = true;
tutorialTextIndex = 14;
tutorialEndIndex = 15;
_root.tutorial_txt.text = tutorial[tutorialTextIndex][0];
tutorialTextCntDwn = 0;
} else {
_root.tutorial_txt.text = "";
}
}
if (_root.initValues.gameType == _root.COLLECTION) {
bCollectionMode = true;
bTimeAttackMode = false;
} else if (_root.initValues.gameType == _root.TIMEATTACK) {
bCollectionMode = false;
bTimeAttackMode = true;
TimeLimit = -1;
} else {
trace("Unrecognized GameType: ");
trace(_root.initValues.gameType);
}
_root.Scr.setVolume(100);
_root.Scr.stop();
trace(_root.bMute);
if (!_root.bMute) {
Music = new Sound(this);
Music.attachSound("music");
Music.setVolume(100);
Music.start(0, 100);
}
_root.seat_mc.placeholder_mc.face_mc = _root.seat_mc.placeholder_mc.attachMovie(_root.allFaces[_root.chosenFace], "faceMC", 10);
_root.seat_mc.placeholder_mc.face_mc._x = -13;
_root.seat_mc.placeholder_mc.face_mc._y = -40;
_root.seat_mc.placeholder_mc.hair_mc = _root.seat_mc.placeholder_mc.attachMovie(_root.unlockables[_root.chosenHair].reference, "hairMC", 11);
_root.seat_mc.placeholder_mc.hair_mc._x = -13;
_root.seat_mc.placeholder_mc.hair_mc._y = -40;
_root.seat_mc.placeholder_mc.hat_mc = _root.seat_mc.placeholder_mc.attachMovie(_root.unlockables[_root.chosenHat].reference, "hatMC", 12);
_root.seat_mc.placeholder_mc.hat_mc._x = -13;
_root.seat_mc.placeholder_mc.hat_mc._y = -40;
_root.seat_mc.placeholder_mc.body_mc = _root.seat_mc.placeholder_mc.attachMovie(_root.unlockables[_root.chosenBody].reference, "bodyMC", 9);
_root.seat_mc.placeholder_mc.body_mc._x = -38;
_root.seat_mc.placeholder_mc.body_mc._y = 36;
_root.seat_mc.lplaceholder_mc.lArm_mc = _root.seat_mc.lplaceholder_mc.attachMovie(_root.lArms[_root.chosenBody - _root.bodyBegin], "lArmMC", 14);
_root.seat_mc.lplaceholder_mc.lArm_mc._x = 0;
_root.seat_mc.lplaceholder_mc.lArm_mc._y = 0;
_root.seat_mc.rplaceholder_mc.rArm_mc = _root.seat_mc.rplaceholder_mc.attachMovie(_root.rArms[_root.chosenBody - _root.bodyBegin], "rArmMC", 7);
_root.seat_mc.rplaceholder_mc.rArm_mc._x = 0;
_root.seat_mc.rplaceholder_mc.rArm_mc._y = 0;
_root.seat_mc.lplaceholder_mc.lArm_mc.handholder_mc.skin_mc = _root.seat_mc.lplaceholder_mc.lArm_mc.handholder_mc.attachMovie(_root.allSkins[_root.chosenFace], "lSkinMC", 13);
_root.seat_mc.lplaceholder_mc.rArm_mc.handholder_mc.skin_mc = _root.seat_mc.rplaceholder_mc.rArm_mc.handholder_mc.attachMovie(_root.allSkins[_root.chosenFace], "rSkinMC", 8);
if (bCollectionMode) {
rboardID = "257abe4fe82e2429";
} else if (_root.difficulty == 1) {
rboardID = "7903a22b06b6e3c1";
} else if (_root.difficulty == 2) {
rboardID = "86487bc380047ec0";
} else {
rboardID = "914ba4ffd10fccab";
}
_root.CollectLeader(rboardID);
}
onClipEvent (enterFrame) {
function AdjustLevel(xAdj) {
smallAdj = 0.5 * xAdj;
if (((xAdj > 0) && (totalXAdjust < maxUitwijk)) || ((xAdj < 0) && (totalXAdjust > (-maxUitwijk)))) {
_root.shooter_mc._x = _root.shooter_mc._x + xAdj;
_root.clouds1_mc._x = _root.clouds1_mc._x + xAdj;
_root.clouds2_mc._x = _root.clouds2_mc._x + xAdj;
_root.clouds3_mc._x = _root.clouds3_mc._x + xAdj;
_root.fg_mc._x = _root.fg_mc._x + xAdj;
_root.bg_mc._x = _root.bg_mc._x + smallAdj;
_root.bridge_mc._x = _root.bridge_mc._x + xAdj;
_root.game_mc.AdjustLevel(xAdj);
totalXAdjust = totalXAdjust + xAdj;
smallXAdjust = smallXAdjust + smallAdj;
return(true);
}
return(false);
}
function PlayBell() {
if (!_root.bMute) {
Bell = new Sound(this);
Bell.attachSound("bell1");
Bell.start(0, 0);
}
}
function FinishLevel() {
bGameOver = true;
Music.stop();
_root.finished_mc.play();
}
function GotoNextLevel() {
if (bLevel1 && (_root.bUnlockedLevel2)) {
_root.StartLevel2();
} else if (bLevel2 && (_root.bUnlockedLevel3)) {
_root.StartLevel3();
} else if (bLevel3 && (_root.bUnlockedLevel4)) {
_root.StartTimeAttack();
}
}
function FallDown() {
_root.equilibrium_mc._alpha = 0;
_root.layover_mc._alpha = 0;
seat_mc.gotoAndPlay("falldown");
_root.game_mc.StopBullets();
bGameOver = true;
EqScore = Math.round(EqScore);
if (bLevel1) {
_root.bPlayedLevel1 = true;
}
if (bLevel2) {
_root.bPlayedLevel2 = true;
}
if (bLevel3) {
_root.bPlayedLevel3 = true;
}
Music.stop();
bPlaySuccess = false;
if ((bLevel1 || (bLevel2)) || (bLevel3)) {
if (bLevelFinished) {
_root.gameover_mc.gotoAndPlay("clean");
bPlaySuccess = true;
} else {
_root.gameover_mc.gotoAndPlay("fail");
}
} else {
_root.gameover_mc.gotoAndPlay("full");
}
if (!_root.bMute) {
if (bPlaySuccess) {
_root.Scr = new Sound(_root);
_root.Scr.attachSound("cheer");
_root.Scr.setVolume(20);
_root.Scr.start(1, 0);
} else {
_root.Err = new Sound(_root);
_root.Err.attachSound("scratch");
_root.Err.setVolume(5);
_root.Err.start(0, 0);
_root.Scr = new Sound(_root);
_root.Scr.attachSound("scream2");
_root.Scr.setVolume(20);
_root.Scr.start(1, 0);
}
}
if (bCollectionMode) {
_root.gameover_mc.timescore_txt.text = "-";
_root.gameover_mc.trophyscore_txt.text = "-";
_root.gameover_mc.pickupscore_txt.text = "" + (pickupScore / pickupValue);
_root.gameover_mc.eqscore_txt.text = "-";
totalScore = pickupScore / pickupValue;
_root.gameover_mc.totalscore_txt.text = "" + totalScore;
_root.gameover_mc.submit_btn.enabled = true;
} else if (bTimeAttackMode) {
_root.gameover_mc.timescore_txt.text = (((Math.floor(timeTot) + " x ") + timeScore) + " = ") + Math.floor(timeTot * timeScore);
_root.gameover_mc.trophyscore_txt.text = "+ " + trophyScore;
_root.gameover_mc.pickupscore_txt.text = (((("+ " + (pickupScore / pickupValue)) + " x ") + pickupValue) + " = ") + pickupScore;
_root.gameover_mc.eqscore_txt.text = "+ " + EqScore;
_root.gameover_mc.MPscore_txt.text = "x" + _root.difficulty;
_root.gameover_mc.totalscore_txt.text = "" + totalScore;
if (unlockedContent.length > 0) {
_root.gameover_mc.unlocked_txt.text = "Unlocked:";
nSkins = 0;
nAcc = 0;
nOutf = 0;
nHairs = 0;
i = 0;
while (i < unlockedContent.length) {
if (unlockedContent[i] == "skin") {
nSkins++;
} else if (unlockedContent[i] == "hairstyle") {
nHairs++;
} else if (unlockedContent[i] == "accessory") {
nAcc++;
} else if (unlockedContent[i] == "outfit") {
nOutf++;
} else {
_root.gameover_mc.unlocked_txt.text = _root.gameover_mc.unlocked_txt.text + (" " + unlockedContent[i]);
}
i++;
}
if (nSkins > 0) {
_root.gameover_mc.unlocked_txt.text = _root.gameover_mc.unlocked_txt.text + ((" " + nSkins) + " new skin");
}
if (nHairs > 0) {
_root.gameover_mc.unlocked_txt.text = _root.gameover_mc.unlocked_txt.text + ((" " + nHairs) + " new hairstyle");
}
if (nAcc > 0) {
_root.gameover_mc.unlocked_txt.text = _root.gameover_mc.unlocked_txt.text + ((" " + nAcc) + " new accessory");
}
if (nOutf > 0) {
_root.gameover_mc.unlocked_txt.text = _root.gameover_mc.unlocked_txt.text + ((" " + nOutf) + " new outfit");
}
} else {
_root.gameover_mc.unlocked_txt.text = "";
}
if (((totalScore > 8000) && (_root.difficulty <= 2)) && (Math.random() > 0.2)) {
_root.gameover_mc.unlocked_txt.text = _root.gameover_mc.unlocked_txt.text + "\nTip: Too easy? Try setting the difficulty harder in the main menu";
} else if (Math.random() > 0.8) {
_root.gameover_mc.unlocked_txt.text = _root.gameover_mc.unlocked_txt.text + "\nTip: You can customize your character's appearance in the main menu";
} else if (health > 0) {
if ((_x > Stage.width) || (_x < 0)) {
_root.gameover_mc.unlocked_txt.text = _root.gameover_mc.unlocked_txt.text + "\nTip: Try to stay inside the screen area";
} else if (Math.random() > 0.5) {
_root.gameover_mc.unlocked_txt.text = _root.gameover_mc.unlocked_txt.text + "\nTip: Try to keep your wheel directly underneath you for balance";
} else {
_root.gameover_mc.unlocked_txt.text = _root.gameover_mc.unlocked_txt.text + "\nTip: Use hip control for better balace";
}
} else if (Math.random() > 0.5) {
_root.gameover_mc.unlocked_txt.text = _root.gameover_mc.unlocked_txt.text + "\nTip: Pick up blue and gold balls to regain your health";
} else {
_root.gameover_mc.unlocked_txt.text = _root.gameover_mc.unlocked_txt.text + "\nTip: Watch out for red balls and birds, they're bad for you!";
}
_root.gameover_mc.submit_btn.enabled = true;
if (totalScore > _root.myTopScore) {
_root.myTopScore = totalScore;
}
_root.myNextMedal = "0.10";
if (_root.bUnlockedBronze) {
_root.myNextMedal = "0.30";
if (_root.bUnlockedSilver) {
_root.myNextMedal = "1.00";
if (_root.bUnlockedGold) {
_root.myNextMedal = "1.30";
if (_root.bUnlocked1Star) {
_root.myNextMedal = "2.00";
if (_root.bUnlocked2Star) {
_root.myNextMedal = "3.00";
if (_root.bUnlocked3Star) {
_root.myNextMedal = "4.00";
if (_root.bUnlocked4Star) {
_root.myNextMedal = "5.00";
if (_root.bUnlocked5Star) {
_root.myNextMedal = "7.30";
if (_root.bUnlockedGoldStar) {
_root.myNextMedal = " - ";
}
}
}
}
}
}
}
}
}
_root.myProgress = (((((_root.unlockedFaces + _root.unlockedHairs) + _root.unlockedHats) + _root.unlockedBodies) - 4) / ((((_root.allFaces.length + _root.allHairs.length) + _root.allHats.length) + _root.allBodies.length) - 4)) * 100;
} else {
_root.gameover_mc.timescore_txt.text = "-";
_root.gameover_mc.trophyscore_txt.text = "-";
_root.gameover_mc.pickupscore_txt.text = "-";
_root.gameover_mc.eqscore_txt.text = "-";
_root.gameover_mc.totalscore_txt.text = "-";
totalScore = 0;
_root.gameover_mc.submit_btn._alpha = 0;
_root.gameover_mc.submit_btn.enabled = false;
_root.equilibrium_mc._alpha = 0;
_root.tutorialtxt_mc._alpha = 0;
}
_root.SaveUserData();
bFalling = !bPlaySuccess;
}
function Quit() {
_root.Quit();
}
function QuitToMenu() {
_root.QuitToMenu();
}
currentT = getTimer();
deltaT = (currentT - prevT) / 1000;
prevT = currentT;
if (bCollectionMode) {
totalScore = Math.round(pickupScore / 50);
} else {
totalScore = Math.round(((EqScore + pickupScore) + trophyScore) + Math.floor(timeTot * timeScore)) * _root.difficulty;
}
if (bFalling) {
fallSpeed = fallSpeed + (800 * deltaT);
_y = (_y + (fallSpeed * deltaT));
_root.seat_mc._y = _root.seat_mc._y + (fallSpeed * deltaT);
_root.ob1_mc._y = _root.ob1_mc._y + (fallSpeed * deltaT);
_root.bb1_mc._y = _root.bb1_mc._y + (fallSpeed * deltaT);
_root.ob2_mc._y = _root.ob2_mc._y + (fallSpeed * deltaT);
_root.bb2_mc._y = _root.bb2_mc._y + (fallSpeed * deltaT);
_root.voet1_mc._y = _root.voet1_mc._y + (fallSpeed * deltaT);
_root.voet2_mc._y = _root.voet2_mc._y + (fallSpeed * deltaT);
}
if (bGameOver) {
return(undefined);
}
if (Key.isDown(32)) {
if (bPause) {
bPause = false;
if (!(bLevel1 || (bLevel2))) {
_root.game_mc.bPause = false;
}
_root.tutorial_txt.text = "";
tutorialTextIndex++;
tutorialTextCntDwn = tutorial[tutorialTextIndex][1];
trace("B");
if ((!((bLevel3 || (bLevel2)) || (bLevel1))) && (!_root.bPlayedTimeAttackOnce)) {
_root.bPlayedTimeAttackOnce = true;
}
if (tutorialTextIndex > tutorialEndIndex) {
trace("A");
if (bLevel1) {
_root.bUnlockedLevel2 = true;
} else if (bLevel2) {
_root.bUnlockedLevel3 = true;
}
if (!bLevel3) {
bLevelFinished = true;
}
trace("Falling down cause tutTextIndex > tutEndIndex");
FallDown();
}
}
}
if (tutorialTextCntDwn < 0) {
bPause = true;
_root.game_mc.bPause = true;
_root.tutorial_txt.text = tutorial[tutorialTextIndex][0];
if (bLevel3) {
if (bFinishedLevel3) {
_root.tutorial_txt.text = tutorial[tutorialTextIndex][0];
bLevelFinished = true;
} else {
_root.tutorial_txt.text = tutorial[tutorialTextIndex + 1][0];
bLevelFinished = false;
}
}
}
if (bPause) {
pauseTime = pauseTime + deltaT;
return(undefined);
}
if (tutorialTextCntDwn >= 0) {
tutorialTextCntDwn = tutorialTextCntDwn - deltaT;
}
health = Math.min(health, maxHealth);
_root.healthometer_mc._xscale = Math.max(health, 0);
if (health <= 0) {
health = 0;
FallDown();
}
timeTot = ((currentT - beginT) / 1000) - pauseTime;
if (bCollectionMode) {
timeTot = (TimeLimit + 1) - timeTot;
if (timeTot <= 0) {
timeTot = 0;
trace("Falling down cause timeTot <= 0");
FallDown();
}
}
if (!((bLevel1 || (bLevel2)) || (bLevel3))) {
_root.credits_txt.text = "credits: " + _root.credits;
if (_root.leaderScore > 0) {
_root.topscore_txt.text = (("Today's top score by " + _root.leaderName) + ": ") + _root.leaderScore;
} else {
_root.topscore_txt.text = "Retrieving data..";
}
_root.myscore_txt.text = "Score: " + totalScore;
} else {
_root.credits_txt.text = "";
}
timeMin = Math.floor(timeTot / 60);
timeSec = Math.floor(timeTot % 60);
timeSec = ((timeSec < 10) ? ("0" + timeSec) : (timeSec));
_root.time_txt.text = (timeMin + ":") + timeSec;
if (TimeGoal > 0) {
_root.medal_txt.text = "Level finished at: 0:" + TimeGoal;
}
if (bLevel3) {
if (pickupScore >= 150) {
bFinishedLevel3 = true;
_root.bUnlockedLevel4 = true;
}
}
if (bTimeAttackMode && (!((bLevel1 || (bLevel2)) || (bLevel3)))) {
if (timeTot < 10) {
_root.medal_txt.text = "Bronze medal at: 0:10";
} else if (timeTot < 30) {
_root.medal_txt.text = "Silver medal at: 0:30";
} else if (timeTot < 60) {
_root.medal_txt.text = "Gold medal at: 1:00";
} else if (timeTot < 90) {
_root.medal_txt.text = "Single star bonus at: 1:30";
} else if (timeTot < 120) {
_root.medal_txt.text = "Two stars at: 2:00";
} else if (timeTot < 180) {
_root.medal_txt.text = "Three stars at: 3:00";
} else if (timeTot < 240) {
_root.medal_txt.text = "Four stars at: 4:00";
} else if (timeTot < 300) {
_root.medal_txt.text = "Five stars at: 5:00";
} else if (timeTot < 450) {
_root.medal_txt.text = "Golden stars at: 7:30";
}
if (((timeTot - deltaT) <= 10) && (timeTot > 10)) {
if (_root.initValues.bTutorial) {
_root.tutorialtxt_mc.gotoAndStop(2);
_root.tutorialtxt_mc._alpha = 100;
bPause = true;
} else {
_root.score_mc.score_txt.textColor = 9205843 /* 0x8C7853 */;
_root.score_mc.score_txt.text = "BRONZE MEDAL! \n +50!";
_root.score_mc.gotoAndPlay(1);
_root.bronze_mc.play();
trophyScore = 50;
if (!_root.bUnlockedBronze) {
_root.DisplayMessage("Unlocked medium difficulty!");
unlockedContent.push("Medium difficulty mode");
}
_root.bUnlockedMedium = true;
_root.bUnlockedBronze = true;
PlayBell();
}
} else if (((timeTot - deltaT) <= 30) && (timeTot > 30)) {
_root.score_mc.score_txt.textColor = 15132922 /* 0xE6E8FA */;
_root.score_mc.score_txt.text = "SILVER MEDAL! \n +100!";
_root.score_mc.gotoAndPlay(1);
_root.silver_mc.play();
trophyScore = 150;
if (!_root.bUnlockedSilver) {
_root.DisplayMessage("Unlocked new background!");
unlockedContent.push("New background");
}
_root.bUnlockedBG2 = true;
_root.bUnlockedSilver = true;
PlayBell();
} else if (((timeTot - deltaT) <= 60) && (timeTot > 60)) {
_root.score_mc.score_txt.textColor = 13467442 /* 0xCD7F32 */;
_root.score_mc.score_txt.text = "GOLD MEDAL! \n +200!";
_root.score_mc.gotoAndPlay(1);
_root.gold_mc.play();
trophyScore = 350;
if (!_root.bUnlockedGold) {
_root.DisplayMessage("Unlocked new unicycle: Hot Red!");
unlockedContent.push("New Unicycle: 'Hot Red'");
}
_root.bUnlockedUnicycle2 = true;
_root.bUnlockedGold = true;
_root.SaveUserData();
PlayBell();
} else if (((timeTot - deltaT) <= 90) && (timeTot > 90)) {
_root.score_mc.score_txt.textColor = 1048320 /* 0x0FFF00 */;
_root.score_mc.score_txt.text = "SINGLE STAR BONUS! \n +500!";
_root.score_mc.gotoAndPlay(1);
_root.star1_mc.play();
trophyScore = 850;
if (!_root.bUnlocked1Star) {
_root.DisplayMessage("Unlocked Hard difficulty mode!");
unlockedContent.push("Hard difficulty mode");
}
_root.bUnlockedHard = true;
_root.bUnlocked1Star = true;
PlayBell();
} else if (((timeTot - deltaT) <= 120) && (timeTot > 120)) {
_root.score_mc.score_txt.textColor = 1048320 /* 0x0FFF00 */;
_root.score_mc.score_txt.text = "TWO STAR BONUS! \n +500!";
_root.score_mc.gotoAndPlay(1);
_root.star2_mc.play();
trophyScore = 1350;
if (!_root.bUnlocked2Star) {
_root.DisplayMessage("Unlocked new background!");
unlockedContent.push("New background");
}
_root.bUnlockedBG3 = true;
_root.bUnlocked2Star = true;
PlayBell();
} else if (((timeTot - deltaT) <= 180) && (timeTot > 180)) {
_root.score_mc.score_txt.textColor = 1048320 /* 0x0FFF00 */;
_root.score_mc.score_txt.text = "THREE STAR BONUS! \n +500!";
_root.score_mc.gotoAndPlay(1);
_root.star3_mc.play();
trophyScore = 1850;
if (!_root.bUnlocked3Star) {
_root.DisplayMessage("Increased health to 125%!");
unlockedContent.push("125% health increase");
}
maxHealth = 100;
health = maxHealth;
_root.healthbg_mc._xscale = maxHealth;
_root.bUnlocked3Star = true;
PlayBell();
} else if (((timeTot - deltaT) <= 240) && (timeTot > 240)) {
_root.score_mc.score_txt.textColor = 1048320 /* 0x0FFF00 */;
_root.score_mc.score_txt.text = "FOUR STAR BONUS! \n +500!";
_root.score_mc.gotoAndPlay(1);
_root.star4_mc.play();
trophyScore = 2350;
if (!_root.bUnlocked4Star) {
_root.DisplayMessage("Maximum health increase!");
unlockedContent.push("Maximum health increase");
}
maxHealth = 120;
health = maxHealth;
_root.healthbg_mc._xscale = maxHealth;
_root.bUnlocked4Star = true;
PlayBell();
} else if (((timeTot - deltaT) <= 300) && (timeTot > 300)) {
_root.score_mc.score_txt.textColor = 1048320 /* 0x0FFF00 */;
_root.score_mc.score_txt.text = "FIVE STARS!! \n +500!";
_root.score_mc.gotoAndPlay(1);
_root.star5_mc.play();
trophyScore = 2850;
if (!_root.bUnlocked5Star) {
_root.DisplayMessage("Unlocked new unicycle: Blue Steel!");
unlockedContent.push("New Unicycle: 'Blue Steel'");
}
_root.bUnlockedUnicycle3 = true;
_root.bUnlocked5Star = true;
PlayBell();
} else if (((timeTot - deltaT) <= 450) && (timeTot > 450)) {
_root.score_mc.score_txt.textColor = 0;
_root.score_mc.score_txt.text = "CONGRATULATIONS! \n GOLDEN STARS!!";
_root.score_mc.gotoAndPlay(1);
_root.gstar1_mc.play();
_root.gstar2_mc.play();
_root.gstar3_mc.play();
_root.gstar4_mc.play();
_root.gstar5_mc.play();
trophyScore = 5000;
if (!_root.bUnlockedGoldStar) {
_root.DisplayMessage("Unbelievable! You are now the King of Unicycling! You've unlocked ALL bonus content!");
unlockedContent.push("Unicycle King: ALL bonus content");
}
_root.UnlockAll();
_root.bUnlockedGoldStar = true;
PlayBell();
}
} else if (bCollectionMode) {
_root.medal_txt.text = "Balls collected: " + (pickupScore / pickupValue);
}
if (bHipMovement && (!bLevel1)) {
if (Key.isDown(_root.InputHipLeftCode)) {
bodyDir = -1;
} else if (Key.isDown(_root.InputHipRightCode)) {
bodyDir = 1;
} else {
bodyDir = 0;
}
} else {
bodyDir = 0;
}
dir = 0;
if (!bLevel2) {
if (Key.isDown(_root.InputRightCode)) {
dir = 1;
} else if (Key.isDown(_root.InputLeftCode)) {
dir = -1;
}
}
if (dir != 0) {
acceleration = (movementAccel * deltaT) * dir;
if ((dir == 1) && (velocity > 0)) {
velocity = Math.min(velocity + acceleration, movementSpeed);
} else if ((dir == -1) && (velocity < 0)) {
velocity = Math.max(velocity + acceleration, -movementSpeed);
}
if ((dir == -1) && (velocity > 0)) {
velocity = Math.min(velocity + (acceleration * 2), movementSpeed);
} else if ((dir == 1) && (velocity < 0)) {
velocity = Math.max(velocity + (acceleration * 2), -movementSpeed);
}
} else {
velocity = velocity - (velocity * (movementDecel * deltaT));
}
if (bodyDir != 0) {
bodyAcc = (bodyAccel * deltaT) * bodyDir;
if ((bodyDir == 1) && (bodyVel > 0)) {
bodyVel = Math.min(bodyVel + bodyAcc, bodySpeed);
} else if ((bodyDir == -1) && (bodyVel < 0)) {
bodyVel = Math.max(bodyVel + bodyAcc, -bodySpeed);
}
if ((bodyDir == -1) && (bodyVel > 0)) {
bodyVel = Math.min(bodyVel + (bodyAcc * 10), bodySpeed);
} else if ((bodyDir == 1) && (bodyVel < 0)) {
bodyVel = Math.max(bodyVel + (bodyAcc * 10), -bodySpeed);
}
} else {
bodyVel = bodyVel - (bodyVel * (bodyMoveDecel * deltaT));
}
wiel_mc._rotation = wiel_mc._rotation + (velocity / velocityToWheelRotation);
this._rotation = this._rotation - ((velocity / movementSpeed) * velocityToStickRot);
this._rotation = this._rotation + ((bodyVel / bodySpeed) * rotationInputMP);
if (dir == 0) {
this._rotation = this._rotation * rotationMultiplier;
}
if ((_rotation > maxRotAngle) || (_rotation <= (-maxRotAngle))) {
FallDown();
}
rotationAlpha = ((Math.abs(_rotation) / 60) * 100) - 40;
if ((Math.abs(_rotation) >= 50) && (Math.abs(prevRot) < 50)) {
_root.seat_mc.gotoAndPlay("unsteady3");
} else if (((Math.abs(_rotation) >= 30) && (Math.abs(_rotation) < 50)) && ((Math.abs(prevRot) < 30) || (Math.abs(prevRot) > 50))) {
_root.seat_mc.gotoAndPlay("unsteady2");
} else if (((Math.abs(_rotation) >= 15) && (Math.abs(_rotation) < 30)) && ((Math.abs(prevRot) < 15) || (Math.abs(prevRot) > 30))) {
_root.seat_mc.gotoAndPlay("unsteady1");
} else if ((Math.abs(_rotation) <= 15) && (Math.abs(prevRot) > 15)) {
_root.seat_mc.gotoAndPlay("steady");
}
yOffset = 48 - (Math.cos((this._rotation / 180) * Math.PI) * 48);
this._y = normalY + yOffset;
_root.seat_mc._y = _y + 12;
prevX = _x;
_x = (_x + velocity);
_root.seat_mc._x = _root.seat_mc._x + velocity;
_root.equilibrium_mc._x = _root.equilibrium_mc._x + velocity;
if (bLoopLevel) {
xL = 100;
xR = Stage.width - 100;
xL2 = 150;
xR2 = Stage.width - 150;
if (((_x > xR) && (totalXAdjust < 1)) || ((_x < xL) && (totalXAdjust > -1))) {
trace("outside Bounds");
if (_x > xR) {
AddXMov = xR - _x;
} else {
AddXMov = xL - _x;
}
CounterXMove = (0.95 * deltaT) * AddXMov;
CounterXMove = CounterXMove - (_x - prevX);
if (AdjustLevel(CounterXMove)) {
_x = (_x + CounterXMove);
_root.seat_mc._x = _root.seat_mc._x + CounterXMove;
}
} else if ((_x < xR2) && (_x > xL2)) {
trace("within Bounds");
if (Math.abs(totalXAdjust) > 1) {
if (totalXAdjust > 0) {
AddXMov = -1 * Math.min(20, totalXAdjust);
} else {
AddXMov = -1 * Math.max(-20, totalXAdjust);
}
trace("AddXMov: " + AddXMov);
CounterXMove = (0.95 * deltaT) * AddXMov;
CounterXMove = CounterXMove - (_x - prevX);
if (AdjustLevel(CounterXMove)) {
_x = (_x + CounterXMove);
_root.seat_mc._x = _root.seat_mc._x + CounterXMove;
}
}
}
}
if (bDoPostProcess) {
targetFxValue = Math.max(Math.max(screenAlpha, rotationAlpha), maxHealth - health);
if (targetFxValue > fxValue) {
fxValue = Math.min(fxValue + (deltaT * 50), targetFxValue);
} else {
fxValue = Math.max(fxValue - (deltaT * 50), targetFxValue);
}
fxValue = Math.max(0, fxValue);
_root.layover_mc._alpha = targetFxValue;
_root.clouds1_mc.gotoAndStop(targetFxValue);
}
var trapper1P = new Object();
trapper1P.x = wiel_mc.trapper1_mc._x;
trapper1P.y = wiel_mc.trapper1_mc._y;
wiel_mc.localToGlobal(trapper1P);
_root.voet1_mc._x = trapper1P.x;
_root.voet1_mc._y = trapper1P.y;
var trapper2P = new Object();
trapper2P.x = wiel_mc.trapper2_mc._x;
trapper2P.y = wiel_mc.trapper2_mc._y;
wiel_mc.localToGlobal(trapper2P);
_root.voet2_mc._x = trapper2P.x;
_root.voet2_mc._y = trapper2P.y;
if (bDoIK) {
bb1X = this._x + (1 * bb1OffsetX);
bb1Y = this._y + bb1OffsetY;
d = Math.sqrt(Math.pow(_root.voet1_mc._x - bb1X, 2) + Math.pow(_root.voet1_mc._y - bb1Y, 2));
a = Math.pow(d, 2) / (2 * d);
h = Math.sqrt(bb1LengthSq - Math.pow(a, 2));
x2 = bb1X + ((a * (_root.voet1_mc._x - bb1X)) / d);
y2 = bb1Y + ((a * (_root.voet1_mc._y - bb1Y)) / d);
x3 = x2 + (1 * ((h * (_root.voet1_mc._y - bb1Y)) / d));
y3 = y2 - (1 * ((h * (_root.voet1_mc._x - bb1X)) / d));
_root.bb1_mc._x = bb1X;
_root.bb1_mc._y = bb1Y;
_root.ob1_mc._x = _root.voet1_mc._x;
_root.ob1_mc._y = _root.voet1_mc._y;
_root.bb1_mc._rotation = (-Math.atan2(x3 - bb1X, y3 - bb1Y)) / (Math.PI/180);
_root.ob1_mc._rotation = (-Math.atan2(_root.voet1_mc._x - x3, _root.voet1_mc._y - y3)) / (Math.PI/180);
bb2X = this._x + (1 * bb2OffsetX);
bb2Y = this._y + bb2OffsetY;
d = Math.sqrt(Math.pow(_root.voet2_mc._x - bb2X, 2) + Math.pow(_root.voet2_mc._y - bb2Y, 2));
a = Math.pow(d, 2) / (2 * d);
h = Math.sqrt(bb2LengthSq - Math.pow(a, 2));
x2 = bb2X + ((a * (_root.voet2_mc._x - bb2X)) / d);
y2 = bb2Y + ((a * (_root.voet2_mc._y - bb2Y)) / d);
x3 = x2 + (1 * ((h * (_root.voet2_mc._y - bb2Y)) / d));
y3 = y2 - (1 * ((h * (_root.voet2_mc._x - bb2X)) / d));
_root.bb2_mc._x = bb2X;
_root.bb2_mc._y = bb2Y;
_root.ob2_mc._x = _root.voet2_mc._x;
_root.ob2_mc._y = _root.voet2_mc._y;
_root.bb2_mc._rotation = (-Math.atan2(x3 - bb2X, y3 - bb2Y)) / (Math.PI/180);
_root.ob2_mc._rotation = (-Math.atan2(_root.voet2_mc._x - x3, _root.voet2_mc._y - y3)) / (Math.PI/180);
}
prevRot = _rotation;
}
Instance of Symbol 456 MovieClip "clouds3_mc" in Frame 148
onClipEvent (enterFrame) {
this._x = this._x + 0.5;
if (this._x > 800) {
this._x = this._x - (this._width + 800);
}
}
Instance of Symbol 458 MovieClip "game_mc" in Frame 148
onClipEvent (load) {
graphicCntDwn = 15;
if (_root.initValues.gameType == _root.COLLECTION) {
bigBonusChance = 0;
collectChance = 0;
bonusChance = 1;
spawnCntDwn = 5;
maxBallsPerRow = 2;
waveGrowth = 0;
bltFadeOut = 20;
} else {
collectChance = 0.2;
if (_root.difficulty == 1) {
birdChance = 0;
birdChanceIncrease = 0;
birdChanceMax = 0;
redStayChance = 0;
redStayChanceIncrease = 0;
maxRedStayChance = 0;
bigBonusChance = 0;
bonusChance = 0.3;
spawnCntDwn = 7;
maxBallsPerRow = 5;
waveGrowth = 0.1;
} else if (_root.difficulty == 2) {
birdChance = 0;
birdChanceIncrease = 0.0007;
birdChanceMax = 0.1;
redStayChance = 0;
redStayChanceIncrease = 0.001;
maxRedStayChance = 0.15;
bigBonusChance = 0.01;
bonusChance = 0.25;
spawnCntDwn = 5;
maxBallsPerRow = 6;
waveGrowth = 0.5;
} else {
birdChance = 0.1;
birdChanceIncrease = 0.001;
birdChanceMax = 0.2;
redStayChance = 0.1;
redStayChanceIncrease = 0.001;
maxRedStayChance = 0.25;
bigBonusChance = 0.02;
bonusChance = 0.15;
spawnCntDwn = 5;
maxBallsPerRow = 8;
waveGrowth = 1;
}
bltFadeOut = 33;
}
currentT = getTimer();
deltaT = 0;
prevT = getTimer() - 33;
redFadeOutSpeed = 50;
spawnTimer = 5;
grav = -20;
friction = 0;
bulletArray = [];
bulletCount = 0;
rowSize = [];
rowSize[0] = 1;
currentRow = 0;
waveSize = 1;
betweenWaves = 1.25;
level3Script = [];
level3Script[0] = [2, "BLUE"];
level3Script[1] = [2, "BLUE"];
level3Script[2] = [2, "BLUE"];
level3Script[3] = [2, "BLUE"];
level3Script[4] = [2, "BLUE"];
bPause = false;
bDoScriptLevel3 = false;
if (_root.initValues.bLevel1 || (_root.initValues.bLevel2)) {
bPause = true;
} else if (_root.initValues.bLevel3) {
bPause = !_root.bPlayedLevel3;
bDoScriptLevel3 = true;
index = 0;
spawnCntDwn = level3Script[index][0];
} else {
trace("Yhello!");
bPause = !_root.bPlayedTimeAttackOnce;
trace(_root.bPlayedTimeAttackOnce);
}
}
onClipEvent (enterFrame) {
function updateBullets() {
i = 0;
for ( ; i < bulletArray.length ; i++) {
if (((!bulletArray[0].bLiving) || (bulletArray[0].life <= 0)) || (bulletArray[0]._alpha <= 0)) {
bulletArray[0]._alpha = 0;
bulletArray[0].bDoHitTest = false;
bulletArray[0].bLiving = false;
bulletArray[0].removeMovieClip();
bulletArray.shift();
if (i == 0) {
continue;
}
} else {
bulletArray[i].life = bulletArray[i].life - deltaT;
if (!bulletArray[i].bLiving) {
} else if (((bulletArray[i].bLiving && (bulletArray[i].bDoHitTest)) && (bulletArray[i].bTestSeat && (bulletArray[i].hitTest(_root.seat_mc)))) || (bulletArray[i].hitTest(_root.stok_mc))) {
if (bulletArray[i].col == "red") {
bulletArray[i].gotoAndPlay("redimpact");
_root.PlayImpact();
if (!_root.bMute) {
Imp = new Sound(this);
Imp.attachSound("ImpRed");
Imp.start(0, 0);
}
} else if (bulletArray[i].col == "bird") {
bulletArray[i].gotoAndPlay("birdimpact");
_root.PlayImpact();
if (!_root.bMute) {
Imp = new Sound(this);
Imp.attachSound("ImpRed");
Imp.start(0, 0);
}
} else if (bulletArray[i].col == "green") {
if (!_root.bMute) {
Gr = new Sound(this);
Gr.attachSound("Chime");
Gr.setVolume(80);
Gr.start(0, 0);
}
bulletArray[i].gotoAndPlay("greenimpact");
if (_root.difficulty == 1) {
cred = 10;
} else if (_root.difficulty == 2) {
cred = 20;
} else {
cred = 30;
}
_root.credits = _root.credits + cred;
_root.DisplayMessage(("+" + cred) + " credits!");
} else if (bulletArray[i].col == "blue") {
bulletArray[i].gotoAndPlay("blueimpact");
if (!_root.bMute) {
Bell2 = new Sound(this);
Bell2.attachSound("bell2");
Bell2.setVolume(50);
Bell2.start(0, 0);
}
} else {
bulletArray[i].gotoAndPlay("goldimpact");
if (!_root.bMute) {
Bell2 = new Sound(this);
Bell2.attachSound("bell2");
Bell2.setVolume(50);
Bell2.start(0, 0);
}
}
_root.stok_mc.health = _root.stok_mc.health - bulletArray[i].damage;
_root.stok_mc.pickupScore = _root.stok_mc.pickupScore + bulletArray[i].bonus;
bulletArray[i].bLiving = false;
} else if (bulletArray[i].bStay && (bulletArray[i]._y >= 410)) {
bulletArray[i]._alpha = Math.max(bulletArray[i]._alpha - (deltaT * bulletArray[i].fadeOutSpeed), 0);
bulletArray[i].bTestSeat = false;
bulletArray[i]._y = 427;
if (bulletArray[i].life <= 0) {
bulletArray[i]._alpha = 0;
}
if (bulletArray[i]._alpha <= 0) {
bulletArray[i].bDoHitTest = false;
bulletArray[i].bLiving = false;
}
} else if (bulletArray[i].bLiving) {
bulletArray[i].xAccel = (-friction) * bulletArray[i].mass;
bulletArray[i].yAccel = grav * bulletArray[i].mass;
bulletArray[i].xSpeed = bulletArray[i].xSpeed + (bulletArray[i].xAccel * deltaT);
bulletArray[i].ySpeed = bulletArray[i].ySpeed + (bulletArray[i].yAccel * deltaT);
bulletArray[i]._x = bulletArray[i]._x + (bulletArray[i].xSpeed * deltaT);
bulletArray[i]._y = bulletArray[i]._y - (bulletArray[i].ySpeed * deltaT);
}
}
}
}
function StopBullets() {
Len = bulletArray.length;
i = 0;
while (i < Len) {
bulletArray[0]._alpha = 0;
bulletArray.shift();
i++;
}
}
function AdjustLevel(xAdj) {
i = 0;
while (i < bulletArray.length) {
bulletArray[i]._x = bulletArray[i]._x + xAdj;
i++;
}
}
currentT = getTimer();
deltaT = (currentT - prevT) / 1000;
prevT = currentT;
if (_root.stok_mc.bGameOver) {
return(undefined);
}
if (bPause) {
return(undefined);
}
if (graphicCntDwn > 0) {
graphicCntDwn = graphicCntDwn - deltaT;
}
if (spawnCntDwn > 0) {
spawnCntDwn = spawnCntDwn - deltaT;
}
if (_root.initValues.gameType == _root.TIMEATTACK) {
collectChance = ((100 - _root.myProgress) / 100) * 0.1;
}
if (graphicCntDwn < 0) {
if (Math.random() > 0.5) {
_root.birds_mc._xscale = -100;
_root.birds_mc._x = -100;
} else {
_root.birds_mc._xscale = 100;
_root.birds_mc._x = 640;
}
_root.birds_mc.gotoAndPlay(1);
graphicCntDwn = 15 + (Math.random() * 5);
}
if (spawnCntDwn < 0) {
if (currentRow < rowSize.length) {
i = 0;
while (i < rowSize[currentRow]) {
blt_mc = _root.attachMovie("Rocket", "bllt" + bulletCount, 1000 + bulletCount);
blt_mc.xSpeed = 0;
blt_mc.ySpeed = 10;
blt_mc.mass = 10;
blt_mc.life = 20;
blt_mc.bLiving = true;
blt_mc.bTestSeat = true;
blt_mc.bDoHitTest = true;
blt_mc._xscale = 70;
blt_mc._yscale = 70;
expl_mc = _root.shooter_mc.attachMovie("Explosion", "expl" + bulletCount, 500 + bulletCount);
if (bDoScriptLevel3) {
if (level3Script[index][1] == "RED") {
randType = ((collectChance + bonusChance) + bigBonusChance) + 0.001;
} else if (level3Script[index][1] == "BLUE") {
randType = (collectChance + bonusChance) - 0.001;
} else if (level3Script[index][1] == "GREEN") {
randType = collectChance - 0.001;
}
} else {
randType = Math.random();
}
if (randType < collectChance) {
blt_mc.damage = 0;
blt_mc.bonus = 0;
blt_mc.col = "green";
blt_mc.gotoAndPlay("green");
expl_mc.gotoAndPlay("green");
blt_mc.bStay = false;
blt_mc.fadeOutSpeed = 100;
} else if (randType < (collectChance + bonusChance)) {
blt_mc.damage = -15;
blt_mc.bonus = _root.stok_mc.pickupValue;
blt_mc.col = "blue";
blt_mc.gotoAndPlay("blue");
expl_mc.gotoAndPlay("blue");
blt_mc.bStay = true;
blt_mc.fadeOutSpeed = bltFadeOut;
} else if (randType < ((collectChance + bonusChance) + bigBonusChance)) {
blt_mc.damage = -_root.stok_mc.maxHealth;
blt_mc.bonus = 10 * _root.stok_mc.pickupValue;
blt_mc.col = "gold";
blt_mc.gotoAndPlay("gold");
expl_mc.gotoAndPlay("gold");
blt_mc.bStay = true;
blt_mc.fadeOutSpeed = bltFadeOut;
} else if (randType < (((collectChance + bonusChance) + bigBonusChance) + birdChance)) {
blt_mc.removeMovieClip();
blt_mc = _root.attachMovie("TestBirdMC", "bllt" + bulletCount, 1000 + bulletCount);
blt_mc.xSpeed = 250;
blt_mc.ySpeed = 0;
blt_mc.mass = 0;
blt_mc.life = 20;
blt_mc.bLiving = true;
blt_mc.bTestSeat = true;
blt_mc.bDoHitTest = true;
blt_mc.damage = 30;
blt_mc.bonus = 0;
blt_mc.col = "bird";
expl_mc.gotoAndPlay("bird");
blt_mc.bStay = false;
blt_mc.fadeOutSpeed = 100;
} else {
blt_mc.damage = 30;
blt_mc.bonus = 0;
blt_mc.col = "red";
if (Math.random() < redStayChance) {
blt_mc.bStay = true;
expl_mc._xscale = 135;
expl_mc._yscale = 135;
blt_mc.gotoAndPlay("red2");
expl_mc.gotoAndPlay("red2");
} else {
blt_mc.bStay = false;
blt_mc.gotoAndPlay("red");
expl_mc.gotoAndPlay("red");
}
blt_mc.fadeOutSpeed = redFadeOutSpeed;
}
randHeight = Math.random();
blt_mc._y = (randHeight * 100) - 425;
if (bDoScriptLevel3) {
if ((index % 2) > 0) {
blt_mc._x = 150;
} else {
blt_mc._x = Stage.width - 150;
}
} else if (blt_mc.col == "gold") {
if (_root.stok_mc._x < (Stage.width / 2)) {
blt_mc._x = Stage.width - 80;
} else {
blt_mc._x = 80;
}
} else if (blt_mc.col == "bird") {
blt_mc._xscale = 70;
blt_mc._yscale = 70;
expl_mc._xscale = 70;
expl_mc._yscale = 70;
if (Math.random() > 0.5) {
blt_mc._x = -250;
expl_mc._x = 80 - _root.shooter_mc._x;
} else {
blt_mc._x = Stage.width + 250;
expl_mc._x = (Stage.width - 80) - _root.shooter_mc._x;
blt_mc._xscale = blt_mc._xscale * -1;
expl_mc._xscale = expl_mc._xscale * -1;
blt_mc.xSpeed = blt_mc.xSpeed * -1;
}
blt_mc._y = 305;
expl_mc._y = blt_mc._y - _root.shooter_mc._y;
} else {
blt_mc._x = (Math.random() * (Stage.width - 100)) + 50;
}
if (blt_mc.col != "bird") {
expl_mc._x = blt_mc._x - _root.shooter_mc._x;
expl_mc._y = 100 + (randHeight * 25);
}
bulletCount++;
bulletArray.push(blt_mc);
i++;
}
currentRow++;
spawnCntDwn = (Math.random() * 0.5) + betweenWaves;
} else {
currentRow = 0;
if (!bDoScriptLevel3) {
waveSize = waveSize + waveGrowth;
}
j = 0;
while (j < (waveSize / Math.round(maxBallsPerRow))) {
rowSize[j] = Math.min(Math.max(0, waveSize - (j * Math.round(maxBallsPerRow))), Math.round(maxBallsPerRow));
j++;
}
if (bDoScriptLevel3) {
index++;
spawnCntDwn = level3Script[index][0];
} else {
spawnCntDwn = spawnTimer;
}
}
}
betweenWaves = Math.max(betweenWaves - (deltaT * 0.002), 0.5);
spawnTimer = Math.max(spawnTimer - (deltaT * 0.005), 3);
maxBallsPerRow = Math.min(8, maxBallsPerRow + (deltaT * 0.005));
redStayChance = Math.min(maxRedStayChance, redStayChance + (deltaT * redStayChanceIncrease));
birdChance = Math.min(birdChance + (deltaT * birdChanceIncrease), birdChanceMax);
if (_root.difficulty <= 2) {
waveGrowth = Math.min(waveGrowth + (deltaT * 0.005), 1);
}
updateBullets();
}
Instance of Symbol 226 MovieClip "muteLine_mc" in Frame 148
onClipEvent (load) {
_visible = _root.bMute;
}
Frame 158
gotoAndStop (148);
Symbol 72 MovieClip [Rocket] Frame 13
gotoAndPlay ("red2");
Symbol 72 MovieClip [Rocket] Frame 18
gotoAndPlay ("red");
Symbol 72 MovieClip [Rocket] Frame 31
stop();
Symbol 72 MovieClip [Rocket] Frame 56
gotoAndPlay ("green");
Symbol 72 MovieClip [Rocket] Frame 73
stop();
Symbol 72 MovieClip [Rocket] Frame 79
gotoAndPlay ("blue");
Symbol 72 MovieClip [Rocket] Frame 105
stop();
Symbol 72 MovieClip [Rocket] Frame 106
stop();
Symbol 72 MovieClip [Rocket] Frame 146
stop();
Symbol 76 MovieClip [Explosion] Frame 40
stop();
Symbol 76 MovieClip [Explosion] Frame 80
stop();
Symbol 76 MovieClip [Explosion] Frame 120
stop();
Symbol 76 MovieClip [Explosion] Frame 160
stop();
Symbol 76 MovieClip [Explosion] Frame 200
stop();
Symbol 76 MovieClip [Explosion] Frame 240
stop();
Symbol 123 MovieClip [TestBirdMC] Frame 30
gotoAndPlay ("fly");
Symbol 123 MovieClip [TestBirdMC] Frame 60
stop();
Symbol 144 MovieClip Frame 1
stop();
Symbol 144 MovieClip Frame 2
stop();
Symbol 144 MovieClip Frame 3
stop();
Symbol 149 Button
on (press) {
getURL ("http://www.elektrafungi.com/", "_blank");
}
Symbol 153 Button
on (press) {
getURL ("http://www.freeonlineracinggames.info", "_blank");
}
Symbol 157 Button
on (press) {
getURL ("http://www.freesound.org/", "_blank");
}
Symbol 160 Button
on (press) {
play();
}
Symbol 184 MovieClip Frame 60
gotoAndPlay ("steady");
Symbol 184 MovieClip Frame 70
stop();
Symbol 184 MovieClip Frame 140
gotoAndPlay ("unsteady1");
Symbol 184 MovieClip Frame 194
gotoAndPlay ("unsteady2");
Symbol 184 MovieClip Frame 220
stop();
Symbol 194 Button
on (press) {
getURL ("http://www.flashgamelicense.com/view_account.php?account_id=6826", "_blank");
}
Symbol 500 MovieClip [__Packages.mochi.as2.MochiAd] Frame 0
class mochi.as2.MochiAd
{
function MochiAd () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function showPreGameAd(options) {
var _local26 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}, ad_progress:function (percent) {
}};
options = _parseOptions(options, _local26);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def") {
options.ad_started();
options.ad_finished();
return(undefined);
}
var clip = options.clip;
var _local22 = 11000;
var _local25 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local6 = chk.createEmptyMovieClip("_mochiad_bar", 4);
if (options.no_progress_bar) {
_local6._visible = false;
delete options.no_progress_bar;
} else {
_local6._x = 10;
_local6._y = _local13 - 20;
}
var _local21 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local23 = options.outline;
delete options.outline;
var _local5 = _local6.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local6.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local21);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local7 = _local6.createEmptyMovieClip("_outline", 3);
_local7.lineStyle(0, _local23, 100);
_local7.moveTo(0, 0);
_local7.lineTo(_local4 - 20, 0);
_local7.lineTo(_local4 - 20, 10);
_local7.lineTo(0, 10);
_local7.lineTo(0, 0);
chk.ad_msec = _local22;
chk.ad_timeout = _local25;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
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;
mochi.as2.MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
var sendHostProgress = false;
mc.lc.sendHostLoadProgress = function (lc_name) {
sendHostProgress = true;
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
mc.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local11 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local2 = (100 * _local8) / _local4;
var _local10 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local13 = Math.min(100, Math.min(_local2 || 0, _local10));
_local13 = Math.max(this.last_pcnt, _local13);
this.last_pcnt = _local13;
_local9._xscale = _local13;
options.ad_progress(_local13);
if (sendHostProgress) {
mochi.as2.MochiAd.containerNotify(clip, {id:"hostLoadPcnt", pcnt:_local2}, clip._mochiad._containerLCName);
if (_local2 == 100) {
sendHostProgress = false;
}
}
if (!chk.showing) {
var _local7 = _local11.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if ((_local5 > chk.ad_timeout) && (_local2 == 100)) {
options.ad_failed();
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showClickAwayAd(options) {
var _local9 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function () {
}, ad_finished:function () {
}, ad_loaded:function (width, height) {
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local9);
var clip = options.clip;
var _local8 = options.ad_timeout;
delete options.ad_timeout;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local4 = _getRes(options);
var _local10 = _local4[0];
var _local7 = _local4[1];
mc._x = _local10 * 0.5;
mc._y = _local7 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_timeout = _local8;
chk.started = getTimer();
chk.showing = false;
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
var _local20 = false;
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
_local2 = true;
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local2) {
delete this.onEnterFrame;
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
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;
mochi.as2.MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
mc.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showPreloaderAd(options) {
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
showPreGameAd(options);
}
static function showTimedAd(options) {
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
showInterLevelAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local7 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local7._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local7.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local7._mochiad_loaded = true;
if (_local7._url.indexOf("http") != 0) {
trace("[MochiAd] NOTE: Security Sandbox Violation errors below are normal");
}
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
mochi.as2.MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new Object();
var _local9 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local9;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local9);
_local6.lc = _local5;
_local4.lc = _local9;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".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);
}
containerNotify(clip, {id:"unload"}, clip._mochiad._containerLCName);
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
if (_local4.id == "test") {
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
}
return(_local4);
}
static function rpc(clip, callbackID, arg) {
switch (arg.id) {
case "setValue" :
setValue(clip, arg.objectName, arg.value);
break;
case "getValue" :
var _local4 = getValue(clip, arg.objectName);
containerRpcResult(clip, callbackID, _local4, clip._mochiad._containerLCName);
break;
case "runMethod" :
var _local3 = runMethod(clip, arg.method, arg.args);
containerRpcResult(clip, callbackID, _local3, clip._mochiad._containerLCName);
break;
default :
trace("[mochiads rpc] unknown rpc id: " + arg.id);
}
}
static function setValue(base, objectName, value) {
var _local2 = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
base[_local2[_local1]] = value;
}
static function getValue(base, objectName) {
var _local2 = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
return(base[_local2[_local1]]);
}
static function runMethod(base, methodName, argsArray) {
var _local2 = methodName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
if (typeof(base[_local2[_local1]]) == "function") {
return(base[_local2[_local1]].apply(base, argsArray));
}
return(undefined);
}
static function containerNotify(clip, args, lcName) {
var _local1 = clip._mochiad._mochiad_ctr.ad.app;
if (_local1.notify) {
_local1.notify(args);
} else {
new LocalConnection().send(lcName, "notify", args);
}
}
static function containerRpcResult(clip, callbackID, val, lcName) {
var _local1 = clip._mochiad._mochiad_ctr.ad.app;
if (_local1.rpcResult) {
_local1.rpcResult(callbackID, val);
} else {
new LocalConnection().send(lcName, "rpcResult", callbackID, val);
}
}
}
Symbol 501 MovieClip [__Packages.mochi.as2.MochiSync] Frame 0
class mochi.as2.MochiSync
{
var _syncContainer;
function MochiSync () {
_syncContainer = {};
}
function getProp(name) {
return(_syncContainer[name]);
}
function setProp(name, value) {
if (_syncContainer[name] == value) {
return(undefined);
}
_syncContainer[name] = value;
mochi.as2.MochiServices.send("sync_propUpdate", {name:name, value:value});
}
function triggerEvent(eventType, args) {
switch (eventType) {
case SYNC_REQUEST :
mochi.as2.MochiServices.send("sync_syncronize", _syncContainer);
break;
case SYNC_PROPERTY :
_syncContainer[args.name] = args.value;
}
}
static var SYNC_REQUEST = "SyncRequest";
static var SYNC_PROPERTY = "UpdateProperty";
}
Symbol 502 MovieClip [__Packages.mochi.as2.MochiServices] Frame 0
class mochi.as2.MochiServices
{
static var _id, _container, _clip, _sendChannelName, __get__comChannelName, onError, _listenChannel, _sendChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function get childClip() {
return(_clip);
}
static function getVersion() {
return("3.2 as2");
}
static function allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
warnID(id, false);
if ((!_connected) && (_clip == undefined)) {
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.as2.MochiServices.onError = onError;
} else if (mochi.as2.MochiServices.onError == undefined) {
mochi.as2.MochiServices.onError = function (errorCode) {
trace(errorCode);
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var _local6 = "_mochiservices_com_" + id;
var _local5 = new MovieClipLoader();
var _local3 = {};
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
if (urlOptions().servURL) {
_servURL = urlOptions().servURL;
}
var _local4 = _servURL + _services;
if (urlOptions().servicesURL) {
_local4 = urlOptions().servicesURL;
}
allowDomains(_local4);
_clip = clip.createEmptyMovieClip(_local6, 10336, false);
_listenChannelName = _listenChannelName + ((Math.floor(new Date().getTime()) + "_") + Math.floor(Math.random() * 99999));
listen();
if (_local3.waitInterval != null) {
clearInterval(_local3.waitInterval);
}
_local3.onLoadError = loadError;
_local3.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_local3.startTime = getTimer();
_local3.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.as2.MochiServices.disconnect();
mochi.as2.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_local3.waitInterval = setInterval(_local3, "wait", 1000);
_local5.addListener(_local3);
_local5.loadClip((((((_local4 + "?listenLC=") + _listenChannelName) + "&mochiad_options=") + escape(_root.mochiad_options)) + "&api_version=") + getVersion(), _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
return(_clip);
}
static function loadError(target_mc, errorCode, httpStatus) {
trace("MochiServices could not load.");
disconnect();
onError.apply(null, [errorCode]);
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.as2.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel._nextcallbackID = 0;
_listenChannel._callbacks = {};
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_clip, version:getVersion()});
_listenChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
_listenChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_listenChannel.onEvent = function (pkg) {
switch (pkg.target) {
case "events" :
mochi.as2.MochiEvents.triggerEvent(pkg.event, pkg.args);
break;
case "coins" :
mochi.as2.MochiCoins.triggerEvent(pkg.event, pkg.args);
break;
case "sync" :
mochi.as2.MochiServices.servicesSync.triggerEvent(pkg.event, pkg.args);
}
};
_listenChannel.onError = function () {
mochi.as2.MochiServices.onError.apply(null, ["IOError"]);
};
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _listenChannel._callbacks[_local1.callbackID];
}
delete _listenChannel._callbacks[_local1.callbackID];
if (error) {
handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ["NotConnected"]);
}
if ((args.options != null) && (args.options.onError != null)) {
args.options.onError.apply(null, ["NotConnected"]);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = "NotConnected";
if ((callbackObject != null) && (typeof(callbackMethod) == "string")) {
callbackObject[callbackMethod](args);
} else if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
trace("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + methodName);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
}
_listenChannel._callbacks[_listenChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_listenChannel._nextcallbackID++;
}
static function urlOptions() {
var _local5 = {};
if (_root.mochiad_options) {
var _local4 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2].split("=");
_local5[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local5);
}
static function warnID(bid, leaderboard) {
bid = bid.toLowerCase();
if (bid.length != 16) {
trace(("WARNING: " + (leaderboard ? "board" : "game")) + " ID is not the appropriate length");
return(undefined);
}
if (bid == "1e113c7239048b3f") {
if (leaderboard) {
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
}
return(undefined);
}
if (bid == "84993a1de4031cd8") {
if (leaderboard) {
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
}
return(undefined);
}
var _local1 = 0;
while (_local1 < bid.length) {
switch (bid.charAt(_local1)) {
case "0" :
case "1" :
case "2" :
case "3" :
case "4" :
case "5" :
case "6" :
case "7" :
case "8" :
case "9" :
case "a" :
case "b" :
case "c" :
case "d" :
case "e" :
case "f" :
break;
default :
trace("WARNING: Board ID contains illegal characters: " + bid);
return(undefined);
}
_local1++;
}
}
static function addLinkEvent(url, burl, btn, onClick) {
var timeout = 1500;
var t0 = getTimer();
var _local2 = new Object();
_local2.mav = getVersion();
_local2.swfv = btn.getSWFVersion() || 6;
_local2.swfurl = btn._url;
_local2.fv = System.capabilities.version;
_local2.os = System.capabilities.os;
_local2.lang = System.capabilities.language;
_local2.scres = (System.capabilities.screenResolutionX + "x") + System.capabilities.screenResolutionY;
var s = "?";
var _local3 = 0;
for (var _local6 in _local2) {
if (_local3 != 0) {
s = s + "&";
}
_local3++;
s = ((s + _local6) + "=") + escape(_local2[_local6]);
}
if (!(netupAttempted || (_connected))) {
var ping = btn.createEmptyMovieClip("ping", 777);
var _local7 = btn.createEmptyMovieClip("nettest", 778);
netupAttempted = true;
ping.loadMovie("http://x.mochiads.com/linkping.swf?t=" + getTimer());
_local7.onEnterFrame = function () {
if ((ping._totalframes > 0) && (ping._totalframes == ping._framesloaded)) {
delete this.onEnterFrame;
} else if ((getTimer() - t0) > timeout) {
delete this.onEnterFrame;
mochi.as2.MochiServices.netup = false;
}
};
}
var _local4 = btn.createEmptyMovieClip("clk", 1001);
_local4._alpha = 0;
_local4.beginFill(1044735);
_local4.moveTo(0, 0);
_local4.lineTo(0, btn._height);
_local4.lineTo(btn._width, btn._height);
_local4.lineTo(btn._width, 0);
_local4.lineTo(0, 0);
_local4.endFill();
_local4.onRelease = function () {
if (mochi.as2.MochiServices.netup) {
getURL (url + s, "_blank");
} else {
getURL (burl, "_blank");
}
if (onClick != undefined) {
onClick();
}
};
}
static function setContainer(clip) {
}
static function stayOnTop(clip) {
}
static var _servURL = "http://www.mochiads.com/static/lib/services/";
static var _services = "services.swf";
static var _mochiLC = "MochiLC.swf";
static var _listenChannelName = "__ms_";
static var _connecting = false;
static var _connected = false;
static var netup = true;
static var netupAttempted = false;
static var servicesSync = new mochi.as2.MochiSync();
}
Symbol 503 MovieClip [__Packages.mochi.as2.MochiEventDispatcher] Frame 0
class mochi.as2.MochiEventDispatcher
{
var eventTable;
function MochiEventDispatcher () {
eventTable = {};
}
function buildDelegate(thisObject, thatObject) {
var _local2 = {thisObject:thisObject, thatObject:thatObject};
if (thatObject != undefined) {
var funct = ((typeof(thatObject) == "string") ? (thisObject[thatObject]) : (thatObject));
_local2.delegate = function (args) {
funct.call(thisObject, args);
};
} else {
_local2.delegate = thisObject;
}
return(_local2);
}
function compareDelegate(d_A, d_B) {
if ((d_A.thisObject != d_B.thisObject) || (d_A.thatObject != d_B.thatObject)) {
return(false);
}
return(true);
}
function addEventListener(event, thisObject, thatObject) {
removeEventListener(event, thisObject, thatObject);
eventTable[event].push(buildDelegate(thisObject, thatObject));
}
function removeEventListener(event, thisObject, thatObject) {
var _local3 = buildDelegate(thisObject, thatObject);
if (eventTable[event] == undefined) {
eventTable[event] = [];
return(undefined);
}
for (var _local4 in eventTable[event]) {
if (!compareDelegate(eventTable[event][_local4], _local3)) {
continue;
}
eventTable[event].splice(Number(_local4), 1);
}
}
function triggerEvent(event, args) {
if (eventTable[event] == undefined) {
return(undefined);
}
for (var _local4 in eventTable[event]) {
eventTable[event][_local4].delegate(args);
}
}
}
Symbol 504 MovieClip [__Packages.mochi.as2.MochiEvents] Frame 0
class mochi.as2.MochiEvents
{
static var gameStart, levelStart;
function MochiEvents () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function startSession(achievementID) {
mochi.as2.MochiServices.send("events_beginSession", {achievementID:achievementID}, null, null);
}
static function trigger(kind, obj) {
if (obj == undefined) {
obj = {};
} else if (obj.kind != undefined) {
trace("WARNING: optional arguements package contains key 'id', it will be overwritten");
obj.kind = kind;
}
mochi.as2.MochiServices.send("events_triggerEvent", {eventObject:obj}, null, null);
}
static function setNotifications(clip, style) {
var _local2 = {};
for (var _local3 in style) {
_local2[_local3] = style[_local3];
}
_local2.clip = clip;
mochi.as2.MochiServices.send("events_setNotifications", _local2, null, null);
}
static function addEventListener(eventType, thisObject, thatObject) {
_dispatcher.addEventListener(eventType, thisObject, thatObject);
}
static function triggerEvent(eventType, args) {
_dispatcher.triggerEvent(eventType, args);
}
static function removeEventListener(eventType, thisObject, thatObject) {
_dispatcher.removeEventListener(eventType, thisObject, thatObject);
}
static function startGame() {
gameStart = new Date().getTime();
trigger("start_game");
}
static function endGame() {
var _local1 = new Date().getTime() - gameStart;
trigger("end_game", {time:_local1});
}
static function startLevel() {
levelStart = new Date().getTime();
trigger("start_level");
}
static function endLevel() {
var _local1 = new Date().getTime() - levelStart;
trigger("end_level", {time:_local1});
}
static var ACHIEVEMENT_RECEIVED = "AchievementReceived";
static var ALIGN_TOP_LEFT = "ALIGN_TL";
static var ALIGN_TOP = "ALIGN_T";
static var ALIGN_TOP_RIGHT = "ALIGN_TR";
static var ALIGN_LEFT = "ALIGN_L";
static var ALIGN_CENTER = "ALIGN_C";
static var ALIGN_RIGHT = "ALIGN_R";
static var ALIGN_BOTTOM_LEFT = "ALIGN_BL";
static var ALIGN_BOTTOM = "ALIGN_B";
static var ALIGN_BOTTOM_RIGHT = "ALIGN_BR";
static var FORMAT_SHORT = "ShortForm";
static var FORMAT_LONG = "LongForm";
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 505 MovieClip [__Packages.mochi.as2.MochiCoins] Frame 0
class mochi.as2.MochiCoins
{
function MochiCoins () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function showStore(options) {
mochi.as2.MochiServices.send("coins_showStore", {options:options}, null, null);
}
static function showItem(options) {
if ((options == undefined) || (typeof(options.item) != "string")) {
trace("ERROR: showItem call must pass an Object with an item key");
return(undefined);
}
mochi.as2.MochiServices.send("coins_showItem", {options:options}, null, null);
}
static function showVideo(options) {
if ((options == undefined) || (typeof(options.item) != "string")) {
trace("ERROR: showVideo call must pass an Object with an item key");
return(undefined);
}
mochi.as2.MochiServices.send("coins_showVideo", {options:options}, null, null);
}
static function showLoginWidget(options) {
mochi.as2.MochiServices.setContainer();
mochi.as2.MochiServices.stayOnTop();
mochi.as2.MochiServices.send("coins_showLoginWidget", {options:options});
}
static function hideLoginWidget() {
mochi.as2.MochiServices.send("coins_hideLoginWidget");
}
static function getStoreItems() {
mochi.as2.MochiServices.send("coins_getStoreItems");
}
static function getUserInfo() {
mochi.as2.MochiServices.send("coins_getUserInfo");
}
static function saveUserProperties(properties) {
mochi.as2.MochiServices.send("coins_saveUserProperties", properties);
}
static function addEventListener(eventType, delegate) {
_dispatcher.addEventListener(eventType, delegate);
}
static function triggerEvent(eventType, args) {
_dispatcher.triggerEvent(eventType, args);
}
static function removeEventListener(eventType, delegate) {
_dispatcher.removeEventListener(eventType, delegate);
}
static var LOGGED_IN = "LoggedIn";
static var LOGGED_OUT = "LoggedOut";
static var LOGIN_SHOW = "LoginShow";
static var LOGIN_HIDE = "LoginHide";
static var STORE_SHOW = "StoreShow";
static var STORE_HIDE = "StoreHide";
static var PROFILE_SHOW = "ProfileShow";
static var PROFILE_HIDE = "ProfileHide";
static var PROPERTIES_SAVED = "PropertySaved";
static var WIDGET_LOADED = "WidgetLoaded";
static var ITEM_OWNED = "ItemOwned";
static var ITEM_NEW = "ItemNew";
static var STORE_ITEMS = "StoreItems";
static var USER_INFO = "UserInfo";
static var ERROR = "Error";
static var IO_ERROR = "IOError";
static var NO_USER = "NoUser";
static var PROPERTIES_SIZE = "PropertiesSize";
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 506 MovieClip [__Packages.mochi.as2.MochiScores] Frame 0
class mochi.as2.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.as2.MochiServices.warnID(boardID, true);
mochi.as2.MochiScores.boardID = boardID;
mochi.as2.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
options.clip = mochi.as2.MochiServices.clip;
if ((options.clip != mochi.as2.MochiServices.__get__clip()) || (mochi.as2.MochiServices.__get__childClip()._target == undefined)) {
mochi.as2.MochiServices.disconnect();
trace("WARNING! This application is attempting to connect to MochiServices inside a showLeaderboard call!");
trace("make sure MochiServices.connect is called as early in the application runtime as possible.");
mochi.as2.MochiServices.connect(mochi.as2.MochiServices.__get__id(), options.clip);
}
delete options.clip;
if (options.name != null) {
if (typeof(options.name) == "object") {
if (options.name.text != undefined) {
options.name = options.name.text;
}
}
}
if (options.score != null) {
if (options.score instanceof TextField) {
if (options.score.text != undefined) {
options.score = options.score.text;
}
} else if (options.score instanceof mochi.as2.MochiDigits) {
options.score = options.score.value;
}
var _local1 = Number(options.score);
if (isNaN(_local1)) {
trace(("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'");
} else if ((_local1 == Number.NEGATIVE_INFINITY) || (_local1 == Number.POSITIVE_INFINITY)) {
trace(("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite");
} else {
if (Math.floor(_local1) != _local1) {
trace(("WARNING: Submitted score '" + options.score) + "' will be truncated");
}
options.score = _local1;
}
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.as2.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
mochi.as2.MochiServices.__get__clip().play();
};
}
if (options.onError != null) {
onError = options.onError;
} else {
onError = onClose;
}
if (options.boardID == null) {
if (boardID != null) {
options.boardID = boardID;
}
}
mochi.as2.MochiServices.warnID(options.boardID, true);
trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal");
mochi.as2.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function closeLeaderboard() {
mochi.as2.MochiServices.send("scores_closeLeaderboard");
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.as2.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
score = Number(score);
if (isNaN(score)) {
trace(("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is 'Not a Number'");
} else if ((score == Number.NEGATIVE_INFINITY) || (score == Number.POSITIVE_INFINITY)) {
trace(("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is an infinite");
} else {
if (Math.floor(score) != score) {
trace(("WARNING: Submitted score '" + String(score)) + "' will be truncated");
}
score = Number(score);
}
mochi.as2.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.as2.MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
static function scoresArrayToObjects(scores) {
var _local5 = {};
var _local1;
var _local4;
var _local2;
var _local6;
for (var _local8 in scores) {
if (typeof(scores[_local8]) == "object") {
if ((scores[_local8].cols != null) && (scores[_local8].rows != null)) {
_local5[_local8] = [];
_local2 = scores[_local8];
_local4 = 0;
while (_local4 < _local2.rows.length) {
_local6 = {};
_local1 = 0;
while (_local1 < _local2.cols.length) {
_local6[_local2.cols[_local1]] = _local2.rows[_local4][_local1];
_local1++;
}
_local5[_local8].push(_local6);
_local4++;
}
} else {
_local5[_local8] = {};
for (var _local7 in scores[_local8]) {
_local5[_local8][_local7] = scores[_local8][_local7];
}
}
} else {
_local5[_local8] = scores[_local8];
}
}
return(_local5);
}
static function doClose(args) {
if (args.error == true) {
if (args.errorCode == undefined) {
args.errorCode = "IOError";
}
onError.apply(null, [args.errorCode]);
} else {
onClose.apply();
}
}
}
Symbol 507 MovieClip [__Packages.mochi.as2.MochiDigits] Frame 0
class mochi.as2.MochiDigits
{
var Encoder, Fragment, Sibling;
function MochiDigits (digit, index) {
Encoder = 0;
setValue(digit, index);
}
function get value() {
return(Number(toString()));
}
function set value(v) {
setValue(v);
//return(value);
}
function addValue(v) {
value = value + v;
}
function setValue(digit, index) {
var _local3 = digit.toString();
if ((index == undefined) || (isNaN(index))) {
index = 0;
}
Fragment = _local3.charCodeAt(index++) ^ Encoder;
if (index < _local3.length) {
Sibling = new mochi.as2.MochiDigits(digit, index);
} else {
Sibling = null;
}
reencode();
}
function reencode() {
var _local2 = int(2147483647 * Math.random());
Fragment = Fragment ^ (_local2 ^ Encoder);
Encoder = _local2;
}
function toString() {
var _local2 = String.fromCharCode(Fragment ^ Encoder);
return(((Sibling != null) ? (_local2.concat(Sibling.toString())) : (_local2)));
}
}
Symbol 200 Button
on (press) {
getURL ("http://www.google.com", "_blank");
}
Symbol 218 Button
on (press) {
_root.user.clear();
_root.credits = 10000;
}
Symbol 224 Button
on (press) {
_root.bMute = !_root.bMute;
_root.muteLine_mc._alpha = (_root.bMute ? 100 : 0);
}
Symbol 229 Button
on (press) {
urlStart = _url.indexOf("://") + 3;
urlEnd = _url.indexOf("/", urlStart);
domain = _url.substring(urlStart, urlEnd);
LastDot = domain.lastIndexOf(".") - 1;
domEnd = domain.lastIndexOf(".", LastDot) + 1;
domain = domain.substring(domEnd, domain.length);
if ((((true || (domain == "")) || (domain == "flashgamelicense.com")) || (domain == "progamestudios.com")) || (domain == "mochiads.com")) {
_root.LevelSelect();
} else {
trace(domain);
}
}
on (rollOver) {
_root.display_txt.text = "Become the Unicycle King by staying balanced as long as possible and setting a new highscore \nAvoid red balls and collect blue ones to regenerate health \nCollect green balls to unlock new outfits for your character";
}
on (rollOut) {
_root.display_txt.text = "";
}
Symbol 232 Button
on (press) {
if (_root.difficulty == 1) {
var o = {n:[7, 9, 0, 3, 10, 2, 2, 11, 0, 6, 11, 6, 14, 3, 12, 1], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
} else if (_root.difficulty == 2) {
var o = {n:[8, 6, 4, 8, 7, 11, 12, 3, 8, 0, 0, 4, 7, 14, 12, 0], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
} else {
var o = {n:[9, 1, 4, 11, 10, 4, 15, 15, 13, 1, 0, 15, 12, 12, 10, 11], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
}
var boardID = o.f(0, "");
mochi.as2.MochiScores.showLeaderboard({boardID:boardID, res:"600x600", width:400, height:300, preloaderDisplay:false, onClose:function () {
_root.loading_mc._alpha = 0;
}});
_root.loading_mc._alpha = 100;
}
on (rollOver) {
_root.display_txt.text = "View the highscores for the current difficulty setting. Are you today's King of Unicycling?";
}
on (rollOut) {
_root.display_txt.text = "";
}
Symbol 235 Button
on (press) {
_root.gotoAndStop("credits");
}
on (rollOver) {
_root.display_txt.text = "See who are responsible for creating this awesome game!";
}
on (rollOut) {
_root.display_txt.text = "";
}
Symbol 238 Button
on (rollOver) {
_root.display_txt.autoSize;
_root.display_txt.text = "The goal is to stay balanced as long as possible while avoiding falling obstacles. ";
_root.display_txt.text = _root.display_txt.text + "The key to staying in balance is to have the wheel directly under your hips, either by moving the wheel, your hips, or both at the same time";
_root.display_txt.text = _root.display_txt.text + "\nDefault controls: Left and right to move wheel, A and D to move hips.";
}
on (press) {
_root.ViewInstructions();
}
on (rollOut) {
_root.display_txt.text = "";
}
Symbol 241 Button
on (press) {
_root.gotoAndStop("achievements");
}
on (rollOver) {
_root.display_txt.text = "View the medals you achieved on your path to becoming the Unicycle King";
}
on (rollOut) {
_root.display_txt.text = "";
}
Symbol 244 Button
on (press) {
_root.gotoAndStop("options");
_root.DisplayItems();
_root.UpdateBody();
_root.UpdateHats();
_root.UpdateHair();
_root.UpdateFace();
}
on (rollOver) {
_root.display_txt.text = "Use credits to customize your character with various skins, hairstyles, outfits and accessoires \nYou can get credits by collecting green balls in Time Attack";
}
on (rollOut) {
_root.display_txt.text = "";
}
Symbol 249 Button
on (press) {
_root.gotoAndStop("settings");
}
on (rollOver) {
_root.display_txt.text = "Change the control settings. Default: left and right arrow keys for wheel movement, A and D for hip control left and right";
}
on (rollOut) {
_root.display_txt.text = "";
}
Symbol 251 Button
on (press) {
getURL ("http://www.freeonlineracinggames.info", "_blank");
}
Symbol 256 Button
on (press) {
if (_root.pass_txt.text eq "bonus") {
_root.unlockedFaces = _root.allFaces.length;
_root.unlockedBodies = _root.allBodies.length;
_root.unlockedHats = _root.allHats.length;
_root.unlockedHairs = _root.allHairs.length;
_root.faces = _root.allFaces;
_root.hairs = _root.allHairs;
_root.hats = _root.allHats;
_root.bodies = _root.allBodies;
_root.congrats_mc._alpha = 100;
_root.face_mc = UpdateFace();
_root.hair_mc = UpdateHair();
_root.hat_mc = UpdateHats();
_root.body_mc = UpdateBody();
_root.SaveUserData();
}
}
Symbol 264 Button
on (press) {
gotoAndStop ("main");
_root.currentBody = _root.BackupCurrentBody;
_root.currentHat = _root.BackupCurrentHat;
_root.currentHair = _root.BackupCurrentHair;
_root.currentFace = _root.BackupCurrentFace;
_root.UpdateBody();
_root.UpdateHats();
_root.UpdateHair();
_root.UpdateFace();
_root.RemovePreview();
_root.ClearItems();
}
Symbol 267 Button
on (press) {
gotoAndStop ("main");
_root.UpdateBody();
_root.UpdateHats();
_root.UpdateHair();
_root.UpdateFace();
_root.RemovePreview();
_root.ClearItems();
_root.SaveUserData();
}
Symbol 275 Button
on (press) {
_root.BuyItem(0);
}
on (rollOver) {
if (currentItems[0].naam == undefined) {
_root.item_txt.text = "";
} else {
_root.item_txt.text = (_root.currentItems[0].naam + newline) + _root.currentItems[0].cost;
}
_root.bought_txt.text = "";
}
on (rollOut) {
_root.item_txt.text = "";
_root.bought_txt.text = "";
}
Symbol 276 Button
on (press) {
_root.BuyItem(1);
}
on (rollOver) {
if (currentItems[1].naam == undefined) {
_root.item_txt.text = "";
} else {
_root.item_txt.text = (_root.currentItems[1].naam + newline) + _root.currentItems[1].cost;
}
_root.bought_txt.text = "";
}
on (rollOut) {
_root.item_txt.text = "";
_root.bought_txt.text = "";
}
Symbol 277 Button
on (press) {
_root.BuyItem(2);
}
on (rollOver) {
if (currentItems[2].naam == undefined) {
_root.item_txt.text = "";
} else {
_root.item_txt.text = (_root.currentItems[2].naam + newline) + _root.currentItems[2].cost;
}
_root.bought_txt.text = "";
}
on (rollOut) {
_root.item_txt.text = "";
_root.bought_txt.text = "";
}
Symbol 278 Button
on (press) {
_root.BuyItem(3);
}
on (rollOver) {
if (currentItems[3].naam == undefined) {
_root.item_txt.text = "";
} else {
_root.item_txt.text = (_root.currentItems[3].naam + newline) + _root.currentItems[3].cost;
}
_root.bought_txt.text = "";
}
on (rollOut) {
_root.item_txt.text = "";
_root.bought_txt.text = "";
}
Symbol 279 Button
on (press) {
_root.BuyItem(4);
}
on (rollOver) {
if (currentItems[4].naam == undefined) {
_root.item_txt.text = "";
} else {
_root.item_txt.text = (_root.currentItems[4].naam + newline) + _root.currentItems[4].cost;
}
_root.bought_txt.text = "";
}
on (rollOut) {
_root.item_txt.text = "";
_root.bought_txt.text = "";
}
Symbol 280 Button
on (press) {
_root.BuyItem(5);
}
on (rollOver) {
if (currentItems[5].naam == undefined) {
_root.item_txt.text = "";
} else {
_root.item_txt.text = (_root.currentItems[5].naam + newline) + _root.currentItems[5].cost;
}
_root.bought_txt.text = "";
}
on (rollOut) {
_root.item_txt.text = "";
_root.bought_txt.text = "";
}
Symbol 284 Button
on (press) {
_root.NextHair();
_root.UpdateHair();
}
Symbol 285 Button
on (press) {
_root.NextFace();
_root.UpdateFace();
}
Symbol 288 Button
on (press) {
_root.currentHair--;
if (_root.currentHair < 0) {
_root.currentHair = _root.hairs.length - 1;
}
_root.UpdateHair();
}
Symbol 289 Button
on (press) {
_root.currentHat--;
if (_root.currentHat < 0) {
_root.currentHat = _root.hats.length - 1;
}
_root.UpdateHats();
}
Symbol 290 Button
on (press) {
_root.currentFace--;
if (_root.currentFace < 0) {
_root.currentFace = _root.faces.length - 1;
}
_root.UpdateFace();
}
Symbol 291 Button
on (press) {
_root.NextHat();
_root.UpdateHats();
}
Symbol 292 Button
on (press) {
_root.currentBody--;
if (_root.currentBody < 0) {
_root.currentBody = _root.bodies.length - 1;
}
_root.UpdateBody();
}
Symbol 293 Button
on (press) {
_root.NextBody();
_root.UpdateBody();
}
Symbol 294 Button
on (press) {
_root.PrevItems();
}
Symbol 295 Button
on (press) {
_root.NextItems();
}
Symbol 298 Button
on (press) {
gotoAndStop ("main");
}
Symbol 305 Button
on (press) {
_root.StartLevel1();
}
Symbol 308 Button
on (press) {
_root.bPlayedLevel2 = false;
_root.StartLevel2();
}
Symbol 311 Button
on (press) {
_root.bPlayedLevel3 = false;
_root.StartLevel3();
}
Symbol 314 Button
on (press) {
_root.gotoAndStop("unicycle");
_root.pre_unicycle = _root.unicycle;
_root.UpdateUnicycle();
}
Symbol 318 Button
on (press) {
_root.NextBackground();
}
Symbol 323 Button
on (press) {
if (_root.difficulty == 1) {
if (_root.bUnlockedMedium) {
_root.difficulty = 2;
}
} else if (_root.difficulty == 2) {
if (_root.bUnlockedHard) {
_root.difficulty = 3;
} else {
_root.difficulty = 1;
}
} else {
_root.difficulty = 1;
}
_root.SetDifficultyText();
}
on (rollOver) {
_root.display_txt.text = "Change the difficulty \nCollect medals to unlock harder difficulty modes \nHarder difficulties offer you more challenges, but with greater rewards!";
}
on (rollOut) {
_root.display_txt.text = "";
}
Symbol 338 MovieClip Frame 1
stop();
Symbol 338 MovieClip Frame 2
stop();
Symbol 353 MovieClip Frame 1
stop();
Symbol 353 MovieClip Frame 5
stop();
Symbol 353 MovieClip Frame 10
stop();
Symbol 356 Button
on (press) {
gotoAndStop ("main");
}
Symbol 357 Button
on (press) {
if (_root.pre_unicycle > 1) {
if (!_root.bUnlockedUnicycle2) {
_root.pre_unicycle = _root.unicycle;
} else if ((_root.pre_unicycle == 3) && (!_root.bUnlockedUnicycle3)) {
_root.pre_unicycle = _root.unicycle;
}
}
_root.unicycle = _root.pre_unicycle;
_root.SaveUserData();
_root.StartTimeAttack();
}
Symbol 358 Button
on (press) {
_root.pre_unicycle++;
if (_root.pre_unicycle > 3) {
_root.pre_unicycle = 1;
}
_root.UpdateUnicycle();
}
Symbol 359 Button
on (press) {
_root.pre_unicycle--;
if (_root.pre_unicycle < 1) {
_root.pre_unicycle = 3;
}
_root.UpdateUnicycle();
}
Symbol 375 Button
on (press) {
gotoAndStop ("main");
_root.InputLeftCode = _root.BackupInputLeftCode;
_root.InputRightCode = _root.BackupInputRightCode;
_root.InputHipLeftCode = _root.BackupInputHipLeftCode;
_root.InputHipRightCode = _root.BackupInputHipRightCode;
}
Symbol 376 Button
on (press) {
gotoAndStop ("main");
_root.SaveUserData();
}
Symbol 381 Button
on (press) {
_root.WaitForInput("LEFT");
}
Symbol 384 Button
on (press) {
_root.WaitForInput("RIGHT");
}
Symbol 387 Button
on (press) {
_root.WaitForInput("HIPLEFT");
}
Symbol 390 Button
on (press) {
_root.WaitForInput("HIPRIGHT");
}
Symbol 397 MovieClip Frame 1
stop();
Symbol 397 MovieClip Frame 2
stop();
Symbol 397 MovieClip Frame 3
stop();
Symbol 400 Button
on (rollOver) {
_root.instr_txt.autoSize;
_root.instr_txt.text = "This displays your health";
_root.instr_txt.text = _root.instr_txt.text + "\nWhen this is empty, you'll automatically fall down";
}
on (rollOut) {
_root.instr_txt.text = "";
}
Symbol 413 Button
on (press) {
gotoAndStop ("main");
}
on (rollOver) {
_root.instr_txt.autoSize;
_root.instr_txt.text = "\nGo back to the main menu";
}
on (rollOut) {
_root.instr_txt.text = "";
}
Symbol 415 Button
on (rollOver) {
_root.instr_txt.autoSize;
_root.instr_txt.text = "Getting hit by a red ball decreases your health";
_root.instr_txt.text = _root.instr_txt.text + "\nOh, and watch out for flashing red balls, they will stay on the bridge for a while!";
}
on (rollOut) {
_root.instr_txt.text = "";
}
Symbol 416 Button
on (rollOver) {
_root.instr_txt.autoSize;
_root.instr_txt.text = "Green balls give you credits, which you can use to by new characters, outfits, accessories, powerups and backgrounds";
}
on (rollOut) {
_root.instr_txt.text = "";
}
Symbol 417 Button
on (rollOver) {
_root.instr_txt.autoSize;
_root.instr_txt.text = "Catching or picking up blue balls recovers your health and gives you bonus points";
}
on (rollOut) {
_root.instr_txt.text = "";
}
Symbol 418 Button
on (rollOver) {
_root.instr_txt.autoSize;
_root.instr_txt.text = "Catching or picking up gold balls fully recovers your health and gives you a lot of bonus points";
}
on (rollOut) {
_root.instr_txt.text = "";
}
Symbol 420 Button
on (rollOver) {
_root.instr_txt.autoSize;
_root.instr_txt.text = "Don't go outside the screen area";
_root.instr_txt.text = _root.instr_txt.text + "\nStaying there too long means game over";
}
on (rollOut) {
_root.instr_txt.text = "";
}
Symbol 421 Button
on (rollOver) {
_root.instr_txt.autoSize;
_root.instr_txt.text = "When your health reaches zero, or when you're out of balance, you'll fall down";
_root.instr_txt.text = _root.instr_txt.text + "\nTry to stay up as long as possible, to get the highest score!";
}
on (rollOut) {
_root.instr_txt.text = "";
}
Symbol 422 Button
on (rollOver) {
_root.instr_txt.autoSize;
_root.instr_txt.text = "Birds fly horizontally across the screen\nWatch out for them, you'll lose health when they hit you";
_root.instr_txt.text = _root.instr_txt.text + "\nGo underneath them by letting yourself get out of balance a bit, but not too much!";
}
on (rollOut) {
_root.instr_txt.text = "";
}
Symbol 424 Button
on (rollOver) {
_root.instr_txt.autoSize;
_root.instr_txt.text = "Use the arrow keys for movement of the wheel. A and D moves your hips (default settings)";
_root.instr_txt.text = _root.instr_txt.text + "\nUse both normal movement and hip control to fully control your unicycle";
}
on (rollOut) {
_root.instr_txt.text = "";
}
Symbol 435 MovieClip Frame 1
stop();
Symbol 435 MovieClip Frame 90
stop();
Symbol 439 MovieClip Frame 1
stop();
Symbol 449 MovieClip Frame 57
gotoAndPlay ("normal");
Symbol 456 MovieClip Frame 1
stop();
Symbol 461 MovieClip Frame 1
stop();
Symbol 469 Button
on (press) {
_root.stok_mc.QuitToMenu();
}
Symbol 471 Button
on (press) {
_root.gameover_mc.loading_mc._alpha = 100;
if (_root.stok_mc.bTimeAttackMode) {
trace("TA");
if (_root.difficulty == 1) {
var o = {n:[7, 9, 0, 3, 10, 2, 2, 11, 0, 6, 11, 6, 14, 3, 12, 1], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
} else if (_root.difficulty == 2) {
var o = {n:[8, 6, 4, 8, 7, 11, 12, 3, 8, 0, 0, 4, 7, 14, 12, 0], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
} else {
var o = {n:[9, 1, 4, 11, 10, 4, 15, 15, 13, 1, 0, 15, 12, 12, 10, 11], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
}
} else if (_root.stok_mc.bCollectionMode) {
trace("CO");
var o = {n:[2, 5, 7, 10, 11, 14, 4, 15, 14, 8, 2, 14, 2, 4, 2, 9], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
} else {
trace("ERRROOORRRR!!");
}
var mBoardID = o.f(0, "");
mochi.as2.MochiScores.showLeaderboard({boardID:mBoardID, score:_root.stok_mc.totalScore, clip:_root, res:"600x600", width:400, height:300, preloaderDisplay:false, onClose:function () {
_root.gameover_mc.loading_mc._alpha = 0;
}});
}
Symbol 481 Button
on (press) {
_root.stok_mc.GotoNextLevel();
}
on (keyPress "<Space>") {
_root.stok_mc.GotoNextLevel();
}
Symbol 483 MovieClip Frame 1
stop();
Symbol 483 MovieClip Frame 55
stop();
Instance of Symbol 476 MovieClip "retry_btn" in Symbol 483 MovieClip Frame 55
on (press) {
_root.stok_mc.Quit();
}
on (keyPress "<Space>") {
_root.stok_mc.Quit();
}
Instance of Symbol 212 MovieClip "loading_mc" in Symbol 483 MovieClip Frame 55
onClipEvent (load) {
_alpha = 0;
}
Symbol 483 MovieClip Frame 80
stop();
Instance of Symbol 476 MovieClip "retry_btn" in Symbol 483 MovieClip Frame 80
on (press) {
_root.stok_mc.Quit();
}
Symbol 483 MovieClip Frame 135
stop();
Instance of Symbol 476 MovieClip "retry_btn" in Symbol 483 MovieClip Frame 135
on (press) {
_root.stok_mc.Quit();
}
on (keyPress "<Space>") {
_root.stok_mc.Quit();
}
Symbol 489 MovieClip Frame 1
stop();
Symbol 489 MovieClip Frame 30
stop();
Symbol 490 MovieClip Frame 1
stop();
Symbol 490 MovieClip Frame 30
stop();
Symbol 491 MovieClip Frame 1
stop();
Symbol 491 MovieClip Frame 30
stop();
Symbol 492 MovieClip Frame 1
stop();
Symbol 492 MovieClip Frame 30
stop();
Symbol 494 MovieClip Frame 1
stop();
Symbol 494 MovieClip Frame 30
stop();
Symbol 495 Button
on (press) {
_root.bMute = !_root.bMute;
_root.muteLine_mc._visible = _root.bMute;
if (_root.bMute) {
_root.stok_mc.Music.stop();
} else if (!_root.stok_mc.bGameOver) {
_root.stok_mc.Music = new Sound(_root.stok_mc);
_root.stok_mc.Music.attachSound("music");
_root.stok_mc.Music.setVolume(100);
_root.stok_mc.Music.start(0, 100);
}
}
Symbol 498 Button
on (press) {
getURL ("http://www.freeonlineracinggames.info", "_blank");
}