Frame 1
Stage.showMenu = false;
var MochiAd = {getVersion:function () {
return("2.3");
}, showPreGameAd:function (options) {
var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochAd] 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) {
}};
options = MochiAd._parseOptions(options, _local27);
if ("5cc6f7dfb67f2f08341c831480f7c2a7".length == 0) {
options.ad_started();
options.ad_finished();
return(undefined);
}
var clip = options.clip;
var _local23 = 11000;
var _local26 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.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 = MochiAd._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 _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local7._x = 10;
_local7._y = _local13 - 20;
var _local22 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local7.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 = _local7.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local22);
_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 _local6 = _local7.createEmptyMovieClip("_outline", 3);
_local6.lineStyle(0, _local24, 100);
_local6.moveTo(0, 0);
_local6.lineTo(_local4 - 20, 0);
_local6.lineTo(_local4 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
chk.ad_msec = _local23;
chk.ad_timeout = _local26;
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;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
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;
}
}
};
}, showInterLevelAd:function (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("[MochAd] 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) {
}};
options = MochiAd._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 (!MochiAd.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 = MochiAd._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;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
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;
}
}
};
}, showTimedAd:function (options) {
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
MochiAd.showInterLevelAd(options);
}, showPreloaderAd:function (options) {
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
MochiAd.showPreGameAd(options);
}, _allowDomains:function (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);
}, _loadCommunicator:function (options) {
var _local26 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, _local26);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = MochiAd.getVersion();
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!MochiAd._isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
MochiAd._allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local25 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local25);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb_arg) {
var _local8 = parseInt(cb_arg);
var _local4 = this._callbacks[_local8];
if (!_local4) {
return(undefined);
}
delete this._callbacks[_local8];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}, fetchHighScores:function (options, callbackObj, callbackMethod) {
var _local1 = MochiAd._loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}, sendHighScore:function (options, callbackObj, callbackMethod) {
var _local1 = MochiAd._loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}, load:function (options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = MochiAd.getVersion();
var _local9 = options.clip;
if (!MochiAd._isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = MochiAd._getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = MochiAd._allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}, unload:function (clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}, _isNetworkAvailable:function () {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}, _getRes:function (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]);
}, _parseOptions:function (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);
}, _:null};
MochiAd.showPreGameAd({id:"fbe3c16dd3fba5a4", res:"550x400", background:8873283, color:16777215, outline:5282574, no_bg:true});
Frame 8
function updatePlayed() {
send_lv = new LoadVars();
take_lv = new LoadVars();
send_lv.game = "robotrun";
take_lv.onLoad = function (success) {
if (success) {
}
};
send_lv.sendAndLoad("http://www.axis-games.com/addplayed.php", take_lv, "POST");
}
updatePlayed();
stop();
Frame 15
if (_root.login) {
login_status = "You are logged in";
} else {
login_status = "You are NOT logged in.";
}
Frame 32
function setRockPos() {
var _local1 = 0;
while (_local1 <= 9) {
rockTime[_local1] = 55;
rockPos[_local1] = random(400) + 150;
_local1++;
}
_local1 = 0;
while (_local1 <= 9) {
rockTime[_local1 + 10] = 30;
rockPos[_local1 + 10] = 150 + (40 * _local1);
_local1++;
}
_local1 = 20;
while (_local1 <= 29) {
rockTime[_local1] = 40;
rockPos[_local1] = random(400) + 150;
_local1++;
}
_local1 = 0;
while (_local1 <= 9) {
rockTime[_local1 + 30] = 20;
rockPos[_local1 + 30] = 550 - (40 * _local1);
_local1++;
}
_local1 = 40;
while (_local1 <= 49) {
rockTime[_local1] = 30;
rockPos[_local1] = random(400) + 150;
_local1++;
}
_local1 = 0;
while (_local1 <= 9) {
rockTime[_local1 + 50] = 15;
rockPos[_local1 + 50] = 150 + (40 * _local1);
_local1++;
}
_local1 = 0;
while (_local1 <= 9) {
rockTime[_local1 + 60] = 15;
rockPos[_local1 + 60] = 550 - (40 * _local1);
_local1++;
}
_local1 = 0;
while (_local1 <= 9) {
rockTime[_local1 + 70] = 10;
rockPos[_local1 + 70] = 150 + (40 * _local1);
_local1++;
}
_local1 = 0;
while (_local1 <= 9) {
rockTime[_local1 + 80] = 10;
rockPos[_local1 + 80] = 550 - (40 * _local1);
_local1++;
}
_local1 = 0;
while (_local1 <= 9) {
if ((_local1 % 2) == 0) {
rockTime[_local1 + 90] = 10;
rockPos[_local1 + 90] = 100 + (40 * _local1);
} else {
rockTime[_local1 + 90] = 10;
rockPos[_local1 + 90] = 550 - (40 * _local1);
}
_local1++;
}
_local1 = 0;
while (_local1 <= 9) {
if ((_local1 % 2) == 0) {
rockTime[_local1 + 100] = 10;
rockPos[_local1 + 100] = 550 - (40 * _local1);
} else {
rockTime[_local1 + 100] = 10;
rockPos[_local1 + 100] = 100 + (40 * _local1);
}
_local1++;
}
_local1 = 0;
while (_local1 <= 20) {
rockTime[_local1 + 110] = 20;
rockPos[_local1 + 110] = random(400) + 150;
_local1++;
}
_local1 = 0;
while (_local1 <= 500) {
rockTime[_local1 + 130] = 15;
rockPos[_local1 + 130] = random(400) + 150;
_local1++;
}
}
function checkFire() {
if (_root.hero.hitTest(_root.fire.inside)) {
health = health - 2;
if (health <= 0) {
gameOver = true;
_root.fire._visible = false;
_root.deathThing._visible = false;
clearBoxes();
}
_root.hpBar._xscale = (health / 100) * 100;
}
}
function clearBoxes() {
clearInterval(myNum);
var _local2 = 0;
while (_local2 < boxes.length) {
var _local5 = boxes[_local2];
_root[_local5].removeMovieClip();
_local2++;
}
_local2 = 0;
while (_local2 < upgrades.length) {
var _local4 = upgrades[_local2];
_root[_local4].removeMovieClip();
_local2++;
}
_local2 = ropeNum - 15;
while (_local2 <= (ropeNum + 1)) {
var _local3 = "rope" + _local2;
_root[_local3].removeMovieClip();
_local2++;
}
_root.fadeScreen.gotoAndPlay(2);
}
function playSound(yes) {
if (soundOn) {
_root.soundFX.gotoAndPlay(yes);
}
}
function rockTime() {
gameTimer++;
if (gameTimer == rockTime[ropeNum]) {
gameTimer = 0;
var _local2 = "rope" + ropeNum;
_root.attachMovie("rope", _local2, 1000 + ropeNum);
if (ropeNum < 110) {
_root[_local2]._x = rockPos[ropeNum];
} else {
_root[_local2]._x = random(400) + 150;
}
_root[_local2]._y = -10;
ropeNum++;
if (ropeNum == 50) {
stopAllSounds();
playSound("cBelt");
playSound("alarm");
playSound("loop2");
}
}
}
function stunHero() {
if (shield == false) {
playSound("stun");
health = health - 5;
if (health <= 0) {
gameOver = true;
attachBox.clearInterval();
_root.fire._visible = false;
_root.deathThing._visible = false;
clearBoxes();
}
_root.hpBar._xscale = (health / 100) * 100;
heroStun = true;
stunTimer = 0;
if (isJumping && (gravity < jumpSpeed)) {
gravity = jumpSpeed;
}
} else {
shield = false;
_root.hero.shield._visible = false;
}
}
function attachBox() {
nextUpgrade++;
if ((nextUpgrade % 15) == 0) {
dropPU = true;
}
score = score + (4 + Math.round(boxNumber / 10));
boxNumber++;
var _local2 = "box" + boxNumber;
var _local3 = random(3) + 2;
var _local4 = "box" + _local3;
_root.attachMovie(_local4, _local2, 50000 + boxNumber);
_root[_local2]._x = 560;
_root[_local2]._y = (_root.bg.ground._y - _root[_local2]._height) + 10;
boxes[boxes.length] = _local2;
}
function explodeRock(xPos, yPos) {
rockNumber++;
var _local2 = "rock" + rockNumber;
_root.attachMovie("rockBreak", _local2, 150000 + rockNumber);
_root[_local2]._x = xPos;
_root[_local2]._y = yPos;
}
function dropUpgrade(xPos, yPos) {
if (dropPU == true) {
dropPU = false;
powerUpNum++;
var _local3 = "pu" + (random(3) + 1);
var _local2 = "powerUp" + powerUpNum;
_root.attachMovie(_local3, _local2, 650000 + powerUpNum);
_root[_local2]._x = xPos;
_root[_local2]._y = yPos;
upgrades[upgrades.length] = _local2;
}
}
function moveBox() {
var _local3 = 0;
while (_local3 < upgrades.length) {
var _local4 = upgrades[_local3];
_root[_local4]._x = _root[_local4]._x - boxSpeed;
if (_root[_local4]._x < 0) {
_root[_local4].removeMovieClip();
upgrades.splice(i, 1);
_root[upgrades[_local3]]._x = _root[upgrades[_local3]]._x - boxSpeed;
}
_local3++;
}
var i = 0;
while (i < boxes.length) {
var _local2 = boxes[i];
if (_root.hero.hitArea.hitTest(_root[_local2])) {
if (isJumping) {
if (((gravity > jumpSpeed) && ((_root.hero._y - 10) < _root[_local2]._y)) && (onBox == false)) {
playSound("land");
onBox = true;
isJumping = false;
_root.hero._y = _root[_local2]._y;
savedBox = _local2;
gravity = 0;
} else if (_root.hero._x < _root[_local2]._x) {
onBox = false;
_root.hero._x = (_root[_local2]._x - (_root.hero._width / 2)) - (_root[_local2]._width / 2);
}
} else if (onBox == false) {
if (_root.hero._x < _root[_local2]._x) {
_root.hero._x = (_root[_local2]._x - (_root.hero._width / 2)) - (_root[_local2]._width / 2);
} else if (Key.isDown(37) && (heroStun == false)) {
_root.hero._x = _root[_local2]._x + (_root.hero._width / 2);
}
}
} else if (onBox && (_local2 == savedBox)) {
isJumping = true;
gravity = jumpSpeed + 2;
onBox = false;
}
_root[_local2]._x = _root[_local2]._x - boxSpeed;
if (_root[_local2]._x < 0) {
_root[_local2].removeMovieClip();
boxes.splice(i, 1);
_root[boxes[i]]._x = _root[boxes[i]]._x - boxSpeed;
}
i++;
}
}
function moveHero() {
if (jumpUpgrade) {
jumpTimer++;
if (jumpTimer == 150) {
jumpTimer = 0;
jumpUpgrade = false;
jumpSpeed = jumpSpeed - 5;
_root.hero.boot._visible = false;
}
}
if (onBox || ((isJumping == false) && (_root.hero._x > 15))) {
_root.hero._x = _root.hero._x - boxSpeed;
} else if (_root.hero._x <= 15) {
health = health - 2;
_root.hpBar._xscale = (health / 100) * 100;
if (health <= 0) {
gameOver = true;
attachBox.clearInterval();
_root.fire._visible = false;
_root.deathThing._visible = false;
clearBoxes();
}
}
if (Key.isDown(39) && (heroStun == false)) {
_root.hero.gotoAndStop("run");
_root.hero._xscale = 100;
if (onBox && (_root.hero._x < 535)) {
_root.hero._x = _root.hero._x + (heroSpeed + boxSpeed);
} else if (_root.hero._x < 535) {
_root.hero._x = _root.hero._x + heroSpeed;
}
} else if (Key.isDown(37) && (heroStun == false)) {
_root.hero.gotoAndStop("run");
_root.hero._xscale = -100;
if (onBox && (_root.hero._x > 15)) {
_root.hero._x = _root.hero._x - heroSpeed;
} else if (_root.hero._x > 15) {
_root.hero._x = _root.hero._x - heroSpeed;
}
} else if (((!Key.isDown(39)) && (!Key.isDown(37))) && (heroStun == false)) {
_root.hero.gotoAndStop("stand");
}
if ((Key.isDown(32) && (isJumping == false)) && (heroStun == false)) {
playSound("jump");
onBox = false;
isJumping = true;
gravity = 0;
timer = 0;
}
if (isJumping == true) {
timer++;
gravity = gravity + 1;
if ((gravity > jumpSpeed) && (heroStun == false)) {
_root.hero.gotoAndStop("jumpDown");
} else if ((jumpSpeed >= gravity) && (heroStun == false)) {
_root.hero.gotoAndStop("jumpUp");
}
_root.hero._y = _root.hero._y - jumpSpeed;
_root.hero._y = _root.hero._y + gravity;
if (_root.hero.hitTest(_root.bg.ground)) {
playSound("land");
onBox = false;
_root.hero._y = _root.bg.ground._y + 10;
isJumping = false;
gravity = 0;
timer = 0;
}
}
if (heroStun) {
stunTimer++;
_root.hero.gotoAndStop("stun");
if (stunTimer >= 25) {
heroStun = false;
}
}
if (_root.hero._x <= 5) {
health = health - 2;
_root.hpBar._xscale = (health / 100) * 100;
if (health <= 0) {
gameOver = true;
attachBox.clearInterval();
_root.fire._visible = false;
_root.deathThing._visible = false;
clearBoxes();
}
}
}
stopAllSounds();
heroSpeed = 5;
_root.hero.shield._visible = false;
_root.hero.boot._visible = false;
rockPos = [[]];
soundOn = true;
isJumping = false;
hitByBox = false;
shield = false;
gravity = 0;
timer = 0;
heroStun = false;
stunTimer = 0;
boxNumber = 0;
rockNumber = 0;
attachNumber = 50;
jumpSpeed = 14;
boxSpeed = 7;
onBox = false;
boxes = [];
upgrades = [];
score = 0;
ropeNum = 0;
rockTimer = 5000;
interval = 200;
gameTimer = 0;
score = 0;
health = 100;
jumpTimer = 0;
jumpUpgrade = false;
dropPU = false;
playSound("cBelt");
playSound("loop");
gameOver = false;
nextUpgrade = 0;
powerUpNum = 0;
_root.fire.swapDepths(100001);
_root.deathThing.swapDepths(100000);
myNum = setInterval(attachBox, 1000);
setRockPos();
_root.onEnterFrame = function () {
if (gameOver == false) {
moveHero();
moveBox();
rockTime();
checkFire();
}
};
stop();
Frame 40
function sendForm() {
send_lv = new LoadVars();
take_lv = new LoadVars();
send_lv.user = _root.userName;
send_lv.pass = _root.pass;
send_lv.amount = updateAmt;
send_lv.game = "aprobo";
take_lv.onLoad = function (success) {
if (success) {
_root.return_btn._visible = true;
statusbox = "Update Finished!";
}
};
send_lv.sendAndLoad("http://www.axis-games.com/addpoints.php", take_lv, "POST");
}
function updateTotal() {
throw_lv = new LoadVars();
catch_lv = new LoadVars();
throw_lv.amt = updateAmt;
throw_lv.gametype = "robotrun";
catch_lv.onLoad = function (success) {
if (success) {
}
};
throw_lv.sendAndLoad("http://www.axis-games.com/addtotals.php", catch_lv, "POST");
}
function highscores() {
left_lv = new LoadVars();
right_lv = new LoadVars();
left_lv.user = _root.userName;
left_lv.gamename = "robotrun";
left_lv.score = _root.score;
right_lv.onLoad = function (success) {
if (success) {
}
};
left_lv.sendAndLoad("http://www.axis-games.com/updatehighscores.php", right_lv, "POST");
}
_root.fire._visible = false;
apupdate = "You are not logged in.";
statusbox = "";
if (_root.login) {
apupdate = "";
highscores();
if (_root.score >= 1150) {
_root.return_btn._visible = false;
apupdate = "You earned 2 Axis Points!";
statusbox = "Updating Your Account...";
updateAmt = 2;
updateTotal();
sendForm();
}
if ((_root.score >= 800) && (_root.score < 1150)) {
_root.return_btn._visible = false;
apupdate = "You earned 1 Axis Point!";
statusbox = "Updating Your Account...";
updateAmt = 1;
updateTotal();
sendForm();
}
}
Symbol 16 MovieClip Frame 90
stop();
Instance of Symbol 17 MovieClip in Symbol 36 MovieClip [rope] Frame 85
onClipEvent (enterFrame) {
if (this.hitTest(_root.hero)) {
_root.playSound("hitHero");
_root.stunHero();
_root.explodeRock(this._parent._x, _root.hero._y - _root.hero._height);
this._parent.removeMovieClip();
removeMovieClip(this._parent);
this._parent._x = 900;
this._visible = false;
}
if (this.hitTest(_root.bg.ground)) {
_root.playSound("hitGround");
_root.explodeRock(this._parent._x, _root.bg.ground._y);
_root.dropUpgrade(this._parent._x, _root.bg.ground._y);
this._parent.removeMovieClip();
removeMovieClip(this._parent);
this._parent._x = 900;
this._visible = false;
}
var i = 0;
while (i < _root.boxes.length) {
var tempBox = _root.boxes[i];
if (this.hitTest(_root[tempBox])) {
_root.playSound("hitGround");
_root.explodeRock(this._parent._x, _root[tempBox]._y);
this._parent.removeMovieClip();
removeMovieClip(this._parent);
this._parent._x = 900;
this._visible = false;
}
i++;
}
}
Symbol 36 MovieClip [rope] Frame 105
this._parent.removeMovieClip();
Instance of Symbol 17 MovieClip in Symbol 36 MovieClip [rope] Frame 105
onClipEvent (enterFrame) {
if (this.hitTest(_root.hero)) {
_root.playSound("hitHero");
_root.stunHero();
_root.explodeRock(this._parent._x, _root.hero._y - _root.hero._height);
this._parent.removeMovieClip();
removeMovieClip(this._parent);
this._parent._x = 900;
this._visible = false;
}
if (this.hitTest(_root.bg.ground)) {
_root.playSound("hitGround");
_root.explodeRock(this._parent._x, _root.bg.ground._y);
this._parent.removeMovieClip();
removeMovieClip(this._parent);
this._parent._x = 900;
this._visible = false;
}
var i = 0;
while (i < _root.boxes.length) {
var tempBox = _root.boxes[i];
if (this.hitTest(_root[tempBox])) {
_root.playSound("hitGround");
_root.explodeRock(this._parent._x, _root[tempBox]._y);
this._parent.removeMovieClip();
removeMovieClip(this._parent);
this._parent._x = 900;
this._visible = false;
}
i++;
}
}
Symbol 49 MovieClip [rockBreak] Frame 5
this.removeMovieClip();
Instance of Symbol 53 MovieClip in Symbol 54 MovieClip [pu1] Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.hero)) {
_root.playSound("upgrade");
_root.health = _root.health + 20;
_root.score = _root.score + 20;
if (_root.health > 100) {
_root.health = 100;
}
_root.hpBar._xscale = (_root.health / 100) * 100;
_root.upgrades.splice(0, 1);
this._parent.removeMovieClip();
}
}
Instance of Symbol 58 MovieClip in Symbol 59 MovieClip [pu3] Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.hero)) {
_root.playSound("upgrade");
_root.hero.shield._visible = true;
_root.shield = true;
_root.score = _root.score + 20;
_root.upgrades.splice(0, 1);
this._parent.removeMovieClip();
}
}
Instance of Symbol 62 MovieClip in Symbol 63 MovieClip [pu2] Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.hero)) {
_root.playSound("upgrade");
_root.hero.boot._visible = true;
_root.jumpSpeed = _root.jumpSpeed + 5;
_root.score = _root.score + 20;
_root.jumpTimer = 0;
_root.jumpUpgrade = true;
_root.upgrades.splice(0, 1);
this._parent.removeMovieClip();
}
}
Symbol 84 MovieClip Frame 39
stop();
Symbol 104 MovieClip Frame 39
stop();
Symbol 132 MovieClip Frame 35
this.gotoAndPlay(1);
Symbol 135 MovieClip Frame 1
stopAllSounds();
Symbol 135 MovieClip Frame 145
stopAllSounds();
Symbol 135 MovieClip Frame 146
this.gotoAndStop(1);
_root.gotoAndStop("splash");
Symbol 146 MovieClip Frame 138
this.gotoAndPlay(1);
Symbol 151 Button
on (release) {
_root.gotoAndStop("game");
}
Symbol 153 Button
on (release) {
_root.gotoAndStop("credits");
}
Symbol 176 Button
on (release) {
getURL ("http://www.axis-games.com");
}
Symbol 190 Button
on (release) {
stopAllSounds();
_root.gotoAndStop("splash");
}
Symbol 203 MovieClip Frame 1
stop();
Symbol 203 MovieClip Frame 2
this.gotoAndStop(1);
Symbol 203 MovieClip Frame 12
this.gotoAndStop(1);
Symbol 203 MovieClip Frame 20
this.gotoAndStop(1);
Symbol 203 MovieClip Frame 30
this.gotoAndStop(1);
Symbol 203 MovieClip Frame 38
this.gotoAndStop(1);
Symbol 203 MovieClip Frame 46
this.gotoAndStop(1);
Symbol 203 MovieClip Frame 55
this.gotoAndStop(1);
Symbol 203 MovieClip Frame 64
this.gotoAndStop(1);
Symbol 203 MovieClip Frame 73
this.gotoAndStop(1);
Symbol 203 MovieClip Frame 83
this.gotoAndStop(1);
Symbol 203 MovieClip Frame 110
trace("here");
this.gotoAndStop(1);
Symbol 204 MovieClip Frame 155
this.gotoAndPlay(1);
Symbol 253 MovieClip Frame 1
stop();
Symbol 325 Button
on (release) {
if (_root.soundOn) {
_root.soundOn = false;
stopAllSounds();
} else {
_root.soundOn = true;
_root.playSound("cBelt");
_root.playSound("loop");
}
}
Symbol 328 MovieClip Frame 1
stop();
Symbol 328 MovieClip Frame 30
stopAllSounds();
_root.gotoAndStop("gameOver");