Frame 1
function splashFinished() {
trace("splash finished");
_root.gotoAndStop(2);
}
function restartGame() {
_root.blackScreen.gotoAndPlay(1);
gotoAndPlay ("restartGame");
}
stop();
var connector = (new com.doof.client.gameconnector.GameConnector(this, "ParkingMad", splashFinised, restartGame));
com.novelgames.flashgames.commonAS2.MainDevelopment.initialize(this);
Symbol 9 MovieClip [Spark] Frame 1
#initclip 82
Object.registerClass("Spark", com.novelgames.flashgames.parkingAS2.Spark);
#endinitclip
Symbol 11 MovieClip [InstructionsButton] Frame 1
#initclip 50
Object.registerClass("InstructionsButton", com.novelgames.flashgames.commonAS2.InstructionsButton);
#endinitclip
Symbol 21 MovieClip [MessagePlayAgain] Frame 1
#initclip 51
Object.registerClass("MessagePlayAgain", com.novelgames.flashgames.parkingAS2.MessagePlayAgain);
#endinitclip
Symbol 24 MovieClip [parkingSpaceLine] Frame 1
#initclip 52
Object.registerClass("parkingSpaceLine", com.novelgames.flashgames.commonAS2.NewMovieClip);
#endinitclip
Symbol 26 MovieClip [parkingSpaceInterior] Frame 1
#initclip 53
Object.registerClass("parkingSpaceInterior", com.novelgames.flashgames.commonAS2.NewMovieClip);
#endinitclip
Symbol 27 MovieClip [ParkingSpace] Frame 1
#initclip 54
Object.registerClass("ParkingSpace", com.novelgames.flashgames.parkingAS2.ParkingSpace);
#endinitclip
Symbol 30 MovieClip [Wheel] Frame 1
#initclip 55
Object.registerClass("Wheel", com.novelgames.flashgames.parkingAS2.Wheel);
#endinitclip
Symbol 50 MovieClip [carBody] Frame 1
#initclip 56
Object.registerClass("carBody", com.novelgames.flashgames.commonAS2.NewMovieClip);
#endinitclip
Symbol 53 MovieClip [carLights] Frame 1
#initclip 57
Object.registerClass("carLights", com.novelgames.flashgames.commonAS2.NewMovieClip);
#endinitclip
Symbol 56 MovieClip [Instructions] Frame 1
#initclip 58
Object.registerClass("Instructions", com.novelgames.flashgames.commonAS2.Instructions);
#endinitclip
Symbol 60 MovieClip [MuteButton] Frame 1
#initclip 59
Object.registerClass("MuteButton", com.novelgames.flashgames.commonAS2.MuteButton);
#endinitclip
Symbol 61 MovieClip [empty] Frame 1
#initclip 60
Object.registerClass("empty", com.novelgames.flashgames.commonAS2.NewMovieClip);
#endinitclip
Symbol 89 MovieClip [Message] Frame 1
#initclip 61
Object.registerClass("Message", com.novelgames.flashgames.parkingAS2.Message);
#endinitclip
Symbol 90 MovieClip [Game] Frame 1
#initclip 62
Object.registerClass("Game", com.novelgames.flashgames.parkingAS2.Game);
#endinitclip
Symbol 93 MovieClip [Wall] Frame 1
#initclip 63
Object.registerClass("Wall", com.novelgames.flashgames.parkingAS2.Wall);
#endinitclip
Symbol 97 MovieClip [Car3] Frame 1
#initclip 64
Object.registerClass("Car3", com.novelgames.flashgames.parkingAS2.Car3);
#endinitclip
Symbol 102 MovieClip [Car2] Frame 1
#initclip 65
Object.registerClass("Car2", com.novelgames.flashgames.parkingAS2.Car2);
#endinitclip
Symbol 107 MovieClip [Car1] Frame 1
#initclip 66
Object.registerClass("Car1", com.novelgames.flashgames.parkingAS2.Car1);
#endinitclip
Symbol 115 MovieClip [Tree] Frame 1
#initclip 67
Object.registerClass("Tree", com.novelgames.flashgames.parkingAS2.Tree);
#endinitclip
Symbol 121 MovieClip [Car] Frame 1
#initclip 68
Object.registerClass("Car", com.novelgames.flashgames.parkingAS2.Car);
#endinitclip
Symbol 122 MovieClip [Level10] Frame 1
#initclip 69
Object.registerClass("Level10", com.novelgames.flashgames.parkingAS2.Level10);
#endinitclip
Symbol 125 MovieClip [Level9] Frame 1
#initclip 70
Object.registerClass("Level9", com.novelgames.flashgames.parkingAS2.Level9);
#endinitclip
Symbol 126 MovieClip [Level8] Frame 1
#initclip 71
Object.registerClass("Level8", com.novelgames.flashgames.parkingAS2.Level8);
#endinitclip
Symbol 143 MovieClip [Level7] Frame 1
#initclip 72
Object.registerClass("Level7", com.novelgames.flashgames.parkingAS2.Level7);
#endinitclip
Symbol 160 MovieClip [Level6] Frame 1
#initclip 73
Object.registerClass("Level6", com.novelgames.flashgames.parkingAS2.Level6);
#endinitclip
Symbol 182 MovieClip [Level5] Frame 1
#initclip 74
Object.registerClass("Level5", com.novelgames.flashgames.parkingAS2.Level5);
#endinitclip
Symbol 186 MovieClip [Level4] Frame 1
#initclip 75
Object.registerClass("Level4", com.novelgames.flashgames.parkingAS2.Level4);
#endinitclip
Symbol 189 MovieClip [Level3] Frame 1
#initclip 76
Object.registerClass("Level3", com.novelgames.flashgames.parkingAS2.Level3);
#endinitclip
Symbol 193 MovieClip [Level2] Frame 1
#initclip 77
Object.registerClass("Level2", com.novelgames.flashgames.parkingAS2.Level2);
#endinitclip
Symbol 194 MovieClip [Level1] Frame 1
#initclip 78
Object.registerClass("Level1", com.novelgames.flashgames.parkingAS2.Level1);
#endinitclip
Symbol 198 MovieClip [MessageLevel] Frame 1
#initclip 79
Object.registerClass("MessageLevel", com.novelgames.flashgames.parkingAS2.MessageLevel);
#endinitclip
Symbol 211 MovieClip [MessageClear] Frame 1
#initclip 80
Object.registerClass("MessageClear", com.novelgames.flashgames.parkingAS2.MessageClear);
#endinitclip
Symbol 232 MovieClip [Title] Frame 1
#initclip 81
Object.registerClass("Title", com.novelgames.flashgames.commonAS2.Title);
#endinitclip
Symbol 237 MovieClip Frame 21
stop();
Symbol 233 MovieClip [__Packages.com.doof.client.gameconnector.GameConnector] Frame 0
class com.doof.client.gameconnector.GameConnector extends MovieClip
{
var _parentRef, _gameID, _splashFinishedMethod, _restartGameMethod, _gameShell;
function GameConnector (parentRef, gameID, splashFinishedMethod, restartGameMethod) {
super();
trace("AS2 GameConnector V2 constructor called");
allowDomains();
_parentRef = parentRef;
_gameID = gameID;
_splashFinishedMethod = splashFinishedMethod;
_restartGameMethod = restartGameMethod;
loadGameShell();
}
function allowDomains() {
System.security.allowDomain("*");
System.security.allowInsecureDomain("*");
System.security.loadPolicyFile("http://dev.cam.doof.com/crossdomain.xml");
}
function loadGameShell() {
var _local4 = new MovieClipLoader();
var _local5 = new Object();
_local5.onLoadInit = mx.utils.Delegate.create(this, shellLoadCompleteHandler);
_local4.addListener(_local5);
_gameShell = _root.createEmptyMovieClip("_gameShell", _root.getNextHighestDepth());
var _local3 = _root.environment.toString();
if (((((_local3 != "null") && (_local3 != "undefined")) && (_local3 != "")) && (_local3 != undefined)) && (_local3.length > 0)) {
trace(("TEST GameShell loading in " + _local3) + " AS2 Mode");
_local4.loadClip(("http://cdn.doof.com/static/gameClient/shell/GameShell" + _local3) + "AS2.swf", _gameShell);
} else {
trace("TEST GameShell loading in external AS2 Mode");
_local4.loadClip("http://cdn.doof.com/static/gameClient/shell/GameShellAS2.swf", _gameShell);
}
}
function shellLoadCompleteHandler(gameShell) {
_gameShell = gameShell;
trace("shell load complete");
var _local2 = new LocalConnection();
var _local3 = _local2.domain();
_gameShell.setGameURL(getPageURL());
initShell();
}
function getPageURL() {
var _local1;
if (flash.external.ExternalInterface.available) {
trace("calling getPageURL in jscript");
_local1 = String(flash.external.ExternalInterface.call("document.location.href.toString"));
}
if ((((_local1 == "null") || (_local1 == "undefined")) || (_local1 == "")) || (_local1 == null)) {
_local1 = "unknown";
}
return(_local1);
}
function initShell() {
trace("GameConnector init();");
_gameShell.init(_parentRef, _gameID, _splashFinishedMethod, _restartGameMethod);
}
function gameStarted(initialScore) {
trace(("GameConnector gameStarted(" + initialScore) + ");");
_gameShell.gameStarted(initialScore);
}
function gameStat(statName, statValue) {
trace(((("GameConnector gameStat(" + statName) + ", ") + statValue) + ");");
_gameShell.gameStat(statName, statValue);
}
function gameEnded(finalScore) {
trace(("GameConnector gameEnded(" + finalScore) + ");");
_gameShell.gameEnded(finalScore);
}
}
Symbol 238 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.MainDevelopment] Frame 0
class com.novelgames.flashgames.commonAS2.MainDevelopment extends MovieClip
{
var title, attachMovie, titleDepth, instructions, game, getNextHighestDepth, onEnterFrame, stop;
function MainDevelopment () {
super();
}
static function initialize(movieClip) {
movieClip.__proto__ = com.novelgames.flashgames.commonAS2.MainDevelopment.prototype;
movieClip.onEnterFrame = movieClip.checkTitle;
_root.connector.gameStarted(0);
}
function gotoTitlePage() {
removePage();
title = com.novelgames.flashgames.commonAS2.Title(attachMovie("Title", "title", titleDepth));
}
function gotoInstructionsPage() {
removePage();
instructions = com.novelgames.flashgames.commonAS2.Instructions(attachMovie("Instructions", "instructions", titleDepth));
instructions.initialize();
}
function gotoGamePage() {
removePage();
game = attachMovie("Game", "game", titleDepth);
}
function showInstructionsFromGame() {
game.pause();
game._visible = false;
instructions = com.novelgames.flashgames.commonAS2.Instructions(attachMovie("Instructions", "instructions", getNextHighestDepth()));
instructions.swapDepths(titleDepth);
instructions.initialize(true);
}
function hideInstructionsFromGame() {
instructions.swapDepths(game.getDepth());
instructions.removeMovieClip();
instructions = null;
game._visible = true;
game.unpause();
}
function showHighScores() {
trace("showHighScores()");
}
function showEnterHighScore(score) {
trace(("showEnterHighScore(" + score) + ")");
_root.connector.gameEnded(score);
_root.sendApiScore(score);
}
function checkTitle() {
if (!title) {
return(undefined);
}
onEnterFrame = null;
stop();
titleDepth = title.getDepth();
}
function removePage() {
if (title) {
title.removeMovieClip();
title = null;
}
if (instructions) {
instructions.removeMovieClip();
instructions = null;
}
if (game) {
game.removeMovieClip();
game = null;
}
}
}
Symbol 239 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.Title] Frame 0
class com.novelgames.flashgames.commonAS2.Title extends MovieClip
{
var startButton, highScoresButton, moreGamesButton, _parent, getURL;
function Title () {
super();
startButton.onRelease = function () {
this._parent.startButtonClicked();
};
highScoresButton.onRelease = function () {
this._parent.highScoresButtonClicked();
};
moreGamesButton.onRelease = function () {
this._parent.moreGamesButtonClicked();
};
}
function startButtonClicked() {
_parent.gotoInstructionsPage();
}
function highScoresButtonClicked() {
_parent.showHighScores();
}
function moreGamesButtonClicked() {
getURL("http://www.novelgames.com", "_blank");
}
}
Symbol 240 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.Instructions] Frame 0
class com.novelgames.flashgames.commonAS2.Instructions extends MovieClip
{
var startButton, shownFromGame, _parent;
function Instructions () {
super();
startButton.onRelease = function () {
this._parent.startButtonClicked();
};
}
function initialize(shownFromGame) {
if (shownFromGame == undefined) {
shownFromGame = false;
}
this.shownFromGame = shownFromGame;
}
function startButtonClicked() {
if (!shownFromGame) {
_parent.gotoGamePage();
} else {
_parent.hideInstructionsFromGame();
}
}
}
Symbol 241 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.NewMovieClip] Frame 0
class com.novelgames.flashgames.commonAS2.NewMovieClip extends MovieClip
{
var _parent, _x, _y, _rotation, _visible, _alpha, _width, _height, _xscale, _yscale, _xmouse, _ymouse, _totalframes, _currentframe, _name, __mask, useHandCursor, __mouseEnabled, __mouseChildren, __numChildren, getInstanceAtDepth, getNextHighestDepth, onRelease, onRollOver, onRollOut, onPress, onReleaseOutside, onMouseMove, onEnterFrame, getURL, createMovieCount, attachMovie, createEmptyMovieClip;
function NewMovieClip () {
super();
}
function get parent() {
return(_parent);
}
function set x(x) {
_x = x;
//return(this.x);
}
function get x() {
return(_x);
}
function set y(y) {
_y = y;
//return(this.y);
}
function get y() {
return(_y);
}
function set rotation(rotation) {
_rotation = rotation;
//return(this.rotation);
}
function get rotation() {
return(_rotation);
}
function set visible(visible) {
_visible = visible;
//return(this.visible);
}
function get visible() {
return(_visible);
}
function set alpha(alpha) {
_alpha = alpha * 100;
//return(this.alpha);
}
function get alpha() {
return(_alpha / 100);
}
function get width() {
return(_width);
}
function set width(width) {
_width = width;
//return(this.width);
}
function get height() {
return(_height);
}
function set height(height) {
_height = height;
//return(this.height);
}
function set scaleX(scaleX) {
_xscale = scaleX * 100;
//return(this.scaleX);
}
function get scaleX() {
return(_xscale / 100);
}
function set scaleY(scaleY) {
_yscale = scaleY * 100;
//return(this.scaleY);
}
function get scaleY() {
return(_yscale / 100);
}
function set mouseX(mouseX) {
_xmouse = mouseX;
//return(this.mouseX);
}
function get mouseX() {
return(_xmouse);
}
function set mouseY(mouseY) {
_ymouse = mouseY;
//return(this.mouseY);
}
function get mouseY() {
return(_ymouse);
}
function get totalFrames() {
return(_totalframes);
}
function get currentFrame() {
return(_currentframe);
}
function get name() {
return(_name);
}
function set mask(mask) {
__mask = mask;
super.setMask(mask);
//return(this.mask);
}
function get mask() {
return(__mask);
}
function set buttonMode(buttonMode) {
useHandCursor = buttonMode;
//return(this.buttonMode);
}
function get buttonMode() {
return(useHandCursor);
}
function set mouseEnabled(mouseEnabled) {
__mouseEnabled = mouseEnabled;
//return(this.mouseEnabled);
}
function get mouseEnabled() {
return(__mouseEnabled);
}
function set mouseChildren(mouseChildren) {
__mouseChildren = mouseChildren;
//return(this.mouseChildren);
}
function get mouseChildren() {
return(__mouseChildren);
}
function get stage() {
return(com.novelgames.flashgames.commonAS2.NewStage.getNewStage());
}
function set numChildren(numChildren) {
__numChildren = numChildren;
//return(this.numChildren);
}
function get numChildren() {
if (__numChildren == undefined) {
__numChildren = 0;
}
return(__numChildren);
}
function get graphics() {
return(this);
}
function startDrag(lockCenter, bounds) {
if (lockCenter == undefined) {
super.startDrag();
} else if (bounds == undefined) {
super.startDrag(lockCenter);
} else {
super.startDrag(lockCenter, bounds.__get__left(), bounds.__get__top(), bounds.__get__right(), bounds.__get__bottom());
}
}
function beginFill(colour, alpha) {
if (alpha == undefined) {
alpha = 1;
}
super.beginFill(colour, alpha * 100);
}
function getBounds(target) {
var _local2 = super.getBounds(target);
return(new com.novelgames.flashgames.commonAS2.Rectangle(_local2.xMin, _local2.yMin, _local2.xMax - _local2.xMin, _local2.yMax - _local2.yMin));
}
function localToGlobal(point) {
var _local2 = {x:point.x, y:point.y};
super.localToGlobal(_local2);
return(_local2);
}
function globalToLocal(point) {
var _local2 = {x:point.x, y:point.y};
super.globalToLocal(_local2);
return(_local2);
}
function hitTestPoint(x, y, shapeFlag) {
if (shapeFlag == undefined) {
return(super.hitTest(x, y));
}
return(super.hitTest(x, y, shapeFlag));
}
function hitTestObject(obj) {
return(super.hitTest(obj));
}
function addChild(movieClip) {
if (movieClip.addedToParent) {
return(undefined);
}
if (movieClip._parent != this) {
trace("wrong addChild: " + [this, movieClip]);
}
if (movieClip == null) {
return(undefined);
}
addChildAt(movieClip, numChildren);
}
function addChildAt(movieClip, index) {
if (movieClip.addedToParent) {
return(undefined);
}
if (movieClip._parent != this) {
trace("wrong addChildAt: " + [this, movieClip]);
}
if (movieClip == null) {
return(undefined);
}
movieClip.addedToParent = true;
numChildren = ((numChildren+1));
setChildIndex(movieClip, index);
}
function removeChild(movieClip) {
if (!movieClip.addedToParent) {
return(undefined);
}
removeChildAt(movieClip.getDepth());
}
function removeChildAt(index) {
var _local5 = getInstanceAtDepth(index);
var _local3;
var _local2;
if (!_local5.addedToParent) {
return(undefined);
}
_local5.removeMovieClip();
_local3 = getNextHighestDepth();
_local2 = index + 1;
while (_local2 < _local3) {
getInstanceAtDepth(_local2).swapDepths(_local2 - 1);
_local2++;
}
numChildren = ((numChildren-1));
}
function setChildIndex(child, index) {
var _local3 = child.getDepth();
var _local2;
var _local1;
if (_local3 == index) {
return(undefined);
}
_local2 = ((_local3 < index) ? 1 : -1);
_local1 = _local3;
while (_local1 != index) {
child.swapDepths(_local1 + _local2);
_local1 = _local1 + _local2;
}
}
function getChildIndex(child) {
return(child.getDepth());
}
function addEventListener(type, listenerObject, listenerFunctionName) {
switch (type) {
case com.novelgames.flashgames.commonAS2.MouseEvent.CLICK :
onRelease = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OVER :
onRollOver = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OUT :
onRollOut = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_DOWN :
onPress = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_UP :
onRelease = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
onReleaseOutside = onRelease;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_MOVE :
onMouseMove = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.Event.ENTER_FRAME :
onEnterFrame = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
}
}
function removeEventListener(type) {
switch (type) {
case com.novelgames.flashgames.commonAS2.MouseEvent.CLICK :
onRelease = null;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OVER :
onRollOver = null;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OUT :
onRollOut = null;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_DOWN :
onPress = null;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_UP :
onRelease = null;
onReleaseOutside = null;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_MOVE :
onMouseMove = null;
break;
case com.novelgames.flashgames.commonAS2.Event.ENTER_FRAME :
onEnterFrame = null;
}
}
function navigateToURL(urlRequest, window) {
getURL(urlRequest.url, window);
}
function createMovie(name) {
var _local4 = getNextHighestDepth();
var _local2;
if (createMovieCount == undefined) {
createMovieCount = 0;
}
if (name) {
_local2 = attachMovie(name, (name + "_") + createMovieCount, _local4);
} else {
_local2 = createEmptyMovieClip((name + "_") + createMovieCount, _local4);
_local2.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
}
_local2.addedToParent = false;
createMovieCount++;
return(_local2);
}
function createSound(name) {
return(new com.novelgames.flashgames.commonAS2.NewSound(this, name));
}
}
Symbol 242 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.NewStage] Frame 0
class com.novelgames.flashgames.commonAS2.NewStage
{
var addedListener, onKeyDown, onKeyUp;
function NewStage () {
addedListener = false;
onKeyDown = null;
onKeyUp = null;
}
static function getNewStage() {
if (newStage == null) {
newStage = new com.novelgames.flashgames.commonAS2.NewStage();
}
return(newStage);
}
function get stageWidth() {
return(Stage.width);
}
function get stageHeight() {
return(Stage.height);
}
function set focus(object) {
Selection.setFocus(object);
//return(focus);
}
function get focus() {
return(Selection.getFocus());
}
function addEventListener(type, listenerObject, listenerFunctionName) {
if (!addedListener) {
Key.addListener(this);
addedListener = true;
}
switch (type) {
case com.novelgames.flashgames.commonAS2.KeyboardEvent.KEY_DOWN :
onKeyDown = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.KeyboardEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.KeyboardEvent.KEY_UP :
onKeyUp = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.KeyboardEvent(this));
};
}
}
function removeEventListener(type) {
switch (type) {
case com.novelgames.flashgames.commonAS2.KeyboardEvent.KEY_DOWN :
onKeyDown = null;
break;
case com.novelgames.flashgames.commonAS2.KeyboardEvent.KEY_UP :
onKeyUp = null;
}
}
static var newStage = null;
}
Symbol 243 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.KeyboardEvent] Frame 0
class com.novelgames.flashgames.commonAS2.KeyboardEvent
{
function KeyboardEvent () {
}
function get charCode() {
return(Key.getAscii());
}
function get keyCode() {
return(Key.getCode());
}
function updateAfterEvent() {
_global.updateAfterEvent();
}
static var KEY_DOWN = "keyDown";
static var KEY_UP = "keyUp";
}
Symbol 244 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.Rectangle] Frame 0
class com.novelgames.flashgames.commonAS2.Rectangle
{
var x, y, width, height;
function Rectangle (x, y, width, height) {
this.x = x;
this.y = y;
this.width = width;
this.height = height;
}
function get left() {
return(x);
}
function set left(left) {
x = left;
//return(this.left);
}
function get top() {
return(y);
}
function set top(top) {
y = top;
//return(this.top);
}
function get right() {
return(x + width);
}
function set right(right) {
width = right - x;
//return(this.right);
}
function get bottom() {
return(y + height);
}
function set bottom(bottom) {
height = bottom - y;
//return(this.bottom);
}
function get size() {
return({x:width, y:height});
}
function set size(size) {
width = size.x;
height = size.y;
//return(this.size);
}
function get topLeft() {
return({x:x, y:y});
}
function set topLeft(topLeft) {
x = topLeft.x;
y = topLeft.y;
//return(this.topLeft);
}
function get bottomRight() {
return({x:x + width, y:y + height});
}
function set bottomRight(bottomRight) {
width = x - bottomRight.x;
height = y - bottomRight.y;
//return(this.bottomRight);
}
}
Symbol 245 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.MouseEvent] Frame 0
class com.novelgames.flashgames.commonAS2.MouseEvent
{
var target, currentTarget;
function MouseEvent (target) {
this.target = target;
currentTarget = target;
}
function updateAfterEvent() {
_global.updateAfterEvent();
}
static var CLICK = "click";
static var DOUBLE_CLICK = "doubleClick";
static var MOUSE_DOWN = "mouseDown";
static var MOUSE_MOVE = "mouseMove";
static var MOUSE_OUT = "mouseOut";
static var MOUSE_OVER = "mouseOver";
static var MOUSE_UP = "mouseUp";
static var MOUSE_WHEEL = "mouseWheel";
static var ROLL_OUT = "rollOut";
static var ROLL_OVER = "rollOver";
}
Symbol 246 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.Event] Frame 0
class com.novelgames.flashgames.commonAS2.Event
{
function Event () {
}
static var ENTER_FRAME = "enterFrame";
}
Symbol 247 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.URLRequest] Frame 0
class com.novelgames.flashgames.commonAS2.URLRequest
{
var url;
function URLRequest (url) {
this.url = url;
}
}
Symbol 248 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.NewSound] Frame 0
class com.novelgames.flashgames.commonAS2.NewSound extends Sound
{
var attachSound, start;
function NewSound (target, symbolName) {
super(target);
attachSound(symbolName);
}
function play() {
start();
}
}
Symbol 249 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.InstructionsButton] Frame 0
class com.novelgames.flashgames.commonAS2.InstructionsButton extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var onRelease;
function InstructionsButton () {
super();
onRelease = function () {
this._parent._parent.showInstructionsFromGame();
};
}
}
Symbol 250 MovieClip [__Packages.com.novelgames.flashgames.parkingAS2.MessagePlayAgain] Frame 0
class com.novelgames.flashgames.parkingAS2.MessagePlayAgain extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var playAgainButton, homeButton;
function MessagePlayAgain () {
super();
playAgainButton.__proto__ = com.novelgames.flashgames.commonAS2.NewButton.prototype;
homeButton.__proto__ = com.novelgames.flashgames.commonAS2.NewButton.prototype;
}
}
Symbol 251 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.NewButton] Frame 0
class com.novelgames.flashgames.commonAS2.NewButton extends Button
{
var _xmouse, _ymouse, _visible, _alpha, _name, onRelease, onRollOver, onRollOut, onPress, onReleaseOutside;
function NewButton () {
super();
}
function set mouseX(mouseX) {
_xmouse = mouseX;
//return(this.mouseX);
}
function get mouseX() {
return(_xmouse);
}
function set mouseY(mouseY) {
_ymouse = mouseY;
//return(this.mouseY);
}
function get mouseY() {
return(_ymouse);
}
function set visible(visible) {
_visible = visible;
//return(this.visible);
}
function get visible() {
return(_visible);
}
function set alpha(alpha) {
_alpha = alpha * 100;
//return(this.alpha);
}
function get alpha() {
return(_alpha / 100);
}
function get name() {
return(_name);
}
function addEventListener(type, listenerObject, listenerFunctionName) {
switch (type) {
case com.novelgames.flashgames.commonAS2.MouseEvent.CLICK :
onRelease = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OVER :
onRollOver = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OUT :
onRollOut = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_DOWN :
onPress = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_UP :
onRelease = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
onReleaseOutside = onRelease;
}
}
function removeEventListener(type) {
switch (type) {
case com.novelgames.flashgames.commonAS2.MouseEvent.CLICK :
onRelease = null;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OVER :
onRollOver = null;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OUT :
onRollOut = null;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_DOWN :
onPress = null;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_UP :
onRelease = null;
onReleaseOutside = null;
}
}
}
Symbol 252 MovieClip [__Packages.com.novelgames.flashgames.parkingAS2.ParkingSpace] Frame 0
class com.novelgames.flashgames.parkingAS2.ParkingSpace extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var interior, line0, line1, line2, line3;
function ParkingSpace () {
super();
interior.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
line0.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
line1.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
line2.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
line3.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
}
function checkCarIsInside(car) {
if (!checkWheelIsInside(car.wheelFL)) {
return(false);
}
if (!checkWheelIsInside(car.wheelFR)) {
return(false);
}
if (!checkWheelIsInside(car.wheelRL)) {
return(false);
}
if (!checkWheelIsInside(car.wheelRR)) {
return(false);
}
return(true);
}
function checkWheelIsInside(wheel) {
if (!interior.hitTestObject(wheel)) {
return(false);
}
if (line0.hitTestObject(wheel)) {
return(false);
}
if (line1.hitTestObject(wheel)) {
return(false);
}
if (line2.hitTestObject(wheel)) {
return(false);
}
if (line3.hitTestObject(wheel)) {
return(false);
}
return(true);
}
}
Symbol 253 MovieClip [__Packages.com.novelgames.flashgames.parkingAS2.Car] Frame 0
class com.novelgames.flashgames.parkingAS2.Car extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var lights, body, wheelFL, wheelFR, wheelRL, wheelRR, speed, wheelAngle, isTurningLeft, isTurningRight, isMovingForward, isMovingBackward, frontWheelsY, localToGlobal, __set__x, __set__y, rotation;
function Car () {
super();
lights.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
body.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
wheelFL.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
wheelFR.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
wheelRL.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
wheelRR.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
speed = 0;
wheelAngle = 0;
isTurningLeft = false;
isTurningRight = false;
isMovingForward = false;
isMovingBackward = false;
frontWheelsY = wheelFL.y;
lights.__set__visible(false);
}
function showLights() {
lights.__set__visible(true);
}
function hideLights() {
lights.__set__visible(false);
}
function move(dTime) {
var _local5;
var _local12;
var _local11;
var _local2;
var _local9;
var _local8;
var _local6;
var _local10;
var _local3;
var _local7;
if (isMovingForward) {
speed = speed + ((com.novelgames.flashgames.parkingAS2.Config.CAR_ACCELERATION * dTime) / 1000);
} else if (isMovingBackward) {
speed = speed - ((com.novelgames.flashgames.parkingAS2.Config.CAR_ACCELERATION * dTime) / 1000);
}
if (speed > 0) {
speed = speed - ((com.novelgames.flashgames.parkingAS2.Config.CAR_DECELERATION * dTime) / 1000);
if (speed < 0) {
speed = 0;
}
} else if (speed < 0) {
speed = speed + ((com.novelgames.flashgames.parkingAS2.Config.CAR_DECELERATION * dTime) / 1000);
if (speed > 0) {
speed = 0;
}
}
if (isTurningLeft) {
wheelAngle = wheelAngle - ((com.novelgames.flashgames.parkingAS2.Config.CAR_TURNSPEED * dTime) / 1000);
if (wheelAngle < (-com.novelgames.flashgames.parkingAS2.Config.CAR_MAXWHEELANGLE)) {
wheelAngle = -com.novelgames.flashgames.parkingAS2.Config.CAR_MAXWHEELANGLE;
}
} else if (isTurningRight) {
wheelAngle = wheelAngle + ((com.novelgames.flashgames.parkingAS2.Config.CAR_TURNSPEED * dTime) / 1000);
if (wheelAngle > com.novelgames.flashgames.parkingAS2.Config.CAR_MAXWHEELANGLE) {
wheelAngle = com.novelgames.flashgames.parkingAS2.Config.CAR_MAXWHEELANGLE;
}
}
updateFrontWheels();
_local2 = (speed * dTime) / 1000;
if (speed == 0) {
return(undefined);
}
_local8 = 1;
_local6 = (2 * ((-frontWheelsY) - _local2)) * Math.cos((wheelAngle * Math.PI) / 180);
_local10 = (((-frontWheelsY) - _local2) * ((-frontWheelsY) - _local2)) - (frontWheelsY * frontWheelsY);
_local9 = ((-_local6) + Math.sqrt((_local6 * _local6) - ((4 * _local8) * _local10))) / (2 * _local8);
_local3 = (((_local9 * _local9) - (((-frontWheelsY) - _local2) * ((-frontWheelsY) - _local2))) - (frontWheelsY * frontWheelsY)) / ((-2 * ((-frontWheelsY) - _local2)) * (-frontWheelsY));
if (_local3 < -1) {
_local3 = -1;
} else if (_local3 > 1) {
_local3 = 1;
}
_local7 = Math.acos(_local3);
_local7 = (((Math.abs(_local7) * 180) / Math.PI) * ((wheelAngle > 0) ? 1 : -1)) * ((speed > 0) ? 1 : -1);
_local5 = new Object({x:0, y:-_local2});
_local5 = localToGlobal(_local5);
_local12 = _local5.x;
_local11 = _local5.y;
__set__x(_local12);
__set__y(_local11);
rotation = rotation + _local7;
}
function updateFrontWheels() {
wheelFL.__set__rotation(wheelAngle);
wheelFR.__set__rotation(wheelAngle);
}
}
Symbol 254 MovieClip [__Packages.com.novelgames.flashgames.parkingAS2.Config] Frame 0
class com.novelgames.flashgames.parkingAS2.Config
{
function Config () {
}
static var CAR_MAXSPEED = 300;
static var CAR_MAXWHEELANGLE = 40;
static var CAR_ACCELERATION = 350;
static var CAR_DECELERATION = 200;
static var CAR_TURNSPEED = 80;
static var CAR_CRASHTOLERANCE = 3;
static var LEVEL_TOTAL = 10;
static var LEVEL_TIMEBONUSES = [6000, 9000, 12000, 15000, 10000, 12000, 15000, 20000, 30000, 60000];
static var SCORE_LEVEL = 1000;
static var SCORE_TIME = 1;
static var SCORE_SINGLEMOVE = 1000;
static var MESSAGE_LEVELTIME = 2000;
static var MESSAGE_CLEARTIME = 2000;
static var MESSAGE_ALLCLEARTIME = 1500;
static var MESSAGE_GAMEOVERTIME = 2000;
}
Symbol 255 MovieClip [__Packages.com.novelgames.flashgames.parkingAS2.Wheel] Frame 0
class com.novelgames.flashgames.parkingAS2.Wheel extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
function Wheel () {
super();
}
}
Symbol 256 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.MuteButton] Frame 0
class com.novelgames.flashgames.commonAS2.MuteButton extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var gotoAndStop;
function MuteButton () {
super();
if (new Sound().getVolume() == 0) {
showOff();
} else {
showOn();
}
}
function onPress() {
if (new Sound().getVolume() == 0) {
new Sound().setVolume(100);
showOn();
} else {
new Sound().setVolume(0);
showOff();
}
}
function showOff() {
gotoAndStop("off");
}
function showOn() {
gotoAndStop("on");
}
}
Symbol 257 MovieClip [__Packages.com.novelgames.flashgames.parkingAS2.Message] Frame 0
class com.novelgames.flashgames.parkingAS2.Message extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var stop, gotoAndStop, messageLevel, createMovie, addChild, messageClear, messagePlayAgain, removeChild, __get__parent;
function Message () {
super();
stop();
}
function showLevel(level) {
hide();
gotoAndStop("hide");
messageLevel = com.novelgames.flashgames.parkingAS2.MessageLevel(createMovie("MessageLevel"));
messageLevel.levelText.text = level.toString();
addChild(messageLevel);
}
function showClear(timeBonus, singleMoveBonus) {
hide();
gotoAndStop("hide");
messageClear = com.novelgames.flashgames.parkingAS2.MessageClear(createMovie("MessageClear"));
messageClear.clearBonusText.text = com.novelgames.flashgames.parkingAS2.Config.SCORE_LEVEL.toString();
messageClear.timeBonusText.text = timeBonus.toString();
messageClear.singleMoveBonusText.text = singleMoveBonus.toString();
addChild(messageClear);
}
function showAllClear() {
hide();
gotoAndStop("allClear");
}
function showGameOver() {
hide();
gotoAndStop("gameOver");
}
function showPlayAgain() {
hide();
gotoAndStop("hide");
messagePlayAgain = com.novelgames.flashgames.parkingAS2.MessagePlayAgain(createMovie("MessagePlayAgain"));
messagePlayAgain.playAgainButton.addEventListener(com.novelgames.flashgames.commonAS2.MouseEvent.CLICK, this, "playAgainButtonClicked");
messagePlayAgain.homeButton.addEventListener(com.novelgames.flashgames.commonAS2.MouseEvent.CLICK, this, "homeButtonClicked");
addChild(messagePlayAgain);
}
function hide() {
if (messageLevel) {
removeChild(messageLevel);
messageLevel = null;
}
if (messageClear) {
removeChild(messageClear);
messageClear = null;
}
if (messagePlayAgain) {
removeChild(messagePlayAgain);
messagePlayAgain = null;
}
gotoAndStop("hide");
}
function playAgainButtonClicked(mouseEvent) {
Object(__get__parent().parent).gotoGamePage();
}
function homeButtonClicked(mouseEvent) {
Object(__get__parent().parent).gotoTitlePage();
}
}
Symbol 258 MovieClip [__Packages.com.novelgames.flashgames.parkingAS2.MessageLevel] Frame 0
class com.novelgames.flashgames.parkingAS2.MessageLevel extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var levelText;
function MessageLevel () {
super();
levelText.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
}
}
Symbol 259 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.NewTextField] Frame 0
class com.novelgames.flashgames.commonAS2.NewTextField extends TextField
{
var _x, _y, _rotation, _visible, _alpha, _width, _height, scroll, maxscroll;
function NewTextField () {
super();
}
function set x(x) {
_x = x;
//return(this.x);
}
function get x() {
return(_x);
}
function set y(y) {
_y = y;
//return(this.y);
}
function get y() {
return(_y);
}
function set rotation(rotation) {
_rotation = rotation;
//return(this.rotation);
}
function get rotation() {
return(_rotation);
}
function set visible(visible) {
_visible = visible;
//return(this.visible);
}
function get visible() {
return(_visible);
}
function set alpha(alpha) {
_alpha = alpha * 100;
//return(this.alpha);
}
function get alpha() {
return(_alpha / 100);
}
function get width() {
return(_width);
}
function set width(width) {
_width = width;
//return(this.width);
}
function get height() {
return(_height);
}
function set height(height) {
_height = height;
//return(this.height);
}
function set scrollV(scrollV) {
scroll = scrollV;
//return(this.scrollV);
}
function get scrollV() {
return(scroll);
}
function set maxScrollV(maxScrollV) {
maxscroll = maxScrollV;
//return(this.maxScrollV);
}
function get maxScrollV() {
return(maxscroll);
}
function setTextFormat(textFormat, beginIndex, endIndex) {
if ((beginIndex == undefined) || (endIndex == undefined)) {
super.setTextFormat(textFormat);
} else {
super.setTextFormat(beginIndex, endIndex, textFormat);
}
}
}
Symbol 260 MovieClip [__Packages.com.novelgames.flashgames.parkingAS2.MessageClear] Frame 0
class com.novelgames.flashgames.parkingAS2.MessageClear extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var clearBonusText, timeBonusText, singleMoveBonusText;
function MessageClear () {
super();
clearBonusText.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
timeBonusText.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
singleMoveBonusText.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
}
}
Symbol 261 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.CommonGame] Frame 0
class com.novelgames.flashgames.commonAS2.CommonGame extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
function CommonGame () {
super();
}
static function get gameStage() {
return(com.novelgames.flashgames.commonAS2.NewStage.getNewStage());
}
function pause() {
com.novelgames.flashgames.commonAS2.NewTimer.pause();
}
function unpause() {
com.novelgames.flashgames.commonAS2.NewTimer.unpause();
}
}
Symbol 262 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.Timer] Frame 0
interface com.novelgames.flashgames.commonAS2.Timer
{
}
Symbol 263 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.NewTimer] Frame 0
class com.novelgames.flashgames.commonAS2.NewTimer implements com.novelgames.flashgames.commonAS2.Timer
{
static var pauseTime;
var delay, repeatCount, currentCount, listenerObject, listenerFunctionName, adjustedStartTime, usingDelay, intervalID;
function NewTimer (delay, repeatCount) {
if (repeatCount == undefined) {
repeatCount = 0;
}
this.delay = delay;
this.repeatCount = repeatCount;
currentCount = 0;
}
static function getTimer() {
if (paused) {
return(pauseTime - totalPausedTime);
}
return(getTimer() - totalPausedTime);
}
static function pause() {
if (paused) {
return(undefined);
}
paused = true;
pauseTime = getTimer();
}
static function unpause() {
if (!paused) {
return(undefined);
}
paused = false;
totalPausedTime = totalPausedTime + (getTimer() - pauseTime);
}
function addEventListener(type, listenerObject, listenerFunctionName) {
if (type != com.novelgames.flashgames.commonAS2.TimerEvent.TIMER) {
return(undefined);
}
this.listenerObject = listenerObject;
this.listenerFunctionName = listenerFunctionName;
}
function removeEventListener(type) {
if (type != com.novelgames.flashgames.commonAS2.TimerEvent.TIMER) {
return(undefined);
}
listenerObject = null;
listenerFunctionName = null;
}
function start() {
adjustedStartTime = getTimer();
usingDelay = delay;
clearInterval(intervalID);
intervalID = setInterval(this, "timerEventListener", delay);
}
function stop() {
clearInterval(intervalID);
}
function timerEventListener() {
currentCount++;
if (paused) {
clearInterval(intervalID);
usingDelay = Math.max(delay - (getTimer() - adjustedStartTime), 1);
currentCount--;
intervalID = setInterval(this, "timerEventListener", usingDelay);
return(undefined);
}
if ((getTimer() - adjustedStartTime) >= delay) {
adjustedStartTime = getTimer();
if (usingDelay != delay) {
clearInterval(intervalID);
usingDelay = delay;
intervalID = setInterval(this, "timerEventListener", usingDelay);
}
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.TimerEvent());
if ((repeatCount != 0) && (currentCount >= repeatCount)) {
clearInterval(intervalID);
}
} else {
clearInterval(intervalID);
usingDelay = Math.max(delay - (getTimer() - adjustedStartTime), 1);
currentCount--;
intervalID = setInterval(this, "timerEventListener", usingDelay);
}
}
static var paused = false;
static var totalPausedTime = 0;
}
Symbol 264 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.TimerEvent] Frame 0
class com.novelgames.flashgames.commonAS2.TimerEvent
{
function TimerEvent () {
}
function updateAfterEvent() {
_global.updateAfterEvent();
}
static var TIMER = "timer";
}
Symbol 265 MovieClip [__Packages.com.novelgames.flashgames.parkingAS2.Game] Frame 0
class com.novelgames.flashgames.parkingAS2.Game extends com.novelgames.flashgames.commonAS2.CommonGame
{
var message, timeText, movesText, levelsHolder, score, soundClear, createSound, soundCrash, soundAllClear, __time, __moves, level, levelArea, car, targetSpace, timer, carHasMoved, startLevelTime, lastTime, carWasMovingForward, __get__parent;
function Game () {
super();
message.__proto__ = com.novelgames.flashgames.parkingAS2.Message.prototype;
timeText.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
movesText.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
levelsHolder.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
score = 0;
startLevel(1);
com.novelgames.flashgames.commonAS2.CommonGame.__get__gameStage().__set__focus(com.novelgames.flashgames.commonAS2.CommonGame.gameStage);
com.novelgames.flashgames.commonAS2.CommonGame.__get__gameStage().addEventListener(com.novelgames.flashgames.commonAS2.KeyboardEvent.KEY_DOWN, this, "onPlayKeyDown");
com.novelgames.flashgames.commonAS2.CommonGame.__get__gameStage().addEventListener(com.novelgames.flashgames.commonAS2.KeyboardEvent.KEY_UP, this, "onPlayKeyUp");
soundClear = createSound("SoundClear");
soundCrash = createSound("SoundCrash");
soundAllClear = createSound("SoundAllClear");
}
function set time(time) {
__time = time;
timeText.text = time.toString();
//return(this.time);
}
function get time() {
return(__time);
}
function set moves(moves) {
__moves = moves;
movesText.text = moves.toString();
//return(this.moves);
}
function get moves() {
return(__moves);
}
function startLevel(level) {
this.level = level;
if (levelArea) {
levelsHolder.removeChild(levelArea);
}
levelArea = com.novelgames.flashgames.parkingAS2.Level(levelsHolder.createMovie("Level" + level));
car = levelArea.car;
targetSpace = levelArea.targetSpace;
levelsHolder.addChild(levelArea);
time = (0);
moves = (0);
message.showLevel(level);
timer = new com.novelgames.flashgames.commonAS2.NewTimer(com.novelgames.flashgames.parkingAS2.Config.MESSAGE_LEVELTIME, 1);
timer.addEventListener(com.novelgames.flashgames.commonAS2.TimerEvent.TIMER, this, "startPlay");
timer.start();
}
function startPlay(timerEvent) {
message.hide();
car.showLights();
carHasMoved = false;
startLevelTime = com.novelgames.flashgames.commonAS2.NewTimer.getTimer();
lastTime = startLevelTime;
timer = new com.novelgames.flashgames.commonAS2.NewTimer(1, 0);
timer.addEventListener(com.novelgames.flashgames.commonAS2.TimerEvent.TIMER, this, "onPlayTime");
timer.start();
}
function onPlayKeyDown(keyboardEvent) {
switch (keyboardEvent.__get__keyCode()) {
case com.novelgames.flashgames.commonAS2.Keyboard.LEFT :
car.isTurningLeft = true;
break;
case com.novelgames.flashgames.commonAS2.Keyboard.RIGHT :
car.isTurningRight = true;
break;
case com.novelgames.flashgames.commonAS2.Keyboard.UP :
car.isMovingForward = true;
break;
case com.novelgames.flashgames.commonAS2.Keyboard.DOWN :
car.isMovingBackward = true;
}
}
function onPlayKeyUp(keyboardEvent) {
switch (keyboardEvent.__get__keyCode()) {
case com.novelgames.flashgames.commonAS2.Keyboard.LEFT :
car.isTurningLeft = false;
break;
case com.novelgames.flashgames.commonAS2.Keyboard.RIGHT :
car.isTurningRight = false;
break;
case com.novelgames.flashgames.commonAS2.Keyboard.UP :
car.isMovingForward = false;
break;
case com.novelgames.flashgames.commonAS2.Keyboard.DOWN :
car.isMovingBackward = false;
}
}
function onPlayTime(timerEvent) {
var _local2 = com.novelgames.flashgames.commonAS2.NewTimer.getTimer();
timerEvent.updateAfterEvent();
updateTime(_local2);
moveCar(_local2);
lastTime = _local2;
if (!checkCrash()) {
checkWin();
}
}
function updateTime(time) {
this.time = (time - startLevelTime);
}
function moveCar(time) {
if (car.speed > 0) {
carWasMovingForward = true;
} else if (car.speed < 0) {
carWasMovingForward = false;
}
car.move(time - lastTime);
if ((car.speed > 0) && ((!carHasMoved) || (!carWasMovingForward))) {
carHasMoved = true;
moves = ((moves+1));
} else if ((car.speed < 0) && ((!carHasMoved) || (carWasMovingForward))) {
carHasMoved = true;
moves = ((moves+1));
}
}
function checkCrash() {
if (!levelArea.checkCrash()) {
return(false);
}
car.hideLights();
timer.stop();
message.showGameOver();
soundCrash.play();
timer = new com.novelgames.flashgames.commonAS2.NewTimer(com.novelgames.flashgames.parkingAS2.Config.MESSAGE_GAMEOVERTIME, 1);
timer.addEventListener(com.novelgames.flashgames.commonAS2.TimerEvent.TIMER, this, "showPlayAgain");
timer.start();
return(true);
}
function checkWin() {
var _local2;
var _local3;
if (car.speed != 0) {
return(false);
}
if (!targetSpace.checkCarIsInside(car)) {
return(false);
}
car.hideLights();
timer.stop();
_local2 = com.novelgames.flashgames.parkingAS2.Config.LEVEL_TIMEBONUSES[level - 1] - (time * com.novelgames.flashgames.parkingAS2.Config.SCORE_TIME);
if (_local2 < 0) {
_local2 = 0;
}
_local3 = ((moves <= 1) ? (com.novelgames.flashgames.parkingAS2.Config.SCORE_SINGLEMOVE) : 0);
score = score + ((com.novelgames.flashgames.parkingAS2.Config.SCORE_LEVEL + _local2) + _local3);
message.showClear(_local2, _local3);
soundClear.play();
timer = new com.novelgames.flashgames.commonAS2.NewTimer(com.novelgames.flashgames.parkingAS2.Config.MESSAGE_CLEARTIME, 1);
timer.addEventListener(com.novelgames.flashgames.commonAS2.TimerEvent.TIMER, this, "startNextLevel");
timer.start();
return(true);
}
function startNextLevel(timerEvent) {
if (level < com.novelgames.flashgames.parkingAS2.Config.LEVEL_TOTAL) {
startLevel(level + 1);
} else {
message.showAllClear();
soundAllClear.play();
timer = new com.novelgames.flashgames.commonAS2.NewTimer(com.novelgames.flashgames.parkingAS2.Config.MESSAGE_ALLCLEARTIME, 1);
timer.addEventListener(com.novelgames.flashgames.commonAS2.TimerEvent.TIMER, this, "showPlayAgain");
timer.start();
}
}
function showPlayAgain(timerEvent) {
Object(__get__parent()).showEnterHighScore(score);
}
}
Symbol 266 MovieClip [__Packages.com.novelgames.flashgames.parkingAS2.Level] Frame 0
class com.novelgames.flashgames.parkingAS2.Level extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var obstacles, car, createMovie, addChild;
function Level () {
super();
}
function registerObstacle(obstacle) {
if (!obstacles) {
obstacles = new Array();
}
obstacles.push(obstacle);
}
function checkCrash() {
var _local3;
var _local4;
var _local2;
_local2 = 0;
while (_local2 < obstacles.length) {
_local3 = obstacles[_local2].getHitCarPoint(car.body);
if (_local3 != null) {
break;
}
_local2++;
}
if (_local2 >= obstacles.length) {
return(false);
}
_local4 = com.novelgames.flashgames.parkingAS2.Spark(createMovie("Spark"));
_local4.x = _local3.x;
_local4.y = _local3.y;
addChild(_local4);
return(true);
}
}
Symbol 267 MovieClip [__Packages.com.novelgames.flashgames.parkingAS2.Obstacle] Frame 0
class com.novelgames.flashgames.parkingAS2.Obstacle extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var __get__parent, getBounds, hitTestPoint;
function Obstacle () {
super();
Object(__get__parent()).registerObstacle(this);
}
function getHitCarPoint(carBody) {
var _local2 = getBounds(com.novelgames.flashgames.commonAS2.NewMovieClip(__get__parent()));
var _local3;
_local2.left = _local2.left + com.novelgames.flashgames.parkingAS2.Config.CAR_CRASHTOLERANCE;
_local2.top = _local2.top + com.novelgames.flashgames.parkingAS2.Config.CAR_CRASHTOLERANCE;
_local2.right = _local2.right - com.novelgames.flashgames.parkingAS2.Config.CAR_CRASHTOLERANCE;
_local2.bottom = _local2.bottom - com.novelgames.flashgames.parkingAS2.Config.CAR_CRASHTOLERANCE;
if (carBody.hitTestPoint(_local2.__get__left(), _local2.__get__top(), true)) {
return(new Object({x:_local2.__get__left(), y:_local2.__get__top()}));
}
if (carBody.hitTestPoint(_local2.__get__right(), _local2.__get__top(), true)) {
return(new Object({x:_local2.__get__right(), y:_local2.__get__top()}));
}
if (carBody.hitTestPoint(_local2.__get__right(), _local2.__get__bottom(), true)) {
return(new Object({x:_local2.__get__right(), y:_local2.__get__bottom()}));
}
if (carBody.hitTestPoint(_local2.__get__left(), _local2.__get__bottom(), true)) {
return(new Object({x:_local2.__get__left(), y:_local2.__get__bottom()}));
}
_local2 = carBody.getBounds(carBody);
_local2.left = _local2.left + com.novelgames.flashgames.parkingAS2.Config.CAR_CRASHTOLERANCE;
_local2.top = _local2.top + com.novelgames.flashgames.parkingAS2.Config.CAR_CRASHTOLERANCE;
_local2.right = _local2.right - com.novelgames.flashgames.parkingAS2.Config.CAR_CRASHTOLERANCE;
_local2.bottom = _local2.bottom - com.novelgames.flashgames.parkingAS2.Config.CAR_CRASHTOLERANCE;
_local3 = carBody.localToGlobal(new Object({x:_local2.__get__left(), y:_local2.__get__top()}));
if (hitTestPoint(_local3.x, _local3.y, true)) {
return(_local3);
}
_local3 = carBody.localToGlobal(new Object({x:_local2.__get__right(), y:_local2.__get__top()}));
if (hitTestPoint(_local3.x, _local3.y, true)) {
return(_local3);
}
_local3 = carBody.localToGlobal(new Object({x:_local2.__get__right(), y:_local2.__get__bottom()}));
if (hitTestPoint(_local3.x, _local3.y, true)) {
return(_local3);
}
_local3 = carBody.localToGlobal(new Object({x:_local2.__get__left(), y:_local2.__get__bottom()}));
if (hitTestPoint(_local3.x, _local3.y, true)) {
return(_local3);
}
return(null);
}
}
Symbol 268 MovieClip [__Packages.com.novelgames.flashgames.parkingAS2.Spark] Frame 0
class com.novelgames.flashgames.parkingAS2.Spark extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
function Spark () {
super();
}
}
Symbol 269 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.Keyboard] Frame 0
class com.novelgames.flashgames.commonAS2.Keyboard
{
function Keyboard () {
}
static var LEFT = 37;
static var RIGHT = 39;
static var UP = 38;
static var DOWN = 40;
static var SPACE = 32;
static var BACKSPACE = 8;
static var SHIFT = 16;
static var ENTER = 13;
}
Symbol 270 MovieClip [__Packages.com.novelgames.flashgames.parkingAS2.Wall] Frame 0
class com.novelgames.flashgames.parkingAS2.Wall extends com.novelgames.flashgames.parkingAS2.Obstacle
{
function Wall () {
super();
}
}
Symbol 271 MovieClip [__Packages.com.novelgames.flashgames.parkingAS2.Car3] Frame 0
class com.novelgames.flashgames.parkingAS2.Car3 extends com.novelgames.flashgames.parkingAS2.Obstacle
{
function Car3 () {
super();
}
}
Symbol 272 MovieClip [__Packages.com.novelgames.flashgames.parkingAS2.Car2] Frame 0
class com.novelgames.flashgames.parkingAS2.Car2 extends com.novelgames.flashgames.parkingAS2.Obstacle
{
function Car2 () {
super();
}
}
Symbol 273 MovieClip [__Packages.com.novelgames.flashgames.parkingAS2.Car1] Frame 0
class com.novelgames.flashgames.parkingAS2.Car1 extends com.novelgames.flashgames.parkingAS2.Obstacle
{
function Car1 () {
super();
}
}
Symbol 274 MovieClip [__Packages.com.novelgames.flashgames.parkingAS2.Tree] Frame 0
class com.novelgames.flashgames.parkingAS2.Tree extends com.novelgames.flashgames.parkingAS2.Obstacle
{
function Tree () {
super();
}
}
Symbol 275 MovieClip [__Packages.com.novelgames.flashgames.parkingAS2.Level10] Frame 0
class com.novelgames.flashgames.parkingAS2.Level10 extends com.novelgames.flashgames.parkingAS2.Level
{
var car, targetSpace;
function Level10 () {
super();
car.__proto__ = com.novelgames.flashgames.parkingAS2.Car.prototype;
targetSpace.__proto__ = com.novelgames.flashgames.parkingAS2.ParkingSpace.prototype;
}
}
Symbol 276 MovieClip [__Packages.com.novelgames.flashgames.parkingAS2.Level9] Frame 0
class com.novelgames.flashgames.parkingAS2.Level9 extends com.novelgames.flashgames.parkingAS2.Level
{
var car, targetSpace;
function Level9 () {
super();
car.__proto__ = com.novelgames.flashgames.parkingAS2.Car.prototype;
targetSpace.__proto__ = com.novelgames.flashgames.parkingAS2.ParkingSpace.prototype;
}
}
Symbol 277 MovieClip [__Packages.com.novelgames.flashgames.parkingAS2.Level8] Frame 0
class com.novelgames.flashgames.parkingAS2.Level8 extends com.novelgames.flashgames.parkingAS2.Level
{
var car, targetSpace;
function Level8 () {
super();
car.__proto__ = com.novelgames.flashgames.parkingAS2.Car.prototype;
targetSpace.__proto__ = com.novelgames.flashgames.parkingAS2.ParkingSpace.prototype;
}
}
Symbol 278 MovieClip [__Packages.com.novelgames.flashgames.parkingAS2.Level7] Frame 0
class com.novelgames.flashgames.parkingAS2.Level7 extends com.novelgames.flashgames.parkingAS2.Level
{
var car, targetSpace;
function Level7 () {
super();
car.__proto__ = com.novelgames.flashgames.parkingAS2.Car.prototype;
targetSpace.__proto__ = com.novelgames.flashgames.parkingAS2.ParkingSpace.prototype;
}
}
Symbol 279 MovieClip [__Packages.com.novelgames.flashgames.parkingAS2.Level6] Frame 0
class com.novelgames.flashgames.parkingAS2.Level6 extends com.novelgames.flashgames.parkingAS2.Level
{
var car, targetSpace;
function Level6 () {
super();
car.__proto__ = com.novelgames.flashgames.parkingAS2.Car.prototype;
targetSpace.__proto__ = com.novelgames.flashgames.parkingAS2.ParkingSpace.prototype;
}
}
Symbol 280 MovieClip [__Packages.com.novelgames.flashgames.parkingAS2.Level5] Frame 0
class com.novelgames.flashgames.parkingAS2.Level5 extends com.novelgames.flashgames.parkingAS2.Level
{
var car, targetSpace;
function Level5 () {
super();
car.__proto__ = com.novelgames.flashgames.parkingAS2.Car.prototype;
targetSpace.__proto__ = com.novelgames.flashgames.parkingAS2.ParkingSpace.prototype;
}
}
Symbol 281 MovieClip [__Packages.com.novelgames.flashgames.parkingAS2.Level4] Frame 0
class com.novelgames.flashgames.parkingAS2.Level4 extends com.novelgames.flashgames.parkingAS2.Level
{
var car, targetSpace;
function Level4 () {
super();
car.__proto__ = com.novelgames.flashgames.parkingAS2.Car.prototype;
targetSpace.__proto__ = com.novelgames.flashgames.parkingAS2.ParkingSpace.prototype;
}
}
Symbol 282 MovieClip [__Packages.com.novelgames.flashgames.parkingAS2.Level3] Frame 0
class com.novelgames.flashgames.parkingAS2.Level3 extends com.novelgames.flashgames.parkingAS2.Level
{
var car, targetSpace;
function Level3 () {
super();
car.__proto__ = com.novelgames.flashgames.parkingAS2.Car.prototype;
targetSpace.__proto__ = com.novelgames.flashgames.parkingAS2.ParkingSpace.prototype;
}
}
Symbol 283 MovieClip [__Packages.com.novelgames.flashgames.parkingAS2.Level2] Frame 0
class com.novelgames.flashgames.parkingAS2.Level2 extends com.novelgames.flashgames.parkingAS2.Level
{
var car, targetSpace;
function Level2 () {
super();
car.__proto__ = com.novelgames.flashgames.parkingAS2.Car.prototype;
targetSpace.__proto__ = com.novelgames.flashgames.parkingAS2.ParkingSpace.prototype;
}
}
Symbol 284 MovieClip [__Packages.com.novelgames.flashgames.parkingAS2.Level1] Frame 0
class com.novelgames.flashgames.parkingAS2.Level1 extends com.novelgames.flashgames.parkingAS2.Level
{
var car, targetSpace;
function Level1 () {
super();
car.__proto__ = com.novelgames.flashgames.parkingAS2.Car.prototype;
targetSpace.__proto__ = com.novelgames.flashgames.parkingAS2.ParkingSpace.prototype;
}
}
Symbol 235 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}