Frame 1
fscommand ("showmenu", "false");
_focusrect = false;
_global.openSite = function () {
getURL ("http://www.gametop.com/stats/neptunebuggy.html", "_blank");
};
_global.gameName = "neptunebuggy";
_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 711 MovieClip [__Packages.CGame] Frame 0
class CGame extends MovieClip
{
static var m_instance, levels, levelNum, gameType, timeChangeScore, __get__time, __get__txtLevel_;
var txtTime;
function CGame () {
super();
m_instance = this;
levels = new Array();
levels.push({mc:"dmLevel1", points:30000});
levels.push({mc:"dmLevel2", points:30000});
levels.push({mc:"dmLevel7", points:30000});
levels.push({mc:"dmLevel3", points:30000});
levels.push({mc:"dmLevel8", points:30000});
levels.push({mc:"dmLevel9", points:30000});
levels.push({mc:"dmLevel4", points:30000});
levels.push({mc:"dmLevel6", points:30000});
levels.push({mc:"dmLevel5", points:30000});
txtTime = "";
}
static function butStart() {
levelNum = 1;
time = ("");
gameType = 1;
m_instance.full_m_score = 0;
m_instance.gotoAndStop("lbRace");
}
static function butStartNext() {
m_instance.gotoAndStop("lbRace");
if (gameType == 1) {
m_instance.guiBar.gotoAndStop(2);
}
}
static function butSwitchPause() {
m_instance.m_race.__set__pauseOn(!m_instance.m_race.__get__pauseOn());
}
static function butEndRaceVictory() {
m_instance.gotoAndStop("lbStatistics");
instance.tf2.text = (_global.takenBonus1 + "/") + _global.allBonus1;
instance.tf22.text = _global.takenScore1;
instance.tf1.text = (_global.takenBonus2 + "/") + _global.allBonus2;
instance.tf11.text = _global.takenScore2;
instance.tf3.text = (_global.takenBonus3 + "/") + _global.allBonus3;
instance.tf33.text = _global.takenScore3;
instance.tf4.text = (_global.takenBonus4 + "/") + _global.allBonus4;
instance.tf44.text = _global.takenScore4;
}
static function butEndRace() {
m_instance.gotoAndStop("lbFinalStatistics");
instance.tf2.text = (_global.takenBonus1 + "/") + _global.allBonus1;
instance.tf22.text = _global.takenScore1;
instance.tf1.text = (_global.takenBonus2 + "/") + _global.allBonus2;
instance.tf11.text = _global.takenScore2;
instance.tf3.text = (_global.takenBonus3 + "/") + _global.allBonus3;
instance.tf33.text = _global.takenScore3;
instance.tf4.text = (_global.takenBonus4 + "/") + _global.allBonus4;
instance.tf44.text = _global.takenScore4;
}
static function butEndRaceLoose() {
m_instance.gotoAndStop("lbGameOver");
}
static function butEndRaceTimeAttack() {
m_instance.gotoAndStop("lbGameOverTimeAttack");
}
static function butAbout() {
m_instance.gotoAndStop("lbAbout");
}
static function butStartContest() {
gameType = 1;
levelNum = 1;
butStart();
}
static function butStartLevel(n) {
gameType = 2;
levelNum = n;
butStart();
}
static function butSelectLevel() {
m_instance.gotoAndStop("lbSelect");
}
static function butBackToMenu() {
m_instance.gotoAndStop("lbSplash");
}
static function butBackToSplash() {
m_instance.gotoAndStop("lbSplash");
}
static function set score(nScore) {
if (nScore < 0) {
nScore = 0;
}
m_instance.m_score = nScore;
m_instance.txtScore = String(score + full_score);
m_instance.txtScore_ins = String(score);
if (gameType == 1) {
m_instance.txtScore_ins = m_instance.txtScore_ins + (" / " + levels[levelNum - 1].points);
}
timeChangeScore = getTimer();
//return(score);
}
static function set time(t) {
m_instance.txtTime = t;
//return(__get__time());
}
static function get full_score() {
return(m_instance.full_m_score);
}
static function set full_score(nScore) {
if (nScore < 0) {
nScore = 0;
}
m_instance.full_m_score = nScore;
m_instance.full_txtScore = String(full_score);
//return(full_score);
}
static function get score() {
return(m_instance.m_score);
}
static function set takenBonus(a) {
m_instance.bonusTaken = a;
setBonusTXT();
//return(takenBonus);
}
static function get takenBonus() {
return(m_instance.bonusTaken);
}
static function set allBonus(a) {
m_instance.bonusAtAll = a;
setBonusTXT();
//return(allBonus);
}
static function get allBonus() {
return(m_instance.bonusAtAll);
}
static function setBonusTXT() {
m_instance.txtBonus = (m_instance.bonusTaken + "/") + m_instance.bonusAtAll;
}
static function set txtLevel_(a) {
m_instance.txtLevel = a;
//return(__get__txtLevel_());
}
static function get instance() {
return(m_instance);
}
}
Symbol 712 MovieClip [__Packages.CRace] Frame 0
class CRace extends MovieClip
{
static var m_instance;
var dieTime, inDieMode, startPauser, savedPoint, savedScore, carType, m_level, attachMovie, _parent, lives, endTime, mm, mm_xy_ratio, mm_scale, m_pEngine, inProcess, inPostGame, m_car, FINinterval, m_pauseOn, onEnterFrame, scroll_x;
function CRace () {
super();
}
function onLoad() {
m_instance = this;
init();
pauseOn = (false);
CGame.__set__score(0);
dieTime = 0;
inDieMode = false;
}
function init() {
trace("Starting level " + (CGame.levelNum - 1));
CGame.__get__instance().txtLevelStr = ((("LEVEL " + CGame.levels[CGame.levelNum - 1].mc.substr(7, 2)) + " (order: ") + CGame.levelNum) + ")";
startPauser = 0;
CGame.__set__txtLevel_(String(CGame.levelNum));
_global.dieZ = new Array();
_global.savePointz = new Array();
savedPoint = undefined;
savedScore = 0;
carType = CGame.__get__instance().selectedCar;
m_level = attachMovie(CGame.levels[CGame.levelNum - 1].mc, "_Level1", 1001);
_parent.soundMC.gotoAndPlay("go");
lives = 5;
_parent.heartz.gotoAndStop(lives + 1);
if (CGame.gameType == 2) {
endTime = getTimer() + 60000;
}
if (usingMap) {
mm = _parent.miniMap;
mm._visible = true;
var _local7 = mm.attachMovie(CGame.levels[CGame.levelNum - 1].mc + "_mm", "map", 0);
if (_local7 == undefined) {
_local7 = mm.attachMovie(CGame.levels[CGame.levelNum - 1].mc, "map", 0);
}
var _local6 = m_level._width;
var _local5 = m_level._height;
mm_xy_ratio = mm._xscale / mm._yscale;
var _local3 = _local6 / 550;
var _local4 = _local5 / 400;
_local3 = _local3 / mm_xy_ratio;
mm_scale = (mm_ratio * 100) / Math.max(_local3, _local4);
mm.player.swapDepths(2);
mm.player._xscale = mm.player._xscale / mm_xy_ratio;
mm.miniMap_misc.swapDepths(3);
mm.map.setMask(mm.miniMap_mask);
mm.map._xscale = mm_scale / mm_xy_ratio;
mm.map._yscale = mm_scale;
} else {
_parent.miniMap._visible = false;
}
m_pEngine = new iriysoft.pengine.CParticleEngine(m_level.mcHit, 7);
newRace();
}
function newRace() {
inProcess = true;
inPostGame = false;
m_pEngine.clear();
m_car = new CCar();
m_car.init(m_level.mcVehiclePlace, m_pEngine, _parent);
m_car.addEventListener(CCar.EVENT_TRICK, mx.utils.Delegate.create(this, makeTrickMassage));
setPosition(true);
m_car.initTricks(CGame.levelNum);
_parent.sinfo.gotoAndPlay(2);
if (CGame.gameType == 1) {
_parent.sinfo.img.gotoAndStop("level" + CGame.levelNum);
}
}
function processRace() {
m_pEngine.process();
m_car.process();
startPauser++;
if (startPauser == 1) {
_global.takenBonus1 = (_global.takenBonus2 = (_global.takenBonus3 = (_global.takenBonus4 = 0)));
_global.takenScore1 = (_global.takenScore2 = (_global.takenScore3 = (_global.takenScore4 = 0)));
_global.allBonus1 = (_global.allBonus2 = (_global.allBonus3 = (_global.allBonus4 = 0)));
for (var _local7 in m_level.mcBonusPlace) {
if (m_level.mcBonusPlace[_local7].mcHit != undefined) {
switch (m_level.mcBonusPlace[_local7].subtype) {
case 1 :
_global.allBonus1++;
break;
case 2 :
_global.allBonus2++;
break;
case 3 :
_global.allBonus3++;
break;
case 4 :
_global.allBonus4++;
break;
case 5 :
_global.allBonus5++;
}
}
}
}
if (CGame.gameType == 2) {
var _local18 = Math.round((endTime - getTimer()) / 1000);
var _local21 = Math.floor(_local18 / 60);
var _local13 = _local18 % 60;
if (_local13 < 10) {
_local13 = "0" + _local13;
}
CGame.__set__time((_local21 + ":") + _local13);
if (getTimer() >= endTime) {
CGame.__set__time("0:00");
}
}
var _local15 = {x:m_car.__get__image().aPart._x, y:m_car.__get__image().aPart._y};
m_car.__get__image().aPart._parent.localToGlobal(_local15);
var _local14 = {x:m_car.__get__backWheel().__get__pos().x, y:m_car.__get__backWheel().__get__pos().y};
m_level.localToGlobal(_local14);
var _local20 = (Math.atan2(_local14.y - _local15.y, _local14.x - _local15.x) * 57.2957795130823) - m_car.__get__image()._rotation;
m_car.__get__image().aPart._rotation = _local20 + 180;
if (usingMap) {
var _local17 = (mm_scale * m_car.__get__image()._x) / 100;
var _local19 = (mm_scale * m_car.__get__image()._y) / 100;
_local17 = _local17 / mm_xy_ratio;
mm.map._x = (-_local17) + 275;
mm.map._y = (-_local19) + 200;
}
setPosition();
if (((m_level.mcFinish._x < (m_car.__get__backWheel().__get__pos().x - 50)) || (m_car.gameOverInTest)) && (!inPostGame)) {
if ((getTimer() - CGame.timeChangeScore) > 500) {
if (CGame.levelNum >= CGame.levels.length) {
trace("\u0423\u0440\u043E\u0432\u043D\u0438 \u0437\u0430\u043A\u043E\u043D\u0447\u0438\u043B\u0438\u0441\u044C");
var _local16 = attachMovie("winMF", "winMessage", 1002);
_local16._x = 275;
_local16._y = 120;
inPostGame = true;
FINinterval = setInterval(this, "endOfLevel", 1500, 1);
_parent.soundMC.gotoAndPlay("flip");
} else {
var _local16 = attachMovie("winMF", "winMessage", 1002);
_local16._x = 275;
_local16._y = 120;
inPostGame = true;
FINinterval = setInterval(this, "endOfLevel", 1500, 2);
_parent.soundMC.gotoAndPlay("flip");
}
}
if ((getTimer() >= endTime) && (CGame.gameType == 2)) {
trace("\u0412\u0440\u0435\u043C\u044F \u0432\u044B\u0448\u043B\u043E");
var _local16 = attachMovie("winMF", "winMessage", 1002);
_local16._x = 275;
_local16._y = 120;
inPostGame = true;
FINinterval = setInterval(this, "endOfLevel", 1500, 1);
_parent.soundMC.gotoAndPlay("flip");
}
}
var _local11 = m_car.getHitForBonus();
for (var _local7 in m_level.mcBonusPlace) {
if (_local11.hitTest(m_level.mcBonusPlace[_local7].mcHit)) {
m_level.mcBonusPlace[_local7].gotoAndPlay("die");
if (usingMap) {
var _local6 = m_level.mcBonusPlace[_local7]._x;
var _local5 = m_level.mcBonusPlace[_local7]._y;
for (var _local12 in mm.map.mcBonusPlace) {
var _local3 = mm.map.mcBonusPlace[_local12];
if ((((_local3._x > (_local6 - 2)) && (_local3._x < (_local6 + 2))) && (_local3._y > (_local5 - 2))) && (_local3._y < (_local5 + 2))) {
_local3._visible = false;
break;
}
}
}
switch (m_level.mcBonusPlace[_local7].type) {
case 0 :
var _local4 = bonus_0;
break;
case 1 :
_local4 = bonus_1;
break;
case 2 :
_local4 = bonus_2;
break;
case 3 :
_local4 = bonus_3;
break;
case 4 :
_local4 = bonus_4;
break;
case 5 :
_local4 = bonus_5;
break;
default :
_local4 = bonus_0;
}
switch (m_level.mcBonusPlace[_local7].subtype) {
case 1 :
_global.takenBonus1++;
_global.takenScore1 = _global.takenScore1 + _local4;
break;
case 2 :
_global.takenBonus2++;
_global.takenScore2 = _global.takenScore2 + _local4;
break;
case 3 :
_global.takenBonus3++;
_global.takenScore3 = _global.takenScore3 + _local4;
break;
case 4 :
_global.takenBonus4++;
_global.takenScore4 = _global.takenScore4 + _local4;
break;
case 5 :
_global.takenBonus5++;
_global.takenScore5 = _global.takenScore5 + _local4;
}
CGame.score = CGame.score + _local4;
CGame.__set__takenBonus((CGame.__get__takenBonus()+1));
}
}
var _local7 = 0;
while (_local7 < _global.savePointz.length) {
var _local8 = _global.savePointz[_local7];
if (savedPoint == _local8) {
} else if (_local11.hitTest(_local8.mcHit)) {
savedPoint = _local8;
savedScore = CGame.score;
var _local9 = attachMovie("dmSaved", "_dmSaved", 28000);
_local9._x = 275;
_local9._y = 100;
}
_local7++;
}
if (inProcess && ((getTimer() - m_car.bornTime) > 200)) {
if (!inPostGame) {
if (inProcess) {
_local7 = 0;
while (_local7 < _global.dieZ.length) {
var _local10 = _global.dieZ[_local7];
if (m_car.checkDeathPoints(_local10)) {
makeDie();
m_car.bar._visible = false;
}
_local7++;
}
}
if (inProcess) {
if (m_car.checkDeathPoints(m_level.mcHit)) {
inDieMode = true;
} else {
inDieMode = false;
dieTime = getTimer();
}
if ((getTimer() - dieTime) > 100) {
CGame.__get__instance().dieTime_ = String(Math.round((getTimer() - dieTime) / 10) / 100);
} else {
CGame.__get__instance().dieTime_ = "";
}
if ((getTimer() - dieTime) > dieTimeout) {
makeDie();
m_car.bar._visible = false;
_parent.soundMC.gotoAndPlay("die" + Math.floor((Math.random() * 3) + 1));
trace("\u043F\u043F\u0446");
}
}
}
}
}
function makeDie() {
_root.ssMC.stop();
m_car.inProcess = false;
inPostGame = true;
inProcess = false;
var _local3 = attachMovie(((lives == 0) ? "dieMFend" : "dieMF"), "dieMessage", 3002);
_local3._x = 275;
_local3._y = 150;
m_car.__get__image().cbs.carBody.gotoAndStop(m_car.__get__image().cbs.carBody._totalframes);
}
function endOfLevel(n) {
clearInterval(FINinterval);
CGame.full_score = CGame.full_score + CGame.score;
if (CGame.gameType == 1) {
if (n == 1) {
CGame.butEndRace();
} else if (n == 2) {
CGame.levelNum++;
CGame.butEndRaceVictory();
}
}
if (CGame.gameType == 2) {
CGame.butEndRaceTimeAttack();
}
}
function makeTrickMassage(msg) {
if (!inProcess) {
return(undefined);
}
var _local4 = "";
var _local6 = 0;
if (!m_car.mode) {
if (msg.trickID == CCar.TRICK_BACK_FLIP) {
msg.trickID = CCar.TRICK_FRONT_FLIP;
} else if (msg.trickID == CCar.TRICK_FRONT_FLIP) {
msg.trickID = CCar.TRICK_BACK_FLIP;
}
}
if (msg.trickID == CCar.TRICK_BACK_FLIP) {
_local4 = "backFlip";
_local6 = 10;
} else if (msg.trickID == CCar.TRICK_FRONT_FLIP) {
_local4 = "frontFlip";
_local6 = 15;
}
if (_local4 != "") {
var _local2 = CCar.__get__instance();
_local2.combo++;
var _local3 = _local2.combo;
if (_local3 > 5) {
_local3 = 5;
}
if (_local3 > 1) {
_local2.mainMovie.cmsg.gotoAndPlay(2);
_local2.mainMovie.cmsg.msg.gotoAndStop("x" + _local3);
_parent.soundMC.gotoAndPlay("c" + _local3);
}
_local2.trickSumCount = _local2.trickSumCount + _local6;
_local2.mainMovie.msg.gotoAndPlay(2);
_local2.mainMovie.msg.msg.gotoAndStop(_local4);
}
}
function set pauseOn(pauseState) {
m_pauseOn = pauseState;
enableProcess(!m_pauseOn);
//return(pauseOn);
}
function get pauseOn() {
return(m_pauseOn);
}
function enableProcess(enable) {
if (enable) {
onEnterFrame = processRace;
_parent._scrPause.removeMovieClip();
} else {
onEnterFrame = function () {
};
_parent.attachMovie("dmPause", "_scrPause", 32001);
}
}
function setPosition(now) {
var _local4 = m_car.__get__image()._x;
var _local3 = m_car.__get__image()._y;
var _local6 = leftOffset;
var _local5 = rightOffset;
if (!m_car.mode) {
_local6 = rightOffset;
_local5 = leftOffset;
}
var _local2 = m_level._x;
if (_local2 < (_local6 - _local4)) {
_local2 = _local6 - _local4;
}
if (_local2 > ((550 - _local5) - _local4)) {
_local2 = (550 - _local5) - _local4;
}
_local2 = Math.round(_local2);
if (scroll_x == undefined) {
scroll_x = m_level._x;
}
if (now) {
scroll_x = _local2;
} else {
scroll_x = scroll_x + ((_local2 - scroll_x) / xScrollFactor);
}
m_level._x = Math.round(scroll_x);
if (m_level._y < (topOffset - _local3)) {
m_level._y = Math.round(topOffset - _local3);
}
if (m_level._y > ((400 - bottomOffset) - _local3)) {
m_level._y = Math.round((400 - bottomOffset) - _local3);
}
m_car.bar._x = m_car.__get__image()._x + m_level._x;
m_car.bar._y = (m_car.__get__image()._y + m_level._y) - 70;
}
static function get instance() {
return(m_instance);
}
var usingMap = true;
static var dieTimeout = 1200;
var bonus_0 = 0;
var bonus_1 = 250;
var bonus_2 = 250;
var bonus_3 = 50;
var bonus_4 = 200;
var bonus_5 = 25;
var leftOffset = 150;
var rightOffset = 350;
var topOffset = 170;
var bottomOffset = 170;
var xScrollFactor = 5;
var mm_ratio = 2;
}
Symbol 713 MovieClip [__Packages.iriysoft.pengine.CParticleEngine] Frame 0
class iriysoft.pengine.CParticleEngine
{
var m_particles, m_constraints, m_hitMovie, m_gravity, m_koeffDamp;
function CParticleEngine (hitMovie, nGravity, koeffDamp) {
m_particles = new Array();
m_constraints = new Array();
setHitMovie(hitMovie);
init(nGravity, koeffDamp);
}
function setHitMovie(hitMovie) {
if (hitMovie == undefined) {
hitMovie = null;
}
m_hitMovie = hitMovie;
}
function getHitMovie() {
return(m_hitMovie);
}
function set gravity(nGravity) {
m_gravity = nGravity;
//return(gravity);
}
function get gravity() {
return(m_gravity);
}
function init(nGravity, koeffDamp) {
if (nGravity == undefined) {
nGravity = 9.8;
}
if (koeffDamp == undefined) {
koeffDamp = 0.995;
}
gravity = (nGravity);
m_koeffDamp = koeffDamp;
}
function addParticle(p) {
m_particles.push(p);
}
function process() {
var _local2 = 0;
while (_local2 < m_particles.length) {
m_particles[_local2].accelerate.plusXY(0, m_gravity * m_particles[_local2].mass);
m_particles[_local2].accelerate.mult(1 / REPEAT_COUNT);
_local2++;
}
var _local3 = 0;
while (_local3 < REPEAT_COUNT) {
_local2 = 0;
while (_local2 < m_particles.length) {
m_particles[_local2].verlet(D_TIME, m_koeffDamp);
_local2++;
}
_local2 = 0;
while (_local2 < m_constraints.length) {
m_constraints[_local2].resolve();
_local2++;
}
_local2 = 0;
while (_local2 < m_particles.length) {
m_particles[_local2].checkCollision(m_hitMovie);
_local2++;
}
_local3++;
}
_local2 = 0;
while (_local2 < m_particles.length) {
m_particles[_local2].accelerate.init(0, 0);
_local2++;
}
}
function addConstraint(c) {
m_constraints.push(c);
}
function clear() {
while (m_particles.pop() != undefined) {
}
clearConstraints();
}
function clearConstraints() {
while (m_constraints.pop() != undefined) {
}
}
static var SEC_PER_FRAME = 0.0416666666666667;
static var REPEAT_COUNT = 3;
static var D_TIME = SEC_PER_FRAME / REPEAT_COUNT;
}
Symbol 714 MovieClip [__Packages.iriysoft.pengine.particle.CParticle] Frame 0
class iriysoft.pengine.particle.CParticle
{
var m_curPosition, m_prevPosition, m_accelerate, m_buckup, m_mass, m_mc;
function CParticle () {
m_curPosition = new iriysoft.pengine.math.CVector2D();
m_prevPosition = new iriysoft.pengine.math.CVector2D();
m_accelerate = new iriysoft.pengine.math.CVector2D();
m_buckup = new iriysoft.pengine.math.CVector2D();
}
function initParticle(x, y, mass, mc) {
if (x == undefined) {
x = 0;
}
if (y == undefined) {
y = 0;
}
if (mass == undefined) {
mass = 1;
}
moveTo(x, y);
m_mass = mass;
m_accelerate.x = 0;
m_accelerate.y = 0;
setMovie(mc);
return(this);
}
function moveTo(nx, ny) {
m_curPosition.x = (m_prevPosition.x = nx);
m_curPosition.y = (m_prevPosition.y = ny);
synchronizeMovie();
}
function verlet(dTime, koeffDamp) {
m_buckup.copyFrom(m_curPosition);
m_curPosition.x = m_curPosition.x + (((m_curPosition.x - m_prevPosition.x) * koeffDamp) + (m_accelerate.x * dTime));
m_curPosition.y = m_curPosition.y + (((m_curPosition.y - m_prevPosition.y) * koeffDamp) + (m_accelerate.y * dTime));
m_buckup.copyTo(m_prevPosition);
synchronizeMovie();
}
function checkCollision(hitMovie) {
}
function synchronizeMovie() {
}
function moveMovieToCurentPosition() {
m_mc._x = m_curPosition.x;
m_mc._y = m_curPosition.y;
}
function get mass() {
return(m_mass);
}
function set mass(nMass) {
m_mass = nMass;
//return(mass);
}
function get accelerate() {
return(m_accelerate);
}
function set accelerate(acc) {
m_accelerate = acc;
//return(accelerate);
}
function get prevPos() {
return(m_prevPosition);
}
function set prevPos(pos) {
m_prevPosition = pos;
//return(prevPos);
}
function get pos() {
return(m_curPosition);
}
function set pos(pos) {
m_curPosition = pos;
//return(this.pos);
}
function setMovie(mc) {
if ((mc == null) || (mc == undefined)) {
synchronizeMovie = function () {
};
m_mc = null;
} else {
m_mc = mc;
synchronizeMovie = moveMovieToCurentPosition;
}
}
function getMovie() {
return(m_mc);
}
}
Symbol 715 MovieClip [__Packages.iriysoft.pengine.math.CVector2D] Frame 0
class iriysoft.pengine.math.CVector2D
{
var x, y;
function CVector2D (nx, ny) {
init(nx, ny);
}
function init(nx, ny) {
x = nx;
y = ny;
}
function copyFrom(v) {
x = v.x;
y = v.y;
}
function copyTo(v) {
v.x = x;
v.y = y;
}
function plusXY(nx, ny) {
x = x + nx;
y = y + ny;
}
static function getDistanceBetween(p1, p2) {
var _local2 = p1.x - p2.x;
var _local1 = p1.y - p2.y;
return(Math.sqrt((_local2 * _local2) + (_local1 * _local1)));
}
function duplicate() {
return(new iriysoft.pengine.math.CVector2D(x, y));
}
function minus(v) {
x = x - v.x;
y = y - v.y;
}
function minusNew(v) {
return(new iriysoft.pengine.math.CVector2D(x - v.x, y - v.y));
}
function normalize() {
var _local2 = Math.sqrt((x * x) + (y * y));
x = x / _local2;
y = y / _local2;
}
function reverseNew() {
return(new iriysoft.pengine.math.CVector2D(-x, -y));
}
function scalar(v) {
return((x * v.x) + (y * v.y));
}
function modul() {
return(Math.sqrt((x * x) + (y * y)));
}
function rotate(u) {
var _local4 = x;
var _local3 = y;
x = (_local4 * Math.cos(u)) - (_local3 * Math.sin(u));
y = (_local4 * Math.sin(u)) + (_local3 * Math.cos(u));
}
function rotateNew(u) {
return(new iriysoft.pengine.math.CVector2D((x * Math.cos(u)) - (y * Math.sin(u)), (x * Math.sin(u)) + (y * Math.cos(u))));
}
function mult(k) {
x = x * k;
y = y * k;
}
function multNew(k) {
return(new iriysoft.pengine.math.CVector2D(x * k, y * k));
}
function plus(v) {
x = x + v.x;
y = y + v.y;
}
function plusNew(v) {
return(new iriysoft.pengine.math.CVector2D(x + v.x, y + v.y));
}
function getDistanceTo(p1, p2) {
var _local3 = p1.y - p2.y;
var _local2 = p2.x - p1.x;
var _local6 = (p1.x * (p2.y - p1.y)) - (p1.y * (p2.x - p1.x));
var _local5 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
_local3 = _local3 / _local5;
_local2 = _local2 / _local5;
_local6 = _local6 / _local5;
return(((_local3 * x) + (_local2 * y)) + _local6);
}
}
Symbol 716 MovieClip [__Packages.iriysoft.pengine.constraint.IConstraint] Frame 0
interface iriysoft.pengine.constraint.IConstraint
{
}
Symbol 717 MovieClip [__Packages.iriysoft.pengine.CVehicle] Frame 0
class iriysoft.pengine.CVehicle
{
var m_vehicleDir, m_vehicleNormal, t_point1, t_point2, m_vehicleMovie, m_vehicleParam, m_bodyMovie, m_backWheel, m_forwardWheel, m_accPercMultForTurn, m_normalYLimitForTurn, m_koeffPrimaryForTurn, m_koeffSecondaryForTurn, m_accPercBaseForTurn, m_accelerateForwardWheel, m_accelerateBackWheel, m_brakeForwardWheel, m_brakeBackWheel, t_buffNumber, m_vehicleAngle, t_turnToPerc, t_turnToDX, t_turnToDY;
function CVehicle () {
m_vehicleDir = new iriysoft.pengine.math.CVector2D(0, 0);
m_vehicleNormal = new iriysoft.pengine.math.CVector2D(0, 0);
t_point1 = new iriysoft.pengine.math.CVector2D();
t_point2 = new iriysoft.pengine.math.CVector2D();
}
function getVehiclePoint(mc) {
var _local2 = new Object();
_local2.x = mc._x;
_local2.y = mc._y;
mc._parent.localToGlobal(_local2);
m_vehicleMovie._parent.globalToLocal(_local2);
return(_local2);
}
function moveMovieToMovieGlobal(movie, moviePos) {
var _local1 = {x:movie._x, y:movie._y};
movie._parent.localToGlobal(_local1);
moviePos._parent.globalToLocal(_local1);
moviePos._x = _local1.x;
moviePos._y = _local1.y;
}
function rotateMovieToMovieLocal(movie, moviePos) {
movie._rotation = Math.atan2(moviePos._y - movie._y, moviePos._x - movie._x) * VAL_180_DIV_PI;
}
function construct(vehicleParam, bodyMovie, vehicleMovie, mcWBack, mcWForward) {
m_vehicleParam = vehicleParam;
m_bodyMovie = bodyMovie;
m_vehicleMovie = vehicleMovie;
m_vehicleParam.changeGeometry(getVehiclePoint(m_bodyMovie.mcA), getVehiclePoint(m_bodyMovie.mcB), getVehiclePoint(m_bodyMovie.mcC), getVehiclePoint(m_bodyMovie.mcD));
m_backWheel = iriysoft.pengine.particle.CWheel(m_vehicleParam.__get__A());
m_forwardWheel = iriysoft.pengine.particle.CWheel(m_vehicleParam.__get__D());
if (mcWBack != undefined) {
m_backWheel.setMovie(mcWBack);
m_backWheel.setRotationMovie(mcWBack.mcSpoke);
}
if (mcWForward != undefined) {
m_forwardWheel.setMovie(mcWForward);
m_forwardWheel.setRotationMovie(mcWForward.mcSpoke);
}
setVehicleParam(getDefaultVehicleParam());
}
static function getDefaultVehicleParam() {
var _local1 = new Object();
_local1.accPercMult = 39.2;
_local1.normalYLimit = 0.4;
_local1.koeffPrimary = 1.3;
_local1.koeffSecondary = 0.7;
_local1.accPercBase = 0.6;
_local1.accelerateForwardWheel = 0;
_local1.accelerateBackWheel = 50;
_local1.brakeForwardWheel = 0;
_local1.brakeBackWheel = 0;
return(_local1);
}
function setVehicleParam(param) {
m_accPercMultForTurn = param.accPercMult;
m_normalYLimitForTurn = param.normalYLimit;
m_koeffPrimaryForTurn = param.koeffPrimary;
m_koeffSecondaryForTurn = param.koeffSecondary;
m_accPercBaseForTurn = param.accPercBase;
m_accelerateForwardWheel = param.accelerateForwardWheel;
m_accelerateBackWheel = param.accelerateBackWheel;
m_brakeForwardWheel = param.brakeForwardWheel;
m_brakeBackWheel = param.brakeBackWheel;
}
function processKey(mask) {
if ((mask & KM_ACCELERATE) != 0) {
accelerate();
} else if ((mask & KM_BRAKE) != 0) {
brake();
} else {
stopAccelerate();
}
if ((mask & KM_MOVE_BODY_FORWARD) != 0) {
turnTo(DIR_RIGHT, m_accPercMultForTurn);
} else if ((mask & KM_MOVE_BODY_BACK) != 0) {
turnTo(DIR_LEFT, m_accPercMultForTurn);
}
}
function process() {
m_vehicleDir.init(m_forwardWheel.__get__pos().x - m_backWheel.__get__pos().x, m_forwardWheel.__get__pos().y - m_backWheel.__get__pos().y);
m_vehicleNormal.init(m_vehicleDir.x, m_vehicleDir.y);
m_vehicleNormal.normalize();
t_buffNumber = m_vehicleNormal.x;
m_vehicleNormal.x = -m_vehicleNormal.y;
m_vehicleNormal.y = t_buffNumber;
m_vehicleAngle = Math.atan2(m_vehicleDir.y, m_vehicleDir.x) * VAL_180_DIV_PI;
m_vehicleMovie._rotation = m_vehicleAngle;
t_point1.x = m_bodyMovie.mcB._x;
t_point1.y = m_bodyMovie.mcB._y;
m_bodyMovie.localToGlobal(t_point1);
m_vehicleMovie._parent.globalToLocal(t_point1);
t_point2.x = m_bodyMovie.mcC._x;
t_point2.y = m_bodyMovie.mcC._y;
m_bodyMovie.localToGlobal(t_point2);
m_vehicleMovie._parent.globalToLocal(t_point2);
m_vehicleMovie._x = m_vehicleMovie._x + ((((m_vehicleParam.__get__B().__get__pos().x - t_point1.x) + m_vehicleParam.__get__C().__get__pos().x) - t_point2.x) / 2);
m_vehicleMovie._y = m_vehicleMovie._y + ((((m_vehicleParam.__get__B().__get__pos().y - t_point1.y) + m_vehicleParam.__get__C().__get__pos().y) - t_point2.y) / 2);
}
function turnTo(dir, turnPower) {
t_turnToPerc = ((Math.abs(m_vehicleNormal.y) * (1 - m_accPercBaseForTurn)) + m_accPercBaseForTurn) * turnPower;
t_turnToDX = m_vehicleNormal.x * t_turnToPerc;
t_turnToDY = m_vehicleNormal.y * t_turnToPerc;
if (m_vehicleNormal.y > (-m_normalYLimitForTurn)) {
if (dir == DIR_RIGHT) {
if (!m_forwardWheel.hasIntersection()) {
m_forwardWheel.__get__accelerate().plusXY(t_turnToDX * m_koeffPrimaryForTurn, t_turnToDY * m_koeffPrimaryForTurn);
}
m_backWheel.__get__accelerate().plusXY((-t_turnToDX) * m_koeffSecondaryForTurn, (-t_turnToDY) * m_koeffSecondaryForTurn);
} else {
m_forwardWheel.__get__accelerate().plusXY((-t_turnToDX) * m_koeffSecondaryForTurn, (-t_turnToDY) * m_koeffSecondaryForTurn);
if (!m_backWheel.hasIntersection()) {
m_backWheel.__get__accelerate().plusXY(t_turnToDX * m_koeffPrimaryForTurn, t_turnToDY * m_koeffPrimaryForTurn);
}
}
}
}
function accelerate() {
m_backWheel.setAccelerate(m_accelerateBackWheel);
m_forwardWheel.setAccelerate(m_accelerateForwardWheel);
}
function brake() {
m_backWheel.setAccelerate(m_brakeBackWheel);
m_forwardWheel.setAccelerate(m_brakeForwardWheel);
}
function stopAccelerate() {
m_backWheel.setAccelerate(0);
m_forwardWheel.setAccelerate(0);
}
function get backWheel() {
return(m_backWheel);
}
function get forwardWheel() {
return(m_forwardWheel);
}
function onGround() {
return(m_backWheel.hasIntersection() || (m_forwardWheel.hasIntersection()));
}
function get vehicleParam() {
return(m_vehicleParam);
}
function set vehicleParam(nParam) {
m_vehicleParam = nParam;
//return(vehicleParam);
}
function get vehicleAngle() {
return(m_vehicleAngle);
}
function get vehicleDir() {
return(m_vehicleDir);
}
static var VAL_180_DIV_PI = 57.2957795130823;
static var DIR_RIGHT = 0;
static var DIR_LEFT = 1;
static var KM_NONE = 0;
static var KM_ACCELERATE = 1;
static var KM_BRAKE = 2;
static var KM_MOVE_BODY_FORWARD = 4;
static var KM_MOVE_BODY_BACK = 8;
}
Symbol 718 MovieClip [__Packages.iriysoft.pengine.particle.CWheel] Frame 0
class iriysoft.pengine.particle.CWheel extends iriysoft.pengine.particle.CParticle
{
var m_rim, m_acceleration, initParticle, m_koeffSpring, m_koeffSlip, m_radius, m_maxAccSpeed, m_speed, m_accSpeed, rot, intersectionFlag, lastIntersPoint, lastN, hitPointArray, normalArray, hitArray, intersArray, n_part, oldPos, _p, _n, p3, m_prevPosition, synchronizeMovie, m_mc, m_curPosition, obj;
function CWheel () {
super();
}
function setRotationMovie(rotationMovie) {
if ((rotationMovie == undefined) || (rotationMovie == null)) {
rotateMovie = function () {
};
m_rim = null;
} else {
rotateMovie = function () {
this.rot.rotate(this.m_speed / this.m_radius);
this.m_rim._rotation = Math.atan2(this.rot.y, this.rot.x) * iriysoft.pengine.particle.CWheel.ANGLE_180_DIV_PI;
};
m_rim = rotationMovie;
}
}
function setAccelerate(nAccelerate) {
m_acceleration = nAccelerate;
}
function getAccelerate() {
return(m_acceleration);
}
function initWheel(x, y, mass, rad, maxAccSpeed, mc, rotationMovie, koeffSpring, koeffSlip) {
_innerInit();
initParticle(x, y, mass, mc);
if (koeffSpring == undefined) {
koeffSpring = 0.1;
}
if (koeffSlip == undefined) {
koeffSlip = 0.1;
}
m_koeffSpring = koeffSpring;
m_koeffSlip = koeffSlip;
setRotationMovie(rotationMovie);
m_radius = rad;
m_maxAccSpeed = maxAccSpeed;
m_speed = 0;
m_accSpeed = 0;
rot = new iriysoft.pengine.math.CVector2D(1, 0);
intersectionFlag = false;
lastIntersPoint = new iriysoft.pengine.math.CVector2D(0, 0);
lastN = new iriysoft.pengine.math.CVector2D(0, 0);
var _local2;
var _local3 = (Math.PI*2) / m_hitCount;
hitPointArray = new Array(m_hitCount);
normalArray = new Array(m_hitCount);
hitArray = new Array(m_hitCount);
intersArray = new Array();
_local2 = 0;
while (_local2 < m_hitCount) {
hitPointArray[_local2] = new iriysoft.pengine.math.CVector2D(Math.sin(_local3 * _local2) * m_radius, (-Math.cos(_local3 * _local2)) * m_radius);
normalArray[_local2] = hitPointArray[_local2].multNew(-1);
normalArray[_local2].normalize();
_local2++;
}
m_acceleration = 0;
return(this);
}
function verlet(dTime, koeffDamp) {
super.verlet(dTime, koeffDamp);
m_accSpeed = Math.max(-m_maxAccSpeed, Math.min(m_maxAccSpeed, m_accSpeed + (m_acceleration * dTime)));
m_speed = Math.max((-m_maxSpeed) * dTime, Math.min((m_speed * koeffDamp) + m_accSpeed, m_maxSpeed * dTime));
rotateMovie();
}
function rotateMovie() {
}
function _innerInit() {
n_part = new iriysoft.pengine.math.CVector2D(0, 0);
oldPos = new iriysoft.pengine.math.CVector2D(0, 0);
_p = new iriysoft.pengine.math.CVector2D(0, 0);
_n = new iriysoft.pengine.math.CVector2D(0, 0);
p3 = new iriysoft.pengine.math.CVector2D(0, 0);
}
function checkCollision(hit_mc) {
var _local2;
var _local5;
_p.init(0, 0);
var _local9 = false;
var _local3;
var _local4;
var _local11;
oldPos.init(m_prevPosition.x, m_prevPosition.y);
_n.init(0, 0);
n_part.init(0, 0);
var _local10;
synchronizeMovie();
_local10 = 0;
_local2 = 0;
while (_local2 < m_hitCount) {
hitPointArray[_local2].copyTo(_p);
m_mc.localToGlobal(_p);
if ((hitArray[_local2] = hit_mc.hitTest(_p.x, _p.y, true))) {
_local9 = true;
_local3 = _local2;
_local10++;
}
_local2++;
}
if (_local10 == m_hitCount) {
m_curPosition.x = m_prevPosition.x + ((m_curPosition.x - m_prevPosition.x) * 0.3);
m_curPosition.y = m_prevPosition.y + ((m_curPosition.y - m_prevPosition.y) * 0.3);
synchronizeMovie();
return(undefined);
}
_local2 = 0;
if (_local9) {
while (true) {
_local2++;
if (_local2 == m_hitCount) {
_local2 = 0;
}
if (!hitArray[_local2]) {
_local3 = -1;
_local5 = 0;
while (_local5 < m_hitCount) {
_local2++;
if (_local2 == m_hitCount) {
_local2 = 0;
}
if (_local3 == -1) {
if (hitArray[_local2]) {
_local3 = _local2;
_n.plus(normalArray[_local2]);
normalArray[_local2].copyTo(n_part);
}
} else if (!hitArray[_local2]) {
_local4 = _local2 - 1;
if (_local4 < 0) {
_local4 = m_hitCount - 1;
}
intersArray.push({k1:_local3, k2:_local4, n:new iriysoft.pengine.math.CVector2D(n_part.x, n_part.y)});
_local3 = -1;
} else {
_n.plus(normalArray[_local2]);
n_part.plus(normalArray[_local2]);
}
_local5++;
}
break;
}
}
p3.init(0, 0);
if (intersArray.length > 0) {
_n.normalize();
if (intersectionFlag) {
_n.x = _n.x + lastN.x;
_n.y = _n.y + lastN.y;
_n.x = _n.x / 2;
_n.y = _n.y / 2;
}
var _local7;
_local11 = intersArray.length;
_local2 = 0;
while (_local2 < _local11) {
obj = intersArray.pop();
_local3 = obj.k1;
_local4 = obj.k2;
obj.n.copyTo(n_part);
m_curPosition.minusNew(m_prevPosition).copyTo(p3);
if (_n.scalar(p3) < 0) {
_local7 = Math.atan2(_n.y, _n.x);
p3.rotate(-_local7);
p3.x = (-p3.x) * m_koeffSpring;
p3.rotate(_local7);
pushOut(_local3, _local4, n_part, hit_mc);
m_prevPosition.x = m_curPosition.x - p3.x;
m_prevPosition.y = m_curPosition.y - p3.y;
} else {
pushOut(_local3, _local4, n_part, hit_mc);
}
_local2++;
}
validateRotation(_n, oldPos);
intersectionFlag = true;
m_curPosition.copyTo(lastIntersPoint);
_n.copyTo(lastN);
}
} else if (intersectionFlag) {
validateRotation(lastN, oldPos);
intersectionFlag = false;
}
synchronizeMovie();
}
function pushOut(k1, k2, n, hit_mc) {
n.normalize();
if (k1 != k2) {
var _local7 = (new iriysoft.pengine.math.CVector2D(0, 0)).getDistanceTo(hitPointArray[k1], hitPointArray[k2]);
_local7 = m_radius - Math.abs(_local7);
m_curPosition.plus(n.multNew(_local7));
m_prevPosition.plus(n.multNew(_local7));
} else {
var _local6 = n.multNew(-m_radius);
var _local4 = new iriysoft.pengine.math.CVector2D(0, 0);
var _local5 = 0;
var _local3 = 0.03;
while (true) {
_local6.copyTo(_local4);
m_mc.localToGlobal(_local4);
if (hit_mc.hitTest(_local4.x, _local4.y, true)) {
_local5++;
m_curPosition.x = m_curPosition.x + (n.x * _local3);
m_curPosition.y = m_curPosition.y + (n.y * _local3);
synchronizeMovie();
} else {
_local5--;
m_curPosition.x = m_curPosition.x - (n.x * _local3);
m_curPosition.y = m_curPosition.y - (n.y * _local3);
m_prevPosition.plus(n.multNew(_local3 * _local5));
break;
}
}
}
}
function validateRotation(n, oldPos) {
if ((!intersectionFlag) && (Math.abs(m_accSpeed) > 0.01)) {
if (Math.abs(m_accSpeed) < ((m_maxAccSpeed * 0.02) / 2)) {
m_accSpeed = 0;
} else if (m_accSpeed > 0) {
m_accSpeed = m_maxAccSpeed * 0.02;
} else {
m_accSpeed = (-m_maxAccSpeed) * 0.02;
}
}
var _local3 = new iriysoft.pengine.math.CVector2D(-n.y, n.x);
var _local6 = m_curPosition.minusNew(oldPos);
var _local5 = Math.atan2(_local3.y, _local3.x);
var _local2 = _local6.rotateNew(-_local5);
m_speed = _local2.x + m_accSpeed;
_local2.y = 0;
_local2.rotate(_local5);
var _local4 = 1 - m_koeffSlip;
m_curPosition.x = (m_curPosition.x + ((_local3.x * m_accSpeed) * _local4)) - (m_koeffFriction * _local2.x);
m_curPosition.y = (m_curPosition.y + ((_local3.y * m_accSpeed) * _local4)) - (m_koeffFriction * _local2.y);
m_accSpeed = m_accSpeed * m_koeffSlip;
}
function hasIntersection() {
return(intersectionFlag);
}
static var m_maxSpeed = 180;
static var m_hitCount = 16;
static var m_koeffFriction = 0.03;
static var ANGLE_180_DIV_PI = 57.2957795130823;
}
Symbol 719 MovieClip [__Packages.iriysoft.pengine.constraint.CBoxConstrainSkeleton] Frame 0
class iriysoft.pengine.constraint.CBoxConstrainSkeleton
{
var m_A, m_B, m_C, m_D, m_AB, m_AC, m_AD, m_BC, m_BD, m_CD, m_ABC, m_DCB;
function CBoxConstrainSkeleton () {
}
function init(a, b, c, d, ab, ac, ad, bc, bd, cd) {
m_A = a;
m_B = b;
m_C = c;
m_D = d;
m_AB = ab;
m_AB.__set__p1(a);
m_AB.__set__p2(b);
m_AC = ac;
m_AC.__set__p1(a);
m_AC.__set__p2(c);
m_AD = ad;
m_AD.__set__p1(a);
m_AD.__set__p2(d);
m_BC = bc;
m_BC.__set__p1(b);
m_BC.__set__p2(c);
m_BD = bd;
m_BD.__set__p1(b);
m_BD.__set__p2(d);
m_CD = cd;
m_CD.__set__p1(c);
m_CD.__set__p2(d);
m_ABC = new iriysoft.pengine.constraint.CPenetrationConstraint(m_D, m_C, m_B);
m_DCB = new iriysoft.pengine.constraint.CPenetrationConstraint(m_A, m_B, m_C);
return(this);
}
function changeGeometry(pA, pB, pC, pD) {
m_A.moveTo(pA.x, pA.y);
m_B.moveTo(pB.x, pB.y);
m_C.moveTo(pC.x, pC.y);
m_D.moveTo(pD.x, pD.y);
m_AB.fixDistance();
m_AC.fixDistance();
m_AD.fixDistance();
m_BC.fixDistance();
m_BD.fixDistance();
m_CD.fixDistance();
m_ABC.fixDistance();
m_DCB.fixDistance();
}
function addToEngine(engine) {
engine.addParticle(m_A);
engine.addParticle(m_B);
engine.addParticle(m_C);
engine.addParticle(m_D);
engine.addConstraint(m_AB);
engine.addConstraint(m_AC);
engine.addConstraint(m_AD);
engine.addConstraint(m_BC);
engine.addConstraint(m_BD);
engine.addConstraint(m_CD);
engine.addConstraint(m_ABC);
engine.addConstraint(m_DCB);
}
function get A() {
return(m_A);
}
function get B() {
return(m_B);
}
function get C() {
return(m_C);
}
function get D() {
return(m_D);
}
function get AB() {
return(m_AB);
}
function get AC() {
return(m_AC);
}
function get AD() {
return(m_AD);
}
function get BC() {
return(m_BC);
}
function get BD() {
return(m_BD);
}
function get CD() {
return(m_CD);
}
}
Symbol 720 MovieClip [__Packages.iriysoft.pengine.constraint.CSpringConstraint] Frame 0
class iriysoft.pengine.constraint.CSpringConstraint implements iriysoft.pengine.constraint.IConstraint
{
var m_p1, m_p2, m_koeffStiffPress, m_koeffStiffStretch, m_relaxLen;
function CSpringConstraint () {
}
function init(koeffStiffPress, koeffStiffStretch, p1, p2) {
m_p1 = p1;
m_p2 = p2;
m_koeffStiffPress = koeffStiffPress;
m_koeffStiffStretch = koeffStiffStretch;
fixDistance();
return(this);
}
function fixDistance() {
m_relaxLen = iriysoft.pengine.math.CVector2D.getDistanceBetween(m_p1.__get__pos(), m_p2.__get__pos());
}
function resolve() {
var _local3 = m_p1.__get__pos().x - m_p2.__get__pos().x;
var _local2 = m_p1.__get__pos().y - m_p2.__get__pos().y;
var _local5 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
var _local9 = (_local5 - m_relaxLen) / _local5;
var _local8;
if (_local5 > m_relaxLen) {
_local8 = m_koeffStiffStretch;
} else {
_local8 = m_koeffStiffPress;
}
var _local7 = m_p1.__get__mass();
var _local6 = m_p2.__get__mass();
var _local4 = (_local9 * _local8) / (_local7 + _local6);
m_p1.__get__pos().x = m_p1.__get__pos().x - ((_local3 * _local7) * _local4);
m_p1.__get__pos().y = m_p1.__get__pos().y - ((_local2 * _local7) * _local4);
m_p2.__get__pos().x = m_p2.__get__pos().x + ((_local3 * _local6) * _local4);
m_p2.__get__pos().y = m_p2.__get__pos().y + ((_local2 * _local6) * _local4);
}
function set p1(nP1) {
m_p1 = nP1;
//return(p1);
}
function get p1() {
return(m_p1);
}
function set p2(nP2) {
m_p2 = nP2;
//return(p2);
}
function get p2() {
return(m_p2);
}
}
Symbol 721 MovieClip [__Packages.iriysoft.pengine.constraint.CPenetrationConstraint] Frame 0
class iriysoft.pengine.constraint.CPenetrationConstraint implements iriysoft.pengine.constraint.IConstraint
{
var p0, p1, p2, sign, n;
function CPenetrationConstraint (np0, np1, np2) {
p0 = np0;
p1 = np1;
p2 = np2;
fixDistance();
}
function fixDistance() {
sign = p0.__get__pos().getDistanceTo(p1.__get__pos(), p2.__get__pos());
if (sign < 0) {
sign = -1;
} else {
sign = 1;
}
n = new iriysoft.pengine.math.CVector2D();
}
function resolve() {
var _local2 = p0.__get__pos().getDistanceTo(p1.__get__pos(), p2.__get__pos());
if ((sign * _local2) <= 2) {
n.init(p2.__get__pos().x, p2.__get__pos().y);
n.minus(p1.__get__pos());
n.normalize();
n.rotate(PI2 * sign);
n.mult(Math.abs(_local2) + 1);
p1.__get__pos().minus(n);
}
}
static var PI2 = (Math.PI/2);
}
Symbol 722 MovieClip [__Packages.CCar] Frame 0
class CCar extends iriysoft.pengine.CVehicle
{
static var c_instance;
var bornTime, inProcess, mode, inTrickCompletes, inTrick, tricks, inAirCounter, combo, trickSumCount, endAnimFrame, animLength, canDie, tricksDone, gameOverInTest, flipTime, mvWBack, mvWForward, mainMovie, bar, construct, setVehicleParam, key1Trigger, key2Trigger, m_vehicleMovie, m_accelerateForwardWheel, m_accelerateBackWheel, m_brakeForwardWheel, m_brakeBackWheel, processKey, onGround, m_point90, m_point270, m_prevCarAngle, m_carAngle, m_vehicleAngle, dispatchEvent;
function CCar () {
super();
bornTime = getTimer();
c_instance = this;
inProcess = true;
mode = true;
inTrickCompletes = (inTrick = false);
tricks = new Array();
inAirCounter = 0;
combo = 0;
trickSumCount = 0;
endAnimFrame = 0;
animLength = 0;
canDie = false;
trickSumCount = 0;
tricksDone = new Array();
gameOverInTest = false;
trace("start");
}
function initTricks() {
tricks.push({kk:51, label:"trick1", labelOut:"", labelText:"trick1Done", endFrame:20, score:25});
tricks.push({kk:49, label:"trick2", labelOut:"", labelText:"trick2Done", endFrame:39, score:20});
tricks.push({kk:53, label:"trick3", labelOut:"", labelText:"trick3Done", endFrame:63, score:30});
tricks.push({kk:56, label:"trick4", labelOut:"", labelText:"trick4Done", endFrame:97, score:40});
tricks.push({kk:55, label:"trick5", labelOut:"", labelText:"trick5Done", endFrame:120, score:35});
tricks.push({kk:50, label:"trick6", labelOut:"", labelText:"trick6Done", endFrame:136, score:20});
tricks.push({kk:52, label:"trick7", labelOut:"", labelText:"trick7Done", endFrame:160, score:25});
tricks.push({kk:54, label:"trick8", labelOut:"", labelText:"trick8Done", endFrame:186, score:30});
}
function init(carPlace, engine, mmovie) {
flipTime = getTimer();
if (carPlace.xx == undefined) {
carPlace.xx = carPlace._x;
}
if (carPlace.yy == undefined) {
carPlace.yy = carPlace._y;
}
carPlace._x = (carPlace._y = 0);
var _local4 = carPlace.attachMovie("dmCarBody", "_dmCarBody", 1010);
mvWBack = carPlace.attachMovie("dmWheel", "_dmWheel1", 1020);
mvWForward = carPlace.attachMovie("dmWheel", "_dmWheel2", 1030);
mainMovie = mmovie;
bar = mainMovie.attachMovie("trickBar", "barMC", 1040);
bar._alpha = 0;
_local4._x = carPlace.xx;
_local4._y = carPlace.yy;
if (CRace.__get__instance().savedPoint != undefined) {
trace("\u0441\u0442\u0430\u0440\u0442 \u0441 \u0441\u0435\u0439\u0432 \u043F\u043E\u0438\u043D\u0442\u0430");
_local4._x = CRace.__get__instance().savedPoint._x;
_local4._y = CRace.__get__instance().savedPoint._y;
}
var _local5 = (new iriysoft.pengine.constraint.CBoxConstrainSkeleton()).init((new iriysoft.pengine.particle.CWheel()).initWheel(0, 0, 6, 12, 80), (new iriysoft.pengine.particle.CParticle()).initParticle(0, 0, 3), (new iriysoft.pengine.particle.CParticle()).initParticle(0, 0, 3), (new iriysoft.pengine.particle.CWheel()).initWheel(0, 0, 6, 12, 80), (new iriysoft.pengine.constraint.CSpringConstraint()).init(0.8, 0.8), (new iriysoft.pengine.constraint.CSpringConstraint()).init(0.9, 0.9), (new iriysoft.pengine.constraint.CSpringConstraint()).init(1, 1), (new iriysoft.pengine.constraint.CSpringConstraint()).init(1, 1), (new iriysoft.pengine.constraint.CSpringConstraint()).init(0.9, 0.9), (new iriysoft.pengine.constraint.CSpringConstraint()).init(0.8, 0.8));
construct(_local5, _local4, _local4, mvWBack, mvWForward);
engine.__set__gravity(4.5);
var _local3 = iriysoft.pengine.CVehicle.getDefaultVehicleParam();
_local3.accelerateForwardWheel = 16;
_local3.accelerateBackWheel = 30;
_local3.brakeForwardWheel = -16;
_local3.brakeBackWheel = -30;
_local3.accPercMult = engine.__get__gravity() * 6;
_local3.normalYLimit = 1;
setVehicleParam(_local3);
_local5.addToEngine(engine);
resetFlipPoint();
mx.events.EventDispatcher.initialize(this);
image.cbs.gotoAndStop(CRace.__get__instance().carType);
}
function process() {
var _local5 = 0;
if (inProcess) {
if ((Key.isDown(13) && (Key.isToggled(13) != key1Trigger)) || (Key.isDown(32) && (Key.isToggled(32) != key2Trigger))) {
if ((getTimer() - flipTime) > flipTimeout) {
flipTime = getTimer();
m_vehicleMovie._xscale = m_vehicleMovie._xscale * -1;
mode = !mode;
key1Trigger = Key.isToggled(13);
key2Trigger = Key.isToggled(32);
var _local9 = m_accelerateForwardWheel;
var _local8 = m_accelerateBackWheel;
var _local7 = m_brakeForwardWheel;
var _local6 = m_brakeBackWheel;
m_accelerateForwardWheel = -_local8;
m_accelerateBackWheel = -_local9;
m_brakeForwardWheel = -_local6;
m_brakeBackWheel = -_local7;
}
}
var _local3 = 0;
if (Key.isDown(37)) {
_local5 = _local5 | iriysoft.pengine.CVehicle.KM_MOVE_BODY_BACK;
_local3 = -1;
} else if (Key.isDown(39)) {
_local5 = _local5 | iriysoft.pengine.CVehicle.KM_MOVE_BODY_FORWARD;
_local3 = 1;
}
if (mode) {
_local3 = _local3 * -1;
}
if (_local3 == 0) {
if (image.carBody._currentframe > 4) {
_local3 = -1;
}
if (image.carBody._currentframe < 4) {
_local3 = 1;
}
}
if (_local3 != 0) {
var _local4 = (image.carBody._currentframe = image.carBody._currentframe + _local3);
if (_local4 < 1) {
_local4 = 1;
}
if (_local4 > (image.carBody._totalframes - 1)) {
_local4 = image.carBody._totalframes - 1;
}
image.carBody.gotoAndStop(_local4);
}
if (Key.isDown(38) && (!CRace.__get__instance().inPostGame)) {
if (!CRace.__get__instance().inDieMode) {
_local5 = _local5 | iriysoft.pengine.CVehicle.KM_ACCELERATE;
}
} else if (Key.isDown(40) && (!CRace.__get__instance().inPostGame)) {
if (!CRace.__get__instance().inDieMode) {
_local5 = _local5 | iriysoft.pengine.CVehicle.KM_BRAKE;
}
}
}
super.process();
processKey(_local5);
processFlipPoint();
}
static function makeTrickDone() {
if (!CRace.__get__instance().inPostGame) {
var _local1 = instance;
_local1.inTrickCompletes = true;
_local1.combo++;
var _local2 = _local1.combo;
if (_local2 > 5) {
_local2 = 5;
}
_local1.trickSumCount = _local1.trickSumCount + _local1.tricks[_local1.trickNum].score;
if (_local2 > 1) {
_local1.mainMovie.cmsg.gotoAndPlay(2);
_local1.mainMovie.cmsg.msg.gotoAndStop("x" + _local2);
CRace.__get__instance()._parent.soundMC.gotoAndPlay("c" + _local2);
}
_local1.mainMovie.msg.gotoAndPlay(2);
_local1.mainMovie.msg.msg.gotoAndStop(_local1.tricks[_local1.trickNum].labelText);
}
}
static function makeTrickAnimComplete(oneAnimTrick) {
if (!CRace.__get__instance().inPostGame) {
var _local1 = instance;
if (oneAnimTrick) {
_local1.mainMovie.msg.gotoAndPlay(2);
_local1.mainMovie.msg.msg.gotoAndStop(_local1.tricks[_local1.trickNum].labelText);
_local1.combo++;
var _local2 = _local1.combo;
if (_local2 > 5) {
_local2 = 5;
}
_local1.trickSumCount = _local1.trickSumCount + _local1.tricks[_local1.trickNum].score;
if (_local2 > 1) {
_local1.mainMovie.cmsg.gotoAndPlay(2);
_local1.mainMovie.cmsg.msg.gotoAndStop("x" + _local2);
CRace.__get__instance()._parent.soundMC.gotoAndPlay("c" + _local2);
}
}
_local1.mvWBack._visible = (_local1.mvWForward._visible = true);
_local1.inTrickCompletes = (_local1.inTrick = false);
}
}
function checkDie() {
return((onGround() && (inTrick)) && (canDie));
}
function resetFlipPoint() {
m_point90 = (m_point270 = 0);
m_prevCarAngle = (m_carAngle = 0);
}
function processFlipPoint() {
m_prevCarAngle = m_carAngle;
m_carAngle = m_vehicleAngle;
if (onGround()) {
resetFlipPoint();
return(undefined);
}
if ((m_carAngle * m_prevCarAngle) < 0) {
return(undefined);
}
if ((m_carAngle > TRICK_ANGLE) && (m_prevCarAngle < TRICK_ANGLE)) {
m_point90++;
} else if ((m_carAngle < TRICK_ANGLE) && (m_prevCarAngle > TRICK_ANGLE)) {
m_point90--;
} else if ((m_carAngle > (-TRICK_ANGLE)) && (m_prevCarAngle < (-TRICK_ANGLE))) {
m_point270++;
} else if ((m_carAngle < (-TRICK_ANGLE)) && (m_prevCarAngle > (-TRICK_ANGLE))) {
m_point270--;
}
if ((m_point90 > 0) && (m_point270 > 0)) {
makeTrick(TRICK_FRONT_FLIP);
resetFlipPoint();
} else if ((m_point90 < 0) && (m_point270 < 0)) {
makeTrick(TRICK_BACK_FLIP);
resetFlipPoint();
}
}
function makeTrick(tirckID) {
dispatchEvent({type:EVENT_TRICK, target:this, trickID:tirckID});
}
function getMC() {
return(m_vehicleMovie);
}
function getHitForBonus() {
return(m_vehicleMovie.mcHit);
}
function checkDeathPoints(hitMov) {
var _local2 = new Object();
for (var _local4 in m_vehicleMovie.mcDeathPoints) {
_local2.x = m_vehicleMovie.mcDeathPoints[_local4]._x;
_local2.y = m_vehicleMovie.mcDeathPoints[_local4]._y;
m_vehicleMovie.mcDeathPoints.localToGlobal(_local2);
if (hitMov.hitTest(_local2.x, _local2.y, true)) {
return(true);
}
}
return(false);
}
function get image() {
return(m_vehicleMovie);
}
static function get instance() {
return(c_instance);
}
var bodyAnimDir = 0;
static var flipTimeout = 300;
static var TRICK_ANGLE = 130;
static var EVENT_TRICK = "trick";
static var TRICK_FRONT_FLIP = 0;
static var TRICK_BACK_FLIP = 1;
}
Symbol 723 MovieClip [__Packages.mx.events.EventDispatcher] Frame 0
class mx.events.EventDispatcher
{
function EventDispatcher () {
}
static function _removeEventListener(queue, event, handler) {
if (queue != undefined) {
var _local4 = queue.length;
var _local1;
_local1 = 0;
while (_local1 < _local4) {
var _local2 = queue[_local1];
if (_local2 == handler) {
queue.splice(_local1, 1);
return(undefined);
}
_local1++;
}
}
}
static function initialize(object) {
if (_fEventDispatcher == undefined) {
_fEventDispatcher = new mx.events.EventDispatcher();
}
object.addEventListener = _fEventDispatcher.addEventListener;
object.removeEventListener = _fEventDispatcher.removeEventListener;
object.dispatchEvent = _fEventDispatcher.dispatchEvent;
object.dispatchQueue = _fEventDispatcher.dispatchQueue;
}
function dispatchQueue(queueObj, eventObj) {
var _local7 = "__q_" + eventObj.type;
var _local4 = queueObj[_local7];
if (_local4 != undefined) {
var _local5;
for (_local5 in _local4) {
var _local1 = _local4[_local5];
var _local3 = typeof(_local1);
if ((_local3 == "object") || (_local3 == "movieclip")) {
if (_local1.handleEvent != undefined) {
_local1.handleEvent(eventObj);
}
if (_local1[eventObj.type] != undefined) {
if (exceptions[eventObj.type] == undefined) {
_local1[eventObj.type](eventObj);
}
}
} else {
_local1.apply(queueObj, [eventObj]);
}
}
}
}
function dispatchEvent(eventObj) {
if (eventObj.target == undefined) {
eventObj.target = this;
}
this[eventObj.type + "Handler"](eventObj);
dispatchQueue(this, eventObj);
}
function addEventListener(event, handler) {
var _local3 = "__q_" + event;
if (this[_local3] == undefined) {
this[_local3] = new Array();
}
_global.ASSetPropFlags(this, _local3, 1);
_removeEventListener(this[_local3], event, handler);
this[_local3].push(handler);
}
function removeEventListener(event, handler) {
var _local2 = "__q_" + event;
_removeEventListener(this[_local2], event, handler);
}
static var _fEventDispatcher = undefined;
static var exceptions = {move:1, draw:1, load:1};
}
Symbol 724 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 725 MovieClip [__Packages.iriysoft.CInvisibleMovie] Frame 0
class iriysoft.CInvisibleMovie extends MovieClip
{
var _visible;
function CInvisibleMovie () {
super();
_visible = false;
}
}
Symbol 2 Button
on (press) {
openSite();
}
Symbol 26 Button
on (release) {
CGame.butBackToSplash();
this.removeMovieClip();
}
Symbol 31 Button
on (release) {
CGame.butSwitchPause();
}
Symbol 38 Button
on (release) {
openSite();
}
Symbol 45 MovieClip [dmSaved] Frame 36
this.removeMovieClip();
Symbol 47 MovieClip [mcHit] Frame 1
#initclip 17
Object.registerClass("mcHit", iriysoft.CInvisibleMovie);
#endinitclip
Symbol 99 MovieClip Frame 24
stop();
Symbol 101 MovieClip Frame 6
stop();
Symbol 102 MovieClip Frame 1
stop();
Symbol 103 MovieClip Frame 1
stop();
Symbol 104 MovieClip Frame 1
stop();
Symbol 106 MovieClip [mcHidePoint] Frame 1
#initclip 16
Object.registerClass("mcHidePoint", iriysoft.CInvisibleMovie);
#endinitclip
Symbol 108 MovieClip [dmCarBody] Frame 1
this.stop();
Symbol 117 MovieClip [dieMF] Frame 33
_parent.newRace();
this.removeMovieClip();
Symbol 271 MovieClip Frame 1
if (this._parent._parent._name != "map") {
_global.savePointz.push(this);
}
mcHit._visible = false;
Symbol 325 MovieClip [mcBonusHit] Frame 1
#initclip 18
Object.registerClass("mcBonusHit", iriysoft.CInvisibleMovie);
#endinitclip
Symbol 329 MovieClip Frame 12
stop();
Symbol 331 MovieClip Frame 1
type = 3;
subtype = 3;
stop();
Symbol 331 MovieClip Frame 11
stop();
Symbol 337 MovieClip Frame 1
type = 3;
subtype = 3;
stop();
Symbol 337 MovieClip Frame 11
stop();
Symbol 339 MovieClip Frame 1
type = 3;
subtype = 3;
stop();
Symbol 339 MovieClip Frame 11
stop();
Symbol 588 MovieClip Frame 1025
gotoAndPlay (1);
Symbol 591 MovieClip Frame 485
gotoAndPlay (1);
Symbol 633 Button
on (release, keyPress "<Enter>") {
CGame.butAbout();
}
Symbol 638 Button
on (release) {
CGame.butAbout();
}
Symbol 641 Button
on (press) {
this.gotoAndStop(2);
}
Symbol 643 Button
on (press) {
this.gotoAndStop(1);
}
Symbol 644 MovieClip Frame 1
this.stop();
this._parent.soundStarter.gotoAndPlay("start");
_global.soundEnable = true;
Symbol 644 MovieClip Frame 2
this.stop();
this._parent.soundStarter.gotoAndPlay("stop");
_global.soundEnable = false;
Symbol 648 MovieClip Frame 1
_visible = false;
stop();
Symbol 648 MovieClip Frame 7
gotoAndStop (1);
Symbol 648 MovieClip Frame 12
gotoAndStop (1);
Symbol 656 Button
on (release) {
CGame.butBackToSplash();
}
Symbol 657 Button
on (release, keyPress "<Enter>") {
CGame.butStart();
}
Symbol 660 MovieClip [dmRace] Frame 1
#initclip 20
Object.registerClass("dmRace", CRace);
#endinitclip
Symbol 682 MovieClip Frame 1
stop();
_visible = false;
_global.callSound = function (s) {
var _local1 = s + (Math.floor(Math.random() * ((s == "m") ? 2 : 3)) + 1);
gotoAndPlay(_local1);
};
Symbol 682 MovieClip Frame 7
gotoAndStop (1);
Symbol 682 MovieClip Frame 12
gotoAndStop (1);
Symbol 682 MovieClip Frame 17
gotoAndStop (1);
Symbol 682 MovieClip Frame 22
gotoAndStop (1);
Symbol 682 MovieClip Frame 27
gotoAndStop (1);
Symbol 682 MovieClip Frame 32
gotoAndStop (1);
Symbol 682 MovieClip Frame 37
gotoAndStop (1);
Symbol 682 MovieClip Frame 42
gotoAndStop (1);
Symbol 682 MovieClip Frame 47
gotoAndStop (1);
Symbol 688 Button
on (release) {
CGame.butBackToSplash();
}
Symbol 689 Button
on (release, keyPress "<Enter>") {
CGame.butStartNext();
}
Symbol 705 Button
on (release) {
CGame.butBackToSplash();
}
Symbol 710 MovieClip [dmGame] Frame 1
#initclip 19
Object.registerClass("dmGame", CGame);
#endinitclip
stop();
Instance of Symbol 644 MovieClip "btn_sound" in Symbol 710 MovieClip [dmGame] Frame 1
onClipEvent (load) {
if (_global.soundEnable == undefined) {
_global.soundEnable = true;
}
if (!_global.soundEnable) {
gotoAndStop (2);
}
}
Instance of Symbol 684 MovieClip in Symbol 710 MovieClip [dmGame] Frame 31
onClipEvent (load) {
key1 = Key.isToggled(19);
key2 = Key.isToggled(80);
key3 = Key.isToggled(27);
this._visible = false;
}
onClipEvent (keyDown) {
if (((Key.isDown(19) && (key1 != Key.isToggled(19))) || (Key.isDown(80) && (key2 != Key.isToggled(80)))) || (Key.isDown(27) && (key3 != Key.isToggled(27)))) {
CGame.butSwitchPause();
}
key1 = Key.isToggled(19);
key2 = Key.isToggled(80);
key3 = Key.isToggled(27);
}
Instance of Symbol 644 MovieClip "btn_sound" in Symbol 710 MovieClip [dmGame] Frame 31
onClipEvent (load) {
if (_global.soundEnable == undefined) {
_global.soundEnable = true;
}
if (!_global.soundEnable) {
gotoAndStop (2);
}
}