Frame 1
function gotoURL() {
getURL ("http://www.amoebastudios.com");
}
function randomRange(min, max) {
var _local1 = Math.floor(Math.random() * ((max - min) + 1)) + min;
return(_local1);
}
var newMenu = new ContextMenu();
newMenu.hideBuiltInItems();
this.menu = newMenu;
_root.playIntro = true;
_root.allSounds = new Sound();
_root.score = 0;
_root.timeScore = 0;
_root.levelScore = 0;
_root.isPause = false;
_root.levelArray = ["lblgame", "level2", "level3", "level4", "level5", "level6", "level7", "level8", "level9", "level10"];
_root.level = 1;
_root.isEasy = false;
_root.playIntroSound = true;
_root.playerId = 1;
_root.isOver = false;
Frame 2
Frame 3
function playAgain() {
mystr1 = "playerId|" + _root.playerId;
_root.score = 0;
var _local2 = _root.levelArray[int(_root.level - 1)];
_root._playAgain(_root, _local2, mystr1);
}
function displayScores(mc) {
names = _root.topnickname.split(",");
scores = _root.topscore.split(",");
i = 0;
while (i <= 19) {
if (names[i] == undefined) {
names[i] = "";
}
if (scores[i] == undefined) {
scores[i] = "";
}
eval ((mc + ".n") + (i + 1)).text = names[i];
eval ((mc + ".p") + (i + 1)).text = scores[i];
i++;
}
}
function cancelSubmit(mc, useridframe) {
trace("cancelSubmit");
delete _root.send_lv.onLoad;
_root.skipsubmit = true;
mc.gotoAndStop(useridframe);
}
function _newUser() {
getURL (_root._registerurl, "_blank");
}
function _trackClickThru(mc) {
if (_root._allowclick) {
mc.hit_area.onRelease = function () {
getURL (_root._clickthru, "_blank");
};
} else {
mc.hit_area.useHandCursor = false;
}
}
function _resetUsername(txt) {
txt.onSetFocus = function () {
if ((this.text == _root._msgValid) or (this.text == "Connecting Error!")) {
this.text = "";
}
};
}
function _readSharedData() {
_root.so_uname = ((_root._sostatus.data.so_uname == undefined) ? "" : (_root._sostatus.data.so_uname));
_root.so_jumpframe = ((_root._sostatus.data.so_jumpframe == undefined) ? "" : (_root._sostatus.data.so_jumpframe));
_root.so_sound = ((_root._sostatus.data.so_sound == undefined) ? 1 : (_root._sostatus.data.so_sound));
_resetString = _root._sostatus.data.so_resetString;
trace("==========================");
trace((("_root.so_jumpframe : " + _root._sostatus.data.so_jumpframe) + " : ") + _root.so_uname);
if (_root.so_jumpframe != "") {
_assignValue(_resetString);
_root.createEmptyMovieClip("eye", _root.getNextHighestDepth());
_root.eye.onEnterFrame = function () {
if ((_root.getBytesTotal() == _root.getBytesLoaded()) and (_root.getBytesLoaded() > 50000)) {
_root.intro = 0;
_root._sostatus.data.so_jumpframe = "";
_root._sostatus.flush();
this.onEnterFrame = null;
_root.gotoAndStop(_root.so_jumpframe);
}
};
} else {
_root.intro = 1;
play();
}
_root.uname = _root.so_uname;
_root.gamesound = _root.so_sound;
}
function _writeSharedData(jumpframe, jumpurl, _resetString) {
_root._sostatus.data.so_uname = ((_root.so_uname == undefined) ? "" : (_root.so_uname));
_root._sostatus.data.so_sound = _root.so_sound;
_root._sostatus.data.so_resetString = _resetString;
_root._sostatus.data.so_jumpframe = jumpframe;
_root._sostatus.flush();
if (jumpurl != "") {
getURL (jumpurl);
} else {
gotoAndPlay (1);
}
}
function _assignValue(_val) {
_arr = new Array();
_arr = _val.split("|");
i = 0;
while (i < (_arr.length / 2)) {
_var2 = ((i * 2) + 1) - 1;
_var3 = _var2 + 1;
_root[_arr[_var2]] = _arr[_var3];
i++;
}
}
function _playAgain(mc, jumpframe, _resetString) {
_root.so_uname = _root.uname;
if ((_root.gurl != undefined) and (_root.gurl != "")) {
_writeSharedData(jumpframe, _root.gurl, _resetString);
} else {
_assignValue(_resetString);
mc.gotoAndStop(jumpframe);
}
}
var Sscore = 0;
System.security.allowDomain("shockwave.com", "intranet.shockwave.com", "games2win.com", "gameblast.shockwave.com", "www.shockwave.com", "dev.shockwave.com", "stage.shockwave.com", "agstage.shockwave.com");
_level0.swHighScoreObject = new Object();
_level0.swHighScoreObject.showTab = "view";
_level0.swHighScoreObject.gameId = "twowheelertrauma";
_level0.swHighScoreObject.gameTitle = "Two Wheeler Trauma";
_level0.swHighScoreObject.screenWidth = 800;
_level0.swHighScoreObject.screenHeight = 600;
_level0.swHighScoreObject.scoreDescriptor = "points";
_level0.swHighScoreObject.numPlayers = 1;
_level0.swHighScoreObject.player1Score = 0;
_level0.swHighScoreObject.player2Score = 0;
_level0.swHighScoreObject.player3Score = 0;
_level0.swHighScoreObject.player4Score = 0;
_level0.HSHubURL = "http://www.shockwave.com/content/highscores/scorez-2002.swf";
_root._google_txt.text = "two wheeler trauma";
_root._gameid = "1018";
_root._clickthru = "http://www.games2win.com";
_root._customer_id = "games2win";
_root.uname = "";
_root.submiturl = "/gamesubmit.asp";
_root.topnickname = [];
_root.topscore = [];
dataSubmit = function (myname, myscore, mygameid, destmc, useridframe, connframe, top10frame, _ord) {
trace("dataSubmit");
_root.skipsubmit = false;
myname = myname.trim();
_loc = eval (destmc);
if (((myname.length == 0) or (myname == "Invalid Nickname!")) or (myname == "Connecting Error!")) {
_root.uname = "Invalid Nickname!";
} else {
_root.send_lv = new LoadVars();
_root.send_lv.onLoad = function (success) {
if (success and (!_root.skipsubmit)) {
if (_root.send_lv.isreg == 0) {
_root.uname = "Invalid Nickname!";
_loc.gotoAndStop(useridframe);
} else if (_root.send_lv.isreg == 1) {
_root.topnickname = send_lv.topnicknames;
_root.topscore = send_lv.topscores;
_loc.gotoAndPlay(top10frame);
}
}
};
_root.send_lv.nickname = myname;
_root.send_lv.points = myscore;
_root.send_lv.gameid = mygameid;
_root.send_lv.order = _ord;
_root.send_lv.sendAndLoad(submiturl, _root.send_lv, "POST");
_loc.gotoAndPlay(connframe);
}
};
String.prototype.trim = function () {
var _local3 = 0;
var _local2 = this.length;
white = new Object();
white._32 = 1;
_local2--;
while (white["_" + ord(this.charAt(_local2))]) {
}
while (white["_" + ord(this.charAt(_local3++))]) {
}
return(this.slice(_local3 - 1, _local2 + 1));
};
_root._registerurl = "http://www.games2win.com/register.asp";
_root._allowclick = true;
var _sostatus = SharedObject.getLocal("gamestatus", "/");
_readSharedData();
Frame 4
Frame 5
Frame 6
stop();
Frame 7
stop();
Frame 8
stopAllSounds();
Frame 9
stop();
Instance of Symbol 197 MovieClip in Frame 9
on (release) {
this.gotoAndPlay(_currentframe + 1);
}
Frame 10
stop();
Frame 11
stop();
Frame 12
stop();
_root.score = 0;
Frame 13
stop();
stopAllSounds();
_root.level = 1;
Frame 14
stop();
stopAllSounds();
_root.level = 2;
Frame 15
stop();
stopAllSounds();
_root.level = 3;
Frame 16
stop();
stopAllSounds();
_root.level = 4;
Frame 17
stop();
stopAllSounds();
_root.level = 5;
Frame 18
stop();
stopAllSounds();
_root.level = 6;
Frame 19
stop();
stopAllSounds();
_root.level = 7;
Frame 20
stop();
stopAllSounds();
_root.level = 8;
Frame 21
stop();
stopAllSounds();
_root.level = 9;
Frame 22
stop();
stopAllSounds();
_root.level = 10;
Frame 23
stop();
Frame 24
stop();
stopAllSounds();
Symbol 465 MovieClip [__Packages.classes.CollisionDetection] Frame 0
class classes.CollisionDetection
{
function CollisionDetection () {
}
static function checkForCollision(p_clip1, p_clip2, p_alphaTolerance, p_scope) {
if (p_alphaTolerance == undefined) {
p_alphaTolerance = 255;
}
if (p_scope == undefined) {
p_scope = p_clip2._parent;
}
var _local3 = p_clip1.getBounds(p_scope);
var _local2 = p_clip2.getBounds(p_scope);
if (((_local3.xMax < _local2.xMin) || (_local2.xMax < _local3.xMin)) || ((_local3.yMax < _local2.yMin) || (_local2.yMax < _local3.yMin))) {
return(null);
}
var _local1 = {};
_local1.xMin = Math.max(_local3.xMin, _local2.xMin);
_local1.xMax = Math.min(_local3.xMax, _local2.xMax);
_local1.yMin = Math.max(_local3.yMin, _local2.yMin);
_local1.yMax = Math.min(_local3.yMax, _local2.yMax);
var _local8 = new flash.display.BitmapData(_local1.xMax - _local1.xMin, _local1.yMax - _local1.yMin, false);
var _local4 = p_clip1.transform.matrix;
_local4.tx = p_clip1._x - _local1.xMin;
_local4.ty = p_clip1._y - _local1.yMin;
_local8.draw(p_clip1, _local4, new flash.geom.ColorTransform(1, 1, 1, 1, 255, -255, -255, p_alphaTolerance));
_local4 = p_clip2.transform.matrix;
_local4.tx = p_clip2._x - _local1.xMin;
_local4.ty = p_clip2._y - _local1.yMin;
_local8.draw(p_clip2, _local4, new flash.geom.ColorTransform(1, 1, 1, 1, 255, 255, 255, p_alphaTolerance), "difference");
var _local6 = _local8.getColorBoundsRect(4294967295, 4278255615);
if (_local6.width == 0) {
return(null);
}
_local6.x = _local6.x + _local1.xMin;
_local6.y = _local6.y + _local1.yMin;
return(_local6);
}
}
Symbol 15 Button
on (release) {
_parent.gotoAndStop("lblloader");
}
Symbol 25 Button
on (release) {
getURL ("http://www.addictinggames.com", "_blank");
}
Symbol 65 MovieClip Frame 104
_parent.gotoAndStop("lblloader");
Symbol 74 MovieClip Frame 1
stop();
var loaded = 0;
var temp = 0;
onEnterFrame = function () {
loaded = Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
mask_mc._yscale = loaded;
if (loaded >= 100) {
_root.gotoAndStop("lblgameintro");
}
};
Symbol 92 MovieClip Frame 1
stop();
Symbol 92 MovieClip Frame 2
stop();
Symbol 93 Button
on (rollOver) {
bb.useHandCursor = false;
}
Symbol 98 Button
on (release) {
getURL ("http://www.addictinggames.com", "_blank");
}
Symbol 156 MovieClip Frame 97
stop();
Symbol 161 Button
on (release) {
_parent.gotoAndStop(1);
}
Symbol 162 MovieClip Frame 1
stop();
Instance of Symbol 101 MovieClip in Symbol 162 MovieClip Frame 39
on (release) {
getURL ("http://www.media2win.com/admin/me2wbannertracking.asp?bannerid=1115&campaign=Two_Wheeler_Trauma_AddictingGames &client=Addicting_Games&site=Two_Wheeler_Trauma &creative=&b_section=&size=&fromsite=0 &link=www.games2win.com ", "_blank");
}
Symbol 162 MovieClip Frame 40
stop();
Instance of Symbol 156 MovieClip in Symbol 162 MovieClip Frame 40
on (release) {
getURL ("http://www.media2win.com/admin/me2wbannertracking.asp?bannerid=1115&campaign=Two_Wheeler_Trauma_AddictingGames &client=Addicting_Games&site=Two_Wheeler_Trauma &creative=&b_section=&size=&fromsite=0 &link=www.games2win.com", "_blank");
}
Symbol 163 MovieClip Frame 1
stop();
Symbol 163 MovieClip Frame 18
stop();
G2W_CREDIT.gotoAndPlay(2);
Symbol 176 MovieClip Frame 70
gotoAndPlay (3);
Symbol 186 Button
on (release) {
credit.gotoAndPlay(2);
}
Symbol 193 MovieClip Frame 1
if (!_root.playIntro) {
gotoAndStop(_totalframes);
}
if (_root.playIntroSound) {
stopAllSounds();
sound_mc.gotoAndStop(2);
}
_root.playIntroSound = false;
_root.playIntro = false;
Symbol 193 MovieClip Frame 148
stop();
story_btn.onRelease = function () {
_root.gotoAndStop("story");
};
instructions_btn.onRelease = function () {
_root.gotoAndStop("instructions");
};
start_btn.onRelease = function () {
_root.gotoAndStop("select");
};
Symbol 197 MovieClip Frame 1
stop();
_root.allSounds.setVolume(100);
Symbol 197 MovieClip Frame 2
stop();
_root.allSounds.setVolume(0);
Symbol 222 MovieClip Frame 1
stop();
start_btn.onRelease = function () {
stopAllSounds();
_root.gotoAndStop("select");
};
back_btn.onRelease = function () {
_root.gotoAndStop("lblgameintro");
};
Symbol 225 MovieClip Frame 1
stop();
start_btn.onRelease = function () {
_root.gotoAndStop("select");
};
back_btn.onRelease = function () {
_root.gotoAndStop("lblgameintro");
};
Symbol 254 MovieClip Frame 1
b1_btn.onRelease = function () {
_root.playerId = 1;
_root.nextFrame();
};
b2_btn.onRelease = function () {
_root.playerId = 2;
_root.nextFrame();
};
b3_btn.onRelease = function () {
_root.playerId = 4;
_root.nextFrame();
};
b4_btn.onRelease = function () {
_root.playerId = 3;
_root.nextFrame();
};
Symbol 260 MovieClip Frame 1
function checkCollision(mc2, mc1, tolerance, scope) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
var scope = _parent;
var tolerance = 256;
var initPosX = (_parent.road_mc._x - this._x);
var initPosY = (_parent.road_mc._y - this._y);
onEnterFrame = function () {
this._x = _parent.road_mc._x - initPosX;
this._y = _parent.road_mc._y - initPosY;
if (this.hitTest(_parent.bike_mc.target_mc)) {
if ((checkCollision(this, _parent.bike_mc) != undefined) || (checkCollision(this, _parent.bike_mc) != null)) {
if (_parent.bike_mc.UD == -1) {
_parent.bike_mc.speed = 1;
var _local3 = "back";
} else if (_parent.bike_mc.UD == 1) {
_parent.bike_mc.speed = -1;
var _local3 = "front";
} else if (_parent.bike_mc.UD == 0) {
if (_local3 == "back") {
_parent.bike_mc.speed = 1;
_local3 == "front";
} else {
_parent.bike_mc.speed = -1;
_local3 == "back";
}
}
stopAllSounds();
_parent.bike_mc.hit = true;
_parent.bike_mc.target_mc.gotoAndStop(2);
onEnterFrame = null;
}
}
};
Symbol 261 MovieClip Frame 1
function checkCollision(mc2, mc1, tolerance, scope) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
var scope = _parent;
var tolerance = 256;
var initPosX = (_parent.road_mc._x - this._x);
var initPosY = (_parent.road_mc._y - this._y);
onEnterFrame = function () {
this._x = _parent.road_mc._x - initPosX;
this._y = _parent.road_mc._y - initPosY;
if (this.hitTest(_parent.bike_mc.target_mc)) {
if ((checkCollision(this, _parent.bike_mc) != undefined) || (checkCollision(this, _parent.bike_mc) != null)) {
if (_parent.bike_mc.UD == -1) {
_parent.bike_mc.speed = 1;
var _local3 = "back";
} else if (_parent.bike_mc.UD == 1) {
_parent.bike_mc.speed = -1;
var _local3 = "front";
} else if (_parent.bike_mc.UD == 0) {
if (_local3 == "back") {
_parent.bike_mc.speed = 1;
_local3 == "front";
} else {
_parent.bike_mc.speed = -1;
_local3 == "back";
}
}
stopAllSounds();
_parent.bike_mc.hit = true;
_parent.bike_mc.target_mc.gotoAndStop(2);
onEnterFrame = null;
}
}
};
Symbol 263 MovieClip Frame 1
function checkCollision(mc2, mc1, tolerance, scope) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
var scope = _parent;
var tolerance = 256;
var initPosX = (_parent.road_mc._x - this._x);
var initPosY = (_parent.road_mc._y - this._y);
onEnterFrame = function () {
this._x = _parent.road_mc._x - initPosX;
this._y = _parent.road_mc._y - initPosY;
if (this.hitTest(_parent.bike_mc.target_mc)) {
if ((checkCollision(this, _parent.bike_mc) != undefined) || (checkCollision(this, _parent.bike_mc) != null)) {
if (_parent.bike_mc.UD == -1) {
_parent.bike_mc.speed = 1;
var _local3 = "back";
} else if (_parent.bike_mc.UD == 1) {
_parent.bike_mc.speed = -1;
var _local3 = "front";
} else if (_parent.bike_mc.UD == 0) {
if (_local3 == "back") {
_parent.bike_mc.speed = 1;
_local3 == "front";
} else {
_parent.bike_mc.speed = -1;
_local3 == "back";
}
}
stopAllSounds();
_parent.bike_mc.hit = true;
_parent.bike_mc.target_mc.gotoAndStop(2);
onEnterFrame = null;
}
}
};
Symbol 265 MovieClip Frame 1
function checkCollision(mc2, mc1, tolerance, scope) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
var scope = _parent;
var tolerance = 256;
var initPosX = (_parent.road_mc._x - this._x);
var initPosY = (_parent.road_mc._y - this._y);
onEnterFrame = function () {
this._x = _parent.road_mc._x - initPosX;
this._y = _parent.road_mc._y - initPosY;
if (this.hitTest(_parent.bike_mc.target_mc)) {
if ((checkCollision(this, _parent.bike_mc) != undefined) || (checkCollision(this, _parent.bike_mc) != null)) {
if (_parent.bike_mc.UD == -1) {
_parent.bike_mc.speed = 1;
var _local3 = "back";
} else if (_parent.bike_mc.UD == 1) {
_parent.bike_mc.speed = -1;
var _local3 = "front";
} else if (_parent.bike_mc.UD == 0) {
if (_local3 == "back") {
_parent.bike_mc.speed = 1;
_local3 == "front";
} else {
_parent.bike_mc.speed = -1;
_local3 == "back";
}
}
stopAllSounds();
_parent.bike_mc.hit = true;
_parent.bike_mc.target_mc.gotoAndStop(2);
onEnterFrame = null;
}
}
};
Symbol 267 MovieClip Frame 1
function checkCollision(mc2, mc1, tolerance, scope) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
var scope = _parent;
var tolerance = 256;
var initPosX = (_parent.road_mc._x - this._x);
var initPosY = (_parent.road_mc._y - this._y);
onEnterFrame = function () {
this._x = _parent.road_mc._x - initPosX;
this._y = _parent.road_mc._y - initPosY;
if (this.hitTest(_parent.bike_mc.target_mc)) {
if ((checkCollision(this, _parent.bike_mc) != undefined) || (checkCollision(this, _parent.bike_mc) != null)) {
if (_parent.bike_mc.UD == -1) {
_parent.bike_mc.speed = 1;
var _local3 = "back";
} else if (_parent.bike_mc.UD == 1) {
_parent.bike_mc.speed = -1;
var _local3 = "front";
} else if (_parent.bike_mc.UD == 0) {
if (_local3 == "back") {
_parent.bike_mc.speed = 1;
_local3 == "front";
} else {
_parent.bike_mc.speed = -1;
_local3 == "back";
}
}
stopAllSounds();
_parent.bike_mc.hit = true;
_parent.bike_mc.target_mc.gotoAndStop(2);
onEnterFrame = null;
}
}
};
Symbol 268 MovieClip Frame 1
function checkCollision(mc2, mc1, tolerance, scope) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
var scope = _parent;
var tolerance = 256;
var initPosX = (_parent.road_mc._x - this._x);
var initPosY = (_parent.road_mc._y - this._y);
onEnterFrame = function () {
this._x = _parent.road_mc._x - initPosX;
this._y = _parent.road_mc._y - initPosY;
if (this.hitTest(_parent.bike_mc.target_mc)) {
if ((checkCollision(this, _parent.bike_mc) != undefined) || (checkCollision(this, _parent.bike_mc) != null)) {
if (_parent.bike_mc.UD == -1) {
_parent.bike_mc.speed = 1;
var _local3 = "back";
} else if (_parent.bike_mc.UD == 1) {
_parent.bike_mc.speed = -1;
var _local3 = "front";
} else if (_parent.bike_mc.UD == 0) {
if (_local3 == "back") {
_parent.bike_mc.speed = 1;
_local3 == "front";
} else {
_parent.bike_mc.speed = -1;
_local3 == "back";
}
}
stopAllSounds();
_parent.bike_mc.hit = true;
_parent.bike_mc.target_mc.gotoAndStop(2);
onEnterFrame = null;
}
}
};
Symbol 269 MovieClip Frame 1
function checkCollision(mc2, mc1, tolerance, scope) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
var scope = _parent;
var tolerance = 256;
var initPosX = (_parent.road_mc._x - this._x);
var initPosY = (_parent.road_mc._y - this._y);
onEnterFrame = function () {
this._x = _parent.road_mc._x - initPosX;
this._y = _parent.road_mc._y - initPosY;
if (this.hitTest(_parent.bike_mc.target_mc)) {
if ((checkCollision(this, _parent.bike_mc) != undefined) || (checkCollision(this, _parent.bike_mc) != null)) {
if (_parent.bike_mc.UD == -1) {
_parent.bike_mc.speed = 1;
var _local3 = "back";
} else if (_parent.bike_mc.UD == 1) {
_parent.bike_mc.speed = -1;
var _local3 = "front";
} else if (_parent.bike_mc.UD == 0) {
if (_local3 == "back") {
_parent.bike_mc.speed = 1;
_local3 == "front";
} else {
_parent.bike_mc.speed = -1;
_local3 == "back";
}
}
stopAllSounds();
_parent.bike_mc.hit = true;
_parent.bike_mc.target_mc.gotoAndStop(2);
onEnterFrame = null;
}
}
};
Symbol 271 MovieClip Frame 1
function checkCollision(mc2, mc1, tolerance, scope) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
var scope = _parent;
var tolerance = 256;
var initPosX = (_parent.road_mc._x - this._x);
var initPosY = (_parent.road_mc._y - this._y);
onEnterFrame = function () {
this._x = _parent.road_mc._x - initPosX;
this._y = _parent.road_mc._y - initPosY;
if (this.hitTest(_parent.bike_mc.target_mc)) {
if ((checkCollision(this, _parent.bike_mc) != undefined) || (checkCollision(this, _parent.bike_mc) != null)) {
if (_parent.bike_mc.UD == -1) {
_parent.bike_mc.speed = 1;
var _local3 = "back";
} else if (_parent.bike_mc.UD == 1) {
_parent.bike_mc.speed = -1;
var _local3 = "front";
} else if (_parent.bike_mc.UD == 0) {
if (_local3 == "back") {
_parent.bike_mc.speed = 1;
_local3 == "front";
} else {
_parent.bike_mc.speed = -1;
_local3 == "back";
}
}
stopAllSounds();
_parent.bike_mc.hit = true;
_parent.bike_mc.target_mc.gotoAndStop(2);
onEnterFrame = null;
}
}
};
Symbol 273 MovieClip Frame 1
function checkCollision(mc2, mc1, tolerance, scope) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
var scope = _parent;
var tolerance = 256;
var initPosX = (_parent.road_mc._x - this._x);
var initPosY = (_parent.road_mc._y - this._y);
onEnterFrame = function () {
this._x = _parent.road_mc._x - initPosX;
this._y = _parent.road_mc._y - initPosY;
if (this.hitTest(_parent.bike_mc.target_mc)) {
if ((checkCollision(this, _parent.bike_mc) != undefined) || (checkCollision(this, _parent.bike_mc) != null)) {
if (_parent.bike_mc.UD == -1) {
_parent.bike_mc.speed = 1;
var _local3 = "back";
} else if (_parent.bike_mc.UD == 1) {
_parent.bike_mc.speed = -1;
var _local3 = "front";
} else if (_parent.bike_mc.UD == 0) {
if (_local3 == "back") {
_parent.bike_mc.speed = 1;
_local3 == "front";
} else {
_parent.bike_mc.speed = -1;
_local3 == "back";
}
}
stopAllSounds();
_parent.bike_mc.hit = true;
_parent.bike_mc.target_mc.gotoAndStop(2);
onEnterFrame = null;
}
}
};
Symbol 276 MovieClip Frame 1
function checkCollision(mc2, mc1, tolerance, scope) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
var scope = _parent;
var tolerance = 256;
var initPosX = (_parent.road_mc._x - this._x);
var initPosY = (_parent.road_mc._y - this._y);
onEnterFrame = function () {
this._x = _parent.road_mc._x - initPosX;
this._y = _parent.road_mc._y - initPosY;
if (this.hitTest(_parent.bike_mc.target_mc)) {
if ((checkCollision(this, _parent.bike_mc) != undefined) || (checkCollision(this, _parent.bike_mc) != null)) {
if (_parent.bike_mc.UD == -1) {
_parent.bike_mc.speed = 1;
var _local3 = "back";
} else if (_parent.bike_mc.UD == 1) {
_parent.bike_mc.speed = -1;
var _local3 = "front";
} else if (_parent.bike_mc.UD == 0) {
if (_local3 == "back") {
_parent.bike_mc.speed = 1;
_local3 == "front";
} else {
_parent.bike_mc.speed = -1;
_local3 == "back";
}
}
stopAllSounds();
_parent.bike_mc.hit = true;
_parent.bike_mc.target_mc.gotoAndStop(2);
onEnterFrame = null;
}
}
};
Symbol 278 MovieClip Frame 1
function checkCollision(mc2, mc1, tolerance, scope) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
var scope = _parent;
var tolerance = 256;
var initPosX = (_parent.road_mc._x - this._x);
var initPosY = (_parent.road_mc._y - this._y);
onEnterFrame = function () {
this._x = _parent.road_mc._x - initPosX;
this._y = _parent.road_mc._y - initPosY;
if (this.hitTest(_parent.bike_mc.target_mc)) {
if ((checkCollision(this, _parent.bike_mc) != undefined) || (checkCollision(this, _parent.bike_mc) != null)) {
if (_parent.bike_mc.UD == -1) {
_parent.bike_mc.speed = 1;
var _local3 = "back";
} else if (_parent.bike_mc.UD == 1) {
_parent.bike_mc.speed = -1;
var _local3 = "front";
} else if (_parent.bike_mc.UD == 0) {
if (_local3 == "back") {
_parent.bike_mc.speed = 1;
_local3 == "front";
} else {
_parent.bike_mc.speed = -1;
_local3 == "back";
}
}
stopAllSounds();
_parent.bike_mc.hit = true;
_parent.bike_mc.target_mc.gotoAndStop(2);
onEnterFrame = null;
}
}
};
Symbol 280 MovieClip Frame 1
function checkCollision(mc2, mc1, tolerance, scope) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
var scope = _parent;
var tolerance = 256;
var initPosX = (_parent.road_mc._x - this._x);
var initPosY = (_parent.road_mc._y - this._y);
onEnterFrame = function () {
this._x = _parent.road_mc._x - initPosX;
this._y = _parent.road_mc._y - initPosY;
if (this.hitTest(_parent.bike_mc.target_mc)) {
if ((checkCollision(this, _parent.bike_mc) != undefined) || (checkCollision(this, _parent.bike_mc) != null)) {
if (_parent.bike_mc.UD == -1) {
_parent.bike_mc.speed = 1;
var _local3 = "back";
} else if (_parent.bike_mc.UD == 1) {
_parent.bike_mc.speed = -1;
var _local3 = "front";
} else if (_parent.bike_mc.UD == 0) {
if (_local3 == "back") {
_parent.bike_mc.speed = 1;
_local3 == "front";
} else {
_parent.bike_mc.speed = -1;
_local3 == "back";
}
}
stopAllSounds();
_parent.bike_mc.hit = true;
_parent.bike_mc.target_mc.gotoAndStop(2);
onEnterFrame = null;
}
}
};
Symbol 282 MovieClip Frame 1
function checkCollision(mc2, mc1, tolerance, scope) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
var scope = _parent;
var tolerance = 256;
var initPosX = (_parent.road_mc._x - this._x);
var initPosY = (_parent.road_mc._y - this._y);
onEnterFrame = function () {
this._x = _parent.road_mc._x - initPosX;
this._y = _parent.road_mc._y - initPosY;
if (this.hitTest(_parent.bike_mc.target_mc)) {
if ((checkCollision(this, _parent.bike_mc) != undefined) || (checkCollision(this, _parent.bike_mc) != null)) {
if (_parent.bike_mc.UD == -1) {
_parent.bike_mc.speed = 1;
var _local3 = "back";
} else if (_parent.bike_mc.UD == 1) {
_parent.bike_mc.speed = -1;
var _local3 = "front";
} else if (_parent.bike_mc.UD == 0) {
if (_local3 == "back") {
_parent.bike_mc.speed = 1;
_local3 == "front";
} else {
_parent.bike_mc.speed = -1;
_local3 == "back";
}
}
stopAllSounds();
_parent.bike_mc.hit = true;
_parent.bike_mc.target_mc.gotoAndStop(2);
onEnterFrame = null;
}
}
};
Symbol 284 MovieClip Frame 1
function checkCollision(mc2, mc1, tolerance, scope) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
var scope = _parent;
var tolerance = 120;
var initPosX = (_parent.road_mc._x - this._x);
var initPosY = (_parent.road_mc._y - this._y);
onEnterFrame = function () {
this._x = _parent.road_mc._x - initPosX;
this._y = _parent.road_mc._y - initPosY;
if (this.hitTest(_parent.bike_mc.target_mc)) {
if ((checkCollision(this, _parent.bike_mc) != undefined) || (checkCollision(this, _parent.bike_mc) != null)) {
if (_parent.bike_mc.UD == -1) {
_parent.bike_mc.speed = 1;
var _local4 = "back";
} else if (_parent.bike_mc.UD == 1) {
_parent.bike_mc.speed = -1;
var _local4 = "front";
} else if (_parent.bike_mc.UD == 0) {
if (_local4 == "back") {
_parent.bike_mc.speed = 1;
_local4 == "front";
} else {
_parent.bike_mc.speed = -1;
_local4 == "back";
}
}
stopAllSounds();
_root.timeScore = (180 - int(_root.hud_mc.time_txt.text)) * 50;
_root.levelScore = 2000 * _root.level;
_root.score = (_root.score + _root.timeScore) + _root.levelScore;
_parent.bike_mc.hit = true;
_parent.nextFrame();
onEnterFrame = null;
}
}
};
Symbol 298 MovieClip Frame 5
stop();
_root.gotoAndStop("gameOver");
Symbol 300 MovieClip Frame 1
stop();
Symbol 300 MovieClip Frame 2
stop();
Symbol 301 MovieClip Frame 2
stop();
Symbol 316 MovieClip Frame 5
stop();
_root.gotoAndStop("gameOver");
Symbol 317 MovieClip Frame 1
stop();
Symbol 317 MovieClip Frame 2
stop();
Symbol 328 MovieClip Frame 5
stop();
_root.gotoAndStop("gameOver");
Symbol 329 MovieClip Frame 1
stop();
Symbol 329 MovieClip Frame 2
stop();
Symbol 330 MovieClip Frame 5
stop();
_root.gotoAndStop("gameOver");
Symbol 331 MovieClip Frame 1
stop();
Symbol 331 MovieClip Frame 2
stop();
Symbol 332 MovieClip Frame 1
function adjust(v, threshold, maximum) {
vx = 0;
if (v <= threshold) {
vx = (v / threshold) * 1;
} else {
vx = 1;
}
return(vx);
}
function move() {
this._rotation = (angle * 180) / 3.141593;
UD = Key.isDown(38) - Key.isDown(40);
LR = (Key.isDown(39) - Key.isDown(37)) / 2;
HAND = Key.isDown(32);
if (LR) {
angle = angle + (((LR * UD) * steer) * adjust(Math.abs(speed), steer_threshold, MAXSpd));
} else {
turnskidding = false;
}
if (!UD) {
speed = speed * drift;
} else if (UD & (!HAND)) {
speed = Math.min(Math.max(speed + (UD * accel), MINspd), MAXspd);
}
if (Math.abs(speed) < (accel / 2)) {
speed = 0;
}
if (HAND) {
speed = speed * handbrake;
if (speed == 0) {
var _local4 = new Object();
_local4.x = this._x;
_local4.y = this._y;
_parent.localToGlobal(_local4);
blights = _root.attachMovie("breaklite", "breaklite", 100);
blights._x = _local4.x;
blights._y = _local4.y;
blights._rotation = this._rotation;
}
if (speed > MAXskiddisplay) {
steer = steer_handbrake;
}
traction = handbrake_traction / surface;
} else {
blights.removeMovieClip();
skidding = false;
traction = Math.max(traction_max, Math.abs((speed - MAXturnSpd) / surface));
steer = steer_normal;
}
if (speed <= 0) {
traction = 1;
}
this._x = this._x + ((vector[0] = vector[0] + (((Math.cos(angle) * speed) - vector[0]) / traction)));
if (_parent.road_mc._y >= roadYpos1) {
dir = "down";
} else if (_parent.road_mc._y <= roadYpos2) {
dir = "up";
}
if (dir == "up") {
if (this._y > 0) {
this._y = this._y + ((vector[1] = vector[1] + (((Math.sin(angle) * speed) - vector[1]) / traction)));
} else {
_parent.road_mc._y = _parent.road_mc._y - ((vector[1] = vector[1] + (((Math.sin(angle) * speed) - vector[1]) / traction)));
}
} else if (dir == "down") {
if (this._y < 0) {
this._y = this._y + ((vector[1] = vector[1] + (((Math.sin(angle) * speed) - vector[1]) / traction)));
} else {
_parent.road_mc._y = _parent.road_mc._y - ((vector[1] = vector[1] + (((Math.sin(angle) * speed) - vector[1]) / traction)));
}
}
}
var blights;
_root.hud_mc._visible = true;
_root.hud_mc.timer = 0;
gotoAndStop(_root.playerId);
var accel = 0.3;
var steer = 0.04;
var steer_normal = 0.08;
var steer_handbrake = 0.099;
var steer_threshold = 4;
var MINspd = -5;
var MAXspd = 15;
var MAXskiddisplay = 2;
var MAXturnSpd = 10;
var MaxTurnSkid = 18;
var deccel = 0.92;
var handbrake = 0.33;
var handbrake_traction = 20;
var drift = 0.58;
var speed = 0;
var surface = 3;
var traction = 2;
var traction_max = 1;
var vector = [0, 0];
var angle = ((this._rotation / 180) * 3.141593);
var skidding = false;
var turnskidding = false;
var hit = false;
var dir = "up";
var roadXpos2 = _parent.road_mc._x;
var roadXpos1 = ((_parent.road_mc._x + _parent.road_mc._width) + 20);
var roadYpos2 = _parent.road_mc._y;
var roadYpos1 = ((_parent.road_mc._y + (_parent.road_mc._height / 2)) - 160);
onEnterFrame = function () {
if (hit != true) {
move();
}
};
stop();
Symbol 332 MovieClip Frame 2
stop();
Symbol 332 MovieClip Frame 3
stop();
Symbol 332 MovieClip Frame 4
stop();
Symbol 335 MovieClip Frame 1
var initPosX = (_parent.road_mc._x - this._x);
var initPosY = (_parent.road_mc._y - this._y);
onEnterFrame = function () {
this._x = _parent.road_mc._x - initPosX;
this._y = _parent.road_mc._y - initPosY;
};
Symbol 337 MovieClip Frame 2
stop();
Symbol 353 MovieClip Frame 1
_root.hud_mc._visible = false;
Symbol 353 MovieClip Frame 47
stop();
next_btn.onRelease = function () {
_root.nextFrame();
};
Symbol 354 MovieClip Frame 1
stop();
Symbol 354 MovieClip Frame 2
stop();
Symbol 361 MovieClip Frame 1
var timer = 0;
onEnterFrame = function () {
if (timer < 4320) {
timer++;
time_txt.text = Math.round(timer / 24);
}
};
Symbol 362 MovieClip Frame 1
stop();
Symbol 362 MovieClip Frame 2
stop();
Symbol 364 MovieClip Frame 1
function checkCollision(mc2, mc1, tolerance, scope) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
var scope = _parent;
var tolerance = 256;
var initPosX = (_parent.road_mc._x - this._x);
var initPosY = (_parent.road_mc._y - this._y);
onEnterFrame = function () {
this._x = _parent.road_mc._x - initPosX;
this._y = _parent.road_mc._y - initPosY;
if (this.hitTest(_parent.bike_mc.target_mc)) {
if ((checkCollision(this, _parent.bike_mc) != undefined) || (checkCollision(this, _parent.bike_mc) != null)) {
if (_parent.bike_mc.UD == -1) {
_parent.bike_mc.speed = 1;
var _local3 = "back";
} else if (_parent.bike_mc.UD == 1) {
_parent.bike_mc.speed = -1;
var _local3 = "front";
} else if (_parent.bike_mc.UD == 0) {
if (_local3 == "back") {
_parent.bike_mc.speed = 1;
_local3 == "front";
} else {
_parent.bike_mc.speed = -1;
_local3 == "back";
}
}
stopAllSounds();
_parent.bike_mc.hit = true;
_parent.bike_mc.target_mc.gotoAndStop(2);
onEnterFrame = null;
}
}
};
Symbol 366 MovieClip Frame 1
function checkCollision(mc2, mc1, tolerance, scope) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
var scope = _parent;
var tolerance = 256;
var initPosX = (_parent.road_mc._x - this._x);
var initPosY = (_parent.road_mc._y - this._y);
onEnterFrame = function () {
this._x = _parent.road_mc._x - initPosX;
this._y = _parent.road_mc._y - initPosY;
if (this.hitTest(_parent.bike_mc.target_mc)) {
if ((checkCollision(this, _parent.bike_mc) != undefined) || (checkCollision(this, _parent.bike_mc) != null)) {
if (_parent.bike_mc.UD == -1) {
_parent.bike_mc.speed = 1;
var _local3 = "back";
} else if (_parent.bike_mc.UD == 1) {
_parent.bike_mc.speed = -1;
var _local3 = "front";
} else if (_parent.bike_mc.UD == 0) {
if (_local3 == "back") {
_parent.bike_mc.speed = 1;
_local3 == "front";
} else {
_parent.bike_mc.speed = -1;
_local3 == "back";
}
}
stopAllSounds();
_parent.bike_mc.hit = true;
_parent.bike_mc.target_mc.gotoAndStop(2);
onEnterFrame = null;
}
}
};
Symbol 368 MovieClip Frame 1
function checkCollision(mc2, mc1, tolerance, scope) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
var scope = _parent;
var tolerance = 256;
var initPosX = (_parent.road_mc._x - this._x);
var initPosY = (_parent.road_mc._y - this._y);
onEnterFrame = function () {
this._x = _parent.road_mc._x - initPosX;
this._y = _parent.road_mc._y - initPosY;
if (this.hitTest(_parent.bike_mc.target_mc)) {
if ((checkCollision(this, _parent.bike_mc) != undefined) || (checkCollision(this, _parent.bike_mc) != null)) {
if (_parent.bike_mc.UD == -1) {
_parent.bike_mc.speed = 1;
var _local3 = "back";
} else if (_parent.bike_mc.UD == 1) {
_parent.bike_mc.speed = -1;
var _local3 = "front";
} else if (_parent.bike_mc.UD == 0) {
if (_local3 == "back") {
_parent.bike_mc.speed = 1;
_local3 == "front";
} else {
_parent.bike_mc.speed = -1;
_local3 == "back";
}
}
stopAllSounds();
_parent.bike_mc.hit = true;
_parent.bike_mc.target_mc.gotoAndStop(2);
onEnterFrame = null;
}
}
};
Symbol 370 MovieClip Frame 1
function checkCollision(mc2, mc1, tolerance, scope) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
var scope = _parent;
var tolerance = 256;
var initPosX = (_parent.road_mc._x - this._x);
var initPosY = (_parent.road_mc._y - this._y);
onEnterFrame = function () {
this._x = _parent.road_mc._x - initPosX;
this._y = _parent.road_mc._y - initPosY;
if (this.hitTest(_parent.bike_mc.target_mc)) {
if ((checkCollision(this, _parent.bike_mc) != undefined) || (checkCollision(this, _parent.bike_mc) != null)) {
if (_parent.bike_mc.UD == -1) {
_parent.bike_mc.speed = 1;
var _local3 = "back";
} else if (_parent.bike_mc.UD == 1) {
_parent.bike_mc.speed = -1;
var _local3 = "front";
} else if (_parent.bike_mc.UD == 0) {
if (_local3 == "back") {
_parent.bike_mc.speed = 1;
_local3 == "front";
} else {
_parent.bike_mc.speed = -1;
_local3 == "back";
}
}
stopAllSounds();
_parent.bike_mc.hit = true;
_parent.bike_mc.target_mc.gotoAndStop(2);
onEnterFrame = null;
}
}
};
Symbol 371 MovieClip Frame 1
stop();
Symbol 371 MovieClip Frame 2
stop();
Symbol 374 MovieClip Frame 1
function checkCollision(mc2, mc1, tolerance, scope) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
var scope = _parent;
var tolerance = 256;
var initPosX = (_parent.road_mc._x - this._x);
var initPosY = (_parent.road_mc._y - this._y);
onEnterFrame = function () {
this._x = _parent.road_mc._x - initPosX;
this._y = _parent.road_mc._y - initPosY;
if (this.hitTest(_parent.bike_mc.target_mc)) {
if ((checkCollision(this, _parent.bike_mc) != undefined) || (checkCollision(this, _parent.bike_mc) != null)) {
if (_parent.bike_mc.UD == -1) {
_parent.bike_mc.speed = 1;
var _local3 = "back";
} else if (_parent.bike_mc.UD == 1) {
_parent.bike_mc.speed = -1;
var _local3 = "front";
} else if (_parent.bike_mc.UD == 0) {
if (_local3 == "back") {
_parent.bike_mc.speed = 1;
_local3 == "front";
} else {
_parent.bike_mc.speed = -1;
_local3 == "back";
}
}
stopAllSounds();
_parent.bike_mc.hit = true;
_parent.bike_mc.target_mc.gotoAndStop(2);
onEnterFrame = null;
}
}
};
Symbol 376 MovieClip Frame 1
function checkCollision(mc2, mc1, tolerance, scope) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
var scope = _parent;
var tolerance = 256;
var initPosX = (_parent.road_mc._x - this._x);
var initPosY = (_parent.road_mc._y - this._y);
onEnterFrame = function () {
this._x = _parent.road_mc._x - initPosX;
this._y = _parent.road_mc._y - initPosY;
if (this.hitTest(_parent.bike_mc.target_mc)) {
if ((checkCollision(this, _parent.bike_mc) != undefined) || (checkCollision(this, _parent.bike_mc) != null)) {
if (_parent.bike_mc.UD == -1) {
_parent.bike_mc.speed = 1;
var _local3 = "back";
} else if (_parent.bike_mc.UD == 1) {
_parent.bike_mc.speed = -1;
var _local3 = "front";
} else if (_parent.bike_mc.UD == 0) {
if (_local3 == "back") {
_parent.bike_mc.speed = 1;
_local3 == "front";
} else {
_parent.bike_mc.speed = -1;
_local3 == "back";
}
}
stopAllSounds();
_parent.bike_mc.hit = true;
_parent.bike_mc.target_mc.gotoAndStop(2);
onEnterFrame = null;
}
}
};
Symbol 377 MovieClip Frame 1
function adjust(v, threshold, maximum) {
vx = 0;
if (v <= threshold) {
vx = (v / threshold) * 1;
} else {
vx = 1;
}
return(vx);
}
function move() {
this._rotation = (angle * 180) / 3.141593;
UD = Key.isDown(38) - Key.isDown(40);
LR = (Key.isDown(39) - Key.isDown(37)) / 2;
HAND = Key.isDown(32);
if (LR) {
angle = angle + (((LR * UD) * steer) * adjust(Math.abs(speed), steer_threshold, MAXSpd));
} else {
turnskidding = false;
}
if (!UD) {
speed = speed * drift;
} else if (UD & (!HAND)) {
speed = Math.min(Math.max(speed + (UD * accel), MINspd), MAXspd);
}
if (Math.abs(speed) < (accel / 2)) {
speed = 0;
}
if (HAND) {
speed = speed * handbrake;
if (speed == 0) {
var _local4 = new Object();
_local4.x = this._x;
_local4.y = this._y;
_parent.localToGlobal(_local4);
blights = _root.attachMovie("breaklite", "breaklite", 100);
blights._x = _local4.x;
blights._y = _local4.y;
blights._rotation = this._rotation;
}
if (speed > MAXskiddisplay) {
steer = steer_handbrake;
}
traction = handbrake_traction / surface;
} else {
blights.removeMovieClip();
skidding = false;
traction = Math.max(traction_max, Math.abs((speed - MAXturnSpd) / surface));
steer = steer_normal;
}
if (speed <= 0) {
traction = 1;
}
this._y = this._y + ((vector[1] = vector[1] + (((Math.sin(angle) * speed) - vector[1]) / traction)));
if (_parent.road_mc._x >= 490.05) {
dir = "right";
}
if (_parent.road_mc._x <= -480.05) {
dir = "left";
}
if (dir == "left") {
if (this._x > 0) {
this._x = this._x + ((vector[0] = vector[0] + (((Math.cos(angle) * speed) - vector[0]) / traction)));
} else {
_parent.road_mc._x = _parent.road_mc._x - ((vector[0] = vector[0] + (((Math.cos(angle) * speed) - vector[0]) / traction)));
}
} else if (dir == "right") {
if (this._x < 0) {
this._x = this._x + ((vector[0] = vector[0] + (((Math.cos(angle) * speed) - vector[0]) / traction)));
} else {
_parent.road_mc._x = _parent.road_mc._x - ((vector[0] = vector[0] + (((Math.cos(angle) * speed) - vector[0]) / traction)));
}
}
}
var blights;
gotoAndStop(_root.playerId);
var accel = 0.3;
var steer = 0.04;
var steer_normal = 0.08;
var steer_handbrake = 0.099;
var steer_threshold = 4;
var MINspd = -5;
var MAXspd = 15;
var MAXskiddisplay = 2;
var MAXturnSpd = 10;
var MaxTurnSkid = 18;
var deccel = 0.92;
var handbrake = 0.33;
var handbrake_traction = 20;
var drift = 0.58;
var speed = 0;
var surface = 3;
var traction = 2;
var traction_max = 1;
var vector = [0, 0];
var angle = ((this._rotation / 180) * 3.141593);
var skidding = false;
var turnskidding = false;
var hit = false;
var dir = "right";
var roadXpos2 = _parent.road_mc._x;
var roadXpos1 = (_parent.road_mc._x + (_parent.road_mc._width / 2));
var roadYpos2 = _parent.road_mc._y;
var roadYpos1 = ((_parent.road_mc._y + (_parent.road_mc._height / 2)) - 60);
onEnterFrame = function () {
if (hit != true) {
move();
}
};
stop();
Symbol 377 MovieClip Frame 2
stop();
Symbol 377 MovieClip Frame 3
stop();
Symbol 377 MovieClip Frame 4
stop();
Symbol 378 MovieClip Frame 1
stop();
Symbol 378 MovieClip Frame 2
stop();
Symbol 379 MovieClip Frame 1
stop();
Symbol 379 MovieClip Frame 2
stop();
Symbol 382 MovieClip Frame 1
var initPosX = (_parent.road_mc._x - this._x);
var initPosY = (_parent.road_mc._y - this._y);
var go = true;
onEnterFrame = function () {
this._x = _parent.road_mc._x - initPosX;
this._y = _parent.road_mc._y - initPosY;
if (this.hitTest(_parent.bike_mc) && (go)) {
_parent.movCar_mc.gotoAndPlay(2);
go = false;
}
};
Symbol 384 MovieClip Frame 1
function checkCollision(mc2, mc1, tolerance, scope) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
var scope = _parent;
var tolerance = 256;
var initPosX = (_parent.road_mc._x - this._x);
var initPosY = (_parent.road_mc._y - this._y);
onEnterFrame = function () {
this._x = _parent.road_mc._x - initPosX;
this._y = _parent.road_mc._y - initPosY;
if (this.hitTest(_parent.bike_mc.target_mc)) {
if ((checkCollision(this, _parent.bike_mc) != undefined) || (checkCollision(this, _parent.bike_mc) != null)) {
if (_parent.bike_mc.UD == -1) {
_parent.bike_mc.speed = 1;
var _local3 = "back";
} else if (_parent.bike_mc.UD == 1) {
_parent.bike_mc.speed = -1;
var _local3 = "front";
} else if (_parent.bike_mc.UD == 0) {
if (_local3 == "back") {
_parent.bike_mc.speed = 1;
_local3 == "front";
} else {
_parent.bike_mc.speed = -1;
_local3 == "back";
}
}
stopAllSounds();
_parent.bike_mc.hit = true;
_parent.bike_mc.target_mc.gotoAndStop(2);
onEnterFrame = null;
}
}
};
Symbol 385 MovieClip Frame 1
function checkCollision(mc2, mc1, tolerance, scope) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
var scope = _parent;
var tolerance = 256;
var initPosX = (_parent.road_mc._x - this._x);
var initPosY = (_parent.road_mc._y - this._y);
onEnterFrame = function () {
this._x = _parent.road_mc._x - initPosX;
this._y = _parent.road_mc._y - initPosY;
if (this.hitTest(_parent.bike_mc.target_mc)) {
if ((checkCollision(this, _parent.bike_mc) != undefined) || (checkCollision(this, _parent.bike_mc) != null)) {
if (_parent.bike_mc.UD == -1) {
_parent.bike_mc.speed = 1;
var _local3 = "back";
} else if (_parent.bike_mc.UD == 1) {
_parent.bike_mc.speed = -1;
var _local3 = "front";
} else if (_parent.bike_mc.UD == 0) {
if (_local3 == "back") {
_parent.bike_mc.speed = 1;
_local3 == "front";
} else {
_parent.bike_mc.speed = -1;
_local3 == "back";
}
}
stopAllSounds();
_parent.bike_mc.hit = true;
_parent.bike_mc.target_mc.gotoAndStop(2);
onEnterFrame = null;
}
}
};
stop();
Symbol 385 MovieClip Frame 52
stop();
Symbol 386 MovieClip Frame 1
stop();
Symbol 386 MovieClip Frame 2
stop();
Symbol 390 MovieClip Frame 1
function checkCollision(mc2, mc1, tolerance, scope) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
var scope = _parent;
var tolerance = 256;
var initPosX = (_parent.road_mc._x - this._x);
var initPosY = (_parent.road_mc._y - this._y);
onEnterFrame = function () {
this._x = _parent.road_mc._x - initPosX;
this._y = _parent.road_mc._y - initPosY;
if (this.hitTest(_parent.bike_mc.target_mc)) {
if ((checkCollision(this, _parent.bike_mc) != undefined) || (checkCollision(this, _parent.bike_mc) != null)) {
if (_parent.bike_mc.UD == -1) {
_parent.bike_mc.speed = 1;
var _local3 = "back";
} else if (_parent.bike_mc.UD == 1) {
_parent.bike_mc.speed = -1;
var _local3 = "front";
} else if (_parent.bike_mc.UD == 0) {
if (_local3 == "back") {
_parent.bike_mc.speed = 1;
_local3 == "front";
} else {
_parent.bike_mc.speed = -1;
_local3 == "back";
}
}
stopAllSounds();
_parent.bike_mc.hit = true;
_parent.bike_mc.target_mc.gotoAndStop(2);
onEnterFrame = null;
}
}
};
Symbol 401 MovieClip Frame 1
function checkCollision(mc2, mc1, tolerance, scope) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
var scope = _parent;
var tolerance = 256;
var initPosX = (_parent.road_mc._x - this._x);
var initPosY = (_parent.road_mc._y - this._y);
onEnterFrame = function () {
this._x = _parent.road_mc._x - initPosX;
this._y = _parent.road_mc._y - initPosY;
if (this.hitTest(_parent.bike_mc.target_mc)) {
if ((checkCollision(this, _parent.bike_mc) != undefined) || (checkCollision(this, _parent.bike_mc) != null)) {
if (_parent.bike_mc.UD == -1) {
_parent.bike_mc.speed = 1;
var _local3 = "back";
} else if (_parent.bike_mc.UD == 1) {
_parent.bike_mc.speed = -1;
var _local3 = "front";
} else if (_parent.bike_mc.UD == 0) {
if (_local3 == "back") {
_parent.bike_mc.speed = 1;
_local3 == "front";
} else {
_parent.bike_mc.speed = -1;
_local3 == "back";
}
}
stopAllSounds();
_parent.bike_mc.hit = true;
_parent.bike_mc.target_mc.gotoAndStop(2);
onEnterFrame = null;
}
}
};
Symbol 402 MovieClip Frame 1
function checkCollision(mc2, mc1, tolerance, scope) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
var scope = _parent;
var tolerance = 256;
var initPosX = (_parent.road_mc._x - this._x);
var initPosY = (_parent.road_mc._y - this._y);
onEnterFrame = function () {
this._x = _parent.road_mc._x - initPosX;
this._y = _parent.road_mc._y - initPosY;
if (this.hitTest(_parent.bike_mc.target_mc)) {
if ((checkCollision(this, _parent.bike_mc) != undefined) || (checkCollision(this, _parent.bike_mc) != null)) {
if (_parent.bike_mc.UD == -1) {
_parent.bike_mc.speed = 1;
var _local3 = "back";
} else if (_parent.bike_mc.UD == 1) {
_parent.bike_mc.speed = -1;
var _local3 = "front";
} else if (_parent.bike_mc.UD == 0) {
if (_local3 == "back") {
_parent.bike_mc.speed = 1;
_local3 == "front";
} else {
_parent.bike_mc.speed = -1;
_local3 == "back";
}
}
stopAllSounds();
_parent.bike_mc.hit = true;
_parent.bike_mc.target_mc.gotoAndStop(2);
onEnterFrame = null;
}
}
};
Symbol 403 MovieClip Frame 1
function adjust(v, threshold, maximum) {
vx = 0;
if (v <= threshold) {
vx = (v / threshold) * 1;
} else {
vx = 1;
}
return(vx);
}
function move() {
this._rotation = (angle * 180) / 3.141593;
UD = Key.isDown(38) - Key.isDown(40);
LR = (Key.isDown(39) - Key.isDown(37)) / 2;
HAND = Key.isDown(32);
if (LR) {
angle = angle + (((LR * UD) * steer) * adjust(Math.abs(speed), steer_threshold, MAXSpd));
} else {
turnskidding = false;
}
if (!UD) {
speed = speed * drift;
} else if (UD & (!HAND)) {
speed = Math.min(Math.max(speed + (UD * accel), MINspd), MAXspd);
}
if (Math.abs(speed) < (accel / 2)) {
speed = 0;
}
if (HAND) {
speed = speed * handbrake;
if (speed == 0) {
var _local4 = new Object();
_local4.x = this._x;
_local4.y = this._y;
_parent.localToGlobal(_local4);
blights = _root.attachMovie("breaklite", "breaklite", 100);
blights._x = _local4.x;
blights._y = _local4.y;
blights._rotation = this._rotation;
}
if (speed > MAXskiddisplay) {
steer = steer_handbrake;
}
traction = handbrake_traction / surface;
} else {
blights.removeMovieClip();
skidding = false;
traction = Math.max(traction_max, Math.abs((speed - MAXturnSpd) / surface));
steer = steer_normal;
}
if (speed <= 0) {
traction = 1;
}
this._x = this._x + ((vector[0] = vector[0] + (((Math.cos(angle) * speed) - vector[0]) / traction)));
if (_parent.road_mc._y >= roadYpos1) {
dir = "down";
} else if (_parent.road_mc._y <= roadYpos2) {
dir = "up";
}
if (dir == "up") {
if (this._y > 0) {
this._y = this._y + ((vector[1] = vector[1] + (((Math.sin(angle) * speed) - vector[1]) / traction)));
} else {
_parent.road_mc._y = _parent.road_mc._y - ((vector[1] = vector[1] + (((Math.sin(angle) * speed) - vector[1]) / traction)));
}
} else if (dir == "down") {
if (this._y < 0) {
this._y = this._y + ((vector[1] = vector[1] + (((Math.sin(angle) * speed) - vector[1]) / traction)));
} else {
_parent.road_mc._y = _parent.road_mc._y - ((vector[1] = vector[1] + (((Math.sin(angle) * speed) - vector[1]) / traction)));
}
}
}
var blights;
gotoAndStop(_root.playerId);
var accel = 0.3;
var steer = 0.04;
var steer_normal = 0.08;
var steer_handbrake = 0.099;
var steer_threshold = 4;
var MINspd = -5;
var MAXspd = 15;
var MAXskiddisplay = 2;
var MAXturnSpd = 10;
var MaxTurnSkid = 18;
var deccel = 0.92;
var handbrake = 0.33;
var handbrake_traction = 20;
var drift = 0.58;
var speed = 0;
var surface = 3;
var traction = 2;
var traction_max = 1;
var vector = [0, 0];
var angle = ((this._rotation / 180) * 3.141593);
var skidding = false;
var turnskidding = false;
var hit = false;
var dir = "up";
var roadXpos2 = _parent.road_mc._x;
var roadXpos1 = ((_parent.road_mc._x + _parent.road_mc._width) + 20);
var roadYpos2 = _parent.road_mc._y;
var roadYpos1 = ((_parent.road_mc._y + (_parent.road_mc._height / 2)) - 200);
onEnterFrame = function () {
if (hit != true) {
move();
}
};
stop();
Symbol 403 MovieClip Frame 2
stop();
Symbol 403 MovieClip Frame 3
stop();
Symbol 403 MovieClip Frame 4
stop();
Symbol 404 MovieClip Frame 1
stop();
Symbol 404 MovieClip Frame 2
stop();
Symbol 405 MovieClip Frame 1
function checkCollision(mc2, mc1, tolerance, scope) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
var scope = _parent;
var tolerance = 256;
var initPosX = (_parent.road_mc._x - this._x);
var initPosY = (_parent.road_mc._y - this._y);
onEnterFrame = function () {
this._x = _parent.road_mc._x - initPosX;
this._y = _parent.road_mc._y - initPosY;
if (this.hitTest(_parent.bike_mc.target_mc)) {
if ((checkCollision(this, _parent.bike_mc) != undefined) || (checkCollision(this, _parent.bike_mc) != null)) {
if (_parent.bike_mc.UD == -1) {
_parent.bike_mc.speed = 1;
var _local3 = "back";
} else if (_parent.bike_mc.UD == 1) {
_parent.bike_mc.speed = -1;
var _local3 = "front";
} else if (_parent.bike_mc.UD == 0) {
if (_local3 == "back") {
_parent.bike_mc.speed = 1;
_local3 == "front";
} else {
_parent.bike_mc.speed = -1;
_local3 == "back";
}
}
stopAllSounds();
_parent.bike_mc.hit = true;
_parent.bike_mc.target_mc.gotoAndStop(2);
onEnterFrame = null;
}
}
};
Symbol 406 MovieClip Frame 1
function checkCollision(mc2, mc1, tolerance, scope) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
var scope = _parent;
var tolerance = 256;
var initPosX = (_parent.road_mc._x - this._x);
var initPosY = (_parent.road_mc._y - this._y);
onEnterFrame = function () {
this._x = _parent.road_mc._x - initPosX;
this._y = _parent.road_mc._y - initPosY;
if (this.hitTest(_parent.bike_mc.target_mc)) {
if ((checkCollision(this, _parent.bike_mc) != undefined) || (checkCollision(this, _parent.bike_mc) != null)) {
if (_parent.bike_mc.UD == -1) {
_parent.bike_mc.speed = 1;
var _local3 = "back";
} else if (_parent.bike_mc.UD == 1) {
_parent.bike_mc.speed = -1;
var _local3 = "front";
} else if (_parent.bike_mc.UD == 0) {
if (_local3 == "back") {
_parent.bike_mc.speed = 1;
_local3 == "front";
} else {
_parent.bike_mc.speed = -1;
_local3 == "back";
}
}
stopAllSounds();
_parent.bike_mc.hit = true;
_parent.bike_mc.target_mc.gotoAndStop(2);
onEnterFrame = null;
}
}
};
Symbol 407 MovieClip Frame 1
stop();
Symbol 407 MovieClip Frame 2
stop();
Symbol 412 MovieClip Frame 1
function checkCollision(mc2, mc1, tolerance, scope) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
var scope = _parent;
var tolerance = 256;
var initPosX = (_parent.road_mc._x - this._x);
var initPosY = (_parent.road_mc._y - this._y);
onEnterFrame = function () {
this._x = _parent.road_mc._x - initPosX;
this._y = _parent.road_mc._y - initPosY;
if (this.hitTest(_parent.bike_mc.target_mc)) {
if ((checkCollision(this, _parent.bike_mc) != undefined) || (checkCollision(this, _parent.bike_mc) != null)) {
if (_parent.bike_mc.UD == -1) {
_parent.bike_mc.speed = 1;
var _local3 = "back";
} else if (_parent.bike_mc.UD == 1) {
_parent.bike_mc.speed = -1;
var _local3 = "front";
} else if (_parent.bike_mc.UD == 0) {
if (_local3 == "back") {
_parent.bike_mc.speed = 1;
_local3 == "front";
} else {
_parent.bike_mc.speed = -1;
_local3 == "back";
}
}
stopAllSounds();
_parent.bike_mc.hit = true;
_parent.bike_mc.target_mc.gotoAndStop(2);
onEnterFrame = null;
}
}
};
Symbol 413 MovieClip Frame 1
function adjust(v, threshold, maximum) {
vx = 0;
if (v <= threshold) {
vx = (v / threshold) * 1;
} else {
vx = 1;
}
return(vx);
}
function move() {
this._rotation = (angle * 180) / 3.141593;
UD = Key.isDown(38) - Key.isDown(40);
LR = (Key.isDown(39) - Key.isDown(37)) / 2;
HAND = Key.isDown(32);
if (LR) {
angle = angle + (((LR * UD) * steer) * adjust(Math.abs(speed), steer_threshold, MAXSpd));
} else {
turnskidding = false;
}
if (!UD) {
speed = speed * drift;
} else if (UD & (!HAND)) {
speed = Math.min(Math.max(speed + (UD * accel), MINspd), MAXspd);
}
if (Math.abs(speed) < (accel / 2)) {
speed = 0;
}
if (HAND) {
speed = speed * handbrake;
if (speed == 0) {
var _local4 = new Object();
_local4.x = this._x;
_local4.y = this._y;
_parent.localToGlobal(_local4);
blights = _root.attachMovie("breaklite", "breaklite", 100);
blights._x = _local4.x;
blights._y = _local4.y;
blights._rotation = this._rotation;
}
if (speed > MAXskiddisplay) {
steer = steer_handbrake;
}
traction = handbrake_traction / surface;
} else {
blights.removeMovieClip();
skidding = false;
traction = Math.max(traction_max, Math.abs((speed - MAXturnSpd) / surface));
steer = steer_normal;
}
if (speed <= 0) {
traction = 1;
}
this._x = this._x + ((vector[0] = vector[0] + (((Math.cos(angle) * speed) - vector[0]) / traction)));
this._y = this._y + ((vector[1] = vector[1] + (((Math.sin(angle) * speed) - vector[1]) / traction)));
}
var blights;
gotoAndStop(_root.playerId);
var accel = 0.3;
var steer = 0.04;
var steer_normal = 0.08;
var steer_handbrake = 0.099;
var steer_threshold = 4;
var MINspd = -5;
var MAXspd = 15;
var MAXskiddisplay = 2;
var MAXturnSpd = 10;
var MaxTurnSkid = 18;
var deccel = 0.92;
var handbrake = 0.33;
var handbrake_traction = 20;
var drift = 0.58;
var speed = 0;
var surface = 3;
var traction = 2;
var traction_max = 1;
var vector = [0, 0];
var angle = ((this._rotation / 180) * 3.141593);
var skidding = false;
var turnskidding = false;
var hit = false;
var dir = "up";
var roadXpos2 = _parent.road_mc._x;
var roadXpos1 = ((_parent.road_mc._x + _parent.road_mc._width) + 20);
var roadYpos2 = _parent.road_mc._y;
var roadYpos1 = ((_parent.road_mc._y + (_parent.road_mc._height / 2)) - 60);
onEnterFrame = function () {
if (hit != true) {
move();
}
};
stop();
Symbol 413 MovieClip Frame 2
stop();
Symbol 413 MovieClip Frame 3
stop();
Symbol 413 MovieClip Frame 4
stop();
Symbol 414 MovieClip Frame 1
stop();
Symbol 414 MovieClip Frame 2
stop();
Symbol 415 MovieClip Frame 1
function checkCollision(mc2, mc1, tolerance, scope) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
var scope = _parent;
var tolerance = 256;
var initPosX = (_parent.road_mc._x - this._x);
var initPosY = (_parent.road_mc._y - this._y);
onEnterFrame = function () {
this._x = _parent.road_mc._x - initPosX;
this._y = _parent.road_mc._y - initPosY;
if (this.hitTest(_parent.bike_mc.target_mc)) {
if ((checkCollision(this, _parent.bike_mc) != undefined) || (checkCollision(this, _parent.bike_mc) != null)) {
if (_parent.bike_mc.UD == -1) {
_parent.bike_mc.speed = 1;
var _local3 = "back";
} else if (_parent.bike_mc.UD == 1) {
_parent.bike_mc.speed = -1;
var _local3 = "front";
} else if (_parent.bike_mc.UD == 0) {
if (_local3 == "back") {
_parent.bike_mc.speed = 1;
_local3 == "front";
} else {
_parent.bike_mc.speed = -1;
_local3 == "back";
}
}
stopAllSounds();
_parent.bike_mc.hit = true;
_parent.bike_mc.target_mc.gotoAndStop(2);
onEnterFrame = null;
}
}
};
Symbol 416 MovieClip Frame 1
stop();
Symbol 416 MovieClip Frame 2
stop();
Symbol 421 MovieClip Frame 90
_root.isOver = true;
stopAllSounds();
_parent.nextFrame();
Symbol 456 Button
on (release) {
credit.gotoAndPlay(2);
}
Symbol 459 Button
on (release) {
_root.swHighScoreObject.showTab = "submit";
docount = true;
loadMovieNum (_root.HSHubURL, 2);
}
Symbol 462 Button
on (release) {
stopAllSounds();
_root.swHighScoreObject.showTab = "view";
docount = true;
loadMovieNum (_root.HSHubURL, 2);
}
Symbol 464 MovieClip Frame 1
if (_root.isOver) {
gotoAndPlay (6);
}
Symbol 464 MovieClip Frame 5
stop();
next_btn.onRelease = function () {
gotoAndPlay (6);
};
Symbol 464 MovieClip Frame 9
stop();
Selection.setFocus("username_txt");
username_txt.onSetFocus = function () {
if (username_txt.text == "Invalid Nickname!") {
username_txt.text = "";
}
};
playAgain_btn.onRelease = function () {
mystr1 = "playerId|" + _root.playerId;
_root.score = 0;
var _local3 = _root.levelArray[int(_root.level - 1)];
_parent._playAgain(_root, _local3, mystr1);
};
submit_btn.onRelease = function () {
_root.dataSubmit(_root.uname, _root.score, _root._gameid, _parent, "gameOver", "connecting", "highScores");
};
Instance of Symbol 463 MovieClip in Symbol 464 MovieClip Frame 9
onClipEvent (load) {
docount = false;
}
onClipEvent (enterFrame) {
if (docount) {
trycount++;
if ((_level2.getBytesTotal() == -1) && (trycount > 60)) {
docount = false;
trycount = 0;
}
}
}