Frame 1
fscommand ("showmenu", "false");
_focusrect = false;
_global.use_playtomic = true;
if (_global.use_playtomic) {
trace("PLAYTOMIC: Init");
Playtomic.Log.View(940132, "e1b61faa86de4f55", _root._url);
}
_global.openSite = function (link_name, link_group) {
var _local2 = "http://www.onlinefreegames.com/stats/mountain-atv-nd.html";
trace((((("openSite (" + link_name) + ", ") + link_group) + "): url = ") + _local2);
if (_global.use_playtomic) {
trace((((("open " + _local2) + " ") + link_name) + " ") + link_group);
_global.openSitePlaytomic(_local2, link_name, link_group);
} else {
getURL (_local2, "_blank");
}
};
_global.openSitePlaytomic = function (url_string, link_name, link_group) {
var _local1 = Playtomic.Link.Open(url_string, link_name, link_group);
if (!_local1) {
trace("can't open url " + url_string);
}
};
_global.gameName = "mountainatv";
_root.loaderAnimDelta = 5;
_root.loaderAnimPause = 2500;
_root.parsingAnimDelta = 10;
Instance of Symbol 10 MovieClip "status_mc" in Frame 2
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
t = _root.getBytesTotal();
l = _root.getBytesLoaded();
gotoAndStop(Math.floor((l / t) * 100));
tf.text = Math.floor((l / t) * 100) + "%";
if (t > 0) {
if ((l < t) && (_alpha < 100)) {
_alpha = (_alpha + 5);
}
if ((l == t) && (_alpha > 0)) {
_alpha = (_alpha - 5);
}
}
}
Frame 3
stop();
Instance of Symbol 13 MovieClip in Frame 3
onClipEvent (load) {
_alpha = 0;
state = 0;
_root.stop();
}
onClipEvent (enterFrame) {
l = _root.getBytesLoaded();
t = _root.getBytesTotal();
if (state == 0) {
_alpha = (_alpha + 5);
if (_alpha >= 100) {
_alpha = 100;
state = 1;
startPause = getTimer();
}
} else if ((((state == 1) && (t == l)) && (l > 10)) && ((getTimer() - startPause) > 2500)) {
this._alpha = this._alpha - 5;
if (_alpha < 0) {
_root.gotoAndStop("lbStart");
}
}
}
Frame 32
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__("db0c2ebe", this, 10301, true);
Symbol 708 MovieClip [__Packages.Playtomic.LogRequest] Frame 0
class Playtomic.LogRequest
{
var Pieces;
function LogRequest () {
}
function Queue(data) {
Pieces++;
Data = Data + (((Data == "") ? "" : "~") + data);
if ((Pieces == 8) || (Data.length > 300)) {
Pieces = 0;
Ready = true;
}
}
function Send() {
var _local3 = function (success) {
if ((this.Data.indexOf("v/") == 0) || (this.Data.indexOf("~v/") > -1)) {
Playtomic.Log.IncreaseViews();
}
if ((this.Data.indexOf("p/") == 0) || (this.Data.indexOf("~p/") > -1)) {
Playtomic.Log.IncreasePlays();
}
};
var _local2 = new LoadVars();
_local2.sendAndLoad(((((((((("http://g" + Playtomic.Log.GUID) + ".api.playtomic.com/Tracker/q.aspx?swfid=") + Playtomic.Log.SWFID) + "&q=") + Data) + "&url=") + Playtomic.Log.SourceUrl) + "&") + Math.random()) + "z", _local3, "POST");
}
var Data = "";
var Ready = false;
}
Symbol 709 MovieClip [__Packages.Playtomic.Log] Frame 0
class Playtomic.Log
{
static var SourceUrl, Cookie;
function Log () {
}
static function View(swfid, guid, defaulturl) {
if (swfid == undefined) {
swfid = 0;
}
if (guid == undefined) {
guid = "";
}
if (defaulturl == undefined) {
defaulturl = "";
}
if (SWFID > 0) {
return(undefined);
}
SWFID = swfid;
GUID = guid;
Enabled = true;
if ((SWFID == 0) || (GUID == "")) {
Enabled = false;
return(undefined);
}
if (((defaulturl.indexOf("http://") != 0) && (System.security.sandboxType != "localWithNetwork")) && (System.security.sandboxType != "localTrusted")) {
Enabled = false;
return(undefined);
}
SourceUrl = GetUrl(defaulturl);
if (((SourceUrl == null) || (SourceUrl == "")) || (SourceUrl.indexOf("https://") == 0)) {
Enabled = false;
return(undefined);
}
Cookie = SharedObject.getLocal("playtomic");
var _local5 = GetCookie("views");
Send("v/" + (_local5 + 1), true);
_global.setTimeout(PingServer, 60000);
}
static function ForceSend() {
Request.Send();
Request = new Playtomic.LogRequest();
}
static function IncreaseViews() {
var _local1 = GetCookie("views");
_local1++;
SaveCookie("views", _local1);
}
static function IncreasePlays() {
Plays++;
}
static function Play() {
if (!Enabled) {
return(undefined);
}
LevelCounters = new Array();
LevelAverages = new Array();
LevelRangeds = new Array();
Send("p/" + (Plays + 1), true);
}
static function CustomMetric(name, group, unique) {
if (!Enabled) {
return(undefined);
}
if ((group == null) || (group == undefined)) {
group = "";
}
if ((unique == null) || (unique == undefined)) {
unique = false;
}
if (unique) {
if (Customs.indexOf(name) > -1) {
return(undefined);
}
Customs.push(name);
}
Send((("c/" + Clean(name)) + "/") + Clean(group));
}
static function Link(url, name, group, unique, total, fail) {
if (!Enabled) {
return(undefined);
}
Send((((((((((("l/" + Clean(name)) + "/") + Clean(group)) + "/") + Clean(url)) + "/") + unique) + "/") + total) + "/") + fail);
}
static function LevelCounterMetric(name, level, unique) {
if (!Enabled) {
return(undefined);
}
if (unique) {
if (LevelCounters.indexOf(name) > -1) {
return(undefined);
}
LevelCounters.push(name);
}
Send((("lc/" + Clean(name)) + "/") + Clean(level));
}
static function LevelRangedMetric(name, level, value, unique) {
if (!Enabled) {
return(undefined);
}
if (unique) {
if (LevelRangeds.indexOf(name) > -1) {
return(undefined);
}
LevelRangeds.push(name);
SaveCookie("lr_" + name, 1);
}
Send((((("lr/" + Clean(name)) + "/") + Clean(level)) + "/") + value);
}
static function LevelAverageMetric(name, level, value, unique) {
if (!Enabled) {
return(undefined);
}
if (unique) {
if (LevelAverages.indexOf(name) > -1) {
return(undefined);
}
LevelAverages.push(name);
}
Send((((("la/" + Clean(name)) + "/") + Clean(level)) + "/") + value);
}
static function PingServer() {
if (!Enabled) {
return(undefined);
}
Pings++;
Send((("t/" + (FirstPing ? "y" : "n")) + "/") + Pings, true);
if (FirstPing) {
FirstPing = false;
setInterval(PingServer, 60000);
}
}
static function Send(s, view) {
if (view == undefined) {
view = false;
}
Request.Queue(s);
if ((Request.Ready || (view)) || (!Queue)) {
Request.Send();
Request = new Playtomic.LogRequest();
}
}
static function GetCookie(n) {
if (Cookie.data[n] == undefined) {
return(0);
}
return(parseInt(Cookie.data[n]));
}
static function SaveCookie(n, v) {
var _local1 = SharedObject.getLocal("swfstats");
_local1.data[n] = v.toString();
_local1.flush();
}
static function Clean(s) {
while (s.indexOf("/") > -1) {
s = s.replace("/", "\\");
}
while (s.indexOf("~") > -1) {
s = s.replace("~", "-");
}
return(escape(s));
}
static function Replace(str, find, replace) {
return(str.split(find).join(replace));
}
static function GetUrl(defaulturl) {
return(defaulturl);
}
static var Enabled = false;
static var Queue = true;
static var SWFID = 0;
static var GUID = "";
static var Request = new Playtomic.LogRequest();
static var FirstPing = true;
static var Pings = 0;
static var Plays = 0;
static var HighestGoal = 0;
static var Customs = new Array();
static var LevelCounters = new Array();
static var LevelAverages = new Array();
static var LevelRangeds = new Array();
}
Symbol 710 MovieClip [__Packages.Playtomic.Link] Frame 0
class Playtomic.Link
{
function Link () {
}
static function Open(url, name, group) {
var _local9 = 0;
var _local5 = 0;
var _local3 = 0;
var _local4 = 0;
var _local8 = 0;
var _local11 = 0;
var _local6 = (url + ".") + name;
var _local7;
var _local1 = url;
_local1 = Replace(_local1, "http://", "");
if (_local1.indexOf("/") > -1) {
_local1 = _local1.substring(0, _local1.indexOf("/"));
}
if (_local1.indexOf("?") > -1) {
_local1 = _local1.substring(0, _local1.indexOf("?"));
}
_local1 = ("http://" + _local1) + "/";
var _local2 = _local1;
if (_local2.indexOf("//") > -1) {
_local2 = _local2.substring(_local2.indexOf("//") + 2);
}
_local2 = Replace(_local2, "www.", "");
if (_local2.indexOf("/") > -1) {
_local2 = _local2.substring(0, _local2.indexOf("/"));
}
try {
getURL (url, "_blank");
if (Clicks.indexOf(_local6) > -1) {
_local3 = 1;
} else {
_local3 = 1;
_local9 = 1;
Clicks.push(_local6);
}
if (Clicks.indexOf(_local2) > -1) {
_local4 = 1;
} else {
_local4 = 1;
_local5 = 1;
Clicks.push(_local2);
}
_local7 = true;
} catch(err) {
_local8 = 1;
_local11 = 1;
_local7 = false;
}
Playtomic.Log.Link(_local1, _local2.toLowerCase(), "DomainTotals", _local5, _local4, _local11);
Playtomic.Log.Link(url, name, group, _local9, _local3, _local8);
Playtomic.Log.ForceSend();
return(_local7);
}
static function Replace(str, find, replace) {
return(str.split(find).join(replace));
}
static var Clicks = new Array();
}
Symbol 711 MovieClip [__Packages.CGame] Frame 0
class CGame extends MovieClip
{
static var m_instance, levels, m_numberLevelsOpened, levelNum, gameType, timeChangeScore, __get__time, __get__txtLevel_;
var txtTime, m_playedTimes;
function CGame () {
super();
m_instance = this;
levels = new Array();
levels.push({mc:"dmLevel8", points:30000});
levels.push({mc:"dmLevel7", points:30000});
levels.push({mc:"dmLevel4", points:30000});
levels.push({mc:"dmLevel6", points:30000});
levels.push({mc:"dmLevel2", points:30000});
levels.push({mc:"dmLevel3", points:30000});
levels.push({mc:"dmLevel9", points:30000});
levels.push({mc:"dmLevel5", points:30000});
levels.push({mc:"dmLevel1", points:30000});
txtTime = "";
m_playedTimes = 0;
m_numberLevelsOpened = loadLevelsOpened();
}
static function saveLevelsOpened() {
var _local2 = SharedObject.getLocal(_global.gameName, "/");
if ((_local2.data.numberOpened < m_numberLevelsOpened) || (_local2.data.numberOpened == undefined)) {
_local2.data.numberOpened = m_numberLevelsOpened;
_local2.flush();
}
}
static function loadLevelsOpened() {
var _local2 = SharedObject.getLocal(_global.gameName, "/");
if ((_local2.data.numberOpened == undefined) || (_local2.data.numberOpened < 1)) {
_local2.data.numberOpened = 1;
_local2.flush();
}
return(_local2.data.numberOpened);
}
static function butLevelSelect() {
m_instance.gotoAndStop("lbLevelSelect");
}
static function butStart() {
levelNum = 1;
time = ("");
gameType = 1;
m_instance.full_m_score = 0;
m_instance.gotoAndStop("lbRace");
}
static function butStartFrom(num) {
levelNum = num;
time = ("");
gameType = 1;
m_instance.full_m_score = 0;
m_instance.gotoAndStop("lbRace");
}
static function butStartNext() {
m_instance.gotoAndStop("lbRace");
if (gameType == 1) {
m_instance.guiBar.gotoAndStop(2);
}
}
static function butSwitchPause() {
m_instance.m_race.__set__pauseOn(!m_instance.m_race.__get__pauseOn());
}
static function butEndRaceVictory() {
if (m_numberLevelsOpened < levelNum) {
m_numberLevelsOpened = levelNum;
trace("NUMBER OF OPENED LEVELS WAS UPDATED AND NOW EQUAL " + m_numberLevelsOpened);
}
saveLevelsOpened();
if (_global.use_playtomic) {
trace(("Win level: " + (levelNum - 1)) + "; PLAYTOMIC stat was updated!");
Playtomic.Log.LevelCounterMetric("Completed", levelNum - 1);
Playtomic.Log.ForceSend();
}
m_instance.gotoAndStop("lbStatistics");
instance.tf2.text = (_global.takenBonus1 + "/") + _global.allBonus1;
instance.tf22.text = _global.takenScore1;
instance.tf1.text = (_global.takenBonus2 + "/") + _global.allBonus2;
instance.tf11.text = _global.takenScore2;
instance.tf3.text = (_global.takenBonus3 + "/") + _global.allBonus3;
instance.tf33.text = _global.takenScore3;
instance.tf4.text = (_global.takenBonus4 + "/") + _global.allBonus4;
instance.tf44.text = _global.takenScore4;
}
static function butEndRace() {
m_instance.gotoAndStop("lbFinalStatistics");
instance.tf2.text = (_global.takenBonus1 + "/") + _global.allBonus1;
instance.tf22.text = _global.takenScore1;
instance.tf1.text = (_global.takenBonus2 + "/") + _global.allBonus2;
instance.tf11.text = _global.takenScore2;
instance.tf3.text = (_global.takenBonus3 + "/") + _global.allBonus3;
instance.tf33.text = _global.takenScore3;
instance.tf4.text = (_global.takenBonus4 + "/") + _global.allBonus4;
instance.tf44.text = _global.takenScore4;
}
static function butEndRaceLoose() {
m_instance.gotoAndStop("lbGameOver");
}
static function butEndRaceTimeAttack() {
m_instance.gotoAndStop("lbGameOverTimeAttack");
}
static function butAbout() {
m_instance.gotoAndStop("lbAbout");
}
static function butStartContest() {
gameType = 1;
levelNum = 1;
butStart();
}
static function butStartLevel(n) {
gameType = 2;
levelNum = n;
butStart();
}
static function butSelectLevel() {
m_instance.gotoAndStop("lbSelect");
}
static function butBackToMenu() {
m_instance.gotoAndStop("lbSplash");
}
static function butBackToSplash() {
m_instance.gotoAndStop("lbSplash");
}
static function set score(nScore) {
if (nScore < 0) {
nScore = 0;
}
m_instance.m_score = nScore;
m_instance.txtScore = String(score + full_score);
m_instance.txtScore_ins = String(score);
if (gameType == 1) {
m_instance.txtScore_ins = m_instance.txtScore_ins + (" / " + levels[levelNum - 1].points);
}
timeChangeScore = getTimer();
//return(score);
}
static function set time(t) {
m_instance.txtTime = t;
//return(__get__time());
}
static function get full_score() {
return(m_instance.full_m_score);
}
static function set full_score(nScore) {
if (nScore < 0) {
nScore = 0;
}
m_instance.full_m_score = nScore;
m_instance.full_txtScore = String(full_score);
//return(full_score);
}
static function get score() {
return(m_instance.m_score);
}
static function set takenBonus(a) {
m_instance.bonusTaken = a;
setBonusTXT();
//return(takenBonus);
}
static function get takenBonus() {
return(m_instance.bonusTaken);
}
static function set allBonus(a) {
m_instance.bonusAtAll = a;
setBonusTXT();
//return(allBonus);
}
static function get allBonus() {
return(m_instance.bonusAtAll);
}
static function setBonusTXT() {
m_instance.txtBonus = (m_instance.bonusTaken + "/") + m_instance.bonusAtAll;
}
static function set txtLevel_(a) {
m_instance.txtLevel = a;
//return(__get__txtLevel_());
}
static function get instance() {
return(m_instance);
}
}
Symbol 712 MovieClip [__Packages.CRace] Frame 0
class CRace extends MovieClip
{
static var m_instance;
var dieTime, inDieMode, startPauser, savedPoint, savedScore, carType, m_level, attachMovie, _parent, lives, endTime, mm, mm_xy_ratio, mm_scale, m_pEngine, inProcess, inPostGame, m_car, FINinterval, m_pauseOn, onEnterFrame, scroll_x;
function CRace () {
super();
}
function onLoad() {
m_instance = this;
init();
pauseOn = (false);
CGame.__set__score(0);
dieTime = 0;
inDieMode = false;
}
function init() {
trace("Starting level " + (CGame.levelNum - 1));
CGame.__get__instance().txtLevelStr = ((("LEVEL " + CGame.levels[CGame.levelNum - 1].mc.substr(7, 2)) + " (order: ") + CGame.levelNum) + ")";
startPauser = 0;
CGame.__set__txtLevel_(String(CGame.levelNum));
_global.dieZ = new Array();
_global.savePointz = new Array();
savedPoint = undefined;
savedScore = 0;
carType = CGame.__get__instance().selectedCar;
m_level = attachMovie(CGame.levels[CGame.levelNum - 1].mc, "_Level1", 1001);
_parent.soundMC.gotoAndPlay("go");
lives = 5;
_parent.heartz.gotoAndStop(lives + 1);
if (CGame.gameType == 2) {
endTime = getTimer() + 60000;
}
if (usingMap) {
mm = _parent.miniMap;
mm._visible = true;
var _local7 = mm.attachMovie(CGame.levels[CGame.levelNum - 1].mc + "_mm", "map", 0);
if (_local7 == undefined) {
_local7 = mm.attachMovie(CGame.levels[CGame.levelNum - 1].mc, "map", 0);
}
var _local6 = m_level._width;
var _local5 = m_level._height;
mm_xy_ratio = mm._xscale / mm._yscale;
var _local3 = _local6 / 720;
var _local4 = _local5 / 540;
_local3 = _local3 / mm_xy_ratio;
mm_scale = (mm_ratio * 100) / Math.max(_local3, _local4);
mm.player.swapDepths(2);
mm.player._xscale = mm.player._xscale / mm_xy_ratio;
mm.miniMap_misc.swapDepths(3);
mm.map.setMask(mm.miniMap_mask);
mm.map._xscale = mm_scale / mm_xy_ratio;
mm.map._yscale = mm_scale;
} else {
_parent.miniMap._visible = false;
}
m_pEngine = new iriysoft.pengine.CParticleEngine(m_level.mcHit, 7);
newRace();
}
function newRace() {
inProcess = true;
inPostGame = false;
m_pEngine.clear();
m_car = new CCar();
m_car.init(m_level.mcVehiclePlace, m_pEngine, _parent);
m_car.addEventListener(CCar.EVENT_TRICK, mx.utils.Delegate.create(this, makeTrickMassage));
setPosition(true);
m_car.initTricks(CGame.levelNum);
_parent.sinfo.gotoAndPlay(2);
if (CGame.gameType == 1) {
_parent.sinfo.img.gotoAndStop("level" + CGame.levelNum);
}
}
function processRace() {
m_pEngine.process();
m_car.process();
startPauser++;
if (startPauser == 1) {
_global.takenBonus1 = (_global.takenBonus2 = (_global.takenBonus3 = (_global.takenBonus4 = 0)));
_global.takenScore1 = (_global.takenScore2 = (_global.takenScore3 = (_global.takenScore4 = 0)));
_global.allBonus1 = (_global.allBonus2 = (_global.allBonus3 = (_global.allBonus4 = 0)));
for (var _local7 in m_level.mcBonusPlace) {
if (m_level.mcBonusPlace[_local7].mcHit != undefined) {
switch (m_level.mcBonusPlace[_local7].subtype) {
case 1 :
_global.allBonus1++;
break;
case 2 :
_global.allBonus2++;
break;
case 3 :
_global.allBonus3++;
break;
case 4 :
_global.allBonus4++;
break;
case 5 :
_global.allBonus5++;
}
}
}
}
if (CGame.gameType == 2) {
var _local18 = Math.round((endTime - getTimer()) / 1000);
var _local21 = Math.floor(_local18 / 60);
var _local13 = _local18 % 60;
if (_local13 < 10) {
_local13 = "0" + _local13;
}
CGame.__set__time((_local21 + ":") + _local13);
if (getTimer() >= endTime) {
CGame.__set__time("0:00");
}
}
var _local15 = {x:m_car.__get__image().aPart._x, y:m_car.__get__image().aPart._y};
m_car.__get__image().aPart._parent.localToGlobal(_local15);
var _local14 = {x:m_car.__get__backWheel().__get__pos().x, y:m_car.__get__backWheel().__get__pos().y};
m_level.localToGlobal(_local14);
var _local20 = (Math.atan2(_local14.y - _local15.y, _local14.x - _local15.x) * 57.2957795130823) - m_car.__get__image()._rotation;
m_car.__get__image().aPart._rotation = _local20 + 180;
if (usingMap) {
var _local17 = (mm_scale * m_car.__get__image()._x) / 100;
var _local19 = (mm_scale * m_car.__get__image()._y) / 100;
_local17 = _local17 / mm_xy_ratio;
mm.map._x = (-_local17) + 275;
mm.map._y = (-_local19) + 200;
}
setPosition();
if (((m_level.mcFinish._x < (m_car.__get__backWheel().__get__pos().x - 50)) || (m_car.gameOverInTest)) && (!inPostGame)) {
if ((getTimer() - CGame.timeChangeScore) > 500) {
if (CGame.levelNum >= CGame.levels.length) {
trace("\u0423\u0440\u043E\u0432\u043D\u0438 \u0437\u0430\u043A\u043E\u043D\u0447\u0438\u043B\u0438\u0441\u044C");
var _local16 = attachMovie("winMF", "winMessage", 1002);
_local16._x = 360;
_local16._y = 120;
inPostGame = true;
FINinterval = setInterval(this, "endOfLevel", 1500, 1);
_parent.soundMC.gotoAndPlay("flip");
} else {
var _local16 = attachMovie("winMF", "winMessage", 1002);
_local16._x = 360;
_local16._y = 120;
inPostGame = true;
FINinterval = setInterval(this, "endOfLevel", 1500, 2);
_parent.soundMC.gotoAndPlay("flip");
}
}
if ((getTimer() >= endTime) && (CGame.gameType == 2)) {
trace("\u0412\u0440\u0435\u043C\u044F \u0432\u044B\u0448\u043B\u043E");
var _local16 = attachMovie("winMF", "winMessage", 1002);
_local16._x = 360;
_local16._y = 120;
inPostGame = true;
FINinterval = setInterval(this, "endOfLevel", 1500, 1);
_parent.soundMC.gotoAndPlay("flip");
}
}
var _local11 = m_car.getHitForBonus();
for (var _local7 in m_level.mcBonusPlace) {
if (_local11.hitTest(m_level.mcBonusPlace[_local7].mcHit)) {
m_level.mcBonusPlace[_local7].gotoAndPlay("die");
if (usingMap) {
var _local6 = m_level.mcBonusPlace[_local7]._x;
var _local5 = m_level.mcBonusPlace[_local7]._y;
for (var _local12 in mm.map.mcBonusPlace) {
var _local3 = mm.map.mcBonusPlace[_local12];
if ((((_local3._x > (_local6 - 2)) && (_local3._x < (_local6 + 2))) && (_local3._y > (_local5 - 2))) && (_local3._y < (_local5 + 2))) {
_local3._visible = false;
break;
}
}
}
switch (m_level.mcBonusPlace[_local7].type) {
case 0 :
var _local4 = bonus_0;
break;
case 1 :
_local4 = bonus_1;
break;
case 2 :
_local4 = bonus_2;
break;
case 3 :
_local4 = bonus_3;
break;
case 4 :
_local4 = bonus_4;
break;
case 5 :
_local4 = bonus_5;
break;
default :
_local4 = bonus_0;
}
switch (m_level.mcBonusPlace[_local7].subtype) {
case 1 :
_global.takenBonus1++;
_global.takenScore1 = _global.takenScore1 + _local4;
break;
case 2 :
_global.takenBonus2++;
_global.takenScore2 = _global.takenScore2 + _local4;
break;
case 3 :
_global.takenBonus3++;
_global.takenScore3 = _global.takenScore3 + _local4;
break;
case 4 :
_global.takenBonus4++;
_global.takenScore4 = _global.takenScore4 + _local4;
break;
case 5 :
_global.takenBonus5++;
_global.takenScore5 = _global.takenScore5 + _local4;
}
CGame.score = CGame.score + _local4;
CGame.__set__takenBonus((CGame.__get__takenBonus()+1));
}
}
var _local7 = 0;
while (_local7 < _global.savePointz.length) {
var _local8 = _global.savePointz[_local7];
if (savedPoint == _local8) {
} else if (_local11.hitTest(_local8.mcHit)) {
savedPoint = _local8;
savedScore = CGame.score;
var _local9 = attachMovie("dmSaved", "_dmSaved", 28000);
_local9._x = 360;
_local9._y = 170;
}
_local7++;
}
if (inProcess && ((getTimer() - m_car.bornTime) > 200)) {
if (!inPostGame) {
if (inProcess) {
_local7 = 0;
while (_local7 < _global.dieZ.length) {
var _local10 = _global.dieZ[_local7];
if (m_car.checkDeathPoints(_local10)) {
makeDie();
m_car.bar._visible = false;
}
_local7++;
}
}
if (inProcess) {
if (m_car.checkDeathPoints(m_level.mcHit)) {
inDieMode = true;
} else {
inDieMode = false;
dieTime = getTimer();
}
if ((getTimer() - dieTime) > 100) {
CGame.__get__instance().dieTime_ = String(Math.round((getTimer() - dieTime) / 10) / 100);
} else {
CGame.__get__instance().dieTime_ = "";
}
if ((getTimer() - dieTime) > dieTimeout) {
makeDie();
m_car.bar._visible = false;
_parent.soundMC.gotoAndPlay("die");
trace("\u043F\u043F\u0446");
}
}
}
}
}
function makeDie() {
if (_global.use_playtomic) {
trace("PLAYTOMIC 'Fail' var was updated");
Playtomic.Log.LevelCounterMetric("Fail", CGame.levelNum);
Playtomic.Log.ForceSend();
}
_root.ssMC.stop();
m_car.inProcess = false;
inPostGame = true;
inProcess = false;
var _local4 = attachMovie(((lives == 0) ? "dieMFend" : "dieMF"), "dieMessage", 3002);
_local4._x = 360;
_local4._y = 150;
m_car.__get__image().cbs.carBody.gotoAndStop(m_car.__get__image().cbs.carBody._totalframes);
}
function endOfLevel(n) {
clearInterval(FINinterval);
CGame.full_score = CGame.full_score + CGame.score;
if (CGame.gameType == 1) {
if (n == 1) {
CGame.butEndRace();
} else if (n == 2) {
CGame.levelNum++;
CGame.butEndRaceVictory();
}
}
if (CGame.gameType == 2) {
CGame.butEndRaceTimeAttack();
}
}
function makeTrickMassage(msg) {
if (!inProcess) {
return(undefined);
}
var _local4 = "";
var _local6 = 0;
if (!m_car.mode) {
if (msg.trickID == CCar.TRICK_BACK_FLIP) {
msg.trickID = CCar.TRICK_FRONT_FLIP;
} else if (msg.trickID == CCar.TRICK_FRONT_FLIP) {
msg.trickID = CCar.TRICK_BACK_FLIP;
}
}
if (msg.trickID == CCar.TRICK_BACK_FLIP) {
_local4 = "backFlip";
_local6 = 10;
} else if (msg.trickID == CCar.TRICK_FRONT_FLIP) {
_local4 = "frontFlip";
_local6 = 15;
}
if (_local4 != "") {
var _local2 = CCar.__get__instance();
_local2.combo++;
var _local3 = _local2.combo;
if (_local3 > 5) {
_local3 = 5;
}
if (_local3 > 1) {
_local2.mainMovie.cmsg.gotoAndPlay(2);
_local2.mainMovie.cmsg.msg.gotoAndStop("x" + _local3);
_parent.soundMC.gotoAndPlay("c" + _local3);
}
_local2.trickSumCount = _local2.trickSumCount + _local6;
_local2.mainMovie.msg.gotoAndPlay(2);
_local2.mainMovie.msg.msg.gotoAndStop(_local4);
}
}
function set pauseOn(pauseState) {
m_pauseOn = pauseState;
enableProcess(!m_pauseOn);
//return(pauseOn);
}
function get pauseOn() {
return(m_pauseOn);
}
function enableProcess(enable) {
if (enable) {
onEnterFrame = processRace;
_parent._scrPause.removeMovieClip();
} else {
onEnterFrame = function () {
};
_parent.attachMovie("dmPause", "_scrPause", 32001);
}
}
function setPosition(now) {
var _local4 = m_car.__get__image()._x;
var _local3 = m_car.__get__image()._y;
var _local6 = leftOffset;
var _local5 = rightOffset;
if (!m_car.mode) {
_local6 = rightOffset;
_local5 = leftOffset;
}
var _local2 = m_level._x;
if (_local2 < (_local6 - _local4)) {
_local2 = _local6 - _local4;
}
if (_local2 > ((550 - _local5) - _local4)) {
_local2 = (550 - _local5) - _local4;
}
_local2 = Math.round(_local2);
if (scroll_x == undefined) {
scroll_x = m_level._x;
}
if (now) {
scroll_x = _local2;
} else {
scroll_x = scroll_x + ((_local2 - scroll_x) / xScrollFactor);
}
m_level._x = Math.round(scroll_x);
if (m_level._y < (topOffset - _local3)) {
m_level._y = Math.round(topOffset - _local3);
}
if (m_level._y > ((400 - bottomOffset) - _local3)) {
m_level._y = Math.round((400 - bottomOffset) - _local3);
}
m_car.bar._x = m_car.__get__image()._x + m_level._x;
m_car.bar._y = (m_car.__get__image()._y + m_level._y) - 70;
}
static function get instance() {
return(m_instance);
}
var usingMap = true;
static var dieTimeout = 1200;
var bonus_0 = 0;
var bonus_1 = 30;
var bonus_2 = 50;
var bonus_3 = 100;
var bonus_4 = 200;
var bonus_5 = 500;
var leftOffset = 150;
var rightOffset = 350;
var topOffset = 170;
var bottomOffset = 170;
var xScrollFactor = 5;
var mm_ratio = 2;
}
Symbol 713 MovieClip [__Packages.iriysoft.pengine.CParticleEngine] Frame 0
class iriysoft.pengine.CParticleEngine
{
var m_particles, m_constraints, m_hitMovie, m_gravity, m_koeffDamp;
function CParticleEngine (hitMovie, nGravity, koeffDamp) {
m_particles = new Array();
m_constraints = new Array();
setHitMovie(hitMovie);
init(nGravity, koeffDamp);
}
function setHitMovie(hitMovie) {
if (hitMovie == undefined) {
hitMovie = null;
}
m_hitMovie = hitMovie;
}
function getHitMovie() {
return(m_hitMovie);
}
function set gravity(nGravity) {
m_gravity = nGravity;
//return(gravity);
}
function get gravity() {
return(m_gravity);
}
function init(nGravity, koeffDamp) {
if (nGravity == undefined) {
nGravity = 9.8;
}
if (koeffDamp == undefined) {
koeffDamp = 0.995;
}
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.0416666666666667;
static var REPEAT_COUNT = 3;
static var D_TIME = SEC_PER_FRAME / REPEAT_COUNT;
}
Symbol 714 MovieClip [__Packages.iriysoft.pengine.particle.CParticle] Frame 0
class iriysoft.pengine.particle.CParticle
{
var m_curPosition, m_prevPosition, m_accelerate, m_buckup, m_mass, m_mc;
function CParticle () {
m_curPosition = new iriysoft.pengine.math.CVector2D();
m_prevPosition = new iriysoft.pengine.math.CVector2D();
m_accelerate = new iriysoft.pengine.math.CVector2D();
m_buckup = new iriysoft.pengine.math.CVector2D();
}
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;
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 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 setMovie(mc) {
if ((mc == null) || (mc == undefined)) {
synchronizeMovie = function () {
};
m_mc = null;
} else {
m_mc = mc;
synchronizeMovie = moveMovieToCurentPosition;
}
}
function getMovie() {
return(m_mc);
}
}
Symbol 715 MovieClip [__Packages.iriysoft.pengine.math.CVector2D] Frame 0
class iriysoft.pengine.math.CVector2D
{
var x, y;
function CVector2D (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 iriysoft.pengine.math.CVector2D(x, y));
}
function minus(v) {
x = x - v.x;
y = y - v.y;
}
function minusNew(v) {
return(new iriysoft.pengine.math.CVector2D(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 iriysoft.pengine.math.CVector2D(-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 iriysoft.pengine.math.CVector2D((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;
}
function multNew(k) {
return(new iriysoft.pengine.math.CVector2D(x * k, y * k));
}
function plus(v) {
x = x + v.x;
y = y + v.y;
}
function plusNew(v) {
return(new iriysoft.pengine.math.CVector2D(x + v.x, y + v.y));
}
function getDistanceTo(p1, p2) {
var _local3 = p1.y - p2.y;
var _local2 = p2.x - p1.x;
var _local6 = (p1.x * (p2.y - p1.y)) - (p1.y * (p2.x - p1.x));
var _local5 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
_local3 = _local3 / _local5;
_local2 = _local2 / _local5;
_local6 = _local6 / _local5;
return(((_local3 * x) + (_local2 * y)) + _local6);
}
}
Symbol 716 MovieClip [__Packages.iriysoft.pengine.constraint.IConstraint] Frame 0
interface iriysoft.pengine.constraint.IConstraint
{
}
Symbol 717 MovieClip [__Packages.iriysoft.pengine.CVehicle] Frame 0
class iriysoft.pengine.CVehicle
{
var m_vehicleDir, m_vehicleNormal, t_point1, t_point2, m_vehicleMovie, m_vehicleParam, m_bodyMovie, m_backWheel, m_forwardWheel, m_accPercMultForTurn, m_normalYLimitForTurn, m_koeffPrimaryForTurn, m_koeffSecondaryForTurn, m_accPercBaseForTurn, m_accelerateForwardWheel, m_accelerateBackWheel, m_brakeForwardWheel, m_brakeBackWheel, t_buffNumber, m_vehicleAngle, t_turnToPerc, t_turnToDX, t_turnToDY;
function CVehicle () {
m_vehicleDir = new iriysoft.pengine.math.CVector2D(0, 0);
m_vehicleNormal = new iriysoft.pengine.math.CVector2D(0, 0);
t_point1 = new iriysoft.pengine.math.CVector2D();
t_point2 = new iriysoft.pengine.math.CVector2D();
}
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 = iriysoft.pengine.particle.CWheel(m_vehicleParam.__get__A());
m_forwardWheel = iriysoft.pengine.particle.CWheel(m_vehicleParam.__get__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_accelerateForwardWheel = param.accelerateForwardWheel;
m_accelerateBackWheel = 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();
t_buffNumber = m_vehicleNormal.x;
m_vehicleNormal.x = -m_vehicleNormal.y;
m_vehicleNormal.y = t_buffNumber;
m_vehicleAngle = Math.atan2(m_vehicleDir.y, m_vehicleDir.x) * VAL_180_DIV_PI;
m_vehicleMovie._rotation = m_vehicleAngle;
t_point1.x = m_bodyMovie.mcB._x;
t_point1.y = m_bodyMovie.mcB._y;
m_bodyMovie.localToGlobal(t_point1);
m_vehicleMovie._parent.globalToLocal(t_point1);
t_point2.x = m_bodyMovie.mcC._x;
t_point2.y = m_bodyMovie.mcC._y;
m_bodyMovie.localToGlobal(t_point2);
m_vehicleMovie._parent.globalToLocal(t_point2);
m_vehicleMovie._x = m_vehicleMovie._x + ((((m_vehicleParam.__get__B().__get__pos().x - t_point1.x) + m_vehicleParam.__get__C().__get__pos().x) - t_point2.x) / 2);
m_vehicleMovie._y = m_vehicleMovie._y + ((((m_vehicleParam.__get__B().__get__pos().y - t_point1.y) + m_vehicleParam.__get__C().__get__pos().y) - t_point2.y) / 2);
}
function turnTo(dir, turnPower) {
t_turnToPerc = ((Math.abs(m_vehicleNormal.y) * (1 - m_accPercBaseForTurn)) + m_accPercBaseForTurn) * turnPower;
t_turnToDX = m_vehicleNormal.x * t_turnToPerc;
t_turnToDY = m_vehicleNormal.y * t_turnToPerc;
if (m_vehicleNormal.y > (-m_normalYLimitForTurn)) {
if (dir == DIR_RIGHT) {
if (!m_forwardWheel.hasIntersection()) {
m_forwardWheel.__get__accelerate().plusXY(t_turnToDX * m_koeffPrimaryForTurn, t_turnToDY * m_koeffPrimaryForTurn);
}
m_backWheel.__get__accelerate().plusXY((-t_turnToDX) * m_koeffSecondaryForTurn, (-t_turnToDY) * m_koeffSecondaryForTurn);
} else {
m_forwardWheel.__get__accelerate().plusXY((-t_turnToDX) * m_koeffSecondaryForTurn, (-t_turnToDY) * m_koeffSecondaryForTurn);
if (!m_backWheel.hasIntersection()) {
m_backWheel.__get__accelerate().plusXY(t_turnToDX * m_koeffPrimaryForTurn, t_turnToDY * m_koeffPrimaryForTurn);
}
}
}
}
function accelerate() {
m_backWheel.setAccelerate(m_accelerateBackWheel);
m_forwardWheel.setAccelerate(m_accelerateForwardWheel);
}
function brake() {
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()));
}
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);
}
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 718 MovieClip [__Packages.iriysoft.pengine.particle.CWheel] Frame 0
class iriysoft.pengine.particle.CWheel extends iriysoft.pengine.particle.CParticle
{
var m_rim, m_acceleration, initParticle, m_koeffSpring, m_koeffSlip, m_radius, m_maxAccSpeed, m_speed, m_accSpeed, rot, intersectionFlag, lastIntersPoint, lastN, hitPointArray, normalArray, hitArray, intersArray, n_part, oldPos, _p, _n, p3, m_prevPosition, synchronizeMovie, m_mc, m_curPosition, obj;
function CWheel () {
super();
}
function setRotationMovie(rotationMovie) {
if ((rotationMovie == undefined) || (rotationMovie == null)) {
rotateMovie = function () {
};
m_rim = null;
} else {
rotateMovie = function () {
this.rot.rotate(this.m_speed / this.m_radius);
this.m_rim._rotation = Math.atan2(this.rot.y, this.rot.x) * iriysoft.pengine.particle.CWheel.ANGLE_180_DIV_PI;
};
m_rim = rotationMovie;
}
}
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 iriysoft.pengine.math.CVector2D(1, 0);
intersectionFlag = false;
lastIntersPoint = new iriysoft.pengine.math.CVector2D(0, 0);
lastN = new iriysoft.pengine.math.CVector2D(0, 0);
var _local2;
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();
_local2 = 0;
while (_local2 < m_hitCount) {
hitPointArray[_local2] = new iriysoft.pengine.math.CVector2D(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 iriysoft.pengine.math.CVector2D(0, 0);
oldPos = new iriysoft.pengine.math.CVector2D(0, 0);
_p = new iriysoft.pengine.math.CVector2D(0, 0);
_n = new iriysoft.pengine.math.CVector2D(0, 0);
p3 = new iriysoft.pengine.math.CVector2D(0, 0);
}
function checkCollision(hit_mc) {
var _local2;
var _local5;
_p.init(0, 0);
var _local9 = false;
var _local3;
var _local4;
var _local11;
oldPos.init(m_prevPosition.x, m_prevPosition.y);
_n.init(0, 0);
n_part.init(0, 0);
var _local10;
synchronizeMovie();
_local10 = 0;
_local2 = 0;
while (_local2 < m_hitCount) {
hitPointArray[_local2].copyTo(_p);
m_mc.localToGlobal(_p);
if ((hitArray[_local2] = hit_mc.hitTest(_p.x, _p.y, true))) {
_local9 = true;
_local3 = _local2;
_local10++;
}
_local2++;
}
if (_local10 == 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);
}
_local2 = 0;
if (_local9) {
while (true) {
_local2++;
if (_local2 == m_hitCount) {
_local2 = 0;
}
if (!hitArray[_local2]) {
_local3 = -1;
_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 iriysoft.pengine.math.CVector2D(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 _local7;
_local11 = intersArray.length;
_local2 = 0;
while (_local2 < _local11) {
obj = intersArray.pop();
_local3 = obj.k1;
_local4 = obj.k2;
obj.n.copyTo(n_part);
m_curPosition.minusNew(m_prevPosition).copyTo(p3);
if (_n.scalar(p3) < 0) {
_local7 = Math.atan2(_n.y, _n.x);
p3.rotate(-_local7);
p3.x = (-p3.x) * m_koeffSpring;
p3.rotate(_local7);
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);
}
_local2++;
}
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 _local7 = (new iriysoft.pengine.math.CVector2D(0, 0)).getDistanceTo(hitPointArray[k1], hitPointArray[k2]);
_local7 = m_radius - Math.abs(_local7);
m_curPosition.plus(n.multNew(_local7));
m_prevPosition.plus(n.multNew(_local7));
} else {
var _local6 = n.multNew(-m_radius);
var _local4 = new iriysoft.pengine.math.CVector2D(0, 0);
var _local5 = 0;
var _local3 = 0.03;
while (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();
} else {
_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));
break;
}
}
}
}
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 iriysoft.pengine.math.CVector2D(-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 719 MovieClip [__Packages.iriysoft.pengine.constraint.CBoxConstrainSkeleton] Frame 0
class iriysoft.pengine.constraint.CBoxConstrainSkeleton
{
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 CBoxConstrainSkeleton () {
}
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 iriysoft.pengine.constraint.CPenetrationConstraint(m_D, m_C, m_B);
m_DCB = new iriysoft.pengine.constraint.CPenetrationConstraint(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);
}
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);
}
}
Symbol 720 MovieClip [__Packages.iriysoft.pengine.constraint.CSpringConstraint] Frame 0
class iriysoft.pengine.constraint.CSpringConstraint implements iriysoft.pengine.constraint.IConstraint
{
var m_p1, m_p2, m_koeffStiffPress, m_koeffStiffStretch, m_relaxLen;
function CSpringConstraint () {
}
function init(koeffStiffPress, koeffStiffStretch, p1, p2) {
m_p1 = p1;
m_p2 = p2;
m_koeffStiffPress = koeffStiffPress;
m_koeffStiffStretch = koeffStiffStretch;
fixDistance();
return(this);
}
function fixDistance() {
m_relaxLen = iriysoft.pengine.math.CVector2D.getDistanceBetween(m_p1.__get__pos(), m_p2.__get__pos());
}
function resolve() {
var _local3 = m_p1.__get__pos().x - m_p2.__get__pos().x;
var _local2 = m_p1.__get__pos().y - m_p2.__get__pos().y;
var _local5 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
var _local9 = (_local5 - m_relaxLen) / _local5;
var _local8;
if (_local5 > m_relaxLen) {
_local8 = m_koeffStiffStretch;
} else {
_local8 = m_koeffStiffPress;
}
var _local7 = m_p1.__get__mass();
var _local6 = m_p2.__get__mass();
var _local4 = (_local9 * _local8) / (_local7 + _local6);
m_p1.__get__pos().x = m_p1.__get__pos().x - ((_local3 * _local7) * _local4);
m_p1.__get__pos().y = m_p1.__get__pos().y - ((_local2 * _local7) * _local4);
m_p2.__get__pos().x = m_p2.__get__pos().x + ((_local3 * _local6) * _local4);
m_p2.__get__pos().y = m_p2.__get__pos().y + ((_local2 * _local6) * _local4);
}
function set p1(nP1) {
m_p1 = nP1;
//return(p1);
}
function get p1() {
return(m_p1);
}
function set p2(nP2) {
m_p2 = nP2;
//return(p2);
}
function get p2() {
return(m_p2);
}
}
Symbol 721 MovieClip [__Packages.iriysoft.pengine.constraint.CPenetrationConstraint] Frame 0
class iriysoft.pengine.constraint.CPenetrationConstraint implements iriysoft.pengine.constraint.IConstraint
{
var p0, p1, p2, sign, n;
function CPenetrationConstraint (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;
}
n = new iriysoft.pengine.math.CVector2D();
}
function resolve() {
var _local2 = p0.__get__pos().getDistanceTo(p1.__get__pos(), p2.__get__pos());
if ((sign * _local2) <= 2) {
n.init(p2.__get__pos().x, p2.__get__pos().y);
n.minus(p1.__get__pos());
n.normalize();
n.rotate(PI2 * sign);
n.mult(Math.abs(_local2) + 1);
p1.__get__pos().minus(n);
}
}
static var PI2 = (Math.PI/2);
}
Symbol 722 MovieClip [__Packages.CCar] Frame 0
class CCar extends iriysoft.pengine.CVehicle
{
static var c_instance;
var bornTime, inProcess, mode, inTrickCompletes, inTrick, tricks, inAirCounter, combo, trickSumCount, endAnimFrame, animLength, canDie, tricksDone, gameOverInTest, flipTime, mvWBack, mvWForward, mainMovie, bar, construct, setVehicleParam, m_vehicleMovie, key1Trigger, key2Trigger, m_accelerateForwardWheel, m_accelerateBackWheel, m_brakeForwardWheel, m_brakeBackWheel, onGround, processKey, m_point90, m_point270, m_prevCarAngle, m_carAngle, m_vehicleAngle, dispatchEvent;
function CCar () {
super();
bornTime = getTimer();
c_instance = this;
inProcess = true;
mode = true;
inTrickCompletes = (inTrick = false);
tricks = new Array();
inAirCounter = 0;
combo = 0;
trickSumCount = 0;
endAnimFrame = 0;
animLength = 0;
canDie = false;
trickSumCount = 0;
tricksDone = new Array();
gameOverInTest = false;
trace("start");
}
function initTricks() {
tricks.push({kk:51, label:"trick1", labelOut:"", labelText:"trick1Done", endFrame:20, score:25});
tricks.push({kk:49, label:"trick2", labelOut:"", labelText:"trick2Done", endFrame:39, score:20});
tricks.push({kk:53, label:"trick3", labelOut:"", labelText:"trick3Done", endFrame:63, score:30});
tricks.push({kk:56, label:"trick4", labelOut:"", labelText:"trick4Done", endFrame:97, score:40});
tricks.push({kk:55, label:"trick5", labelOut:"", labelText:"trick5Done", endFrame:120, score:35});
tricks.push({kk:50, label:"trick6", labelOut:"", labelText:"trick6Done", endFrame:136, score:20});
tricks.push({kk:52, label:"trick7", labelOut:"", labelText:"trick7Done", endFrame:160, score:25});
tricks.push({kk:54, label:"trick8", labelOut:"", labelText:"trick8Done", endFrame:186, score:30});
}
function init(carPlace, engine, mmovie) {
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("dmCarBody", "_dmCarBody", 1010);
mvWBack = carPlace.attachMovie("dmWheel", "_dmWheel1", 1020);
mvWForward = carPlace.attachMovie("dmWheel", "_dmWheel2", 1030);
mainMovie = mmovie;
bar = mainMovie.attachMovie("trickBar", "barMC", 1040);
bar._alpha = 0;
_local4._x = carPlace.xx;
_local4._y = carPlace.yy;
if (CRace.__get__instance().savedPoint != undefined) {
trace("\u0441\u0442\u0430\u0440\u0442 \u0441 \u0441\u0435\u0439\u0432 \u043F\u043E\u0438\u043D\u0442\u0430");
_local4._x = CRace.__get__instance().savedPoint._x;
_local4._y = CRace.__get__instance().savedPoint._y;
}
var _local5 = (new iriysoft.pengine.constraint.CBoxConstrainSkeleton()).init((new iriysoft.pengine.particle.CWheel()).initWheel(0, 0, 6, 13, 180), (new iriysoft.pengine.particle.CParticle()).initParticle(0, 0, 4), (new iriysoft.pengine.particle.CParticle()).initParticle(0, 0, 4), (new iriysoft.pengine.particle.CWheel()).initWheel(0, 0, 6, 13, 180), (new iriysoft.pengine.constraint.CSpringConstraint()).init(0.4, 0.4), (new iriysoft.pengine.constraint.CSpringConstraint()).init(0.7, 0.7), (new iriysoft.pengine.constraint.CSpringConstraint()).init(0.9, 0.9), (new iriysoft.pengine.constraint.CSpringConstraint()).init(0.8, 0.8), (new iriysoft.pengine.constraint.CSpringConstraint()).init(0.7, 0.7), (new iriysoft.pengine.constraint.CSpringConstraint()).init(0.4, 0.4));
construct(_local5, _local4, _local4, mvWBack, mvWForward);
engine.__set__gravity(6);
var _local3 = iriysoft.pengine.CVehicle.getDefaultVehicleParam();
_local3.accelerateForwardWheel = 25;
_local3.accelerateBackWheel = 45;
_local3.brakeForwardWheel = -20;
_local3.brakeBackWheel = -40;
_local3.accPercMult = engine.__get__gravity() * 6;
_local3.normalYLimit = 0.9;
setVehicleParam(_local3);
_local5.addToEngine(engine);
resetFlipPoint();
mx.events.EventDispatcher.initialize(this);
image.cbs.gotoAndStop(CRace.__get__instance().carType);
}
function process() {
var _local5 = 0;
if (inProcess) {
if (Key.isDown(13) || (Key.isDown(32))) {
if ((getTimer() - flipTime) > flipTimeout) {
flipTime = getTimer();
m_vehicleMovie._xscale = m_vehicleMovie._xscale * -1;
mode = !mode;
key1Trigger = Key.isToggled(13);
key2Trigger = Key.isToggled(32);
var _local9 = m_accelerateForwardWheel;
var _local8 = m_accelerateBackWheel;
var _local7 = m_brakeForwardWheel;
var _local6 = m_brakeBackWheel;
m_accelerateForwardWheel = -_local8;
m_accelerateBackWheel = -_local9;
m_brakeForwardWheel = -_local6;
m_brakeBackWheel = -_local7;
}
}
var _local3 = 0;
if (Key.isDown(37)) {
_local5 = _local5 | iriysoft.pengine.CVehicle.KM_MOVE_BODY_BACK;
_local3 = -1;
} else if (Key.isDown(39)) {
_local5 = _local5 | iriysoft.pengine.CVehicle.KM_MOVE_BODY_FORWARD;
_local3 = 1;
}
if (mode) {
_local3 = _local3 * -1;
}
if (_local3 == 0) {
if (image.carBody._currentframe > 10) {
_local3 = -1;
}
if (image.carBody._currentframe < 10) {
_local3 = 1;
}
}
if (_local3 != 0) {
var _local4 = (image.carBody._currentframe = image.carBody._currentframe + _local3);
if (_local4 < 1) {
_local4 = 1;
}
if (_local4 > (image.carBody._totalframes - 1)) {
_local4 = image.carBody._totalframes - 1;
}
image.carBody.gotoAndStop(_local4);
}
if (Key.isDown(38) && (!CRace.__get__instance().inPostGame)) {
if (!CRace.__get__instance().inDieMode) {
_local5 = _local5 | iriysoft.pengine.CVehicle.KM_ACCELERATE;
}
} else if (Key.isDown(40) && (!CRace.__get__instance().inPostGame)) {
if (!CRace.__get__instance().inDieMode) {
_local5 = _local5 | iriysoft.pengine.CVehicle.KM_BRAKE;
}
}
if (!onGround()) {
inAirCounter++;
} else {
if (inAirCounter > 10) {
CRace.__get__instance()._parent.soundMC.gotoAndPlay("down");
}
inAirCounter = 0;
}
}
super.process();
processKey(_local5);
processFlipPoint();
}
static function makeTrickDone() {
if (!CRace.__get__instance().inPostGame) {
var _local1 = instance;
_local1.inTrickCompletes = true;
_local1.combo++;
var _local2 = _local1.combo;
if (_local2 > 5) {
_local2 = 5;
}
_local1.trickSumCount = _local1.trickSumCount + _local1.tricks[_local1.trickNum].score;
if (_local2 > 1) {
_local1.mainMovie.cmsg.gotoAndPlay(2);
_local1.mainMovie.cmsg.msg.gotoAndStop("x" + _local2);
CRace.__get__instance()._parent.soundMC.gotoAndPlay("c" + _local2);
}
_local1.mainMovie.msg.gotoAndPlay(2);
_local1.mainMovie.msg.msg.gotoAndStop(_local1.tricks[_local1.trickNum].labelText);
}
}
static function makeTrickAnimComplete(oneAnimTrick) {
if (!CRace.__get__instance().inPostGame) {
var _local1 = instance;
if (oneAnimTrick) {
_local1.mainMovie.msg.gotoAndPlay(2);
_local1.mainMovie.msg.msg.gotoAndStop(_local1.tricks[_local1.trickNum].labelText);
_local1.combo++;
var _local2 = _local1.combo;
if (_local2 > 5) {
_local2 = 5;
}
_local1.trickSumCount = _local1.trickSumCount + _local1.tricks[_local1.trickNum].score;
if (_local2 > 1) {
_local1.mainMovie.cmsg.gotoAndPlay(2);
_local1.mainMovie.cmsg.msg.gotoAndStop("x" + _local2);
CRace.__get__instance()._parent.soundMC.gotoAndPlay("c" + _local2);
}
}
_local1.mvWBack._visible = (_local1.mvWForward._visible = true);
_local1.inTrickCompletes = (_local1.inTrick = false);
}
}
function checkDie() {
return((onGround() && (inTrick)) && (canDie));
}
function resetFlipPoint() {
m_point90 = (m_point270 = 0);
m_prevCarAngle = (m_carAngle = 0);
}
function processFlipPoint() {
m_prevCarAngle = m_carAngle;
m_carAngle = m_vehicleAngle;
if (onGround()) {
resetFlipPoint();
return(undefined);
}
if ((m_carAngle * m_prevCarAngle) < 0) {
return(undefined);
}
if ((m_carAngle > TRICK_ANGLE) && (m_prevCarAngle < TRICK_ANGLE)) {
m_point90++;
} else if ((m_carAngle < TRICK_ANGLE) && (m_prevCarAngle > TRICK_ANGLE)) {
m_point90--;
} else if ((m_carAngle > (-TRICK_ANGLE)) && (m_prevCarAngle < (-TRICK_ANGLE))) {
m_point270++;
} else if ((m_carAngle < (-TRICK_ANGLE)) && (m_prevCarAngle > (-TRICK_ANGLE))) {
m_point270--;
}
if ((m_point90 > 0) && (m_point270 > 0)) {
makeTrick(TRICK_FRONT_FLIP);
resetFlipPoint();
} else if ((m_point90 < 0) && (m_point270 < 0)) {
makeTrick(TRICK_BACK_FLIP);
resetFlipPoint();
}
}
function makeTrick(tirckID) {
dispatchEvent({type:EVENT_TRICK, target:this, trickID:tirckID});
}
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 get image() {
return(m_vehicleMovie);
}
static function get instance() {
return(c_instance);
}
var bodyAnimDir = 0;
static var flipTimeout = 300;
static var TRICK_ANGLE = 130;
static var EVENT_TRICK = "trick";
static var TRICK_FRONT_FLIP = 0;
static var TRICK_BACK_FLIP = 1;
}
Symbol 723 MovieClip [__Packages.mx.events.EventDispatcher] Frame 0
class mx.events.EventDispatcher
{
function EventDispatcher () {
}
static function _removeEventListener(queue, event, handler) {
if (queue != undefined) {
var _local4 = queue.length;
var _local1;
_local1 = 0;
while (_local1 < _local4) {
var _local2 = queue[_local1];
if (_local2 == handler) {
queue.splice(_local1, 1);
return(undefined);
}
_local1++;
}
}
}
static function initialize(object) {
if (_fEventDispatcher == undefined) {
_fEventDispatcher = new mx.events.EventDispatcher();
}
object.addEventListener = _fEventDispatcher.addEventListener;
object.removeEventListener = _fEventDispatcher.removeEventListener;
object.dispatchEvent = _fEventDispatcher.dispatchEvent;
object.dispatchQueue = _fEventDispatcher.dispatchQueue;
}
function dispatchQueue(queueObj, eventObj) {
var _local7 = "__q_" + eventObj.type;
var _local4 = queueObj[_local7];
if (_local4 != undefined) {
var _local5;
for (_local5 in _local4) {
var _local1 = _local4[_local5];
var _local3 = typeof(_local1);
if ((_local3 == "object") || (_local3 == "movieclip")) {
if (_local1.handleEvent != undefined) {
_local1.handleEvent(eventObj);
}
if (_local1[eventObj.type] != undefined) {
if (exceptions[eventObj.type] == undefined) {
_local1[eventObj.type](eventObj);
}
}
} else {
_local1.apply(queueObj, [eventObj]);
}
}
}
}
function dispatchEvent(eventObj) {
if (eventObj.target == undefined) {
eventObj.target = this;
}
this[eventObj.type + "Handler"](eventObj);
dispatchQueue(this, eventObj);
}
function addEventListener(event, handler) {
var _local3 = "__q_" + event;
if (this[_local3] == undefined) {
this[_local3] = new Array();
}
_global.ASSetPropFlags(this, _local3, 1);
_removeEventListener(this[_local3], event, handler);
this[_local3].push(handler);
}
function removeEventListener(event, handler) {
var _local2 = "__q_" + event;
_removeEventListener(this[_local2], event, handler);
}
static var _fEventDispatcher = undefined;
static var exceptions = {move:1, draw:1, load:1};
}
Symbol 724 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 725 MovieClip [__Packages.iriysoft.CInvisibleMovie] Frame 0
class iriysoft.CInvisibleMovie extends MovieClip
{
var _visible;
function CInvisibleMovie () {
super();
_visible = false;
}
}
Symbol 10 MovieClip Frame 1
stop();
Symbol 15 Button
on (release) {
_global.openSite("Loading", "Site");
}
Symbol 16 Button
on (release) {
_global.openSite("Loading", "Site");
}
Symbol 34 Button
on (release) {
CGame.butBackToSplash();
this.removeMovieClip();
}
Symbol 39 Button
on (release) {
CGame.butSwitchPause();
}
Symbol 46 Button
on (release) {
openSite();
}
Symbol 53 MovieClip [dmSaved] Frame 36
this.removeMovieClip();
Symbol 55 MovieClip [mcHit] Frame 1
#initclip 20
Object.registerClass("mcHit", iriysoft.CInvisibleMovie);
#endinitclip
Symbol 98 MovieClip Frame 1
stop();
Symbol 100 MovieClip [mcHidePoint] Frame 1
#initclip 19
Object.registerClass("mcHidePoint", iriysoft.CInvisibleMovie);
#endinitclip
Symbol 102 MovieClip [dmCarBody] Frame 1
this.stop();
Symbol 111 MovieClip [dieMF] Frame 33
_parent.newRace();
this.removeMovieClip();
Symbol 168 MovieClip Frame 1
if (this._parent._parent._name != "map") {
_global.savePointz.push(this);
}
mcHit._visible = false;
Symbol 248 MovieClip Frame 1
_visible = false;
Symbol 262 MovieClip [mcBonusHit] Frame 1
#initclip 21
Object.registerClass("mcBonusHit", iriysoft.CInvisibleMovie);
#endinitclip
Symbol 265 MovieClip Frame 31
stop();
Symbol 269 MovieClip Frame 12
stop();
Symbol 271 MovieClip Frame 1
type = 2;
subtype = 3;
stop();
Symbol 271 MovieClip Frame 25
stop();
Symbol 275 MovieClip Frame 31
stop();
Symbol 276 MovieClip Frame 1
type = 3;
subtype = 3;
stop();
Symbol 276 MovieClip Frame 25
stop();
Symbol 280 MovieClip Frame 31
stop();
Symbol 281 MovieClip Frame 1
type = 4;
subtype = 3;
stop();
Symbol 281 MovieClip Frame 25
stop();
Symbol 285 MovieClip Frame 31
stop();
Symbol 286 MovieClip Frame 1
type = 5;
subtype = 3;
stop();
Symbol 286 MovieClip Frame 25
stop();
Symbol 290 MovieClip Frame 31
stop();
Symbol 291 MovieClip Frame 1
type = 1;
subtype = 3;
stop();
Symbol 291 MovieClip Frame 25
stop();
Symbol 521 MovieClip Frame 9
gotoAndPlay (1);
Symbol 521 MovieClip Frame 64
gotoAndPlay (1);
Symbol 566 Button
on (release, keyPress "<Enter>") {
CGame.butAbout();
}
Symbol 571 Button
on (release) {
CGame.butAbout();
}
Symbol 572 Button
on (release) {
openSite("Menu", "Site");
}
Symbol 576 Button
on (press) {
this.gotoAndStop(2);
}
Symbol 578 Button
on (press) {
this.gotoAndStop(1);
}
Symbol 579 MovieClip Frame 1
this.stop();
this._parent.soundStarter.gotoAndPlay("start");
_global.soundEnable = true;
Symbol 579 MovieClip Frame 2
this.stop();
this._parent.soundStarter.gotoAndPlay("stop");
_global.soundEnable = false;
Symbol 583 MovieClip Frame 1
_visible = false;
stop();
Symbol 583 MovieClip Frame 7
gotoAndStop (1);
Symbol 583 MovieClip Frame 12
gotoAndStop (1);
Symbol 592 Button
on (release) {
CGame.butBackToSplash();
}
Symbol 593 Button
on (release, keyPress "<Enter>") {
if (_global.use_playtomic) {
trace("PLAYTOMIC play");
Playtomic.Log.Play();
}
CGame.butLevelSelect();
}
Symbol 594 Button
on (release) {
openSite("Help", "Site");
}
Symbol 598 MovieClip [dmRace] Frame 1
#initclip 23
Object.registerClass("dmRace", CRace);
#endinitclip
Symbol 622 MovieClip Frame 1
stop();
_visible = false;
_global.callSound = function (s) {
var _local1 = s + (Math.floor(Math.random() * ((s == "m") ? 2 : 3)) + 1);
gotoAndPlay(_local1);
};
Symbol 622 MovieClip Frame 7
gotoAndStop (1);
Symbol 622 MovieClip Frame 12
gotoAndStop (1);
Symbol 622 MovieClip Frame 17
gotoAndStop (1);
Symbol 622 MovieClip Frame 22
gotoAndStop (1);
Symbol 622 MovieClip Frame 27
gotoAndStop (1);
Symbol 622 MovieClip Frame 32
gotoAndStop (1);
Symbol 622 MovieClip Frame 37
gotoAndStop (1);
Symbol 622 MovieClip Frame 42
gotoAndStop (1);
Symbol 622 MovieClip Frame 47
gotoAndStop (1);
Symbol 622 MovieClip Frame 53
gotoAndStop (1);
Symbol 622 MovieClip Frame 55
lab = "d" + Math.floor((Math.random() * 3) + 1);
gotoAndPlay(lab);
Symbol 622 MovieClip Frame 61
gotoAndStop (1);
Symbol 622 MovieClip Frame 65
gotoAndStop (1);
Symbol 622 MovieClip Frame 69
gotoAndStop (1);
Symbol 622 MovieClip Frame 73
gotoAndStop (1);
Symbol 633 Button
on (release) {
openSite("Game", "Site");
}
Symbol 637 Button
on (release) {
CGame.butBackToSplash();
}
Symbol 638 Button
on (release, keyPress "<Enter>") {
CGame.butStartNext();
}
Symbol 639 Button
on (release) {
openSite("LevelDone", "Site");
}
Symbol 652 Button
on (release) {
openSite("GameDone", "Site");
}
Symbol 653 Button
on (release) {
CGame.butBackToSplash();
}
Symbol 660 Button
on (release) {
openSite("LevelSelect", "Site");
}
Symbol 665 Button
on (release) {
if (_global.soundEnable) {
this._parent.soundMC.gotoAndPlay("button_click");
}
CGame.butStartFrom(1);
}
Symbol 670 Button
on (release) {
if (_global.soundEnable) {
this._parent.soundMC.gotoAndPlay("button_click");
}
CGame.butStartFrom(2);
}
Symbol 675 Button
on (release) {
if (_global.soundEnable) {
this._parent.soundMC.gotoAndPlay("button_click");
}
CGame.butStartFrom(3);
}
Symbol 680 Button
on (release) {
if (_global.soundEnable) {
this._parent.soundMC.gotoAndPlay("button_click");
}
CGame.butStartFrom(4);
}
Symbol 685 Button
on (release) {
if (_global.soundEnable) {
this._parent.soundMC.gotoAndPlay("button_click");
}
CGame.butStartFrom(5);
}
Symbol 690 Button
on (release) {
if (_global.soundEnable) {
this._parent.soundMC.gotoAndPlay("button_click");
}
CGame.butStartFrom(6);
}
Symbol 695 Button
on (release) {
if (_global.soundEnable) {
this._parent.soundMC.gotoAndPlay("button_click");
}
CGame.butStartFrom(7);
}
Symbol 700 Button
on (release) {
if (_global.soundEnable) {
this._parent.soundMC.gotoAndPlay("button_click");
}
CGame.butStartFrom(8);
}
Symbol 705 Button
on (release) {
if (_global.soundEnable) {
this._parent.soundMC.gotoAndPlay("button_click");
}
CGame.butStartFrom(9);
}
Symbol 707 MovieClip [dmGame] Frame 1
#initclip 22
Object.registerClass("dmGame", CGame);
#endinitclip
stop();
Instance of Symbol 579 MovieClip "btn_sound" in Symbol 707 MovieClip [dmGame] Frame 1
onClipEvent (load) {
if (_global.soundEnable == undefined) {
_global.soundEnable = true;
}
if (!_global.soundEnable) {
gotoAndStop (2);
}
}
Instance of Symbol 624 MovieClip in Symbol 707 MovieClip [dmGame] Frame 31
onClipEvent (load) {
key1 = Key.isToggled(19);
key2 = Key.isToggled(80);
key3 = Key.isToggled(27);
this._visible = false;
}
onClipEvent (keyDown) {
if (((Key.isDown(19) && (key1 != Key.isToggled(19))) || (Key.isDown(80) && (key2 != Key.isToggled(80)))) || (Key.isDown(27) && (key3 != Key.isToggled(27)))) {
CGame.butSwitchPause();
}
key1 = Key.isToggled(19);
key2 = Key.isToggled(80);
key3 = Key.isToggled(27);
}
Instance of Symbol 579 MovieClip "btn_sound" in Symbol 707 MovieClip [dmGame] Frame 31
onClipEvent (load) {
if (_global.soundEnable == undefined) {
_global.soundEnable = true;
}
if (!_global.soundEnable) {
gotoAndStop (2);
}
}
Instance of Symbol 706 MovieClip in Symbol 707 MovieClip [dmGame] Frame 76
onClipEvent (load) {
trace("init select level screen");
CGame.m_numberLevelsOpened = CGame.loadLevelsOpened();
var opened = CGame.m_numberLevelsOpened;
trace(opened + " levels opened");
var i = 1;
while (i <= 9) {
var clip = this["b" + i];
clip._visible = false;
if (i <= opened) {
clip._visible = true;
}
i++;
}
}
Instance of Symbol 706 MovieClip in Symbol 707 MovieClip [dmGame] Frame 90
onClipEvent (load) {
trace("init select level screen");
CGame.m_numberLevelsOpened = CGame.loadLevelsOpened();
var opened = CGame.m_numberLevelsOpened;
trace(opened + " levels opened");
var i = 1;
while (i <= 9) {
var clip = this["b" + i];
clip._visible = false;
if (i <= opened) {
clip._visible = true;
}
i++;
}
}