Frame 1
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__("f103be8c", this, 10301, true);
stop();
Frame 10
function geturl() {
}
stop();
_global.sndobj = new com.sound.CSound();
_global.sndobj.playStartsnd();
var gameLevel = 5;
var flipArray = [0, 0, 0, 0, 0];
var currentlevel = 1;
var gamescore1 = 0;
var levelscore = 1500;
var dieCount = 0;
var sndon = true;
titleScreen.play_mc.onRelease = function () {
gotoAndStop ("instructions");
stopAllSounds();
};
titleScreen.more_mc.onRelease = function () {
getURL ("http://www.101cargames.com", "_blank");
};
titleScreen.instructions_mc.onRelease = function () {
gotoAndStop ("instructions");
};
_root.game.b.popup.scorepanel.music.onRelease = function () {
if (_root.sndon == true) {
this.gotoAndStop(2);
_root.sndon = false;
sco.snd.sndvoloff();
} else {
this.gotoAndStop(1);
_root.sndon = true;
sco.snd.sndvolon();
}
};
Frame 20
gotoAndStop ("game");
Frame 40
instructions.play_mc.onRelease = function () {
gotoAndStop ("game");
};
stopAllSounds();
_global.sndobj.playStartsnd();
Frame 50
stopAllSounds();
init();
Symbol 6 MovieClip [hitCopac] Frame 1
stop();
var removeClip = false;
Symbol 6 MovieClip [hitCopac] Frame 16
stop();
removeClip = true;
Symbol 53 MovieClip Frame 1
stop();
Symbol 54 MovieClip Frame 1
onEnterFrame = function () {
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
delete onEnterFrame;
_root.play();
} else {
var _local2 = Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
preloaderBar.gotoAndStop(_local2);
}
};
Instance of Symbol 48 MovieClip in Symbol 54 MovieClip Frame 1
on (release) {
getURL ("http://www.101cargames.com", "_blank");
}
Symbol 336 MovieClip [__Packages.com.sound.CSound] Frame 0
class com.sound.CSound
{
static var instance;
var engineStart, engineLoop, bgsnd, truck_snd, welcome, trickotreat, cauciuc, foc, ghiulea, mina, masina, copac, lemne, apa, apa1, nitro, sndVol, truckstart, truckblast, zoombiesnd, truckidle;
function CSound () {
engineStart = new Sound();
engineStart.attachSound("engineStart");
engineLoop = new Sound();
engineLoop.attachSound("engineLoop");
bgsnd = new Sound();
bgsnd.attachSound("bgsnd");
truck_snd = new Sound();
truck_snd.attachSound("truck_snd");
welcome = new Sound();
welcome.attachSound("welcome");
trickotreat = new Sound();
trickotreat.attachSound("trickotreat");
cauciuc = new Sound();
cauciuc.attachSound("cauciuc");
foc = new Sound();
foc.attachSound("foc");
ghiulea = new Sound();
ghiulea.attachSound("ghiulea");
mina = new Sound();
mina.attachSound("mina");
masina = new Sound();
masina.attachSound("masina");
copac = new Sound();
copac.attachSound("copac");
lemne = new Sound();
lemne.attachSound("lemne");
apa = new Sound();
apa.attachSound("apa");
apa1 = new Sound();
apa1.attachSound("apa1");
nitro = new Sound();
nitro.attachSound("nitro");
sndVol = new Sound();
truckstart = new Sound();
truckstart.attachSound("bg1");
truckstart.setVolume(40);
truckblast = new Sound();
truckblast.attachSound("blast");
zoombiesnd = new Sound();
zoombiesnd.attachSound("zoombiesnd");
truckstart.onSoundComplete = function () {
this.start(0, 1);
};
truckidle.onSoundComplete = function () {
this.start(0, 1);
};
instance = this;
}
function sndvolon() {
sndVol.setVolume(100);
}
function sndvoloff() {
sndVol.setVolume(0);
}
function playBgsnd() {
stopBgsnd();
truckstart.start(0.999999);
bgsnd.start(0, 999999999);
bgsnd.setVolume(50);
}
function stopBgsnd() {
bgsnd.stop();
}
function playStartsnd() {
truckstart.stop();
truckstart.start(0, 9999999);
}
function stopSnds() {
stopBgsnd();
truckstart.stop();
truckidle.stop();
}
function playWelcome() {
welcome.start(0, 1);
}
function playEngineStart() {
engineStart.start(0, 1);
}
function playEngineLoop() {
engineLoop.start(0, 9999999);
}
function playBlastsnd() {
truckblast.start(0, 1);
}
function playTrick() {
trickotreat.start(0, 1);
}
function playCauciuc() {
cauciuc.start(0, 1);
}
function playGhiulea() {
ghiulea.start(0, 1);
}
function playMina() {
mina.start(0, 1);
}
function playFoc() {
foc.start(0, 1);
}
function playMasina() {
masina.start(0, 1);
}
function playCopac() {
copac.start(0, 1);
}
function playLemne() {
lemne.start(0, 1);
}
function playApa() {
apa.start(0, 1);
}
function playApa1() {
apa1.start(0, 99);
}
function playNitro() {
nitro.start(0, 1);
}
}
Symbol 337 MovieClip [__Packages.com.UI.Game] Frame 0
class com.UI.Game extends MovieClip
{
static var m_instance;
var inPostGame, m_pauseOn, hitcount, min, sec, snd, firetime, m_level, attachMovie, m_pEngine, setint, inProcess, scen, m_car, _parent, bodyCrash, score, onEnterFrame, _scrPause;
function Game () {
super();
m_instance = this;
}
function set pauseOn(pauseState) {
if (inPostGame) {
return;
}
m_pauseOn = pauseState;
enableProcess(!m_pauseOn);
//return(pauseOn);
}
function get pauseOn() {
return(m_pauseOn);
}
function onLoad() {
init();
pauseOn = (false);
}
function init() {
_root.levelscore = 1500;
hitcount = 0;
min = 2;
sec = 30;
snd = com.sound.CSound.instance;
firetime = 75;
m_level = attachMovie("level" + _root.currentlevel, "_Level", 1001);
m_level.mcHit._alpha = 0;
var _local3 = 1;
while (_local3 <= 10) {
m_level["nitro" + _local3]._alpha = 0;
_local3++;
}
m_pEngine = new com.ACA.DynamicsEngine(m_level.mcHit, 7);
var mc = attachMovie("popup", "popup", 1002);
mc._x = 350;
mc._y = 262.5;
mc.gotoAndStop("startup");
var sco = this;
_root.game.b.popup.scorepanel.gscore1 = _root.gamescore1;
if (_root.sndon == true) {
_root.game.b.popup.scorepanel.music.txt = "ON";
snd.sndvolon();
} else {
_root.game.b.popup.scorepanel.music.txt = "OFF";
snd.sndvoloff();
}
mc.onEnterFrame = function () {
if (mc.lev._currentframe >= 90) {
sco.str();
mc.onEnterFrame = null;
}
};
_root.game.b.popup.scorepanel.music.onRelease = function () {
if (_root.sndon == true) {
this.gotoAndStop(2);
_root.sndon = false;
sco.snd.sndvoloff();
} else {
this.gotoAndStop(1);
_root.sndon = true;
sco.snd.sndvolon();
}
};
}
function str() {
newRace();
setint = setInterval(this, "tim", 1000);
}
function tim() {
if (!pauseOn) {
sec--;
if (sec <= 0) {
sec = 59;
min--;
if (min < 0) {
_root.game.b.popup.scorepanel.timer = "00:00";
clearInterval(setint);
}
}
if (min == 0) {
_root.game.b.popup.scorepanel.timer = "00:" + sec;
if (sec < 10) {
_root.game.b.popup.scorepanel.timer = "00:0" + sec;
}
} else {
_root.game.b.popup.scorepanel.timer = (("0" + min) + ":") + sec;
if (sec < 10) {
_root.game.b.popup.scorepanel.timer = ((("0" + min) + ":") + "0") + sec;
}
}
}
}
function newRace() {
inPostGame = false;
inProcess = true;
scen._x = 0;
scen._y = 0;
snd.playBgsnd();
snd.playStartsnd();
if (_root.sndon == true) {
_root.game.b.popup.scorepanel.music.gotoAndStop(1);
snd.sndvolon();
} else {
_root.game.b.popup.scorepanel.music.gotoAndStop(2);
snd.sndvoloff();
}
m_pEngine.clear();
m_car = new com.UI.Truck();
m_car.init(m_level.mcVehiclePlace, m_pEngine);
setObstruct_mc();
setPosition(true);
}
function setObstruct_mc() {
for (var _local2 in m_level.obstruct) {
m_level.obstruct[_local2].gotoAndStop(1);
}
}
function gameNewEnd() {
var _local3 = attachMovie("popup", "popup", 1002);
_local3._x = 350;
_local3._y = 262.5;
if (m_car.nrFlip < _root.flipArray[_root.currentlevel - 1]) {
_local3.gotoAndStop("flip");
_root.game.b.popup.scorepanel._visible = false;
_parent.sbar._visible = false;
_root.dieCount++;
_local3.level = _root.currentlevel;
clearInterval(setint);
} else {
if (_root.currentlevel >= _root.gameLevel) {
_local3.gotoAndStop("congrats");
} else {
_local3.gotoAndStop("levelup");
}
_local3.papirus.interior.lscore = (_root.levelscore - (_root.dieCount * 100)) + (sec * 100);
_root.gamescore1 = _root.gamescore1 + ((_root.levelscore - (_root.dieCount * 100)) + (sec * 100));
_local3.gscore = _root.gamescore1;
snd.stopSnds();
snd.playTrick();
_root.game.b.popup.scorepanel._visible = false;
_parent.sbar._visible = false;
clearInterval(setint);
}
}
function processRace() {
m_pEngine.process();
m_car.process();
setPosition();
if ((m_level.mcFinish._x < (m_car.__get__backWheel().pos.x - 50)) && (!inPostGame)) {
inPostGame = true;
}
var _local3 = m_car.getHitForBonus();
m_car.offNitro();
if (m_car.checkDeathPoints(_level0.game.b._Level.mcHit) == false) {
i = 1;
while (i <= 10) {
if (_local3.hitTest(m_level["nitro" + i])) {
if (m_car.onWheels()) {
if (m_level["nitro" + i].startNitro != 1) {
m_level["nitro" + i].startNitro = 1;
m_level["semnNitro" + i]._visible = false;
m_car.startFire();
}
m_car.onNitro();
if (this["nitroo" + i] != 1) {
this["nitroo" + i] = 1;
snd.playFoc();
}
}
}
i++;
}
}
if (_local3.hitTest(m_level.bonus_mc)) {
i = 1;
while (i <= 10) {
if (_local3.hitTest(m_level.bonus_mc["bonus" + i])) {
if (m_level.bonus_mc["bonus" + i]._visible == true) {
if ((m_level.bonus_mc["bonus" + i]._visible = false)) {
_root.levelscore = _root.levelscore + 50;
}
_root.game.b.popup.scorepanel.gscore1 = _root.game.b.popup.scorepanel.gscore1 + 50;
}
}
if (_local3.hitTest(m_level.bonus_mc.gold)) {
if (m_level.bonus_mc.gold._visible == true) {
m_level.bonus_mc.gold._visible = false;
_root.levelscore = _root.levelscore + 200;
_root.game.b.popup.scorepanel.gscore1 = _root.game.b.popup.scorepanel.gscore1 + 200;
}
}
i++;
}
}
if (_local3.lemn.hitTest(m_level.masini)) {
i = 1;
while (i <= 20) {
if (_local3.lemn.hitTest(m_level.masini["masina" + i])) {
if (m_level.masini["masina" + i].carHit != false) {
m_level.masini["masina" + i].carHit = false;
m_level.masini["masina" + i].play();
m_level.masini["masina" + i].explozie.gotoAndPlay(2);
m_level.mcHit.masini["masina" + i].play();
snd.playMasina();
}
}
i++;
}
}
i = 1;
while (i <= 30) {
if (_local3.lemn.hitTest(m_level["lemn" + i])) {
if (m_level["lemn" + i].hit != false) {
m_level["lemn" + i].play();
m_level.mcHit["lemn" + i].play();
m_level["lemn" + i].hit = false;
snd.playLemne();
}
}
i++;
}
i = 1;
while (i <= 15) {
if ((_local3.mina.hitTest(m_level["mina" + i].mina) || (_local3.lemn.hitTest(m_level["mina" + i].mina))) && (m_level["mina" + i].hit != true)) {
m_level["mina" + i].hit = true;
m_level["mina" + i].play();
m_level.mcHit["mina" + i].play();
snd.playMina();
}
i++;
}
i = 1;
while (i <= 20) {
if (_local3.hitTest(m_level.mcHit["copac" + i]) && (m_level.mcHit["copac" + i].hit != true)) {
m_level.mcHit["copac" + i].hit = true;
m_level.mcHit["copac" + i].play();
if (m_level["copac" + i].stopCopac != true) {
snd.playCopac();
m_level["copac" + i].play();
}
}
i++;
}
if (_local3.hitTest(m_level.death) && (inPostGame != true)) {
trace("ssssssssssssssssssssssssssssssssssss");
m_pEngine.clearConstraints();
m_car.inProcess = false;
inProcess = false;
inPostGame = true;
var _local4 = attachMovie("popup", "dieMessage", 1002);
_local4._x = 350;
_local4._y = 262.5;
if (papirusPlay != true) {
_local4.papirus.gotoAndPlay(2);
papirusPlay = true;
}
_local4.gotoAndStop("crash");
_root.game.b.popup.scorepanel._visible = false;
_parent.sbar._visible = false;
_root.dieCount++;
_local4.level = _root.currentlevel;
_local4.lscore = _root.levelscore;
_root.gamescore1 = _root.gamescore1 + 0;
_local4.gscore = _root.gamescore1;
snd.stopSnds();
snd.playBlastsnd();
clearInterval(setint);
}
if (_local3.hitTest(m_level.liftstart) || (_local3.hitTest(m_level.liftstart1))) {
}
i = 1;
while (i <= 2) {
if (_local3.hitTest(m_level["attention" + i])) {
_root.game.b.popup.atention._visible = true;
}
if (_local3.hitTest(m_level["rattention" + i])) {
_root.game.b.popup.atention._visible = false;
}
i++;
}
if (_local3.hitTest(m_level.end)) {
moveBg = false;
if (gameNew == false) {
if (m_car.nrFlip < 0) {
var _local4 = attachMovie("popup", "dieMessage", 1002);
_local4._x = 350;
_local4._y = 262.5;
_local4.gotoAndStop("crash");
_root.game.b.popup.scorepanel._visible = false;
_parent.sbar._visible = false;
_root.dieCount++;
_local4.level = _root.currentlevel;
} else {
gameNewEnd();
gameNew = true;
}
}
if (inProcess) {
m_car.inProcess = false;
inProcess = false;
}
}
for (var i in m_level.obstruct) {
if ((_local3.hitTest(m_level.obstruct[i].mc) == true) && (inProcess)) {
m_level.obstruct[i].gotoAndPlay("die");
snd.zoombiesnd.start(0, 1);
updatescore(100);
}
}
if (inProcess && ((getTimer() - m_car.bornTime) > 200)) {
if (!inPostGame) {
if (m_car.checkDeathPoints(m_level.mcHit)) {
bodyCrash = true;
if (inProcess) {
hitcount++;
if (hitcount >= 1) {
hitcount = 0;
_parent.sbar.nextFrame();
}
if ((_parent.sbar._currentframe >= 100) || (min < 0)) {
m_car.inProcess = false;
inProcess = false;
inPostGame = true;
var _local4 = attachMovie("popup", "dieMessage", 1002);
_local4._x = 350;
_local4._y = 262.5;
if (papirusPlay != true) {
_local4.papirus.gotoAndPlay(2);
papirusPlay = true;
}
_local4.gotoAndStop("crash");
_root.game.b.popup.scorepanel._visible = false;
_parent.sbar._visible = false;
_root.dieCount++;
_local4.level = _root.currentlevel;
_local4.papirus.interior.lscore = _root.levelscore;
_root.gamescore1 = _root.gamescore1 + 0;
_local4.gscore = _root.gamescore1;
snd.stopSnds();
snd.playBlastsnd();
clearInterval(setint);
}
}
} else {
bodyCrash = false;
}
if (m_car.chkDeath(m_level.mcHit.Deathhit) || (min < 0)) {
_root.game.b.popup.scorepanel.timer = "00:00";
m_car.inProcess = false;
inProcess = false;
inPostGame = true;
var _local4 = attachMovie("popup", "dieMessage", 1002);
_local4.gotoAndStop("die");
_local4._x = 350;
_local4._y = 262.5;
_root.game.b.popup.scorepanel._visible = false;
_parent.sbar._visible = false;
_local4.level = _root.currentlevel;
_root.dieCount++;
_local4.papirus.interior.lscore = _root.levelscore;
_root.gamescore1 = _root.gamescore1 + 0;
_local4.papirus.interior.gscore = _root.gamescore1;
snd.stopSnds();
snd.playBlastsnd();
clearInterval(setint);
}
}
}
}
function updatescore(no) {
score = score + no;
_root.levelscore = score;
_root.game.b.popup.scorepanel.gscore = _root.gamescore;
}
function enableProcess(enable) {
if (enable) {
onEnterFrame = processRace;
_scrPause.removeMovieClip();
} else {
onEnterFrame = function () {
};
attachMovie("popup", "_scrPause", 32001);
_scrPause.gotoAndStop("pause");
_scrPause._x = 350;
_scrPause._y = 262.5;
}
}
function setPosition(b) {
var _local4 = m_car.__get__image()._x;
var _local3 = m_car.__get__image()._y;
var _local5 = leftOffset;
var _local6 = rightOffset;
if (!m_car.mode) {
_local5 = rightOffset;
_local6 = leftOffset;
}
var _local2 = m_level._x;
if (_local2 < (_local5 - _local4)) {
_local2 = _local5 - _local4;
}
if (_local2 > ((550 - _local6) - _local4)) {
_local2 = (550 - _local6) - _local4;
}
if (b) {
m_level._x = _local2;
} else if (moveBg == true) {
m_level._x = m_level._x + ((_local2 - m_level._x) / xScrollFactor);
scen._x = scen._x + (((_local2 - m_level._x) / xScrollFactor) * 0.03);
}
if (m_level._y < (topOffset - _local3)) {
m_level._y = topOffset - _local3;
}
if (m_level._y > ((400 - bottomOffset) - _local3)) {
m_level._y = (400 - bottomOffset) - _local3;
}
}
static function get instance() {
return(m_instance);
}
function endOfLevel(n) {
if (n == 1) {
} else if (n == 2) {
}
}
var leftOffset = 200;
var rightOffset = 350;
var topOffset = 250;
var bottomOffset = 120;
var xScrollFactor = 5;
var stopArray = [7020, 7450, 7100, 11070];
var kid = false;
var gameNew = false;
var papirusPlay = false;
var moveBg = true;
var nrCopac = 1;
var spacePressed = false;
}
Symbol 338 MovieClip [__Packages.com.ACA.DynamicsEngine] Frame 0
class com.ACA.DynamicsEngine
{
var m_particles, m_constraints, m_gravity, m_hitMovie, m_koeffDamp;
function DynamicsEngine (hitMovie, nGravity, koeffDamp) {
m_particles = new Array();
m_constraints = new Array();
setHitMovie(hitMovie);
init(nGravity, koeffDamp);
}
function set gravity(nGravity) {
m_gravity = nGravity;
//return(gravity);
}
function get gravity() {
return(m_gravity);
}
function setHitMovie(hitMovie) {
if (hitMovie == undefined) {
hitMovie = null;
}
m_hitMovie = hitMovie;
}
function getHitMovie() {
return(m_hitMovie);
}
function init(nGravity, koeffDamp) {
if (nGravity == undefined) {
nGravity = 9.8;
}
if (koeffDamp == undefined) {
koeffDamp = 0.99;
}
gravity = (nGravity);
m_koeffDamp = koeffDamp;
}
function addParticle(p) {
m_particles.push(p);
}
function process() {
var _local2 = 0;
while (_local2 < m_particles.length) {
m_particles[_local2].accelerate.plusXY(0, m_gravity * m_particles[_local2].mass);
m_particles[_local2].accelerate.mult(1 / REPEAT_COUNT);
_local2++;
}
var _local3 = 0;
while (_local3 < REPEAT_COUNT) {
_local2 = 0;
while (_local2 < m_particles.length) {
m_particles[_local2].verlet(D_TIME, m_koeffDamp);
_local2++;
}
_local2 = 0;
while (_local2 < m_constraints.length) {
m_constraints[_local2].resolve();
_local2++;
}
_local2 = 0;
while (_local2 < m_particles.length) {
m_particles[_local2].checkCollision(m_hitMovie);
_local2++;
}
_local3++;
}
_local2 = 0;
while (_local2 < m_particles.length) {
m_particles[_local2].accelerate.init(0, 0);
_local2++;
}
}
function addConstraint(c) {
m_constraints.push(c);
}
function clear() {
while (m_particles.pop() != undefined) {
}
clearConstraints();
}
function clearConstraints() {
while (m_constraints.pop() != undefined) {
}
}
static var SEC_PER_FRAME = 0.04;
static var REPEAT_COUNT = 3;
static var D_TIME = SEC_PER_FRAME / REPEAT_COUNT;
}
Symbol 339 MovieClip [__Packages.com.ACA.Vehicle] Frame 0
class com.ACA.Vehicle
{
var m_vehicleDir, m_vehicleNormal, m_vehicleParam, m_vehicleAngle, m_vehicleMovie, m_bodyMovie, m_backWheel, m_forwardWheel, m_accPercMultForTurn, m_normalYLimitForTurn, m_koeffPrimaryForTurn, m_koeffSecondaryForTurn, m_accPercBaseForTurn, m_accForwardWheel, m_accBackWheel, m_brakeForwardWheel, m_brakeBackWheel, t_turnToPerc;
function Vehicle () {
m_vehicleDir = new com.ACA.util.Vector(0, 0);
m_vehicleNormal = new com.ACA.util.Vector(0, 0);
}
function get vehicleParam() {
return(m_vehicleParam);
}
function set vehicleParam(nParam) {
m_vehicleParam = nParam;
//return(vehicleParam);
}
function get vehicleAngle() {
return(m_vehicleAngle);
}
function get vehicleDir() {
return(m_vehicleDir);
}
function getVehiclePoint(mc) {
var _local2 = new Object();
_local2.x = mc._x;
_local2.y = mc._y;
mc._parent.localToGlobal(_local2);
m_vehicleMovie._parent.globalToLocal(_local2);
return(_local2);
}
function moveMovieToMovieGlobal(movie, moviePos) {
var _local1 = {x:movie._x, y:movie._y};
movie._parent.localToGlobal(_local1);
moviePos._parent.globalToLocal(_local1);
moviePos._x = _local1.x;
moviePos._y = _local1.y;
}
function rotateMovieToMovieLocal(movie, moviePos) {
movie._rotation = Math.atan2(moviePos._y - movie._y, moviePos._x - movie._x) * VAL_180_DIV_PI;
}
function construct(vehicleParam, bodyMovie, vehicleMovie, mcWBack, mcWForward) {
m_vehicleParam = vehicleParam;
m_bodyMovie = bodyMovie;
m_vehicleMovie = vehicleMovie;
m_vehicleParam.changeGeometry(getVehiclePoint(m_bodyMovie.mcA), getVehiclePoint(m_bodyMovie.mcB), getVehiclePoint(m_bodyMovie.mcC), getVehiclePoint(m_bodyMovie.mcD));
m_backWheel = m_vehicleParam.A;
m_forwardWheel = m_vehicleParam.D;
if (mcWBack != undefined) {
m_backWheel.setMovie(mcWBack);
m_backWheel.setRotationMovie(mcWBack.mcSpoke);
}
if (mcWForward != undefined) {
m_forwardWheel.setMovie(mcWForward);
m_forwardWheel.setRotationMovie(mcWForward.mcSpoke);
}
setVehicleParam(getDefaultVehicleParam());
}
static function getDefaultVehicleParam() {
var _local1 = new Object();
_local1.accPercMult = 39.2;
_local1.normalYLimit = 0.4;
_local1.koeffPrimary = 1.6;
_local1.koeffSecondary = 0.7;
_local1.accPercBase = 0.6;
_local1.accelerateForwardWheel = 0;
_local1.accelerateBackWheel = 50;
_local1.brakeForwardWheel = 0;
_local1.brakeBackWheel = 0;
return(_local1);
}
function setVehicleParam(param) {
m_accPercMultForTurn = param.accPercMult;
m_normalYLimitForTurn = param.normalYLimit;
m_koeffPrimaryForTurn = param.koeffPrimary;
m_koeffSecondaryForTurn = param.koeffSecondary;
m_accPercBaseForTurn = param.accPercBase;
m_accForwardWheel = param.accelerateForwardWheel;
m_accBackWheel = param.accelerateBackWheel;
m_brakeForwardWheel = param.brakeForwardWheel;
m_brakeBackWheel = param.brakeBackWheel;
}
function processKey(mask) {
if ((mask & KM_ACCELERATE) != 0) {
accelerate();
} else if ((mask & KM_BRAKE) != 0) {
brake();
} else {
stopAccelerate();
}
if ((mask & KM_MOVE_BODY_FORWARD) != 0) {
turnTo(DIR_RIGHT, m_accPercMultForTurn);
} else if ((mask & KM_MOVE_BODY_BACK) != 0) {
turnTo(DIR_LEFT, m_accPercMultForTurn);
}
}
function process() {
m_vehicleDir.init(m_forwardWheel.__get__pos().x - m_backWheel.__get__pos().x, m_forwardWheel.__get__pos().y - m_backWheel.__get__pos().y);
m_vehicleNormal.init(m_vehicleDir.x, m_vehicleDir.y);
m_vehicleNormal.normalize();
var _local4 = m_vehicleNormal.x;
m_vehicleNormal.x = -m_vehicleNormal.y;
m_vehicleNormal.y = _local4;
m_vehicleAngle = Math.atan2(m_vehicleDir.y, m_vehicleDir.x) * VAL_180_DIV_PI;
m_vehicleMovie._rotation = m_vehicleAngle;
var _local3 = new Object();
_local3.x = m_bodyMovie.mcB._x;
_local3.y = m_bodyMovie.mcB._y;
m_bodyMovie.localToGlobal(_local3);
m_vehicleMovie._parent.globalToLocal(_local3);
var _local2 = new Object();
_local2.x = m_bodyMovie.mcC._x;
_local2.y = m_bodyMovie.mcC._y;
m_bodyMovie.localToGlobal(_local2);
m_vehicleMovie._parent.globalToLocal(_local2);
m_vehicleMovie._x = m_vehicleMovie._x + ((((m_vehicleParam.__get__B().__get__pos().x - _local3.x) + m_vehicleParam.__get__C().__get__pos().x) - _local2.x) / 2);
m_vehicleMovie._y = m_vehicleMovie._y + ((((m_vehicleParam.__get__B().__get__pos().y - _local3.y) + m_vehicleParam.__get__C().__get__pos().y) - _local2.y) / 2);
}
function drawSuspension() {
if (!m_vehicleMovie._parent.sus_mc) {
m_vehicleMovie._parent.createEmptyMovieClip("sus_mc", 1015);
m_vehicleMovie._parent.sus_mc._x = (m_vehicleMovie._parent.sus_mc._y = 0);
}
var _local2 = m_vehicleMovie._parent.sus_mc;
_local2.clear();
_local2.lineStyle(5, 16777215, 100);
_local2.moveTo(m_vehicleParam.__get__A().__get__pos().x, m_vehicleParam.__get__A().__get__pos().y);
_local2.lineTo(m_vehicleParam.__get__B().__get__pos().x, m_vehicleParam.__get__B().__get__pos().y);
_local2.lineTo(m_vehicleParam.__get__C().__get__pos().x, m_vehicleParam.__get__C().__get__pos().y);
_local2.lineTo(m_vehicleParam.__get__A().__get__pos().x, m_vehicleParam.__get__A().__get__pos().y);
_local2.moveTo(m_vehicleParam.__get__D().__get__pos().x, m_vehicleParam.__get__D().__get__pos().y);
_local2.lineTo(m_vehicleParam.__get__B().__get__pos().x, m_vehicleParam.__get__B().__get__pos().y);
_local2.lineTo(m_vehicleParam.__get__C().__get__pos().x, m_vehicleParam.__get__C().__get__pos().y);
_local2.lineTo(m_vehicleParam.__get__D().__get__pos().x, m_vehicleParam.__get__D().__get__pos().y);
}
function turnTo(dir, turnPower) {
t_turnToPerc = ((Math.abs(m_vehicleNormal.y) * (1 - m_accPercBaseForTurn)) + m_accPercBaseForTurn) * turnPower;
var _local3;
var _local2;
_local3 = m_vehicleNormal.x * t_turnToPerc;
_local2 = m_vehicleNormal.y * t_turnToPerc;
if (m_vehicleNormal.y > (-m_normalYLimitForTurn)) {
if (dir == DIR_RIGHT) {
if (!m_forwardWheel.hasIntersection()) {
m_forwardWheel.__get__accelerate().plusXY(_local3 * m_koeffPrimaryForTurn, _local2 * m_koeffPrimaryForTurn);
}
m_backWheel.__get__accelerate().plusXY((-_local3) * m_koeffSecondaryForTurn, (-_local2) * m_koeffSecondaryForTurn);
} else {
m_forwardWheel.__get__accelerate().plusXY((-_local3) * m_koeffSecondaryForTurn, (-_local2) * m_koeffSecondaryForTurn);
if (!m_backWheel.hasIntersection()) {
m_backWheel.__get__accelerate().plusXY(_local3 * m_koeffPrimaryForTurn, _local2 * m_koeffPrimaryForTurn);
}
}
}
}
function accelerate() {
if (!m_vehicleMovie._parent._parent._parent.bodyCrash) {
m_backWheel.setAccelerate(m_accBackWheel);
m_forwardWheel.setAccelerate(m_accForwardWheel);
}
}
function brake() {
if (!m_vehicleMovie._parent._parent._parent.bodyCrash) {
m_backWheel.setAccelerate(m_brakeBackWheel);
m_forwardWheel.setAccelerate(m_brakeForwardWheel);
}
}
function stopAccelerate() {
m_backWheel.setAccelerate(0);
m_forwardWheel.setAccelerate(0);
}
function get backWheel() {
return(m_backWheel);
}
function get forwardWheel() {
return(m_forwardWheel);
}
function onGround() {
return(m_backWheel.hasIntersection() || (m_forwardWheel.hasIntersection()));
}
static var VAL_180_DIV_PI = 57.2957795130823;
static var DIR_RIGHT = 0;
static var DIR_LEFT = 1;
static var KM_NONE = 0;
static var KM_ACCELERATE = 1;
static var KM_BRAKE = 2;
static var KM_MOVE_BODY_FORWARD = 4;
static var KM_MOVE_BODY_BACK = 8;
static var nitro = false;
}
Symbol 340 MovieClip [__Packages.com.ACA.util.Vector] Frame 0
class com.ACA.util.Vector
{
var x, y;
function Vector (nx, ny) {
init(nx, ny);
}
function init(nx, ny) {
x = nx;
y = ny;
}
function copyFrom(v) {
x = v.x;
y = v.y;
}
function copyTo(v) {
v.x = x;
v.y = y;
}
function plusXY(nx, ny) {
x = x + nx;
y = y + ny;
}
static function getDistanceBetween(p1, p2) {
var _local2 = p1.x - p2.x;
var _local1 = p1.y - p2.y;
return(Math.sqrt((_local2 * _local2) + (_local1 * _local1)));
}
function duplicate() {
return(new com.ACA.util.Vector(x, y));
}
function minus(v) {
x = x - v.x;
y = y - v.y;
}
function minusNew(v) {
return(new com.ACA.util.Vector(x - v.x, y - v.y));
}
function normalize() {
var _local2 = Math.sqrt((x * x) + (y * y));
x = x / _local2;
y = y / _local2;
}
function reverseNew() {
return(new com.ACA.util.Vector(-x, -y));
}
function scalar(v) {
return((x * v.x) + (y * v.y));
}
function modul() {
return(Math.sqrt((x * x) + (y * y)));
}
function rotate(u) {
var _local4 = x;
var _local3 = y;
x = (_local4 * Math.cos(u)) - (_local3 * Math.sin(u));
y = (_local4 * Math.sin(u)) + (_local3 * Math.cos(u));
}
function rotateNew(u) {
return(new com.ACA.util.Vector((x * Math.cos(u)) - (y * Math.sin(u)), (x * Math.sin(u)) + (y * Math.cos(u))));
}
function mult(k) {
x = x * k;
y = y * k;
return(this);
}
function multNew(k) {
return(new com.ACA.util.Vector(x * k, y * k));
}
function plus(v) {
x = x + v.x;
y = y + v.y;
}
function plusNew(v) {
return(new com.ACA.util.Vector(x + v.x, y + v.y));
}
function getDistanceTo(p1, p2) {
var _local2 = p1.y - p2.y;
var _local3 = p2.x - p1.x;
var _local5 = (p1.x * (p2.y - p1.y)) - (p1.y * (p2.x - p1.x));
var _local6 = Math.sqrt((_local2 * _local2) + (_local3 * _local3));
_local2 = _local2 / _local6;
_local3 = _local3 / _local6;
_local5 = _local5 / _local6;
return(((_local2 * x) + (_local3 * y)) + _local5);
}
}
Symbol 341 MovieClip [__Packages.com.ACA.composites.Composite] Frame 0
class com.ACA.composites.Composite
{
var m_A, m_B, m_C, m_D, m_AB, m_AC, m_AD, m_BC, m_BD, m_CD, m_ABC, m_DCB;
function Composite () {
}
function get A() {
return(m_A);
}
function get B() {
return(m_B);
}
function get C() {
return(m_C);
}
function get D() {
return(m_D);
}
function get AB() {
return(m_AB);
}
function get AC() {
return(m_AC);
}
function get AD() {
return(m_AD);
}
function get BC() {
return(m_BC);
}
function get BD() {
return(m_BD);
}
function get CD() {
return(m_CD);
}
function init(a, b, c, d, ab, ac, ad, bc, bd, cd) {
m_A = a;
m_B = b;
m_C = c;
m_D = d;
m_AB = ab;
m_AB.__set__p1(a);
m_AB.__set__p2(b);
m_AC = ac;
m_AC.__set__p1(a);
m_AC.__set__p2(c);
m_AD = ad;
m_AD.__set__p1(a);
m_AD.__set__p2(d);
m_BC = bc;
m_BC.__set__p1(b);
m_BC.__set__p2(c);
m_BD = bd;
m_BD.__set__p1(b);
m_BD.__set__p2(d);
m_CD = cd;
m_CD.__set__p1(c);
m_CD.__set__p2(d);
m_ABC = new com.ACA.constraints.AngularConstraint(m_D, m_C, m_B);
m_DCB = new com.ACA.constraints.AngularConstraint(m_A, m_B, m_C);
return(this);
}
function changeGeometry(pA, pB, pC, pD) {
m_A.moveTo(pA.x, pA.y);
m_B.moveTo(pB.x, pB.y);
m_C.moveTo(pC.x, pC.y);
m_D.moveTo(pD.x, pD.y);
m_AB.fixDistance();
m_AC.fixDistance();
m_AD.fixDistance();
m_BC.fixDistance();
m_BD.fixDistance();
m_CD.fixDistance();
m_ABC.fixDistance();
m_DCB.fixDistance();
}
function addToEngine(engine) {
engine.addParticle(m_A);
engine.addParticle(m_B);
engine.addParticle(m_C);
engine.addParticle(m_D);
engine.addConstraint(m_AB);
engine.addConstraint(m_AC);
engine.addConstraint(m_AD);
engine.addConstraint(m_BC);
engine.addConstraint(m_BD);
engine.addConstraint(m_CD);
engine.addConstraint(m_ABC);
engine.addConstraint(m_DCB);
}
}
Symbol 342 MovieClip [__Packages.com.ACA.primitives.Particle] Frame 0
class com.ACA.primitives.Particle
{
var m_curPosition, m_prevPosition, m_accelerate, m_buckup, m_mass, m_mc;
function Particle () {
m_curPosition = new com.ACA.util.Vector();
m_prevPosition = new com.ACA.util.Vector();
m_accelerate = new com.ACA.util.Vector();
m_buckup = new com.ACA.util.Vector();
}
function get mass() {
return(m_mass);
}
function set mass(nMass) {
m_mass = nMass;
//return(mass);
}
function get accelerate() {
return(m_accelerate);
}
function set accelerate(acc) {
m_accelerate = acc;
//return(accelerate);
}
function get prevPos() {
return(m_prevPosition);
}
function set prevPos(pos) {
m_prevPosition = pos;
//return(prevPos);
}
function get pos() {
return(m_curPosition);
}
function set pos(pos) {
m_curPosition = pos;
//return(this.pos);
}
function initParticle(x, y, mass, mc) {
if (x == undefined) {
x = 0;
}
if (y == undefined) {
y = 0;
}
if (mass == undefined) {
mass = 1;
}
moveTo(x, y);
m_mass = mass;
m_accelerate.x = 0;
m_accelerate.y = 0;
if (mc) {
setMovie(mc);
}
return(this);
}
function moveTo(nx, ny) {
m_curPosition.x = (m_prevPosition.x = nx);
m_curPosition.y = (m_prevPosition.y = ny);
synchronizeMovie();
}
function verlet(dTime, koeffDamp) {
m_buckup.copyFrom(m_curPosition);
m_curPosition.x = m_curPosition.x + (((m_curPosition.x - m_prevPosition.x) * koeffDamp) + (m_accelerate.x * dTime));
m_curPosition.y = m_curPosition.y + (((m_curPosition.y - m_prevPosition.y) * koeffDamp) + (m_accelerate.y * dTime));
m_buckup.copyTo(m_prevPosition);
synchronizeMovie();
}
function checkCollision(hitMovie) {
}
function synchronizeMovie() {
}
function moveMovieToCurentPosition() {
m_mc._x = m_curPosition.x;
m_mc._y = m_curPosition.y;
}
function setMovie(mc) {
if ((mc == null) || (mc == undefined)) {
synchronizeMovie = function () {
};
m_mc = null;
} else {
m_mc = mc;
synchronizeMovie = moveMovieToCurentPosition;
}
}
function getMovie() {
return(m_mc);
}
}
Symbol 343 MovieClip [__Packages.com.ACA.primitives.Wheel] Frame 0
class com.ACA.primitives.Wheel extends com.ACA.primitives.Particle
{
var m_rim, rot, m_radius, m_speed, m_acceleration, initParticle, m_koeffSpring, m_koeffSlip, m_maxAccSpeed, m_accSpeed, intersectionFlag, lastIntersPoint, lastN, hitPointArray, normalArray, hitArray, intersArray, n_part, oldPos, _p, _n, p3, m_prevPosition, synchronizeMovie, m_mc, m_curPosition;
function Wheel () {
super();
}
function setRotationMovie(rotationMovie) {
if ((rotationMovie == undefined) || (rotationMovie == null)) {
rotateMovie = function () {
};
m_rim = null;
} else {
rotateMovie = rmovie;
m_rim = rotationMovie;
}
}
function rmovie() {
rot.rotate(m_speed / m_radius);
m_rim._rotation = Math.atan2(rot.y, rot.x) * ANGLE_180_DIV_PI;
}
function setAccelerate(nAccelerate) {
m_acceleration = nAccelerate;
}
function getAccelerate() {
return(m_acceleration);
}
function initWheel(x, y, mass, rad, maxAccSpeed, mc, rotationMovie, koeffSpring, koeffSlip) {
_innerInit();
initParticle(x, y, mass, mc);
if (koeffSpring == undefined) {
koeffSpring = 0.1;
}
if (koeffSlip == undefined) {
koeffSlip = 0.1;
}
m_koeffSpring = koeffSpring;
m_koeffSlip = koeffSlip;
setRotationMovie(rotationMovie);
m_radius = rad;
m_maxAccSpeed = maxAccSpeed;
m_speed = 0;
m_accSpeed = 0;
rot = new com.ACA.util.Vector(1, 0);
intersectionFlag = false;
lastIntersPoint = new com.ACA.util.Vector(0, 0);
lastN = new com.ACA.util.Vector(0, 0);
var _local3 = (Math.PI*2) / m_hitCount;
hitPointArray = new Array(m_hitCount);
normalArray = new Array(m_hitCount);
hitArray = new Array(m_hitCount);
intersArray = new Array();
var _local2 = 0;
while (_local2 < m_hitCount) {
hitPointArray[_local2] = new com.ACA.util.Vector(Math.sin(_local3 * _local2) * m_radius, (-Math.cos(_local3 * _local2)) * m_radius);
normalArray[_local2] = hitPointArray[_local2].multNew(-1);
normalArray[_local2].normalize();
_local2++;
}
m_acceleration = 0;
return(this);
}
function verlet(dTime, koeffDamp) {
super.verlet(dTime, koeffDamp);
m_accSpeed = Math.max(-m_maxAccSpeed, Math.min(m_maxAccSpeed, m_accSpeed + (m_acceleration * dTime)));
m_speed = Math.max((-m_maxSpeed) * dTime, Math.min((m_speed * koeffDamp) + m_accSpeed, m_maxSpeed * dTime));
rotateMovie();
}
function rotateMovie() {
}
function _innerInit() {
n_part = new com.ACA.util.Vector(0, 0);
oldPos = new com.ACA.util.Vector(0, 0);
_p = new com.ACA.util.Vector(0, 0);
_n = new com.ACA.util.Vector(0, 0);
p3 = new com.ACA.util.Vector(0, 0);
}
function checkCollision(hit_mc) {
var _local14 = false;
var _local3 = 0;
var _local4 = 0;
var _local15 = 0;
_p.init(0, 0);
oldPos.init(m_prevPosition.x, m_prevPosition.y);
_n.init(0, 0);
n_part.init(0, 0);
synchronizeMovie();
var _local6 = 0;
while (_local6 < m_hitCount) {
hitPointArray[_local6].copyTo(_p);
m_mc.localToGlobal(_p);
hitArray[_local6] = hit_mc.hitTest(_p.x, _p.y, true);
if (hitArray[_local6]) {
_local14 = true;
_local3 = _local6;
_local15++;
}
_local6++;
}
if (_local15 == m_hitCount) {
m_curPosition.x = m_prevPosition.x + ((m_curPosition.x - m_prevPosition.x) * 0.3);
m_curPosition.y = m_prevPosition.y + ((m_curPosition.y - m_prevPosition.y) * 0.3);
synchronizeMovie();
return(undefined);
}
if (_local14) {
var _local2 = 0;
while (true) {
_local2++;
if (_local2 == m_hitCount) {
_local2 = 0;
}
if (!hitArray[_local2]) {
_local3 = -1;
var _local5 = 0;
while (_local5 < m_hitCount) {
_local2++;
if (_local2 == m_hitCount) {
_local2 = 0;
}
if (_local3 == -1) {
if (hitArray[_local2]) {
_local3 = _local2;
_n.plus(normalArray[_local2]);
normalArray[_local2].copyTo(n_part);
}
} else if (!hitArray[_local2]) {
_local4 = _local2 - 1;
if (_local4 < 0) {
_local4 = m_hitCount - 1;
}
intersArray.push({k1:_local3, k2:_local4, n:new com.ACA.util.Vector(n_part.x, n_part.y)});
_local3 = -1;
} else {
_n.plus(normalArray[_local2]);
n_part.plus(normalArray[_local2]);
}
_local5++;
}
break;
}
}
p3.init(0, 0);
if (intersArray.length > 0) {
_n.normalize();
if (intersectionFlag) {
_n.x = _n.x + lastN.x;
_n.y = _n.y + lastN.y;
_n.x = _n.x / 2;
_n.y = _n.y / 2;
}
var _local16 = intersArray.length;
var _local7;
var _local10 = 0;
while (_local10 < _local16) {
_local7 = intersArray.pop();
_local3 = _local7.k1;
_local4 = _local7.k2;
_local7.n.copyTo(n_part);
m_curPosition.minusNew(m_prevPosition).copyTo(p3);
if (_n.scalar(p3) < 0) {
var _local12 = Math.atan2(_n.y, _n.x);
p3.rotate(-_local12);
p3.x = (-p3.x) * m_koeffSpring;
p3.rotate(_local12);
pushOut(_local3, _local4, n_part, hit_mc);
m_prevPosition.x = m_curPosition.x - p3.x;
m_prevPosition.y = m_curPosition.y - p3.y;
} else {
pushOut(_local3, _local4, n_part, hit_mc);
}
_local10++;
}
validateRotation(_n, oldPos);
intersectionFlag = true;
m_curPosition.copyTo(lastIntersPoint);
_n.copyTo(lastN);
}
} else if (intersectionFlag) {
validateRotation(lastN, oldPos);
intersectionFlag = false;
}
synchronizeMovie();
}
function pushOut(k1, k2, n, hit_mc) {
n.normalize();
if (k1 != k2) {
var _local9 = new com.ACA.util.Vector(0, 0);
var _local8 = _local9.getDistanceTo(hitPointArray[k1], hitPointArray[k2]);
_local8 = m_radius - Math.abs(_local8);
m_curPosition.plus(n.multNew(_local8));
m_prevPosition.plus(n.multNew(_local8));
} else {
var _local6 = n.multNew(-m_radius);
var _local4 = new com.ACA.util.Vector(0, 0);
var _local5 = 0;
var _local3 = 0.03;
if (true) {
_local6.copyTo(_local4);
m_mc.localToGlobal(_local4);
if (hit_mc.hitTest(_local4.x, _local4.y, true)) {
_local5++;
m_curPosition.x = m_curPosition.x + (n.x * _local3);
m_curPosition.y = m_curPosition.y + (n.y * _local3);
synchronizeMovie();
// unexpected jump
}
_local5--;
m_curPosition.x = m_curPosition.x - (n.x * _local3);
m_curPosition.y = m_curPosition.y - (n.y * _local3);
m_prevPosition.plus(n.multNew(_local3 * _local5));
}
}
}
function validateRotation(n, oldPos) {
if ((!intersectionFlag) && (Math.abs(m_accSpeed) > 0.01)) {
if (Math.abs(m_accSpeed) < ((m_maxAccSpeed * 0.02) / 2)) {
m_accSpeed = 0;
} else if (m_accSpeed > 0) {
m_accSpeed = m_maxAccSpeed * 0.02;
} else {
m_accSpeed = (-m_maxAccSpeed) * 0.02;
}
}
var _local3 = new com.ACA.util.Vector(-n.y, n.x);
var _local6 = m_curPosition.minusNew(oldPos);
var _local5 = Math.atan2(_local3.y, _local3.x);
var _local2 = _local6.rotateNew(-_local5);
m_speed = _local2.x + m_accSpeed;
_local2.y = 0;
_local2.rotate(_local5);
var _local4 = 1 - m_koeffSlip;
if (com.ACA.Vehicle.nitro == true) {
m_curPosition.x = (m_curPosition.x + ((_local3.x * (m_accSpeed + 0.35)) * _local4)) - (0.01 * _local2.x);
m_curPosition.y = (m_curPosition.y + ((_local3.y * (m_accSpeed + 0.35)) * _local4)) - (0.01 * _local2.y);
m_accSpeed = m_accSpeed * m_koeffSlip;
} else {
m_curPosition.x = (m_curPosition.x + ((_local3.x * m_accSpeed) * _local4)) - (0.02 * _local2.x);
m_curPosition.y = (m_curPosition.y + ((_local3.y * m_accSpeed) * _local4)) - (0.02 * _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 344 MovieClip [__Packages.com.ACA.constraints.SpringConstraint] Frame 0
class com.ACA.constraints.SpringConstraint
{
var _p1, _p2, coeffV, coeffH, restLen;
function SpringConstraint () {
}
function set p1(nP1) {
_p1 = nP1;
//return(p1);
}
function get p1() {
return(_p1);
}
function set p2(nP2) {
_p2 = nP2;
//return(p2);
}
function get p2() {
return(_p2);
}
function init(cV, cH, p1, p2) {
if (p1) {
_p1 = p1;
_p2 = p2;
}
if (cV) {
coeffV = cV;
coeffH = cH;
}
fixDistance();
return(this);
}
function fixDistance() {
restLen = com.ACA.util.Vector.getDistanceBetween(_p1.__get__pos(), _p2.__get__pos());
}
function resolve() {
var _local9 = _p1.__get__pos().minusNew(_p2.__get__pos());
var _local2 = com.ACA.util.Vector.getDistanceBetween(_p1.__get__pos(), _p2.__get__pos());
var _local8 = (_local2 - restLen) / _local2;
var _local3;
if (_local2 > restLen) {
_local3 = coeffH;
} else {
_local3 = coeffV;
}
var _local6 = _p1.__get__mass();
var _local5 = _p2.__get__mass();
var _local7 = (_local8 * _local3) / (_local6 + _local5);
var _local4 = _local9.multNew(_local7);
_p1.__get__pos().minus(_local4.multNew(_local6));
_p2.__get__pos().plus(_local4.multNew(_local5));
}
}
Symbol 345 MovieClip [__Packages.com.ACA.constraints.AngularConstraint] Frame 0
class com.ACA.constraints.AngularConstraint
{
var p0, p1, p2, sign;
function AngularConstraint (np0, np1, np2) {
p0 = np0;
p1 = np1;
p2 = np2;
fixDistance();
}
function fixDistance() {
sign = p0.__get__pos().getDistanceTo(p1.__get__pos(), p2.__get__pos());
if (sign < 0) {
sign = -1;
} else {
sign = 1;
}
}
function resolve() {
var _local3 = p0.__get__pos().getDistanceTo(p1.__get__pos(), p2.__get__pos());
if ((sign * _local3) <= 1) {
var _local2 = new com.ACA.util.Vector(p2.__get__pos().x, p2.__get__pos().y);
_local2.minus(p1.__get__pos());
_local2.normalize();
_local2.rotate(PI2 * sign);
_local2.mult(Math.abs(_local3) + 1);
p1.__get__pos().minus(_local2);
}
}
static var PI2 = (Math.PI/2);
}
Symbol 346 MovieClip [__Packages.com.UI.Truck] Frame 0
class com.UI.Truck extends com.ACA.Vehicle
{
var bornTime, inProcess, mode, getKeys, snd1, m_vehicleMovie, flipTime, construct, setVehicleParam, m_forwardWheel, m_backWheel, m_accForwardWheel, currentRotation, oldRotation, initialRotation, processKey;
function Truck () {
super();
_level0.game.b.popup.nrFlip = "0 of " + _root.flipArray[_root.currentlevel - 1];
bornTime = getTimer();
inProcess = true;
mode = true;
getKeys = true;
snd1 = com.sound.CSound.instance;
}
function get image() {
return(m_vehicleMovie);
}
function init(carPlace, engine) {
flipTime = getTimer();
if (carPlace.xx == undefined) {
carPlace.xx = carPlace._x;
}
if (carPlace.yy == undefined) {
carPlace.yy = carPlace._y;
}
carPlace._x = (carPlace._y = 0);
var _local4 = carPlace.attachMovie("truckbody", "_dmCarBody", 100);
var _local6 = carPlace.attachMovie("wheel", "_dmWheel1", 1010);
var _local13 = carPlace.attachMovie("wheel", "_dmWheel2", 1020);
_local6.mcSpoke.mc_rim.gotoAndStop(2);
_local4._x = carPlace.xx;
_local4._y = carPlace.yy;
_local4.copii._visible = false;
var _local16 = new com.ACA.primitives.Wheel();
var _local14 = new com.ACA.primitives.Wheel();
var _local11 = new com.ACA.primitives.Particle();
var _local10 = new com.ACA.primitives.Particle();
var _local9 = new com.ACA.constraints.SpringConstraint();
var _local8 = new com.ACA.constraints.SpringConstraint();
var _local7 = new com.ACA.constraints.SpringConstraint();
var _local18 = new com.ACA.constraints.SpringConstraint();
var _local17 = new com.ACA.constraints.SpringConstraint();
var _local15 = new com.ACA.constraints.SpringConstraint();
var _local5 = new com.ACA.composites.Composite();
_local5.init(_local16.initWheel(0, 0, 5, 15, 20), _local11.initParticle(0, 0, 5), _local10.initParticle(0, 0, 5), _local14.initWheel(0, 0, 5, 15, 20), _local9.init(0.1, 0.1), _local8.init(0.3, 0.3), _local7.init(0.5, 0.5), _local18.init(0.9, 0.9), _local17.init(0.6, 0.6), _local15.init(0.2, 0.2));
construct(_local5, _local4, _local4, _local6, _local13);
engine.__set__gravity(9);
var _local3 = com.ACA.Vehicle.getDefaultVehicleParam();
_local3.accelerateForwardWheel = 60;
_local3.accelerateBackWheel = 40;
_local3.brakeForwardWheel = -10;
_local3.brakeBackWheel = -20;
_local3.accPercMult = engine.__get__gravity() * 8;
_local3.normalYLimit = 0.9;
setVehicleParam(_local3);
_local5.addToEngine(engine);
}
function stopCar(stopPoint) {
if (m_forwardWheel.m_speed > 2) {
kids = false;
m_backWheel.setAccelerate(-10);
m_forwardWheel.setAccelerate(-10);
} else if (m_vehicleMovie._x < stopPoint) {
m_forwardWheel.setAccelerate(m_accForwardWheel);
kids = false;
} else if (m_vehicleMovie._x > (stopPoint + 50)) {
m_backWheel.setAccelerate(-10);
m_forwardWheel.setAccelerate(-10);
kids = false;
} else {
kids = true;
}
}
function onNitro() {
com.ACA.Vehicle.nitro = true;
m_backWheel.setAccelerate(80);
m_forwardWheel.setAccelerate(80);
}
function offNitro() {
com.ACA.Vehicle.nitro = false;
}
function showKids() {
m_vehicleMovie.copii._visible = true;
m_vehicleMovie.copii.play();
}
function startFire() {
m_vehicleMovie.ex1.gotoAndPlay(2);
}
function onWheels() {
if ((m_backWheel.hasIntersection() == false) && (m_forwardWheel.hasIntersection() == false)) {
return(false);
}
return(true);
}
function checkRotation() {
if ((m_backWheel.hasIntersection() == false) && (m_forwardWheel.hasIntersection() == false)) {
onAir = true;
if (m_vehicleMovie._rotation > 0) {
currentRotation = m_vehicleMovie._rotation;
} else {
currentRotation = 360 + m_vehicleMovie._rotation;
}
if ((oldRotation > currentRotation) && (Math.abs(oldRotation - currentRotation) < 300)) {
if (initialRotation > 180) {
if (currentRotation < (initialRotation - 180)) {
abc++;
initialRotation = initialRotation - 180;
}
} else if ((currentRotation < ((360 + initialRotation) - 180)) && (currentRotation > 180)) {
abc++;
initialRotation = (360 + initialRotation) - 180;
}
}
oldRotation = currentRotation;
} else {
if (!checkDeathPoints(_level0.game.b._Level.mcHit)) {
if ((m_backWheel.hasIntersection() == true) && (m_forwardWheel.hasIntersection() == true)) {
if (onAir == true) {
if (abc > 0) {
nrFlip = nrFlip + (Math.floor(abc / 2) + 1);
_level0.game.b.popup.nrFlip = (nrFlip + " of ") + _root.flipArray[_root.currentlevel - 1];
if ((Math.floor(abc / 2) + 1) > 0) {
_root.game.b.popup.scorepanel.gscore1 = _root.game.b.popup.scorepanel.gscore1 + 100;
_root.game.b.popup.validate.gotoAndPlay(2);
_root.game.b.popup.validate.validateInterior.validate.text = "Backflip";
} else if ((Math.floor(abc / 2) + 1) > 1) {
_root.game.b.popup.validate.validateInterior.validate.text = "Double Backflip";
_root.game.b.popup.validate.gotoAndPlay(1);
}
}
onAir = false;
abc = 0;
}
}
} else {
abc = 0;
}
if (m_vehicleMovie._rotation < 0) {
initialRotation = 360 + m_vehicleMovie._rotation;
} else {
initialRotation = m_vehicleMovie._rotation;
}
currentRotation = initialRotation;
oldRotation = initialRotation;
}
}
function process() {
checkRotation();
var _local3 = 0;
if (inProcess) {
if (!m_vehicleMovie._parent._parent._parent.bodyCrash) {
if (getKeys) {
if (Key.isDown(37)) {
_local3 = _local3 | com.ACA.Vehicle.KM_MOVE_BODY_BACK;
} else if (Key.isDown(39)) {
_local3 = _local3 | com.ACA.Vehicle.KM_MOVE_BODY_FORWARD;
}
}
if (Key.isDown(38)) {
_local3 = _local3 | com.ACA.Vehicle.KM_ACCELERATE;
} else if (Key.isDown(40)) {
_local3 = _local3 | com.ACA.Vehicle.KM_BRAKE;
}
_level0.game.bg_level.back_mc.stop();
} else if (Key.isDown(38) && (Key.isDown(37))) {
moveFor();
} else if (Key.isDown(38) && (Key.isDown(39))) {
moveBack();
}
}
processKey(_local3);
super.process();
}
function moveFor() {
m_backWheel.__get__accelerate().plusXY(0, -150);
}
function moveBack() {
m_forwardWheel.__get__accelerate().plusXY(0, -150);
}
function getMC() {
return(m_vehicleMovie);
}
function getHitForBonus() {
return(m_vehicleMovie.mcHit);
}
function checkDeathPoints(hitMov) {
var _local2 = new Object();
for (var _local4 in m_vehicleMovie.mcDeathPoints) {
_local2.x = m_vehicleMovie.mcDeathPoints[_local4]._x;
_local2.y = m_vehicleMovie.mcDeathPoints[_local4]._y;
m_vehicleMovie.mcDeathPoints.localToGlobal(_local2);
if (hitMov.hitTest(_local2.x, _local2.y, true)) {
return(true);
}
}
return(false);
}
function chkDeath(ht) {
var _local2 = new Object();
for (var _local4 in m_vehicleMovie.mcDeathPoints) {
_local2.x = m_vehicleMovie.mcDeathPoints[_local4]._x;
_local2.y = m_vehicleMovie.mcDeathPoints[_local4]._y;
m_vehicleMovie.mcDeathPoints.localToGlobal(_local2);
if (ht.hitTest(_local2.x, _local2.y, true)) {
return(true);
}
}
return(false);
}
var kids = false;
var truckRotation = 180;
var abc = 0;
var onAir = false;
var nrFlip = 0;
}
Instance of Symbol 74 MovieClip "more" in Symbol 78 MovieClip Frame 1
onClipEvent (load) {
this.onRelease = function () {
getURL ("http://www.101cargames.com", "_blank");
};
}
Instance of Symbol 81 MovieClip in Symbol 82 MovieClip Frame 1
on (release) {
getURL ("http://www.facebook.com/pages/101CarGames/112483118816680", "_blank");
}
Symbol 85 Button
on (release) {
getURL ("http://www.juegosjuegos.com", "_blank");
}
Symbol 98 MovieClip Frame 1
stop();
Symbol 98 MovieClip Frame 5
stop();
Symbol 106 MovieClip Frame 1
stop();
Symbol 106 MovieClip Frame 5
stop();
Symbol 120 MovieClip Frame 1
stop();
Symbol 120 MovieClip Frame 2
var stopCopac = true;
Symbol 120 MovieClip Frame 21
stop();
Symbol 141 MovieClip [level2] Frame 1
onEnterFrame = function () {
this.poduri.pod1._y = this.mcHit.shape_pod1._y + 1100;
this.poduri.pod2._y = this.mcHit.shape_pod2._y + 1100;
this.poduri.pod2._x = this.mcHit.shape_pod2._x + 1812;
};
Symbol 155 MovieClip [level4] Frame 1
onEnterFrame = function () {
this.poduri.pod1._y = this.mcHit.shape_pod1._y + 1100;
this.poduri.pod2._y = this.mcHit.shape_pod2._y + 1100;
this.poduri.pod2._x = this.mcHit.shape_pod2._x + 1812;
};
Symbol 163 Button
on (release) {
_root.gamescore = _root.gamescore - _root.levelscore;
trace("aaaaaaa" + _parent._parent);
_root.game.removeMovieClip();
_root.gotoAndStop("start");
}
Symbol 164 Button
on (release) {
getURL ("http://www.101cargames.com", "_blank");
}
Symbol 166 MovieClip Frame 19
stop();
Symbol 169 MovieClip Frame 25
stop();
Symbol 177 Button
on (release) {
_root.dieCount = 0;
_root.gamescore1 = 0;
_root.currentlevel = 1;
_parent._parent.removeMovieClip();
_root.gotoAndStop("start");
}
Symbol 186 Button
on (release) {
_root.dieCount = 0;
_root.currentlevel++;
_root.game.removeMovieClip();
_root.gotoAndStop("start");
}
Symbol 188 MovieClip Frame 19
stop();
Symbol 193 MovieClip Frame 1
stop();
Symbol 193 MovieClip Frame 26
stop();
trace(validateInterior);
Symbol 200 MovieClip Frame 1
stop();
gotoAndStop(_root.currentlevel);
Symbol 201 MovieClip Frame 78
stop();
Symbol 206 MovieClip Frame 1
stop();
snd.sndvolon();
Symbol 206 MovieClip Frame 2
snd.sndvoloff();
Symbol 214 MovieClip Frame 1
trace(this);
Symbol 218 MovieClip Frame 25
stop();
Symbol 219 MovieClip [popup] Frame 1
stop();
more_mc.onRelease = function () {
getURL ("http://www.101cargames.com", "_blank");
};
Symbol 219 MovieClip [popup] Frame 10
stop();
more_mc.onRelease = function () {
getURL ("http://www.101cargames.com", "_blank");
};
Instance of Symbol 81 MovieClip in Symbol 219 MovieClip [popup] Frame 10
on (release) {
getURL ("http://www.facebook.com/pages/101CarGames/112483118816680", "_blank");
}
Symbol 219 MovieClip [popup] Frame 20
stop();
papirus.interior.gscore = _root.gamescore1;
papirus.interior.more_mc.onRelease = function () {
getURL ("http://www.101cargames.com", "_blank");
};
Symbol 219 MovieClip [popup] Frame 29
stop();
Symbol 219 MovieClip [popup] Frame 30
stop();
more_mc.onRelease = function () {
getURL ("http://www.101cargames.com", "_blank");
};
Symbol 219 MovieClip [popup] Frame 41
stop();
onLoad = function () {
papirus.play();
};
more_mc.onRelease = function () {
getURL ("http://www.101cargames.com", "_blank");
};
Symbol 231 MovieClip Frame 1
onEnterFrame = function () {
gotoAndStop(_root.currentlevel);
};
Symbol 232 MovieClip [bg] Frame 1
#initclip 12
Object.registerClass("bg", com.UI.Game);
#endinitclip
Symbol 236 MovieClip Frame 1
stop();
Symbol 237 MovieClip Frame 1
stop();
init();
more_btn.onRelease = function () {
getURL ("http://www.101cargames.com", "_blank");
};
more_btn.onRollOver = function () {
more_btn.gotoAndPlay("over");
};
more_btn.onRollOut = function () {
more_btn.gotoAndPlay("out");
};
Symbol 317 MovieClip Frame 1
stop();
Symbol 317 MovieClip Frame 38
stop();
Symbol 330 MovieClip [truckbody] Frame 1
onEnterFrame = function () {
carlig_mc._rotation = -this._rotation;
};
ex1.cacheAsBitmap = true;
maskMC.cacheAsBitmap = true;
ex1.setMask("maskMC");
Symbol 333 MovieClip Frame 1
stop();