Frame 1
stop();
Instance of Symbol 133 MovieClip in Frame 1
on (press) {
getURL ("http://ArcadeLots.com", "_blank");
}
Instance of Symbol 140 MovieClip in Frame 1
onClipEvent (load) {
var numPercentage = 0;
var numMaxWidth = this.mcStripe._width;
}
onClipEvent (enterFrame) {
if ((_parent.getBytesLoaded() > 1) && (_parent.getBytesTotal() > 1)) {
numPercentage = Math.floor((100 * _parent.getBytesLoaded()) / _parent.getBytesTotal());
this.mcStripe._width = (numPercentage * numMaxWidth) / 100;
this.txtPercentage = String(numPercentage) + "%";
if (numPercentage >= 100) {
_parent.gotoAndStop("lbStart");
}
}
}
Symbol 1 MovieClip [dmSoundService] Frame 1
#initclip 30
Object.registerClass("dmSoundService", CSoundService);
#endinitclip
Symbol 3 MovieClip [levelHit8] Frame 1
#initclip 24
Object.registerClass("levelHit8", CInvisibleMovie);
#endinitclip
Symbol 5 MovieClip [levelHit6] Frame 1
#initclip 25
Object.registerClass("levelHit6", CInvisibleMovie);
#endinitclip
Symbol 65 MovieClip Frame 22
stop();
Symbol 66 MovieClip [bikePlace] Frame 13
stop();
Symbol 66 MovieClip [bikePlace] Frame 61
stop();
Symbol 69 MovieClip [hitBonus] Frame 1
#initclip 26
Object.registerClass("hitBonus", CInvisibleMovie);
#endinitclip
Symbol 92 MovieClip [finishWall] Frame 1
#initclip 27
Object.registerClass("finishWall", CInvisibleMovie);
#endinitclip
Symbol 105 MovieClip [levelHit5] Frame 1
#initclip 28
Object.registerClass("levelHit5", CInvisibleMovie);
#endinitclip
Symbol 112 MovieClip [levelHit3] Frame 1
#initclip 29
Object.registerClass("levelHit3", CInvisibleMovie);
#endinitclip
Symbol 125 MovieClip [deadBlink] Frame 87
stop();
Symbol 377 MovieClip [__Packages.CInvisibleMovie] Frame 0
class CInvisibleMovie extends MovieClip
{
var _visible;
function CInvisibleMovie () {
super();
_visible = false;
}
}
Symbol 378 MovieClip [__Packages.CSoundService] Frame 0
class CSoundService extends MovieClip
{
var m_sounds, m_soundsState, m_soundsNames, createEmptyMovieClip, onEnterFrame;
function CSoundService () {
super();
}
function realPlaySound(id, repeatCount) {
if (m_soundOff) {
return(undefined);
}
Sound(m_sounds[id]).start(0, repeatCount);
}
function processSounds() {
var _local2 = 0;
while (_local2 < m_sounds.length) {
if (m_soundsState[_local2] > 0) {
realPlaySound(_local2, m_soundsState[_local2]);
m_soundsState[_local2] = ST_PLAY;
break;
}
_local2++;
}
}
function init(soundNames) {
m_soundsNames = soundNames;
m_sounds = new Array(soundNames.length);
m_soundsState = new Array(soundNames.length);
var _local2 = 0;
while (_local2 < soundNames.length) {
var _local4 = createEmptyMovieClip("_contMovie" + _local2, 1000 + _local2);
var _local3 = new Sound(_local4);
_local3.attachSound(soundNames[_local2]);
m_soundsState[_local2] = ST_STOP;
_local3.sounID = _local2;
_local3.parent = m_instance;
_local3.onSoundComplete = function () {
this.parent.m_soundsState[this.sounID] = this.ST_STOP;
};
m_sounds[_local2] = _local3;
_local2++;
}
onEnterFrame = processSounds;
}
static function createSoundService(soundNames, soundsPlace, depthInSoundsPlace) {
m_instance = CSoundService(soundsPlace.attachMovie("dmSoundService", "__SoundServiceObject", depthInSoundsPlace));
m_instance.init(soundNames);
return(m_instance);
}
static function playLoopSound(soundID) {
if ((m_instance.m_loopSoundID >= 0) && (m_instance.m_loopSoundID != soundID)) {
stopSound(m_instance.m_loopSoundID);
}
m_instance.m_loopSoundID = soundID;
if (!soundIsPlay(m_instance.m_loopSoundID)) {
playCurLoopSound();
}
}
static function playCurLoopSound() {
playSound(m_instance.m_loopSoundID, true, 9999);
}
static function stopCurLoopSound() {
stopSound(m_instance.m_loopSoundID);
m_instance.m_loopSoundID = -1;
}
static function soundOff() {
var _local1 = 0;
while (_local1 < m_instance.m_sounds.length) {
stopSound(_local1);
_local1++;
}
m_instance.m_soundOff = true;
}
static function soundOn() {
m_instance.m_soundOff = false;
if (m_instance.m_loopSoundID >= 0) {
playCurLoopSound();
}
}
static function soundIsPlay(id) {
return(m_instance.m_soundsState[id] != ST_STOP);
}
static function playSound(id, ifSoundStop, repeatCount) {
if (repeatCount == undefined) {
repeatCount = 1;
}
if (ifSoundStop == undefined) {
ifSoundStop = false;
}
if (m_instance.m_soundOff) {
return(undefined);
}
if (ifSoundStop && (soundIsPlay(id))) {
return(undefined);
}
m_instance.m_soundsState[id] = repeatCount;
}
static function stopSound(id) {
Sound(m_instance.m_sounds[id]).stop(m_instance.m_soundsNames[id]);
m_instance.m_soundsState[id] = ST_STOP;
}
static function getSoundAt(soundNum) {
return(m_instance.m_sounds[soundNum]);
}
static function soundIsOn() {
return(!m_instance.m_soundOff);
}
static function stopAllSound() {
var _local1 = 0;
while (_local1 < m_instance.m_sounds.length) {
stopSound(_local1);
_local1++;
}
}
var m_loopSoundID = -1;
static var m_instance = null;
var m_soundOff = false;
static var ST_PLAY = -1;
static var ST_STOP = 0;
static var PLAY_OPT_ALWAYS = 0;
static var PLAY_OPT_IFSTOP = 1;
static var PLAY_OPT_STOPANDPLAY = 2;
}
Symbol 379 MovieClip [__Packages.CSoundControl] Frame 0
class CSoundControl extends MovieClip
{
var _currentframe, gotoAndStop;
function CSoundControl () {
super();
}
function onEnterFrame() {
if ((!CSoundService.soundIsOn()) && (_currentframe != 2)) {
gotoAndStop(2);
}
if (CSoundService.soundIsOn() && (_currentframe != 1)) {
gotoAndStop(1);
}
}
}
Symbol 380 MovieClip [__Packages.CLevel] Frame 0
class CLevel extends MovieClip
{
var m_levelPlace, attachMovie, m_hitPlace, m_back, m_BonusPlace, m_engine, m_camera, _x, _y;
function CLevel () {
super();
}
function initLevel(levelNum) {
m_levelPlace = attachMovie(CConstants.levelNames[levelNum], "_levelName", DEPTH_LEVEL);
m_hitPlace = m_levelPlace.mcHit;
m_back = m_levelPlace.mcMiddle;
m_BonusPlace = m_levelPlace.BonusPlace;
m_engine = new CParticleEngine(m_hitPlace, 6);
m_camera = new CCamera();
}
function initCamera(movieCenteredAtScreen, windowWidth, windowHeight, lookAtX, lookAtY) {
m_camera.init(movieCenteredAtScreen, this, windowWidth, windowHeight);
m_camera.setLookPoint(lookAtX, lookAtY);
m_camera.setLevelSize(m_hitPlace._width, m_hitPlace._height);
m_camera.process();
}
function process() {
m_back._x = -Math.round(_x / 2);
m_back._y = -Math.round(_y / 2);
m_engine.process();
m_camera.process();
}
function checkFinish(targetObject) {
return(m_levelPlace.m_finishWall.hitTest(targetObject));
}
function getEngine() {
return(m_engine);
}
function getLevelPlace() {
return(m_levelPlace);
}
function getVehiclePlace() {
return(m_levelPlace.m_vehiclePlace);
}
function getHitPlace() {
return(m_hitPlace);
}
function getBonusPlace() {
return(m_BonusPlace);
}
function getHitBonus(m) {
for (var _local3 in m_BonusPlace) {
if (m_BonusPlace[_local3]._visible) {
if (m.hitTest(m_BonusPlace[_local3])) {
m_BonusPlace[_local3]._visible = false;
return(true);
}
}
}
return(false);
}
function getBikePlace() {
var _local2 = new Object();
_local2.x = 0;
_local2.y = 0;
m_levelPlace.mcBikePlace.localToGlobal(_local2);
getVehiclePlace().globalToLocal(_local2);
return(_local2);
}
static var DEPTH_VECHICLE_PLACE = 150;
static var DEPTH_LEVEL = 110;
static var DEPTH_MIDDLE = 100;
static var DEPTH_HIT_LEVEL = 105;
}
Symbol 381 MovieClip [__Packages.CParticleEngine] Frame 0
class 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() {
drawSpringConstraints();
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) {
}
}
function drawSpringConstraints() {
if (CGameService.__get__DEBUG_MODE()) {
var _local4 = new Object();
var _local3 = new Object();
var _local2 = 0;
while (_local2 < m_constraints.length) {
_local4.x = m_constraints[_local2].m_p1.pos.x;
_local4.y = m_constraints[_local2].m_p1.pos.y;
_local3.x = m_constraints[_local2].m_p2.pos.x;
_local3.y = m_constraints[_local2].m_p2.pos.y;
m_hitMovie.localToGlobal(_local4);
m_hitMovie.localToGlobal(_local3);
CGameService.drawLine(_local4.x, _local4.y, _local3.x, _local3.y, 0.5, 0, 100);
_local2++;
}
}
}
static var SEC_PER_FRAME = 0.0416666666666667;
static var REPEAT_COUNT = 3;
static var D_TIME = SEC_PER_FRAME / REPEAT_COUNT;
}
Symbol 382 MovieClip [__Packages.CParticle] Frame 0
class CParticle
{
var m_curPosition, m_prevPosition, m_accelerate, m_buckup, m_mass, m_mc;
function CParticle () {
m_curPosition = new CVector2D();
m_prevPosition = new CVector2D();
m_accelerate = new CVector2D();
m_buckup = new 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);
}
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 383 MovieClip [__Packages.CVector2D] Frame 0
class 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 getUgol() {
return(Math.atan2(y, x));
}
function duplicate() {
return(new CVector2D(x, y));
}
function minus(v) {
x = x - v.x;
y = y - v.y;
}
function minusNew(v) {
return(new 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 CVector2D(-x, -y));
}
function scalar(v) {
return((x * v.x) + (y * v.y));
}
function modul() {
return(Math.sqrt((x * x) + (y * y)));
}
function reflectFromNormal(n) {
var _local2 = Math.atan2(n.y, n.x);
rotate(-_local2);
x = -x;
rotate(_local2);
}
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 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 CVector2D(x * k, y * k));
}
function plus(v) {
x = x + v.x;
y = y + v.y;
}
function plusNew(v) {
return(new 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);
}
function toString() {
return(((("( " + x) + ", ") + y) + " )");
}
}
Symbol 384 MovieClip [__Packages.IConstraint] Frame 0
interface IConstraint
{
}
Symbol 385 MovieClip [__Packages.CGameService] Frame 0
class CGameService
{
static var m_instance;
var m_root, m_debugMode, m_pauseListeners, m_score;
function CGameService (rootPointer, soundsNames) {
m_instance = this;
m_root = rootPointer;
m_debugMode = false;
m_pauseListeners = new CGroup();
m_score = 0;
CSoundService.createSoundService(soundsNames, m_root, 9999);
}
static function get instance() {
return(m_instance);
}
static function get _root() {
return(m_instance.m_root);
}
static function get score() {
return(m_instance.m_score);
}
static function set score(score) {
m_instance.m_score = score;
//return(CGameService.score);
}
static function set pauseOn(pauseState) {
m_instance.m_pauseOn = pauseState;
if (pauseState) {
m_instance.m_pauseListeners.callFunction("enablePause");
} else {
m_instance.m_pauseListeners.callFunction("disablePause");
}
//return(pauseOn);
}
static function get pauseOn() {
return(m_instance.m_pauseOn);
}
static function addPauseListener(obj) {
m_instance.m_pauseListeners.addElement(obj);
}
static function removePauseListener(obj) {
m_instance.m_pauseListeners.removeElement(obj);
}
static function getGlobalXY(pX, pY, movie) {
var _local1 = {x:pX, y:pY};
movie.localToGlobal(_local1);
return(_local1);
}
static function get DEBUG_MODE() {
return(m_instance.m_debugMode);
}
static function set DEBUG_MODE(debugMode) {
m_instance.m_debugMode = debugMode;
if (debugMode) {
m_instance.m_drawArea = m_instance.m_root.createEmptyMovieClip("__drawArea", DEPTH_DRAW_AREA);
} else {
m_instance.m_drawArea.removeMovieClip();
}
//return(DEBUG_MODE);
}
static function drawLine(x1, y1, x2, y2, thickness, rgb, alpha) {
if (m_instance.m_debugMode) {
m_instance.m_drawArea.lineStyle(thickness, rgb, alpha);
m_instance.m_drawArea.moveTo(x1, y1);
m_instance.m_drawArea.lineTo(x2, y2);
}
}
static function clearAll() {
if (m_instance.m_debugMode) {
m_instance.m_drawArea.clear();
}
}
static function numberToStringWith0(val) {
if (val < 10) {
return(String("0" + val.toString()));
}
return(val.toString());
}
static function setFilter(movie, filter) {
var _local1 = new Array();
_local1.push(filter);
movie.filters = _local1;
}
static var DEPTH_DRAW_AREA = 32001;
}
Symbol 386 MovieClip [__Packages.CGroup] Frame 0
class CGroup
{
var m_elements;
function CGroup () {
m_elements = new Array();
}
function addElement(element) {
var _local2 = 0;
while (_local2 < m_elements.length) {
if (m_elements[_local2] == null) {
m_elements[_local2] = element;
return(undefined);
}
_local2++;
}
m_elements.push(element);
}
function removeElement(element) {
var _local2 = m_elements.length - 1;
while (_local2 >= 0) {
if (m_elements[_local2] == element) {
m_elements[_local2] = null;
}
_local2--;
}
}
function getElementAt(elementNum) {
return(m_elements[elementNum]);
}
function removeAllElements() {
var _local2 = m_elements.length - 1;
while (_local2 >= 0) {
m_elements[_local2] = null;
_local2--;
}
}
function callFunction(funcName) {
var _local2 = m_elements.length - 1;
while (_local2 >= 0) {
if (m_elements[_local2] != null) {
m_elements[_local2][funcName]();
}
_local2--;
}
}
function callFunctionParam1(funcName, param1) {
var _local2 = m_elements.length - 1;
while (_local2 >= 0) {
if (m_elements[_local2] != null) {
m_elements[_local2][funcName](param1);
}
_local2--;
}
}
function callFunctionParam2(funcName, param1, param2) {
var _local2 = m_elements.length - 1;
while (_local2 >= 0) {
if (m_elements[_local2] != null) {
m_elements[_local2][funcName](param1, param2);
}
_local2--;
}
}
}
Symbol 387 MovieClip [__Packages.IPauseListener] Frame 0
interface IPauseListener
{
}
Symbol 388 MovieClip [__Packages.CCamera] Frame 0
class CCamera
{
var m_targetMoviePos, m_targetMovie, m_levelMovie, m_screenWidth, m_screenHeight, m_levelWidth, m_levelHeight, m_targetXAtScreen, m_targetYAtScreen, m_positionState;
function CCamera () {
m_targetMoviePos = new Object();
}
function init(targetMovie, levelMovie, screenWidth, screenHeight) {
m_targetMovie = targetMovie;
m_levelMovie = levelMovie;
m_screenWidth = screenWidth;
m_screenHeight = screenHeight;
setLevelSize(m_levelMovie._width, m_levelMovie._height);
setLookPoint(m_screenWidth / 2, m_screenHeight / 2);
}
function setLevelSize(levelWidth, levelHeight) {
m_levelWidth = levelWidth;
m_levelHeight = levelHeight;
}
function setLookPoint(px, py) {
m_targetXAtScreen = px;
m_targetYAtScreen = py;
process();
}
function pointOutsideLeft(pX) {
return(Math.abs(pX) < Math.abs(m_levelMovie._x));
}
function process() {
m_targetMoviePos.x = m_targetMovie._x;
m_targetMoviePos.y = m_targetMovie._y;
m_targetMovie._parent.localToGlobal(m_targetMoviePos);
m_levelMovie._parent.globalToLocal(m_targetMoviePos);
m_levelMovie._x = m_levelMovie._x + Math.round(m_targetXAtScreen - m_targetMoviePos.x);
m_levelMovie._y = m_levelMovie._y + Math.round(m_targetYAtScreen - m_targetMoviePos.y);
m_positionState = BORDER_NONE;
if (m_levelMovie._x > 0) {
m_levelMovie._x = 0;
m_positionState = BORDER_LEFT;
} else if (m_levelMovie._x < (m_screenWidth - m_levelWidth)) {
m_levelMovie._x = m_screenWidth - m_levelWidth;
m_positionState = BORDER_RIGHT;
}
if (m_levelMovie._y < 20) {
m_levelMovie._y = 20;
} else if (m_levelMovie._y > (m_screenHeight + m_levelHeight)) {
m_levelMovie._y = m_screenHeight + m_levelHeight;
}
}
function getTargetMovie() {
return(m_targetMovie);
}
static var BORDER_NONE = 0;
static var BORDER_LEFT = 1;
static var BORDER_RIGHT = 2;
}
Symbol 389 MovieClip [__Packages.CBoxConstrainSkeleton] Frame 0
class 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 CPenetrationConstraint(m_D, m_C, m_B);
m_DCB = new 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 390 MovieClip [__Packages.CSpringConstraint] Frame 0
class CSpringConstraint implements 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 = 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 391 MovieClip [__Packages.CPenetrationConstraint] Frame 0
class CPenetrationConstraint implements 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 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 392 MovieClip [__Packages.CWheel] Frame 0
class CWheel extends 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, m_prevPosition, synchronizeMovie, m_mc, m_curPosition;
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) * CWheel.ANGLE_180_DIV_PI;
};
m_rim = rotationMovie;
}
}
function setAccelerate(nAccelerate) {
m_acceleration = nAccelerate;
}
function getAccelerate() {
return(m_acceleration);
}
function initWhile(x, y, mass, rad, maxAccSpeed, mc, rotationMovie, koeffSpring, koeffSlip) {
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 CVector2D(1, 0);
intersectionFlag = false;
lastIntersPoint = new CVector2D(0, 0);
lastN = new 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 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 checkCollision(hit_mc) {
var _local2;
var _local8;
var _local9 = new CVector2D(0, 0);
var _local13 = false;
var _local5;
var _local7;
var _local15;
var _local16 = new CVector2D(m_prevPosition.x, m_prevPosition.y);
var _local4 = new CVector2D(0, 0);
var _local3 = new CVector2D(0, 0);
var _local14;
synchronizeMovie();
_local14 = 0;
_local2 = 0;
while (_local2 < m_hitCount) {
hitPointArray[_local2].copyTo(_local9);
m_mc.localToGlobal(_local9);
if ((hitArray[_local2] = hit_mc.hitTest(_local9.x, _local9.y, true))) {
_local13 = true;
_local5 = _local2;
_local14++;
}
_local2++;
}
if (_local14 == 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 (_local13) {
while (true) {
_local2++;
if (_local2 == m_hitCount) {
_local2 = 0;
}
if (!hitArray[_local2]) {
_local5 = -1;
_local8 = 0;
while (_local8 < m_hitCount) {
_local2++;
if (_local2 == m_hitCount) {
_local2 = 0;
}
if (_local5 == -1) {
if (hitArray[_local2]) {
_local5 = _local2;
_local4.plus(normalArray[_local2]);
normalArray[_local2].copyTo(_local3);
}
} else if (!hitArray[_local2]) {
_local7 = _local2 - 1;
if (_local7 < 0) {
_local7 = m_hitCount - 1;
}
intersArray.push({k1:_local5, k2:_local7, n:new CVector2D(_local3.x, _local3.y)});
_local5 = -1;
} else {
_local4.plus(normalArray[_local2]);
_local3.plus(normalArray[_local2]);
}
_local8++;
}
break;
}
}
var _local6 = new CVector2D(0, 0);
if (intersArray.length > 0) {
_local4.normalize();
if (intersectionFlag) {
_local4.x = _local4.x + lastN.x;
_local4.y = _local4.y + lastN.y;
_local4.x = _local4.x / 2;
_local4.y = _local4.y / 2;
}
var _local10;
var _local11;
_local15 = intersArray.length;
_local2 = 0;
while (_local2 < _local15) {
_local10 = intersArray.pop();
_local5 = _local10.k1;
_local7 = _local10.k2;
_local10.n.copyTo(_local3);
m_curPosition.minusNew(m_prevPosition).copyTo(_local6);
if (_local4.scalar(_local6) < 0) {
_local11 = Math.atan2(_local4.y, _local4.x);
_local6.rotate(-_local11);
_local6.x = (-_local6.x) * m_koeffSpring;
_local6.rotate(_local11);
pushOut(_local5, _local7, _local3, hit_mc);
m_prevPosition.x = m_curPosition.x - _local6.x;
m_prevPosition.y = m_curPosition.y - _local6.y;
} else {
pushOut(_local5, _local7, _local3, hit_mc);
}
_local2++;
}
validateRotation(_local4, _local16);
intersectionFlag = true;
m_curPosition.copyTo(lastIntersPoint);
_local4.copyTo(lastN);
}
} else if (intersectionFlag) {
validateRotation(lastN, _local16);
intersectionFlag = false;
}
synchronizeMovie();
}
function pushOut(k1, k2, n, hit_mc) {
n.normalize();
if (k1 != k2) {
var _local7 = new 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 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 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 393 MovieClip [__Packages.CConstants] Frame 0
class CConstants
{
function CConstants () {
}
static var SOUNDS_NAMES = new Array("sndInGame", "sndIntro1", "BOOM", "IDEngine", "click", "IDEngine2", "bonus");
static var SND_INTRO = 1;
static var SND_NEXT_LEVEL = 1;
static var SND_INGAME = 0;
static var SND_BOMB = 2;
static var SND_ENGINE3 = 3;
static var SND_BUTTON = 4;
static var SND_ACSEL = 5;
static var SND_BONUS = 6;
static var COLORCAR = 1;
static var SCREEN_WIDTH = 550;
static var SCREEN_HEIGHT = 400;
static var LEVEL_HORIZONT = 180;
static var ACCELERATE_BIKE = 32;
static var JUMP_BIKE = 150;
static var JUMP_RESPAUN = 3;
static var DEAD_POWER = 2;
static var MINE_POWER = 35;
static var MINE_POWER_JUMP = 370;
static var REPEAR_POWER = 45;
static var levelNames = new Array("idLevel1", "idLevel2", "idLevel3", "idLevel4", "idLevel5", "idLevel6", "idLevel9", "idLevel7", "idLevel8", "idLevel10");
static var bikeBaseParam = new CBoxConstrainSkeleton().init(new CWheel().initWhile(0, 0, 5, 37, 180), new CWheel().initWhile(0, 0, 3, 16, 0), new CParticle().initParticle(0, 0, 3), new CWheel().initWhile(0, 0, 5, 37, 180), new CSpringConstraint().init(0.3, 0.2), new CSpringConstraint().init(0.3, 0.3), new CSpringConstraint().init(0.3, 0.3), new CSpringConstraint().init(0.3, 0.3), new CSpringConstraint().init(0.3, 0.3), new CSpringConstraint().init(0.3, 0.2));
}
Symbol 394 MovieClip [__Packages.CGame] Frame 0
class CGame extends MovieClip
{
var m_curLevel, m_BiStr, m_raceEngine, onEnterFrame, screen;
function CGame () {
super();
m_curLevel = 0;
m_BiStr = 0;
m_instance = this;
Key.addListener(this);
new CGameService(_root, CConstants.SOUNDS_NAMES);
CGameService.__set__DEBUG_MODE(false);
CSoundService.playSound(CConstants.SND_INTRO, true, 9999);
}
function initGame() {
m_raceEngine.initRaceEngine(curLevel);
onEnterFrame = processGame;
}
static function buttonStartGame() {
CSoundService.playSound(CConstants.SND_BUTTON, false, 1);
trace("StartButton");
m_instance.all_time = 0;
tryCount = (0);
CGameService.__set__score(0);
curLevel = (0);
m_instance.gotoAndStop("lbColorChang");
CSoundService.playSound(CConstants.SND_INTRO, true, 9999);
}
static function buttonHowToPlay() {
CSoundService.playSound(CConstants.SND_BUTTON, false, 1);
m_instance.gotoAndStop("lbHowToPlay");
}
function updateScoreAndLevel() {
screen.txtAllTime = int2Time(m_instance.all_time);
screen.txtLevel = String(curLevel + 1);
screen.txtScore = String(CGameService.__get__score());
}
static function buttonNextLevel() {
CSoundService.playSound(CConstants.SND_BUTTON, false, 1);
curLevel = ((curLevel+1));
buttonStartRace();
}
static function buttonStartRace() {
CSoundService.playSound(CConstants.SND_BUTTON, false, 1);
CSoundService.stopAllSound();
CSoundService.playLoopSound(CConstants.SND_INGAME);
m_instance.gotoAndStop("lbGame");
m_instance.defaltFunction = function () {
};
m_instance.m_raceEngine.m_panel.txtLevel = curLevel + 1;
m_instance.m_raceEngine.m_panel.txtScore = CGameService.score;
bonusScore = (0);
m_instance.m_collectAllBonus = false;
m_instance.onEnterFrame = m_instance.initGame;
}
static function buttonBack() {
CSoundService.stopAllSound();
CSoundService.playLoopSound(CConstants.SND_INTRO);
CSoundService.playSound(CConstants.SND_BUTTON, false, 1);
m_instance.gotoAndStop("lbSplash");
m_instance.defaltFunction = buttonStartGame;
}
static function buttonExitGame() {
CSoundService.playSound(CConstants.SND_BUTTON, false, 1);
m_instance.gotoAndStop("lbLose");
var _local1 = 0;
CGameService.score = CGameService.score + _local1;
m_instance.screen.txtTimeScore = String(_local1);
m_instance.updateScoreAndLevel();
m_instance.defaltFunction = buttonStartRace;
}
static function levelComplete() {
m_instance.all_time = m_instance.all_time + m_instance.m_time;
CSoundService.stopAllSound();
CSoundService.playLoopSound(CConstants.SND_INTRO);
if (curLevel >= (CConstants.levelNames.length - 1)) {
m_instance.gotoAndStop("lbWin");
m_instance.defaltFunction = function () {
};
} else {
m_instance.gotoAndStop("lbStatistic");
m_instance.defaltFunction = buttonNextLevel;
}
var _local1 = 0;
_local1 = _local1 + ((1000 + (347 * curLevel)) / tryCount);
trace("CGame.tryCount " + tryCount);
if (tryCount <= 1) {
_local1 = _local1 * 1.5;
_local1 = _local1 + 1000;
m_instance.screen.mcFirstTry._visible = true;
} else {
m_instance.screen.mcFirstTry._visible = false;
}
tryCount = (0);
m_instance.screen.txtTimeScore = int2Time(m_instance.m_time);
m_instance.screen.txtSpecialScore = String(int(_local1));
m_instance.screen.txtBonusScore = String(CRaceEngine.BonusLevel);
CGameService.score = CGameService.score + int(_local1 + CRaceEngine.BonusLevel);
m_instance.updateScoreAndLevel();
tryCount = (0);
}
function processGame() {
CGameService.clearAll();
m_raceEngine.process();
}
function onKeyDown() {
m_raceEngine.onKeyDown();
if (Key.getCode() == 32) {
defaltFunction();
}
}
function defaltFunction() {
buttonStartRace();
}
static function set curLevel(curLevel) {
m_instance.m_curLevel = curLevel;
//return(CGame.curLevel);
}
static function get curLevel() {
return(m_instance.m_curLevel);
}
static function get curTime() {
return(m_instance.m_time);
}
static function set curTime(newTime) {
m_instance.m_time = newTime;
var _local3 = Math.floor(newTime / 60);
var _local2 = Math.floor(newTime % 60);
var _local4 = Math.floor((newTime - Math.floor(newTime)) * 100);
m_instance.m_raceEngine.m_panel.m_msec = CGameService.numberToStringWith0(_local4);
m_instance.m_raceEngine.m_panel.m_sec = CGameService.numberToStringWith0(_local2);
m_instance.m_raceEngine.m_panel.m_min = CGameService.numberToStringWith0(_local3);
m_instance.m_raceEngine.m_panel.txtScore = CRaceEngine.BonusLevel;
//return(curTime);
}
static function int2Time(newTime) {
var _local3 = Math.floor(newTime / 60);
var _local2 = Math.floor(newTime % 60);
var _local4 = Math.floor((newTime - Math.floor(newTime)) * 100);
return((((CGameService.numberToStringWith0(_local3) + ":") + CGameService.numberToStringWith0(_local2)) + ":") + CGameService.numberToStringWith0(_local4));
}
static function set bonusScore(score) {
m_instance.m_bonusScore = score;
//return(bonusScore);
}
static function get bonusScore() {
return(m_instance.m_bonusScore);
}
static function set tryCount(count) {
trace(m_instance.m_tryCount);
m_instance.m_tryCount = count;
//return(tryCount);
}
static function get tryCount() {
return(m_instance.m_tryCount);
}
static var m_instance = null;
var m_tryCount = 0;
}
Symbol 395 MovieClip [__Packages.CRaceEngine] Frame 0
class CRaceEngine extends MovieClip implements IPauseListener
{
static var BonusLevel;
var processBuckUp, m_windowPause, attachMovie, m_pause, m_level, m_keyState, m_bike, m_curLevel, m_levelPlace, mcBG, deadCounter, _DieMessage;
function CRaceEngine () {
super();
CGameService.addPauseListener(this);
}
function enablePause() {
processBuckUp = process;
process = function () {
};
m_windowPause = attachMovie("pauseWindow", "__pauseWindow", 32001);
m_pause.enabled = false;
}
function disablePause() {
process = processBuckUp;
enableBikeControll();
m_pause.enabled = true;
m_windowPause.removeMovieClip();
}
function processKeys() {
var _local1 = new CMultiState();
return(_local1);
}
function onUnload() {
CGameService.removePauseListener(this);
}
function processTime() {
CGame.curTime = CGame.curTime + 0.04167;
}
function process() {
}
function processRace() {
processTime();
m_level.process();
var _local2 = processKeys();
if (_local2.__get__curMask() != m_keyState.__get__curMask()) {
m_keyState.__set__curMask(_local2.curMask);
}
m_bike.processKeys(m_keyState);
m_bike.process();
if (m_level.getHitBonus(m_bike.getHitBonusMovieClip())) {
CSoundService.playSound(CConstants.SND_BONUS, false, 1);
BonusLevel = BonusLevel + 100;
}
if (m_bike.checkDeathPoint()) {
killBike();
}
if (m_level.checkFinish(m_bike.getBodyMovieClip())) {
CGame.levelComplete();
}
}
function initRaceEngine(levelNum) {
m_curLevel = levelNum;
m_bike = new CBike();
BonusLevel = 0;
m_level = CLevel(m_levelPlace.attachMovie("idCurLevel", "__idLevel", DEPTH_CURLEVEL));
m_level.initLevel(levelNum);
if (levelNum < 5) {
mcBG.gotoAndStop(1);
} else {
mcBG.gotoAndStop(2);
}
m_keyState = new CMultiState();
resetBike();
CGame.__set__tryCount((CGame.__get__tryCount()+1));
CGame.__set__curTime(0);
enableBikeControll();
process = processRace;
}
function resetBike() {
var _local2 = m_level.getBikePlace();
m_level.getEngine().clear();
m_bike.initWehicle(m_level, _local2.x, _local2.y);
m_level.initCamera(m_bike.getBodyMovieClip(), CConstants.SCREEN_WIDTH, CConstants.SCREEN_HEIGHT, CConstants.SCREEN_WIDTH / 4, 150);
}
function enableBikeControll() {
processKeys = function () {
var _local1 = new CMultiState();
if (Key.isDown(38)) {
_local1.addMask(CBike.KM_ACCELERATE);
}
if (Key.isDown(40)) {
_local1.addMask(CBike.KM_BRAKE);
}
if (Key.isDown(37)) {
_local1.addMask(CBike.KM_MOVE_BODY_BACK);
}
if (Key.isDown(39)) {
_local1.addMask(CBike.KM_MOVE_BODY_FORWARD);
}
if (Key.isDown(17)) {
_local1.addMask(CBike.KM_SPURT_FORWARD);
}
if (Key.isDown(18)) {
_local1.addMask(CBike.KM_SPURT_BACK);
}
return(_local1);
};
}
function disableKeyFunction() {
processKeys = function () {
var _local1 = new CMultiState();
return(_local1);
};
}
function onKeyDown() {
}
function spaceFunction() {
}
function Boom() {
var _local2 = attachMovie("deadBlink", "_DieMessage", 555);
_local2._x = CConstants.SCREEN_WIDTH / 2;
_local2._y = CConstants.SCREEN_HEIGHT / 2;
process = processDie;
deadCounter = 88;
}
function killBike() {
trace("Death!");
process = processDie;
deadCounter = 35;
}
function processDie() {
deadCounter--;
m_bike.process();
if (deadCounter == 34) {
CSoundService.stopSound(CConstants.SND_BOMB);
CSoundService.playSound(CConstants.SND_BOMB, true, 1);
m_bike.getBodyMovieClip().mc.play();
m_bike.hideWeel();
}
if (deadCounter <= 0) {
_DieMessage.removeMovieClip();
initRaceEngine(m_curLevel);
}
}
function processWaitRestart() {
initRaceEngine(m_curLevel);
}
static var DEPTH_CURLEVEL = 10;
}
Symbol 396 MovieClip [__Packages.CBike] Frame 0
class CBike
{
var m_bikeDir, m_bikeNormal, delayCounter, m_afterJerk, m_engine, m_bikeMovie, m_backWheel, m_forwardWheel, p_ld, p_rd;
function CBike () {
m_bikeDir = new CVector2D(0, 0);
m_bikeNormal = new CVector2D(0, 0);
delayCounter = 0;
m_afterJerk = 0;
CSoundService.playSound(CConstants.SND_ENGINE3, false, 99999);
CSoundService.getSoundAt(CConstants.SND_ENGINE3).setVolume(40);
CSoundService.getSoundAt(CConstants.SND_INGAME).setVolume(40);
}
function initWehicle(level, posX, posY) {
var _local4 = level.getEngine();
var _local3 = level.getVehiclePlace();
m_engine = _local4;
var _local2;
m_bikeMovie = _local3.attachMovie("idBike", "_Bike", 140);
m_bikeMovie._x = posX;
m_bikeMovie._y = posY;
CConstants.bikeBaseParam.changeGeometry(getBikePoint(m_bikeMovie.mc.mc_p_wl), getBikePoint(m_bikeMovie.mc.mc_p_ld), getBikePoint(m_bikeMovie.mc.mc_p_rd), getBikePoint(m_bikeMovie.mc.mc_p_wr));
_local2 = _local3.attachMovie("idMotoWhellBack", "_MotoWhellBack", 150);
CConstants.bikeBaseParam.__get__A().setMovie(_local2);
CWheel(CConstants.bikeBaseParam.__get__A()).setRotationMovie(_local2.mcSpoke);
_local2 = _local3.attachMovie("idMotoWhellBack", "_MotoTop", 155);
CConstants.bikeBaseParam.__get__B().setMovie(_local2);
CWheel(CConstants.bikeBaseParam.__get__B()).setRotationMovie(_local2.mcSpoke);
_local2 = _local3.attachMovie("idMotoWhellForward", "_MotoWhellForward", 160);
CConstants.bikeBaseParam.__get__D().setMovie(_local2);
CWheel(CConstants.bikeBaseParam.__get__D()).setRotationMovie(_local2.mcSpoke);
CConstants.bikeBaseParam.addToEngine(_local4);
m_backWheel = CWheel(CConstants.bikeBaseParam.__get__A());
m_forwardWheel = CWheel(CConstants.bikeBaseParam.__get__D());
p_ld = CWheel(CConstants.bikeBaseParam.__get__B());
p_ld.getMovie()._visible = false;
p_rd = CConstants.bikeBaseParam.C;
m_bikeMovie.mc.bike.kuzov.gotoAndStop(CConstants.COLORCAR);
}
function hideWeel() {
m_forwardWheel.getMovie()._visible = false;
m_backWheel.getMovie()._visible = false;
}
function getBikePoint(mc) {
var _local2 = new Object();
_local2.x = mc._x;
_local2.y = mc._y;
mc._parent.localToGlobal(_local2);
m_bikeMovie._parent.globalToLocal(_local2);
return(_local2);
}
function playAccelerateSound() {
CSoundService.stopSound(CConstants.SND_ACSEL);
CSoundService.playSound(CConstants.SND_ACSEL, true, 1);
}
function stopAccelerateSound() {
}
function accelerate() {
if (!p_ld.hasIntersection()) {
m_backWheel.setAccelerate(CConstants.ACCELERATE_BIKE);
m_forwardWheel.setAccelerate(CConstants.ACCELERATE_BIKE);
}
}
function brake() {
m_backWheel.setAccelerate(-CConstants.ACCELERATE_BIKE);
m_forwardWheel.setAccelerate(-CConstants.ACCELERATE_BIKE);
}
function stopAccelerate() {
m_backWheel.setAccelerate(0);
m_forwardWheel.setAccelerate(0);
}
function processKeys(keyState) {
if (keyState.checkMask(KM_ACCELERATE)) {
accelerate();
if (!keyState.checkPrevStateMask(KM_ACCELERATE)) {
playAccelerateSound();
keyState.addMask(KM_ACCELERATE);
}
} else if (keyState.checkMask(KM_BRAKE)) {
brake();
} else {
stopAccelerate();
stopAccelerateSound();
}
m_bikeMovie.mc.mc_man.processKeys(keyState);
m_afterJerk++;
if (keyState.checkMask(KM_MOVE_BODY_FORWARD)) {
if (((m_afterJerk > 10) && (delayCounter > 0)) && (delayCounter < 5)) {
Upp(DIR_RIGHT);
m_afterJerk = 0;
} else {
turnTo(DIR_RIGHT);
}
} else if (keyState.checkMask(KM_MOVE_BODY_BACK)) {
if (((m_afterJerk > 10) && (delayCounter < 0)) && (delayCounter > -5)) {
Upp(DIR_LEFT);
m_afterJerk = 0;
} else {
turnTo(DIR_LEFT);
}
}
if ((!keyState.checkMask(KM_MOVE_BODY_FORWARD)) && (keyState.checkPrevStateMask(KM_MOVE_BODY_FORWARD))) {
delayCounter++;
} else if ((!keyState.checkMask(KM_MOVE_BODY_BACK)) && (keyState.checkPrevStateMask(KM_MOVE_BODY_BACK))) {
delayCounter--;
} else {
delayCounter = 0;
}
}
function Upp(dir) {
m_bikeNormal.init(m_bikeDir.x, m_bikeDir.y);
m_bikeNormal.normalize();
var _local7;
_local7 = m_bikeNormal.x;
m_bikeNormal.x = -m_bikeNormal.y;
m_bikeNormal.y = _local7;
var _local5 = 0.6;
var _local6 = 3.3;
var _local2 = (Math.abs(m_bikeNormal.y) * (1 - _local5)) + _local5;
_local2 = _local2 * _local6;
var _local4 = (m_bikeNormal.x * 9.8) * _local2;
var _local3 = (m_bikeNormal.y * 9.8) * _local2;
if (m_bikeNormal.y > -0.4) {
if (dir == DIR_LEFT) {
m_forwardWheel.__get__accelerate().plusXY((-_local4) * 10, (-_local3) * 10);
} else {
m_backWheel.__get__accelerate().plusXY((-_local4) * 10, (-_local3) * 10);
}
}
}
function onGround() {
return(m_backWheel.hasIntersection() || (m_forwardWheel.hasIntersection()));
}
function process() {
var _local3;
var _local2;
m_bikeDir.init(m_forwardWheel.__get__pos().x - m_backWheel.__get__pos().x, m_forwardWheel.__get__pos().y - m_backWheel.__get__pos().y);
m_bikeMovie._rotation = (Math.atan2(m_bikeDir.y, m_bikeDir.x) * 180) / Math.PI;
_local3 = new CVector2D(m_bikeMovie.mc.mc_p_ld._x, m_bikeMovie.mc.mc_p_ld._y);
_local2 = new CVector2D(m_bikeMovie.mc.mc_p_rd._x, m_bikeMovie.mc.mc_p_rd._y);
m_bikeMovie.mc.localToGlobal(_local3);
m_bikeMovie._parent.globalToLocal(_local3);
m_bikeMovie.mc.localToGlobal(_local2);
m_bikeMovie._parent.globalToLocal(_local2);
m_bikeMovie._x = m_bikeMovie._x + ((((p_ld.__get__pos().x - _local3.x) + p_rd.__get__pos().x) - _local2.x) / 2);
m_bikeMovie._y = m_bikeMovie._y + ((((p_ld.__get__pos().y - _local3.y) + p_rd.__get__pos().y) - _local2.y) / 2);
moveMovieToMovieGlobal(m_backWheel.getMovie(), m_bikeMovie.mc.bike.mc_back_spring);
moveMovieToMovieGlobal(m_forwardWheel.getMovie(), m_bikeMovie.mc.bike.mc_forward_spring);
rotateMovieToMovieLocal(m_bikeMovie.mc.bike.mc_forward_spring, m_bikeMovie.mc.bike.mcDir);
}
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) * 180) / Math.PI;
}
function turnTo(dir) {
m_bikeNormal.init(m_bikeDir.x, m_bikeDir.y);
m_bikeNormal.normalize();
var _local7;
_local7 = m_bikeNormal.x;
m_bikeNormal.x = -m_bikeNormal.y;
m_bikeNormal.y = _local7;
var _local5 = 0.6;
var _local6 = 7;
var _local4 = (Math.abs(m_bikeNormal.y) * (1 - _local5)) + _local5;
_local4 = _local4 * _local6;
var _local3 = (m_bikeNormal.x * 5) * _local4;
var _local2 = (m_bikeNormal.y * 5) * _local4;
if (m_bikeNormal.y > -0.4) {
if (dir == DIR_RIGHT) {
if (!m_forwardWheel.hasIntersection()) {
m_forwardWheel.__get__accelerate().plusXY(_local3 * 1.3, _local2 * 1.3);
}
m_backWheel.__get__accelerate().plusXY((-_local3) * 0.7, (-_local2) * 0.7);
} else {
m_forwardWheel.__get__accelerate().plusXY((-_local3) * 0.7, (-_local2) * 0.7);
if (!m_backWheel.hasIntersection()) {
m_backWheel.__get__accelerate().plusXY(_local3 * 1.3, _local2 * 1.3);
}
}
}
}
function checkPointVsMovie(point, movie) {
var _local1 = {x:point._x, y:point._y};
point._parent.localToGlobal(_local1);
return(movie.hitTest(_local1.x, _local1.y, true));
}
function checkDeathPoint() {
var _local2 = m_engine.getHitMovie();
return(((checkPointVsMovie(m_bikeMovie.mcDeathPoint1, _local2) || (checkPointVsMovie(m_bikeMovie.mcDeathPoint2, _local2))) || (checkPointVsMovie(m_bikeMovie.mcDeathPoint3, _local2))) || (checkPointVsMovie(m_bikeMovie.mcDeathPoint4, _local2)));
}
function getBodyMovieClip() {
return(m_bikeMovie);
}
function getHitBonusMovieClip() {
return(m_bikeMovie.hitForBonus);
}
function show(visible) {
m_bikeMovie._visible = visible;
m_backWheel.getMovie()._visible = visible;
m_forwardWheel.getMovie()._visible = visible;
}
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 KM_SPURT_FORWARD = 256;
static var KM_SPURT_BACK = 512;
static var DIR_RIGHT = 0;
static var DIR_LEFT = 1;
}
Symbol 397 MovieClip [__Packages.CMultiState] Frame 0
class CMultiState
{
var m_state, m_prevState;
function CMultiState () {
m_state = (m_prevState = 0);
}
function set curMask(nState) {
m_prevState = m_state;
m_state = nState;
//return(curMask);
}
function get curMask() {
return(m_state);
}
function checkMask(nState) {
return((m_state & nState) != 0);
}
function checkPrevStateMask(nState) {
return((m_prevState & nState) != 0);
}
function addMask(nState) {
curMask = curMask | nState;
}
function delMask(nState) {
curMask = curMask & (~nState);
}
}
Symbol 398 MovieClip [__Packages.CGameControl] Frame 0
class CGameControl extends MovieClip
{
var _currentframe, gotoAndStop;
function CGameControl () {
super();
}
function onEnterFrame() {
if ((!CGameService.__get__pauseOn()) && (_currentframe != 1)) {
gotoAndStop(1);
}
if (CGameService.__get__pauseOn() && (_currentframe != 2)) {
gotoAndStop(2);
}
}
function onPress111() {
if (CGameService.__get__pauseOn()) {
CGameService.__set__pauseOn(false);
} else {
CGameService.__set__pauseOn(true);
}
}
}
Symbol 399 MovieClip [__Packages.cColorCh] Frame 0
class cColorCh extends MovieClip
{
var mcbb;
function cColorCh () {
super();
}
function chColor(t) {
CSoundService.playSound(CConstants.SND_BUTTON, false, 1);
if (t) {
CConstants.COLORCAR++;
} else {
CConstants.COLORCAR--;
}
if (CConstants.COLORCAR < 1) {
CConstants.COLORCAR = 4;
}
if (CConstants.COLORCAR > 4) {
CConstants.COLORCAR = 1;
}
mcbb.kuzov.gotoAndStop(CConstants.COLORCAR);
}
}
Symbol 141 MovieClip [idCurLevel] Frame 1
#initclip 38
Object.registerClass("idCurLevel", CLevel);
#endinitclip
Symbol 150 Button
on (press) {
CSoundService.soundOff();
this.gotoAndStop(2);
}
Symbol 152 Button
on (press) {
CSoundService.soundOn();
this.gotoAndStop(1);
}
Symbol 153 MovieClip [Sound] Frame 1
#initclip 31
Object.registerClass("Sound", CSoundControl);
#endinitclip
stop();
Symbol 166 MovieClip Frame 1
stop();
Symbol 184 MovieClip Frame 1
stop();
Symbol 191 MovieClip [idMotoWhellBack] Frame 1
stop();
Symbol 192 MovieClip Frame 1
stop();
Symbol 192 MovieClip Frame 35
this.removeMovieClip();
stop();
Symbol 197 MovieClip [levelHit1] Frame 1
#initclip 32
Object.registerClass("levelHit1", CInvisibleMovie);
#endinitclip
Symbol 203 MovieClip [levelHit2] Frame 1
#initclip 33
Object.registerClass("levelHit2", CInvisibleMovie);
#endinitclip
Symbol 211 MovieClip [levelHit4] Frame 1
#initclip 34
Object.registerClass("levelHit4", CInvisibleMovie);
#endinitclip
Symbol 221 MovieClip [levelHit7] Frame 1
#initclip 35
Object.registerClass("levelHit7", CInvisibleMovie);
#endinitclip
Symbol 233 MovieClip [levelHit9] Frame 1
#initclip 36
Object.registerClass("levelHit9", CInvisibleMovie);
#endinitclip
Symbol 239 MovieClip [levelHit10] Frame 1
#initclip 37
Object.registerClass("levelHit10", CInvisibleMovie);
#endinitclip
Symbol 265 Button
on (press) {
CGame.buttonHowToPlay();
}
Symbol 271 Button
on (press) {
trace("ffffff");
cGame.buttonStartGame();
}
Symbol 272 Button
on (press) {
cGame.buttonHowToPlay();
}
Symbol 273 Button
on (press) {
CGame.buttonHowToPlay();
}
Symbol 274 Button
on (press) {
CGame.buttonStartGame();
}
Symbol 277 Button
on (press) {
getURL ("http://iriysoft.ru", "_blank");
}
Symbol 281 Button
on (press) {
getURL ("http://ArcadeLots.com", "_blank");
}
Symbol 282 Button
on (press) {
getURL ("http://ArcadeLots.com", "_blank");
}
Symbol 283 MovieClip Frame 28
stop();
Symbol 293 Button
on (press) {
CGame.buttonBack();
}
Symbol 304 MovieClip [CarColorChang] Frame 1
#initclip 42
Object.registerClass("CarColorChang", cColorCh);
#endinitclip
stop();
Instance of Symbol 303 MovieClip in Symbol 304 MovieClip [CarColorChang] Frame 1
on (press) {
_parent.chColor(true);
}
Instance of Symbol 303 MovieClip in Symbol 304 MovieClip [CarColorChang] Frame 1
on (press) {
trace(this);
_parent.chColor(false);
}
Symbol 310 Button
on (press) {
CGame.buttonStartRace();
}
Symbol 318 Button
on (press) {
CGame.buttonBack();
}
Symbol 331 Button
on (press) {
CGame.buttonNextLevel();
}
Symbol 345 Button
on (press) {
CGame.buttonStartRace();
}
Symbol 358 MovieClip Frame 1
stop();
Symbol 358 MovieClip Frame 2
stop();
Symbol 371 Button
on (press) {
CGameService.__set__pauseOn(!CGameService.__get__pauseOn());
}
Symbol 373 MovieClip [pausaGame] Frame 1
#initclip 39
Object.registerClass("pausaGame", CGameControl);
#endinitclip
stop();
Symbol 373 MovieClip [pausaGame] Frame 2
stop();
Symbol 375 MovieClip [gameRace] Frame 1
#initclip 40
Object.registerClass("gameRace", CRaceEngine);
#endinitclip
Symbol 376 MovieClip [game] Frame 1
#initclip 41
Object.registerClass("game", CGame);
#endinitclip
stop();
Symbol 376 MovieClip [game] Frame 46
stop();
Symbol 376 MovieClip [game] Frame 61
stop();
Symbol 376 MovieClip [game] Frame 76
stop();
Symbol 376 MovieClip [game] Frame 91
stop();