Section 1
//Bounce (fl.transitions.easing.Bounce)
package fl.transitions.easing {
public class Bounce {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
if (_arg1 < (1 / 2.75)){
return (((_arg3 * ((7.5625 * _arg1) * _arg1)) + _arg2));
};
if (_arg1 < (2 / 2.75)){
_arg1 = (_arg1 - (1.5 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2));
};
if (_arg1 < (2.5 / 2.75)){
_arg1 = (_arg1 - (2.25 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2));
};
_arg1 = (_arg1 - (2.625 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 - easeOut((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (((easeIn((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((easeOut(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
}
}//package fl.transitions.easing
Section 2
//Strong (fl.transitions.easing.Strong)
package fl.transitions.easing {
public class Strong {
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
}
}//package fl.transitions.easing
Section 3
//Tween (fl.transitions.Tween)
package fl.transitions {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class Tween extends EventDispatcher {
public var isPlaying:Boolean;// = false
public var obj:Object;// = null
public var prop:String;// = ""
public var func:Function;
public var begin:Number;// = NAN
public var change:Number;// = NAN
public var useSeconds:Boolean;// = false
public var prevTime:Number;// = NAN
public var prevPos:Number;// = NAN
public var looping:Boolean;// = false
private var _duration:Number;// = NAN
private var _time:Number;// = NAN
private var _fps:Number;// = NAN
private var _position:Number;// = NAN
private var _startTime:Number;// = NAN
private var _intervalID:uint;// = 0
private var _finish:Number;// = NAN
private var _timer:Timer;// = null
protected static var _mc:MovieClip = new MovieClip();
public function Tween(_arg1:Object, _arg2:String, _arg3:Function, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean=false){
this.func = function (_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
};
super();
if (!arguments.length){
return;
};
this.obj = _arg1;
this.prop = _arg2;
this.begin = _arg4;
this.position = _arg4;
this.duration = _arg6;
this.useSeconds = _arg7;
if ((_arg3 is Function)){
this.func = _arg3;
};
this.finish = _arg5;
this._timer = new Timer(100);
this.start();
}
public function get time():Number{
return (this._time);
}
public function set time(_arg1:Number):void{
this.prevTime = this._time;
if (_arg1 > this.duration){
if (this.looping){
this.rewind((_arg1 - this._duration));
this.update();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_LOOP, this._time, this._position));
} else {
if (this.useSeconds){
this._time = this._duration;
this.update();
};
this.stop();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_FINISH, this._time, this._position));
};
} else {
if (_arg1 < 0){
this.rewind();
this.update();
} else {
this._time = _arg1;
this.update();
};
};
}
public function get duration():Number{
return (this._duration);
}
public function set duration(_arg1:Number):void{
this._duration = ((_arg1)<=0) ? Infinity : _arg1;
}
public function get FPS():Number{
return (this._fps);
}
public function set FPS(_arg1:Number):void{
var _local2:Boolean = this.isPlaying;
this.stopEnterFrame();
this._fps = _arg1;
if (_local2){
this.startEnterFrame();
};
}
public function get position():Number{
return (this.getPosition(this._time));
}
public function set position(_arg1:Number):void{
this.setPosition(_arg1);
}
public function getPosition(_arg1:Number=NaN):Number{
if (isNaN(_arg1)){
_arg1 = this._time;
};
return (this.func(_arg1, this.begin, this.change, this._duration));
}
public function setPosition(_arg1:Number):void{
this.prevPos = this._position;
if (this.prop.length){
this.obj[this.prop] = (this._position = _arg1);
};
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_CHANGE, this._time, this._position));
}
public function get finish():Number{
return ((this.begin + this.change));
}
public function set finish(_arg1:Number):void{
this.change = (_arg1 - this.begin);
}
public function continueTo(_arg1:Number, _arg2:Number):void{
this.begin = this.position;
this.finish = _arg1;
if (!isNaN(_arg2)){
this.duration = _arg2;
};
this.start();
}
public function yoyo():void{
this.continueTo(this.begin, this.time);
}
protected function startEnterFrame():void{
var _local1:Number;
if (isNaN(this._fps)){
_mc.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, false, 0, true);
} else {
_local1 = (1000 / this._fps);
this._timer.delay = _local1;
this._timer.addEventListener(TimerEvent.TIMER, this.timerHandler, false, 0, true);
this._timer.start();
};
this.isPlaying = true;
}
protected function stopEnterFrame():void{
if (isNaN(this._fps)){
_mc.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
} else {
this._timer.stop();
};
this.isPlaying = false;
}
public function start():void{
this.rewind();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_START, this._time, this._position));
}
public function stop():void{
this.stopEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_STOP, this._time, this._position));
}
public function resume():void{
this.fixTime();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_RESUME, this._time, this._position));
}
public function rewind(_arg1:Number=0):void{
this._time = _arg1;
this.fixTime();
this.update();
}
public function fforward():void{
this.time = this._duration;
this.fixTime();
}
public function nextFrame():void{
if (this.useSeconds){
this.time = ((getTimer() - this._startTime) / 1000);
} else {
this.time = (this._time + 1);
};
}
protected function onEnterFrame(_arg1:Event):void{
this.nextFrame();
}
protected function timerHandler(_arg1:TimerEvent):void{
this.nextFrame();
_arg1.updateAfterEvent();
}
public function prevFrame():void{
if (!this.useSeconds){
this.time = (this._time - 1);
};
}
private function fixTime():void{
if (this.useSeconds){
this._startTime = (getTimer() - (this._time * 1000));
};
}
private function update():void{
this.setPosition(this.getPosition(this._time));
}
}
}//package fl.transitions
Section 4
//TweenEvent (fl.transitions.TweenEvent)
package fl.transitions {
import flash.events.*;
public class TweenEvent extends Event {
public var time:Number;// = NAN
public var position:Number;// = NAN
public static const MOTION_START:String = "motionStart";
public static const MOTION_STOP:String = "motionStop";
public static const MOTION_FINISH:String = "motionFinish";
public static const MOTION_CHANGE:String = "motionChange";
public static const MOTION_RESUME:String = "motionResume";
public static const MOTION_LOOP:String = "motionLoop";
public function TweenEvent(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Boolean=false){
super(_arg1, _arg4, _arg5);
this.time = _arg2;
this.position = _arg3;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.time, this.position, this.bubbles, this.cancelable));
}
}
}//package fl.transitions
Section 5
//AGteaser_mc_20 (ParkMyBigRig2_fla.AGteaser_mc_20)
package ParkMyBigRig2_fla {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import fl.transitions.*;
import fl.transitions.easing.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class AGteaser_mc_20 extends MovieClip {
public var outerloader:MovieClip;
public var progress_mc:MovieClip;
public var AGlogo_mc:MovieClip;
public var AGclick_btn:SimpleButton;
public var AGpresented_mc:MovieClip;
public var loadText:TextField;
public var AGskip_btn:SimpleButton;
public var smash:Smash;
public var timer:Timer;
public var p_in;
public var total:Number;
public var loaded:Number;
public var loadPerc:Number;
public var currentFrm:Number;
public var totalFrm:Number;
public var perTxt:Number;
public var percByt:Number;
public var animspeed:Number;
public function AGteaser_mc_20(){
addFrameScript(0, frame1, 1, frame2);
}
public function done(_arg1:Event){
timer.stop();
if (this.visible == true){
gotoAndStop(2);
};
}
public function logo(_arg1:TweenEvent){
var crunch:Function;
var logo_in:*;
var event = _arg1;
crunch = function (_arg1:TweenEvent){
smash.play();
if (AGclick_btn != null){
AGclick_btn.visible = true;
};
if (AGlogo_mc != null){
new Tween(AGlogo_mc, "y", Bounce.easeOut, 60, 85, 6, false);
new Tween(AGlogo_mc, "x", Bounce.easeOut, 30, 50, 6, false);
};
if (AGpresented_mc != null){
new Tween(AGpresented_mc, "y", Bounce.easeOut, 15, 25, 6, false);
new Tween(AGpresented_mc, "x", Bounce.easeOut, 110, 100, 6, false);
};
};
if (AGlogo_mc != null){
logo_in = new Tween(AGlogo_mc, "y", Strong.easeIn, -75, 85, 12, false);
logo_in.addEventListener(TweenEvent.MOTION_FINISH, crunch);
};
}
public function loadAG(_arg1:MouseEvent):void{
var event = _arg1;
var AGurl:URLRequest = new URLRequest("http://www.addictinggames.com");
try {
navigateToURL(AGurl, "_blank");
} catch(e:Error) {
};
}
public function onDisplayObjectsLoaded(_arg1){
stage.removeEventListener(Event.RENDER, onDisplayObjectsLoaded);
this.addEventListener(MouseEvent.CLICK, logoRelease);
this.addEventListener(Event.ENTER_FRAME, preLoader);
}
public function logoRelease(_arg1:MouseEvent){
}
public function preLoader(_arg1:Event):void{
total = loaderInfo.bytesTotal;
loaded = loaderInfo.bytesLoaded;
loadPerc = Math.floor(((loaded / total) * 100));
currentFrm = outerloader.innerloader.currentFrame;
totalFrm = outerloader.innerloader.totalFrames;
perTxt = Math.round(((currentFrm / totalFrm) * 100));
loadText.text = String(perTxt);
percByt = (loaded / total);
animspeed = Math.ceil((totalFrm * percByt));
if (animspeed > currentFrm){
outerloader.innerloader.play();
progress_mc.play();
} else {
outerloader.innerloader.stop();
progress_mc.stop();
};
if ((((perTxt >= 99)) && ((loadPerc >= 100)))){
this.removeEventListener(MouseEvent.CLICK, logoRelease);
removeEventListener(Event.ENTER_FRAME, preLoader);
if (this.visible == true){
MovieClip(root).removeChild(this);
};
};
}
function frame1(){
stop();
smash = new Smash();
AGpresented_mc.alpha = 0;
AGclick_btn.visible = false;
AGlogo_mc.y = -70;
timer = new Timer(4000);
timer.addEventListener(TimerEvent.TIMER, done);
timer.start();
if (AGpresented_mc != null){
p_in = new Tween(AGpresented_mc, "alpha", Strong.easeIn, 0, 100, 12, false);
p_in.addEventListener(TweenEvent.MOTION_FINISH, logo);
};
if (AGskip_btn != null){
AGskip_btn.addEventListener(MouseEvent.MOUSE_DOWN, done);
};
if (AGclick_btn != null){
AGclick_btn.addEventListener(MouseEvent.CLICK, loadAG);
};
}
function frame2(){
stop();
stage.invalidate();
stage.addEventListener(Event.RENDER, onDisplayObjectsLoaded);
total = 0;
loaded = 0;
loadPerc = 0;
currentFrm = 0;
totalFrm = 0;
perTxt = 0;
percByt = 0;
animspeed = 0;
}
}
}//package ParkMyBigRig2_fla
Section 6
//bg_220 (ParkMyBigRig2_fla.bg_220)
package ParkMyBigRig2_fla {
import flash.display.*;
public dynamic class bg_220 extends MovieClip {
public var scoreWindow:MovieClip;
public function bg_220(){
addFrameScript(41, frame42);
}
function frame42(){
stop();
}
}
}//package ParkMyBigRig2_fla
Section 7
//BUGload_26 (ParkMyBigRig2_fla.BUGload_26)
package ParkMyBigRig2_fla {
import flash.display.*;
public dynamic class BUGload_26 extends MovieClip {
public function BUGload_26(){
addFrameScript(74, frame75);
}
function frame75(){
}
}
}//package ParkMyBigRig2_fla
Section 8
//buttonGraphicsQuality_73 (ParkMyBigRig2_fla.buttonGraphicsQuality_73)
package ParkMyBigRig2_fla {
import flash.display.*;
public dynamic class buttonGraphicsQuality_73 extends MovieClip {
public function buttonGraphicsQuality_73(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package ParkMyBigRig2_fla
Section 9
//CONGRATSscroler_62 (ParkMyBigRig2_fla.CONGRATSscroler_62)
package ParkMyBigRig2_fla {
import flash.display.*;
public dynamic class CONGRATSscroler_62 extends MovieClip {
public function CONGRATSscroler_62(){
addFrameScript(0, frame1, 56, frame57);
}
function frame1(){
stop();
}
function frame57(){
gotoAndStop(1);
}
}
}//package ParkMyBigRig2_fla
Section 10
//CRASHEDANIMATION_64 (ParkMyBigRig2_fla.CRASHEDANIMATION_64)
package ParkMyBigRig2_fla {
import flash.display.*;
public dynamic class CRASHEDANIMATION_64 extends MovieClip {
public var crashedFinish:MovieClip;
public function CRASHEDANIMATION_64(){
addFrameScript(0, frame1, 47, frame48);
}
function frame1(){
stop();
}
function frame48(){
gotoAndStop(1);
}
}
}//package ParkMyBigRig2_fla
Section 11
//crasheddoubleTrailer_147 (ParkMyBigRig2_fla.crasheddoubleTrailer_147)
package ParkMyBigRig2_fla {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class crasheddoubleTrailer_147 extends MovieClip {
public var rigFront:MovieClip;
public var rigBack:MovieClip;
public function crasheddoubleTrailer_147(){
addFrameScript(0, frame1);
}
function frame1(){
rigFront.leftSmoke.visible = false;
rigFront.rightSmoke.visible = false;
}
}
}//package ParkMyBigRig2_fla
Section 12
//Game_goodjob_1_227 (ParkMyBigRig2_fla.Game_goodjob_1_227)
package ParkMyBigRig2_fla {
import flash.display.*;
public dynamic class Game_goodjob_1_227 extends MovieClip {
public function Game_goodjob_1_227(){
addFrameScript(40, frame41);
}
function frame41(){
stop();
}
}
}//package ParkMyBigRig2_fla
Section 13
//Game_goodjob_1asd_230 (ParkMyBigRig2_fla.Game_goodjob_1asd_230)
package ParkMyBigRig2_fla {
import flash.display.*;
public dynamic class Game_goodjob_1asd_230 extends MovieClip {
public function Game_goodjob_1asd_230(){
addFrameScript(40, frame41);
}
function frame41(){
stop();
}
}
}//package ParkMyBigRig2_fla
Section 14
//Game_goodjob_df_233 (ParkMyBigRig2_fla.Game_goodjob_df_233)
package ParkMyBigRig2_fla {
import flash.display.*;
public dynamic class Game_goodjob_df_233 extends MovieClip {
public function Game_goodjob_df_233(){
addFrameScript(40, frame41);
}
function frame41(){
stop();
}
}
}//package ParkMyBigRig2_fla
Section 15
//GAMEOVER_216 (ParkMyBigRig2_fla.GAMEOVER_216)
package ParkMyBigRig2_fla {
import flash.display.*;
public dynamic class GAMEOVER_216 extends MovieClip {
public function GAMEOVER_216(){
addFrameScript(31, frame32);
}
function frame32(){
stop();
}
}
}//package ParkMyBigRig2_fla
Section 16
//GAMEOVERSCREEN_215 (ParkMyBigRig2_fla.GAMEOVERSCREEN_215)
package ParkMyBigRig2_fla {
import flash.display.*;
public dynamic class GAMEOVERSCREEN_215 extends MovieClip {
public function GAMEOVERSCREEN_215(){
addFrameScript(35, frame36);
}
function frame36(){
stop();
}
}
}//package ParkMyBigRig2_fla
Section 17
//GAMEWON_224 (ParkMyBigRig2_fla.GAMEWON_224)
package ParkMyBigRig2_fla {
import flash.display.*;
public dynamic class GAMEWON_224 extends MovieClip {
public function GAMEWON_224(){
addFrameScript(40, frame41);
}
function frame41(){
stop();
}
}
}//package ParkMyBigRig2_fla
Section 18
//GAMEWONSCREEN_222 (ParkMyBigRig2_fla.GAMEWONSCREEN_222)
package ParkMyBigRig2_fla {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class GAMEWONSCREEN_222 extends MovieClip {
public var congratsMsg4:MovieClip;
public var congratsMsg3:MovieClip;
public var congratsMsg2:MovieClip;
public var congratsMsg1:MovieClip;
public var bonusText:MovieClip;
public var msg:Number;
public function GAMEWONSCREEN_222(){
addFrameScript(0, frame1, 10, frame11, 44, frame45);
}
function frame1(){
if (((((MovieClip(root).nextLevel % 5) == 0)) && ((MovieClip(root).remainingLife < 5)))){
MovieClip(root).remainingLife = (MovieClip(root).remainingLife + 1);
bonusText.visible = true;
} else {
bonusText.visible = false;
};
}
function frame11(){
msg = (Math.random() * 4);
if (msg > 3){
congratsMsg1.visible = true;
congratsMsg2.visible = false;
congratsMsg3.visible = false;
congratsMsg4.visible = false;
} else {
if (msg > 2){
congratsMsg1.visible = false;
congratsMsg2.visible = true;
congratsMsg3.visible = false;
congratsMsg4.visible = false;
} else {
if (msg > 1){
congratsMsg1.visible = false;
congratsMsg2.visible = false;
congratsMsg3.visible = true;
congratsMsg4.visible = false;
} else {
if (msg > 0){
congratsMsg1.visible = false;
congratsMsg2.visible = false;
congratsMsg3.visible = false;
congratsMsg4.visible = true;
};
};
};
};
}
function frame45(){
stop();
}
}
}//package ParkMyBigRig2_fla
Section 19
//HUB_72 (ParkMyBigRig2_fla.HUB_72)
package ParkMyBigRig2_fla {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class HUB_72 extends MovieClip {
public var life1:MovieClip;
public var life2:MovieClip;
public var life3:MovieClip;
public var life4:MovieClip;
public var life5:MovieClip;
public var btnAdjustQuality:MovieClip;
public var qualityFlag:Boolean;
public function HUB_72(){
addFrameScript(0, frame1);
}
public function changeQuality(_arg1:MouseEvent):void{
if (!MovieClip(root).muteFlag){
MovieClip(root).buttonSoundChannel = MovieClip(root).sound_Button.play(0, 1);
};
if (qualityFlag){
stage.quality = StageQuality.MEDIUM;
btnAdjustQuality.gotoAndStop(2);
qualityFlag = false;
} else {
stage.quality = StageQuality.HIGH;
btnAdjustQuality.gotoAndStop(1);
qualityFlag = true;
};
}
function frame1(){
MovieClip(root).statusBar.visible = true;
qualityFlag = undefined;
if (btnAdjustQuality.currentFrame == 1){
qualityFlag = true;
} else {
if (btnAdjustQuality.currentFrame == 2){
qualityFlag = false;
};
};
btnAdjustQuality.addEventListener(MouseEvent.MOUSE_DOWN, changeQuality);
}
}
}//package ParkMyBigRig2_fla
Section 20
//INSTRUCTIONSCREEN_34 (ParkMyBigRig2_fla.INSTRUCTIONSCREEN_34)
package ParkMyBigRig2_fla {
import flash.display.*;
public dynamic class INSTRUCTIONSCREEN_34 extends MovieClip {
public function INSTRUCTIONSCREEN_34(){
addFrameScript(38, frame39);
}
function frame39(){
stop();
}
}
}//package ParkMyBigRig2_fla
Section 21
//MainTimeline (ParkMyBigRig2_fla.MainTimeline)
package ParkMyBigRig2_fla {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var agButton_btn:SimpleButton;
public var crashedMsg:MovieClip;
public var topObject:MovieClip;
public var btnMute:MovieClip;
public var timeElapsedMsg:MovieClip;
public var statusBar:MovieClip;
public var lightArea1:MovieClip;
public var playGround:MovieClip;
public var congratsMsg:MovieClip;
public var teaser:MovieClip;
public var gameOverScreen:MovieClip;
public var training:MovieClip;
public var night:MovieClip;
public var txtLevel:TextField;
public var maskLayer:MovieClip;
public var playMask:MovieClip;
public var scoreWindow1:MovieClip;
public var maskLayer1:MovieClip;
public var lightArea:MovieClip;
public var txtTimeLeft:TextField;
public var teaserShown:Boolean;
public var muteFlag:Boolean;
public var mute1:SoundTransform;
public var volume11:SoundTransform;
public var sound_BG:m1;
public var trainingFinished:Boolean;
public var truckBGChannel:SoundChannel;
public var score:Number;
public var nextLevel:Number;
public var remainingLife:Number;
public var sound_Button:buttonSound;
public var buttonSoundChannel:SoundChannel;
public var bonusTextDisplay:Boolean;
public var btnPlay;
public var btnInstructions;
public var btnPMBR1;
public var btniParkIt2;
public var btnBack;
public var sound_BG_onPlay:m7;
public var truckBGOnPlayChannel:SoundChannel;
public var timer1;
public var timer2;
public var btnPlayAgain;
public var btnContinue;
public var btnTryAgain;
public function MainTimeline(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11, 11, frame12, 12, frame13, 13, frame14, 14, frame15, 15, frame16, 16, frame17, 17, frame18, 18, frame19, 19, frame20, 20, frame21, 21, frame22, 22, frame23, 23, frame24, 24, frame25, 25, frame26, 26, frame27, 27, frame28, 28, frame29, 29, frame30);
}
public function muteSound(_arg1:MouseEvent):void{
MovieClip(root).buttonSoundChannel = MovieClip(root).sound_Button.play(0, 1);
if (truckBGOnPlayChannel != null){
if (muteFlag){
btnMute.gotoAndStop(1);
muteFlag = false;
truckBGOnPlayChannel.soundTransform = volume11;
} else {
btnMute.gotoAndStop(2);
muteFlag = true;
truckBGOnPlayChannel.soundTransform = mute1;
};
};
if (truckBGChannel != null){
if (muteFlag){
btnMute.gotoAndStop(1);
muteFlag = false;
truckBGChannel.soundTransform = volume11;
} else {
btnMute.gotoAndStop(2);
muteFlag = true;
truckBGChannel.soundTransform = mute1;
};
};
}
public function playIntroSoundAgain(_arg1:Event):void{
truckBGChannel.removeEventListener(Event.SOUND_COMPLETE, playIntroSoundAgain);
truckBGChannel = sound_BG.play(0, 100);
if (MovieClip(root).muteFlag){
truckBGChannel.soundTransform = mute1;
} else {
truckBGChannel.soundTransform = volume11;
};
truckBGChannel.addEventListener(Event.SOUND_COMPLETE, playIntroSoundAgain);
}
public function playGame(_arg1:MouseEvent):void{
if (!muteFlag){
buttonSoundChannel = sound_Button.play(0, 1);
};
if (truckBGChannel != null){
truckBGChannel.stop();
truckBGChannel = null;
};
gotoAndStop(3);
clearEventListeners();
}
public function instructions(_arg1:MouseEvent):void{
if (!muteFlag){
buttonSoundChannel = sound_Button.play(0, 1);
};
gotoAndStop(2);
clearEventListeners();
}
public function clearEventListeners():void{
stage.removeEventListener(MouseEvent.MOUSE_DOWN, playGame);
stage.removeEventListener(MouseEvent.CLICK, instructions);
stage.removeEventListener(MouseEvent.CLICK, gotoPMBR1);
}
public function gotoPMBR1(_arg1:MouseEvent):void{
var e = _arg1;
if (!muteFlag){
buttonSoundChannel = sound_Button.play(0, 1);
};
var PMBR1url:URLRequest = new URLRequest("http://www.addictinggames.com/park_my_big_rig.html");
try {
navigateToURL(PMBR1url, "_blank");
} catch(e:Error) {
};
}
public function gotoiParkIt2(_arg1:MouseEvent):void{
var e = _arg1;
if (!muteFlag){
buttonSoundChannel = sound_Button.play(0, 1);
};
var iParkit2url:URLRequest = new URLRequest("http://itunes.apple.com/us/app/id374275580?mt=8");
try {
navigateToURL(iParkit2url, "_blank");
} catch(e:Error) {
};
}
public function gotoHome(_arg1:MouseEvent):void{
if (!muteFlag){
buttonSoundChannel = sound_Button.play(0, 1);
};
gotoAndStop(1);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, gotoHome1);
stage.removeEventListener(MouseEvent.CLICK, gotoHome);
}
public function gotoHome1(_arg1:KeyboardEvent):void{
if (!muteFlag){
buttonSoundChannel = sound_Button.play(0, 1);
};
gotoAndStop(1);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, gotoHome1);
stage.removeEventListener(MouseEvent.CLICK, gotoHome);
}
public function playSoundAgain(_arg1:Event):void{
truckBGOnPlayChannel.removeEventListener(Event.SOUND_COMPLETE, playSoundAgain);
truckBGOnPlayChannel = sound_BG_onPlay.play(0, 100);
if (MovieClip(root).muteFlag){
truckBGOnPlayChannel.soundTransform = mute1;
} else {
truckBGOnPlayChannel.soundTransform = volume11;
};
truckBGOnPlayChannel.addEventListener(Event.SOUND_COMPLETE, playSoundAgain);
}
public function startGame_level2():void{
MovieClip(root).training.textText.trainingText.text = "Use WASD or Arrow keys to drive the truck... Drive and park in the flashing Park Area...";
MovieClip(root).training.visible = true;
MovieClip(root).training.gotoAndPlay(1);
var _local1:mainTruck = new boxVan();
_local1.name = "veh1";
addChild(_local1);
_local1.mainTruckX = 600;
_local1.mainTruckY = 150;
_local1.mainTruckRotation = 180;
_local1.RIG1_LENGTH = 125;
_local1.x = 600;
_local1.y = 150;
_local1.rotation = 180;
_local1.obstacleCount = 2;
_local1.movCarCount = 0;
_local1.gutterCount = 2;
_local1.nightMode = false;
_local1.initialize();
var _local2:* = 1;
while (_local2 <= _local1.movCarCount) {
root["playGround"][("movingCar" + _local2)].gotoAndPlay(1);
if (_local1.nightMode){
root["playMask"][("movingCar" + _local2)].gotoAndPlay(1);
};
_local2++;
};
}
public function startGame_level3():void{
MovieClip(root).training.textText.trainingText.text = "A Dump Truck??? Oh, it's empty!!! Should be easy to drive...";
MovieClip(root).training.visible = true;
MovieClip(root).training.gotoAndPlay(1);
var _local1:mainTruck = new dumpTruck();
addChild(_local1);
_local1.mainTruckX = 600;
_local1.mainTruckY = 500;
_local1.mainTruckRotation = 0;
_local1.RIG1_LENGTH = 125;
_local1.x = 600;
_local1.y = 500;
_local1.rotation = 0;
_local1.obstacleCount = 1;
_local1.movCarCount = 0;
_local1.gutterCount = 0;
_local1.nightMode = false;
_local1.initialize();
var _local2:* = 1;
while (_local2 <= _local1.movCarCount) {
root["playGround"][("movingCar" + _local2)].gotoAndPlay(1);
if (_local1.nightMode){
root["playMask"][("movingCar" + _local2)].gotoAndPlay(1);
};
_local2++;
};
}
public function startGame_level4():void{
MovieClip(root).training.textText.trainingText.text = "Deliver the Monster Truck... Drive and park in the flashing park Area...";
MovieClip(root).training.visible = true;
MovieClip(root).training.gotoAndPlay(1);
var _local1:monster = new monster();
addChild(_local1);
_local1.mainTruckX = 400;
_local1.mainTruckY = 120;
_local1.mainTruckRotation = 90;
_local1.RIG1_LENGTH = 125;
_local1.x = 400;
_local1.y = 120;
_local1.rotation = 90;
_local1.obstacleCount = 1;
_local1.movCarCount = 0;
_local1.gutterCount = 0;
_local1.nightMode = false;
_local1.initialize();
var _local2:* = 1;
while (_local2 <= _local1.movCarCount) {
root["playGround"][("movingCar" + _local2)].gotoAndPlay(1);
if (_local1.nightMode){
root["playMask"][("movingCar" + _local2)].gotoAndPlay(1);
};
_local2++;
};
}
public function startGame_level1():void{
MovieClip(root).training.textText.trainingText.text = "Here Comes the real challenge... Drive and park this beautiful Biggie!!!";
MovieClip(root).training.visible = true;
MovieClip(root).training.gotoAndPlay(1);
var _local1:Rig = new cementMixer();
addChild(_local1);
_local1.mainTruckX = 100;
_local1.mainTruckY = 250;
_local1.mainTruckRotation = 90;
_local1.RIG1_LENGTH = 123;
_local1.x = 100;
_local1.y = 250;
_local1.rotation = 90;
_local1.obstacleCount = 2;
_local1.movCarCount = 0;
_local1.gutterCount = 0;
_local1.nightMode = false;
_local1.initialize();
var _local2:* = 1;
while (_local2 <= _local1.movCarCount) {
root["playGround"][("movingCar" + _local2)].gotoAndPlay(1);
if (_local1.nightMode){
root["playMask"][("movingCar" + _local2)].gotoAndPlay(1);
};
_local2++;
};
}
public function startGame_level5():void{
MovieClip(root).training.textText.trainingText.text = "Fire!!! A fire alarm has just went off... Rush!!!";
MovieClip(root).training.visible = true;
MovieClip(root).training.gotoAndPlay(1);
var _local1:mainTruck = new fireTruck();
addChild(_local1);
_local1.mainTruckX = 720;
_local1.mainTruckY = 420;
_local1.mainTruckRotation = 0;
_local1.RIG1_LENGTH = 125;
_local1.x = 720;
_local1.y = 420;
_local1.rotation = 0;
_local1.obstacleCount = 1;
_local1.movCarCount = 0;
_local1.gutterCount = 1;
_local1.nightMode = false;
_local1.isFireTruck = true;
_local1.initialize();
var _local2:* = 1;
while (_local2 <= _local1.movCarCount) {
root["playGround"][("movingCar" + _local2)].gotoAndPlay(1);
if (_local1.nightMode){
root["playMask"][("movingCar" + _local2)].gotoAndPlay(1);
};
_local2++;
};
}
public function startGame_level7():void{
MovieClip(root).training.textText.trainingText.text = "Avoid other vehicles and park the rig... Let's see, whether you are patient enough to be a good driver...";
MovieClip(root).training.visible = true;
MovieClip(root).training.gotoAndPlay(1);
var _local1:Rig = new cementMixer();
addChild(_local1);
_local1.mainTruckX = 200;
_local1.mainTruckY = 300;
_local1.mainTruckRotation = 0;
_local1.RIG1_LENGTH = 123;
_local1.x = 200;
_local1.y = 300;
_local1.rotation = 0;
_local1.obstacleCount = 1;
_local1.movCarCount = 1;
_local1.gutterCount = 0;
_local1.nightMode = false;
_local1.scrollable = true;
_local1.initialize();
var _local2:* = 1;
while (_local2 <= _local1.movCarCount) {
root["playGround"][("movingCar" + _local2)].gotoAndPlay(1);
if (_local1.nightMode){
root["playMask"][("movingCar" + _local2)].gotoAndPlay(1);
};
_local2++;
};
}
public function startGame_level10():void{
MovieClip(root).training.textText.trainingText.text = "Park this Monster... Let's see whether you have what's needed!!!";
MovieClip(root).training.visible = true;
MovieClip(root).training.gotoAndPlay(1);
var _local1:monster = new monster();
addChild(_local1);
_local1.mainTruckX = 530;
_local1.mainTruckY = 250;
_local1.mainTruckRotation = 270;
_local1.RIG1_LENGTH = 125;
_local1.x = 530;
_local1.y = 250;
_local1.rotation = 270;
_local1.obstacleCount = 1;
_local1.movCarCount = 1;
_local1.gutterCount = 0;
_local1.nightMode = false;
_local1.scrollable = true;
_local1.initialize();
var _local2:* = 1;
while (_local2 <= _local1.movCarCount) {
root["playGround"][("movingCar" + _local2)].gotoAndPlay(1);
if (_local1.nightMode){
root["playMask"][("movingCar" + _local2)].gotoAndPlay(1);
};
_local2++;
};
}
public function startGame_level9():void{
MovieClip(root).training.textText.trainingText.text = "Oh, It's too late... Drive and find parking Area...";
MovieClip(root).training.visible = true;
MovieClip(root).training.gotoAndPlay(1);
var _local1:Rig = new cementMixer();
addChild(_local1);
_local1.mainTruckX = 200;
_local1.mainTruckY = 300;
_local1.mainTruckRotation = 270;
_local1.RIG1_LENGTH = 123;
_local1.x = 200;
_local1.y = 300;
_local1.rotation = 270;
_local1.obstacleCount = 1;
_local1.movCarCount = 0;
_local1.gutterCount = 0;
_local1.nightMode = true;
_local1.scrollable = true;
_local1.initialize();
var _local2:* = 1;
while (_local2 <= _local1.movCarCount) {
root["playGround"][("movingCar" + _local2)].gotoAndPlay(1);
if (_local1.nightMode){
root["playMask"][("movingCar" + _local2)].gotoAndPlay(1);
};
_local2++;
};
}
public function startGame_level6():void{
MovieClip(root).training.textText.trainingText.text = "Night driving has never been so much fun... Find the parking spot...";
MovieClip(root).training.visible = true;
MovieClip(root).training.gotoAndPlay(1);
var _local1:mainTruck = new boxVan();
addChild(_local1);
_local1.mainTruckX = 500;
_local1.mainTruckY = 130;
_local1.mainTruckRotation = 270;
_local1.RIG1_LENGTH = 125;
_local1.x = 500;
_local1.y = 130;
_local1.rotation = 270;
_local1.obstacleCount = 1;
_local1.movCarCount = 1;
_local1.gutterCount = 0;
_local1.nightMode = true;
_local1.scrollable = true;
_local1.initialize();
var _local2:* = 1;
while (_local2 <= _local1.movCarCount) {
root["playGround"][("movingCar" + _local2)].gotoAndPlay(1);
if (_local1.nightMode){
root["playMask"][("movingCar" + _local2)].gotoAndPlay(1);
};
_local2++;
};
}
public function startGame_level8():void{
MovieClip(root).training.textText.trainingText.text = "Foggy Day, Can't see anything... How will I reach Work Site?";
MovieClip(root).training.visible = true;
MovieClip(root).training.gotoAndPlay(1);
var _local1:Rig = new cementMixer();
addChild(_local1);
_local1.mainTruckX = 400;
_local1.mainTruckY = 400;
_local1.mainTruckRotation = 270;
_local1.RIG1_LENGTH = 123;
_local1.x = 400;
_local1.y = 400;
_local1.rotation = 270;
_local1.obstacleCount = 1;
_local1.movCarCount = 1;
_local1.gutterCount = 0;
_local1.nightMode = false;
_local1.scrollable = true;
_local1.isMonster = true;
_local1.initialize();
var _local2:* = 1;
while (_local2 <= _local1.movCarCount) {
root["playGround"][("movingCar" + _local2)].gotoAndPlay(1);
if (_local1.nightMode){
root["playMask"][("movingCar" + _local2)].gotoAndPlay(1);
};
_local2++;
};
}
public function startGame_level15():void{
MovieClip(root).training.textText.trainingText.text = "Seems like this fog is going to stay forever... How can I reach home?";
MovieClip(root).training.visible = true;
MovieClip(root).training.gotoAndPlay(1);
var _local1:mainTruck = new dumpTruck();
addChild(_local1);
_local1.mainTruckX = 220;
_local1.mainTruckY = 200;
_local1.mainTruckRotation = 180;
_local1.RIG1_LENGTH = 125;
_local1.x = 220;
_local1.y = 200;
_local1.rotation = 180;
_local1.obstacleCount = 1;
_local1.movCarCount = 0;
_local1.gutterCount = 0;
_local1.nightMode = false;
_local1.scrollable = true;
_local1.initialize();
var _local2:* = 1;
while (_local2 <= _local1.movCarCount) {
root["playGround"][("movingCar" + _local2)].gotoAndPlay(1);
if (_local1.nightMode){
root["playMask"][("movingCar" + _local2)].gotoAndPlay(1);
};
_local2++;
};
}
public function startGame_level11():void{
MovieClip(root).training.textText.trainingText.text = "This Biggie is fully loaded... Should take care while driving...";
MovieClip(root).training.visible = true;
MovieClip(root).training.gotoAndPlay(1);
var _local1:Rig = new singleTrailer();
addChild(_local1);
_local1.mainTruckX = 260;
_local1.mainTruckY = 350;
_local1.mainTruckRotation = 0;
_local1.RIG1_LENGTH = 214;
_local1.x = 260;
_local1.y = 350;
_local1.rotation = 0;
_local1.obstacleCount = 1;
_local1.movCarCount = 0;
_local1.gutterCount = 0;
_local1.nightMode = false;
_local1.scrollable = true;
_local1.initialize();
var _local2:* = 1;
while (_local2 <= _local1.movCarCount) {
root["playGround"][("movingCar" + _local2)].gotoAndPlay(1);
if (_local1.nightMode){
root["playMask"][("movingCar" + _local2)].gotoAndPlay(1);
};
_local2++;
};
}
public function startGame_level12():void{
var _local1:mainTruck;
MovieClip(root).training.textText.trainingText.text = "Somebody got hurt... Rush to The Spot!!!";
MovieClip(root).training.visible = true;
MovieClip(root).training.gotoAndPlay(1);
_local1 = new ambulance();
addChild(_local1);
_local1.ambulance = true;
_local1.mainTruckX = 520;
_local1.mainTruckY = 420;
_local1.mainTruckRotation = 0;
_local1.RIG1_LENGTH = 125;
_local1.x = 520;
_local1.y = 420;
_local1.rotation = 0;
_local1.obstacleCount = 1;
_local1.movCarCount = 0;
_local1.gutterCount = 0;
_local1.nightMode = false;
_local1.scrollable = true;
_local1.isAmbulance = true;
_local1.initialize();
var _local2:* = 1;
while (_local2 <= _local1.movCarCount) {
root["playGround"][("movingCar" + _local2)].gotoAndPlay(1);
if (_local1.nightMode){
root["playMask"][("movingCar" + _local2)].gotoAndPlay(1);
};
_local2++;
};
}
public function startGame_level13():void{
MovieClip(root).training.textText.trainingText.text = "Driving Monsters nuts is really fun...";
MovieClip(root).training.visible = true;
MovieClip(root).training.gotoAndPlay(1);
var _local1:monster = new monster();
addChild(_local1);
_local1.mainTruckX = 275;
_local1.mainTruckY = 400;
_local1.mainTruckRotation = 0;
_local1.RIG1_LENGTH = 125;
_local1.x = 275;
_local1.y = 400;
_local1.rotation = 0;
_local1.obstacleCount = 1;
_local1.movCarCount = 3;
_local1.gutterCount = 0;
_local1.nightMode = false;
_local1.scrollable = true;
_local1.initialize();
var _local2:* = 1;
while (_local2 <= _local1.movCarCount) {
root["playGround"][("movingCar" + _local2)].gotoAndPlay(1);
if (_local1.nightMode){
root["playMask"][("movingCar" + _local2)].gotoAndPlay(1);
};
_local2++;
};
}
public function startGame_level14():void{
MovieClip(root).training.textText.trainingText.text = "Still doubt on my driving skills? I'll show you what I can do!";
MovieClip(root).training.visible = true;
MovieClip(root).training.gotoAndPlay(1);
var _local1:Rig = new singleTrailer();
addChild(_local1);
_local1.mainTruckX = 450;
_local1.mainTruckY = 350;
_local1.mainTruckRotation = 180;
_local1.RIG1_LENGTH = 214;
_local1.x = 450;
_local1.y = 350;
_local1.rotation = 180;
_local1.obstacleCount = 1;
_local1.movCarCount = 0;
_local1.gutterCount = 0;
_local1.nightMode = false;
_local1.scrollable = true;
_local1.initialize();
var _local2:* = 1;
while (_local2 <= _local1.movCarCount) {
root["playGround"][("movingCar" + _local2)].gotoAndPlay(1);
if (_local1.nightMode){
root["playMask"][("movingCar" + _local2)].gotoAndPlay(1);
};
_local2++;
};
}
public function startGame_level18():void{
MovieClip(root).training.textText.trainingText.text = "Finding way to collect waste is feeling like climbing Everest!!!";
MovieClip(root).training.visible = true;
MovieClip(root).training.gotoAndPlay(1);
var _local1:mainTruck = new dumpTruck();
addChild(_local1);
_local1.mainTruckX = 570;
_local1.mainTruckY = 170;
_local1.mainTruckRotation = 180;
_local1.RIG1_LENGTH = 125;
_local1.x = 570;
_local1.y = 170;
_local1.rotation = 180;
_local1.obstacleCount = 1;
_local1.movCarCount = 0;
_local1.gutterCount = 0;
_local1.nightMode = true;
_local1.scrollable = true;
_local1.initialize();
var _local2:* = 1;
while (_local2 <= _local1.movCarCount) {
root["playGround"][("movingCar" + _local2)].gotoAndPlay(1);
if (_local1.nightMode){
root["playMask"][("movingCar" + _local2)].gotoAndPlay(1);
};
_local2++;
};
}
public function startGame_level17():void{
MovieClip(root).training.textText.trainingText.text = "Deliver the cargo dude... Don't make any scratches on our Van!!!";
MovieClip(root).training.visible = true;
MovieClip(root).training.gotoAndPlay(1);
var _local1:mainTruck = new boxVan();
addChild(_local1);
_local1.mainTruckX = 420;
_local1.mainTruckY = 300;
_local1.mainTruckRotation = 270;
_local1.RIG1_LENGTH = 125;
_local1.x = 420;
_local1.y = 300;
_local1.rotation = 270;
_local1.obstacleCount = 1;
_local1.movCarCount = 0;
_local1.gutterCount = 0;
_local1.nightMode = false;
_local1.scrollable = true;
_local1.initialize();
var _local2:* = 1;
while (_local2 <= _local1.movCarCount) {
root["playGround"][("movingCar" + _local2)].gotoAndPlay(1);
if (_local1.nightMode){
root["playMask"][("movingCar" + _local2)].gotoAndPlay(1);
};
_local2++;
};
}
public function startGame_level20():void{
MovieClip(root).training.textText.trainingText.text = "It's a rescue mission... Drive Fast...";
MovieClip(root).training.visible = true;
MovieClip(root).training.gotoAndPlay(1);
var _local1:mainTruck = new ambulance();
addChild(_local1);
_local1.ambulance = true;
_local1.mainTruckX = 250;
_local1.mainTruckY = 200;
_local1.mainTruckRotation = 90;
_local1.RIG1_LENGTH = 125;
_local1.x = 250;
_local1.y = 200;
_local1.rotation = 90;
_local1.obstacleCount = 1;
_local1.movCarCount = 0;
_local1.gutterCount = 0;
_local1.nightMode = false;
_local1.scrollable = true;
_local1.isAmbulance = true;
_local1.initialize();
var _local2:* = 1;
while (_local2 <= _local1.movCarCount) {
root["playGround"][("movingCar" + _local2)].gotoAndPlay(1);
if (_local1.nightMode){
root["playMask"][("movingCar" + _local2)].gotoAndPlay(1);
};
_local2++;
};
}
public function startGame_level21():void{
MovieClip(root).training.textText.trainingText.text = "Delivering cargo? What the hell does this contain?";
MovieClip(root).training.visible = true;
MovieClip(root).training.gotoAndPlay(1);
var _local1:mainTruck = new boxVan();
addChild(_local1);
_local1.mainTruckX = 400;
_local1.mainTruckY = 300;
_local1.mainTruckRotation = 270;
_local1.RIG1_LENGTH = 125;
_local1.x = 400;
_local1.y = 300;
_local1.rotation = 270;
_local1.obstacleCount = 1;
_local1.movCarCount = 1;
_local1.gutterCount = 0;
_local1.nightMode = false;
_local1.scrollable = true;
_local1.initialize();
var _local2:* = 1;
while (_local2 <= _local1.movCarCount) {
root["playGround"][("movingCar" + _local2)].gotoAndPlay(1);
if (_local1.nightMode){
root["playMask"][("movingCar" + _local2)].gotoAndPlay(1);
};
_local2++;
};
}
public function startGame_level19():void{
MovieClip(root).training.textText.trainingText.text = "Deliver this Monster Truck... Don't make any scratches on It...";
MovieClip(root).training.visible = true;
MovieClip(root).training.gotoAndPlay(1);
var _local1:monster = new monster();
addChild(_local1);
_local1.mainTruckX = 400;
_local1.mainTruckY = 200;
_local1.mainTruckRotation = 180;
_local1.RIG1_LENGTH = 125;
_local1.x = 400;
_local1.y = 200;
_local1.rotation = 180;
_local1.obstacleCount = 1;
_local1.movCarCount = 1;
_local1.gutterCount = 0;
_local1.nightMode = false;
_local1.scrollable = true;
_local1.initialize();
var _local2:* = 1;
while (_local2 <= _local1.movCarCount) {
root["playGround"][("movingCar" + _local2)].gotoAndPlay(1);
if (_local1.nightMode){
root["playMask"][("movingCar" + _local2)].gotoAndPlay(1);
};
_local2++;
};
}
public function startGame_level24():void{
MovieClip(root).training.textText.trainingText.text = "Fire, this early... I'm feeling sleepy... Anyway, has got to find the place...";
MovieClip(root).training.visible = true;
MovieClip(root).training.gotoAndPlay(1);
var _local1:mainTruck = new fireTruck();
addChild(_local1);
_local1.mainTruckX = 625;
_local1.mainTruckY = 375;
_local1.mainTruckRotation = 0;
_local1.RIG1_LENGTH = 125;
_local1.x = 625;
_local1.y = 375;
_local1.rotation = 0;
_local1.obstacleCount = 1;
_local1.movCarCount = 0;
_local1.gutterCount = 0;
_local1.nightMode = false;
_local1.scrollable = true;
_local1.isFireTruck = true;
_local1.initialize();
var _local2:* = 1;
while (_local2 <= _local1.movCarCount) {
root["playGround"][("movingCar" + _local2)].gotoAndPlay(1);
if (_local1.nightMode){
root["playMask"][("movingCar" + _local2)].gotoAndPlay(1);
};
_local2++;
};
}
public function startGame_level16():void{
MovieClip(root).training.textText.trainingText.text = "Call from Construction site... Deliver the concrete before it sets...";
MovieClip(root).training.visible = true;
MovieClip(root).training.gotoAndPlay(1);
var _local1:Rig = new cementMixer();
addChild(_local1);
_local1.mainTruckX = 470;
_local1.mainTruckY = 350;
_local1.mainTruckRotation = 270;
_local1.RIG1_LENGTH = 123;
_local1.x = 470;
_local1.y = 350;
_local1.rotation = 270;
_local1.obstacleCount = 1;
_local1.movCarCount = 0;
_local1.gutterCount = 0;
_local1.nightMode = false;
_local1.scrollable = true;
_local1.initialize();
var _local2:* = 1;
while (_local2 <= _local1.movCarCount) {
root["playGround"][("movingCar" + _local2)].gotoAndPlay(1);
if (_local1.nightMode){
root["playMask"][("movingCar" + _local2)].gotoAndPlay(1);
};
_local2++;
};
}
public function startGame_level23():void{
MovieClip(root).training.textText.trainingText.text = "Real Estate is really booming... There are loads of overtime work...";
MovieClip(root).training.visible = true;
MovieClip(root).training.gotoAndPlay(1);
var _local1:Rig = new cementMixer();
addChild(_local1);
_local1.mainTruckX = 400;
_local1.mainTruckY = 250;
_local1.mainTruckRotation = 0;
_local1.RIG1_LENGTH = 123;
_local1.x = 400;
_local1.y = 250;
_local1.rotation = 0;
_local1.obstacleCount = 1;
_local1.movCarCount = 0;
_local1.gutterCount = 0;
_local1.nightMode = false;
_local1.scrollable = true;
_local1.initialize();
var _local2:* = 1;
while (_local2 <= _local1.movCarCount) {
root["playGround"][("movingCar" + _local2)].gotoAndPlay(1);
if (_local1.nightMode){
root["playMask"][("movingCar" + _local2)].gotoAndPlay(1);
};
_local2++;
};
}
public function startGame_level22():void{
MovieClip(root).training.textText.trainingText.text = "Go and Collect the waste dude... Take care, there is a vehicle parked below the fly over...";
MovieClip(root).training.visible = true;
MovieClip(root).training.gotoAndPlay(1);
var _local1:mainTruck = new dumpTruck();
addChild(_local1);
_local1.mainTruckX = 175;
_local1.mainTruckY = 460;
_local1.mainTruckRotation = 90;
_local1.RIG1_LENGTH = 125;
_local1.x = 175;
_local1.y = 460;
_local1.rotation = 90;
_local1.obstacleCount = 1;
_local1.movCarCount = 0;
_local1.gutterCount = 0;
_local1.nightMode = false;
_local1.scrollable = true;
_local1.initialize();
var _local2:* = 1;
while (_local2 <= _local1.movCarCount) {
root["playGround"][("movingCar" + _local2)].gotoAndPlay(1);
if (_local1.nightMode){
root["playMask"][("movingCar" + _local2)].gotoAndPlay(1);
};
_local2++;
};
}
public function startGame_level25():void{
MovieClip(root).training.textText.trainingText.text = "Deliver the cargo... Don't think that it's that much easy...";
MovieClip(root).training.visible = true;
MovieClip(root).training.gotoAndPlay(1);
var _local1:mainTruck = new boxVan();
addChild(_local1);
_local1.mainTruckX = 300;
_local1.mainTruckY = 400;
_local1.mainTruckRotation = 90;
_local1.RIG1_LENGTH = 125;
_local1.x = 300;
_local1.y = 400;
_local1.rotation = 90;
_local1.obstacleCount = 1;
_local1.movCarCount = 0;
_local1.gutterCount = 0;
_local1.nightMode = false;
_local1.scrollable = true;
_local1.initialize();
var _local2:* = 1;
while (_local2 <= _local1.movCarCount) {
root["playGround"][("movingCar" + _local2)].gotoAndPlay(1);
if (_local1.nightMode){
root["playMask"][("movingCar" + _local2)].gotoAndPlay(1);
};
_local2++;
};
}
public function playGame1(_arg1:MouseEvent):void{
if (!muteFlag){
buttonSoundChannel = MovieClip(root).sound_Button.play(0, 1);
};
gotoAndStop(1);
stage.removeEventListener(MouseEvent.CLICK, playGame1);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, playGame11);
if (truckBGOnPlayChannel != null){
truckBGOnPlayChannel.stop();
truckBGOnPlayChannel = null;
};
}
public function playGame11(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 32){
if (!muteFlag){
buttonSoundChannel = sound_Button.play(0, 1);
};
gotoAndStop(1);
stage.removeEventListener(MouseEvent.CLICK, playGame1);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, playGame11);
if (truckBGOnPlayChannel != null){
truckBGOnPlayChannel.stop();
truckBGOnPlayChannel = null;
};
};
}
public function playContinue(_arg1:MouseEvent):void{
if (!muteFlag){
buttonSoundChannel = sound_Button.play(0, 1);
};
nextLevel = (nextLevel + 1);
gotoAndPlay((nextLevel + 2));
stage.removeEventListener(MouseEvent.CLICK, playContinue);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, playContinue1);
}
public function playContinue1(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 32){
if (!muteFlag){
buttonSoundChannel = sound_Button.play(0, 1);
};
nextLevel = (nextLevel + 1);
gotoAndPlay((nextLevel + 2));
stage.removeEventListener(MouseEvent.CLICK, playContinue);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, playContinue1);
};
}
function frame1(){
if (!teaserShown){
teaser.visible = true;
teaserShown = true;
} else {
teaser.visible = false;
};
muteFlag = undefined;
mute1 = new SoundTransform();
volume11 = new SoundTransform();
if (btnMute.currentFrame == 1){
muteFlag = false;
} else {
if (btnMute.currentFrame == 2){
muteFlag = true;
};
};
mute1.volume = 0;
volume11.volume = 0.6;
btnMute.addEventListener(MouseEvent.MOUSE_DOWN, muteSound);
sound_BG = new m1();
if (truckBGChannel == null){
truckBGChannel = sound_BG.play(0, 100);
if (MovieClip(root).muteFlag){
truckBGChannel.soundTransform = mute1;
} else {
truckBGChannel.soundTransform = volume11;
};
truckBGChannel.addEventListener(Event.SOUND_COMPLETE, playIntroSoundAgain);
};
stage.showDefaultContextMenu = false;
stop();
score = 0;
nextLevel = 1;
remainingLife = 5;
sound_Button = new buttonSound();
bonusTextDisplay = false;
btnPlay = (getChildByName("btnPlay") as SimpleButton);
btnInstructions = (getChildByName("btnInstructions") as SimpleButton);
btnPMBR1 = (getChildByName("btnPMBR1") as SimpleButton);
btniParkIt2 = (getChildByName("btniParkIt2") as SimpleButton);
btnPlay.addEventListener(MouseEvent.MOUSE_DOWN, playGame);
btnInstructions.addEventListener(MouseEvent.CLICK, instructions);
btnPMBR1.addEventListener(MouseEvent.MOUSE_DOWN, gotoPMBR1);
btniParkIt2.addEventListener(MouseEvent.MOUSE_DOWN, gotoiParkIt2);
}
function frame2(){
stop();
btnBack = (getChildByName("btnBack") as SimpleButton);
btnBack.addEventListener(MouseEvent.CLICK, gotoHome);
stage.addEventListener(KeyboardEvent.KEY_DOWN, gotoHome1);
}
function frame3(){
sound_BG_onPlay = new m7();
if (truckBGOnPlayChannel == null){
truckBGOnPlayChannel = sound_BG_onPlay.play(0, 100);
if (MovieClip(root).muteFlag){
truckBGOnPlayChannel.soundTransform = mute1;
} else {
truckBGOnPlayChannel.soundTransform = volume11;
};
truckBGOnPlayChannel.addEventListener(Event.SOUND_COMPLETE, playSoundAgain);
};
stop();
startGame_level2();
}
function frame4(){
stop();
startGame_level3();
}
function frame5(){
stop();
startGame_level4();
}
function frame6(){
stop();
startGame_level1();
}
function frame7(){
stop();
startGame_level5();
}
function frame8(){
stop();
startGame_level7();
}
function frame9(){
stop();
startGame_level10();
}
function frame10(){
stop();
startGame_level9();
}
function frame11(){
stop();
startGame_level6();
}
function frame12(){
stop();
startGame_level8();
}
function frame13(){
stop();
startGame_level15();
}
function frame14(){
stop();
startGame_level11();
}
function frame15(){
stop();
startGame_level12();
}
function frame16(){
stop();
startGame_level13();
}
function frame17(){
stop();
startGame_level14();
}
function frame18(){
stop();
startGame_level18();
}
function frame19(){
stop();
startGame_level17();
}
function frame20(){
stop();
startGame_level20();
}
function frame21(){
stop();
startGame_level21();
}
function frame22(){
stop();
startGame_level19();
}
function frame23(){
stop();
startGame_level24();
}
function frame24(){
stop();
startGame_level16();
}
function frame25(){
stop();
startGame_level23();
}
function frame26(){
stop();
startGame_level22();
}
function frame27(){
stop();
startGame_level25();
}
function frame28(){
stop();
statusBar.visible = false;
txtLevel.visible = false;
txtTimeLeft.visible = false;
btnPlayAgain = (getChildByName("btnPlayAgain") as SimpleButton);
btnPlayAgain.addEventListener(MouseEvent.CLICK, playGame1);
stage.addEventListener(KeyboardEvent.KEY_DOWN, playGame11);
root["scoreWindow1"]["scoreWindow"]["txtScore"].text = (score + "");
score = 0;
}
function frame29(){
stop();
statusBar.visible = false;
txtLevel.visible = false;
txtTimeLeft.visible = false;
btnContinue = (getChildByName("btnContinue") as SimpleButton);
btnContinue.addEventListener(MouseEvent.CLICK, playContinue);
stage.addEventListener(KeyboardEvent.KEY_DOWN, playContinue1);
root["scoreWindow1"]["scoreWindow"]["txtScore"].text = (score + "");
}
function frame30(){
stop();
statusBar.visible = false;
txtLevel.visible = false;
txtTimeLeft.visible = false;
btnTryAgain = (getChildByName("btnTryAgain") as SimpleButton);
btnTryAgain.addEventListener(MouseEvent.CLICK, playGame1);
stage.addEventListener(KeyboardEvent.KEY_DOWN, playGame11);
root["scoreWindow1"]["scoreWindow"]["txtScore"].text = (score + "");
score = 0;
}
}
}//package ParkMyBigRig2_fla
Section 22
//mm_221 (ParkMyBigRig2_fla.mm_221)
package ParkMyBigRig2_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mm_221 extends MovieClip {
public var txtScore:TextField;
public function mm_221(){
addFrameScript(0, frame1);
}
function frame1(){
}
}
}//package ParkMyBigRig2_fla
Section 23
//moving7_173 (ParkMyBigRig2_fla.moving7_173)
package ParkMyBigRig2_fla {
import flash.display.*;
public dynamic class moving7_173 extends MovieClip {
public function moving7_173(){
addFrameScript(962, frame963);
}
function frame963(){
stop();
}
}
}//package ParkMyBigRig2_fla
Section 24
//muteButton_15 (ParkMyBigRig2_fla.muteButton_15)
package ParkMyBigRig2_fla {
import flash.display.*;
public dynamic class muteButton_15 extends MovieClip {
public function muteButton_15(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package ParkMyBigRig2_fla
Section 25
//pickupTruckBody_128 (ParkMyBigRig2_fla.pickupTruckBody_128)
package ParkMyBigRig2_fla {
import flash.display.*;
public dynamic class pickupTruckBody_128 extends MovieClip {
public function pickupTruckBody_128(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ParkMyBigRig2_fla
Section 26
//smoke_112 (ParkMyBigRig2_fla.smoke_112)
package ParkMyBigRig2_fla {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class smoke_112 extends MovieClip {
public function smoke_112(){
addFrameScript(0, frame1, 11, frame12);
}
function frame1(){
this.smoke = true;
}
function frame12(){
this.smoke = true;
}
}
}//package ParkMyBigRig2_fla
Section 27
//TIMEELAPSEDANIMATION45_66 (ParkMyBigRig2_fla.TIMEELAPSEDANIMATION45_66)
package ParkMyBigRig2_fla {
import flash.display.*;
public dynamic class TIMEELAPSEDANIMATION45_66 extends MovieClip {
public function TIMEELAPSEDANIMATION45_66(){
addFrameScript(53, frame54);
}
function frame54(){
gotoAndStop(1);
}
}
}//package ParkMyBigRig2_fla
Section 28
//trainingpopup_69 (ParkMyBigRig2_fla.trainingpopup_69)
package ParkMyBigRig2_fla {
import flash.display.*;
public dynamic class trainingpopup_69 extends MovieClip {
public var textText:MovieClip;
public function trainingpopup_69(){
addFrameScript(0, frame1, 29, frame30);
}
function frame1(){
}
function frame30(){
stop();
}
}
}//package ParkMyBigRig2_fla
Section 29
//ambulance (ambulance)
package {
public dynamic class ambulance extends mainTruck {
public function ambulance(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
this.truckSmoke.visible = false;
}
}
}//package
Section 30
//boxVan (boxVan)
package {
public dynamic class boxVan extends mainTruck {
public function boxVan(){
addFrameScript(0, frame1);
}
function frame1(){
truckSmoke.visible = false;
}
}
}//package
Section 31
//buttonSound (buttonSound)
package {
import flash.media.*;
public dynamic class buttonSound extends Sound {
}
}//package
Section 32
//cementMixer (cementMixer)
package {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class cementMixer extends Rig {
public function cementMixer(){
addFrameScript(0, frame1);
}
function frame1(){
rigFront.leftSmoke.visible = false;
rigFront.rightSmoke.visible = false;
}
}
}//package
Section 33
//clap (clap)
package {
import flash.media.*;
public dynamic class clap extends Sound {
}
}//package
Section 34
//doubleTrailer (doubleTrailer)
package {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class doubleTrailer extends Rig {
public function doubleTrailer(){
addFrameScript(0, frame1);
}
function frame1(){
rigFront.leftSmoke.visible = false;
rigFront.rightSmoke.visible = false;
}
}
}//package
Section 35
//dumpTruck (dumpTruck)
package {
public dynamic class dumpTruck extends mainTruck {
public function dumpTruck(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
truckSmoke.visible = false;
}
}
}//package
Section 36
//fireTruck (fireTruck)
package {
public dynamic class fireTruck extends mainTruck {
public function fireTruck(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
truckSmoke.visible = false;
}
}
}//package
Section 37
//m1 (m1)
package {
import flash.media.*;
public dynamic class m1 extends Sound {
}
}//package
Section 38
//m7 (m7)
package {
import flash.media.*;
public dynamic class m7 extends Sound {
}
}//package
Section 39
//mainTruck (mainTruck)
package {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.media.*;
public class mainTruck extends MovieClip {
public var tire4:MovieClip;
public var parkingPoint1:MovieClip;
public var parkingPoint2:MovieClip;
public var tire1:MovieClip;
public var parkingPoint3:MovieClip;
public var tire2:MovieClip;
public var parkingPoint4:MovieClip;
public var tire3:MovieClip;
public var vehicleHitBody:MovieClip;
public var truckSmoke:MovieClip;
var level:int;// = 1
var timeLeft:int;// = 180
var life:int;// = 5
var timer2;
public var mainTruckX:Number;
public var mainTruckY:Number;
public var mainTruckRotation:Number;
public var rigX:Number;
public var rigY:Number;
public var rigRotation:Number;
public var ambulance:Boolean;// = false
protected var forwardKey:Boolean;
protected var backwardKey:Boolean;
protected var leftKey:Boolean;
protected var rightKey:Boolean;
protected var skip1:Boolean;
protected var skip2:Boolean;
protected var truckSpeed:Number;// = 0
protected var STEER_MAX:Number;// = 30
protected var STEER_SENSITIVITY:Number;// = 0.5
protected var ACCELERATION:Number;// = 0.2
protected var MAX_SPEED:Number;// = 4
protected var ROLLFRICTIONFACTOR:Number;// = 1.05
protected var ROTATION_SPEED:Number;// = 1.3
public var RIG1_LENGTH:Number;
protected var playGroundX:Number;
protected var playGroundY:Number;
protected var nightX:Number;
protected var nightY:Number;
protected var parked:Boolean;// = false
protected var skidSoundFlag:Boolean;// = true
protected var tireMarkLimit:Number;// = 3.7
protected var tireMark:Boolean;// = false
protected var pointTire1:Point;
protected var pointTire2:Point;
protected var tireMarkX1;
protected var tireMarkY1;
protected var tireMarkX2;
protected var tireMarkY2;
protected var TM1;// = null
protected var TM2;// = null
protected var bgX:Number;
protected var bgY:Number;
protected var topObjX:Number;
protected var topObjY:Number;
public var isAmbulance:Boolean;// = false
public var isFireTruck:Boolean;// = false
public var obstacleCount:int;// = 0
public var gutterCount:int;// = 0
public var movCarCount:int;// = 0
public var timeID;
public var objectBased:Boolean;// = false
public var nightMode:Boolean;// = false
public var scrollable:Boolean;// = false
private var sound_Sound:truckSound;
private var sound_Crash:truckCrash;
private var sound_Start:truckSound;
private var sound_Running:truckRunning;
private var sound_clap:clap;
private var sound_skid:truckSkid1;
private var truckSoundChannel:SoundChannel;
private var truckCrashChannel:SoundChannel;
private var truckStartChannel:SoundChannel;
private var truckRunningChannel:SoundChannel;
private var clapChannel:SoundChannel;
private var skidChannel:SoundChannel;
private var mute:SoundTransform;
private var volume1:SoundTransform;
private var volume2:SoundTransform;
public static const score:int = 0;
protected static var isCollision:Boolean = false;
public function mainTruck():void{
sound_Sound = new truckSound();
sound_Crash = new truckCrash();
sound_Start = new truckSound();
sound_Running = new truckRunning();
sound_clap = new clap();
sound_skid = new truckSkid1();
mute = new SoundTransform();
volume1 = new SoundTransform();
volume2 = new SoundTransform();
super();
mainTruckX = x;
mainTruckY = y;
mainTruckRotation = rotation;
}
function gotoNextLevel(){
clearInterval(timeID);
MovieClip(root).score = ((MovieClip(root).score + (10 * timeLeft)) + (life * 50));
Remove();
}
function timer(){
var _local1:*;
var _local2:*;
if (!MovieClip(root).training.visible){
timeLeft--;
if ((((timeLeft / 60)) && ((timeLeft >= 0)))){
_local1 = int((timeLeft / 60));
_local2 = (timeLeft % 60);
if (String(_local1).length == 1){
MovieClip(parent).txtTimeLeft.text = (("0" + _local1) + ":");
} else {
MovieClip(parent).txtTimeLeft.text = (_local1 + ":");
};
if (String(_local2).length == 1){
MovieClip(parent).txtTimeLeft.text = ((MovieClip(parent).txtTimeLeft.text + "0") + _local2);
} else {
MovieClip(parent).txtTimeLeft.text = ((MovieClip(parent).txtTimeLeft.text + "") + _local2);
};
} else {
MovieClip(parent).txtTimeLeft.text = "00:00";
};
return (timeLeft);
};
}
private function loadSound():void{
mute.volume = 0;
volume1.volume = 0.6;
volume2.volume = 1;
truckStartChannel = sound_Start.play(0);
truckRunningChannel = sound_Running.play(0, 100);
if (MovieClip(root).muteFlag){
truckStartChannel.soundTransform = mute;
truckRunningChannel.soundTransform = mute;
} else {
truckStartChannel.soundTransform = volume1;
truckRunningChannel.soundTransform = volume1;
};
truckStartChannel.addEventListener(Event.SOUND_COMPLETE, loadStandBySound);
}
private function loadStandBySound(_arg1:Event):void{
truckSoundChannel = sound_Sound.play(2000, 100);
if (MovieClip(root).muteFlag){
truckSoundChannel.soundTransform = mute;
} else {
truckSoundChannel.soundTransform = volume1;
};
truckStartChannel.removeEventListener(Event.SOUND_COMPLETE, loadStandBySound);
truckStartChannel = null;
}
private function manageSound():void{
if (((forwardKey) || (backwardKey))){
if (truckSoundChannel != null){
truckSoundChannel.soundTransform = mute;
};
if (truckStartChannel != null){
truckStartChannel.soundTransform = mute;
};
if (truckRunningChannel != null){
truckRunningChannel.soundTransform = volume1;
};
} else {
if (truckSoundChannel != null){
truckSoundChannel.soundTransform = volume1;
};
if (truckStartChannel != null){
truckStartChannel.soundTransform = volume1;
};
if (truckRunningChannel != null){
truckRunningChannel.soundTransform = mute;
};
};
if (MovieClip(root).muteFlag){
if (truckSoundChannel != null){
truckSoundChannel.soundTransform = mute;
};
if (truckStartChannel != null){
truckStartChannel.soundTransform = mute;
};
if (truckRunningChannel != null){
truckRunningChannel.soundTransform = mute;
};
};
}
public function initialize():void{
if (isAmbulance){
MAX_SPEED = 6;
ACCELERATION = 0.28;
tireMarkLimit = 5.7;
} else {
if (isFireTruck){
MAX_SPEED = 5.2;
ACCELERATION = 0.26;
tireMarkLimit = 4.9;
};
};
life = MovieClip(root).remainingLife;
var _local1:* = 1;
while (_local1 <= 5) {
if (_local1 <= life){
root["statusBar"][("life" + _local1)].visible = true;
} else {
root["statusBar"][("life" + _local1)].visible = false;
};
_local1++;
};
MovieClip(root).statusBar.visible = true;
MovieClip(root).txtLevel.visible = true;
MovieClip(root).txtTimeLeft.visible = true;
MovieClip(root).txtTimeLeft.text = "03:00";
if (nightMode){
MovieClip(root).playMask.mask = MovieClip(root).lightArea;
nightX = MovieClip(parent).night.x;
nightY = MovieClip(parent).night.y;
};
if (MovieClip(parent).topObject != null){
topObjX = MovieClip(parent).topObject.x;
topObjY = MovieClip(parent).topObject.y;
};
loadSound();
manageSound();
MovieClip(parent).txtLevel.text = ("0" + MovieClip(parent).nextLevel);
parked = false;
MovieClip(parent).setChildIndex(this, (MovieClip(parent).getChildIndex(root["playGround"]) + 1));
MovieClip(parent).timeElapsedMsg.gotoAndStop(1);
MovieClip(parent).congratsMsg.gotoAndStop(1);
MovieClip(parent).crashedMsg.gotoAndStop(1);
playGroundX = MovieClip(parent).playGround.x;
playGroundY = MovieClip(parent).playGround.y;
stage.addEventListener(Event.ENTER_FRAME, mainTruckOnEnterFrame);
stage.addEventListener(KeyboardEvent.KEY_DOWN, mainTruckOnKeyPressed);
stage.addEventListener(KeyboardEvent.KEY_UP, mainTruckOnKeyReleased);
timeID = setInterval(timer, 1000);
}
protected function mainTruckOnEnterFrame(_arg1:Event):void{
manageSound();
if (scrollable){
bgMove();
};
if (truckSpeed == 0){
truckSmoke.visible = false;
} else {
truckSmoke.visible = true;
};
if (((((!(forwardKey)) && (!(backwardKey)))) || (((forwardKey) && (backwardKey))))){
truckSpeed = (truckSpeed * 0.9);
if (Math.abs(truckSpeed) < 0.3){
truckSpeed = 0;
};
};
if ((((Math.abs(truckSpeed) >= tireMarkLimit)) && ((Math.abs(tire1.rotation) > 25)))){
tireMark = true;
};
if (((forwardKey) && (backwardKey))){
tireMark = true;
} else {
if (((forwardKey) && (!(isCollision)))){
if ((((truckSpeed < MAX_SPEED)) && (!(parked)))){
truckSpeed = (truckSpeed + ACCELERATION);
};
} else {
if (((backwardKey) && (!(isCollision)))){
if ((((truckSpeed > -(MAX_SPEED))) && (!(parked)))){
truckSpeed = (truckSpeed - ACCELERATION);
};
};
};
};
if (((rightKey) && (!(parked)))){
if (tire1.rotation < 0){
tire1.rotation = (tire1.rotation + (ROTATION_SPEED * 3));
tire2.rotation = (tire2.rotation + (ROTATION_SPEED * 3));
} else {
if (tire1.rotation < STEER_MAX){
tire1.rotation = (tire1.rotation + ROTATION_SPEED);
tire2.rotation = (tire2.rotation + ROTATION_SPEED);
};
};
};
if (((leftKey) && (!(parked)))){
if (tire1.rotation > 0){
tire1.rotation = (tire1.rotation - (ROTATION_SPEED * 3));
tire2.rotation = (tire2.rotation - (ROTATION_SPEED * 3));
} else {
if (tire1.rotation > -(STEER_MAX)){
tire1.rotation = (tire1.rotation - ROTATION_SPEED);
tire2.rotation = (tire2.rotation - ROTATION_SPEED);
};
};
} else {
if (((!(rightKey)) && (!(leftKey)))){
if (tire1.rotation > 0){
tire1.rotation = (tire1.rotation - (ROTATION_SPEED * 2));
tire2.rotation = (tire2.rotation - (ROTATION_SPEED * 2));
};
if (tire1.rotation < 0){
tire1.rotation = (tire1.rotation + (ROTATION_SPEED * 2));
tire2.rotation = (tire2.rotation + (ROTATION_SPEED * 2));
};
if (Math.abs(tire1.rotation) < 2){
tire1.rotation = 0;
tire2.rotation = 0;
};
};
};
if (!isCollision){
rotation = (rotation + ((truckSpeed * 0.018) * tire1.rotation));
x = (x + (Math.sin(((rotation * Math.PI) / 180)) * truckSpeed));
y = (y + ((Math.cos(((rotation * Math.PI) / 180)) * -1) * truckSpeed));
if (nightMode){
ApplyMask();
};
};
checkCollision();
if (tireMark){
pointTire1 = new Point(x, y);
pointTire1 = root["playGround"].globalToLocal(pointTire1);
tireMarkX1 = pointTire1.x;
tireMarkY1 = pointTire1.y;
if (ambulance){
if ((((MovieClip(root).nextLevel >= 1)) && ((MovieClip(root).nextLevel <= 5)))){
TM1 = new TireMarkAmb();
} else {
if ((((MovieClip(root).nextLevel >= 6)) && ((MovieClip(root).nextLevel <= 25)))){
TM1 = new TireMarkAmb1();
};
};
} else {
if ((((MovieClip(root).nextLevel >= 1)) && ((MovieClip(root).nextLevel <= 5)))){
TM1 = new TireMark();
} else {
if ((((MovieClip(root).nextLevel >= 6)) && ((MovieClip(root).nextLevel <= 25)))){
TM1 = new TireMark1();
};
};
};
TM1.x = tireMarkX1;
TM1.y = tireMarkY1;
TM1.rotation = rotation;
if (MovieClip(root).nextLevel == 6){
TM1.rotation = (rotation - 90);
};
if (MovieClip(root).nextLevel == 21){
TM1.rotation = (rotation + 90);
TM1.visible = false;
};
if (MovieClip(root).nextLevel == 25){
TM1.rotation = (rotation + 180);
};
root["playGround"].addChild(TM1);
if (movCarCount >= 1){
root["playGround"].setChildIndex(TM1, (root["playGround"].getChildIndex(root["playGround"]["movingCar1"]) - 1));
};
if (nightMode){
if (ambulance){
if ((((MovieClip(root).nextLevel >= 1)) && ((MovieClip(root).nextLevel <= 5)))){
TM1 = new TireMarkAmb();
} else {
if ((((MovieClip(root).nextLevel >= 6)) && ((MovieClip(root).nextLevel <= 25)))){
TM1 = new TireMarkAmb1();
};
};
} else {
if ((((MovieClip(root).nextLevel >= 1)) && ((MovieClip(root).nextLevel <= 5)))){
TM2 = new TireMark();
} else {
if ((((MovieClip(root).nextLevel >= 6)) && ((MovieClip(root).nextLevel <= 25)))){
TM2 = new TireMark1();
};
};
};
TM2.x = tireMarkX1;
TM2.y = tireMarkY1;
TM2.rotation = TM1.rotation;
root["playMask"].addChild(TM2);
if (movCarCount >= 1){
root["playMask"].setChildIndex(TM2, (root["playMask"].getChildIndex(root["playMask"]["movingCar1"]) - 1));
};
};
tireMark = false;
};
}
protected function changeSkidSoundFlag(_arg1:Event):void{
skidChannel.removeEventListener(Event.SOUND_COMPLETE, changeSkidSoundFlag);
skidSoundFlag = true;
}
protected function mainTruckOnKeyPressed(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 32){
if (MovieClip(root).training.visible){
MovieClip(root).training.visible = false;
MovieClip(root).timeLeft = 180;
};
};
if (!MovieClip(root).training.visible){
if ((((((_arg1.keyCode == 38)) || ((_arg1.keyCode == 87)))) || ((_arg1.keyCode == 119)))){
forwardKey = true;
};
if ((((((_arg1.keyCode == 40)) || ((_arg1.keyCode == 83)))) || ((_arg1.keyCode == 115)))){
backwardKey = true;
};
if ((((((_arg1.keyCode == 37)) || ((_arg1.keyCode == 65)))) || ((_arg1.keyCode == 97)))){
leftKey = true;
};
if ((((((_arg1.keyCode == 39)) || ((_arg1.keyCode == 68)))) || ((_arg1.keyCode == 100)))){
rightKey = true;
};
if (_arg1.keyCode == 83){
skip1 = true;
};
if (_arg1.keyCode == 77){
skip2 = true;
};
if (_arg1.keyCode == 74){
if (((skip1) && (skip2))){
if (truckSoundChannel != null){
truckSoundChannel.stop();
truckSoundChannel = null;
};
if (truckStartChannel != null){
truckStartChannel.stop();
truckStartChannel = null;
};
if (truckRunningChannel != null){
truckRunningChannel.stop();
truckRunningChannel = null;
};
MovieClip(root).nextLevel = (MovieClip(root).nextLevel + 1);
MovieClip(parent).txtTimeLeft.text = "03:00";
MovieClip(parent).gotoAndStop((MovieClip(parent).currentFrame + 1));
gotoNextLevel();
};
};
};
}
protected function mainTruckOnKeyReleased(_arg1:KeyboardEvent):void{
if ((((((_arg1.keyCode == 38)) || ((_arg1.keyCode == 87)))) || ((_arg1.keyCode == 119)))){
forwardKey = false;
};
if ((((((_arg1.keyCode == 40)) || ((_arg1.keyCode == 83)))) || ((_arg1.keyCode == 115)))){
backwardKey = false;
};
if ((((((_arg1.keyCode == 37)) || ((_arg1.keyCode == 65)))) || ((_arg1.keyCode == 97)))){
leftKey = false;
};
if ((((((_arg1.keyCode == 39)) || ((_arg1.keyCode == 68)))) || ((_arg1.keyCode == 100)))){
rightKey = false;
};
}
protected function checkCollision():void{
var _local3:int;
var _local4:*;
var _local1 = 1;
while (_local1 <= obstacleCount) {
if (PixelPerfectCollisionDetection.isColliding(vehicleHitBody, root["playGround"][("obstacle" + _local1)], MovieClip(root), true)){
if (!isCollision){
if (truckSoundChannel != null){
truckSoundChannel.stop();
truckSoundChannel = null;
};
if (truckStartChannel != null){
truckStartChannel.stop();
truckStartChannel = null;
};
if (truckRunningChannel != null){
truckRunningChannel.stop();
truckRunningChannel = null;
};
if (!MovieClip(root).muteFlag){
truckCrashChannel = sound_Crash.play();
};
_local3 = 1;
while (_local3 <= movCarCount) {
root["playGround"][("movingCar" + _local3)].stop();
if (nightMode){
root["playMask"][("movingCar" + _local3)].stop();
};
_local3++;
};
MovieClip(parent).crashedMsg.gotoAndPlay(1);
isCollision = true;
parked = true;
};
};
_local1++;
};
var _local2 = 1;
while (_local2 <= gutterCount) {
if (PixelPerfectCollisionDetection.isColliding(vehicleHitBody, root["playGround"][("gutter" + _local2)]["innerg"], MovieClip(root), true)){
if (!isCollision){
if (truckSoundChannel != null){
truckSoundChannel.stop();
truckSoundChannel = null;
};
if (truckStartChannel != null){
truckStartChannel.stop();
truckStartChannel = null;
};
if (truckRunningChannel != null){
truckRunningChannel.stop();
truckRunningChannel = null;
};
if (!MovieClip(root).muteFlag){
truckCrashChannel = sound_Crash.play();
};
_local3 = 1;
while (_local3 <= movCarCount) {
root["playGround"][("movingCar" + _local3)].stop();
if (nightMode){
root["playMask"][("movingCar" + _local3)].stop();
};
_local3++;
};
MovieClip(parent).crashedMsg.gotoAndPlay(1);
isCollision = true;
parked = true;
};
};
_local2++;
};
_local3 = 1;
while (_local3 <= movCarCount) {
if (PixelPerfectCollisionDetection.isColliding(vehicleHitBody, root["playGround"][("movingCar" + _local3)], MovieClip(root), true)){
if (!isCollision){
if (truckSoundChannel != null){
truckSoundChannel.stop();
truckSoundChannel = null;
};
if (truckStartChannel != null){
truckStartChannel.stop();
truckStartChannel = null;
};
if (truckRunningChannel != null){
truckRunningChannel.stop();
truckRunningChannel = null;
};
if (!MovieClip(root).muteFlag){
truckCrashChannel = sound_Crash.play();
};
_local4 = 1;
while (_local4 <= movCarCount) {
root["playGround"][("movingCar" + _local4)].stop();
_local4++;
};
if (nightMode){
root["playMask"][("movingCar" + _local3)].stop();
};
MovieClip(parent).crashedMsg.gotoAndPlay(1);
isCollision = true;
parked = true;
};
};
_local3++;
};
if (PixelPerfectCollisionDetection.isColliding(root["playGround"]["parkArea"], parkingPoint4, MovieClip(root), true)){
if (PixelPerfectCollisionDetection.isColliding(root["playGround"]["parkArea"], parkingPoint3, MovieClip(root), true)){
if (PixelPerfectCollisionDetection.isColliding(root["playGround"]["parkArea"], parkingPoint2, MovieClip(root), true)){
if (PixelPerfectCollisionDetection.isColliding(root["playGround"]["parkArea"], parkingPoint1, MovieClip(root), true)){
if (!parked){
if (truckSoundChannel != null){
truckSoundChannel.stop();
truckSoundChannel = null;
};
if (truckStartChannel != null){
truckStartChannel.stop();
truckStartChannel = null;
};
if (truckRunningChannel != null){
truckRunningChannel.stop();
truckRunningChannel = null;
};
if (!MovieClip(root).muteFlag){
clapChannel = sound_clap.play();
};
MovieClip(parent).congratsMsg.gotoAndPlay(1);
parked = true;
truckSpeed = 0;
};
};
};
};
};
if (MovieClip(parent).congratsMsg.currentFrame == 57){
if (MovieClip(parent).nextLevel == 25){
MovieClip(parent).gotoAndPlay(30);
} else {
MovieClip(parent).gotoAndPlay(29);
};
MovieClip(root).remainingLife = life;
gotoNextLevel();
timeLeft = 180;
};
if (((isCollision) && ((timeLeft > 0)))){
if (MovieClip(parent).crashedMsg.currentFrame == 48){
if (truckCrashChannel != null){
truckCrashChannel.stop();
};
root["statusBar"][("life" + life)].visible = false;
life--;
if (life > 0){
resetVehicle();
} else {
MovieClip(root).remainingLife = life;
gameOver();
};
};
};
if (timeLeft <= 0){
root["statusBar"][("life" + life)].visible = false;
MovieClip(parent).timeElapsedMsg.gotoAndPlay(1);
timeLeft = 180;
truckSpeed = 0;
isCollision = true;
parked = true;
clearInterval(timeID);
};
if (MovieClip(parent) != null){
if (MovieClip(parent).timeElapsedMsg.currentFrame == 54){
timeID = setInterval(timer, 1000);
life--;
if (life > 0){
resetVehicle();
} else {
gameOver();
};
};
};
}
protected function ApplyMask():void{
var _local1:Point = new Point(x, y);
_local1 = stage.globalToLocal(_local1);
MovieClip(root).lightArea.rotation = (rotation - 90);
MovieClip(root).lightArea.x = _local1.x;
MovieClip(root).lightArea.y = _local1.y;
MovieClip(root).maskLayer.rotation = (rotation - 90);
MovieClip(root).maskLayer.x = _local1.x;
MovieClip(root).maskLayer.y = _local1.y;
}
protected function resetVehicle():void{
parked = false;
loadSound();
isCollision = false;
x = mainTruckX;
y = mainTruckY;
rotation = mainTruckRotation;
if (MovieClip(parent).topObject != null){
MovieClip(parent).topObject.x = topObjX;
MovieClip(parent).topObject.y = topObjY;
};
if (nightMode){
MovieClip(root).playMask.x = playGroundX;
MovieClip(root).playMask.y = playGroundY;
MovieClip(root).night.x = nightX;
MovieClip(root).night.y = nightY;
};
MovieClip(parent).playGround.x = playGroundX;
MovieClip(parent).playGround.y = playGroundY;
var _local1:* = 1;
while (_local1 <= movCarCount) {
root["playGround"][("movingCar" + _local1)].gotoAndPlay(1);
if (nightMode){
root["playMask"][("movingCar" + _local1)].gotoAndPlay(1);
};
_local1++;
};
}
protected function Remove():void{
if (truckSoundChannel != null){
truckSoundChannel.stop();
};
if (truckRunningChannel != null){
truckRunningChannel.stop();
};
if (truckStartChannel != null){
truckStartChannel.stop();
};
isCollision = false;
clearInterval(timeID);
stage.removeEventListener(Event.ENTER_FRAME, mainTruckOnEnterFrame);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, mainTruckOnKeyPressed);
stage.removeEventListener(KeyboardEvent.KEY_UP, mainTruckOnKeyReleased);
MovieClip(parent).removeChild(this);
}
protected function gameOver():void{
MovieClip(parent).gotoAndStop(28);
Remove();
}
function bgMove():void{
if (x > 700){
MovieClip(parent).playGround.x = (MovieClip(parent).playGround.x - 600);
x = (x - 600);
if (MovieClip(parent).topObject != null){
MovieClip(parent).topObject.x = (MovieClip(parent).topObject.x - 600);
};
if (nightMode){
MovieClip(root).playMask.x = (MovieClip(root).playMask.x - 600);
MovieClip(root).night.x = (MovieClip(root).night.x - 600);
};
} else {
if (x < 100){
MovieClip(parent).playGround.x = (MovieClip(parent).playGround.x + 600);
x = (x + 600);
if (MovieClip(parent).topObject != null){
MovieClip(parent).topObject.x = (MovieClip(parent).topObject.x + 600);
};
if (nightMode){
MovieClip(root).playMask.x = (MovieClip(root).playMask.x + 600);
MovieClip(root).night.x = (MovieClip(root).night.x + 600);
};
} else {
if (y > 500){
MovieClip(parent).playGround.y = (MovieClip(parent).playGround.y - 400);
y = (y - 400);
if (MovieClip(parent).topObject != null){
MovieClip(parent).topObject.y = (MovieClip(parent).topObject.y - 400);
};
if (nightMode){
MovieClip(root).playMask.y = (MovieClip(root).playMask.y - 400);
MovieClip(root).night.y = (MovieClip(root).night.y - 400);
};
} else {
if (y < 100){
MovieClip(parent).playGround.y = (MovieClip(parent).playGround.y + 400);
y = (y + 400);
if (MovieClip(parent).topObject != null){
MovieClip(parent).topObject.y = (MovieClip(parent).topObject.y + 400);
};
if (nightMode){
MovieClip(root).playMask.y = (MovieClip(root).playMask.y + 400);
MovieClip(root).night.y = (MovieClip(root).night.y + 400);
};
};
};
};
};
}
}
}//package
Section 40
//monster (monster)
package {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.media.*;
public class monster extends MovieClip {
public var parkPoint1:MovieClip;
public var tireForward:MovieClip;
public var parkPoint4:MovieClip;
public var tireReverse:MovieClip;
public var parkPoint2:MovieClip;
public var vehicleHitBody:MovieClip;
public var truckSmoke:MovieClip;
public var parkPoint3:MovieClip;
var level:int;// = 1
var timeLeft:int;// = 180
var life:int;// = 5
var timer2;
public var mainTruckX:Number;
public var mainTruckY:Number;
public var mainTruckRotation:Number;
public var rigX:Number;
public var rigY:Number;
public var rigRotation:Number;
protected var forwardKey:Boolean;
protected var backwardKey:Boolean;
protected var leftKey:Boolean;
protected var rightKey:Boolean;
protected var skip1:Boolean;
protected var skip2:Boolean;
protected var truckSpeed:Number;// = 0
public var STEER_MAX:Number;// = 30
protected var STEER_SENSITIVITY:Number;// = 0.5
protected var ACCELERATION:Number;// = 0.3
protected var MAX_SPEED:Number;// = 5.5
protected var ROLLFRICTIONFACTOR:Number;// = 1.05
protected var ROTATION_SPEED:Number;// = 0.95
public var RIG1_LENGTH:Number;
protected var playGroundX:Number;
protected var playGroundY:Number;
protected var parked:Boolean;// = false
protected var tireMark:Boolean;// = false
protected var pointTire1:Point;
protected var pointTire2:Point;
protected var tireMarkX1;
protected var tireMarkY1;
protected var tireMarkX2;
protected var tireMarkY2;
protected var TM1;// = null
protected var TM2;// = null
protected var bgX:Number;
protected var bgY:Number;
protected var topObjX:Number;
protected var topObjY:Number;
protected var abcd:Boolean;
public var obstacleCount:int;// = 0
public var gutterCount:int;// = 0
public var movCarCount:int;// = 0
public var timeID;
public var objectBased:Boolean;// = false
public var nightMode:Boolean;// = false
public var scrollable:Boolean;// = false
private var sound_Sound:truckSound;
private var sound_Crash:truckCrash;
private var sound_Start:truckSound;
private var sound_Running:truckRunning;
private var sound_clap:clap;
private var sound_skid:truckSkid;
private var truckSoundChannel:SoundChannel;
private var truckCrashChannel:SoundChannel;
private var truckStartChannel:SoundChannel;
private var truckRunningChannel:SoundChannel;
private var clapChannel:SoundChannel;
private var skidChannel:SoundChannel;
private var mute:SoundTransform;
private var volume1:SoundTransform;
private var volume2:SoundTransform;
public static const score:int = 0;
protected static var isCollision:Boolean = false;
public function monster():void{
sound_Sound = new truckSound();
sound_Crash = new truckCrash();
sound_Start = new truckSound();
sound_Running = new truckRunning();
sound_clap = new clap();
sound_skid = new truckSkid();
mute = new SoundTransform();
volume1 = new SoundTransform();
volume2 = new SoundTransform();
super();
addFrameScript(0, frame1);
mainTruckX = x;
mainTruckY = y;
mainTruckRotation = rotation;
}
function gotoNextLevel(){
clearInterval(timeID);
MovieClip(root).score = ((MovieClip(root).score + (10 * timeLeft)) + (life * 50));
Remove();
}
function timer(){
var _local1:*;
var _local2:*;
if (!MovieClip(root).training.visible){
timeLeft--;
if ((((timeLeft / 60)) && ((timeLeft >= 0)))){
_local1 = int((timeLeft / 60));
_local2 = (timeLeft % 60);
if (String(_local1).length == 1){
MovieClip(parent).txtTimeLeft.text = (("0" + _local1) + ":");
} else {
MovieClip(parent).txtTimeLeft.text = (_local1 + ":");
};
if (String(_local2).length == 1){
MovieClip(parent).txtTimeLeft.text = ((MovieClip(parent).txtTimeLeft.text + "0") + _local2);
} else {
MovieClip(parent).txtTimeLeft.text = ((MovieClip(parent).txtTimeLeft.text + "") + _local2);
};
} else {
MovieClip(parent).txtTimeLeft.text = "00:00";
};
return (timeLeft);
};
}
private function loadSound():void{
mute.volume = 0;
volume1.volume = 0.6;
volume2.volume = 1;
truckStartChannel = sound_Start.play(0);
truckRunningChannel = sound_Running.play(0, 100);
if (MovieClip(root).muteFlag){
truckStartChannel.soundTransform = mute;
truckRunningChannel.soundTransform = mute;
} else {
truckStartChannel.soundTransform = volume1;
truckRunningChannel.soundTransform = volume1;
};
truckStartChannel.addEventListener(Event.SOUND_COMPLETE, loadStandBySound);
}
private function loadStandBySound(_arg1:Event):void{
truckSoundChannel = sound_Sound.play(2000, 100);
if (MovieClip(root).muteFlag){
truckSoundChannel.soundTransform = mute;
} else {
truckSoundChannel.soundTransform = volume1;
};
truckStartChannel.removeEventListener(Event.SOUND_COMPLETE, loadStandBySound);
truckStartChannel = null;
}
private function manageSound():void{
if (((forwardKey) || (backwardKey))){
if (truckSoundChannel != null){
truckSoundChannel.soundTransform = mute;
};
if (truckStartChannel != null){
truckStartChannel.soundTransform = mute;
};
if (truckRunningChannel != null){
truckRunningChannel.soundTransform = volume1;
};
} else {
if (truckSoundChannel != null){
truckSoundChannel.soundTransform = volume1;
};
if (truckStartChannel != null){
truckStartChannel.soundTransform = volume1;
};
if (truckRunningChannel != null){
truckRunningChannel.soundTransform = mute;
};
};
if (MovieClip(root).muteFlag){
if (truckSoundChannel != null){
truckSoundChannel.soundTransform = mute;
};
if (truckStartChannel != null){
truckStartChannel.soundTransform = mute;
};
if (truckRunningChannel != null){
truckRunningChannel.soundTransform = mute;
};
};
}
public function initialize():void{
life = MovieClip(root).remainingLife;
var _local1:* = 1;
while (_local1 <= 5) {
if (_local1 <= life){
root["statusBar"][("life" + _local1)].visible = true;
} else {
root["statusBar"][("life" + _local1)].visible = false;
};
_local1++;
};
MovieClip(root).txtTimeLeft.visible = true;
MovieClip(root).statusBar.visible = true;
MovieClip(root).txtLevel.visible = true;
MovieClip(root).txtTimeLeft.text = "03:00";
if (nightMode){
MovieClip(root).playMask.mask = MovieClip(root).lightArea;
};
if (MovieClip(parent).topObject != null){
topObjX = MovieClip(parent).topObject.x;
topObjY = MovieClip(parent).topObject.y;
};
loadSound();
manageSound();
MovieClip(parent).txtLevel.text = ("0" + MovieClip(parent).nextLevel);
parked = false;
MovieClip(parent).setChildIndex(this, (MovieClip(parent).getChildIndex(root["playGround"]) + 1));
MovieClip(parent).timeElapsedMsg.gotoAndStop(1);
MovieClip(parent).congratsMsg.gotoAndStop(1);
MovieClip(parent).crashedMsg.gotoAndStop(1);
playGroundX = MovieClip(parent).playGround.x;
playGroundY = MovieClip(parent).playGround.y;
stage.addEventListener(Event.ENTER_FRAME, mainTruckOnEnterFrame);
stage.addEventListener(KeyboardEvent.KEY_DOWN, mainTruckOnKeyPressed);
stage.addEventListener(KeyboardEvent.KEY_UP, mainTruckOnKeyReleased);
timeID = setInterval(timer, 1000);
}
protected function mainTruckOnEnterFrame(_arg1:Event):void{
manageSound();
if (scrollable){
bgMove();
};
if (truckSpeed == 0){
truckSmoke.visible = false;
} else {
truckSmoke.visible = true;
};
if (((((!(forwardKey)) && (!(backwardKey)))) || (((forwardKey) && (backwardKey))))){
truckSpeed = (truckSpeed * 0.9);
if (Math.abs(truckSpeed) < 0.3){
truckSpeed = 0;
};
};
if ((((Math.abs(truckSpeed) >= 5.2)) && ((Math.abs(tireForward.tire1.rotation) >= 29)))){
tireMark = true;
};
if (((forwardKey) && (backwardKey))){
tireMark = true;
} else {
if (forwardKey){
if ((((truckSpeed < MAX_SPEED)) && (!(parked)))){
truckSpeed = (truckSpeed + ACCELERATION);
};
} else {
if (backwardKey){
if ((((truckSpeed > -(MAX_SPEED))) && (!(parked)))){
truckSpeed = (truckSpeed - ACCELERATION);
};
};
};
};
if (truckSpeed == 0){
tireForward.visible = true;
tireReverse.visible = false;
tireForward.tire1.gotoAndStop(1);
tireForward.tire2.gotoAndStop(1);
tireForward.tire3.gotoAndStop(1);
tireForward.tire4.gotoAndStop(1);
tireReverse.tire1.gotoAndStop(1);
tireReverse.tire2.gotoAndStop(1);
tireReverse.tire3.gotoAndStop(1);
tireReverse.tire4.gotoAndStop(1);
abcd = !(abcd);
} else {
if (truckSpeed > 0){
tireForward.visible = true;
tireReverse.visible = false;
if (tireForward.tire1.currentFrame == 3){
tireForward.tire1.gotoAndStop(1);
tireForward.tire2.gotoAndStop(1);
tireForward.tire3.gotoAndStop(1);
tireForward.tire4.gotoAndStop(1);
} else {
tireForward.tire1.nextFrame();
tireForward.tire2.nextFrame();
tireForward.tire3.nextFrame();
tireForward.tire4.nextFrame();
};
} else {
tireForward.visible = false;
tireReverse.visible = true;
if (tireReverse.tire1.currentFrame == 3){
tireReverse.tire1.gotoAndStop(1);
tireReverse.tire2.gotoAndStop(1);
tireReverse.tire3.gotoAndStop(1);
tireReverse.tire4.gotoAndStop(1);
} else {
tireReverse.tire1.nextFrame();
tireReverse.tire2.nextFrame();
tireReverse.tire3.nextFrame();
tireReverse.tire4.nextFrame();
};
};
};
if (((rightKey) && (!(parked)))){
if (tireForward.tire1.rotation < 0){
tireForward.tire1.rotation = (tireForward.tire1.rotation + (ROTATION_SPEED * 1.5));
tireForward.tire2.rotation = (tireForward.tire2.rotation + (ROTATION_SPEED * 1.5));
tireReverse.tire1.rotation = (tireReverse.tire1.rotation + (ROTATION_SPEED * 1.5));
tireReverse.tire2.rotation = (tireReverse.tire2.rotation + (ROTATION_SPEED * 1.5));
} else {
if (tireForward.tire1.rotation < STEER_MAX){
tireForward.tire1.rotation = (tireForward.tire1.rotation + ROTATION_SPEED);
tireForward.tire2.rotation = (tireForward.tire2.rotation + ROTATION_SPEED);
tireReverse.tire1.rotation = (tireReverse.tire1.rotation + ROTATION_SPEED);
tireReverse.tire2.rotation = (tireReverse.tire2.rotation + ROTATION_SPEED);
};
};
};
if (((leftKey) && (!(parked)))){
if (tireForward.tire1.rotation > 0){
tireForward.tire1.rotation = (tireForward.tire1.rotation - (ROTATION_SPEED * 1.5));
tireForward.tire2.rotation = (tireForward.tire2.rotation - (ROTATION_SPEED * 1.5));
tireReverse.tire1.rotation = (tireReverse.tire1.rotation - (ROTATION_SPEED * 1.5));
tireReverse.tire2.rotation = (tireReverse.tire2.rotation - (ROTATION_SPEED * 1.5));
} else {
if (tireForward.tire1.rotation > -(STEER_MAX)){
tireForward.tire1.rotation = (tireForward.tire1.rotation - ROTATION_SPEED);
tireForward.tire2.rotation = (tireForward.tire2.rotation - ROTATION_SPEED);
tireReverse.tire1.rotation = (tireReverse.tire1.rotation - ROTATION_SPEED);
tireReverse.tire2.rotation = (tireReverse.tire2.rotation - ROTATION_SPEED);
};
};
} else {
if (((!(rightKey)) && (!(leftKey)))){
if (tireForward.tire1.rotation > 0){
tireForward.tire1.rotation = (tireForward.tire1.rotation - (ROTATION_SPEED * 2));
tireForward.tire2.rotation = (tireForward.tire2.rotation - (ROTATION_SPEED * 2));
tireReverse.tire1.rotation = (tireReverse.tire1.rotation - (ROTATION_SPEED * 2));
tireReverse.tire2.rotation = (tireReverse.tire2.rotation - (ROTATION_SPEED * 2));
};
if (tireForward.tire1.rotation < 0){
tireForward.tire1.rotation = (tireForward.tire1.rotation + (ROTATION_SPEED * 2));
tireForward.tire2.rotation = (tireForward.tire2.rotation + (ROTATION_SPEED * 2));
tireReverse.tire1.rotation = (tireReverse.tire1.rotation + (ROTATION_SPEED * 2));
tireReverse.tire2.rotation = (tireReverse.tire2.rotation + (ROTATION_SPEED * 2));
};
if (Math.abs(tireForward.tire1.rotation) < 2){
tireForward.tire1.rotation = 0;
tireForward.tire2.rotation = 0;
tireReverse.tire1.rotation = 0;
tireReverse.tire2.rotation = 0;
};
};
};
if (!isCollision){
if (tireForward.visible){
rotation = (rotation + ((truckSpeed * 0.018) * tireForward.tire1.rotation));
x = (x + (Math.sin(((rotation * Math.PI) / 180)) * truckSpeed));
y = (y + ((Math.cos(((rotation * Math.PI) / 180)) * -1) * truckSpeed));
};
if (tireReverse.visible){
rotation = (rotation + ((truckSpeed * 0.018) * tireReverse.tire1.rotation));
x = (x + (Math.sin(((rotation * Math.PI) / 180)) * truckSpeed));
y = (y + ((Math.cos(((rotation * Math.PI) / 180)) * -1) * truckSpeed));
};
if (nightMode){
ApplyMask();
};
};
checkCollision();
if (tireMark){
pointTire1 = new Point(x, y);
pointTire1 = root["playGround"].globalToLocal(pointTire1);
tireMarkX1 = pointTire1.x;
tireMarkY1 = pointTire1.y;
if ((((MovieClip(root).nextLevel >= 1)) && ((MovieClip(root).nextLevel <= 5)))){
TM1 = new TireMarkMonster2();
} else {
if ((((MovieClip(root).nextLevel >= 6)) && ((MovieClip(root).nextLevel <= 25)))){
TM1 = new TireMarkMonster1();
};
};
TM1.x = tireMarkX1;
TM1.y = tireMarkY1;
TM1.rotation = rotation;
if (MovieClip(root).nextLevel == 7){
TM1.rotation = (rotation - 90);
};
if (MovieClip(root).nextLevel == 21){
TM1.rotation = (rotation + 90);
TM1.visible = false;
};
if (MovieClip(root).nextLevel == 25){
TM1.rotation = (rotation + 180);
};
root["playGround"].addChild(TM1);
if (movCarCount >= 1){
root["playGround"].setChildIndex(TM1, (root["playGround"].getChildIndex(root["playGround"]["movingCar1"]) - 1));
};
if (nightMode){
if ((((MovieClip(root).nextLevel >= 1)) && ((MovieClip(root).nextLevel <= 5)))){
TM2 = new TireMarkMonster2();
} else {
if ((((MovieClip(root).nextLevel >= 6)) && ((MovieClip(root).nextLevel <= 25)))){
TM2 = new TireMarkMonster1();
};
};
TM2.x = tireMarkX1;
TM2.y = tireMarkY1;
TM2.rotation = TM1.rotation;
root["playMask"].addChild(TM2);
if (movCarCount >= 1){
root["playMask"].setChildIndex(TM2, (root["playMask"].getChildIndex(root["playMask"]["movingCar1"]) - 1));
};
};
tireMark = false;
};
}
protected function mainTruckOnKeyPressed(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 32){
if (MovieClip(root).training.visible){
MovieClip(root).training.visible = false;
MovieClip(root).timeLeft = 180;
};
};
if (!MovieClip(root).training.visible){
if ((((((_arg1.keyCode == 38)) || ((_arg1.keyCode == 87)))) || ((_arg1.keyCode == 119)))){
forwardKey = true;
};
if ((((((_arg1.keyCode == 40)) || ((_arg1.keyCode == 83)))) || ((_arg1.keyCode == 115)))){
backwardKey = true;
};
if ((((((_arg1.keyCode == 37)) || ((_arg1.keyCode == 65)))) || ((_arg1.keyCode == 97)))){
leftKey = true;
};
if ((((((_arg1.keyCode == 39)) || ((_arg1.keyCode == 68)))) || ((_arg1.keyCode == 100)))){
rightKey = true;
};
if (_arg1.keyCode == 83){
skip1 = true;
};
if (_arg1.keyCode == 77){
skip2 = true;
};
if (_arg1.keyCode == 74){
if (((skip1) && (skip2))){
if (truckSoundChannel != null){
truckSoundChannel.stop();
truckSoundChannel = null;
};
if (truckStartChannel != null){
truckStartChannel.stop();
truckStartChannel = null;
};
if (truckRunningChannel != null){
truckRunningChannel.stop();
truckRunningChannel = null;
};
MovieClip(root).nextLevel = (MovieClip(root).nextLevel + 1);
MovieClip(parent).txtTimeLeft.text = "03:00";
MovieClip(parent).gotoAndStop((MovieClip(parent).currentFrame + 1));
gotoNextLevel();
};
};
};
}
protected function mainTruckOnKeyReleased(_arg1:KeyboardEvent):void{
if ((((((_arg1.keyCode == 38)) || ((_arg1.keyCode == 87)))) || ((_arg1.keyCode == 119)))){
forwardKey = false;
};
if ((((((_arg1.keyCode == 40)) || ((_arg1.keyCode == 83)))) || ((_arg1.keyCode == 115)))){
backwardKey = false;
};
if ((((((_arg1.keyCode == 37)) || ((_arg1.keyCode == 65)))) || ((_arg1.keyCode == 97)))){
leftKey = false;
};
if ((((((_arg1.keyCode == 39)) || ((_arg1.keyCode == 68)))) || ((_arg1.keyCode == 100)))){
rightKey = false;
};
}
protected function checkCollision():void{
var _local3:int;
var _local4:*;
var _local1 = 1;
while (_local1 <= obstacleCount) {
if (PixelPerfectCollisionDetection.isColliding(vehicleHitBody, root["playGround"][("obstacle" + _local1)], MovieClip(root), true)){
if (!isCollision){
if (truckSoundChannel != null){
truckSoundChannel.stop();
truckSoundChannel = null;
};
if (truckStartChannel != null){
truckStartChannel.stop();
truckStartChannel = null;
};
if (truckRunningChannel != null){
truckRunningChannel.stop();
truckRunningChannel = null;
};
if (!MovieClip(root).muteFlag){
truckCrashChannel = sound_Crash.play();
};
_local3 = 1;
while (_local3 <= movCarCount) {
root["playGround"][("movingCar" + _local3)].stop();
if (nightMode){
root["playMask"][("movingCar" + _local3)].stop();
};
_local3++;
};
MovieClip(parent).crashedMsg.gotoAndPlay(1);
isCollision = true;
parked = true;
};
};
_local1++;
};
var _local2 = 1;
while (_local2 <= gutterCount) {
if (PixelPerfectCollisionDetection.isColliding(vehicleHitBody, root["playGround"][("gutter" + _local2)]["innerg"], MovieClip(root), true)){
if (!isCollision){
if (truckSoundChannel != null){
truckSoundChannel.stop();
truckSoundChannel = null;
};
if (truckStartChannel != null){
truckStartChannel.stop();
truckStartChannel = null;
};
if (truckRunningChannel != null){
truckRunningChannel.stop();
truckRunningChannel = null;
};
if (!MovieClip(root).muteFlag){
truckCrashChannel = sound_Crash.play();
};
_local3 = 1;
while (_local3 <= movCarCount) {
root["playGround"][("movingCar" + _local3)].stop();
if (nightMode){
root["playMask"][("movingCar" + _local3)].stop();
};
_local3++;
};
MovieClip(parent).crashedMsg.gotoAndPlay(1);
isCollision = true;
parked = true;
};
};
_local2++;
};
_local3 = 1;
while (_local3 <= movCarCount) {
if (PixelPerfectCollisionDetection.isColliding(vehicleHitBody, root["playGround"][("movingCar" + _local3)], MovieClip(root), true)){
if (!isCollision){
if (truckSoundChannel != null){
truckSoundChannel.stop();
truckSoundChannel = null;
};
if (truckStartChannel != null){
truckStartChannel.stop();
truckStartChannel = null;
};
if (truckRunningChannel != null){
truckRunningChannel.stop();
truckRunningChannel = null;
};
if (!MovieClip(root).muteFlag){
truckCrashChannel = sound_Crash.play();
};
_local4 = 1;
while (_local4 <= movCarCount) {
root["playGround"][("movingCar" + _local4)].stop();
_local4++;
};
if (nightMode){
root["playMask"][("movingCar" + _local3)].stop();
};
MovieClip(parent).crashedMsg.gotoAndPlay(1);
isCollision = true;
parked = true;
};
};
_local3++;
};
if (PixelPerfectCollisionDetection.isColliding(root["playGround"]["parkArea"], parkPoint4, MovieClip(root), true)){
if (PixelPerfectCollisionDetection.isColliding(root["playGround"]["parkArea"], parkPoint3, MovieClip(root), true)){
if (PixelPerfectCollisionDetection.isColliding(root["playGround"]["parkArea"], parkPoint2, MovieClip(root), true)){
if (PixelPerfectCollisionDetection.isColliding(root["playGround"]["parkArea"], parkPoint1, MovieClip(root), true)){
if (!parked){
if (truckSoundChannel != null){
truckSoundChannel.stop();
truckSoundChannel = null;
};
if (truckStartChannel != null){
truckStartChannel.stop();
truckStartChannel = null;
};
if (truckRunningChannel != null){
truckRunningChannel.stop();
truckRunningChannel = null;
};
if (!MovieClip(root).muteFlag){
clapChannel = sound_clap.play();
};
MovieClip(parent).congratsMsg.gotoAndPlay(1);
parked = true;
truckSpeed = 0;
};
};
};
};
};
if (MovieClip(parent).congratsMsg.currentFrame == 56){
MovieClip(parent).gotoAndPlay(29);
MovieClip(root).remainingLife = life;
gotoNextLevel();
timeLeft = 180;
};
if (((isCollision) && ((timeLeft > 0)))){
if (MovieClip(parent).crashedMsg.currentFrame == 47){
if (truckCrashChannel != null){
truckCrashChannel.stop();
};
root["statusBar"][("life" + life)].visible = false;
life--;
if (life > 0){
resetVehicle();
} else {
MovieClip(root).remainingLife = life;
gameOver();
};
};
};
if (timeLeft <= 0){
root["statusBar"][("life" + life)].visible = false;
MovieClip(parent).timeElapsedMsg.gotoAndPlay(1);
timeLeft = 180;
truckSpeed = 0;
isCollision = true;
parked = true;
clearInterval(timeID);
};
if (MovieClip(parent) != null){
if (MovieClip(parent).timeElapsedMsg.currentFrame == 53){
timeID = setInterval(timer, 1000);
life--;
if (life > 0){
resetVehicle();
} else {
gameOver();
};
};
};
}
protected function ApplyMask():void{
var _local1:Point = new Point(x, y);
_local1 = stage.globalToLocal(_local1);
MovieClip(root).lightArea.rotation = (rotation - 90);
MovieClip(root).lightArea.x = _local1.x;
MovieClip(root).lightArea.y = _local1.y;
MovieClip(root).maskLayer.rotation = (rotation - 90);
MovieClip(root).maskLayer.x = _local1.x;
MovieClip(root).maskLayer.y = _local1.y;
}
protected function resetVehicle():void{
parked = false;
loadSound();
isCollision = false;
x = mainTruckX;
y = mainTruckY;
rotation = mainTruckRotation;
if (MovieClip(parent).topObject != null){
MovieClip(parent).topObject.x = topObjX;
MovieClip(parent).topObject.y = topObjY;
};
if (nightMode){
MovieClip(root).playMask.x = playGroundX;
MovieClip(root).playMask.y = playGroundY;
};
MovieClip(parent).playGround.x = playGroundX;
MovieClip(parent).playGround.y = playGroundY;
var _local1:* = 1;
while (_local1 <= movCarCount) {
root["playGround"][("movingCar" + _local1)].gotoAndPlay(1);
if (nightMode){
root["playMask"][("movingCar" + _local1)].gotoAndPlay(1);
};
_local1++;
};
}
protected function Remove():void{
if (truckSoundChannel != null){
truckSoundChannel.stop();
};
if (truckRunningChannel != null){
truckRunningChannel.stop();
};
if (truckStartChannel != null){
truckStartChannel.stop();
};
isCollision = false;
clearInterval(timeID);
stage.removeEventListener(Event.ENTER_FRAME, mainTruckOnEnterFrame);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, mainTruckOnKeyPressed);
stage.removeEventListener(KeyboardEvent.KEY_UP, mainTruckOnKeyReleased);
MovieClip(parent).removeChild(this);
}
protected function gameOver():void{
MovieClip(parent).gotoAndStop(28);
Remove();
}
function bgMove():void{
if (x > 700){
MovieClip(parent).playGround.x = (MovieClip(parent).playGround.x - 600);
x = (x - 600);
if (MovieClip(parent).topObject != null){
MovieClip(parent).topObject.x = (MovieClip(parent).topObject.x - 600);
};
if (nightMode){
MovieClip(root).playMask.x = (MovieClip(root).playMask.x - 600);
};
} else {
if (x < 100){
MovieClip(parent).playGround.x = (MovieClip(parent).playGround.x + 600);
x = (x + 600);
if (MovieClip(parent).topObject != null){
MovieClip(parent).topObject.x = (MovieClip(parent).topObject.x + 600);
};
if (nightMode){
MovieClip(root).playMask.x = (MovieClip(root).playMask.x + 600);
};
} else {
if (y > 500){
MovieClip(parent).playGround.y = (MovieClip(parent).playGround.y - 400);
y = (y - 400);
if (MovieClip(parent).topObject != null){
MovieClip(parent).topObject.y = (MovieClip(parent).topObject.y - 400);
};
if (nightMode){
MovieClip(root).playMask.y = (MovieClip(root).playMask.y - 400);
};
} else {
if (y < 100){
MovieClip(parent).playGround.y = (MovieClip(parent).playGround.y + 400);
y = (y + 400);
if (MovieClip(parent).topObject != null){
MovieClip(parent).topObject.y = (MovieClip(parent).topObject.y + 400);
};
if (nightMode){
MovieClip(root).playMask.y = (MovieClip(root).playMask.y + 400);
};
};
};
};
};
}
function frame1(){
stop();
truckSmoke.visible = false;
}
}
}//package
Section 41
//PixelPerfectCollisionDetection (PixelPerfectCollisionDetection)
package {
import flash.geom.*;
import flash.display.*;
public class PixelPerfectCollisionDetection {
public static function getCollisionRect(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:DisplayObjectContainer, _arg4:Boolean=false, _arg5:Number=0):Rectangle{
var _local9:BitmapData;
var _local10:BitmapData;
var _local11:uint;
var _local12:Rectangle;
var _local13:int;
var _local6:Rectangle = _arg1.getBounds(_arg3);
var _local7:Rectangle = _arg2.getBounds(_arg3);
var _local8:Rectangle = _local6.intersection(_local7);
if (_local8.size.length > 0){
if (_arg4){
_local8.width = Math.ceil(_local8.width);
_local8.height = Math.ceil(_local8.height);
_local9 = getAlphaMap(_arg1, _local8, BitmapDataChannel.RED, _arg3);
_local10 = getAlphaMap(_arg2, _local8, BitmapDataChannel.GREEN, _arg3);
_local9.draw(_local10, null, null, BlendMode.LIGHTEN);
if (_arg5 <= 0){
_local11 = 65792;
} else {
if (_arg5 > 1){
_arg5 = 1;
};
_local13 = Math.round((_arg5 * 0xFF));
_local11 = (((_local13 << 16) | (_local13 << 8)) | 0);
};
_local12 = _local9.getColorBoundsRect(_local11, _local11);
_local9.getColorBoundsRect(_local11, _local11).x = (_local12.x + _local8.x);
_local12.y = (_local12.y + _local8.y);
return (_local12);
} else {
return (_local8);
};
//unresolved jump
};
return (null);
}
private static function getAlphaMap(_arg1:DisplayObject, _arg2:Rectangle, _arg3:uint, _arg4:DisplayObjectContainer):BitmapData{
var _local5:Matrix = _arg4.transform.concatenatedMatrix.clone();
_local5.invert();
var _local6:Matrix = _arg1.transform.concatenatedMatrix.clone();
_local6.concat(_local5);
_local6.translate(-(_arg2.x), -(_arg2.y));
var _local7:BitmapData = new BitmapData(_arg2.width, _arg2.height, true, 0);
_local7.draw(_arg1, _local6);
var _local8:BitmapData = new BitmapData(_arg2.width, _arg2.height, false, 0);
_local8.copyChannel(_local7, _local7.rect, new Point(0, 0), BitmapDataChannel.ALPHA, _arg3);
return (_local8);
}
public static function getCollisionPoint(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:DisplayObjectContainer, _arg4:Boolean=false, _arg5:Number=0):Point{
var _local7:Number;
var _local8:Number;
var _local6:Rectangle = getCollisionRect(_arg1, _arg2, _arg3, _arg4, _arg5);
if (((!((_local6 == null))) && ((_local6.size.length > 0)))){
_local7 = ((_local6.left + _local6.right) / 2);
_local8 = ((_local6.top + _local6.bottom) / 2);
return (new Point(_local7, _local8));
};
return (null);
}
public static function isColliding(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:DisplayObjectContainer, _arg4:Boolean=false, _arg5:Number=0):Boolean{
var _local6:Rectangle = getCollisionRect(_arg1, _arg2, _arg3, _arg4, _arg5);
if (((!((_local6 == null))) && ((_local6.size.length > 0)))){
return (true);
};
return (false);
}
}
}//package
Section 42
//Rig (Rig)
package {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.media.*;
public class Rig extends MovieClip {
public var rigFront:MovieClip;
public var rigBack:MovieClip;
var level:int;// = 1
var timeLeft:int;// = 180
var life:int;// = 5
var timer2;
public var smoke:Boolean;// = true
public var rigX:Number;
public var rigY:Number;
public var rigRotation:Number;
public var mainTruckX:Number;
public var mainTruckY:Number;
public var mainTruckRotation:Number;
public var isMonster:Boolean;// = false
protected var forwardKey:Boolean;
protected var backwardKey:Boolean;
protected var leftKey:Boolean;
protected var rightKey:Boolean;
protected var skip1:Boolean;
protected var skip2:Boolean;
protected var rigSpeed:Number;// = 0
protected var STEER_MAX:Number;// = 30
protected var STEER_SENSITIVITY:Number;// = 1.3
protected var ACCELERATION:Number;// = 0.2
protected var MAX_SPEED:Number;// = 3.5
protected var ROLLFRICTIONFACTOR:Number;// = 1.05
protected var isCollision:Boolean;// = false
protected var ROTATION_SPEED:Number;// = 0.95
protected var diff:Number;// = 0
protected var ROTATION_LIMIT:Number;// = 35
protected var rotation_to_add:Number;// = 0
public var RIG1_LENGTH:Number;// = 109
protected var playGroundX:Number;
protected var playGroundY:Number;
protected var nightX:Number;
protected var nightY:Number;
protected var parked:Boolean;// = false
protected var tireMark:Boolean;// = false
protected var pointTire1:Point;
protected var pointTire2:Point;
protected var tireMarkX1;
protected var tireMarkY1;
protected var tireMarkX2;
protected var tireMarkY2;
protected var TM1;// = null
protected var TM2;// = null
protected var bgX:Number;
protected var bgY:Number;
protected var topObjX:Number;
protected var topObjY:Number;
public var obstacleCount:int;// = 0
public var gutterCount:int;// = 0
public var movCarCount:int;// = 0
public var timeID;
public var objectBased:Boolean;// = false
public var nightMode:Boolean;// = false
public var scrollable:Boolean;// = false
private var sound_Sound:truckSound;
private var sound_Crash:truckCrash;
private var sound_Start:truckSound;
private var sound_Running:truckRunning;
private var sound_clap:clap;
private var truckSoundChannel:SoundChannel;
private var truckCrashChannel:SoundChannel;
private var truckStartChannel:SoundChannel;
private var truckRunningChannel:SoundChannel;
private var clapChannel:SoundChannel;
private var mute:SoundTransform;
private var volume1:SoundTransform;
private var volume2:SoundTransform;
public function Rig():void{
sound_Sound = new truckSound();
sound_Crash = new truckCrash();
sound_Start = new truckSound();
sound_Running = new truckRunning();
sound_clap = new clap();
mute = new SoundTransform();
volume1 = new SoundTransform();
volume2 = new SoundTransform();
super();
rigX = x;
rigY = y;
rigRotation = rotation;
}
function gotoNextLevel(){
clearInterval(timeID);
MovieClip(root).score = ((MovieClip(root).score + (10 * timeLeft)) + (life * 50));
Remove();
}
function timer(){
var _local1:*;
var _local2:*;
if (!MovieClip(root).training.visible){
timeLeft--;
if ((((timeLeft / 60)) && ((timeLeft >= 0)))){
_local1 = int((timeLeft / 60));
_local2 = (timeLeft % 60);
if (String(_local1).length == 1){
MovieClip(parent).txtTimeLeft.text = (("0" + _local1) + ":");
} else {
MovieClip(parent).txtTimeLeft.text = (_local1 + ":");
};
if (String(_local2).length == 1){
MovieClip(parent).txtTimeLeft.text = ((MovieClip(parent).txtTimeLeft.text + "0") + _local2);
} else {
MovieClip(parent).txtTimeLeft.text = ((MovieClip(parent).txtTimeLeft.text + "") + _local2);
};
} else {
MovieClip(parent).txtTimeLeft.text = "00:00";
};
return (timeLeft);
};
}
private function loadSound():void{
mute.volume = 0;
volume1.volume = 0.6;
volume2.volume = 1;
truckStartChannel = sound_Start.play(0);
truckRunningChannel = sound_Running.play(0, 100);
if (MovieClip(root).muteFlag){
truckStartChannel.soundTransform = mute;
truckRunningChannel.soundTransform = mute;
} else {
truckStartChannel.soundTransform = volume1;
truckRunningChannel.soundTransform = volume1;
};
truckStartChannel.addEventListener(Event.SOUND_COMPLETE, loadStandBySound);
}
private function loadStandBySound(_arg1:Event):void{
truckSoundChannel = sound_Sound.play(2000, 100);
if (MovieClip(root).muteFlag){
truckSoundChannel.soundTransform = mute;
} else {
truckSoundChannel.soundTransform = volume1;
};
truckStartChannel.removeEventListener(Event.SOUND_COMPLETE, loadStandBySound);
truckStartChannel = null;
}
private function manageSound():void{
if (((forwardKey) || (backwardKey))){
if (truckSoundChannel != null){
truckSoundChannel.soundTransform = mute;
};
if (truckStartChannel != null){
truckStartChannel.soundTransform = mute;
};
if (truckRunningChannel != null){
truckRunningChannel.soundTransform = volume1;
};
} else {
if (truckSoundChannel != null){
truckSoundChannel.soundTransform = volume1;
};
if (truckStartChannel != null){
truckStartChannel.soundTransform = volume1;
};
if (truckRunningChannel != null){
truckRunningChannel.soundTransform = mute;
};
};
if (MovieClip(root).muteFlag){
if (truckSoundChannel != null){
truckSoundChannel.soundTransform = mute;
};
if (truckStartChannel != null){
truckStartChannel.soundTransform = mute;
};
if (truckRunningChannel != null){
truckRunningChannel.soundTransform = mute;
};
};
}
public function initialize():void{
life = MovieClip(root).remainingLife;
var _local1:* = 1;
while (_local1 <= 5) {
if (_local1 <= life){
root["statusBar"][("life" + _local1)].visible = true;
} else {
root["statusBar"][("life" + _local1)].visible = false;
};
_local1++;
};
MovieClip(root).statusBar.visible = true;
MovieClip(root).txtLevel.visible = true;
MovieClip(root).txtTimeLeft.visible = true;
MovieClip(root).txtTimeLeft.text = "03:00";
if (nightMode){
MovieClip(root).playMask.mask = MovieClip(root).lightArea;
nightX = MovieClip(parent).night.x;
nightY = MovieClip(parent).night.y;
};
loadSound();
manageSound();
bgX = MovieClip(parent).playGround.x;
bgY = MovieClip(parent).playGround.y;
if (MovieClip(parent).topObject != null){
topObjX = MovieClip(parent).topObject.x;
topObjY = MovieClip(parent).topObject.y;
};
MovieClip(parent).txtLevel.text = ("0" + MovieClip(parent).nextLevel);
parked = false;
MovieClip(parent).setChildIndex(this, (MovieClip(parent).getChildIndex(root["playGround"]) + 1));
MovieClip(parent).timeElapsedMsg.gotoAndStop(1);
MovieClip(parent).congratsMsg.gotoAndStop(1);
MovieClip(parent).crashedMsg.gotoAndStop(1);
playGroundX = MovieClip(parent).playGround.x;
playGroundY = MovieClip(parent).playGround.y;
stage.addEventListener(Event.ENTER_FRAME, rigOnEnterFrame);
stage.addEventListener(KeyboardEvent.KEY_DOWN, rigOnKeyPressed);
stage.addEventListener(KeyboardEvent.KEY_UP, rigOnKeyReleased);
timeID = setInterval(timer, 1000);
}
protected function rigOnEnterFrame(_arg1:Event):void{
manageSound();
if (scrollable){
bgMove();
};
if (rigSpeed == 0){
rigFront.leftSmoke.visible = false;
rigFront.rightSmoke.visible = false;
} else {
rigFront.leftSmoke.visible = true;
rigFront.rightSmoke.visible = true;
};
if (((forwardKey) && (backwardKey))){
tireMark = true;
};
if (((((!(forwardKey)) && (!(backwardKey)))) || (((forwardKey) && (backwardKey))))){
rigSpeed = (rigSpeed / ROLLFRICTIONFACTOR);
if (Math.abs(rigSpeed) <= 0.3){
rigSpeed = 0;
};
} else {
if (((forwardKey) && (!(parked)))){
rigSpeed = (rigSpeed + ACCELERATION);
if (rigSpeed > MAX_SPEED){
rigSpeed = MAX_SPEED;
};
} else {
if (((backwardKey) && (!(parked)))){
if (rigSpeed > 0){
rigSpeed = (rigSpeed - (ACCELERATION * 1.5));
} else {
rigSpeed = (rigSpeed - (ACCELERATION / 1.5));
};
if (rigSpeed < (-(MAX_SPEED) / 1.5)){
rigSpeed = (-(MAX_SPEED) / 1.5);
};
diff = DiffAngle(rigFront.rotation, rigBack.rotation);
if (Math.abs(diff) > ROTATION_LIMIT){
if (diff < 0){
rigFront.rotation = (rigBack.rotation - ROTATION_LIMIT);
} else {
if (diff > 0){
rigFront.rotation = (rigBack.rotation + ROTATION_LIMIT);
};
};
};
};
};
};
if (((rightKey) && (!(parked)))){
if (backwardKey){
if (rigFront.wheel0.rotation < 0){
rigFront.wheel0.rotation = (rigFront.wheel0.rotation + (STEER_SENSITIVITY * 3));
rigFront.wheel1.rotation = (rigFront.wheel1.rotation + (STEER_SENSITIVITY * 3));
} else {
if (rigFront.wheel0.rotation < STEER_MAX){
rigFront.wheel0.rotation = (rigFront.wheel0.rotation + (2 * STEER_SENSITIVITY));
rigFront.wheel1.rotation = (rigFront.wheel1.rotation + (2 * STEER_SENSITIVITY));
};
};
} else {
if (rigFront.wheel0.rotation < 0){
rigFront.wheel0.rotation = (rigFront.wheel0.rotation + (STEER_SENSITIVITY * 2));
rigFront.wheel1.rotation = (rigFront.wheel1.rotation + (STEER_SENSITIVITY * 2));
} else {
if (rigFront.wheel0.rotation < STEER_MAX){
rigFront.wheel0.rotation = (rigFront.wheel0.rotation + STEER_SENSITIVITY);
rigFront.wheel1.rotation = (rigFront.wheel1.rotation + STEER_SENSITIVITY);
};
};
};
};
if (((leftKey) && (!(parked)))){
if (backwardKey){
if (rigFront.wheel0.rotation > 0){
rigFront.wheel0.rotation = (rigFront.wheel0.rotation - (STEER_SENSITIVITY * 3));
rigFront.wheel1.rotation = (rigFront.wheel1.rotation - (STEER_SENSITIVITY * 3));
} else {
if (rigFront.wheel0.rotation < STEER_MAX){
rigFront.wheel0.rotation = (rigFront.wheel0.rotation - (2 * STEER_SENSITIVITY));
rigFront.wheel1.rotation = (rigFront.wheel1.rotation - (2 * STEER_SENSITIVITY));
};
};
} else {
if (rigFront.wheel0.rotation > 0){
rigFront.wheel0.rotation = (rigFront.wheel0.rotation - (STEER_SENSITIVITY * 2));
rigFront.wheel1.rotation = (rigFront.wheel1.rotation - (STEER_SENSITIVITY * 2));
} else {
if (rigFront.wheel0.rotation > -(STEER_MAX)){
rigFront.wheel0.rotation = (rigFront.wheel0.rotation - STEER_SENSITIVITY);
rigFront.wheel1.rotation = (rigFront.wheel1.rotation - STEER_SENSITIVITY);
};
};
};
} else {
if (((!(rightKey)) && (!(leftKey)))){
rigFront.wheel0.rotation = (rigFront.wheel0.rotation / 1.2);
if (Math.abs(rigFront.wheel0.rotation) < 3){
rigFront.wheel0.rotation = 0;
};
rigFront.wheel1.rotation = rigFront.wheel0.rotation;
};
};
if (!isCollision){
rotation_to_add = ((rigSpeed * rigFront.wheel0.rotation) * 0.03);
if (rigSpeed < 0){
rigFront.rotation = (rigFront.rotation - rotation_to_add);
} else {
rigFront.rotation = (rigFront.rotation + rotation_to_add);
};
rigFront.x = (rigFront.x + (rigSpeed * Math.cos(((rigFront.rotation * Math.PI) / 180))));
rigFront.y = (rigFront.y + (rigSpeed * Math.sin(((rigFront.rotation * Math.PI) / 180))));
diff = DiffAngle(rigFront.rotation, rigBack.rotation);
if (Math.abs(diff) > ROTATION_LIMIT){
if (diff < 0){
rigFront.rotation = (rigBack.rotation - ROTATION_LIMIT);
} else {
if (diff > 0){
rigFront.rotation = (rigBack.rotation + ROTATION_LIMIT);
};
};
rigFront.wheel0.rotation = FollowRotation(rigFront.wheel0.rotation, 0, 6);
rigFront.wheel1.rotation = rigFront.wheel0.rotation;
};
if (rigSpeed != 0){
rigBack.rotation = ((Math.atan2((rigFront.y - rigBack.y), (rigFront.x - rigBack.x)) * 180) / Math.PI);
rigBack.x = (rigFront.x - (RIG1_LENGTH * Math.cos(((rigBack.rotation * Math.PI) / 180))));
rigBack.y = (rigFront.y - (RIG1_LENGTH * Math.sin(((rigBack.rotation * Math.PI) / 180))));
};
if (nightMode){
ApplyMask();
};
};
checkCollision();
if (tireMark){
if (mainTruckRotation == 0){
pointTire2 = new Point((x + rigBack.x), (y + rigBack.y));
} else {
if (mainTruckRotation == 90){
pointTire2 = new Point((x - rigBack.y), (y + rigBack.x));
} else {
if (mainTruckRotation == 180){
pointTire2 = new Point((x - rigBack.x), (y - rigBack.y));
} else {
if (mainTruckRotation == 270){
pointTire2 = new Point((x + rigBack.y), (y - rigBack.x));
};
};
};
};
pointTire2 = root["playGround"].globalToLocal(pointTire2);
tireMarkX1 = pointTire2.x;
tireMarkY1 = pointTire2.y;
if ((((MovieClip(root).nextLevel >= 1)) && ((MovieClip(root).nextLevel <= 5)))){
TM1 = new TireMarkRig2();
} else {
if ((((MovieClip(root).nextLevel >= 6)) && ((MovieClip(root).nextLevel <= 25)))){
TM1 = new TireMarkRig1();
};
};
TM1.x = tireMarkX1;
TM1.y = tireMarkY1;
TM1.rotation = ((rigBack.rotation + mainTruckRotation) + 90);
if (MovieClip(root).nextLevel == 22){
TM1.rotation = ((rigBack.rotation + mainTruckRotation) + 270);
};
if (MovieClip(root).nextLevel == 23){
TM1.rotation = (rigBack.rotation + mainTruckRotation);
};
root["playGround"].addChild(TM1);
if (movCarCount >= 1){
root["playGround"].setChildIndex(TM1, (root["playGround"].getChildIndex(root["playGround"]["movingCar1"]) - 1));
};
if (nightMode){
if ((((MovieClip(root).nextLevel >= 1)) && ((MovieClip(root).nextLevel <= 5)))){
TM2 = new TireMarkRig2();
} else {
if ((((MovieClip(root).nextLevel >= 6)) && ((MovieClip(root).nextLevel <= 25)))){
TM2 = new TireMarkRig1();
};
};
TM2.x = tireMarkX1;
TM2.y = tireMarkY1;
TM2.rotation = TM1.rotation;
root["playMask"].addChild(TM2);
if (movCarCount >= 1){
root["playMask"].setChildIndex(TM2, (root["playMask"].getChildIndex(root["playMask"]["movingCar1"]) - 1));
};
};
tireMark = false;
};
}
protected function rigOnKeyPressed(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 32){
if (MovieClip(root).training.visible){
MovieClip(root).training.visible = false;
MovieClip(root).timeLeft = 180;
};
};
if (!MovieClip(root).training.visible){
if ((((((_arg1.keyCode == 38)) || ((_arg1.keyCode == 87)))) || ((_arg1.keyCode == 119)))){
forwardKey = true;
};
if ((((((_arg1.keyCode == 40)) || ((_arg1.keyCode == 83)))) || ((_arg1.keyCode == 115)))){
backwardKey = true;
};
if ((((((_arg1.keyCode == 37)) || ((_arg1.keyCode == 65)))) || ((_arg1.keyCode == 97)))){
leftKey = true;
};
if ((((((_arg1.keyCode == 39)) || ((_arg1.keyCode == 68)))) || ((_arg1.keyCode == 100)))){
rightKey = true;
};
if (_arg1.keyCode == 83){
skip1 = true;
};
if (_arg1.keyCode == 77){
skip2 = true;
};
if (_arg1.keyCode == 74){
if (((skip1) && (skip2))){
if (truckSoundChannel != null){
truckSoundChannel.stop();
truckSoundChannel = null;
};
if (truckStartChannel != null){
truckStartChannel.stop();
truckStartChannel = null;
};
if (truckRunningChannel != null){
truckRunningChannel.stop();
truckRunningChannel = null;
};
MovieClip(root).nextLevel = (MovieClip(root).nextLevel + 1);
MovieClip(parent).txtTimeLeft.text = "03:00";
MovieClip(parent).gotoAndStop((MovieClip(parent).currentFrame + 1));
gotoNextLevel();
};
};
};
}
protected function rigOnKeyReleased(_arg1:KeyboardEvent):void{
if ((((((_arg1.keyCode == 38)) || ((_arg1.keyCode == 87)))) || ((_arg1.keyCode == 119)))){
forwardKey = false;
};
if ((((((_arg1.keyCode == 40)) || ((_arg1.keyCode == 83)))) || ((_arg1.keyCode == 115)))){
backwardKey = false;
};
if ((((((_arg1.keyCode == 37)) || ((_arg1.keyCode == 65)))) || ((_arg1.keyCode == 97)))){
leftKey = false;
};
if ((((((_arg1.keyCode == 39)) || ((_arg1.keyCode == 68)))) || ((_arg1.keyCode == 100)))){
rightKey = false;
};
}
protected function checkCollision():void{
var _local3:int;
var _local4:*;
var _local1 = 1;
while (_local1 <= obstacleCount) {
if (((PixelPerfectCollisionDetection.isColliding(rigBack, root["playGround"][("obstacle" + _local1)], MovieClip(root), true)) || (PixelPerfectCollisionDetection.isColliding(rigFront.rigFrontHitBody, root["playGround"][("obstacle" + _local1)], MovieClip(root), true)))){
if (!isCollision){
if (truckSoundChannel != null){
truckSoundChannel.stop();
truckSoundChannel = null;
};
if (truckStartChannel != null){
truckStartChannel.stop();
truckStartChannel = null;
};
if (truckRunningChannel != null){
truckRunningChannel.stop();
truckRunningChannel = null;
};
if (!MovieClip(root).muteFlag){
truckCrashChannel = sound_Crash.play();
};
_local3 = 1;
while (_local3 <= movCarCount) {
root["playGround"][("movingCar" + _local3)].stop();
if (nightMode){
root["playMask"][("movingCar" + _local3)].stop();
};
_local3++;
};
MovieClip(parent).crashedMsg.gotoAndPlay(1);
isCollision = true;
parked = true;
};
};
_local1++;
};
var _local2 = 1;
while (_local2 <= gutterCount) {
if (((PixelPerfectCollisionDetection.isColliding(rigBack, root["playGround"][("gutter" + _local2)]["innerg"], MovieClip(root), true)) || (PixelPerfectCollisionDetection.isColliding(rigFront.rigFrontHitBody, root["playGround"][("gutter" + _local2)]["innerg"], MovieClip(root), true)))){
if (!isCollision){
if (truckSoundChannel != null){
truckSoundChannel.stop();
truckSoundChannel = null;
};
if (truckStartChannel != null){
truckStartChannel.stop();
truckStartChannel = null;
};
if (truckRunningChannel != null){
truckRunningChannel.stop();
truckRunningChannel = null;
};
if (!MovieClip(root).muteFlag){
truckCrashChannel = sound_Crash.play();
};
_local3 = 1;
while (_local3 <= movCarCount) {
root["playGround"][("movingCar" + _local3)].stop();
if (nightMode){
root["playMask"][("movingCar" + _local3)].stop();
};
_local3++;
};
MovieClip(parent).crashedMsg.gotoAndPlay(1);
isCollision = true;
parked = true;
};
};
_local2++;
};
_local3 = 1;
while (_local3 <= movCarCount) {
if (((PixelPerfectCollisionDetection.isColliding(rigBack, root["playGround"][("movingCar" + _local3)], MovieClip(root), true)) || (PixelPerfectCollisionDetection.isColliding(rigFront.rigFrontHitBody, root["playGround"][("movingCar" + _local3)], MovieClip(root), true)))){
if (!isCollision){
if (truckSoundChannel != null){
truckSoundChannel.stop();
truckSoundChannel = null;
};
if (truckStartChannel != null){
truckStartChannel.stop();
truckStartChannel = null;
};
if (truckRunningChannel != null){
truckRunningChannel.stop();
truckRunningChannel = null;
};
if (!MovieClip(root).muteFlag){
truckCrashChannel = sound_Crash.play();
};
_local4 = 1;
while (_local4 <= movCarCount) {
root["playGround"][("movingCar" + _local4)].stop();
_local4++;
};
if (nightMode){
root["playMask"][("movingCar" + _local3)].stop();
};
MovieClip(parent).crashedMsg.gotoAndPlay(1);
isCollision = true;
parked = true;
};
};
_local3++;
};
if (PixelPerfectCollisionDetection.isColliding(root["playGround"]["parkArea"], rigBack.parkingPointML, MovieClip(root), true)){
if (PixelPerfectCollisionDetection.isColliding(root["playGround"]["parkArea"], rigBack.parkingPointMR, MovieClip(root), true)){
if (PixelPerfectCollisionDetection.isColliding(root["playGround"]["parkArea"], rigFront.parkingPointFL, MovieClip(root), true)){
if (PixelPerfectCollisionDetection.isColliding(root["playGround"]["parkArea"], rigFront.parkingPointFR, MovieClip(root), true)){
if (PixelPerfectCollisionDetection.isColliding(root["playGround"]["parkArea"], rigBack.parkingPointBL, MovieClip(root), true)){
if (PixelPerfectCollisionDetection.isColliding(root["playGround"]["parkArea"], rigBack.parkingPointBR, MovieClip(root), true)){
if (!parked){
if (truckSoundChannel != null){
truckSoundChannel.stop();
truckSoundChannel = null;
};
if (truckStartChannel != null){
truckStartChannel.stop();
truckStartChannel = null;
};
if (truckRunningChannel != null){
truckRunningChannel.stop();
truckRunningChannel = null;
};
if (!MovieClip(root).muteFlag){
clapChannel = sound_clap.play();
};
MovieClip(parent).congratsMsg.gotoAndPlay(1);
parked = true;
rigSpeed = 0;
};
};
};
};
};
};
};
if (MovieClip(parent).congratsMsg.currentFrame == 57){
MovieClip(parent).gotoAndPlay(29);
MovieClip(root).remainingLife = life;
gotoNextLevel();
timeLeft = 180;
};
if (((isCollision) && ((timeLeft > 0)))){
rigFront.leftSmoke.visible = false;
rigFront.rightSmoke.visible = false;
if (MovieClip(parent).crashedMsg.currentFrame == 48){
if (truckCrashChannel != null){
truckCrashChannel.stop();
};
root["statusBar"][("life" + life)].visible = false;
life--;
if (life > 0){
resetVehicle();
} else {
MovieClip(root).remainingLife = life;
gameOver();
};
};
};
if (timeLeft <= 0){
root["statusBar"][("life" + life)].visible = false;
MovieClip(parent).timeElapsedMsg.gotoAndPlay(1);
timeLeft = 180;
rigSpeed = 0;
clearInterval(timeID);
parked = true;
isCollision = true;
};
if (MovieClip(parent) != null){
if (MovieClip(parent).timeElapsedMsg.currentFrame == 54){
timeID = setInterval(timer, 1000);
life--;
if (life > 0){
resetVehicle();
} else {
MovieClip(root).remainingLife = life;
gameOver();
};
};
};
}
protected function DiffAngle(_arg1:Number, _arg2:Number):Number{
if (_arg2 < -180){
_arg2 = (_arg2 + 360);
};
if (_arg2 > 180){
_arg2 = (_arg2 - 360);
};
if (_arg1 < -180){
_arg1 = (_arg1 + 360);
};
if (_arg1 > 180){
_arg1 = (_arg1 - 360);
};
if (Math.abs((_arg1 - _arg2)) > 180){
if ((((((_arg1 < 0)) && ((_arg2 > 0)))) || ((((_arg1 > 0)) && ((_arg2 < 0)))))){
if (_arg2 < _arg1){
_arg2 = (_arg2 + 360);
} else {
_arg2 = (_arg2 - 360);
};
};
};
return ((_arg1 - _arg2));
}
protected function FollowRotation(_arg1:Number, _arg2:Number, _arg3:Number):Number{
if (_arg2 < -180){
_arg2 = (_arg2 + 360);
};
if (_arg2 > 180){
_arg2 = (_arg2 - 360);
};
if (_arg1 < -180){
_arg1 = (_arg1 + 360);
};
if (_arg1 > 180){
_arg1 = (_arg1 - 360);
};
if (Math.abs((_arg1 - _arg2)) > 180){
if ((((((_arg1 < 0)) && ((_arg2 > 0)))) || ((((_arg1 > 0)) && ((_arg2 < 0)))))){
if (_arg2 < _arg1){
_arg2 = (_arg2 + 360);
} else {
_arg2 = (_arg2 - 360);
};
};
};
if (Math.abs((_arg1 - _arg2)) < 3){
_arg1 = _arg2;
} else {
_arg1 = (_arg1 + ((_arg2 - _arg1) / _arg3));
};
return (_arg1);
}
protected function resetVehicle():void{
parked = false;
loadSound();
rigFront.x = 0;
rigFront.y = 0;
rigFront.rotation = 0;
rigBack.rotation = 0;
MovieClip(parent).playGround.x = bgX;
MovieClip(parent).playGround.y = bgY;
if (MovieClip(parent).topObject != null){
MovieClip(parent).topObject.x = topObjX;
MovieClip(parent).topObject.y = topObjY;
};
if (nightMode){
MovieClip(root).playMask.x = playGroundX;
MovieClip(root).playMask.y = playGroundY;
MovieClip(root).night.x = nightX;
MovieClip(root).night.y = nightY;
};
rigBack.x = (rigFront.x - (RIG1_LENGTH * Math.cos(((rigBack.rotation * Math.PI) / 180))));
rigBack.y = (rigFront.y - (RIG1_LENGTH * Math.sin(((rigBack.rotation * Math.PI) / 180))));
rigSpeed = 0;
isCollision = false;
var _local1:* = 1;
while (_local1 <= movCarCount) {
root["playGround"][("movingCar" + _local1)].gotoAndPlay(1);
if (nightMode){
root["playMask"][("movingCar" + _local1)].gotoAndPlay(1);
};
_local1++;
};
}
protected function gameOver():void{
MovieClip(parent).gotoAndStop(28);
Remove();
}
protected function Remove():void{
if (truckSoundChannel != null){
truckSoundChannel.stop();
};
if (truckRunningChannel != null){
truckRunningChannel.stop();
};
if (truckStartChannel != null){
truckStartChannel.stop();
};
isCollision = false;
clearInterval(timeID);
stage.removeEventListener(Event.ENTER_FRAME, rigOnEnterFrame);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, rigOnKeyPressed);
stage.removeEventListener(KeyboardEvent.KEY_UP, rigOnKeyReleased);
MovieClip(parent).removeChild(this);
}
protected function ApplyMask():void{
var _local1:Point;
if (mainTruckRotation == 0){
_local1 = new Point((x + rigFront.x), (y + rigFront.y));
} else {
if (mainTruckRotation == 90){
_local1 = new Point((x - rigFront.y), (y + rigFront.x));
} else {
if (mainTruckRotation == 180){
_local1 = new Point((x - rigFront.x), (y - rigFront.y));
} else {
if (mainTruckRotation == 270){
_local1 = new Point((x + rigFront.y), (y - rigFront.x));
};
};
};
};
_local1 = stage.globalToLocal(_local1);
MovieClip(root).lightArea.rotation = (rigFront.rotation + mainTruckRotation);
MovieClip(root).lightArea.x = _local1.x;
MovieClip(root).lightArea.y = _local1.y;
MovieClip(root).maskLayer.rotation = (rigFront.rotation + mainTruckRotation);
MovieClip(root).maskLayer.x = _local1.x;
MovieClip(root).maskLayer.y = _local1.y;
}
protected function bgMove():void{
var _local1:*;
var _local2:*;
if (mainTruckRotation == 0){
_local1 = (x + rigFront.x);
_local2 = (y + rigFront.y);
if (_local1 > 700){
MovieClip(parent).playGround.x = (MovieClip(parent).playGround.x - 600);
rigFront.x = (rigFront.x - 600);
rigBack.x = (rigBack.x - 600);
if (MovieClip(parent).topObject != null){
MovieClip(parent).topObject.x = (MovieClip(parent).topObject.x - 600);
};
if (nightMode){
MovieClip(root).playMask.x = (MovieClip(root).playMask.x - 600);
MovieClip(root).night.x = (MovieClip(root).night.x - 600);
};
} else {
if (_local1 < 100){
MovieClip(parent).playGround.x = (MovieClip(parent).playGround.x + 600);
rigFront.x = (rigFront.x + 600);
rigBack.x = (rigBack.x + 600);
if (MovieClip(parent).topObject != null){
MovieClip(parent).topObject.x = (MovieClip(parent).topObject.x + 600);
};
if (nightMode){
MovieClip(root).playMask.x = (MovieClip(root).playMask.x + 600);
MovieClip(root).night.x = (MovieClip(root).night.x + 600);
};
} else {
if (_local2 > 500){
MovieClip(parent).playGround.y = (MovieClip(parent).playGround.y - 400);
rigFront.y = (rigFront.y - 400);
rigBack.y = (rigBack.y - 400);
if (MovieClip(parent).topObject != null){
MovieClip(parent).topObject.y = (MovieClip(parent).topObject.y - 400);
};
if (nightMode){
MovieClip(root).playMask.y = (MovieClip(root).playMask.y - 400);
MovieClip(root).night.y = (MovieClip(root).night.y - 400);
};
} else {
if (_local2 < 100){
MovieClip(parent).playGround.y = (MovieClip(parent).playGround.y + 400);
rigFront.y = (rigFront.y + 400);
rigBack.y = (rigBack.y + 400);
if (MovieClip(parent).topObject != null){
MovieClip(parent).topObject.y = (MovieClip(parent).topObject.y + 400);
};
if (nightMode){
MovieClip(root).playMask.y = (MovieClip(root).playMask.y + 400);
MovieClip(root).night.y = (MovieClip(root).night.y + 400);
};
};
};
};
};
} else {
if (mainTruckRotation == 90){
_local2 = (y + rigFront.x);
_local1 = (x - rigFront.y);
if (_local1 > 700){
MovieClip(parent).playGround.x = (MovieClip(parent).playGround.x - 600);
rigFront.y = (rigFront.y + 600);
rigBack.y = (rigBack.y + 600);
if (MovieClip(parent).topObject != null){
MovieClip(parent).topObject.x = (MovieClip(parent).topObject.x - 600);
};
if (nightMode){
MovieClip(root).playMask.x = (MovieClip(root).playMask.x - 600);
MovieClip(root).night.x = (MovieClip(root).night.x - 600);
};
} else {
if (_local1 < 100){
MovieClip(parent).playGround.x = (MovieClip(parent).playGround.x + 600);
rigFront.y = (rigFront.y - 600);
rigBack.y = (rigBack.y - 600);
if (MovieClip(parent).topObject != null){
MovieClip(parent).topObject.x = (MovieClip(parent).topObject.x + 600);
};
if (nightMode){
MovieClip(root).playMask.x = (MovieClip(root).playMask.x + 600);
MovieClip(root).night.x = (MovieClip(root).night.x + 600);
};
} else {
if (_local2 > 500){
MovieClip(parent).playGround.y = (MovieClip(parent).playGround.y - 400);
rigFront.x = (rigFront.x - 400);
rigBack.x = (rigBack.x - 400);
if (MovieClip(parent).topObject != null){
MovieClip(parent).topObject.y = (MovieClip(parent).topObject.y - 400);
};
if (nightMode){
MovieClip(root).playMask.y = (MovieClip(root).playMask.y - 400);
MovieClip(root).night.y = (MovieClip(root).night.y - 400);
};
} else {
if (_local2 < 100){
MovieClip(parent).playGround.y = (MovieClip(parent).playGround.y + 400);
rigFront.x = (rigFront.x + 400);
rigBack.x = (rigBack.x + 400);
if (MovieClip(parent).topObject != null){
MovieClip(parent).topObject.y = (MovieClip(parent).topObject.y + 400);
};
if (nightMode){
MovieClip(root).playMask.y = (MovieClip(root).playMask.y + 400);
MovieClip(root).night.y = (MovieClip(root).night.y + 400);
};
};
};
};
};
} else {
if (mainTruckRotation == 180){
_local1 = (x - rigFront.x);
_local2 = (y - rigFront.y);
if (_local1 > 700){
MovieClip(parent).playGround.x = (MovieClip(parent).playGround.x - 600);
rigFront.x = (rigFront.x + 600);
rigBack.x = (rigBack.x + 600);
if (MovieClip(parent).topObject != null){
MovieClip(parent).topObject.x = (MovieClip(parent).topObject.x - 600);
};
if (nightMode){
MovieClip(root).playMask.x = (MovieClip(root).playMask.x - 600);
MovieClip(root).night.x = (MovieClip(root).night.x - 600);
};
} else {
if (_local1 < 100){
MovieClip(parent).playGround.x = (MovieClip(parent).playGround.x + 600);
rigFront.x = (rigFront.x - 600);
rigBack.x = (rigBack.x - 600);
if (MovieClip(parent).topObject != null){
MovieClip(parent).topObject.x = (MovieClip(parent).topObject.x + 600);
};
if (nightMode){
MovieClip(root).playMask.x = (MovieClip(root).playMask.x + 600);
MovieClip(root).night.x = (MovieClip(root).night.x + 600);
};
} else {
if (_local2 > 500){
MovieClip(parent).playGround.y = (MovieClip(parent).playGround.y - 400);
rigFront.y = (rigFront.y + 400);
rigBack.y = (rigBack.y + 400);
if (MovieClip(parent).topObject != null){
MovieClip(parent).topObject.y = (MovieClip(parent).topObject.y - 400);
};
if (nightMode){
MovieClip(root).playMask.y = (MovieClip(root).playMask.y - 400);
MovieClip(root).night.y = (MovieClip(root).night.y - 400);
};
} else {
if (_local2 < 100){
MovieClip(parent).playGround.y = (MovieClip(parent).playGround.y + 400);
rigFront.y = (rigFront.y - 400);
rigBack.y = (rigBack.y - 400);
if (MovieClip(parent).topObject != null){
MovieClip(parent).topObject.y = (MovieClip(parent).topObject.y + 400);
};
if (nightMode){
MovieClip(root).playMask.y = (MovieClip(root).playMask.y + 400);
MovieClip(root).night.y = (MovieClip(root).night.y + 400);
};
};
};
};
};
} else {
if (mainTruckRotation == 270){
_local2 = (y - rigFront.x);
_local1 = (x + rigFront.y);
if (_local1 > 700){
MovieClip(parent).playGround.x = (MovieClip(parent).playGround.x - 600);
rigFront.y = (rigFront.y - 600);
rigBack.y = (rigBack.y - 600);
if (MovieClip(parent).topObject != null){
MovieClip(parent).topObject.x = (MovieClip(parent).topObject.x - 600);
};
if (nightMode){
MovieClip(root).playMask.x = (MovieClip(root).playMask.x - 600);
MovieClip(root).night.x = (MovieClip(root).night.x - 600);
};
} else {
if (_local1 < 100){
MovieClip(parent).playGround.x = (MovieClip(parent).playGround.x + 600);
rigFront.y = (rigFront.y + 600);
rigBack.y = (rigBack.y + 600);
if (MovieClip(parent).topObject != null){
MovieClip(parent).topObject.x = (MovieClip(parent).topObject.x + 600);
};
if (nightMode){
MovieClip(root).playMask.x = (MovieClip(root).playMask.x + 600);
MovieClip(root).night.x = (MovieClip(root).night.x + 600);
};
} else {
if (_local2 > 500){
MovieClip(parent).playGround.y = (MovieClip(parent).playGround.y - 400);
rigFront.x = (rigFront.x + 400);
rigBack.x = (rigBack.x + 400);
if (MovieClip(parent).topObject != null){
MovieClip(parent).topObject.y = (MovieClip(parent).topObject.y - 400);
};
if (nightMode){
MovieClip(root).playMask.y = (MovieClip(root).playMask.y - 400);
MovieClip(root).night.y = (MovieClip(root).night.y - 400);
};
} else {
if (_local2 < 100){
MovieClip(parent).playGround.y = (MovieClip(parent).playGround.y + 400);
rigFront.x = (rigFront.x - 400);
rigBack.x = (rigBack.x - 400);
if (MovieClip(parent).topObject != null){
MovieClip(parent).topObject.y = (MovieClip(parent).topObject.y + 400);
};
if (nightMode){
MovieClip(root).playMask.y = (MovieClip(root).playMask.y + 400);
MovieClip(root).night.y = (MovieClip(root).night.y + 400);
};
};
};
};
};
};
};
};
};
}
}
}//package
Section 43
//rigStart (rigStart)
package {
import flash.media.*;
public dynamic class rigStart extends Sound {
}
}//package
Section 44
//singleTrailer (singleTrailer)
package {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class singleTrailer extends Rig {
public function singleTrailer(){
addFrameScript(0, frame1);
}
function frame1(){
rigFront.leftSmoke.visible = false;
rigFront.rightSmoke.visible = false;
}
}
}//package
Section 45
//Smash (Smash)
package {
import flash.media.*;
public dynamic class Smash extends Sound {
}
}//package
Section 46
//TireMark (TireMark)
package {
import flash.display.*;
public dynamic class TireMark extends MovieClip {
}
}//package
Section 47
//TireMark1 (TireMark1)
package {
import flash.display.*;
public dynamic class TireMark1 extends MovieClip {
}
}//package
Section 48
//TireMarkAmb (TireMarkAmb)
package {
import flash.display.*;
public dynamic class TireMarkAmb extends MovieClip {
}
}//package
Section 49
//TireMarkAmb1 (TireMarkAmb1)
package {
import flash.display.*;
public dynamic class TireMarkAmb1 extends MovieClip {
}
}//package
Section 50
//TireMarkMonster1 (TireMarkMonster1)
package {
import flash.display.*;
public dynamic class TireMarkMonster1 extends MovieClip {
}
}//package
Section 51
//TireMarkMonster2 (TireMarkMonster2)
package {
import flash.display.*;
public dynamic class TireMarkMonster2 extends MovieClip {
}
}//package
Section 52
//TireMarkRig1 (TireMarkRig1)
package {
import flash.display.*;
public dynamic class TireMarkRig1 extends MovieClip {
}
}//package
Section 53
//TireMarkRig2 (TireMarkRig2)
package {
import flash.display.*;
public dynamic class TireMarkRig2 extends MovieClip {
}
}//package
Section 54
//truckCrash (truckCrash)
package {
import flash.media.*;
public dynamic class truckCrash extends Sound {
}
}//package
Section 55
//truckRunning (truckRunning)
package {
import flash.media.*;
public dynamic class truckRunning extends Sound {
}
}//package
Section 56
//truckSkid (truckSkid)
package {
import flash.media.*;
public dynamic class truckSkid extends Sound {
}
}//package
Section 57
//truckSkid1 (truckSkid1)
package {
import flash.media.*;
public dynamic class truckSkid1 extends Sound {
}
}//package
Section 58
//truckSound (truckSound)
package {
import flash.media.*;
public dynamic class truckSound extends Sound {
}
}//package
Section 59
//truckStandBy (truckStandBy)
package {
import flash.media.*;
public dynamic class truckStandBy extends Sound {
}
}//package