Frame 1
fscommand ("showmenu", "false");
_focusrect = false;
_global.openSite = function () {
getURL ("http://www.gametop.com/stats/marsbuggy.html", "_blank");
};
_global.gameName = "marsbuggy";
_root.loaderAnimDelta = 5;
_root.loaderAnimPause = 2500;
_root.parsingAnimDelta = 10;
Instance of Symbol 9 MovieClip in Frame 2
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
t = _root.getBytesTotal();
l = _root.getBytesLoaded();
bar._xscale = (100 * l) / t;
p = Math.round((1000 * l) / t) / 10;
if (p == Math.floor(p)) {
p = p + ".0";
}
p = p + "%";
tf.text = p;
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 12 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 + _root.loaderAnimDelta);
if (_alpha >= 100) {
_alpha = 100;
state = 1;
startPause = getTimer();
}
} else if ((((state == 1) && (t == l)) && (l > 10)) && ((getTimer() - startPause) > _root.loaderAnimPause)) {
this._alpha = this._alpha - _root.loaderAnimDelta;
if (_alpha < 0) {
_root.gotoAndStop("lbStart");
}
}
}
Symbol 544 MovieClip [__Packages.CGame] Frame 0
class CGame extends MovieClip
{
static var m_instance, levels, levelNum, __get__txtLevel_;
function CGame () {
super();
m_instance = this;
levels = new Array();
levels.push("dmLevel1", "dmLevel2", "dmLevel3", "dmLevel4", "dmLevel6", "dmLevel9", "dmLevel5", "dmLevel7");
}
static function butStart() {
levelNum = 1;
m_instance.full_m_score = 0;
m_instance.gotoAndStop("lbRace");
}
static function butStartNext() {
m_instance.gotoAndStop("lbRace");
}
static function butSwitchPause() {
m_instance.m_race.__set__pauseOn(!m_instance.m_race.__get__pauseOn());
}
static function butEndRaceVictory() {
m_instance.gotoAndStop("lbStatistics");
}
static function butEndRace() {
m_instance.gotoAndStop("lbFinalStatistics");
}
static function butAbout() {
m_instance.gotoAndStop("lbAbout");
}
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(full_score + score);
//return(score);
}
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 545 MovieClip [__Packages.CRace] Frame 0
class CRace extends MovieClip
{
static var m_instance;
var m_level, attachMovie, mm, _parent, mm_xy_ratio, mm_scale, m_pEngine, inProcess, inPostGame, m_car, FINinterval, m_pauseOn, onEnterFrame, _scrPause;
function CRace () {
super();
m_instance = this;
}
function onLoad() {
init();
pauseOn = (false);
CGame.__set__score(0);
}
function init() {
trace("Starting level " + (CGame.levelNum - 1));
CGame.__set__txtLevel_(String(CGame.levelNum));
_global.dieZ = new Array();
m_level = attachMovie(CGame.levels[CGame.levelNum - 1], "_Level1", 1001);
CGame.__set__takenBonus(CGame.__set__allBonus(0));
for (var _local3 in m_level.mcBonusPlace) {
if (m_level.mcBonusPlace[_local3].mcHit != undefined) {
CGame.__set__allBonus((CGame.__get__allBonus()+1));
}
}
if (usingMap) {
mm = _parent.miniMap;
mm._visible = true;
var _local8 = mm.attachMovie(CGame.levels[CGame.levelNum - 1] + "_mm", "map", 0);
if (_local8 == undefined) {
_local8 = mm.attachMovie(CGame.levels[CGame.levelNum - 1], "map", 0);
}
var _local7 = m_level._width;
var _local6 = m_level._height;
mm_xy_ratio = mm._xscale / mm._yscale;
var _local4 = _local7 / 550;
var _local5 = _local6 / 400;
_local4 = _local4 / mm_xy_ratio;
mm_scale = (mm_ratio * 100) / Math.max(_local4, _local5);
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() {
CGame.__set__score(0);
inProcess = true;
inPostGame = false;
m_pEngine.clear();
m_car = new CCar();
m_car.init(m_level.mcVehiclePlace, m_pEngine);
m_car.addEventListener(CCar.EVENT_TRICK, mx.utils.Delegate.create(this, makeTrickMassage));
setPosition(true);
}
function processRace() {
m_pEngine.process();
m_car.process();
if (usingMap) {
mm.player.player._rotation = m_car.__get__image()._rotation;
var _local12 = (mm_scale * m_car.__get__image()._x) / 100;
var _local13 = (mm_scale * m_car.__get__image()._y) / 100;
_local12 = _local12 / mm_xy_ratio;
mm.map._x = (-_local12) + 275;
mm.map._y = (-_local13) + 200;
}
setPosition();
if ((m_level.mcFinish._x < (m_car.__get__backWheel().__get__pos().x - 50)) && (!inPostGame)) {
CGame.full_score = CGame.full_score + CGame.score;
CGame.__set__score(0);
inPostGame = true;
if (CGame.levelNum >= CGame.levels.length) {
trace("\u0423\u0440\u043E\u0432\u043D\u0438 \u0437\u0430\u043A\u043E\u043D\u0447\u0438\u043B\u0438\u0441\u044C");
FINinterval = setInterval(this, "endOfLevel", 1000, 1);
} else {
FINinterval = setInterval(this, "endOfLevel", 1000, 2);
}
}
var _local10 = m_car.getHitForBonus();
for (var _local6 in m_level.mcBonusPlace) {
if (_local10.hitTest(m_level.mcBonusPlace[_local6].mcHit)) {
_parent.soundMC.gotoAndPlay("bang");
m_level.mcBonusPlace[_local6].play();
if (usingMap) {
var _local5 = m_level.mcBonusPlace[_local6]._x;
var _local4 = m_level.mcBonusPlace[_local6]._y;
for (var _local9 in mm.map.mcBonusPlace) {
var _local3 = mm.map.mcBonusPlace[_local9];
if ((((_local3._x > (_local5 - 2)) && (_local3._x < (_local5 + 2))) && (_local3._y > (_local4 - 2))) && (_local3._y < (_local4 + 2))) {
_local3._visible = false;
break;
}
}
}
switch (m_level.mcBonusPlace[_local6].type) {
case 0 :
var _local7 = bonus_0;
break;
case 1 :
_local7 = bonus_1;
break;
case 2 :
_local7 = bonus_2;
break;
case 3 :
_local7 = bonus_3;
break;
default :
_local7 = bonus_0;
}
CGame.score = CGame.score + _local7;
CGame.__set__takenBonus((CGame.__get__takenBonus()+1));
}
}
if (inProcess && ((getTimer() - m_car.bornTime) > 400)) {
var _local6 = 0;
while (_local6 < _global.dieZ.length) {
if (inProcess) {
var _local8 = _global.dieZ[_local6];
if (m_car.checkDeathPoints(_local8)) {
m_car.inProcess = false;
inProcess = false;
_parent.soundMC.gotoAndPlay("die");
var _local11 = attachMovie("dieMF", "dieMessage", 1002);
_local11._x = 275;
_local11._y = 200;
}
}
_local6++;
}
}
if (inProcess && ((getTimer() - m_car.bornTime) > 400)) {
if (m_car.checkDeathPoints(m_level.mcHit)) {
m_car.inProcess = false;
inProcess = false;
var _local11 = attachMovie("dieMF", "dieMessage", 1002);
_parent.soundMC.gotoAndPlay("die");
_local11._x = 275;
_local11._y = 200;
}
}
}
function makeTrickMassage(msg) {
var _local4 = 0;
var _local5 = 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) {
_parent.soundMC.gotoAndPlay("flip");
_local4 = 2;
_local5 = 250;
} else if (msg.trickID == CCar.TRICK_FRONT_FLIP) {
_parent.soundMC.gotoAndPlay("flip");
_local4 = 1;
_local5 = 300;
}
if (_local4 > 0) {
var _local2 = attachMovie("dmTrickAnimMessage", "_TrickAnimMessage", 28000);
_local2._x = 275;
_local2._y = 100;
_local2.mc.gotoAndStop(_local4);
_local2.mc.mcMsg.txtScore = _local5;
CGame.score = CGame.score + _local5;
_local2.onEnterFrame = function () {
if (this._currentframe == this._totalframes) {
this.removeMovieClip();
}
};
}
}
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;
_scrPause.removeMovieClip();
mm._visible = true;
} else {
onEnterFrame = function () {
};
attachMovie("dmPause", "_scrPause", 32001);
mm._visible = false;
}
}
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;
}
if (now) {
m_level._x = _local2;
} else {
m_level._x = m_level._x + ((_local2 - m_level._x) / xScrollFactor);
}
if (m_level._y < (topOffset - _local3)) {
m_level._y = topOffset - _local3;
}
if (m_level._y > ((400 - bottomOffset) - _local3)) {
m_level._y = (400 - bottomOffset) - _local3;
}
}
static function get instance() {
return(m_instance);
}
function endOfLevel(n) {
clearInterval(FINinterval);
if (n == 1) {
CGame.butEndRace();
} else if (n == 2) {
CGame.levelNum++;
CGame.butEndRaceVictory();
}
}
var usingMap = true;
var bonus_0 = 25;
var bonus_1 = 25;
var bonus_2 = 25;
var bonus_3 = 25;
var leftOffset = 150;
var rightOffset = 350;
var topOffset = 170;
var bottomOffset = 170;
var xScrollFactor = 5;
var mm_ratio = 2;
}
Symbol 546 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 547 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 548 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 549 MovieClip [__Packages.iriysoft.pengine.constraint.IConstraint] Frame 0
interface iriysoft.pengine.constraint.IConstraint
{
}
Symbol 550 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 551 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 552 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 553 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 554 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 555 MovieClip [__Packages.CCar] Frame 0
class CCar extends iriysoft.pengine.CVehicle
{
var bornTime, inProcess, mode, flipTime, construct, setVehicleParam, key1Trigger, key2Trigger, m_vehicleMovie, m_accelerateForwardWheel, m_accelerateBackWheel, m_brakeForwardWheel, m_brakeBackWheel, processKey, m_point90, m_point270, m_prevCarAngle, m_carAngle, m_vehicleAngle, onGround, dispatchEvent;
function CCar () {
super();
bornTime = getTimer();
inProcess = true;
mode = true;
}
function init(carPlace, engine) {
flipTime = getTimer();
CGame.__set__takenBonus(0);
var _local4 = carPlace.attachMovie("dmCarBody", "_dmCarBody", 1000);
var _local8 = carPlace.attachMovie("dmWheel", "_dmWheel1", 1010);
var _local11 = carPlace.attachMovie("dmWheel", "_dmWheel2", 1020);
_local4._x = 100;
_local4._y = 200;
var _local6 = (new iriysoft.pengine.constraint.CBoxConstrainSkeleton()).init((new iriysoft.pengine.particle.CWheel()).initWheel(0, 0, 5, 13, 180), (new iriysoft.pengine.particle.CParticle()).initParticle(0, 0, 5), (new iriysoft.pengine.particle.CParticle()).initParticle(0, 0, 5), (new iriysoft.pengine.particle.CWheel()).initWheel(0, 0, 5, 13, 180), (new iriysoft.pengine.constraint.CSpringConstraint()).init(0.3, 0.3), (new iriysoft.pengine.constraint.CSpringConstraint()).init(0.6, 0.6), (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.3, 0.3));
construct(_local6, _local4, _local4, _local8, _local11);
engine.__set__gravity(4);
var _local3 = iriysoft.pengine.CVehicle.getDefaultVehicleParam();
_local3.accelerateForwardWheel = 15;
_local3.accelerateBackWheel = 42;
_local3.brakeForwardWheel = -25;
_local3.brakeBackWheel = -25;
_local3.accPercMult = engine.__get__gravity() * 6;
_local3.normalYLimit = 0.9;
setVehicleParam(_local3);
_local6.addToEngine(engine);
resetFlipPoint();
mx.events.EventDispatcher.initialize(this);
image.carBody.gotoAndStop(11);
var _local7 = CRace.__get__instance();
var _local2 = _local7.m_level.mcBonusPlace;
for (var _local5 in _local2) {
if (_local2[_local5]._currentframe > 1) {
_local2[_local5].gotoAndPlay(1);
}
}
_local2 = _local7.mm.map.mcBonusPlace;
for (var _local5 in _local2) {
_local2[_local5]._visible = true;
if (_local2[_local5]._currentframe > 1) {
_local2[_local5].gotoAndPlay(1);
}
}
}
function process() {
var _local5 = 0;
if (inProcess) {
if ((Key.isDown(13) && (Key.isToggled(13) != key1Trigger)) || (Key.isDown(32) && (Key.isToggled(32) != key2Trigger))) {
if ((getTimer() - flipTime) > 300) {
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 > 11) {
_local3 = -1;
}
if (image.carBody._currentframe < 11) {
_local3 = 1;
}
}
if (_local3 != 0) {
var _local4 = (image.carBody._currentframe = image.carBody._currentframe + _local3);
if (_local4 < 1) {
_local4 = 1;
}
if (_local4 > image.carBody._totalframes) {
_local4 = image.carBody._totalframes;
}
image.carBody.gotoAndStop(_local4);
}
if (Key.isDown(38)) {
_local5 = _local5 | iriysoft.pengine.CVehicle.KM_ACCELERATE;
} else if (Key.isDown(40)) {
_local5 = _local5 | iriysoft.pengine.CVehicle.KM_BRAKE;
}
}
super.process();
processKey(_local5);
processFlipPoint();
}
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 var TRICK_ANGLE = 130;
static var EVENT_TRICK = "trick";
static var TRICK_FRONT_FLIP = 0;
static var TRICK_BACK_FLIP = 1;
}
Symbol 556 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 557 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 558 MovieClip [__Packages.iriysoft.CInvisibleMovie] Frame 0
class iriysoft.CInvisibleMovie extends MovieClip
{
var _visible;
function CInvisibleMovie () {
super();
_visible = false;
}
}
Symbol 2 Button
on (press) {
openSite();
}
Symbol 16 MovieClip [dieMF] Frame 18
_parent.newRace();
this.removeMovieClip();
Symbol 26 Button
on (release) {
CGame.butBackToSplash();
}
Symbol 31 Button
on (release) {
CGame.butSwitchPause();
}
Symbol 239 MovieClip [mcBonusHit] Frame 1
#initclip 18
Object.registerClass("mcBonusHit", iriysoft.CInvisibleMovie);
#endinitclip
Symbol 240 MovieClip Frame 1
stop();
type = 2;
Symbol 240 MovieClip Frame 11
stop();
Symbol 246 MovieClip Frame 1
stop();
type = 1;
Symbol 246 MovieClip Frame 11
stop();
Symbol 249 MovieClip [mcHit] Frame 1
#initclip 16
Object.registerClass("mcHit", iriysoft.CInvisibleMovie);
#endinitclip
Symbol 254 MovieClip [mcHidePoint] Frame 1
#initclip 17
Object.registerClass("mcHidePoint", iriysoft.CInvisibleMovie);
#endinitclip
Symbol 256 MovieClip [dmCarBody] Frame 1
this.stop();
Symbol 299 MovieClip Frame 1
stop();
type = 3;
Symbol 299 MovieClip Frame 11
stop();
Symbol 304 MovieClip Frame 1
if (r == undefined) {
gotoAndPlay(Math.floor(Math.random() * _totalframes) + 1);
r = 1;
}
Symbol 434 MovieClip Frame 800
gotoAndPlay (1);
Symbol 476 Button
on (release, keyPress "<Enter>") {
CGame.butAbout();
}
Symbol 481 Button
on (release) {
CGame.butAbout();
}
Symbol 486 Button
on (release) {
openSite();
}
Symbol 489 Button
on (press) {
this.gotoAndStop(2);
}
Symbol 491 Button
on (press) {
this.gotoAndStop(1);
}
Symbol 492 MovieClip Frame 1
this.stop();
this._parent.soundStarter.gotoAndPlay("start");
_global.soundEnable = true;
Symbol 492 MovieClip Frame 2
this.stop();
this._parent.soundStarter.gotoAndPlay("stop");
_global.soundEnable = false;
Symbol 496 MovieClip Frame 1
_visible = false;
stop();
Symbol 496 MovieClip Frame 7
gotoAndStop (1);
Symbol 496 MovieClip Frame 12
gotoAndStop (1);
Symbol 503 Button
on (release) {
CGame.butBackToSplash();
}
Symbol 504 Button
on (release, keyPress "<Enter>") {
CGame.butStart();
}
Symbol 506 MovieClip [dmRace] Frame 1
#initclip 20
Object.registerClass("dmRace", CRace);
#endinitclip
Symbol 523 MovieClip Frame 1
stop();
_visible = false;
Symbol 523 MovieClip Frame 7
gotoAndStop (1);
Symbol 523 MovieClip Frame 12
gotoAndStop (1);
Symbol 523 MovieClip Frame 17
gotoAndStop (1);
Symbol 523 MovieClip Frame 22
gotoAndStop (1);
Symbol 526 Button
on (release) {
CGame.butBackToSplash();
}
Symbol 527 Button
on (release, keyPress "<Enter>") {
CGame.butStartNext();
}
Symbol 536 Button
on (release, keyPress "<Enter>") {
CGame.butBackToSplash();
}
Symbol 543 MovieClip [dmGame] Frame 1
#initclip 19
Object.registerClass("dmGame", CGame);
#endinitclip
stop();
Instance of Symbol 492 MovieClip "btn_sound" in Symbol 543 MovieClip [dmGame] Frame 1
onClipEvent (load) {
if (_global.soundEnable == undefined) {
_global.soundEnable = true;
}
if (!_global.soundEnable) {
gotoAndStop (2);
}
}
Instance of Symbol 513 MovieClip in Symbol 543 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);
}