Frame 1
fscommand ("allowScale", "false");
Stage.showMenu = false;
onLoad = function () {
this.progressbar.bar_mc._width = 1;
var _local2 = false;
};
onEnterFrame = function () {
myLoaded = Math.round(_root.getBytesLoaded());
myTotal = Math.round(_root.getBytesTotal());
myPercent = (myLoaded / myTotal) * 100;
this.progressbar.bar_mc._width = myPercent * 2;
percenttext.percentText.text = Math.round(myPercent) + "%";
if ((myLoaded == myTotal) && (_root.animationCompleted == true)) {
gotoAndPlay (2);
_root.animationCompleted = false;
}
};
animation.onPress = function () {
getURL ("http://www.flasharcade.com/", _blank);
};
stop();
Frame 2
fscommand ("allowscale", "false");
fscommand ("showmenu", "false");
_root.gameBGSound.stop();
_root.gameBGSound = null;
_root.gameBGSound = new Sound();
_root.gameBGSound.attachSound("bgSound");
_root.gameBGSound.start(0, 1000);
_root.gameBGSound.setVolume(50);
Frame 20
stop();
Frame 21
fscommand ("allowscale", "false");
fscommand ("showmenu", "false");
_root.gameBGSound.stop();
_root.gameBGSound = null;
delete _root.gameBGSound;
Frame 23
stop();
Frame 24
fscommand ("allowscale", "false");
_root.score = 0;
stop();
Instance of Symbol 211 MovieClip in Frame 24
onClipEvent (enterFrame) {
text = ((int(_parent.getBytesLoaded() / 1000) + " KBYTES OF ") + int(_parent.getBytesTotal() / 1000)) + " LOADED ...";
if (_parent.getBytesTotal() == _parent.getBytesLoaded()) {
_parent.gotoAndStop(2);
}
}
Frame 26
function depreciateAmount() {
_root.totalAmount = _root.totalAmount - 1;
timeNum = 100 - _root.totalAmount;
if (_root.totalAmount <= 0) {
_root.gameEnd();
}
}
function buildMap(map) {
counter = 0;
_root.attachMovie("empty", "tiles", 2);
_root.tiles.attachMovie("empty", "back", 0);
game.clip = _root.tiles;
game.clip._x = 280;
game.clip._y = 0;
var _local7 = map[0].length;
var _local8 = map.length;
var _local4 = 0;
while (_local4 < _local8) {
var _local3 = 0;
while (_local3 < _local7) {
var _local2 = (("t_" + _local4) + "_") + _local3;
game[_local2] = new game["Tile" + map[_local4][_local3]]();
if (game[_local2].walkable) {
var _local5 = game.clip.back;
} else {
var _local5 = game.clip;
}
game[_local2].depth = (((((_local3 + _local4) * game.tileW) / 2) * 300) + ((_local3 - _local4) * game.tileW)) + 1;
_local5.attachMovie("tile", _local2, game[_local2].depth);
_local5[_local2]._x = (_local3 - _local4) * game.tileW;
_local5[_local2]._y = ((_local3 + _local4) * game.tileW) / 2;
_local5[_local2].gotoAndStop(game[_local2].frame);
counter++;
_local3++;
}
_local4++;
}
createCars(_root.totalCar + 1);
}
function createCars(num) {
i = 1;
while (i < num) {
var _local3 = this["car" + i];
_local3.x = _local3.xtile * game.tileW;
_local3.y = _local3.ytile * game.tileW;
_local3.xiso = _local3.x - _local3.y;
_local3.yiso = (_local3.x + _local3.y) / 2;
_local3.depthshift = (game.tileW - _local3.height) / 2;
_local3.depth = (((_local3.yiso - _local3.depthshift) * 300) + _local3.xiso) + 1;
_local3.correctstatus = false;
carName = "car" + i;
dupName = _local3.clipName;
carRef = game.clip.attachMovie(dupName, carName, _local3.depth);
_local3.clip = carRef;
_local3.clip.objectRef = _local3;
_local3.clip._x = _local3.xiso;
_local3.clip._y = _local3.yiso;
_local3.clip.gotoAndStop(_local3.frame);
_root.tileMap[_local3.ytile][_local3.xtile] = 20;
var _local4 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local4].walkable = false;
i++;
}
}
function getMyCorners(x, y, ob) {
ob.downY = Math.floor(((y + ob.height) - 1) / game.tileW);
ob.upY = Math.floor(y / game.tileW);
ob.leftX = Math.floor(x / game.tileW);
ob.rightX = Math.floor(((x + ob.width) - 1) / game.tileW);
ob.upleft = game[(("t_" + ob.upY) + "_") + ob.leftX].walkable;
ob.downleft = game[(("t_" + ob.downY) + "_") + ob.leftX].walkable;
ob.upright = game[(("t_" + ob.upY) + "_") + ob.rightX].walkable;
ob.downright = game[(("t_" + ob.downY) + "_") + ob.rightX].walkable;
}
function moveChar(ob, dirx, diry) {
getMyCorners(ob.x, ob.y + (ob.speed * diry), ob);
if (diry == -1) {
if (ob.upleft and ob.upright) {
ob.y = ob.y + (ob.speed * diry);
ob.clip.gotoAndStop("up");
} else {
ob.y = ob.ytile * game.tileW;
_root.movement = null;
}
}
if (diry == 1) {
if (ob.downleft and ob.downright) {
ob.y = ob.y + (ob.speed * diry);
ob.clip.gotoAndStop("down");
} else {
ob.y = ((ob.ytile + 1) * game.tileW) - ob.height;
_root.movement = null;
}
}
getMyCorners(ob.x + (ob.speed * dirx), ob.y, ob);
if (dirx == -1) {
if (ob.downleft and ob.upleft) {
ob.x = ob.x + (ob.speed * dirx);
ob.clip.gotoAndStop("left");
} else {
ob.x = ob.xtile * game.tileW;
_root.movement = null;
}
}
if (dirx == 1) {
if (ob.upright and ob.downright) {
ob.x = ob.x + (ob.speed * dirx);
ob.clip.gotoAndStop("right");
} else {
ob.x = ((ob.xtile + 1) * game.tileW) - ob.width;
_root.movement = null;
}
}
ob.xiso = ob.x - ob.y;
ob.yiso = (ob.x + ob.y) / 2;
ob.clip._x = ob.xiso;
ob.clip._y = ob.yiso;
ob.xtile = Math.floor(ob.x / game.tileW);
ob.ytile = Math.floor(ob.y / game.tileW);
_root.tileMap[ob.ytile][ob.xtile] = 20;
var _local5 = (("t_" + ob.ytile) + "_") + ob.xtile;
var _local6 = game[_local5].frame;
game[_local5].walkable = false;
ob.depth = (((ob.yiso - ob.depthshift) * 300) + ob.xiso) + 1;
ob.clip.swapDepths(ob.depth);
if (_local6 == ob.correctcode) {
ob.correctstatus = true;
checkLevelEnd();
} else {
ob.correctstatus = false;
}
return(true);
}
function detectKeys() {
var _local3 = _root.objectRef;
if (_root.movement == "right") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, 0, -1);
} else if (_root.movement == "left") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, 0, 1);
} else if (_root.movement == "up") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, -1, 0);
} else if (_root.movement == "down") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, 1, 0);
}
if (!keyPressed) {
_local3.clip.char.gotoAndStop(1);
} else {
_local3.clip.char.play();
}
i = 1;
while (i < (totalCar + 1)) {
var _local4 = this["car" + i];
_local4.clip.fade._visible = true;
i++;
}
_root.objectRef.clip.fade._visible = false;
}
function checkLevelEnd() {
if (_root.movement == null) {
i = 1;
while (i < (totalCar + 1)) {
var _local3 = this["car" + i].correctstatus;
if (_local3 != true) {
return(false);
}
i++;
}
if (!_root.levelEnd) {
endLevel();
}
}
}
function endLevel() {
_root.score = _root.score + Number(_root.totalAmount * 10);
clearInterval(_root.timerInterval);
_root.tilesSwap.swapDepths(_root.tiles);
_root.mc_levelup.gotoAndPlay(2);
_root.levelEnd = true;
return(undefined);
}
function gameEnd() {
clearInterval(_root.timerInterval);
_root.tilesSwap.swapDepths(_root.tiles);
_root.mc_timeup.gotoAndPlay(2);
_root.gameEndStatus = true;
return(undefined);
}
function reset1() {
clearInterval(timerInterval);
_root.levelEnd = false;
_root.gameEndStatus = false;
_root.tiles.removeMovieClip();
_root.movement = null;
_root.objectRef = null;
_root.totalAmount = 100;
_root.startGameStatus = true;
gotoAndPlay ("level1");
}
fscommand ("allowscale", false);
_root.score = 0;
_root.levelEnd = false;
_root.gameEndStatus = false;
_root.tiles.removeMovieClip();
_root.movement = null;
_root.objectRef = null;
_root.totalAmount = 100;
_root.startGameStatus = true;
_root.gameLevel = 1;
_root.mc_amount._x = 0;
_root.mc_amount._y = 0;
if (_root.startGameStatus) {
_root.timer_clip.gotoAndStop(1);
_root.timerInterval = setInterval(depreciateAmount, 1000);
_root.startGameStatus = false;
}
myMap1 = [[1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1], [1, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 1], [1, 14, 0, 14, 0, 14, 0, 14, 0, 14, 12, 11, 0, 1], [3, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 1], [1, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 1], [1, 0, 14, 0, 14, 0, 4, 0, 14, 0, 14, 0, 14, 2], [1, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 1], [1, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 1], [1, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 1], [1, 0, 14, 0, 14, 0, 14, 0, 14, 0, 11, 12, 14, 1], [1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1]];
game = {tileW:30};
game.Tile0 = function () {
};
game.Tile0.prototype.walkable = true;
game.Tile0.prototype.frame = 1;
game.Tile14 = function () {
};
game.Tile14.prototype.walkable = true;
game.Tile14.prototype.frame = 14;
game.Tile1 = function () {
};
game.Tile1.prototype.walkable = false;
game.Tile1.prototype.frame = 2;
game.Tile2 = function () {
};
game.Tile2.prototype.walkable = false;
game.Tile2.prototype.frame = 3;
game.Tile3 = function () {
};
game.Tile3.prototype.walkable = false;
game.Tile3.prototype.frame = 4;
game.Tile4 = function () {
};
game.Tile4.prototype.walkable = false;
game.Tile4.prototype.frame = 5;
game.Tile11 = function () {
};
game.Tile11.prototype.walkable = true;
game.Tile11.prototype.frame = 11;
game.Tile12 = function () {
};
game.Tile12.prototype.walkable = true;
game.Tile12.prototype.frame = 12;
car1 = {xtile:2, ytile:1, speed:10, width:30, height:30, correctcode:11, clipName:"car1"};
car2 = {xtile:8, ytile:1, speed:10, width:30, height:30, correctcode:11, clipName:"car1"};
car3 = {xtile:3, ytile:3, speed:10, width:30, height:30, correctcode:12, clipName:"car2"};
car4 = {xtile:2, ytile:3, speed:10, width:30, height:30, correctcode:12, clipName:"car2"};
totalCar = 4;
buildMap(_root.myMap1);
_root.tiles._xscale = 120;
_root.tiles._yscale = 120;
_root.mc_mask.swapDepths(_root.tiles);
_root.gameBGSound.stop();
_root.gameBGSound = null;
_root.gameBGSound = new Sound();
_root.gameBGSound.attachSound("bgSound");
_root.gameBGSound.start(0, 1000);
_root.gameBGSound.setVolume(50);
stop();
Instance of Symbol 44 MovieClip [empty] "controller" in Frame 26
onClipEvent (enterFrame) {
_root.detectKeys();
}
onClipEvent (keyDown) {
if ((_root.movement == null) && (!_root.gameEndStatus)) {
if (Key.isDown(39)) {
_root.movement = "right";
} else if (Key.isDown(37)) {
_root.movement = "left";
} else if (Key.isDown(38)) {
_root.movement = "up";
} else if (Key.isDown(40)) {
_root.movement = "down";
} else if (Key.getCode() == "90") {
_root.objectRef = _root.car1;
} else if (Key.getCode() == "88") {
_root.objectRef = _root.car2;
} else if (Key.getCode() == "67") {
_root.objectRef = _root.car3;
} else if (Key.getCode() == "86") {
_root.objectRef = _root.car4;
}
}
}
Instance of Symbol 229 MovieClip "tilesSwap" in Frame 26
/* no clip actions */
Instance of Symbol 245 MovieClip "mc_levelup" in Frame 26
onClipEvent (load) {
nextLevel = 2;
}
Instance of Symbol 250 MovieClip "mc_timeup" in Frame 26
onClipEvent (load) {
function callFunc() {
_root.reset1();
}
}
Frame 28
function depreciateAmount() {
_root.totalAmount = _root.totalAmount - 1;
timeNum = 100 - _root.totalAmount;
if (_root.totalAmount <= 0) {
_root.gameEnd();
}
}
function buildMap(map) {
_root.attachMovie("empty", "tiles", 2);
_root.tiles.attachMovie("empty", "back", 0);
game.clip = _root.tiles;
game.clip._x = 280;
game.clip._y = 0;
var _local7 = map[0].length;
var _local8 = map.length;
var _local4 = 0;
while (_local4 < _local8) {
var _local3 = 0;
while (_local3 < _local7) {
var _local2 = (("t_" + _local4) + "_") + _local3;
game[_local2] = new game["Tile" + map[_local4][_local3]]();
if (game[_local2].walkable) {
var _local5 = game.clip.back;
} else {
var _local5 = game.clip;
}
game[_local2].depth = (((((_local3 + _local4) * game.tileW) / 2) * 300) + ((_local3 - _local4) * game.tileW)) + 1;
_local5.attachMovie("tile", _local2, game[_local2].depth);
_local5[_local2]._x = (_local3 - _local4) * game.tileW;
_local5[_local2]._y = ((_local3 + _local4) * game.tileW) / 2;
_local5[_local2].gotoAndStop(game[_local2].frame);
_local3++;
}
_local4++;
}
createCars(_root.totalCar + 1);
}
function createCars(num) {
i = 1;
while (i < num) {
var _local3 = this["car" + i];
_local3.x = _local3.xtile * game.tileW;
_local3.y = _local3.ytile * game.tileW;
_local3.xiso = _local3.x - _local3.y;
_local3.yiso = (_local3.x + _local3.y) / 2;
_local3.depthshift = (game.tileW - _local3.height) / 2;
_local3.depth = (((_local3.yiso - _local3.depthshift) * 300) + _local3.xiso) + 1;
_local3.correctstatus = false;
carName = "car" + i;
dupName = _local3.clipName;
carRef = game.clip.attachMovie(dupName, carName, _local3.depth);
_local3.clip = carRef;
_local3.clip.objectRef = _local3;
_local3.clip._x = _local3.xiso;
_local3.clip._y = _local3.yiso;
_root.tileMap[_local3.ytile][_local3.xtile] = 20;
var _local4 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local4].walkable = false;
i++;
}
}
function getMyCorners(x, y, ob) {
ob.downY = Math.floor(((y + ob.height) - 1) / game.tileW);
ob.upY = Math.floor(y / game.tileW);
ob.leftX = Math.floor(x / game.tileW);
ob.rightX = Math.floor(((x + ob.width) - 1) / game.tileW);
ob.upleft = game[(("t_" + ob.upY) + "_") + ob.leftX].walkable;
ob.downleft = game[(("t_" + ob.downY) + "_") + ob.leftX].walkable;
ob.upright = game[(("t_" + ob.upY) + "_") + ob.rightX].walkable;
ob.downright = game[(("t_" + ob.downY) + "_") + ob.rightX].walkable;
}
function moveChar(ob, dirx, diry) {
getMyCorners(ob.x, ob.y + (ob.speed * diry), ob);
if (diry == -1) {
if (ob.upleft and ob.upright) {
ob.y = ob.y + (ob.speed * diry);
ob.clip.gotoAndStop("up");
} else {
ob.y = ob.ytile * game.tileW;
_root.movement = null;
}
}
if (diry == 1) {
if (ob.downleft and ob.downright) {
ob.y = ob.y + (ob.speed * diry);
ob.clip.gotoAndStop("down");
} else {
ob.y = ((ob.ytile + 1) * game.tileW) - ob.height;
_root.movement = null;
}
}
getMyCorners(ob.x + (ob.speed * dirx), ob.y, ob);
if (dirx == -1) {
if (ob.downleft and ob.upleft) {
ob.x = ob.x + (ob.speed * dirx);
ob.clip.gotoAndStop("left");
} else {
ob.x = ob.xtile * game.tileW;
_root.movement = null;
}
}
if (dirx == 1) {
if (ob.upright and ob.downright) {
ob.x = ob.x + (ob.speed * dirx);
ob.clip.gotoAndStop("right");
} else {
ob.x = ((ob.xtile + 1) * game.tileW) - ob.width;
_root.movement = null;
}
}
ob.xiso = ob.x - ob.y;
ob.yiso = (ob.x + ob.y) / 2;
ob.clip._x = ob.xiso;
ob.clip._y = ob.yiso;
ob.xtile = Math.floor(ob.x / game.tileW);
ob.ytile = Math.floor(ob.y / game.tileW);
_root.tileMap[ob.ytile][ob.xtile] = 20;
var _local5 = (("t_" + ob.ytile) + "_") + ob.xtile;
var _local6 = game[_local5].frame;
game[_local5].walkable = false;
ob.depth = (((ob.yiso - ob.depthshift) * 300) + ob.xiso) + 1;
ob.clip.swapDepths(ob.depth);
if (_local6 == ob.correctcode) {
ob.correctstatus = true;
checkLevelEnd();
} else {
ob.correctstatus = false;
}
return(true);
}
function detectKeys() {
var _local3 = _root.objectRef;
if (_root.movement == "right") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, 0, -1);
} else if (_root.movement == "left") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, 0, 1);
} else if (_root.movement == "up") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, -1, 0);
} else if (_root.movement == "down") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, 1, 0);
}
if (!keyPressed) {
_local3.clip.char.gotoAndStop(1);
} else {
_local3.clip.char.play();
}
i = 1;
while (i < (totalCar + 1)) {
var _local4 = this["car" + i];
_local4.clip.fade._visible = true;
i++;
}
_root.objectRef.clip.fade._visible = false;
}
function checkLevelEnd() {
if (_root.movement == null) {
i = 1;
while (i < (totalCar + 1)) {
var _local3 = this["car" + i].correctstatus;
if (_local3 != true) {
return(false);
}
i++;
}
if (!_root.levelEnd) {
endLevel();
}
}
}
function endLevel() {
_root.score = _root.score + (_root.totalAmount * 10);
clearInterval(_root.timerInterval);
_root.tilesSwap.swapDepths(_root.tiles);
_root.mc_levelup.gotoAndPlay(2);
_root.levelEnd = true;
return(undefined);
}
function gameEnd() {
clearInterval(_root.timerInterval);
_root.tilesSwap.swapDepths(_root.tiles);
_root.mc_timeup.gotoAndPlay(2);
_root.gameEndStatus = true;
return(undefined);
}
function reset2() {
clearInterval(timerInterval);
_root.levelEnd = false;
_root.gameEndStatus = false;
_root.tiles.removeMovieClip();
_root.movement = null;
_root.objectRef = null;
_root.totalAmount = 100;
_root.startGameStatus = true;
gotoAndPlay ("level2");
}
fscommand ("allowscale", false);
_root.levelEnd = false;
_root.gameEndStatus = false;
_root.tiles.removeMovieClip();
_root.movement = null;
_root.objectRef = null;
_root.totalAmount = 100;
_root.startGameStatus = true;
_root.gameLevel = 2;
if (_root.startGameStatus) {
_root.timer_clip.gotoAndStop(1);
_root.timerInterval = setInterval(depreciateAmount, 1000);
_root.startGameStatus = false;
}
myMap1 = [[1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 2], [1, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 1], [1, 14, 0, 12, 11, 14, 0, 14, 0, 14, 0, 14, 0, 1], [1, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 12, 1], [1, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 1], [5, 0, 14, 0, 14, 0, 14, 0, 14, 4, 14, 0, 14, 2], [1, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 2], [1, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 1], [1, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 1], [1, 0, 14, 0, 14, 2, 11, 0, 14, 0, 14, 0, 14, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2]];
game = {tileW:30};
game.Tile0 = function () {
};
game.Tile0.prototype.walkable = true;
game.Tile0.prototype.frame = 1;
game.Tile14 = function () {
};
game.Tile14.prototype.walkable = true;
game.Tile14.prototype.frame = 14;
game.Tile1 = function () {
};
game.Tile1.prototype.walkable = false;
game.Tile1.prototype.frame = 2;
game.Tile2 = function () {
};
game.Tile2.prototype.walkable = false;
game.Tile2.prototype.frame = 3;
game.Tile3 = function () {
};
game.Tile3.prototype.walkable = false;
game.Tile3.prototype.frame = 4;
game.Tile4 = function () {
};
game.Tile4.prototype.walkable = false;
game.Tile4.prototype.frame = 5;
game.Tile5 = function () {
};
game.Tile5.prototype.walkable = false;
game.Tile5.prototype.frame = 6;
game.Tile11 = function () {
};
game.Tile11.prototype.walkable = true;
game.Tile11.prototype.frame = 11;
game.Tile12 = function () {
};
game.Tile12.prototype.walkable = true;
game.Tile12.prototype.frame = 12;
car1 = {xtile:7, ytile:1, speed:10, width:30, height:30, correctcode:11, clipName:"car1"};
car2 = {xtile:2, ytile:7, speed:10, width:30, height:30, correctcode:11, clipName:"car1"};
car3 = {xtile:5, ytile:5, speed:10, width:30, height:30, correctcode:12, clipName:"car2"};
car4 = {xtile:1, ytile:3, speed:10, width:30, height:30, correctcode:12, clipName:"car2"};
totalCar = 4;
buildMap(_root.myMap1);
_root.tiles._xscale = 120;
_root.tiles._yscale = 120;
_root.mc_mask.swapDepths(_root.tiles);
_root.gameBGSound.stop();
_root.gameBGSound = null;
_root.gameBGSound = new Sound();
_root.gameBGSound.attachSound("bgSound");
_root.gameBGSound.start(0, 1000);
_root.gameBGSound.setVolume(50);
stop();
Instance of Symbol 44 MovieClip [empty] "controller" in Frame 28
onClipEvent (enterFrame) {
_root.detectKeys();
}
onClipEvent (keyDown) {
if ((_root.movement == null) && (!_root.gameEndStatus)) {
if (Key.isDown(39)) {
_root.movement = "right";
} else if (Key.isDown(37)) {
_root.movement = "left";
} else if (Key.isDown(38)) {
_root.movement = "up";
} else if (Key.isDown(40)) {
_root.movement = "down";
} else if (Key.getCode() == "90") {
_root.objectRef = _root.car1;
} else if (Key.getCode() == "88") {
_root.objectRef = _root.car2;
} else if (Key.getCode() == "67") {
_root.objectRef = _root.car3;
} else if (Key.getCode() == "86") {
_root.objectRef = _root.car4;
}
}
}
Instance of Symbol 229 MovieClip "tilesSwap" in Frame 28
/* no clip actions */
Instance of Symbol 245 MovieClip "mc_levelup" in Frame 28
onClipEvent (load) {
nextLevel = 3;
}
Instance of Symbol 250 MovieClip "mc_timeup" in Frame 28
onClipEvent (load) {
function callFunc() {
_root.reset2();
}
}
Frame 30
function depreciateAmount() {
_root.totalAmount = _root.totalAmount - 1;
timeNum = 100 - _root.totalAmount;
if (_root.totalAmount <= 0) {
_root.gameEnd();
}
}
function buildMap(map) {
_root.attachMovie("empty", "tiles", 2);
_root.tiles.attachMovie("empty", "back", 0);
game.clip = _root.tiles;
game.clip._x = 280;
game.clip._y = 0;
var _local7 = map[0].length;
var _local8 = map.length;
var _local4 = 0;
while (_local4 < _local8) {
var _local3 = 0;
while (_local3 < _local7) {
var _local2 = (("t_" + _local4) + "_") + _local3;
game[_local2] = new game["Tile" + map[_local4][_local3]]();
if (game[_local2].walkable) {
var _local5 = game.clip.back;
} else {
var _local5 = game.clip;
}
game[_local2].depth = (((((_local3 + _local4) * game.tileW) / 2) * 300) + ((_local3 - _local4) * game.tileW)) + 1;
_local5.attachMovie("tile", _local2, game[_local2].depth);
_local5[_local2]._x = (_local3 - _local4) * game.tileW;
_local5[_local2]._y = ((_local3 + _local4) * game.tileW) / 2;
_local5[_local2].gotoAndStop(game[_local2].frame);
_local3++;
}
_local4++;
}
createCars(_root.totalCar + 1);
}
function createCars(num) {
i = 1;
while (i < num) {
var _local3 = this["car" + i];
_local3.x = _local3.xtile * game.tileW;
_local3.y = _local3.ytile * game.tileW;
_local3.xiso = _local3.x - _local3.y;
_local3.yiso = (_local3.x + _local3.y) / 2;
_local3.depthshift = (game.tileW - _local3.height) / 2;
_local3.depth = (((_local3.yiso - _local3.depthshift) * 300) + _local3.xiso) + 1;
_local3.correctstatus = false;
carName = "car" + i;
dupName = _local3.clipName;
carRef = game.clip.attachMovie(dupName, carName, _local3.depth);
_local3.clip = carRef;
_local3.clip.objectRef = _local3;
_local3.clip._x = _local3.xiso;
_local3.clip._y = _local3.yiso;
_root.tileMap[_local3.ytile][_local3.xtile] = 20;
var _local4 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local4].walkable = false;
i++;
}
}
function getMyCorners(x, y, ob) {
ob.downY = Math.floor(((y + ob.height) - 1) / game.tileW);
ob.upY = Math.floor(y / game.tileW);
ob.leftX = Math.floor(x / game.tileW);
ob.rightX = Math.floor(((x + ob.width) - 1) / game.tileW);
ob.upleft = game[(("t_" + ob.upY) + "_") + ob.leftX].walkable;
ob.downleft = game[(("t_" + ob.downY) + "_") + ob.leftX].walkable;
ob.upright = game[(("t_" + ob.upY) + "_") + ob.rightX].walkable;
ob.downright = game[(("t_" + ob.downY) + "_") + ob.rightX].walkable;
}
function moveChar(ob, dirx, diry) {
getMyCorners(ob.x, ob.y + (ob.speed * diry), ob);
if (diry == -1) {
if (ob.upleft and ob.upright) {
ob.y = ob.y + (ob.speed * diry);
ob.clip.gotoAndStop("up");
} else {
ob.y = ob.ytile * game.tileW;
_root.movement = null;
}
}
if (diry == 1) {
if (ob.downleft and ob.downright) {
ob.y = ob.y + (ob.speed * diry);
ob.clip.gotoAndStop("down");
} else {
ob.y = ((ob.ytile + 1) * game.tileW) - ob.height;
_root.movement = null;
}
}
getMyCorners(ob.x + (ob.speed * dirx), ob.y, ob);
if (dirx == -1) {
if (ob.downleft and ob.upleft) {
ob.x = ob.x + (ob.speed * dirx);
ob.clip.gotoAndStop("left");
} else {
ob.x = ob.xtile * game.tileW;
_root.movement = null;
}
}
if (dirx == 1) {
if (ob.upright and ob.downright) {
ob.x = ob.x + (ob.speed * dirx);
ob.clip.gotoAndStop("right");
} else {
ob.x = ((ob.xtile + 1) * game.tileW) - ob.width;
_root.movement = null;
}
}
ob.xiso = ob.x - ob.y;
ob.yiso = (ob.x + ob.y) / 2;
ob.clip._x = ob.xiso;
ob.clip._y = ob.yiso;
ob.xtile = Math.floor(ob.x / game.tileW);
ob.ytile = Math.floor(ob.y / game.tileW);
_root.tileMap[ob.ytile][ob.xtile] = 20;
var _local5 = (("t_" + ob.ytile) + "_") + ob.xtile;
var _local6 = game[_local5].frame;
game[_local5].walkable = false;
ob.depth = (((ob.yiso - ob.depthshift) * 300) + ob.xiso) + 1;
ob.clip.swapDepths(ob.depth);
if (_local6 == ob.correctcode) {
ob.correctstatus = true;
checkLevelEnd();
} else {
ob.correctstatus = false;
}
return(true);
}
function detectKeys() {
var _local3 = _root.objectRef;
if (_root.movement == "right") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, 0, -1);
} else if (_root.movement == "left") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, 0, 1);
} else if (_root.movement == "up") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, -1, 0);
} else if (_root.movement == "down") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, 1, 0);
}
if (!keyPressed) {
_local3.clip.char.gotoAndStop(1);
} else {
_local3.clip.char.play();
}
i = 1;
while (i < (totalCar + 1)) {
var _local4 = this["car" + i];
_local4.clip.fade._visible = true;
i++;
}
_root.objectRef.clip.fade._visible = false;
}
function checkLevelEnd() {
if (_root.movement == null) {
i = 1;
while (i < (totalCar + 1)) {
var _local3 = this["car" + i].correctstatus;
if (_local3 != true) {
return(false);
}
i++;
}
if (!_root.levelEnd) {
endLevel();
}
}
}
function endLevel() {
_root.score = _root.score + (_root.totalAmount * 10);
clearInterval(_root.timerInterval);
_root.tilesSwap.swapDepths(_root.tiles);
_root.mc_levelup.gotoAndPlay(2);
_root.levelEnd = true;
return(undefined);
}
function gameEnd() {
clearInterval(_root.timerInterval);
_root.tilesSwap.swapDepths(_root.tiles);
_root.mc_timeup.gotoAndPlay(2);
_root.gameEndStatus = true;
return(undefined);
}
function reset3() {
clearInterval(timerInterval);
_root.levelEnd = false;
_root.gameEndStatus = false;
_root.tiles.removeMovieClip();
_root.movement = null;
_root.objectRef = null;
_root.totalAmount = 100;
_root.startGameStatus = true;
gotoAndPlay ("level3");
}
fscommand ("allowscale", false);
_root.levelEnd = false;
_root.gameEndStatus = false;
_root.tiles.removeMovieClip();
_root.movement = null;
_root.objectRef = null;
_root.totalAmount = 100;
_root.startGameStatus = true;
_root.gameLevel = 3;
if (_root.startGameStatus) {
_root.timer_clip.gotoAndStop(1);
_root.timerInterval = setInterval(depreciateAmount, 1000);
_root.startGameStatus = false;
}
myMap1 = [[1, 1, 1, 1, 1, 5, 2, 1, 1, 1, 1, 1, 1, 1], [1, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 1], [1, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 1], [3, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 1], [1, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 1], [1, 0, 14, 0, 14, 0, 4, 0, 14, 0, 14, 0, 14, 1], [1, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 1], [1, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 1], [1, 14, 0, 14, 0, 14, 0, 14, 0, 12, 11, 14, 0, 1], [1, 0, 14, 0, 14, 0, 14, 0, 14, 11, 12, 0, 14, 1], [1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1]];
game = {tileW:30};
game.Tile0 = function () {
};
game.Tile0.prototype.walkable = true;
game.Tile0.prototype.frame = 1;
game.Tile14 = function () {
};
game.Tile14.prototype.walkable = true;
game.Tile14.prototype.frame = 14;
game.Tile1 = function () {
};
game.Tile1.prototype.walkable = false;
game.Tile1.prototype.frame = 2;
game.Tile2 = function () {
};
game.Tile2.prototype.walkable = false;
game.Tile2.prototype.frame = 3;
game.Tile3 = function () {
};
game.Tile3.prototype.walkable = false;
game.Tile3.prototype.frame = 4;
game.Tile4 = function () {
};
game.Tile4.prototype.walkable = false;
game.Tile4.prototype.frame = 5;
game.Tile5 = function () {
};
game.Tile5.prototype.walkable = false;
game.Tile5.prototype.frame = 6;
game.Tile11 = function () {
};
game.Tile11.prototype.walkable = true;
game.Tile11.prototype.frame = 11;
game.Tile12 = function () {
};
game.Tile12.prototype.walkable = true;
game.Tile12.prototype.frame = 12;
car1 = {xtile:4, ytile:6, speed:10, width:30, height:30, correctcode:11, clipName:"car1"};
car2 = {xtile:7, ytile:1, speed:10, width:30, height:30, correctcode:11, clipName:"car1"};
car3 = {xtile:5, ytile:2, speed:10, width:30, height:30, correctcode:12, clipName:"car2"};
car4 = {xtile:1, ytile:7, speed:10, width:30, height:30, correctcode:12, clipName:"car2"};
totalCar = 4;
buildMap(_root.myMap1);
_root.tiles._xscale = 120;
_root.tiles._yscale = 120;
_root.mc_mask.swapDepths(_root.tiles);
_root.gameBGSound.stop();
_root.gameBGSound = null;
_root.gameBGSound = new Sound();
_root.gameBGSound.attachSound("bgSound");
_root.gameBGSound.start(0, 1000);
_root.gameBGSound.setVolume(50);
stop();
Instance of Symbol 44 MovieClip [empty] "controller" in Frame 30
onClipEvent (enterFrame) {
_root.detectKeys();
}
onClipEvent (keyDown) {
if ((_root.movement == null) && (!_root.gameEndStatus)) {
if (Key.isDown(39)) {
_root.movement = "right";
} else if (Key.isDown(37)) {
_root.movement = "left";
} else if (Key.isDown(38)) {
_root.movement = "up";
} else if (Key.isDown(40)) {
_root.movement = "down";
} else if (Key.getCode() == "90") {
_root.objectRef = _root.car1;
} else if (Key.getCode() == "88") {
_root.objectRef = _root.car2;
} else if (Key.getCode() == "67") {
_root.objectRef = _root.car3;
} else if (Key.getCode() == "86") {
_root.objectRef = _root.car4;
}
}
}
Instance of Symbol 229 MovieClip "tilesSwap" in Frame 30
/* no clip actions */
Instance of Symbol 245 MovieClip "mc_levelup" in Frame 30
onClipEvent (load) {
nextLevel = 4;
}
Instance of Symbol 250 MovieClip "mc_timeup" in Frame 30
onClipEvent (load) {
function callFunc() {
_root.reset3();
}
}
Frame 32
function depreciateAmount() {
_root.totalAmount = _root.totalAmount - 1;
timeNum = 100 - _root.totalAmount;
if (_root.totalAmount <= 0) {
_root.gameEnd();
}
}
function buildMap(map) {
_root.attachMovie("empty", "tiles", 2);
_root.tiles.attachMovie("empty", "back", 0);
game.clip = _root.tiles;
game.clip._x = 280;
game.clip._y = 0;
var _local7 = map[0].length;
var _local8 = map.length;
var _local4 = 0;
while (_local4 < _local8) {
var _local3 = 0;
while (_local3 < _local7) {
var _local2 = (("t_" + _local4) + "_") + _local3;
game[_local2] = new game["Tile" + map[_local4][_local3]]();
if (game[_local2].walkable) {
var _local5 = game.clip.back;
} else {
var _local5 = game.clip;
}
game[_local2].depth = (((((_local3 + _local4) * game.tileW) / 2) * 300) + ((_local3 - _local4) * game.tileW)) + 1;
_local5.attachMovie("tile", _local2, game[_local2].depth);
_local5[_local2]._x = (_local3 - _local4) * game.tileW;
_local5[_local2]._y = ((_local3 + _local4) * game.tileW) / 2;
_local5[_local2].gotoAndStop(game[_local2].frame);
_local3++;
}
_local4++;
}
createCars(_root.totalCar + 1);
}
function createCars(num) {
i = 1;
while (i < num) {
var _local3 = this["car" + i];
_local3.x = _local3.xtile * game.tileW;
_local3.y = _local3.ytile * game.tileW;
_local3.xiso = _local3.x - _local3.y;
_local3.yiso = (_local3.x + _local3.y) / 2;
_local3.depthshift = (game.tileW - _local3.height) / 2;
_local3.depth = (((_local3.yiso - _local3.depthshift) * 300) + _local3.xiso) + 1;
_local3.correctstatus = false;
carName = "car" + i;
dupName = _local3.clipName;
carRef = game.clip.attachMovie(dupName, carName, _local3.depth);
_local3.clip = carRef;
_local3.clip.objectRef = _local3;
_local3.clip._x = _local3.xiso;
_local3.clip._y = _local3.yiso;
_root.tileMap[_local3.ytile][_local3.xtile] = 20;
var _local4 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local4].walkable = false;
i++;
}
}
function getMyCorners(x, y, ob) {
ob.downY = Math.floor(((y + ob.height) - 1) / game.tileW);
ob.upY = Math.floor(y / game.tileW);
ob.leftX = Math.floor(x / game.tileW);
ob.rightX = Math.floor(((x + ob.width) - 1) / game.tileW);
ob.upleft = game[(("t_" + ob.upY) + "_") + ob.leftX].walkable;
ob.downleft = game[(("t_" + ob.downY) + "_") + ob.leftX].walkable;
ob.upright = game[(("t_" + ob.upY) + "_") + ob.rightX].walkable;
ob.downright = game[(("t_" + ob.downY) + "_") + ob.rightX].walkable;
}
function moveChar(ob, dirx, diry) {
getMyCorners(ob.x, ob.y + (ob.speed * diry), ob);
if (diry == -1) {
if (ob.upleft and ob.upright) {
ob.y = ob.y + (ob.speed * diry);
ob.clip.gotoAndStop("up");
} else {
ob.y = ob.ytile * game.tileW;
_root.movement = null;
}
}
if (diry == 1) {
if (ob.downleft and ob.downright) {
ob.y = ob.y + (ob.speed * diry);
ob.clip.gotoAndStop("down");
} else {
ob.y = ((ob.ytile + 1) * game.tileW) - ob.height;
_root.movement = null;
}
}
getMyCorners(ob.x + (ob.speed * dirx), ob.y, ob);
if (dirx == -1) {
if (ob.downleft and ob.upleft) {
ob.x = ob.x + (ob.speed * dirx);
ob.clip.gotoAndStop("left");
} else {
ob.x = ob.xtile * game.tileW;
_root.movement = null;
}
}
if (dirx == 1) {
if (ob.upright and ob.downright) {
ob.x = ob.x + (ob.speed * dirx);
ob.clip.gotoAndStop("right");
} else {
ob.x = ((ob.xtile + 1) * game.tileW) - ob.width;
_root.movement = null;
}
}
ob.xiso = ob.x - ob.y;
ob.yiso = (ob.x + ob.y) / 2;
ob.clip._x = ob.xiso;
ob.clip._y = ob.yiso;
ob.xtile = Math.floor(ob.x / game.tileW);
ob.ytile = Math.floor(ob.y / game.tileW);
_root.tileMap[ob.ytile][ob.xtile] = 20;
var _local5 = (("t_" + ob.ytile) + "_") + ob.xtile;
var _local6 = game[_local5].frame;
game[_local5].walkable = false;
ob.depth = (((ob.yiso - ob.depthshift) * 300) + ob.xiso) + 1;
ob.clip.swapDepths(ob.depth);
if (_local6 == ob.correctcode) {
ob.correctstatus = true;
checkLevelEnd();
} else {
ob.correctstatus = false;
}
return(true);
}
function detectKeys() {
var _local3 = _root.objectRef;
if (_root.movement == "right") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, 0, -1);
} else if (_root.movement == "left") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, 0, 1);
} else if (_root.movement == "up") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, -1, 0);
} else if (_root.movement == "down") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, 1, 0);
}
if (!keyPressed) {
_local3.clip.char.gotoAndStop(1);
} else {
_local3.clip.char.play();
}
i = 1;
while (i < (totalCar + 1)) {
var _local4 = this["car" + i];
_local4.clip.fade._visible = true;
i++;
}
_root.objectRef.clip.fade._visible = false;
}
function checkLevelEnd() {
if (_root.movement == null) {
i = 1;
while (i < (totalCar + 1)) {
var _local3 = this["car" + i].correctstatus;
if (_local3 != true) {
return(false);
}
i++;
}
if (!_root.levelEnd) {
endLevel();
}
}
}
function endLevel() {
_root.score = _root.score + (_root.totalAmount * 10);
clearInterval(_root.timerInterval);
_root.tilesSwap.swapDepths(_root.tiles);
_root.mc_levelup.gotoAndPlay(2);
_root.levelEnd = true;
return(undefined);
}
function gameEnd() {
clearInterval(_root.timerInterval);
_root.tilesSwap.swapDepths(_root.tiles);
_root.mc_timeup.gotoAndPlay(2);
_root.gameEndStatus = true;
return(undefined);
}
function reset4() {
clearInterval(timerInterval);
_root.levelEnd = false;
_root.gameEndStatus = false;
_root.tiles.removeMovieClip();
_root.movement = null;
_root.objectRef = null;
_root.totalAmount = 100;
_root.startGameStatus = true;
gotoAndPlay ("level4");
}
fscommand ("allowscale", false);
_root.levelEnd = false;
_root.gameEndStatus = false;
_root.tiles.removeMovieClip();
_root.movement = null;
_root.objectRef = null;
_root.totalAmount = 100;
_root.startGameStatus = true;
_root.gameLevel = 4;
if (_root.startGameStatus) {
_root.timer_clip.gotoAndStop(1);
_root.timerInterval = setInterval(depreciateAmount, 1000);
_root.startGameStatus = false;
}
myMap1 = [[1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1], [1, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 1], [1, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 1], [3, 0, 14, 0, 14, 0, 14, 0, 2, 0, 14, 0, 14, 1], [1, 14, 1, 14, 0, 14, 0, 14, 12, 14, 0, 14, 0, 1], [1, 0, 11, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 1], [1, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 1], [1, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 1], [1, 14, 0, 14, 0, 14, 0, 12, 11, 14, 0, 14, 0, 1], [1, 3, 14, 0, 14, 0, 14, 0, 14, 4, 14, 0, 14, 1], [1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 2]];
game = {tileW:30};
game.Tile0 = function () {
};
game.Tile0.prototype.walkable = true;
game.Tile0.prototype.frame = 1;
game.Tile14 = function () {
};
game.Tile14.prototype.walkable = true;
game.Tile14.prototype.frame = 14;
game.Tile1 = function () {
};
game.Tile1.prototype.walkable = false;
game.Tile1.prototype.frame = 2;
game.Tile2 = function () {
};
game.Tile2.prototype.walkable = false;
game.Tile2.prototype.frame = 3;
game.Tile3 = function () {
};
game.Tile3.prototype.walkable = false;
game.Tile3.prototype.frame = 4;
game.Tile4 = function () {
};
game.Tile4.prototype.walkable = false;
game.Tile4.prototype.frame = 5;
game.Tile11 = function () {
};
game.Tile11.prototype.walkable = true;
game.Tile11.prototype.frame = 11;
game.Tile12 = function () {
};
game.Tile12.prototype.walkable = true;
game.Tile12.prototype.frame = 12;
car1 = {xtile:4, ytile:1, speed:10, width:30, height:30, correctcode:11, clipName:"car1"};
car2 = {xtile:7, ytile:3, speed:10, width:30, height:30, correctcode:11, clipName:"car1"};
car3 = {xtile:7, ytile:6, speed:10, width:30, height:30, correctcode:12, clipName:"car2"};
car4 = {xtile:1, ytile:1, speed:10, width:30, height:30, correctcode:12, clipName:"car2"};
totalCar = 4;
buildMap(_root.myMap1);
_root.tiles._xscale = 120;
_root.tiles._yscale = 120;
_root.mc_mask.swapDepths(_root.tiles);
_root.gameBGSound.stop();
_root.gameBGSound = null;
_root.gameBGSound = new Sound();
_root.gameBGSound.attachSound("bgSound");
_root.gameBGSound.start(0, 1000);
_root.gameBGSound.setVolume(50);
stop();
Instance of Symbol 44 MovieClip [empty] "controller" in Frame 32
onClipEvent (enterFrame) {
_root.detectKeys();
}
onClipEvent (keyDown) {
if ((_root.movement == null) && (!_root.gameEndStatus)) {
if (Key.isDown(39)) {
_root.movement = "right";
} else if (Key.isDown(37)) {
_root.movement = "left";
} else if (Key.isDown(38)) {
_root.movement = "up";
} else if (Key.isDown(40)) {
_root.movement = "down";
} else if (Key.getCode() == "90") {
_root.objectRef = _root.car1;
} else if (Key.getCode() == "88") {
_root.objectRef = _root.car2;
} else if (Key.getCode() == "67") {
_root.objectRef = _root.car3;
} else if (Key.getCode() == "86") {
_root.objectRef = _root.car4;
}
}
}
Instance of Symbol 229 MovieClip "tilesSwap" in Frame 32
/* no clip actions */
Instance of Symbol 245 MovieClip "mc_levelup" in Frame 32
onClipEvent (load) {
nextLevel = 5;
}
Instance of Symbol 250 MovieClip "mc_timeup" in Frame 32
onClipEvent (load) {
function callFunc() {
_root.reset4();
}
}
Frame 34
function depreciateAmount() {
_root.totalAmount = _root.totalAmount - 1;
timeNum = 100 - _root.totalAmount;
if (_root.totalAmount <= 0) {
_root.gameEnd();
}
}
function buildMap(map) {
_root.attachMovie("empty", "tiles", 1);
_root.tiles.attachMovie("empty", "back", 0);
game.clip = _root.tiles;
game.clip._x = 280;
game.clip._y = 0;
var _local7 = map[0].length;
var _local8 = map.length;
var _local4 = 0;
while (_local4 < _local8) {
var _local3 = 0;
while (_local3 < _local7) {
var _local2 = (("t_" + _local4) + "_") + _local3;
game[_local2] = new game["Tile" + map[_local4][_local3]]();
if (game[_local2].walkable) {
var _local5 = game.clip.back;
} else {
var _local5 = game.clip;
}
game[_local2].depth = (((((_local3 + _local4) * game.tileW) / 2) * 300) + ((_local3 - _local4) * game.tileW)) + 1;
_local5.attachMovie("tile", _local2, game[_local2].depth);
_local5[_local2]._x = (_local3 - _local4) * game.tileW;
_local5[_local2]._y = ((_local3 + _local4) * game.tileW) / 2;
_local5[_local2].gotoAndStop(game[_local2].frame);
_local3++;
}
_local4++;
}
createCars(_root.totalCar + 1);
}
function createCars(num) {
i = 1;
while (i < num) {
var _local3 = this["car" + i];
_local3.x = _local3.xtile * game.tileW;
_local3.y = _local3.ytile * game.tileW;
_local3.xiso = _local3.x - _local3.y;
_local3.yiso = (_local3.x + _local3.y) / 2;
_local3.depthshift = (game.tileW - _local3.height) / 2;
_local3.depth = (((_local3.yiso - _local3.depthshift) * 300) + _local3.xiso) + 1;
_local3.correctstatus = false;
carName = "car" + i;
dupName = _local3.clipName;
carRef = game.clip.attachMovie(dupName, carName, _local3.depth);
_local3.clip = carRef;
_local3.clip.objectRef = _local3;
_local3.clip._x = _local3.xiso;
_local3.clip._y = _local3.yiso;
_root.tileMap[_local3.ytile][_local3.xtile] = 20;
var _local4 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local4].walkable = false;
i++;
}
}
function getMyCorners(x, y, ob) {
ob.downY = Math.floor(((y + ob.height) - 1) / game.tileW);
ob.upY = Math.floor(y / game.tileW);
ob.leftX = Math.floor(x / game.tileW);
ob.rightX = Math.floor(((x + ob.width) - 1) / game.tileW);
ob.upleft = game[(("t_" + ob.upY) + "_") + ob.leftX].walkable;
ob.downleft = game[(("t_" + ob.downY) + "_") + ob.leftX].walkable;
ob.upright = game[(("t_" + ob.upY) + "_") + ob.rightX].walkable;
ob.downright = game[(("t_" + ob.downY) + "_") + ob.rightX].walkable;
}
function moveChar(ob, dirx, diry) {
getMyCorners(ob.x, ob.y + (ob.speed * diry), ob);
if (diry == -1) {
if (ob.upleft and ob.upright) {
ob.y = ob.y + (ob.speed * diry);
ob.clip.gotoAndStop("up");
} else {
ob.y = ob.ytile * game.tileW;
_root.movement = null;
}
}
if (diry == 1) {
if (ob.downleft and ob.downright) {
ob.y = ob.y + (ob.speed * diry);
ob.clip.gotoAndStop("down");
} else {
ob.y = ((ob.ytile + 1) * game.tileW) - ob.height;
_root.movement = null;
}
}
getMyCorners(ob.x + (ob.speed * dirx), ob.y, ob);
if (dirx == -1) {
if (ob.downleft and ob.upleft) {
ob.x = ob.x + (ob.speed * dirx);
ob.clip.gotoAndStop("left");
} else {
ob.x = ob.xtile * game.tileW;
_root.movement = null;
}
}
if (dirx == 1) {
if (ob.upright and ob.downright) {
ob.x = ob.x + (ob.speed * dirx);
ob.clip.gotoAndStop("right");
} else {
ob.x = ((ob.xtile + 1) * game.tileW) - ob.width;
_root.movement = null;
}
}
ob.xiso = ob.x - ob.y;
ob.yiso = (ob.x + ob.y) / 2;
ob.clip._x = ob.xiso;
ob.clip._y = ob.yiso;
ob.xtile = Math.floor(ob.x / game.tileW);
ob.ytile = Math.floor(ob.y / game.tileW);
_root.tileMap[ob.ytile][ob.xtile] = 20;
var _local5 = (("t_" + ob.ytile) + "_") + ob.xtile;
var _local6 = game[_local5].frame;
game[_local5].walkable = false;
ob.depth = (((ob.yiso - ob.depthshift) * 300) + ob.xiso) + 1;
ob.clip.swapDepths(ob.depth);
if (_local6 == ob.correctcode) {
ob.correctstatus = true;
checkLevelEnd();
} else {
ob.correctstatus = false;
}
return(true);
}
function detectKeys() {
var _local3 = _root.objectRef;
if (_root.movement == "right") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, 0, -1);
} else if (_root.movement == "left") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, 0, 1);
} else if (_root.movement == "up") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, -1, 0);
} else if (_root.movement == "down") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, 1, 0);
}
if (!keyPressed) {
_local3.clip.char.gotoAndStop(1);
} else {
_local3.clip.char.play();
}
i = 1;
while (i < (totalCar + 1)) {
var _local4 = this["car" + i];
_local4.clip.fade._visible = true;
i++;
}
_root.objectRef.clip.fade._visible = false;
}
function checkLevelEnd() {
if (_root.movement == null) {
i = 1;
while (i < (totalCar + 1)) {
var _local3 = this["car" + i].correctstatus;
if (_local3 != true) {
return(false);
}
i++;
}
if (!_root.levelEnd) {
endLevel();
}
}
}
function endLevel() {
_root.score = _root.score + (_root.totalAmount * 10);
clearInterval(_root.timerInterval);
_root.tilesSwap.swapDepths(_root.tiles);
_root.mc_levelup.gotoAndPlay(2);
_root.levelEnd = true;
return(undefined);
}
function gameEnd() {
clearInterval(_root.timerInterval);
_root.tilesSwap.swapDepths(_root.tiles);
_root.mc_timeup.gotoAndPlay(2);
_root.gameEndStatus = true;
return(undefined);
}
function reset5() {
clearInterval(timerInterval);
_root.levelEnd = false;
_root.gameEndStatus = false;
_root.tiles.removeMovieClip();
_root.movement = null;
_root.objectRef = null;
_root.totalAmount = 100;
_root.startGameStatus = true;
gotoAndPlay ("level5");
}
fscommand ("allowscale", false);
_root.levelEnd = false;
_root.gameEndStatus = false;
_root.tiles.removeMovieClip();
_root.movement = null;
_root.objectRef = null;
_root.totalAmount = 100;
_root.startGameStatus = true;
_root.gameLevel = 5;
if (_root.startGameStatus) {
_root.timer_clip.gotoAndStop(1);
_root.timerInterval = setInterval(depreciateAmount, 1000);
_root.startGameStatus = false;
}
myMap1 = [[1, 1, 5, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1], [1, 0, 14, 0, 14, 0, 12, 0, 14, 0, 14, 0, 14, 1], [1, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 1], [1, 0, 14, 0, 14, 0, 14, 0, 14, 0, 13, 0, 14, 1], [1, 14, 11, 1, 0, 14, 0, 14, 0, 14, 4, 14, 0, 1], [1, 0, 4, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 2], [1, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 2], [1, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 1], [3, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 1], [1, 0, 14, 0, 14, 11, 12, 13, 14, 0, 14, 0, 2, 1], [1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1]];
game = {tileW:30};
game.Tile0 = function () {
};
game.Tile0.prototype.walkable = true;
game.Tile0.prototype.frame = 1;
game.Tile14 = function () {
};
game.Tile14.prototype.walkable = true;
game.Tile14.prototype.frame = 14;
game.Tile1 = function () {
};
game.Tile1.prototype.walkable = false;
game.Tile1.prototype.frame = 2;
game.Tile2 = function () {
};
game.Tile2.prototype.walkable = false;
game.Tile2.prototype.frame = 3;
game.Tile3 = function () {
};
game.Tile3.prototype.walkable = false;
game.Tile3.prototype.frame = 4;
game.Tile4 = function () {
};
game.Tile4.prototype.walkable = false;
game.Tile4.prototype.frame = 5;
game.Tile5 = function () {
};
game.Tile5.prototype.walkable = false;
game.Tile5.prototype.frame = 6;
game.Tile11 = function () {
};
game.Tile11.prototype.walkable = true;
game.Tile11.prototype.frame = 11;
game.Tile12 = function () {
};
game.Tile12.prototype.walkable = true;
game.Tile12.prototype.frame = 12;
game.Tile13 = function () {
};
game.Tile13.prototype.walkable = true;
game.Tile13.prototype.frame = 13;
car1 = {xtile:4, ytile:2, speed:10, width:30, height:30, correctcode:11, clipName:"car1"};
car2 = {xtile:1, ytile:6, speed:10, width:30, height:30, correctcode:11, clipName:"car1"};
car3 = {xtile:2, ytile:2, speed:10, width:30, height:30, correctcode:12, clipName:"car2"};
car4 = {xtile:8, ytile:3, speed:10, width:30, height:30, correctcode:12, clipName:"car2"};
car5 = {xtile:1, ytile:1, speed:10, width:30, height:30, correctcode:13, clipName:"car3"};
car6 = {xtile:9, ytile:3, speed:10, width:30, height:30, correctcode:13, clipName:"car3"};
totalCar = 6;
buildMap(_root.myMap1);
_root.tiles._xscale = 120;
_root.tiles._yscale = 120;
_root.mc_mask.swapDepths(_root.tiles);
_root.gameBGSound.stop();
_root.gameBGSound = null;
_root.gameBGSound = new Sound();
_root.gameBGSound.attachSound("bgSound");
_root.gameBGSound.start(0, 1000);
_root.gameBGSound.setVolume(50);
stop();
Instance of Symbol 44 MovieClip [empty] "controller" in Frame 34
onClipEvent (enterFrame) {
_root.detectKeys();
}
onClipEvent (keyDown) {
if ((_root.movement == null) && (!_root.gameEndStatus)) {
if (Key.isDown(39)) {
_root.movement = "right";
} else if (Key.isDown(37)) {
_root.movement = "left";
} else if (Key.isDown(38)) {
_root.movement = "up";
} else if (Key.isDown(40)) {
_root.movement = "down";
} else if (Key.getCode() == "90") {
_root.objectRef = _root.car1;
} else if (Key.getCode() == "88") {
_root.objectRef = _root.car2;
} else if (Key.getCode() == "67") {
_root.objectRef = _root.car3;
} else if (Key.getCode() == "86") {
_root.objectRef = _root.car4;
}
}
}
Instance of Symbol 229 MovieClip "tilesSwap" in Frame 34
/* no clip actions */
Instance of Symbol 245 MovieClip "mc_levelup" in Frame 34
onClipEvent (load) {
nextLevel = 6;
}
Instance of Symbol 250 MovieClip "mc_timeup" in Frame 34
onClipEvent (load) {
function callFunc() {
_root.reset5();
}
}
Frame 36
function depreciateAmount() {
_root.totalAmount = _root.totalAmount - 1;
timeNum = 100 - _root.totalAmount;
if (_root.totalAmount <= 0) {
_root.gameEnd();
}
}
function buildMap(map) {
_root.attachMovie("empty", "tiles", 2);
_root.tiles.attachMovie("empty", "back", 0);
game.clip = _root.tiles;
game.clip._x = 280;
game.clip._y = 0;
var _local7 = map[0].length;
var _local8 = map.length;
var _local4 = 0;
while (_local4 < _local8) {
var _local3 = 0;
while (_local3 < _local7) {
var _local2 = (("t_" + _local4) + "_") + _local3;
game[_local2] = new game["Tile" + map[_local4][_local3]]();
if (game[_local2].walkable) {
var _local5 = game.clip.back;
} else {
var _local5 = game.clip;
}
game[_local2].depth = (((((_local3 + _local4) * game.tileW) / 2) * 300) + ((_local3 - _local4) * game.tileW)) + 1;
_local5.attachMovie("tile", _local2, game[_local2].depth);
_local5[_local2]._x = (_local3 - _local4) * game.tileW;
_local5[_local2]._y = ((_local3 + _local4) * game.tileW) / 2;
_local5[_local2].gotoAndStop(game[_local2].frame);
_local3++;
}
_local4++;
}
createCars(_root.totalCar + 1);
}
function createCars(num) {
i = 1;
while (i < num) {
var _local3 = this["car" + i];
_local3.x = _local3.xtile * game.tileW;
_local3.y = _local3.ytile * game.tileW;
_local3.xiso = _local3.x - _local3.y;
_local3.yiso = (_local3.x + _local3.y) / 2;
_local3.depthshift = (game.tileW - _local3.height) / 2;
_local3.depth = (((_local3.yiso - _local3.depthshift) * 300) + _local3.xiso) + 1;
_local3.correctstatus = false;
carName = "car" + i;
dupName = _local3.clipName;
carRef = game.clip.attachMovie(dupName, carName, _local3.depth);
_local3.clip = carRef;
_local3.clip.objectRef = _local3;
_local3.clip._x = _local3.xiso;
_local3.clip._y = _local3.yiso;
_root.tileMap[_local3.ytile][_local3.xtile] = 20;
var _local4 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local4].walkable = false;
i++;
}
}
function getMyCorners(x, y, ob) {
ob.downY = Math.floor(((y + ob.height) - 1) / game.tileW);
ob.upY = Math.floor(y / game.tileW);
ob.leftX = Math.floor(x / game.tileW);
ob.rightX = Math.floor(((x + ob.width) - 1) / game.tileW);
ob.upleft = game[(("t_" + ob.upY) + "_") + ob.leftX].walkable;
ob.downleft = game[(("t_" + ob.downY) + "_") + ob.leftX].walkable;
ob.upright = game[(("t_" + ob.upY) + "_") + ob.rightX].walkable;
ob.downright = game[(("t_" + ob.downY) + "_") + ob.rightX].walkable;
}
function moveChar(ob, dirx, diry) {
getMyCorners(ob.x, ob.y + (ob.speed * diry), ob);
if (diry == -1) {
if (ob.upleft and ob.upright) {
ob.y = ob.y + (ob.speed * diry);
ob.clip.gotoAndStop("up");
} else {
ob.y = ob.ytile * game.tileW;
_root.movement = null;
}
}
if (diry == 1) {
if (ob.downleft and ob.downright) {
ob.y = ob.y + (ob.speed * diry);
ob.clip.gotoAndStop("down");
} else {
ob.y = ((ob.ytile + 1) * game.tileW) - ob.height;
_root.movement = null;
}
}
getMyCorners(ob.x + (ob.speed * dirx), ob.y, ob);
if (dirx == -1) {
if (ob.downleft and ob.upleft) {
ob.x = ob.x + (ob.speed * dirx);
ob.clip.gotoAndStop("left");
} else {
ob.x = ob.xtile * game.tileW;
_root.movement = null;
}
}
if (dirx == 1) {
if (ob.upright and ob.downright) {
ob.x = ob.x + (ob.speed * dirx);
ob.clip.gotoAndStop("right");
} else {
ob.x = ((ob.xtile + 1) * game.tileW) - ob.width;
_root.movement = null;
}
}
ob.xiso = ob.x - ob.y;
ob.yiso = (ob.x + ob.y) / 2;
ob.clip._x = ob.xiso;
ob.clip._y = ob.yiso;
ob.xtile = Math.floor(ob.x / game.tileW);
ob.ytile = Math.floor(ob.y / game.tileW);
_root.tileMap[ob.ytile][ob.xtile] = 20;
var _local5 = (("t_" + ob.ytile) + "_") + ob.xtile;
var _local6 = game[_local5].frame;
game[_local5].walkable = false;
ob.depth = (((ob.yiso - ob.depthshift) * 300) + ob.xiso) + 1;
ob.clip.swapDepths(ob.depth);
if (_local6 == ob.correctcode) {
ob.correctstatus = true;
checkLevelEnd();
} else {
ob.correctstatus = false;
}
return(true);
}
function detectKeys() {
var _local3 = _root.objectRef;
if (_root.movement == "right") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, 0, -1);
} else if (_root.movement == "left") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, 0, 1);
} else if (_root.movement == "up") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, -1, 0);
} else if (_root.movement == "down") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, 1, 0);
}
if (!keyPressed) {
_local3.clip.char.gotoAndStop(1);
} else {
_local3.clip.char.play();
}
i = 1;
while (i < (totalCar + 1)) {
var _local4 = this["car" + i];
_local4.clip.fade._visible = true;
i++;
}
_root.objectRef.clip.fade._visible = false;
}
function checkLevelEnd() {
if (_root.movement == null) {
i = 1;
while (i < (totalCar + 1)) {
var _local3 = this["car" + i].correctstatus;
if (_local3 != true) {
return(false);
}
i++;
}
if (!_root.levelEnd) {
endLevel();
}
}
}
function endLevel() {
_root.score = _root.score + (_root.totalAmount * 10);
clearInterval(_root.timerInterval);
_root.tilesSwap.swapDepths(_root.tiles);
_root.mc_levelup.gotoAndPlay(2);
_root.levelEnd = true;
return(undefined);
}
function gameEnd() {
clearInterval(_root.timerInterval);
_root.tilesSwap.swapDepths(_root.tiles);
_root.mc_timeup.gotoAndPlay(2);
_root.gameEndStatus = true;
return(undefined);
}
function reset6() {
clearInterval(timerInterval);
_root.levelEnd = false;
_root.gameEndStatus = false;
_root.tiles.removeMovieClip();
_root.movement = null;
_root.objectRef = null;
_root.totalAmount = 100;
_root.startGameStatus = true;
gotoAndPlay ("level6");
}
fscommand ("allowscale", false);
_root.levelEnd = false;
_root.gameEndStatus = false;
_root.tiles.removeMovieClip();
_root.movement = null;
_root.objectRef = null;
_root.totalAmount = 100;
_root.startGameStatus = true;
_root.gameLevel = 6;
if (_root.startGameStatus) {
_root.timer_clip.gotoAndStop(1);
_root.timerInterval = setInterval(depreciateAmount, 1000);
_root.startGameStatus = false;
}
myMap1 = [[1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1], [1, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 1], [1, 14, 0, 14, 2, 14, 0, 14, 0, 1, 0, 14, 0, 1], [1, 0, 14, 2, 13, 0, 14, 0, 14, 11, 1, 0, 14, 1], [1, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 1], [1, 0, 14, 0, 14, 0, 4, 0, 2, 0, 14, 0, 14, 2], [1, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 2], [2, 0, 14, 0, 14, 1, 14, 0, 14, 0, 14, 0, 13, 1], [2, 14, 0, 14, 0, 11, 0, 14, 0, 14, 0, 14, 0, 1], [1, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2]];
game = {tileW:30};
game.Tile0 = function () {
};
game.Tile0.prototype.walkable = true;
game.Tile0.prototype.frame = 1;
game.Tile14 = function () {
};
game.Tile14.prototype.walkable = true;
game.Tile14.prototype.frame = 14;
game.Tile1 = function () {
};
game.Tile1.prototype.walkable = false;
game.Tile1.prototype.frame = 2;
game.Tile2 = function () {
};
game.Tile2.prototype.walkable = false;
game.Tile2.prototype.frame = 3;
game.Tile3 = function () {
};
game.Tile3.prototype.walkable = false;
game.Tile3.prototype.frame = 4;
game.Tile4 = function () {
};
game.Tile4.prototype.walkable = false;
game.Tile4.prototype.frame = 5;
game.Tile5 = function () {
};
game.Tile5.prototype.walkable = false;
game.Tile5.prototype.frame = 6;
game.Tile11 = function () {
};
game.Tile11.prototype.walkable = true;
game.Tile11.prototype.frame = 11;
game.Tile12 = function () {
};
game.Tile12.prototype.walkable = true;
game.Tile12.prototype.frame = 12;
game.Tile13 = function () {
};
game.Tile13.prototype.walkable = true;
game.Tile13.prototype.frame = 13;
car1 = {xtile:1, ytile:5, speed:10, width:30, height:30, correctcode:11, clipName:"car1"};
car2 = {xtile:9, ytile:8, speed:10, width:30, height:30, correctcode:11, clipName:"car1"};
car3 = {xtile:7, ytile:1, speed:10, width:30, height:30, correctcode:13, clipName:"car3"};
car4 = {xtile:11, ytile:3, speed:10, width:30, height:30, correctcode:13, clipName:"car3"};
totalCar = 4;
buildMap(_root.myMap1);
_root.tiles._xscale = 120;
_root.tiles._yscale = 120;
_root.mc_mask.swapDepths(_root.tiles);
_root.gameBGSound.stop();
_root.gameBGSound = null;
_root.gameBGSound = new Sound();
_root.gameBGSound.attachSound("bgSound");
_root.gameBGSound.start(0, 1000);
_root.gameBGSound.setVolume(50);
stop();
Instance of Symbol 44 MovieClip [empty] "controller" in Frame 36
onClipEvent (enterFrame) {
_root.detectKeys();
}
onClipEvent (keyDown) {
if ((_root.movement == null) && (!_root.gameEndStatus)) {
if (Key.isDown(39)) {
_root.movement = "right";
} else if (Key.isDown(37)) {
_root.movement = "left";
} else if (Key.isDown(38)) {
_root.movement = "up";
} else if (Key.isDown(40)) {
_root.movement = "down";
} else if (Key.getCode() == "90") {
_root.objectRef = _root.car1;
} else if (Key.getCode() == "88") {
_root.objectRef = _root.car2;
} else if (Key.getCode() == "67") {
_root.objectRef = _root.car3;
} else if (Key.getCode() == "86") {
_root.objectRef = _root.car4;
}
}
}
Instance of Symbol 229 MovieClip "tilesSwap" in Frame 36
/* no clip actions */
Instance of Symbol 245 MovieClip "mc_levelup" in Frame 36
onClipEvent (load) {
nextLevel = 7;
}
Instance of Symbol 250 MovieClip "mc_timeup" in Frame 36
onClipEvent (load) {
function callFunc() {
_root.reset6();
}
}
Frame 38
function depreciateAmount() {
_root.totalAmount = _root.totalAmount - 1;
timeNum = 100 - _root.totalAmount;
if (_root.totalAmount <= 0) {
_root.gameEnd();
}
}
function buildMap(map) {
_root.attachMovie("empty", "tiles", 1);
_root.tiles.attachMovie("empty", "back", 0);
game.clip = _root.tiles;
game.clip._x = 280;
game.clip._y = 0;
var _local7 = map[0].length;
var _local8 = map.length;
var _local4 = 0;
while (_local4 < _local8) {
var _local3 = 0;
while (_local3 < _local7) {
var _local2 = (("t_" + _local4) + "_") + _local3;
game[_local2] = new game["Tile" + map[_local4][_local3]]();
if (game[_local2].walkable) {
var _local5 = game.clip.back;
} else {
var _local5 = game.clip;
}
game[_local2].depth = (((((_local3 + _local4) * game.tileW) / 2) * 300) + ((_local3 - _local4) * game.tileW)) + 1;
_local5.attachMovie("tile", _local2, game[_local2].depth);
_local5[_local2]._x = (_local3 - _local4) * game.tileW;
_local5[_local2]._y = ((_local3 + _local4) * game.tileW) / 2;
_local5[_local2].gotoAndStop(game[_local2].frame);
_local3++;
}
_local4++;
}
createCars(_root.totalCar + 1);
}
function createCars(num) {
i = 1;
while (i < num) {
var _local3 = this["car" + i];
_local3.x = _local3.xtile * game.tileW;
_local3.y = _local3.ytile * game.tileW;
_local3.xiso = _local3.x - _local3.y;
_local3.yiso = (_local3.x + _local3.y) / 2;
_local3.depthshift = (game.tileW - _local3.height) / 2;
_local3.depth = (((_local3.yiso - _local3.depthshift) * 300) + _local3.xiso) + 1;
_local3.correctstatus = false;
carName = "car" + i;
dupName = _local3.clipName;
carRef = game.clip.attachMovie(dupName, carName, _local3.depth);
_local3.clip = carRef;
_local3.clip.objectRef = _local3;
_local3.clip._x = _local3.xiso;
_local3.clip._y = _local3.yiso;
_root.tileMap[_local3.ytile][_local3.xtile] = 20;
var _local4 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local4].walkable = false;
i++;
}
}
function getMyCorners(x, y, ob) {
ob.downY = Math.floor(((y + ob.height) - 1) / game.tileW);
ob.upY = Math.floor(y / game.tileW);
ob.leftX = Math.floor(x / game.tileW);
ob.rightX = Math.floor(((x + ob.width) - 1) / game.tileW);
ob.upleft = game[(("t_" + ob.upY) + "_") + ob.leftX].walkable;
ob.downleft = game[(("t_" + ob.downY) + "_") + ob.leftX].walkable;
ob.upright = game[(("t_" + ob.upY) + "_") + ob.rightX].walkable;
ob.downright = game[(("t_" + ob.downY) + "_") + ob.rightX].walkable;
}
function moveChar(ob, dirx, diry) {
getMyCorners(ob.x, ob.y + (ob.speed * diry), ob);
if (diry == -1) {
if (ob.upleft and ob.upright) {
ob.y = ob.y + (ob.speed * diry);
ob.clip.gotoAndStop("up");
} else {
ob.y = ob.ytile * game.tileW;
_root.movement = null;
}
}
if (diry == 1) {
if (ob.downleft and ob.downright) {
ob.y = ob.y + (ob.speed * diry);
ob.clip.gotoAndStop("down");
} else {
ob.y = ((ob.ytile + 1) * game.tileW) - ob.height;
_root.movement = null;
}
}
getMyCorners(ob.x + (ob.speed * dirx), ob.y, ob);
if (dirx == -1) {
if (ob.downleft and ob.upleft) {
ob.x = ob.x + (ob.speed * dirx);
ob.clip.gotoAndStop("left");
} else {
ob.x = ob.xtile * game.tileW;
_root.movement = null;
}
}
if (dirx == 1) {
if (ob.upright and ob.downright) {
ob.x = ob.x + (ob.speed * dirx);
ob.clip.gotoAndStop("right");
} else {
ob.x = ((ob.xtile + 1) * game.tileW) - ob.width;
_root.movement = null;
}
}
ob.xiso = ob.x - ob.y;
ob.yiso = (ob.x + ob.y) / 2;
ob.clip._x = ob.xiso;
ob.clip._y = ob.yiso;
ob.xtile = Math.floor(ob.x / game.tileW);
ob.ytile = Math.floor(ob.y / game.tileW);
_root.tileMap[ob.ytile][ob.xtile] = 20;
var _local5 = (("t_" + ob.ytile) + "_") + ob.xtile;
var _local6 = game[_local5].frame;
game[_local5].walkable = false;
ob.depth = (((ob.yiso - ob.depthshift) * 300) + ob.xiso) + 1;
ob.clip.swapDepths(ob.depth);
if (_local6 == ob.correctcode) {
ob.correctstatus = true;
checkLevelEnd();
} else {
ob.correctstatus = false;
}
return(true);
}
function detectKeys() {
var _local3 = _root.objectRef;
if (_root.movement == "right") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, 0, -1);
} else if (_root.movement == "left") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, 0, 1);
} else if (_root.movement == "up") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, -1, 0);
} else if (_root.movement == "down") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, 1, 0);
}
if (!keyPressed) {
_local3.clip.char.gotoAndStop(1);
} else {
_local3.clip.char.play();
}
i = 1;
while (i < (totalCar + 1)) {
var _local4 = this["car" + i];
_local4.clip.fade._visible = true;
i++;
}
_root.objectRef.clip.fade._visible = false;
}
function checkLevelEnd() {
if (_root.movement == null) {
i = 1;
while (i < (totalCar + 1)) {
var _local3 = this["car" + i].correctstatus;
if (_local3 != true) {
return(false);
}
i++;
}
if (!_root.levelEnd) {
endLevel();
}
}
}
function endLevel() {
_root.score = _root.score + (_root.totalAmount * 10);
clearInterval(_root.timerInterval);
_root.tilesSwap.swapDepths(_root.tiles);
_root.mc_levelup.gotoAndPlay(2);
_root.levelEnd = true;
return(undefined);
}
function gameEnd() {
clearInterval(_root.timerInterval);
_root.tilesSwap.swapDepths(_root.tiles);
_root.mc_timeup.gotoAndPlay(2);
_root.gameEndStatus = true;
return(undefined);
}
function reset7() {
clearInterval(timerInterval);
_root.levelEnd = false;
_root.gameEndStatus = false;
_root.tiles.removeMovieClip();
_root.movement = null;
_root.objectRef = null;
_root.totalAmount = 100;
_root.startGameStatus = true;
gotoAndPlay ("level7");
}
fscommand ("allowscale", false);
_root.levelEnd = false;
_root.gameEndStatus = false;
_root.tiles.removeMovieClip();
_root.movement = null;
_root.objectRef = null;
_root.totalAmount = 100;
_root.startGameStatus = true;
_root.gameLevel = 7;
if (_root.startGameStatus) {
_root.timer_clip.gotoAndStop(1);
_root.timerInterval = setInterval(depreciateAmount, 1000);
_root.startGameStatus = false;
}
myMap1 = [[1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1], [1, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 1], [1, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 1], [1, 0, 14, 1, 4, 1, 14, 0, 14, 1, 12, 1, 14, 1], [1, 14, 0, 11, 12, 13, 0, 14, 0, 1, 1, 1, 0, 1], [1, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 2], [1, 14, 0, 14, 0, 14, 0, 14, 0, 14, 1, 1, 0, 1], [1, 13, 14, 0, 14, 0, 14, 0, 14, 0, 11, 4, 14, 1], [3, 14, 0, 14, 0, 14, 0, 14, 0, 14, 1, 1, 0, 1], [1, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 1], [1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2]];
game = {tileW:30};
game.Tile0 = function () {
};
game.Tile0.prototype.walkable = true;
game.Tile0.prototype.frame = 1;
game.Tile14 = function () {
};
game.Tile14.prototype.walkable = true;
game.Tile14.prototype.frame = 14;
game.Tile1 = function () {
};
game.Tile1.prototype.walkable = false;
game.Tile1.prototype.frame = 2;
game.Tile2 = function () {
};
game.Tile2.prototype.walkable = false;
game.Tile2.prototype.frame = 3;
game.Tile3 = function () {
};
game.Tile3.prototype.walkable = false;
game.Tile3.prototype.frame = 4;
game.Tile4 = function () {
};
game.Tile4.prototype.walkable = false;
game.Tile4.prototype.frame = 5;
game.Tile5 = function () {
};
game.Tile5.prototype.walkable = false;
game.Tile5.prototype.frame = 6;
game.Tile11 = function () {
};
game.Tile11.prototype.walkable = true;
game.Tile11.prototype.frame = 11;
game.Tile12 = function () {
};
game.Tile12.prototype.walkable = true;
game.Tile12.prototype.frame = 12;
game.Tile13 = function () {
};
game.Tile13.prototype.walkable = true;
game.Tile13.prototype.frame = 13;
car1 = {xtile:1, ytile:4, speed:10, width:30, height:30, correctcode:11, clipName:"car1"};
car2 = {xtile:8, ytile:8, speed:10, width:30, height:30, correctcode:11, clipName:"car1"};
car3 = {xtile:4, ytile:9, speed:10, width:30, height:30, correctcode:12, clipName:"car2"};
car4 = {xtile:5, ytile:5, speed:10, width:30, height:30, correctcode:12, clipName:"car2"};
car5 = {xtile:2, ytile:6, speed:10, width:30, height:30, correctcode:13, clipName:"car3"};
car6 = {xtile:9, ytile:2, speed:10, width:30, height:30, correctcode:13, clipName:"car3"};
totalCar = 6;
buildMap(_root.myMap1);
_root.tiles._xscale = 120;
_root.tiles._yscale = 120;
_root.mc_mask.swapDepths(_root.tiles);
_root.gameBGSound.stop();
_root.gameBGSound = null;
_root.gameBGSound = new Sound();
_root.gameBGSound.attachSound("bgSound");
_root.gameBGSound.start(0, 1000);
_root.gameBGSound.setVolume(50);
stop();
Instance of Symbol 44 MovieClip [empty] "controller" in Frame 38
onClipEvent (enterFrame) {
_root.detectKeys();
}
onClipEvent (keyDown) {
if ((_root.movement == null) && (!_root.gameEndStatus)) {
if (Key.isDown(39)) {
_root.movement = "right";
} else if (Key.isDown(37)) {
_root.movement = "left";
} else if (Key.isDown(38)) {
_root.movement = "up";
} else if (Key.isDown(40)) {
_root.movement = "down";
} else if (Key.getCode() == "90") {
_root.objectRef = _root.car1;
} else if (Key.getCode() == "88") {
_root.objectRef = _root.car2;
} else if (Key.getCode() == "67") {
_root.objectRef = _root.car3;
} else if (Key.getCode() == "86") {
_root.objectRef = _root.car4;
}
}
}
Instance of Symbol 229 MovieClip "tilesSwap" in Frame 38
/* no clip actions */
Instance of Symbol 245 MovieClip "mc_levelup" in Frame 38
onClipEvent (load) {
nextLevel = 8;
}
Instance of Symbol 250 MovieClip "mc_timeup" in Frame 38
onClipEvent (load) {
function callFunc() {
_root.reset7();
}
}
Frame 40
function depreciateAmount() {
_root.totalAmount = _root.totalAmount - 1;
timeNum = 100 - _root.totalAmount;
if (_root.totalAmount <= 0) {
_root.gameEnd();
}
}
function buildMap(map) {
_root.attachMovie("empty", "tiles", 2);
_root.tiles.attachMovie("empty", "back", 0);
game.clip = _root.tiles;
game.clip._x = 280;
game.clip._y = 0;
var _local7 = map[0].length;
var _local8 = map.length;
var _local4 = 0;
while (_local4 < _local8) {
var _local3 = 0;
while (_local3 < _local7) {
var _local2 = (("t_" + _local4) + "_") + _local3;
game[_local2] = new game["Tile" + map[_local4][_local3]]();
if (game[_local2].walkable) {
var _local5 = game.clip.back;
} else {
var _local5 = game.clip;
}
game[_local2].depth = (((((_local3 + _local4) * game.tileW) / 2) * 300) + ((_local3 - _local4) * game.tileW)) + 1;
_local5.attachMovie("tile", _local2, game[_local2].depth);
_local5[_local2]._x = (_local3 - _local4) * game.tileW;
_local5[_local2]._y = ((_local3 + _local4) * game.tileW) / 2;
_local5[_local2].gotoAndStop(game[_local2].frame);
_local3++;
}
_local4++;
}
createCars(_root.totalCar + 1);
}
function createCars(num) {
i = 1;
while (i < num) {
var _local3 = this["car" + i];
_local3.x = _local3.xtile * game.tileW;
_local3.y = _local3.ytile * game.tileW;
_local3.xiso = _local3.x - _local3.y;
_local3.yiso = (_local3.x + _local3.y) / 2;
_local3.depthshift = (game.tileW - _local3.height) / 2;
_local3.depth = (((_local3.yiso - _local3.depthshift) * 300) + _local3.xiso) + 1;
_local3.correctstatus = false;
carName = "car" + i;
dupName = _local3.clipName;
carRef = game.clip.attachMovie(dupName, carName, _local3.depth);
_local3.clip = carRef;
_local3.clip.objectRef = _local3;
_local3.clip._x = _local3.xiso;
_local3.clip._y = _local3.yiso;
_root.tileMap[_local3.ytile][_local3.xtile] = 20;
var _local4 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local4].walkable = false;
i++;
}
}
function getMyCorners(x, y, ob) {
ob.downY = Math.floor(((y + ob.height) - 1) / game.tileW);
ob.upY = Math.floor(y / game.tileW);
ob.leftX = Math.floor(x / game.tileW);
ob.rightX = Math.floor(((x + ob.width) - 1) / game.tileW);
ob.upleft = game[(("t_" + ob.upY) + "_") + ob.leftX].walkable;
ob.downleft = game[(("t_" + ob.downY) + "_") + ob.leftX].walkable;
ob.upright = game[(("t_" + ob.upY) + "_") + ob.rightX].walkable;
ob.downright = game[(("t_" + ob.downY) + "_") + ob.rightX].walkable;
}
function moveChar(ob, dirx, diry) {
getMyCorners(ob.x, ob.y + (ob.speed * diry), ob);
if (diry == -1) {
if (ob.upleft and ob.upright) {
ob.y = ob.y + (ob.speed * diry);
ob.clip.gotoAndStop("up");
} else {
ob.y = ob.ytile * game.tileW;
_root.movement = null;
}
}
if (diry == 1) {
if (ob.downleft and ob.downright) {
ob.y = ob.y + (ob.speed * diry);
ob.clip.gotoAndStop("down");
} else {
ob.y = ((ob.ytile + 1) * game.tileW) - ob.height;
_root.movement = null;
}
}
getMyCorners(ob.x + (ob.speed * dirx), ob.y, ob);
if (dirx == -1) {
if (ob.downleft and ob.upleft) {
ob.x = ob.x + (ob.speed * dirx);
ob.clip.gotoAndStop("left");
} else {
ob.x = ob.xtile * game.tileW;
_root.movement = null;
}
}
if (dirx == 1) {
if (ob.upright and ob.downright) {
ob.x = ob.x + (ob.speed * dirx);
ob.clip.gotoAndStop("right");
} else {
ob.x = ((ob.xtile + 1) * game.tileW) - ob.width;
_root.movement = null;
}
}
ob.xiso = ob.x - ob.y;
ob.yiso = (ob.x + ob.y) / 2;
ob.clip._x = ob.xiso;
ob.clip._y = ob.yiso;
ob.xtile = Math.floor(ob.x / game.tileW);
ob.ytile = Math.floor(ob.y / game.tileW);
_root.tileMap[ob.ytile][ob.xtile] = 20;
var _local5 = (("t_" + ob.ytile) + "_") + ob.xtile;
var _local6 = game[_local5].frame;
game[_local5].walkable = false;
ob.depth = (((ob.yiso - ob.depthshift) * 300) + ob.xiso) + 1;
ob.clip.swapDepths(ob.depth);
if (_local6 == ob.correctcode) {
ob.correctstatus = true;
checkLevelEnd();
} else {
ob.correctstatus = false;
}
return(true);
}
function detectKeys() {
var _local3 = _root.objectRef;
if (_root.movement == "right") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, 0, -1);
} else if (_root.movement == "left") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, 0, 1);
} else if (_root.movement == "up") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, -1, 0);
} else if (_root.movement == "down") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, 1, 0);
}
if (!keyPressed) {
_local3.clip.char.gotoAndStop(1);
} else {
_local3.clip.char.play();
}
i = 1;
while (i < (totalCar + 1)) {
var _local4 = this["car" + i];
_local4.clip.fade._visible = true;
i++;
}
_root.objectRef.clip.fade._visible = false;
}
function checkLevelEnd() {
if (_root.movement == null) {
i = 1;
while (i < (totalCar + 1)) {
var _local3 = this["car" + i].correctstatus;
if (_local3 != true) {
return(false);
}
i++;
}
if (!_root.levelEnd) {
endLevel();
}
}
}
function endLevel() {
_root.score = _root.score + (_root.totalAmount * 10);
clearInterval(_root.timerInterval);
_root.tilesSwap.swapDepths(_root.tiles);
_root.mc_levelup.gotoAndPlay(2);
_root.levelEnd = true;
return(undefined);
}
function gameEnd() {
clearInterval(_root.timerInterval);
_root.tilesSwap.swapDepths(_root.tiles);
_root.mc_timeup.gotoAndPlay(2);
_root.gameEndStatus = true;
return(undefined);
}
function reset8() {
clearInterval(timerInterval);
_root.levelEnd = false;
_root.gameEndStatus = false;
_root.tiles.removeMovieClip();
_root.movement = null;
_root.objectRef = null;
_root.totalAmount = 100;
_root.startGameStatus = true;
gotoAndPlay ("level8");
}
fscommand ("allowscale", false);
_root.levelEnd = false;
_root.gameEndStatus = false;
_root.tiles.removeMovieClip();
_root.movement = null;
_root.objectRef = null;
_root.totalAmount = 100;
_root.startGameStatus = true;
_root.gameLevel = 8;
if (_root.startGameStatus) {
_root.timer_clip.gotoAndStop(1);
_root.timerInterval = setInterval(depreciateAmount, 1000);
_root.startGameStatus = false;
}
myMap1 = [[1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1], [1, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 1], [5, 14, 0, 14, 0, 11, 12, 14, 0, 14, 0, 14, 0, 1], [1, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 1], [1, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 1], [1, 0, 14, 0, 14, 0, 4, 0, 14, 12, 2, 0, 14, 2], [1, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 2], [1, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 1], [1, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 1], [1, 0, 14, 0, 14, 11, 1, 0, 14, 0, 14, 0, 14, 1], [1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2]];
game = {tileW:30};
game.Tile0 = function () {
};
game.Tile0.prototype.walkable = true;
game.Tile0.prototype.frame = 1;
game.Tile14 = function () {
};
game.Tile14.prototype.walkable = true;
game.Tile14.prototype.frame = 14;
game.Tile1 = function () {
};
game.Tile1.prototype.walkable = false;
game.Tile1.prototype.frame = 2;
game.Tile2 = function () {
};
game.Tile2.prototype.walkable = false;
game.Tile2.prototype.frame = 3;
game.Tile3 = function () {
};
game.Tile3.prototype.walkable = false;
game.Tile3.prototype.frame = 4;
game.Tile4 = function () {
};
game.Tile4.prototype.walkable = false;
game.Tile4.prototype.frame = 5;
game.Tile5 = function () {
};
game.Tile5.prototype.walkable = false;
game.Tile5.prototype.frame = 6;
game.Tile11 = function () {
};
game.Tile11.prototype.walkable = true;
game.Tile11.prototype.frame = 11;
game.Tile12 = function () {
};
game.Tile12.prototype.walkable = true;
game.Tile12.prototype.frame = 12;
car1 = {xtile:4, ytile:1, speed:10, width:30, height:30, correctcode:11, clipName:"car1"};
car2 = {xtile:7, ytile:3, speed:10, width:30, height:30, correctcode:11, clipName:"car1"};
car3 = {xtile:7, ytile:6, speed:10, width:30, height:30, correctcode:12, clipName:"car2"};
car4 = {xtile:1, ytile:1, speed:10, width:30, height:30, correctcode:12, clipName:"car2"};
totalCar = 4;
buildMap(_root.myMap1);
_root.tiles._xscale = 120;
_root.tiles._yscale = 120;
_root.mc_mask.swapDepths(_root.tiles);
_root.gameBGSound.stop();
_root.gameBGSound = null;
_root.gameBGSound = new Sound();
_root.gameBGSound.attachSound("bgSound");
_root.gameBGSound.start(0, 1000);
_root.gameBGSound.setVolume(50);
stop();
Instance of Symbol 44 MovieClip [empty] "controller" in Frame 40
onClipEvent (enterFrame) {
_root.detectKeys();
}
onClipEvent (keyDown) {
if ((_root.movement == null) && (!_root.gameEndStatus)) {
if (Key.isDown(39)) {
_root.movement = "right";
} else if (Key.isDown(37)) {
_root.movement = "left";
} else if (Key.isDown(38)) {
_root.movement = "up";
} else if (Key.isDown(40)) {
_root.movement = "down";
} else if (Key.getCode() == "90") {
_root.objectRef = _root.car1;
} else if (Key.getCode() == "88") {
_root.objectRef = _root.car2;
} else if (Key.getCode() == "67") {
_root.objectRef = _root.car3;
} else if (Key.getCode() == "86") {
_root.objectRef = _root.car4;
}
}
}
Instance of Symbol 229 MovieClip "tilesSwap" in Frame 40
/* no clip actions */
Instance of Symbol 245 MovieClip "mc_levelup" in Frame 40
onClipEvent (load) {
nextLevel = 9;
}
Instance of Symbol 250 MovieClip "mc_timeup" in Frame 40
onClipEvent (load) {
function callFunc() {
_root.reset8();
}
}
Frame 42
function depreciateAmount() {
_root.totalAmount = _root.totalAmount - 1;
timeNum = 100 - _root.totalAmount;
if (_root.totalAmount <= 0) {
_root.gameEnd();
}
}
function buildMap(map) {
_root.attachMovie("empty", "tiles", 1);
_root.tiles.attachMovie("empty", "back", 0);
game.clip = _root.tiles;
game.clip._x = 280;
game.clip._y = 0;
var _local7 = map[0].length;
var _local8 = map.length;
var _local4 = 0;
while (_local4 < _local8) {
var _local3 = 0;
while (_local3 < _local7) {
var _local2 = (("t_" + _local4) + "_") + _local3;
game[_local2] = new game["Tile" + map[_local4][_local3]]();
if (game[_local2].walkable) {
var _local5 = game.clip.back;
} else {
var _local5 = game.clip;
}
game[_local2].depth = (((((_local3 + _local4) * game.tileW) / 2) * 300) + ((_local3 - _local4) * game.tileW)) + 1;
_local5.attachMovie("tile", _local2, game[_local2].depth);
_local5[_local2]._x = (_local3 - _local4) * game.tileW;
_local5[_local2]._y = ((_local3 + _local4) * game.tileW) / 2;
_local5[_local2].gotoAndStop(game[_local2].frame);
_local3++;
}
_local4++;
}
createCars(_root.totalCar + 1);
}
function createCars(num) {
i = 1;
while (i < num) {
var _local3 = this["car" + i];
_local3.x = _local3.xtile * game.tileW;
_local3.y = _local3.ytile * game.tileW;
_local3.xiso = _local3.x - _local3.y;
_local3.yiso = (_local3.x + _local3.y) / 2;
_local3.depthshift = (game.tileW - _local3.height) / 2;
_local3.depth = (((_local3.yiso - _local3.depthshift) * 300) + _local3.xiso) + 1;
_local3.correctstatus = false;
carName = "car" + i;
dupName = _local3.clipName;
carRef = game.clip.attachMovie(dupName, carName, _local3.depth);
_local3.clip = carRef;
_local3.clip.objectRef = _local3;
_local3.clip._x = _local3.xiso;
_local3.clip._y = _local3.yiso;
_root.tileMap[_local3.ytile][_local3.xtile] = 20;
var _local4 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local4].walkable = false;
i++;
}
}
function getMyCorners(x, y, ob) {
ob.downY = Math.floor(((y + ob.height) - 1) / game.tileW);
ob.upY = Math.floor(y / game.tileW);
ob.leftX = Math.floor(x / game.tileW);
ob.rightX = Math.floor(((x + ob.width) - 1) / game.tileW);
ob.upleft = game[(("t_" + ob.upY) + "_") + ob.leftX].walkable;
ob.downleft = game[(("t_" + ob.downY) + "_") + ob.leftX].walkable;
ob.upright = game[(("t_" + ob.upY) + "_") + ob.rightX].walkable;
ob.downright = game[(("t_" + ob.downY) + "_") + ob.rightX].walkable;
}
function moveChar(ob, dirx, diry) {
getMyCorners(ob.x, ob.y + (ob.speed * diry), ob);
if (diry == -1) {
if (ob.upleft and ob.upright) {
ob.y = ob.y + (ob.speed * diry);
ob.clip.gotoAndStop("up");
} else {
ob.y = ob.ytile * game.tileW;
_root.movement = null;
}
}
if (diry == 1) {
if (ob.downleft and ob.downright) {
ob.y = ob.y + (ob.speed * diry);
ob.clip.gotoAndStop("down");
} else {
ob.y = ((ob.ytile + 1) * game.tileW) - ob.height;
_root.movement = null;
}
}
getMyCorners(ob.x + (ob.speed * dirx), ob.y, ob);
if (dirx == -1) {
if (ob.downleft and ob.upleft) {
ob.x = ob.x + (ob.speed * dirx);
ob.clip.gotoAndStop("left");
} else {
ob.x = ob.xtile * game.tileW;
_root.movement = null;
}
}
if (dirx == 1) {
if (ob.upright and ob.downright) {
ob.x = ob.x + (ob.speed * dirx);
ob.clip.gotoAndStop("right");
} else {
ob.x = ((ob.xtile + 1) * game.tileW) - ob.width;
_root.movement = null;
}
}
ob.xiso = ob.x - ob.y;
ob.yiso = (ob.x + ob.y) / 2;
ob.clip._x = ob.xiso;
ob.clip._y = ob.yiso;
ob.xtile = Math.floor(ob.x / game.tileW);
ob.ytile = Math.floor(ob.y / game.tileW);
_root.tileMap[ob.ytile][ob.xtile] = 20;
var _local5 = (("t_" + ob.ytile) + "_") + ob.xtile;
var _local6 = game[_local5].frame;
game[_local5].walkable = false;
ob.depth = (((ob.yiso - ob.depthshift) * 300) + ob.xiso) + 1;
ob.clip.swapDepths(ob.depth);
if (_local6 == ob.correctcode) {
ob.correctstatus = true;
checkLevelEnd();
} else {
ob.correctstatus = false;
}
return(true);
}
function detectKeys() {
var _local3 = _root.objectRef;
if (_root.movement == "right") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, 0, -1);
} else if (_root.movement == "left") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, 0, 1);
} else if (_root.movement == "up") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, -1, 0);
} else if (_root.movement == "down") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, 1, 0);
}
if (!keyPressed) {
_local3.clip.char.gotoAndStop(1);
} else {
_local3.clip.char.play();
}
i = 1;
while (i < (totalCar + 1)) {
var _local4 = this["car" + i];
_local4.clip.fade._visible = true;
i++;
}
_root.objectRef.clip.fade._visible = false;
}
function checkLevelEnd() {
if (_root.movement == null) {
i = 1;
while (i < (totalCar + 1)) {
var _local3 = this["car" + i].correctstatus;
if (_local3 != true) {
return(false);
}
i++;
}
if (!_root.levelEnd) {
endLevel();
}
}
}
function endLevel() {
clearInterval(_root.timerInterval);
_root.score = _root.score + Number(_root.totalAmount * 10);
_root.tilesSwap.swapDepths(_root.tiles);
_root.mc_levelup.gotoAndPlay(2);
_root.levelEnd = true;
return(undefined);
}
function gameEnd() {
clearInterval(_root.timerInterval);
_root.tilesSwap.swapDepths(_root.tiles);
_root.mc_timeup.gotoAndPlay(2);
_root.gameEndStatus = true;
return(undefined);
}
function reset9() {
clearInterval(timerInterval);
_root.levelEnd = false;
_root.gameEndStatus = false;
_root.tiles.removeMovieClip();
_root.movement = null;
_root.objectRef = null;
_root.totalAmount = 100;
_root.startGameStatus = true;
gotoAndPlay ("level9");
}
fscommand ("allowscale", false);
_root.levelEnd = false;
_root.gameEndStatus = false;
_root.tiles.removeMovieClip();
_root.movement = null;
_root.objectRef = null;
_root.totalAmount = 100;
_root.startGameStatus = true;
_root.gameLevel = 9;
if (_root.startGameStatus) {
_root.timer_clip.gotoAndStop(1);
_root.timerInterval = setInterval(depreciateAmount, 1000);
_root.startGameStatus = false;
}
myMap1 = [[1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1], [2, 0, 14, 0, 14, 0, 14, 0, 14, 0, 12, 0, 14, 1], [2, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 1], [1, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 1], [1, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 2], [1, 11, 14, 0, 14, 0, 4, 0, 14, 0, 14, 0, 14, 2], [1, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 13, 0, 1], [1, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 1], [1, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 1], [1, 0, 14, 11, 14, 0, 14, 12, 13, 2, 14, 0, 14, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2]];
game = {tileW:30};
game.Tile0 = function () {
};
game.Tile0.prototype.walkable = true;
game.Tile0.prototype.frame = 1;
game.Tile14 = function () {
};
game.Tile14.prototype.walkable = true;
game.Tile14.prototype.frame = 14;
game.Tile1 = function () {
};
game.Tile1.prototype.walkable = false;
game.Tile1.prototype.frame = 2;
game.Tile2 = function () {
};
game.Tile2.prototype.walkable = false;
game.Tile2.prototype.frame = 3;
game.Tile3 = function () {
};
game.Tile3.prototype.walkable = false;
game.Tile3.prototype.frame = 4;
game.Tile4 = function () {
};
game.Tile4.prototype.walkable = false;
game.Tile4.prototype.frame = 5;
game.Tile11 = function () {
};
game.Tile11.prototype.walkable = true;
game.Tile11.prototype.frame = 11;
game.Tile12 = function () {
};
game.Tile12.prototype.walkable = true;
game.Tile12.prototype.frame = 12;
game.Tile13 = function () {
};
game.Tile13.prototype.walkable = true;
game.Tile13.prototype.frame = 13;
car1 = {xtile:4, ytile:4, speed:10, width:30, height:30, correctcode:11, clipName:"car1"};
car2 = {xtile:2, ytile:8, speed:10, width:30, height:30, correctcode:11, clipName:"car1"};
car3 = {xtile:6, ytile:9, speed:10, width:30, height:30, correctcode:12, clipName:"car2"};
car4 = {xtile:3, ytile:5, speed:10, width:30, height:30, correctcode:12, clipName:"car2"};
car5 = {xtile:2, ytile:4, speed:10, width:30, height:30, correctcode:13, clipName:"car3"};
car6 = {xtile:2, ytile:1, speed:10, width:30, height:30, correctcode:13, clipName:"car3"};
totalCar = 6;
buildMap(_root.myMap1);
_root.tiles._xscale = 120;
_root.tiles._yscale = 120;
_root.mc_mask.swapDepths(_root.tiles);
_root.gameBGSound.stop();
_root.gameBGSound = null;
_root.gameBGSound = new Sound();
_root.gameBGSound.attachSound("bgSound");
_root.gameBGSound.start(0, 1000);
_root.gameBGSound.setVolume(50);
stop();
Instance of Symbol 44 MovieClip [empty] "controller" in Frame 42
onClipEvent (enterFrame) {
_root.detectKeys();
}
onClipEvent (keyDown) {
if ((_root.movement == null) && (!_root.gameEndStatus)) {
if (Key.isDown(39)) {
_root.movement = "right";
} else if (Key.isDown(37)) {
_root.movement = "left";
} else if (Key.isDown(38)) {
_root.movement = "up";
} else if (Key.isDown(40)) {
_root.movement = "down";
} else if (Key.getCode() == "90") {
_root.objectRef = _root.car1;
} else if (Key.getCode() == "88") {
_root.objectRef = _root.car2;
} else if (Key.getCode() == "67") {
_root.objectRef = _root.car3;
} else if (Key.getCode() == "86") {
_root.objectRef = _root.car4;
}
}
}
Instance of Symbol 229 MovieClip "tilesSwap" in Frame 42
/* no clip actions */
Instance of Symbol 245 MovieClip "mc_levelup" in Frame 42
onClipEvent (load) {
nextLevel = 10;
}
Instance of Symbol 250 MovieClip "mc_timeup" in Frame 42
onClipEvent (load) {
function callFunc() {
_root.reset9();
}
}
Frame 44
function depreciateAmount() {
_root.totalAmount = _root.totalAmount - 1;
timeNum = 100 - _root.totalAmount;
if (_root.totalAmount <= 0) {
_root.gameEnd();
}
}
function buildMap(map) {
_root.attachMovie("empty", "tiles", 1);
_root.tiles.attachMovie("empty", "back", 0);
game.clip = _root.tiles;
game.clip._x = 280;
game.clip._y = 0;
var _local7 = map[0].length;
var _local8 = map.length;
var _local4 = 0;
while (_local4 < _local8) {
var _local3 = 0;
while (_local3 < _local7) {
var _local2 = (("t_" + _local4) + "_") + _local3;
game[_local2] = new game["Tile" + map[_local4][_local3]]();
if (game[_local2].walkable) {
var _local5 = game.clip.back;
} else {
var _local5 = game.clip;
}
game[_local2].depth = (((((_local3 + _local4) * game.tileW) / 2) * 300) + ((_local3 - _local4) * game.tileW)) + 1;
_local5.attachMovie("tile", _local2, game[_local2].depth);
_local5[_local2]._x = (_local3 - _local4) * game.tileW;
_local5[_local2]._y = ((_local3 + _local4) * game.tileW) / 2;
_local5[_local2].gotoAndStop(game[_local2].frame);
_local3++;
}
_local4++;
}
createCars(_root.totalCar + 1);
}
function createCars(num) {
i = 1;
while (i < num) {
var _local3 = this["car" + i];
_local3.x = _local3.xtile * game.tileW;
_local3.y = _local3.ytile * game.tileW;
_local3.xiso = _local3.x - _local3.y;
_local3.yiso = (_local3.x + _local3.y) / 2;
_local3.depthshift = (game.tileW - _local3.height) / 2;
_local3.depth = (((_local3.yiso - _local3.depthshift) * 300) + _local3.xiso) + 1;
_local3.correctstatus = false;
carName = "car" + i;
dupName = _local3.clipName;
carRef = game.clip.attachMovie(dupName, carName, _local3.depth);
_local3.clip = carRef;
_local3.clip.objectRef = _local3;
_local3.clip._x = _local3.xiso;
_local3.clip._y = _local3.yiso;
_root.tileMap[_local3.ytile][_local3.xtile] = 20;
var _local4 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local4].walkable = false;
i++;
}
}
function getMyCorners(x, y, ob) {
ob.downY = Math.floor(((y + ob.height) - 1) / game.tileW);
ob.upY = Math.floor(y / game.tileW);
ob.leftX = Math.floor(x / game.tileW);
ob.rightX = Math.floor(((x + ob.width) - 1) / game.tileW);
ob.upleft = game[(("t_" + ob.upY) + "_") + ob.leftX].walkable;
ob.downleft = game[(("t_" + ob.downY) + "_") + ob.leftX].walkable;
ob.upright = game[(("t_" + ob.upY) + "_") + ob.rightX].walkable;
ob.downright = game[(("t_" + ob.downY) + "_") + ob.rightX].walkable;
}
function moveChar(ob, dirx, diry) {
getMyCorners(ob.x, ob.y + (ob.speed * diry), ob);
if (diry == -1) {
if (ob.upleft and ob.upright) {
ob.y = ob.y + (ob.speed * diry);
ob.clip.gotoAndStop("up");
} else {
ob.y = ob.ytile * game.tileW;
_root.movement = null;
}
}
if (diry == 1) {
if (ob.downleft and ob.downright) {
ob.y = ob.y + (ob.speed * diry);
ob.clip.gotoAndStop("down");
} else {
ob.y = ((ob.ytile + 1) * game.tileW) - ob.height;
_root.movement = null;
}
}
getMyCorners(ob.x + (ob.speed * dirx), ob.y, ob);
if (dirx == -1) {
if (ob.downleft and ob.upleft) {
ob.x = ob.x + (ob.speed * dirx);
ob.clip.gotoAndStop("left");
} else {
ob.x = ob.xtile * game.tileW;
_root.movement = null;
}
}
if (dirx == 1) {
if (ob.upright and ob.downright) {
ob.x = ob.x + (ob.speed * dirx);
ob.clip.gotoAndStop("right");
} else {
ob.x = ((ob.xtile + 1) * game.tileW) - ob.width;
_root.movement = null;
}
}
ob.xiso = ob.x - ob.y;
ob.yiso = (ob.x + ob.y) / 2;
ob.clip._x = ob.xiso;
ob.clip._y = ob.yiso;
ob.xtile = Math.floor(ob.x / game.tileW);
ob.ytile = Math.floor(ob.y / game.tileW);
_root.tileMap[ob.ytile][ob.xtile] = 20;
var _local5 = (("t_" + ob.ytile) + "_") + ob.xtile;
var _local6 = game[_local5].frame;
game[_local5].walkable = false;
ob.depth = (((ob.yiso - ob.depthshift) * 300) + ob.xiso) + 1;
ob.clip.swapDepths(ob.depth);
if (_local6 == ob.correctcode) {
ob.correctstatus = true;
checkLevelEnd();
} else {
ob.correctstatus = false;
}
return(true);
}
function detectKeys() {
var _local3 = _root.objectRef;
if (_root.movement == "right") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, 0, -1);
} else if (_root.movement == "left") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, 0, 1);
} else if (_root.movement == "up") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, -1, 0);
} else if (_root.movement == "down") {
_root.tileMap[_local3.ytile][_local3.xtile] = 0;
var _local5 = (("t_" + _local3.ytile) + "_") + _local3.xtile;
game[_local5].walkable = true;
keyPressed = _root.moveChar(_local3, 1, 0);
}
if (!keyPressed) {
_local3.clip.char.gotoAndStop(1);
} else {
_local3.clip.char.play();
}
i = 1;
while (i < (totalCar + 1)) {
var _local4 = this["car" + i];
_local4.clip.fade._visible = true;
i++;
}
_root.objectRef.clip.fade._visible = false;
}
function checkLevelEnd() {
if (_root.movement == null) {
i = 1;
while (i < (totalCar + 1)) {
var _local3 = this["car" + i].correctstatus;
if (_local3 != true) {
return(false);
}
i++;
}
if (!_root.levelEnd) {
endLevel();
}
}
}
function endLevel() {
_root.score = _root.score + (_root.totalAmount * 10);
clearInterval(_root.timerInterval);
_root.tilesSwap.swapDepths(_root.tiles);
_root.mc_levelup.gotoAndPlay(2);
_root.levelEnd = true;
return(undefined);
}
function gameEnd() {
clearInterval(_root.timerInterval);
_root.tilesSwap.swapDepths(_root.tiles);
_root.mc_timeup.gotoAndPlay(2);
_root.gameEndStatus = true;
return(undefined);
}
function congrats() {
clearInterval(_root.timerInterval);
_root.levelEnd = true;
_root.gameBGSound.stop();
_root.gameBGSound = null;
_root.tiles.removeMovieClip();
_root.movement = null;
_root.objectRef = null;
_root.totalAmount = 100;
_root.startGameStatus = true;
_root.gameEndStatus = true;
gotoAndPlay (49);
return(undefined);
}
function reset10() {
clearInterval(timerInterval);
_root.levelEnd = false;
_root.gameEndStatus = false;
_root.tiles.removeMovieClip();
_root.movement = null;
_root.objectRef = null;
_root.totalAmount = 100;
_root.startGameStatus = true;
gotoAndPlay ("level10");
}
fscommand ("allowscale", false);
_root.levelEnd = false;
_root.gameEndStatus = false;
_root.tiles.removeMovieClip();
_root.movement = null;
_root.objectRef = null;
_root.totalAmount = 100;
_root.startGameStatus = true;
_root.gameLevel = 10;
if (_root.startGameStatus) {
_root.timer_clip.gotoAndStop(1);
_root.timerInterval = setInterval(depreciateAmount, 1000);
_root.startGameStatus = false;
}
myMap1 = [[1, 1, 1, 5, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1], [1, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 1], [1, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 1], [3, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 1], [1, 14, 0, 14, 1, 1, 4, 1, 1, 14, 0, 14, 0, 1], [1, 0, 14, 0, 11, 1, 12, 1, 13, 0, 14, 0, 14, 2], [1, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 1], [1, 0, 1, 12, 14, 0, 14, 0, 14, 11, 1, 0, 14, 1], [1, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 1], [1, 0, 14, 0, 14, 0, 14, 0, 14, 0, 14, 0, 13, 1], [1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2]];
game = {tileW:30};
game.Tile0 = function () {
};
game.Tile0.prototype.walkable = true;
game.Tile0.prototype.frame = 1;
game.Tile14 = function () {
};
game.Tile14.prototype.walkable = true;
game.Tile14.prototype.frame = 14;
game.Tile1 = function () {
};
game.Tile1.prototype.walkable = false;
game.Tile1.prototype.frame = 2;
game.Tile2 = function () {
};
game.Tile2.prototype.walkable = false;
game.Tile2.prototype.frame = 3;
game.Tile3 = function () {
};
game.Tile3.prototype.walkable = false;
game.Tile3.prototype.frame = 4;
game.Tile4 = function () {
};
game.Tile4.prototype.walkable = false;
game.Tile4.prototype.frame = 5;
game.Tile5 = function () {
};
game.Tile5.prototype.walkable = false;
game.Tile5.prototype.frame = 6;
game.Tile11 = function () {
};
game.Tile11.prototype.walkable = true;
game.Tile11.prototype.frame = 11;
game.Tile12 = function () {
};
game.Tile12.prototype.walkable = true;
game.Tile12.prototype.frame = 12;
game.Tile13 = function () {
};
game.Tile13.prototype.walkable = true;
game.Tile13.prototype.frame = 13;
car1 = {xtile:1, ytile:2, speed:10, width:30, height:30, correctcode:11, clipName:"car1"};
car2 = {xtile:6, ytile:2, speed:10, width:30, height:30, correctcode:11, clipName:"car1"};
car3 = {xtile:3, ytile:9, speed:10, width:30, height:30, correctcode:12, clipName:"car2"};
car4 = {xtile:9, ytile:5, speed:10, width:30, height:30, correctcode:12, clipName:"car2"};
car5 = {xtile:11, ytile:4, speed:10, width:30, height:30, correctcode:13, clipName:"car3"};
car6 = {xtile:4, ytile:1, speed:10, width:30, height:30, correctcode:13, clipName:"car3"};
totalCar = 6;
buildMap(_root.myMap1);
_root.tiles._xscale = 120;
_root.tiles._yscale = 120;
_root.mc_mask.swapDepths(_root.tiles);
_root.gameBGSound.stop();
_root.gameBGSound = null;
_root.gameBGSound = new Sound();
_root.gameBGSound.attachSound("bgSound");
_root.gameBGSound.start(0, 1000);
_root.gameBGSound.setVolume(50);
stop();
Instance of Symbol 44 MovieClip [empty] "controller" in Frame 44
onClipEvent (enterFrame) {
_root.detectKeys();
}
onClipEvent (keyDown) {
if ((_root.movement == null) && (!_root.gameEndStatus)) {
if (Key.isDown(39)) {
_root.movement = "right";
} else if (Key.isDown(37)) {
_root.movement = "left";
} else if (Key.isDown(38)) {
_root.movement = "up";
} else if (Key.isDown(40)) {
_root.movement = "down";
} else if (Key.getCode() == "90") {
_root.objectRef = _root.car1;
} else if (Key.getCode() == "88") {
_root.objectRef = _root.car2;
} else if (Key.getCode() == "67") {
_root.objectRef = _root.car3;
} else if (Key.getCode() == "86") {
_root.objectRef = _root.car4;
}
}
}
Instance of Symbol 229 MovieClip "tilesSwap" in Frame 44
/* no clip actions */
Instance of Symbol 260 MovieClip "mc_levelup" in Frame 44
onClipEvent (load) {
nextLevel = 11;
}
Instance of Symbol 250 MovieClip "mc_timeup" in Frame 44
onClipEvent (load) {
function callFunc() {
_root.reset10();
}
}
Frame 45
fscommand ("allowscale", "false");
fscommand ("showmenu", "false");
Frame 48
stop();
Frame 49
fscommand ("allowscale", "false");
fscommand ("showmenu", "false");
Instance of Symbol 279 MovieClip in Frame 54
onClipEvent (load) {
_root.scoreSubmit = false;
}
onClipEvent (enterFrame) {
if (_parent.scoreName.text != "") {
_parent.trans_btn._visible = false;
} else if (_root.scoreSubmit != true) {
_parent.trans_btn.useHandCursor = false;
_parent.trans_btn._visible = true;
}
}
Frame 59
this.scoreText2.text = Math.ceil(_root.score);
Frame 64
stop();
Frame 80
stop();
Symbol 4 Button
on (release) {
if (_root.movement == null) {
_root.objectRef = this.objectRef;
}
}
Symbol 10 MovieClip [car2] Frame 1
stop();
Symbol 10 MovieClip [car2] Frame 2
stop();
Symbol 10 MovieClip [car2] Frame 3
stop();
Symbol 10 MovieClip [car2] Frame 4
stop();
Symbol 15 MovieClip [car3] Frame 1
stop();
stop();
Symbol 15 MovieClip [car3] Frame 2
stop();
Symbol 15 MovieClip [car3] Frame 3
stop();
Symbol 15 MovieClip [car3] Frame 4
stop();
Symbol 20 MovieClip [car1] Frame 1
stop();
stop();
Symbol 20 MovieClip [car1] Frame 2
stop();
Symbol 20 MovieClip [car1] Frame 3
stop();
Symbol 20 MovieClip [car1] Frame 4
stop();
Symbol 87 MovieClip Frame 95
stop();
Symbol 103 MovieClip Frame 180
stop();
_root.animationCompleted = true;
Instance of Symbol 108 MovieClip "bar_mc" in Symbol 109 MovieClip Frame 1
onClipEvent (enterFrame) {
_xscale = (_root.percentDone * 4);
}
Symbol 130 Button
on (press) {
gotoAndStop (21);
}
Symbol 137 Button
on (release) {
gotoAndStop (26);
}
Symbol 158 MovieClip Frame 20
stop();
Symbol 163 Button
on (release) {
getURL ("http://www.flasharcade.com", "_blank");
}
Symbol 168 Button
on (release) {
getURL ("http://www.flasharcade.com/flash-games/", "_blank");
}
Symbol 173 Button
on (release) {
gotoAndPlay (65);
}
Symbol 200 Button
on (press) {
gotoAndPlay (2);
}
Symbol 213 Button
on (release, keyPress "<Enter>") {
gotoAndStop (26);
}
Symbol 235 Button
on (release) {
this.reset1();
}
Symbol 244 MovieClip Frame 26
stop();
Symbol 245 MovieClip Frame 1
stop();
Symbol 245 MovieClip Frame 2
btn.useHandCursor = false;
Symbol 245 MovieClip Frame 90
var lNum = ("level" + nextLevel);
_root.gotoAndPlay(lNum);
Symbol 248 MovieClip Frame 26
stop();
Symbol 249 Button
on (release) {
this.callFunc();
}
Symbol 250 MovieClip Frame 1
stop();
Symbol 250 MovieClip Frame 2
btn.useHandCursor = false;
Symbol 250 MovieClip Frame 25
stop();
Symbol 251 Button
on (release) {
this.reset2();
}
Symbol 252 Button
on (release) {
this.reset3();
}
Symbol 253 Button
on (release) {
this.reset4();
}
Symbol 254 Button
on (release) {
this.reset5();
}
Symbol 255 Button
on (release) {
this.reset6();
}
Symbol 256 Button
on (release) {
this.reset7();
}
Symbol 257 Button
on (release) {
this.reset8();
}
Symbol 258 Button
on (release) {
this.reset9();
}
Symbol 259 Button
on (release) {
this.reset10();
}
Symbol 260 MovieClip Frame 1
stop();
Symbol 260 MovieClip Frame 2
btn.useHandCursor = false;
stop();
_root.congrats();
Symbol 266 Button
on (release) {
gotoAndStop (2);
}
Symbol 272 Button
on (release) {
gotoAndPlay (2);
}
Symbol 276 MovieClip Frame 1
stop();
Symbol 290 Button
on (release) {
if ((this.scoreName.text != "") && (_root.scoreSubmit == false)) {
trans_btn._visible = false;
var lv = new LoadVars();
var lvAnswer = new LoadVars();
this.message_text.text = "Saving your score...";
lv.scoreName = this.scoreName.text;
lv.scoreText = this.scoreText2.text;
lv.gameId = "ace002";
lv.gameName = "Parking Mania";
lv.sendAndLoad("http://www.flasharcade.com/setscores.php", lvAnswer, "POST");
lvAnswer.onLoad = function (success) {
if (lvAnswer.status1 == "success") {
trans_btn._visible = true;
message_text.text = "Your score is saved successfully.";
gotoAndPlay (65);
} else {
trans_btn._visible = true;
trans_btn.useHandCursor = false;
message_text.text = "Your score could not be saved.";
}
};
}
trans_btn._visible = true;
trans_btn.useHandCursor = false;
_root.scoreSubmit = true;
}
Symbol 334 MovieClip Frame 12
var lv = new LoadVars();
var lvAnswer = new LoadVars();
lvAnswer.name0 = "";
lvAnswer.name1 = "";
lvAnswer.name2 = "";
lvAnswer.name3 = "";
lvAnswer.name4 = "";
lvAnswer.name5 = "";
lvAnswer.name6 = "";
lvAnswer.name7 = "";
lvAnswer.name8 = "";
lvAnswer.name9 = "";
lvAnswer.score0 = "";
lvAnswer.score1 = "";
lvAnswer.score2 = "";
lvAnswer.score3 = "";
lvAnswer.score4 = "";
lvAnswer.score5 = "";
lvAnswer.score6 = "";
lvAnswer.score7 = "";
lvAnswer.score8 = "";
lvAnswer.score9 = "";
lvAnswer.date0 = "";
lvAnswer.date1 = "";
lvAnswer.date2 = "";
lvAnswer.date3 = "";
lvAnswer.date4 = "";
lvAnswer.date5 = "";
lvAnswer.date6 = "";
lvAnswer.date7 = "";
lvAnswer.date8 = "";
lvAnswer.date9 = "";
this.get_message_text.text = "";
lv.gameId = "ace002";
lv.sendAndLoad("http://www.flasharcade.com/getscores.php", lvAnswer, "POST");
lvAnswer.onLoad = function (success) {
if (lvAnswer.status1 == "success") {
_root.score_mc.name0.text = this.name0;
_root.score_mc.name1.text = this.name1;
_root.score_mc.name2.text = this.name2;
_root.score_mc.name3.text = this.name3;
_root.score_mc.name4.text = this.name4;
_root.score_mc.name5.text = this.name5;
_root.score_mc.name6.text = this.name6;
_root.score_mc.name7.text = this.name7;
_root.score_mc.name8.text = this.name8;
_root.score_mc.name9.text = this.name9;
_root.score_mc.score0.text = this.score0;
_root.score_mc.score1.text = this.score1;
_root.score_mc.score2.text = this.score2;
_root.score_mc.score3.text = this.score3;
_root.score_mc.score4.text = this.score4;
_root.score_mc.score5.text = this.score5;
_root.score_mc.score6.text = this.score6;
_root.score_mc.score7.text = this.score7;
_root.score_mc.score8.text = this.score8;
_root.score_mc.score9.text = this.score9;
_root.score_mc.date0.text = this.date0;
_root.score_mc.date1.text = this.date1;
_root.score_mc.date2.text = this.date2;
_root.score_mc.date3.text = this.date3;
_root.score_mc.date4.text = this.date4;
_root.score_mc.date5.text = this.date5;
_root.score_mc.date6.text = this.date6;
_root.score_mc.date7.text = this.date7;
_root.score_mc.date8.text = this.date8;
_root.score_mc.date9.text = this.date9;
}
};
stop();