Frame 1
mochi.as2.MochiAd.showPreGameAd({id:"70ce1ce8356a2e69", res:"800x600"});
Frame 2
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__("6fff91fa", this, 10301, true);
function preload() {
var _local4 = this.getBytesTotal();
var _local5 = this.getBytesLoaded();
var _local3 = int((_local5 * 100) / _local4);
_root.mvBar.loadtext = _local3 + " %";
mcBar.gotoAndStop(_local3);
if ((_local3 >= 100) && (_local4 > 4)) {
delete this.onEnterFrame;
gotoAndStop ("titleScreen");
}
}
stop();
this.onEnterFrame = preload;
ver = $version;
Instance of Symbol 68 MovieClip in Frame 2
on (press) {
getURL ("http://www.101cargames.com", "_blank");
}
Frame 11
function geturl() {
}
stop();
_global.sndobj = new com.sound.CSound();
var gameLevel = 4;
var currentlevel = 1;
var gamescore1 = 0;
var levelscore = 1500;
var dieCount = 0;
var sndon = true;
play_btn.onRelease = function () {
gotoAndStop ("game");
stopAllSounds();
};
play_btn.onRollOver = function () {
play_btn.gotoAndPlay("over");
};
play_btn.onRollOut = function () {
play_btn.gotoAndPlay("out");
};
more_btn.onRelease = function () {
getURL ("http://www.101cargames.com", "_blank");
};
more_btn.onRollOver = function () {
more_btn.gotoAndPlay("over");
};
more_btn.onRollOut = function () {
more_btn.gotoAndPlay("out");
};
Frame 21
gotoAndStop ("game");
Frame 41
play_btn.onRelease = function () {
gotoAndStop ("game");
};
play_btn.onRollOver = function () {
play_btn.gotoAndPlay("over");
};
play_btn.onRollOut = function () {
play_btn.gotoAndPlay("out");
};
Frame 51
init();
Symbol 304 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 _local27 = {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, _local27);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def") {
options.ad_started();
options.ad_finished();
return(undefined);
}
var clip = options.clip;
var _local24 = 11000;
var _local19 = options.ad_timeout;
if (options.skip) {
_local19 = 0;
}
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 _local15 = _getRes(options);
var _local5 = _local15[0];
var _local14 = _local15[1];
mc._x = _local5 * 0.5;
mc._y = _local14 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local5 * -0.5;
chk._y = _local14 * -0.5;
var _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
if (options.no_progress_bar) {
_local7._visible = false;
delete options.no_progress_bar;
} else {
_local7._x = 10;
_local7._y = _local14 - 20;
}
var _local23 = options.color;
delete options.color;
var _local21 = options.background;
delete options.background;
var _local25 = options.outline;
delete options.outline;
var _local6 = _local7.createEmptyMovieClip("_outline", 1);
_local6.beginFill(_local21);
_local6.moveTo(0, 0);
_local6.lineTo(_local5 - 20, 0);
_local6.lineTo(_local5 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
_local6.endFill();
var _local4 = _local7.createEmptyMovieClip("_inside", 2);
_local4.beginFill(_local23);
_local4.moveTo(0, 0);
_local4.lineTo(_local5 - 20, 0);
_local4.lineTo(_local5 - 20, 10);
_local4.lineTo(0, 10);
_local4.lineTo(0, 0);
_local4.endFill();
_local4._xscale = 0;
var _local8 = _local7.createEmptyMovieClip("_outline", 3);
_local8.lineStyle(0, _local25, 100);
_local8.moveTo(0, 0);
_local8.lineTo(_local5 - 20, 0);
_local8.lineTo(_local5 - 20, 10);
_local8.lineTo(0, 10);
_local8.lineTo(0, 0);
chk.ad_msec = _local24;
chk.ad_timeout = _local19;
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;
}
};
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 _local10 = this._parent._parent;
var _local3 = _local10;
while ((!_local3.getBytesTotal()) && (_local3)) {
_local3 = _local3._parent;
}
if (!_local3) {
_local3 = _root;
}
var _local13 = this._parent._mochiad_ctr;
var _local7 = getTimer() - this.started;
var _local5 = false;
var _local6 = _local3.getBytesTotal();
var _local9 = _local3.getBytesLoaded();
var _local4 = (100 * _local9) / _local6;
var _local12 = (100 * _local7) / chk.ad_msec;
var _local11 = this._mochiad_bar._inside;
var _local15 = Math.min(100, Math.min(_local4 || 0, _local12));
_local15 = Math.max(this.last_pcnt, _local15);
this.last_pcnt = _local15;
_local11._xscale = _local15;
options.ad_progress(_local15);
if (sendHostProgress) {
mochi.as2.MochiAd.containerNotify(clip, {id:"hostLoadPcnt", pcnt:_local4}, clip._mochiad._containerLCName);
if (_local4 == 100) {
sendHostProgress = false;
}
}
if (!chk.showing) {
var _local8 = _local13.getBytesTotal();
if ((_local8 > 0) || (typeof(_local8) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if ((_local7 > chk.ad_timeout) && (_local4 == 100)) {
options.ad_failed();
_local5 = true;
}
}
if (_local7 > chk.ad_msec) {
_local5 = true;
}
if (((_local6 > 0) && (_local9 >= _local6)) && (_local5)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showClickAwayAd(options) {
var _local10 = {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, _local10);
var clip = options.clip;
var _local9 = options.ad_timeout;
delete options.ad_timeout;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var _local3 = clip._mochiad;
_local3.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local11 = _local5[0];
var _local8 = _local5[1];
_local3._x = _local11 * 0.5;
_local3._y = _local8 * 0.5;
var chk = _local3.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_timeout = _local9;
chk.started = getTimer();
chk.showing = false;
_local3.lc.adLoaded = options.ad_loaded;
_local3.lc.adSkipped = options.ad_skipped;
_local3.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
_local3.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
var _local21 = false;
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 _local12 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local12);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local6 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local6._mochiad_loaded) {
return(null);
}
var _local11 = options.depth;
delete options.depth;
var mc = _local6.createEmptyMovieClip("_mochiad", _local11);
var _local10 = _getRes(options);
options.res = (_local10[0] + "x") + _local10[1];
options.server = options.server + options.id;
delete options.id;
_local6._mochiad_loaded = true;
if (_local6._url.indexOf("http") != 0) {
trace("[MochiAd] NOTE: Security Sandbox Violation errors below are normal");
}
var _local4 = mc.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local9 = _local4.server;
delete _local4.server;
var _local13 = _allowDomains(_local9);
mc.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 _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = mc;
_local5.name = _local8;
_local5.hostname = _local13;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
mc.lc = _local5;
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
_local4.lc = _local8;
_local4.st = getTimer();
if (!options.skip) {
_local4.loadMovie(_local9 + ".swf", "POST");
}
return(mc);
}
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 305 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 306 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.9.1 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.onLoadComplete = function (target_mc) {
target_mc.MochiServices = mochi.as2.MochiServices;
};
_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, 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 "services" :
mochi.as2.MochiServices.triggerEvent(pkg.event, pkg.args);
break;
case "events" :
mochi.as2.MochiEvents.triggerEvent(pkg.event, pkg.args);
break;
case "coins" :
mochi.as2.MochiCoins.triggerEvent(pkg.event, pkg.args);
break;
case "social" :
mochi.as2.MochiSocial.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 = {};
var _local6;
if (_root._url.indexOf("mochiad_options") != -1) {
var _local2 = (_root._url.indexOf("mochiad_options") + "mochiad_options".length) + 1;
_local6 = _root._url.substr(_local2, _root._url.length);
} else if (_root.mochiad_options) {
_local6 = _root.mochiad_options;
}
if (_local6) {
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://link.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 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 var CONNECTED = "onConnected";
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 _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 307 MovieClip [__Packages.mochi.as2.MochiEvents] Frame 0
class mochi.as2.MochiEvents
{
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 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 startPlay(tag) {
if (tag == undefined) {
tag = "gameplay";
}
mochi.as2.MochiServices.send("events_setRoundID", {tag:String(tag)}, null, null);
}
static function endPlay() {
mochi.as2.MochiServices.send("events_clearRoundID", null, null, null);
}
static function trackEvent(tag, value) {
mochi.as2.MochiServices.send("events_trackEvent", {tag:tag, value:value}, null, null);
}
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 308 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 getStoreItems() {
mochi.as2.MochiServices.send("coins_getStoreItems");
}
static function requestFunding(properties) {
mochi.as2.MochiServices.send("social_requestFunding", 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 STORE_SHOW = "StoreShow";
static var STORE_HIDE = "StoreHide";
static var ITEM_OWNED = "ItemOwned";
static var ITEM_NEW = "ItemNew";
static var STORE_ITEMS = "StoreItems";
static var ERROR = "Error";
static var IO_ERROR = "IOError";
static var NO_USER = "NoUser";
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 309 MovieClip [__Packages.mochi.as2.MochiSocial] Frame 0
class mochi.as2.MochiSocial
{
function MochiSocial () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function showLoginWidget(options) {
mochi.as2.MochiServices.setContainer();
mochi.as2.MochiServices.stayOnTop();
mochi.as2.MochiServices.send("social_showLoginWidget", {options:options});
}
static function hideLoginWidget() {
mochi.as2.MochiServices.send("social_hideLoginWidget");
}
static function requestLogin(properties) {
mochi.as2.MochiServices.send("social_requestLogin", properties);
}
static function getFriendsList(properties) {
mochi.as2.MochiServices.send("social_getFriendsList", properties);
}
static function postToStream(properties) {
mochi.as2.MochiServices.send("social_postToStream", properties);
}
static function inviteFriends(properties) {
mochi.as2.MochiServices.send("social_inviteFriends", properties);
}
static function requestFan(properties) {
mochi.as2.MochiServices.send("social_requestFan", properties);
}
static function saveUserProperties(properties) {
mochi.as2.MochiServices.send("social_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 LOGIN_SHOWN = "LoginShown";
static var PROFILE_SHOW = "ProfileShow";
static var PROFILE_HIDE = "ProfileHide";
static var PROPERTIES_SAVED = "PropertySaved";
static var WIDGET_LOADED = "WidgetLoaded";
static var FRIEND_LIST = "FriendsList";
static var PROFILE_DATA = "ProfileData";
static var GAMEPLAY_DATA = "GameplayData";
static var ACTION_CANCELED = "onCancel";
static var ACTION_COMPLETE = "onComplete";
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 310 MovieClip [__Packages.com.sound.CSound] Frame 0
class com.sound.CSound
{
static var instance;
var engineStart, engineLoop, bgsnd, truck_snd, welcome, trickotreat, sndVol, truckstart, truckblast, zoombiesnd, truckidle;
function CSound () {
engineStart = new Sound();
engineStart.attachSound("engineStart");
engineLoop = new Sound();
engineLoop.attachSound("engineLoop");
bgsnd = new Sound();
bgsnd.attachSound("bgsnd");
truck_snd = new Sound();
truck_snd.attachSound("truck_snd");
welcome = new Sound();
welcome.attachSound("welcome");
trickotreat = new Sound();
trickotreat.attachSound("trickotreat");
sndVol = new Sound();
truckstart = new Sound();
truckstart.attachSound("bg1");
truckstart.setVolume(40);
truckblast = new Sound();
truckblast.attachSound("blast");
zoombiesnd = new Sound();
zoombiesnd.attachSound("zoombiesnd");
truckstart.onSoundComplete = function () {
this.start(0, 1);
};
truckidle.onSoundComplete = function () {
this.start(0, 1);
};
instance = this;
}
function sndvolon() {
sndVol.setVolume(100);
}
function sndvoloff() {
sndVol.setVolume(0);
}
function playBgsnd() {
stopBgsnd();
truckstart.start(0.999999);
bgsnd.start(0, 999999999);
bgsnd.setVolume(50);
}
function stopBgsnd() {
bgsnd.stop();
}
function playStartsnd() {
truckstart.stop();
truckstart.start(0, 9999999);
}
function stopSnds() {
stopBgsnd();
truckstart.stop();
truckidle.stop();
}
function playWelcome() {
welcome.start(0, 1);
}
function playEngineStart() {
engineStart.start(0, 1);
}
function playEngineLoop() {
engineLoop.start(0, 9999999);
}
function playBlastsnd() {
truckblast.start(0, 1);
}
function playTrick() {
trickotreat.start(0, 1);
}
}
Symbol 311 MovieClip [__Packages.com.UI.Game] Frame 0
class com.UI.Game extends MovieClip
{
static var m_instance;
var inPostGame, m_pauseOn, hitcount, min, sec, snd, firetime, m_level, attachMovie, m_pEngine, _parent, setint, inProcess, scen, m_car, bodyCrash, score, onEnterFrame, _scrPause;
function Game () {
super();
m_instance = this;
}
function set pauseOn(pauseState) {
if (inPostGame) {
return;
}
m_pauseOn = pauseState;
enableProcess(!m_pauseOn);
//return(pauseOn);
}
function get pauseOn() {
return(m_pauseOn);
}
function onLoad() {
init();
pauseOn = (false);
}
function init() {
_root.levelscore = 1500;
hitcount = 0;
min = 0;
sec = 60;
snd = com.sound.CSound.instance;
firetime = 75;
trace("_root.currentlevel" + _root.currentlevel);
m_level = attachMovie("level" + _root.currentlevel, "_Level", 1001);
trace("m_level._x" + m_level._y);
m_level.mcHit._alpha = 0;
m_pEngine = new com.ACA.DynamicsEngine(m_level.mcHit, 7);
var mc = attachMovie("popup", "popup", 1002);
trace("mc" + mc);
mc._x = 400;
mc._y = 300;
mc.gotoAndStop("startup");
var sco = this;
trace("init :" + _root.gamescore1);
_parent.scorepanel.gscore1 = _root.gamescore1;
if (_root.sndon == true) {
_parent.scorepanel.music.txt = "ON";
snd.sndvolon();
} else {
_parent.scorepanel.music.txt = "OFF";
snd.sndvoloff();
}
mc.onEnterFrame = function () {
if (mc.lev._currentframe >= 90) {
sco.str();
mc.onEnterFrame = null;
}
};
_parent.scorepanel.music.onRelease = function () {
if (_root.sndon == true) {
this.gotoAndStop(2);
_root.sndon = false;
sco.snd.sndvoloff();
} else {
this.gotoAndStop(1);
_root.sndon = true;
sco.snd.sndvolon();
}
};
}
function str() {
newRace();
setint = setInterval(this, "tim", 1000);
}
function tim() {
if (!pauseOn) {
sec--;
if (sec <= 0) {
sec = 59;
min--;
if (min < 0) {
_parent.scorepanel.timer = "00:00";
clearInterval(setint);
}
}
if (min == 0) {
_parent.scorepanel.timer = "00:" + sec;
if (sec < 10) {
_parent.scorepanel.timer = "00:0" + sec;
}
} else {
_parent.scorepanel.timer = (("0" + min) + ":") + sec;
if (sec < 10) {
_parent.scorepanel.timer = ((("0" + min) + ":") + "0") + sec;
}
}
}
}
function newRace() {
inPostGame = false;
inProcess = true;
scen._x = 0;
scen._y = 0;
snd.playBgsnd();
snd.playStartsnd();
if (_root.sndon == true) {
_parent.scorepanel.music.gotoAndStop(1);
snd.sndvolon();
} else {
_parent.scorepanel.music.gotoAndStop(2);
snd.sndvoloff();
}
m_pEngine.clear();
m_car = new com.UI.Truck();
m_car.init(m_level.mcVehiclePlace, m_pEngine);
setObstruct_mc();
setPosition(true);
}
function setObstruct_mc() {
for (var _local2 in m_level.obstruct) {
m_level.obstruct[_local2].gotoAndStop(1);
}
}
function gameNewEnd() {
var _local3 = attachMovie("popup", "popup", 1002);
_local3._x = 400;
_local3._y = 300;
if (_root.currentlevel >= _root.gameLevel) {
_local3.gotoAndStop("congrats");
} else {
_local3.gotoAndStop("levelup");
}
trace("_root.levelscore :" + _root.levelscore);
trace("die count " + _root.dieCount);
_local3.lscore = (_root.levelscore - (_root.dieCount * 100)) + (sec * 100);
_root.gamescore1 = _root.gamescore1 + ((_root.levelscore - (_root.dieCount * 100)) + (sec * 100));
_local3.gscore = _root.gamescore1;
snd.stopSnds();
snd.playTrick();
_parent.scorepanel._visible = false;
_parent.sbar._visible = false;
trace("_root.gamescore :" + _root.gamescore1);
trace("sec :" + sec);
clearInterval(setint);
}
function processRace() {
m_pEngine.process();
m_car.process();
setPosition();
if ((m_level.mcFinish._x < (m_car.__get__backWheel().pos.x - 50)) && (!inPostGame)) {
inPostGame = true;
}
var _local3 = m_car.getHitForBonus();
if (_local3.hitTest(m_level.bonus_mc)) {
i = 1;
while (i <= 10) {
if (_local3.hitTest(m_level.bonus_mc["bonus" + i])) {
if (m_level.bonus_mc["bonus" + i]._alpha != 0) {
m_level.bonus_mc["bonus" + i]._alpha = 0;
trace("bonus");
_root.levelscore = _root.levelscore + 111;
_root.game.scorepanel.gscore1 = _root.game.scorepanel.gscore1 + 111;
}
}
i++;
}
}
if (_local3.hitTest(m_level.end)) {
m_car.stopCar(stopArray[_root.currentlevel - 1]);
if (m_car.kids == true) {
if (kid == false) {
m_car.showKids();
kid = true;
}
if (_level0.game.b._Level.mcVehiclePlace._dmCarBody.copii.bla == true) {
if (gameNew == false) {
gameNewEnd();
gameNew = true;
}
}
}
if (inProcess) {
m_car.inProcess = false;
inProcess = false;
}
}
for (var i in m_level.obstruct) {
if ((_local3.hitTest(m_level.obstruct[i].mc) == true) && (inProcess)) {
m_level.obstruct[i].gotoAndPlay("die");
snd.zoombiesnd.start(0, 1);
updatescore(100);
}
}
if (inProcess && ((getTimer() - m_car.bornTime) > 200)) {
if (!inPostGame) {
if (m_car.checkDeathPoints(m_level.mcHit)) {
bodyCrash = true;
if (inProcess) {
hitcount++;
if (hitcount >= 1) {
hitcount = 0;
_parent.sbar.nextFrame();
}
if ((_parent.sbar._currentframe >= 100) || (min < 0)) {
m_car.inProcess = false;
inProcess = false;
inPostGame = true;
var _local4 = attachMovie("popup", "dieMessage", 1002);
_local4._x = 400;
_local4._y = 300;
_local4.gotoAndStop("crash");
_parent.scorepanel._visible = false;
_parent.sbar._visible = false;
_root.dieCount++;
_local4.level = _root.currentlevel;
_local4.lscore = _root.levelscore;
_root.gamescore1 = _root.gamescore1 + 0;
_local4.gscore = _root.gamescore1;
trace("gamescore :" + _root.gamescore1);
snd.stopSnds();
snd.playBlastsnd();
clearInterval(setint);
}
}
} else {
bodyCrash = false;
}
if (m_car.chkDeath(m_level.mcHit.Deathhit) || (min < 0)) {
_parent.scorepanel.timer = "00:00";
m_car.inProcess = false;
inProcess = false;
inPostGame = true;
var _local4 = attachMovie("popup", "dieMessage", 1002);
_local4.gotoAndStop("die");
_local4._x = 400;
_local4._y = 300;
_parent.scorepanel._visible = false;
_parent.sbar._visible = false;
_local4.level = _root.currentlevel;
_root.dieCount++;
_local4.lscore = _root.levelscore;
_root.gamescore1 = _root.gamescore1 + 0;
_local4.gscore = _root.gamescore1;
trace("gamescore :" + _root.gamescore1);
snd.stopSnds();
snd.playBlastsnd();
clearInterval(setint);
}
}
}
}
function updatescore(no) {
score = score + no;
_root.levelscore = score;
_parent.scorepanel.gscore = _root.gamescore;
}
function enableProcess(enable) {
if (enable) {
onEnterFrame = processRace;
_scrPause.removeMovieClip();
} else {
onEnterFrame = function () {
};
attachMovie("popup", "_scrPause", 32001);
_scrPause.gotoAndStop("pause");
_scrPause._x = 400;
_scrPause._y = 300;
}
}
function setPosition(b) {
var _local4 = m_car.__get__image()._x;
var _local3 = m_car.__get__image()._y;
var _local5 = leftOffset;
var _local6 = rightOffset;
if (!m_car.mode) {
_local5 = rightOffset;
_local6 = leftOffset;
}
var _local2 = m_level._x;
if (_local2 < (_local5 - _local4)) {
_local2 = _local5 - _local4;
}
if (_local2 > ((550 - _local6) - _local4)) {
_local2 = (550 - _local6) - _local4;
}
if (b) {
m_level._x = _local2;
} else {
m_level._x = m_level._x + ((_local2 - m_level._x) / xScrollFactor);
scen._x = scen._x + (((_local2 - m_level._x) / xScrollFactor) * 0.03);
}
if (m_level._y < (topOffset - _local3)) {
m_level._y = topOffset - _local3;
}
if (m_level._y > ((500 - bottomOffset) - _local3)) {
m_level._y = (500 - bottomOffset) - _local3;
}
}
static function get instance() {
return(m_instance);
}
function endOfLevel(n) {
if (n == 1) {
} else if (n == 2) {
}
}
var leftOffset = 200;
var rightOffset = 350;
var topOffset = 250;
var bottomOffset = 120;
var xScrollFactor = 5;
var stopArray = [7020, 7450, 7100, 11070];
var kid = false;
var gameNew = false;
var spacePressed = false;
}
Symbol 312 MovieClip [__Packages.com.ACA.DynamicsEngine] Frame 0
class com.ACA.DynamicsEngine
{
var m_particles, m_constraints, m_gravity, m_hitMovie, m_koeffDamp;
function DynamicsEngine (hitMovie, nGravity, koeffDamp) {
m_particles = new Array();
m_constraints = new Array();
setHitMovie(hitMovie);
init(nGravity, koeffDamp);
}
function set gravity(nGravity) {
m_gravity = nGravity;
//return(gravity);
}
function get gravity() {
return(m_gravity);
}
function setHitMovie(hitMovie) {
if (hitMovie == undefined) {
hitMovie = null;
}
m_hitMovie = hitMovie;
}
function getHitMovie() {
return(m_hitMovie);
}
function init(nGravity, koeffDamp) {
if (nGravity == undefined) {
nGravity = 9.8;
}
if (koeffDamp == undefined) {
koeffDamp = 0.99;
}
gravity = (nGravity);
m_koeffDamp = koeffDamp;
}
function addParticle(p) {
m_particles.push(p);
}
function process() {
var _local2 = 0;
while (_local2 < m_particles.length) {
m_particles[_local2].accelerate.plusXY(0, m_gravity * m_particles[_local2].mass);
m_particles[_local2].accelerate.mult(1 / REPEAT_COUNT);
_local2++;
}
var _local3 = 0;
while (_local3 < REPEAT_COUNT) {
_local2 = 0;
while (_local2 < m_particles.length) {
m_particles[_local2].verlet(D_TIME, m_koeffDamp);
_local2++;
}
_local2 = 0;
while (_local2 < m_constraints.length) {
m_constraints[_local2].resolve();
_local2++;
}
_local2 = 0;
while (_local2 < m_particles.length) {
m_particles[_local2].checkCollision(m_hitMovie);
_local2++;
}
_local3++;
}
_local2 = 0;
while (_local2 < m_particles.length) {
m_particles[_local2].accelerate.init(0, 0);
_local2++;
}
}
function addConstraint(c) {
m_constraints.push(c);
}
function clear() {
while (m_particles.pop() != undefined) {
}
clearConstraints();
}
function clearConstraints() {
while (m_constraints.pop() != undefined) {
}
}
static var SEC_PER_FRAME = 0.04;
static var REPEAT_COUNT = 3;
static var D_TIME = SEC_PER_FRAME / REPEAT_COUNT;
}
Symbol 313 MovieClip [__Packages.com.ACA.Vehicle] Frame 0
class com.ACA.Vehicle
{
var m_vehicleDir, m_vehicleNormal, m_vehicleParam, m_vehicleAngle, m_vehicleMovie, m_bodyMovie, m_backWheel, m_forwardWheel, m_accPercMultForTurn, m_normalYLimitForTurn, m_koeffPrimaryForTurn, m_koeffSecondaryForTurn, m_accPercBaseForTurn, m_accForwardWheel, m_accBackWheel, m_brakeForwardWheel, m_brakeBackWheel, t_turnToPerc;
function Vehicle () {
m_vehicleDir = new com.ACA.util.Vector(0, 0);
m_vehicleNormal = new com.ACA.util.Vector(0, 0);
}
function get vehicleParam() {
return(m_vehicleParam);
}
function set vehicleParam(nParam) {
m_vehicleParam = nParam;
//return(vehicleParam);
}
function get vehicleAngle() {
return(m_vehicleAngle);
}
function get vehicleDir() {
return(m_vehicleDir);
}
function getVehiclePoint(mc) {
var _local2 = new Object();
_local2.x = mc._x;
_local2.y = mc._y;
mc._parent.localToGlobal(_local2);
m_vehicleMovie._parent.globalToLocal(_local2);
return(_local2);
}
function moveMovieToMovieGlobal(movie, moviePos) {
var _local1 = {x:movie._x, y:movie._y};
movie._parent.localToGlobal(_local1);
moviePos._parent.globalToLocal(_local1);
moviePos._x = _local1.x;
moviePos._y = _local1.y;
}
function rotateMovieToMovieLocal(movie, moviePos) {
movie._rotation = Math.atan2(moviePos._y - movie._y, moviePos._x - movie._x) * VAL_180_DIV_PI;
}
function construct(vehicleParam, bodyMovie, vehicleMovie, mcWBack, mcWForward) {
m_vehicleParam = vehicleParam;
m_bodyMovie = bodyMovie;
m_vehicleMovie = vehicleMovie;
m_vehicleParam.changeGeometry(getVehiclePoint(m_bodyMovie.mcA), getVehiclePoint(m_bodyMovie.mcB), getVehiclePoint(m_bodyMovie.mcC), getVehiclePoint(m_bodyMovie.mcD));
m_backWheel = m_vehicleParam.A;
m_forwardWheel = m_vehicleParam.D;
if (mcWBack != undefined) {
m_backWheel.setMovie(mcWBack);
m_backWheel.setRotationMovie(mcWBack.mcSpoke);
}
if (mcWForward != undefined) {
m_forwardWheel.setMovie(mcWForward);
m_forwardWheel.setRotationMovie(mcWForward.mcSpoke);
}
setVehicleParam(getDefaultVehicleParam());
}
static function getDefaultVehicleParam() {
var _local1 = new Object();
_local1.accPercMult = 39.2;
_local1.normalYLimit = 0.4;
_local1.koeffPrimary = 1.3;
_local1.koeffSecondary = 0.7;
_local1.accPercBase = 0.6;
_local1.accelerateForwardWheel = 0;
_local1.accelerateBackWheel = 50;
_local1.brakeForwardWheel = 0;
_local1.brakeBackWheel = 0;
return(_local1);
}
function setVehicleParam(param) {
m_accPercMultForTurn = param.accPercMult;
m_normalYLimitForTurn = param.normalYLimit;
m_koeffPrimaryForTurn = param.koeffPrimary;
m_koeffSecondaryForTurn = param.koeffSecondary;
m_accPercBaseForTurn = param.accPercBase;
m_accForwardWheel = param.accelerateForwardWheel;
m_accBackWheel = param.accelerateBackWheel;
m_brakeForwardWheel = param.brakeForwardWheel;
m_brakeBackWheel = param.brakeBackWheel;
}
function processKey(mask) {
if ((mask & KM_ACCELERATE) != 0) {
accelerate();
} else if ((mask & KM_BRAKE) != 0) {
brake();
} else {
stopAccelerate();
}
if ((mask & KM_MOVE_BODY_FORWARD) != 0) {
turnTo(DIR_RIGHT, m_accPercMultForTurn);
} else if ((mask & KM_MOVE_BODY_BACK) != 0) {
turnTo(DIR_LEFT, m_accPercMultForTurn);
}
}
function process() {
m_vehicleDir.init(m_forwardWheel.__get__pos().x - m_backWheel.__get__pos().x, m_forwardWheel.__get__pos().y - m_backWheel.__get__pos().y);
m_vehicleNormal.init(m_vehicleDir.x, m_vehicleDir.y);
m_vehicleNormal.normalize();
var _local4 = m_vehicleNormal.x;
m_vehicleNormal.x = -m_vehicleNormal.y;
m_vehicleNormal.y = _local4;
m_vehicleAngle = Math.atan2(m_vehicleDir.y, m_vehicleDir.x) * VAL_180_DIV_PI;
m_vehicleMovie._rotation = m_vehicleAngle;
var _local3 = new Object();
_local3.x = m_bodyMovie.mcB._x;
_local3.y = m_bodyMovie.mcB._y;
m_bodyMovie.localToGlobal(_local3);
m_vehicleMovie._parent.globalToLocal(_local3);
var _local2 = new Object();
_local2.x = m_bodyMovie.mcC._x;
_local2.y = m_bodyMovie.mcC._y;
m_bodyMovie.localToGlobal(_local2);
m_vehicleMovie._parent.globalToLocal(_local2);
m_vehicleMovie._x = m_vehicleMovie._x + ((((m_vehicleParam.__get__B().__get__pos().x - _local3.x) + m_vehicleParam.__get__C().__get__pos().x) - _local2.x) / 2);
m_vehicleMovie._y = m_vehicleMovie._y + ((((m_vehicleParam.__get__B().__get__pos().y - _local3.y) + m_vehicleParam.__get__C().__get__pos().y) - _local2.y) / 2);
}
function drawSuspension() {
if (!m_vehicleMovie._parent.sus_mc) {
m_vehicleMovie._parent.createEmptyMovieClip("sus_mc", 1015);
m_vehicleMovie._parent.sus_mc._x = (m_vehicleMovie._parent.sus_mc._y = 0);
}
var _local2 = m_vehicleMovie._parent.sus_mc;
_local2.clear();
_local2.lineStyle(5, 16777215, 100);
_local2.moveTo(m_vehicleParam.__get__A().__get__pos().x, m_vehicleParam.__get__A().__get__pos().y);
_local2.lineTo(m_vehicleParam.__get__B().__get__pos().x, m_vehicleParam.__get__B().__get__pos().y);
_local2.lineTo(m_vehicleParam.__get__C().__get__pos().x, m_vehicleParam.__get__C().__get__pos().y);
_local2.lineTo(m_vehicleParam.__get__A().__get__pos().x, m_vehicleParam.__get__A().__get__pos().y);
_local2.moveTo(m_vehicleParam.__get__D().__get__pos().x, m_vehicleParam.__get__D().__get__pos().y);
_local2.lineTo(m_vehicleParam.__get__B().__get__pos().x, m_vehicleParam.__get__B().__get__pos().y);
_local2.lineTo(m_vehicleParam.__get__C().__get__pos().x, m_vehicleParam.__get__C().__get__pos().y);
_local2.lineTo(m_vehicleParam.__get__D().__get__pos().x, m_vehicleParam.__get__D().__get__pos().y);
}
function turnTo(dir, turnPower) {
t_turnToPerc = ((Math.abs(m_vehicleNormal.y) * (1 - m_accPercBaseForTurn)) + m_accPercBaseForTurn) * turnPower;
var _local3;
var _local2;
_local3 = m_vehicleNormal.x * t_turnToPerc;
_local2 = m_vehicleNormal.y * t_turnToPerc;
if (m_vehicleNormal.y > (-m_normalYLimitForTurn)) {
if (dir == DIR_RIGHT) {
if (!m_forwardWheel.hasIntersection()) {
m_forwardWheel.__get__accelerate().plusXY(_local3 * m_koeffPrimaryForTurn, _local2 * m_koeffPrimaryForTurn);
}
m_backWheel.__get__accelerate().plusXY((-_local3) * m_koeffSecondaryForTurn, (-_local2) * m_koeffSecondaryForTurn);
} else {
m_forwardWheel.__get__accelerate().plusXY((-_local3) * m_koeffSecondaryForTurn, (-_local2) * m_koeffSecondaryForTurn);
if (!m_backWheel.hasIntersection()) {
m_backWheel.__get__accelerate().plusXY(_local3 * m_koeffPrimaryForTurn, _local2 * m_koeffPrimaryForTurn);
}
}
}
}
function accelerate() {
if (!m_vehicleMovie._parent._parent._parent.bodyCrash) {
m_backWheel.setAccelerate(m_accBackWheel);
m_forwardWheel.setAccelerate(m_accForwardWheel);
}
}
function brake() {
if (!m_vehicleMovie._parent._parent._parent.bodyCrash) {
m_backWheel.setAccelerate(m_brakeBackWheel);
m_forwardWheel.setAccelerate(m_brakeForwardWheel);
}
}
function stopAccelerate() {
m_backWheel.setAccelerate(0);
m_forwardWheel.setAccelerate(0);
}
function get backWheel() {
return(m_backWheel);
}
function get forwardWheel() {
return(m_forwardWheel);
}
function onGround() {
return(m_backWheel.hasIntersection() || (m_forwardWheel.hasIntersection()));
}
static var VAL_180_DIV_PI = 57.2957795130823;
static var DIR_RIGHT = 0;
static var DIR_LEFT = 1;
static var KM_NONE = 0;
static var KM_ACCELERATE = 1;
static var KM_BRAKE = 2;
static var KM_MOVE_BODY_FORWARD = 4;
static var KM_MOVE_BODY_BACK = 8;
}
Symbol 314 MovieClip [__Packages.com.ACA.util.Vector] Frame 0
class com.ACA.util.Vector
{
var x, y;
function Vector (nx, ny) {
init(nx, ny);
}
function init(nx, ny) {
x = nx;
y = ny;
}
function copyFrom(v) {
x = v.x;
y = v.y;
}
function copyTo(v) {
v.x = x;
v.y = y;
}
function plusXY(nx, ny) {
x = x + nx;
y = y + ny;
}
static function getDistanceBetween(p1, p2) {
var _local2 = p1.x - p2.x;
var _local1 = p1.y - p2.y;
return(Math.sqrt((_local2 * _local2) + (_local1 * _local1)));
}
function duplicate() {
return(new com.ACA.util.Vector(x, y));
}
function minus(v) {
x = x - v.x;
y = y - v.y;
}
function minusNew(v) {
return(new com.ACA.util.Vector(x - v.x, y - v.y));
}
function normalize() {
var _local2 = Math.sqrt((x * x) + (y * y));
x = x / _local2;
y = y / _local2;
}
function reverseNew() {
return(new com.ACA.util.Vector(-x, -y));
}
function scalar(v) {
return((x * v.x) + (y * v.y));
}
function modul() {
return(Math.sqrt((x * x) + (y * y)));
}
function rotate(u) {
var _local4 = x;
var _local3 = y;
x = (_local4 * Math.cos(u)) - (_local3 * Math.sin(u));
y = (_local4 * Math.sin(u)) + (_local3 * Math.cos(u));
}
function rotateNew(u) {
return(new com.ACA.util.Vector((x * Math.cos(u)) - (y * Math.sin(u)), (x * Math.sin(u)) + (y * Math.cos(u))));
}
function mult(k) {
x = x * k;
y = y * k;
return(this);
}
function multNew(k) {
return(new com.ACA.util.Vector(x * k, y * k));
}
function plus(v) {
x = x + v.x;
y = y + v.y;
}
function plusNew(v) {
return(new com.ACA.util.Vector(x + v.x, y + v.y));
}
function getDistanceTo(p1, p2) {
var _local2 = p1.y - p2.y;
var _local3 = p2.x - p1.x;
var _local5 = (p1.x * (p2.y - p1.y)) - (p1.y * (p2.x - p1.x));
var _local6 = Math.sqrt((_local2 * _local2) + (_local3 * _local3));
_local2 = _local2 / _local6;
_local3 = _local3 / _local6;
_local5 = _local5 / _local6;
return(((_local2 * x) + (_local3 * y)) + _local5);
}
}
Symbol 315 MovieClip [__Packages.com.ACA.composites.Composite] Frame 0
class com.ACA.composites.Composite
{
var m_A, m_B, m_C, m_D, m_AB, m_AC, m_AD, m_BC, m_BD, m_CD, m_ABC, m_DCB;
function Composite () {
}
function get A() {
return(m_A);
}
function get B() {
return(m_B);
}
function get C() {
return(m_C);
}
function get D() {
return(m_D);
}
function get AB() {
return(m_AB);
}
function get AC() {
return(m_AC);
}
function get AD() {
return(m_AD);
}
function get BC() {
return(m_BC);
}
function get BD() {
return(m_BD);
}
function get CD() {
return(m_CD);
}
function init(a, b, c, d, ab, ac, ad, bc, bd, cd) {
m_A = a;
m_B = b;
m_C = c;
m_D = d;
m_AB = ab;
m_AB.__set__p1(a);
m_AB.__set__p2(b);
m_AC = ac;
m_AC.__set__p1(a);
m_AC.__set__p2(c);
m_AD = ad;
m_AD.__set__p1(a);
m_AD.__set__p2(d);
m_BC = bc;
m_BC.__set__p1(b);
m_BC.__set__p2(c);
m_BD = bd;
m_BD.__set__p1(b);
m_BD.__set__p2(d);
m_CD = cd;
m_CD.__set__p1(c);
m_CD.__set__p2(d);
m_ABC = new com.ACA.constraints.AngularConstraint(m_D, m_C, m_B);
m_DCB = new com.ACA.constraints.AngularConstraint(m_A, m_B, m_C);
return(this);
}
function changeGeometry(pA, pB, pC, pD) {
m_A.moveTo(pA.x, pA.y);
m_B.moveTo(pB.x, pB.y);
m_C.moveTo(pC.x, pC.y);
m_D.moveTo(pD.x, pD.y);
m_AB.fixDistance();
m_AC.fixDistance();
m_AD.fixDistance();
m_BC.fixDistance();
m_BD.fixDistance();
m_CD.fixDistance();
m_ABC.fixDistance();
m_DCB.fixDistance();
}
function addToEngine(engine) {
engine.addParticle(m_A);
engine.addParticle(m_B);
engine.addParticle(m_C);
engine.addParticle(m_D);
engine.addConstraint(m_AB);
engine.addConstraint(m_AC);
engine.addConstraint(m_AD);
engine.addConstraint(m_BC);
engine.addConstraint(m_BD);
engine.addConstraint(m_CD);
engine.addConstraint(m_ABC);
engine.addConstraint(m_DCB);
}
}
Symbol 316 MovieClip [__Packages.com.ACA.primitives.Particle] Frame 0
class com.ACA.primitives.Particle
{
var m_curPosition, m_prevPosition, m_accelerate, m_buckup, m_mass, m_mc;
function Particle () {
m_curPosition = new com.ACA.util.Vector();
m_prevPosition = new com.ACA.util.Vector();
m_accelerate = new com.ACA.util.Vector();
m_buckup = new com.ACA.util.Vector();
}
function get mass() {
return(m_mass);
}
function set mass(nMass) {
m_mass = nMass;
//return(mass);
}
function get accelerate() {
return(m_accelerate);
}
function set accelerate(acc) {
m_accelerate = acc;
//return(accelerate);
}
function get prevPos() {
return(m_prevPosition);
}
function set prevPos(pos) {
m_prevPosition = pos;
//return(prevPos);
}
function get pos() {
return(m_curPosition);
}
function set pos(pos) {
m_curPosition = pos;
//return(this.pos);
}
function initParticle(x, y, mass, mc) {
if (x == undefined) {
x = 0;
}
if (y == undefined) {
y = 0;
}
if (mass == undefined) {
mass = 1;
}
moveTo(x, y);
m_mass = mass;
m_accelerate.x = 0;
m_accelerate.y = 0;
if (mc) {
setMovie(mc);
}
return(this);
}
function moveTo(nx, ny) {
m_curPosition.x = (m_prevPosition.x = nx);
m_curPosition.y = (m_prevPosition.y = ny);
synchronizeMovie();
}
function verlet(dTime, koeffDamp) {
m_buckup.copyFrom(m_curPosition);
m_curPosition.x = m_curPosition.x + (((m_curPosition.x - m_prevPosition.x) * koeffDamp) + (m_accelerate.x * dTime));
m_curPosition.y = m_curPosition.y + (((m_curPosition.y - m_prevPosition.y) * koeffDamp) + (m_accelerate.y * dTime));
m_buckup.copyTo(m_prevPosition);
synchronizeMovie();
}
function checkCollision(hitMovie) {
}
function synchronizeMovie() {
}
function moveMovieToCurentPosition() {
m_mc._x = m_curPosition.x;
m_mc._y = m_curPosition.y;
}
function setMovie(mc) {
if ((mc == null) || (mc == undefined)) {
synchronizeMovie = function () {
};
m_mc = null;
} else {
m_mc = mc;
synchronizeMovie = moveMovieToCurentPosition;
}
}
function getMovie() {
return(m_mc);
}
}
Symbol 317 MovieClip [__Packages.com.ACA.primitives.Wheel] Frame 0
class com.ACA.primitives.Wheel extends com.ACA.primitives.Particle
{
var m_rim, rot, m_radius, m_speed, m_acceleration, initParticle, m_koeffSpring, m_koeffSlip, m_maxAccSpeed, m_accSpeed, intersectionFlag, lastIntersPoint, lastN, hitPointArray, normalArray, hitArray, intersArray, n_part, oldPos, _p, _n, p3, m_prevPosition, synchronizeMovie, m_mc, m_curPosition;
function Wheel () {
super();
}
function setRotationMovie(rotationMovie) {
if ((rotationMovie == undefined) || (rotationMovie == null)) {
rotateMovie = function () {
};
m_rim = null;
} else {
rotateMovie = rmovie;
m_rim = rotationMovie;
}
}
function rmovie() {
rot.rotate(m_speed / m_radius);
m_rim._rotation = Math.atan2(rot.y, rot.x) * ANGLE_180_DIV_PI;
}
function setAccelerate(nAccelerate) {
m_acceleration = nAccelerate;
}
function getAccelerate() {
return(m_acceleration);
}
function initWheel(x, y, mass, rad, maxAccSpeed, mc, rotationMovie, koeffSpring, koeffSlip) {
_innerInit();
initParticle(x, y, mass, mc);
if (koeffSpring == undefined) {
koeffSpring = 0.1;
}
if (koeffSlip == undefined) {
koeffSlip = 0.1;
}
m_koeffSpring = koeffSpring;
m_koeffSlip = koeffSlip;
setRotationMovie(rotationMovie);
m_radius = rad;
m_maxAccSpeed = maxAccSpeed;
m_speed = 0;
m_accSpeed = 0;
rot = new com.ACA.util.Vector(1, 0);
intersectionFlag = false;
lastIntersPoint = new com.ACA.util.Vector(0, 0);
lastN = new com.ACA.util.Vector(0, 0);
var _local3 = (Math.PI*2) / m_hitCount;
hitPointArray = new Array(m_hitCount);
normalArray = new Array(m_hitCount);
hitArray = new Array(m_hitCount);
intersArray = new Array();
var _local2 = 0;
while (_local2 < m_hitCount) {
hitPointArray[_local2] = new com.ACA.util.Vector(Math.sin(_local3 * _local2) * m_radius, (-Math.cos(_local3 * _local2)) * m_radius);
normalArray[_local2] = hitPointArray[_local2].multNew(-1);
normalArray[_local2].normalize();
_local2++;
}
m_acceleration = 0;
return(this);
}
function verlet(dTime, koeffDamp) {
super.verlet(dTime, koeffDamp);
m_accSpeed = Math.max(-m_maxAccSpeed, Math.min(m_maxAccSpeed, m_accSpeed + (m_acceleration * dTime)));
m_speed = Math.max((-m_maxSpeed) * dTime, Math.min((m_speed * koeffDamp) + m_accSpeed, m_maxSpeed * dTime));
rotateMovie();
}
function rotateMovie() {
}
function _innerInit() {
n_part = new com.ACA.util.Vector(0, 0);
oldPos = new com.ACA.util.Vector(0, 0);
_p = new com.ACA.util.Vector(0, 0);
_n = new com.ACA.util.Vector(0, 0);
p3 = new com.ACA.util.Vector(0, 0);
}
function checkCollision(hit_mc) {
var _local14 = false;
var _local3 = 0;
var _local4 = 0;
var _local15 = 0;
_p.init(0, 0);
oldPos.init(m_prevPosition.x, m_prevPosition.y);
_n.init(0, 0);
n_part.init(0, 0);
synchronizeMovie();
var _local6 = 0;
while (_local6 < m_hitCount) {
hitPointArray[_local6].copyTo(_p);
m_mc.localToGlobal(_p);
hitArray[_local6] = hit_mc.hitTest(_p.x, _p.y, true);
if (hitArray[_local6]) {
_local14 = true;
_local3 = _local6;
_local15++;
}
_local6++;
}
if (_local15 == m_hitCount) {
m_curPosition.x = m_prevPosition.x + ((m_curPosition.x - m_prevPosition.x) * 0.3);
m_curPosition.y = m_prevPosition.y + ((m_curPosition.y - m_prevPosition.y) * 0.3);
synchronizeMovie();
return(undefined);
}
if (_local14) {
var _local2 = 0;
while (true) {
_local2++;
if (_local2 == m_hitCount) {
_local2 = 0;
}
if (!hitArray[_local2]) {
_local3 = -1;
var _local5 = 0;
while (_local5 < m_hitCount) {
_local2++;
if (_local2 == m_hitCount) {
_local2 = 0;
}
if (_local3 == -1) {
if (hitArray[_local2]) {
_local3 = _local2;
_n.plus(normalArray[_local2]);
normalArray[_local2].copyTo(n_part);
}
} else if (!hitArray[_local2]) {
_local4 = _local2 - 1;
if (_local4 < 0) {
_local4 = m_hitCount - 1;
}
intersArray.push({k1:_local3, k2:_local4, n:new com.ACA.util.Vector(n_part.x, n_part.y)});
_local3 = -1;
} else {
_n.plus(normalArray[_local2]);
n_part.plus(normalArray[_local2]);
}
_local5++;
}
break;
}
}
p3.init(0, 0);
if (intersArray.length > 0) {
_n.normalize();
if (intersectionFlag) {
_n.x = _n.x + lastN.x;
_n.y = _n.y + lastN.y;
_n.x = _n.x / 2;
_n.y = _n.y / 2;
}
var _local16 = intersArray.length;
var _local7;
var _local10 = 0;
while (_local10 < _local16) {
_local7 = intersArray.pop();
_local3 = _local7.k1;
_local4 = _local7.k2;
_local7.n.copyTo(n_part);
m_curPosition.minusNew(m_prevPosition).copyTo(p3);
if (_n.scalar(p3) < 0) {
var _local12 = Math.atan2(_n.y, _n.x);
p3.rotate(-_local12);
p3.x = (-p3.x) * m_koeffSpring;
p3.rotate(_local12);
pushOut(_local3, _local4, n_part, hit_mc);
m_prevPosition.x = m_curPosition.x - p3.x;
m_prevPosition.y = m_curPosition.y - p3.y;
} else {
pushOut(_local3, _local4, n_part, hit_mc);
}
_local10++;
}
validateRotation(_n, oldPos);
intersectionFlag = true;
m_curPosition.copyTo(lastIntersPoint);
_n.copyTo(lastN);
}
} else if (intersectionFlag) {
validateRotation(lastN, oldPos);
intersectionFlag = false;
}
synchronizeMovie();
}
function pushOut(k1, k2, n, hit_mc) {
n.normalize();
if (k1 != k2) {
var _local9 = new com.ACA.util.Vector(0, 0);
var _local8 = _local9.getDistanceTo(hitPointArray[k1], hitPointArray[k2]);
_local8 = m_radius - Math.abs(_local8);
m_curPosition.plus(n.multNew(_local8));
m_prevPosition.plus(n.multNew(_local8));
} else {
var _local6 = n.multNew(-m_radius);
var _local4 = new com.ACA.util.Vector(0, 0);
var _local5 = 0;
var _local3 = 0.03;
if (true) {
_local6.copyTo(_local4);
m_mc.localToGlobal(_local4);
if (hit_mc.hitTest(_local4.x, _local4.y, true)) {
_local5++;
m_curPosition.x = m_curPosition.x + (n.x * _local3);
m_curPosition.y = m_curPosition.y + (n.y * _local3);
synchronizeMovie();
// unexpected jump
}
_local5--;
m_curPosition.x = m_curPosition.x - (n.x * _local3);
m_curPosition.y = m_curPosition.y - (n.y * _local3);
m_prevPosition.plus(n.multNew(_local3 * _local5));
}
}
}
function validateRotation(n, oldPos) {
if ((!intersectionFlag) && (Math.abs(m_accSpeed) > 0.01)) {
if (Math.abs(m_accSpeed) < ((m_maxAccSpeed * 0.02) / 2)) {
m_accSpeed = 0;
} else if (m_accSpeed > 0) {
m_accSpeed = m_maxAccSpeed * 0.02;
} else {
m_accSpeed = (-m_maxAccSpeed) * 0.02;
}
}
var _local3 = new com.ACA.util.Vector(-n.y, n.x);
var _local6 = m_curPosition.minusNew(oldPos);
var _local5 = Math.atan2(_local3.y, _local3.x);
var _local2 = _local6.rotateNew(-_local5);
m_speed = _local2.x + m_accSpeed;
_local2.y = 0;
_local2.rotate(_local5);
var _local4 = 1 - m_koeffSlip;
m_curPosition.x = (m_curPosition.x + ((_local3.x * m_accSpeed) * _local4)) - (m_koeffFriction * _local2.x);
m_curPosition.y = (m_curPosition.y + ((_local3.y * m_accSpeed) * _local4)) - (m_koeffFriction * _local2.y);
m_accSpeed = m_accSpeed * m_koeffSlip;
}
function hasIntersection() {
return(intersectionFlag);
}
static var m_maxSpeed = 180;
static var m_hitCount = 16;
static var m_koeffFriction = 0.03;
static var ANGLE_180_DIV_PI = 57.2957795130823;
}
Symbol 318 MovieClip [__Packages.com.ACA.constraints.SpringConstraint] Frame 0
class com.ACA.constraints.SpringConstraint
{
var _p1, _p2, coeffV, coeffH, restLen;
function SpringConstraint () {
}
function set p1(nP1) {
_p1 = nP1;
//return(p1);
}
function get p1() {
return(_p1);
}
function set p2(nP2) {
_p2 = nP2;
//return(p2);
}
function get p2() {
return(_p2);
}
function init(cV, cH, p1, p2) {
if (p1) {
_p1 = p1;
_p2 = p2;
}
if (cV) {
coeffV = cV;
coeffH = cH;
}
fixDistance();
return(this);
}
function fixDistance() {
restLen = com.ACA.util.Vector.getDistanceBetween(_p1.__get__pos(), _p2.__get__pos());
}
function resolve() {
var _local9 = _p1.__get__pos().minusNew(_p2.__get__pos());
var _local2 = com.ACA.util.Vector.getDistanceBetween(_p1.__get__pos(), _p2.__get__pos());
var _local8 = (_local2 - restLen) / _local2;
var _local3;
if (_local2 > restLen) {
_local3 = coeffH;
} else {
_local3 = coeffV;
}
var _local6 = _p1.__get__mass();
var _local5 = _p2.__get__mass();
var _local7 = (_local8 * _local3) / (_local6 + _local5);
var _local4 = _local9.multNew(_local7);
_p1.__get__pos().minus(_local4.multNew(_local6));
_p2.__get__pos().plus(_local4.multNew(_local5));
}
}
Symbol 319 MovieClip [__Packages.com.ACA.constraints.AngularConstraint] Frame 0
class com.ACA.constraints.AngularConstraint
{
var p0, p1, p2, sign;
function AngularConstraint (np0, np1, np2) {
p0 = np0;
p1 = np1;
p2 = np2;
fixDistance();
}
function fixDistance() {
sign = p0.__get__pos().getDistanceTo(p1.__get__pos(), p2.__get__pos());
if (sign < 0) {
sign = -1;
} else {
sign = 1;
}
}
function resolve() {
var _local3 = p0.__get__pos().getDistanceTo(p1.__get__pos(), p2.__get__pos());
if ((sign * _local3) <= 1) {
var _local2 = new com.ACA.util.Vector(p2.__get__pos().x, p2.__get__pos().y);
_local2.minus(p1.__get__pos());
_local2.normalize();
_local2.rotate(PI2 * sign);
_local2.mult(Math.abs(_local3) + 1);
p1.__get__pos().minus(_local2);
}
}
static var PI2 = (Math.PI/2);
}
Symbol 320 MovieClip [__Packages.com.UI.Truck] Frame 0
class com.UI.Truck extends com.ACA.Vehicle
{
var bornTime, inProcess, mode, getKeys, snd1, m_vehicleMovie, flipTime, construct, setVehicleParam, m_forwardWheel, m_backWheel, m_accForwardWheel, processKey;
function Truck () {
super();
bornTime = getTimer();
inProcess = true;
mode = true;
getKeys = true;
snd1 = com.sound.CSound.instance;
}
function get image() {
return(m_vehicleMovie);
}
function init(carPlace, engine) {
flipTime = getTimer();
if (carPlace.xx == undefined) {
carPlace.xx = carPlace._x;
}
if (carPlace.yy == undefined) {
carPlace.yy = carPlace._y;
}
carPlace._x = (carPlace._y = 0);
var _local4 = carPlace.attachMovie("truckbody", "_dmCarBody", 100);
var _local15 = carPlace.attachMovie("wheel", "_dmWheel1", 1010);
var _local12 = carPlace.attachMovie("wheel", "_dmWheel2", 1020);
_local4._x = carPlace.xx;
_local4._y = carPlace.yy;
_local4._y = 700;
_local4.copii._visible = false;
var _local16 = new com.ACA.primitives.Wheel();
var _local13 = new com.ACA.primitives.Wheel();
var _local10 = new com.ACA.primitives.Particle();
var _local9 = new com.ACA.primitives.Particle();
var _local8 = new com.ACA.constraints.SpringConstraint();
var _local7 = new com.ACA.constraints.SpringConstraint();
var _local6 = new com.ACA.constraints.SpringConstraint();
var _local18 = new com.ACA.constraints.SpringConstraint();
var _local17 = new com.ACA.constraints.SpringConstraint();
var _local14 = new com.ACA.constraints.SpringConstraint();
var _local5 = new com.ACA.composites.Composite();
_local5.init(_local16.initWheel(0, 0, 5, 20, 20), _local10.initParticle(0, 0, 15), _local9.initParticle(0, 0, 15), _local13.initWheel(0, 0, 5, 20, 20), _local8.init(0.3, 0.3), _local7.init(0.5, 0.5), _local6.init(0.7, 0.7), _local18.init(0.9, 0.9), _local17.init(0.5, 0.5), _local14.init(0.3, 0.3));
construct(_local5, _local4, _local4, _local15, _local12);
engine.__set__gravity(7);
var _local3 = com.ACA.Vehicle.getDefaultVehicleParam();
_local3.accelerateForwardWheel = 33;
_local3.accelerateBackWheel = 38;
_local3.brakeForwardWheel = -10;
_local3.brakeBackWheel = -20;
_local3.accPercMult = engine.__get__gravity() * 6;
_local3.normalYLimit = 0.9;
setVehicleParam(_local3);
_local5.addToEngine(engine);
}
function stopCar(stopPoint) {
if (m_forwardWheel.m_speed > 2) {
kids = false;
m_backWheel.setAccelerate(-10);
m_forwardWheel.setAccelerate(-10);
} else if (m_vehicleMovie._x < stopPoint) {
m_forwardWheel.setAccelerate(m_accForwardWheel);
kids = false;
} else if (m_vehicleMovie._x > (stopPoint + 50)) {
m_backWheel.setAccelerate(-10);
m_forwardWheel.setAccelerate(-10);
kids = false;
} else {
kids = true;
}
}
function showKids() {
trace(m_vehicleMovie.copii);
m_vehicleMovie.copii._visible = true;
m_vehicleMovie.copii.play();
}
function process() {
var _local3 = 0;
if (inProcess) {
if (!m_vehicleMovie._parent._parent._parent.bodyCrash) {
if (getKeys) {
if (Key.isDown(37)) {
_local3 = _local3 | com.ACA.Vehicle.KM_MOVE_BODY_BACK;
} else if (Key.isDown(39)) {
_local3 = _local3 | com.ACA.Vehicle.KM_MOVE_BODY_FORWARD;
}
}
if (Key.isDown(38)) {
_local3 = _local3 | com.ACA.Vehicle.KM_ACCELERATE;
} else if (Key.isDown(40)) {
_local3 = _local3 | com.ACA.Vehicle.KM_BRAKE;
}
_level0.game.bg_level.back_mc.stop();
} else if (Key.isDown(38) && (Key.isDown(37))) {
moveFor();
} else if (Key.isDown(38) && (Key.isDown(39))) {
moveBack();
}
}
processKey(_local3);
super.process();
}
function moveFor() {
m_backWheel.__get__accelerate().plusXY(0, -100);
}
function moveBack() {
m_forwardWheel.__get__accelerate().plusXY(0, -100);
}
function getMC() {
return(m_vehicleMovie);
}
function getHitForBonus() {
return(m_vehicleMovie.mcHit);
}
function checkDeathPoints(hitMov) {
var _local2 = new Object();
for (var _local4 in m_vehicleMovie.mcDeathPoints) {
_local2.x = m_vehicleMovie.mcDeathPoints[_local4]._x;
_local2.y = m_vehicleMovie.mcDeathPoints[_local4]._y;
m_vehicleMovie.mcDeathPoints.localToGlobal(_local2);
if (hitMov.hitTest(_local2.x, _local2.y, true)) {
return(true);
}
}
return(false);
}
function chkDeath(ht) {
var _local2 = new Object();
for (var _local4 in m_vehicleMovie.mcDeathPoints) {
_local2.x = m_vehicleMovie.mcDeathPoints[_local4]._x;
_local2.y = m_vehicleMovie.mcDeathPoints[_local4]._y;
m_vehicleMovie.mcDeathPoints.localToGlobal(_local2);
if (ht.hitTest(_local2.x, _local2.y, true)) {
return(true);
}
}
return(false);
}
static var TRICK_ANGLE = 130;
static var EVENT_TRICK = "trick";
static var TRICK_FRONT_FLIP = 0;
static var TRICK_BACK_FLIP = 1;
var kids = false;
}
Symbol 74 MovieClip Frame 1
stop();
Symbol 74 MovieClip Frame 20
stop();
Symbol 78 MovieClip Frame 1
stop();
Symbol 78 MovieClip Frame 20
stop();
Symbol 85 MovieClip Frame 1
instructions_btn.onRelease = function () {
_root.gotoAndStop("instructions");
};
Symbol 107 MovieClip Frame 372
gotoAndPlay ("witch");
Symbol 113 Button
on (release) {
_root.gamescore = _root.gamescore - _root.levelscore;
_parent._parent.removeMovieClip();
_root.gotoAndStop("start");
}
Symbol 115 Button
on (release) {
getURL ("http://www.101cargames.com", "_blank");
}
Symbol 117 Button
on (press) {
getURL ("http://www.101cargames.com", "_blank");
}
Symbol 120 Button
on (release) {
_root.dieCount = 0;
_root.gamescore1 = 0;
_root.currentlevel = 1;
trace(_parent._parent);
trace(this);
_parent._parent.removeMovieClip();
_root.gotoAndStop("start");
}
Symbol 128 Button
on (release) {
_root.dieCount = 0;
_root.currentlevel++;
trace(_parent._parent);
trace(this);
_parent._parent.removeMovieClip();
_root.gotoAndStop("start");
}
Symbol 134 Button
on (press) {
_root.game.b.pauseOn = true;
}
Symbol 149 MovieClip Frame 1
stop();
gotoAndStop(_root.currentlevel);
Symbol 150 MovieClip Frame 64
stop();
Symbol 153 MovieClip [popup] Frame 1
stop();
more_btn.onRelease = function () {
getURL ("http://www.101cargames.com", "_blank");
};
more_btn.onRollOver = function () {
more_btn.gotoAndPlay("over");
};
more_btn.onRollOut = function () {
more_btn.gotoAndPlay("out");
};
Symbol 153 MovieClip [popup] Frame 10
stop();
Symbol 153 MovieClip [popup] Frame 20
stop();
var se = _root.game.scorepanel.timer;
var s = se.split(":")[1];
lscore = (_root.levelscore - (_root.dieCount * 100)) + (Number(s) * 100);
gscore = _root.gamescore1;
Symbol 153 MovieClip [popup] Frame 29
stop();
Symbol 153 MovieClip [popup] Frame 30
stop();
Instance of Symbol 138 MovieClip in Symbol 153 MovieClip [popup] Frame 30
on (release) {
getURL ("http://www.101cargames.com", "_blank");
}
Symbol 153 MovieClip [popup] Frame 41
stop();
crash.play();
Instance of Symbol 74 MovieClip in Symbol 153 MovieClip [popup] Frame 50
on (press) {
_root.game.b.pauseOn = false;
}
Symbol 159 MovieClip Frame 1
stop();
trace("back" + this);
Symbol 159 MovieClip Frame 1000
stop();
Symbol 163 MovieClip Frame 1000
stop();
Symbol 167 MovieClip Frame 1000
stop();
Symbol 172 MovieClip Frame 1
onEnterFrame = function () {
gotoAndStop(_root.currentlevel);
};
Symbol 178 MovieClip [bg] Frame 1
#initclip 18
Object.registerClass("bg", com.UI.Game);
#endinitclip
Instance of Symbol 177 MovieClip "hitspace" in Symbol 178 MovieClip [bg] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 184 MovieClip Frame 1
stop();
Symbol 198 MovieClip Frame 1
stop();
Symbol 199 MovieClip Frame 1
stop();
init();
trace("game_game" + this);
more_btn.onRelease = function () {
getURL ("http://www.101cargames.com", "_blank");
};
more_btn.onRollOver = function () {
more_btn.gotoAndPlay("over");
};
more_btn.onRollOut = function () {
more_btn.gotoAndPlay("out");
};
Symbol 278 MovieClip Frame 1
stop();
Symbol 278 MovieClip Frame 65
stop();
var bla = true;
trace(this.bla);
Symbol 291 MovieClip Frame 1
stop();
Symbol 291 MovieClip Frame 27
gotoAndPlay (2);
Symbol 298 MovieClip [truckbody] Frame 1
onEnterFrame = function () {
carlig_mc._rotation = -this._rotation;
};