Frame 1
_quality = "high";
fscommand ("fullscreen", "true");
fscommand ("allowscale", "false");
fscommand ("showmenu", "false");
tileSize = 30;
worldPos = [30, 220];
worlds = ["world1.swf"];
worldloaded = -1;
activelevel = -1;
levelcnt = 1;
loadpercent = 0;
finalscore = 0;
finalscore2 = "0%";
submitflag = false;
Frame 3
loadpercent = int((getBytesLoaded() / getBytesTotal()) * 100);
bar._width = (122 * loadpercent) / 100;
thenumber._x = 200 + ((122 * loadpercent) / 100);
thenumber.percent = loadpercent + "%";
if (loadpercent == 100) {
gotoAndPlay (4);
} else {
gotoAndPlay (2);
}
Frame 4
worlds_container.levels = 5;
worlds_container.PercentToComplete1 = 60;
worlds_container.PercentToComplete2 = 70;
worlds_container.PercentToComplete3 = 75;
worlds_container.PercentToComplete4 = 80;
worlds_container.PercentToComplete5 = 80;
worlds_container.map1 = [[21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 10], [21, 1, 2, 2, 2, 2, 2, 15, 2, 2, 14, 21], [21, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 21], [21, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 21], [21, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 21], [21, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 21], [21, 1, 2, 2, 2, 16, 2, 2, 2, 2, 13, 21], [21, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 21], [21, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 21], [21, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 21], [21, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 19], [21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21]];
worlds_container.map2 = [[21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 10], [21, 1, 18, 14, 2, 2, 2, 15, 2, 2, 14, 21], [21, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 21], [21, 1, 2, 2, 2, 2, 13, 2, 2, 2, 2, 21], [21, 1, 2, 2, 2, 2, 2, 2, 16, 2, 2, 21], [21, 1, 14, 2, 2, 2, 2, 2, 12, 2, 2, 21], [21, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 21], [21, 1, 2, 2, 13, 2, 2, 2, 2, 2, 2, 21], [21, 1, 2, 2, 13, 2, 2, 2, 2, 2, 2, 21], [21, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 21], [21, 1, 1, 1, 1, 1, 17, 1, 1, 1, 1, 21], [21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21]];
worlds_container.map3 = [[21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 10], [21, 1, 2, 2, 2, 15, 2, 2, 2, 2, 20, 21], [21, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 21], [21, 1, 14, 2, 14, 2, 2, 2, 12, 2, 2, 21], [21, 1, 2, 2, 2, 2, 2, 2, 13, 2, 2, 21], [21, 17, 18, 2, 2, 2, 2, 2, 2, 2, 2, 21], [21, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 21], [21, 1, 2, 2, 13, 16, 2, 12, 16, 2, 2, 21], [21, 1, 2, 2, 2, 2, 2, 2, 2, 2, 13, 21], [21, 1, 2, 2, 2, 16, 2, 2, 2, 2, 14, 21], [21, 17, 1, 1, 1, 1, 1, 1, 1, 1, 1, 21], [21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21]];
worlds_container.map4 = [[21, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 10], [21, 18, 14, 2, 15, 15, 2, 2, 2, 2, 2, 21], [21, 1, 2, 2, 2, 2, 2, 13, 12, 2, 2, 21], [21, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 21], [21, 17, 2, 2, 15, 15, 2, 15, 13, 2, 2, 21], [21, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 21], [21, 1, 2, 2, 2, 2, 2, 2, 2, 2, 14, 21], [21, 1, 2, 2, 13, 16, 2, 12, 16, 2, 2, 21], [21, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 21], [21, 1, 2, 2, 2, 16, 2, 2, 2, 2, 2, 21], [21, 1, 1, 1, 1, 17, 1, 1, 1, 19, 2, 2], [21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21]];
worlds_container.map5 = [[21, 18, 21, 21, 21, 21, 21, 21, 21, 21, 21, 10], [21, 17, 2, 2, 2, 2, 2, 2, 14, 14, 14, 21], [21, 1, 2, 2, 2, 2, 2, 2, 2, 2, 14, 21], [21, 1, 2, 15, 16, 2, 2, 2, 2, 2, 20, 21], [21, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 21], [21, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 21], [21, 1, 2, 2, 2, 12, 13, 2, 12, 15, 16, 21], [21, 1, 2, 2, 2, 15, 12, 2, 12, 15, 16, 21], [21, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 21], [21, 17, 2, 2, 2, 2, 2, 2, 2, 2, 2, 21], [21, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 21], [21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21]];
Frame 5
function Sound2(mc) {
this.sound = new Sound(mc);
this.secs = 0;
this.startTimer = null;
this.pauseTimer = null;
this.timer = 0;
this.paused = false;
}
function Sound2_stop(id) {
this.startTimer = null;
this.sound.stop(id);
}
function Sound2_start(offset, loops) {
this.offset = offset;
this.startTimer = getTimer() - (offset * 1000);
this.sound.start(offset, loops);
this.duration = (this.secs * (loops + 1)) * 1000;
this.loops = loops;
}
function Sound2_pause() {
var currTime = getTimer();
if (!this.paused) {
this.timer = currTime - this.startTimer;
this.pauseTimer = currTime;
this.paused = true;
this.sound.stop(this.soundID);
} else {
this.paused = false;
var tempStart = (this.startTimer + (currTime - this.pauseTimer));
this.start(this.timer / 1000);
this.startTimer = tempStart;
}
}
function Sound2_attachSound(soundID, secs) {
this.soundId = soundID;
this.secs = secs;
this.sound.attachSound(soundID);
}
function Sound2_isBusy() {
if (this.startTimer != null) {
if ((getTimer() - this.startTimer) < this.duration) {
return(true);
}
return(false);
}
return(false);
}
function Sound2_timeElapsed() {
var currTime = getTimer();
if ((this.startTimer != null) && ((currTime - this.startTimer) < this.duration)) {
return((currTime - this.startTimer) / 1000);
}
return(-1);
}
function Sound2_timeRemaining() {
var currTime = getTimer();
if ((this.startTimer != null) && ((currTime - this.startTimer) < this.duration)) {
return((this.duration - (currTime - this.startTimer)) / 1000);
}
return(-1);
}
Sound2.prototype.stop = Sound2_stop;
Sound2.prototype.start = Sound2_start;
Sound2.prototype.pause = Sound2_pause;
Sound2.prototype.attachSound = Sound2_attachSound;
Sound2.prototype.isBusy = Sound2_isBusy;
Sound2.prototype.timeElapsed = Sound2_timeElapsed;
Sound2.prototype.timeRemaining = Sound2_timeRemaining;
Sound2.prototype.getPan = function () {
return(this.sound.getPan());
};
Sound2.prototype.getTransform = function () {
return(this.sound.getTransform());
};
Sound2.prototype.getVolume = function () {
return(this.sound.getVolume());
};
Sound2.prototype.setPan = function (pan) {
return(this.sound.setPan(pan));
};
Sound2.prototype.setTransform = function (obj) {
return(this.sound.setTransform(obj));
};
Sound2.prototype.setVolume = function (volume) {
return(this.sound.setVolume(volume));
};
Frame 6
truck_snd = new Sound2(world_container);
truck_snd.attachSound("truck_base");
truck_push = new Sound2(empty);
truck_push.attachSound("truck_push", 0.2);
truck_move = new Sound2(empty);
truck_move.attachSound("move");
truck_pushno = new Sound2(empty);
truck_pushno.attachSound("push_nomove");
fin_level = new Sound2(empty);
fin_level.attachSound("finish_level");
Frame 7
function makeWorld() {
world = new world_container.world.initWorld(myMap, tileSize, worldPos, world_container.world, [12, 12], PercentToComplete);
}
function buildMap() {
world.buildMap();
}
function makeChar() {
world.makeChar([6, 1], -200, true, "character", 1);
}
function newLevel() {
gotoAndPlay (21);
}
function buildLevel() {
tempmap = eval ("worlds_container.map" + activelevel);
PercentToComplete = eval ("worlds_container.PercentToComplete" + activelevel);
myMap = new Array();
i = 0;
while (i < tempmap.length) {
temp = new Array();
j = 0;
while (j < tempmap[0].length) {
temp.push(tempmap[i][j]);
j++;
}
myMap.push(temp);
i++;
}
tempmap = 0;
makeWorld();
interface.gotoAndStop("getready");
interface.text.percent.percent = PercentToComplete;
interface.text.gotoAndPlay(2);
world.buildMap();
}
function resetLevel() {
world.killCharacter();
world = 0;
interface.gotoAndStop(1);
interface.text.gotoAndStop(1);
stopAllSounds();
gotoAndPlay (19);
}
function resetAll() {
world.killCharacter();
world = 0;
interface.gotoAndStop(1);
stopAllSounds();
gotoAndPlay (4);
}
function getWorld() {
worldloaded = arguments[0];
activelevel = -1;
}
function initWorld() {
activelevel = 1;
if (arguments[0] != 0) {
resetLevel();
}
}
function quitGame() {
if (0 < finalscore) {
world.killCharacter();
gotoAndPlay (33);
} else {
resetAll();
}
}
function nextLevel() {
if (activelevel < worlds_container.levels) {
activelevel++;
levelcnt++;
resetLevel();
} else if (worldloaded < (worlds.length - 1)) {
getWorld(worldloaded + 1);
gotoAndPlay (10);
} else {
world.killCharacter();
gotoAndPlay (33);
}
if (activelevel == 1) {
playername = "";
finalscore = 0;
finalscore2 = "0%";
} else {
finalscore = finalscore + int(arguments[0].substr(0, 2));
finalscore2 = finalscore + "%";
}
}
Frame 10
if ((worldloaded = -1)) {
getWorld(0);
} else {
gotoAndPlay (15);
}
Frame 11
loadpercent2 = int((worlds_container.getBytesLoaded() / worlds_container.getBytesTotal()) * 100);
if (worlds_container.getBytesLoaded() == worlds_container.getBytesTotal()) {
initWorld(worldloaded);
} else {
gotoAndPlay (10);
}
Frame 15
stop();
stop();
Frame 22
buildLevel();
Frame 27
if (0 < world.TilestoBuild.length) {
gotoAndPlay (26);
}
Frame 28
makeChar();
Frame 29
stop();
Frame 33
stopAllSounds();
Frame 37
stop();
Frame 38
worlds_container.hiscoreload = true;
timeout = getTimer() + 1000;
if (submitflag) {
loadVariables ((("http://www.ae-pro.com/extra/snowstorm/highscore.php?finalscore=" + finalscore) + "&playername=") + playername, "_root.worlds_container");
} else {
loadVariables ("http://www.ae-pro.com/extra/snowstorm/highscore.php?seed=" + random(20), "_root.worlds_container");
}
Frame 40
if (timeout < getTimer()) {
message.gotoAndStop("errorframe");
}
if ((timeout + 1000) < getTimer()) {
worldloaded = -1;
activelevel = -1;
levelcnt = 1;
finalscore = 0;
finalscore2 = "0%";
playername = "";
gotoAndPlay (10);
} else if (worlds_container.hiscoreload) {
gotoAndPlay (39);
} else {
gotoAndStop (42);
}
Frame 42
if ((finalscore == worlds_container.score1) && (playername == worlds_container.name1)) {
hilite1.gotoAndStop(2);
} else if ((finalscore == worlds_container.score2) && (playername == worlds_container.name2)) {
hilite2.gotoAndStop(2);
} else if ((finalscore == worlds_container.score3) && (playername == worlds_container.name3)) {
hilite3.gotoAndStop(2);
} else if ((finalscore == worlds_container.score4) && (playername == worlds_container.name4)) {
hilite4.gotoAndStop(2);
} else if ((finalscore == worlds_container.score5) && (playername == worlds_container.name5)) {
hilite5.gotoAndStop(2);
}
stop();
Frame 48
stop();
Symbol 19 MovieClip Frame 1
stop();
Symbol 19 MovieClip Frame 2
stop();
Symbol 32 MovieClip Frame 1
stop();
Symbol 33 MovieClip Frame 1
stop();
Symbol 33 MovieClip Frame 2
stop();
Symbol 33 MovieClip Frame 3
stop();
Symbol 33 MovieClip Frame 4
stop();
Symbol 33 MovieClip Frame 5
stop();
Symbol 33 MovieClip Frame 6
stop();
Symbol 35 MovieClip Frame 1
stop();
Symbol 35 MovieClip Frame 2
play();
Symbol 35 MovieClip Frame 9
stop();
Symbol 56 MovieClip Frame 1
stop();
Symbol 56 MovieClip Frame 2
play();
Symbol 56 MovieClip Frame 18
stop();
Symbol 74 MovieClip Frame 1
stop();
Symbol 74 MovieClip Frame 2
play();
Symbol 74 MovieClip Frame 5
stop();
Symbol 74 MovieClip Frame 6
play();
Symbol 74 MovieClip Frame 9
stop();
Symbol 74 MovieClip Frame 10
play();
Symbol 74 MovieClip Frame 13
stop();
Symbol 74 MovieClip Frame 14
play();
Symbol 74 MovieClip Frame 17
stop();
Symbol 78 MovieClip Frame 1
stop();
Symbol 78 MovieClip Frame 2
play();
Symbol 78 MovieClip Frame 5
stop();
Symbol 78 MovieClip Frame 6
play();
Symbol 78 MovieClip Frame 9
stop();
Symbol 78 MovieClip Frame 10
play();
Symbol 78 MovieClip Frame 13
stop();
Symbol 78 MovieClip Frame 14
play();
Symbol 78 MovieClip Frame 17
stop();
Symbol 82 MovieClip Frame 1
stop();
Symbol 82 MovieClip Frame 2
play();
Symbol 82 MovieClip Frame 5
stop();
Symbol 82 MovieClip Frame 6
play();
Symbol 82 MovieClip Frame 9
stop();
Symbol 82 MovieClip Frame 10
play();
Symbol 82 MovieClip Frame 13
stop();
Symbol 82 MovieClip Frame 14
play();
Symbol 82 MovieClip Frame 17
stop();
Symbol 86 MovieClip Frame 1
stop();
Symbol 86 MovieClip Frame 2
play();
Symbol 86 MovieClip Frame 5
stop();
Symbol 86 MovieClip Frame 6
play();
Symbol 86 MovieClip Frame 9
stop();
Symbol 86 MovieClip Frame 10
play();
Symbol 86 MovieClip Frame 13
stop();
Symbol 86 MovieClip Frame 14
play();
Symbol 86 MovieClip Frame 17
stop();
Symbol 90 MovieClip Frame 1
stop();
Symbol 90 MovieClip Frame 2
play();
Symbol 90 MovieClip Frame 5
stop();
Symbol 90 MovieClip Frame 6
play();
Symbol 90 MovieClip Frame 9
stop();
Symbol 90 MovieClip Frame 10
play();
Symbol 90 MovieClip Frame 13
stop();
Symbol 90 MovieClip Frame 14
play();
Symbol 90 MovieClip Frame 17
stop();
Symbol 93 MovieClip Frame 1
stop();
Symbol 96 MovieClip Frame 1
stop();
Symbol 99 MovieClip Frame 1
stop();
Symbol 102 MovieClip Frame 1
stop();
Symbol 105 MovieClip Frame 1
stop();
Symbol 108 MovieClip Frame 1
stop();
Symbol 111 MovieClip Frame 1
stop();
Symbol 114 MovieClip Frame 1
stop();
Symbol 116 MovieClip Frame 1
stop();
Symbol 116 MovieClip Frame 2
stop();
Symbol 116 MovieClip Frame 3
stop();
Symbol 116 MovieClip Frame 4
stop();
Symbol 116 MovieClip Frame 5
stop();
Symbol 116 MovieClip Frame 6
stop();
Symbol 116 MovieClip Frame 10
stop();
Symbol 116 MovieClip Frame 11
stop();
Symbol 116 MovieClip Frame 12
stop();
Symbol 116 MovieClip Frame 13
stop();
Symbol 116 MovieClip Frame 14
stop();
Symbol 116 MovieClip Frame 15
stop();
Symbol 116 MovieClip Frame 16
stop();
Symbol 116 MovieClip Frame 17
stop();
Symbol 116 MovieClip Frame 18
stop();
Symbol 116 MovieClip Frame 19
stop();
Symbol 116 MovieClip Frame 20
stop();
Symbol 116 MovieClip Frame 21
stop();
Symbol 163 MovieClip Frame 1
stop();
Symbol 163 MovieClip Frame 2
_root.truck_snd.start(0, 10000);
snowflag = false;
Symbol 163 MovieClip Frame 5
smokeflag = true;
if (snowflag) {
snow.gotoAndPlay(2);
}
Instance of Symbol 47 MovieClip in Symbol 163 MovieClip Frame 5
onClipEvent (keyDown) {
var dir;
if (Key.isDown(38)) {
dir = "up";
} else if (Key.isDown(40)) {
dir = "down";
} else if (Key.isDown(37)) {
dir = "left";
} else if (Key.isDown(39)) {
dir = "right";
} else {
dir = null;
}
if (dir != null) {
if (dir != "up") {
_root.world.actorList[0].look2(dir);
} else {
_root.world.actorList[0].walk2();
}
updateAfterEvent();
}
dir == null;
}
Symbol 163 MovieClip Frame 6
if ((smokeflag = true)) {
smoke1.gotoAndPlay(2);
smoke2.gotoAndPlay(2);
}
Symbol 163 MovieClip Frame 9
smokeflag = false;
snowflag = false;
stop();
Symbol 163 MovieClip Frame 10
tile2 = [tile[0], tile[1] - 1];
_root.world.zSort(Name, tile2, listPos);
dummyclip1.gotoAndStop(_root.world.myMap[tile[0] + 1][tile[1] - 1]);
dummyclip2.gotoAndStop(_root.world.myMap[tile[0] + 1][tile[1]]);
if (snowflag) {
snow.gotoAndPlay(2);
}
smokeflag = true;
play();
Symbol 163 MovieClip Frame 12
if ((smokeflag = true)) {
smoke1.gotoAndPlay(2);
smoke2.gotoAndPlay(2);
}
Symbol 163 MovieClip Frame 14
_root.world.zSort(Name, tile, listPos);
Symbol 163 MovieClip Frame 15
smokeflag = false;
stop();
Symbol 163 MovieClip Frame 16
smokeflag = true;
if (snowflag) {
snow.gotoAndPlay(2);
}
Symbol 163 MovieClip Frame 18
if ((smokeflag = true)) {
smoke1.gotoAndPlay(2);
smoke2.gotoAndPlay(2);
}
Symbol 163 MovieClip Frame 21
smokeflag = false;
stop();
Symbol 163 MovieClip Frame 22
dummyclip1.gotoAndStop(_root.world.myMap[tile[0] + 1][tile[1] + 1]);
dummyclip2.gotoAndStop(_root.world.myMap[tile[0] + 1][tile[1]]);
if (snowflag) {
snow.gotoAndPlay(2);
}
smokeflag = true;
play();
Symbol 163 MovieClip Frame 24
if ((smokeflag = true)) {
smoke1.gotoAndPlay(2);
smoke2.gotoAndPlay(2);
}
Symbol 163 MovieClip Frame 27
smokeflag = false;
stop();
Symbol 163 MovieClip Frame 35
gotoAndStop (9);
Symbol 163 MovieClip Frame 36
dummyclip1.gotoAndStop(_root.world.myMap[tile[0] + 1][tile[1] + 1]);
dummyclip2.gotoAndStop(_root.world.myMap[tile[0] + 1][tile[1]]);
play();
Symbol 163 MovieClip Frame 41
gotoAndStop (15);
Symbol 163 MovieClip Frame 46
gotoAndStop (21);
Symbol 163 MovieClip Frame 47
tile2 = [tile[0], tile[1] - 1];
_root.world.zSort(Name, tile2, listPos);
dummyclip1.gotoAndStop(_root.world.myMap[tile[0] + 1][tile[1] - 1]);
dummyclip2.gotoAndStop(_root.world.myMap[tile[0] + 1][tile[1]]);
Symbol 163 MovieClip Frame 52
_root.world.zSort(Name, tile, listPos);
gotoAndStop (27);
Symbol 163 MovieClip Frame 59
gotoAndStop (15);
Symbol 163 MovieClip Frame 63
gotoAndStop (21);
Symbol 163 MovieClip Frame 67
gotoAndStop (27);
Symbol 163 MovieClip Frame 71
gotoAndStop (9);
Symbol 163 MovieClip Frame 79
gotoAndStop (27);
Symbol 163 MovieClip Frame 83
gotoAndStop (21);
Symbol 163 MovieClip Frame 87
gotoAndStop (15);
Symbol 163 MovieClip Frame 91
gotoAndStop (9);
Symbol 164 MovieClip Frame 2
function initWorld() {
this.myMap = arguments[0];
this.tileSize = arguments[1];
this.sinY = (this.cosY = 0.707);
this.cosX = 0.866;
_parent._x = arguments[2][0];
_parent._y = arguments[2][1];
this.MyX = 0;
this.MyZ = 0;
this.Me = arguments[3];
this.toDo = new Array();
this.toDoFlag = false;
this.toDoDelete = new Array();
this.pulse = 200;
this.visX = arguments[4][0];
this.visY = arguments[4][1];
this.visXstart = 0;
this.visYstart = 0;
this.scrSpeed = this.tileW;
this.actorList = new Array();
this.visibleActors = new Array();
this.updateAllFlag = false;
this.TilestoBuild = new Array();
this.totalpercent = 0;
this.currentpercent = 0;
_root.interface.fps = "0%";
this.percentcleared = 100;
this.percentcomplete = arguments[5];
this.soundUpdateflag = false;
}
initWorld.prototype.makeChar = function () {
this.actorList.push(new this.Me.initChar(arguments[3], arguments[0], arguments[1], this, true, arguments[0], true, false, arguments[4]));
this.showActor(this.actorList[this.actorList.length - 1]);
if (arguments[2]) {
this.addGravity(this.actorList[this.actorList.length - 1]);
this.actorList[this.actorList.length - 1].gravityFlag = true;
}
};
initWorld.prototype.checkActors = function () {
i = 0;
while (i < this.visibleActors.length) {
if (this.visibleActors[i].mainChar) {
} else {
this.visibleActors[i].drawMe();
}
i++;
}
};
initWorld.prototype.pushSnow = function () {
direction = arguments[2];
tempx = 0;
tempy = 0;
if (direction == 0) {
tempx = -1;
this.TilestoUpdateflag = 4;
this.TilestoUpdateframe = "up";
} else if (direction == 1) {
tempy = 1;
this.TilestoUpdateflag = 7;
this.TilestoUpdateframe = "right";
} else if (direction == 2) {
tempx = 1;
this.TilestoUpdateflag = 1;
this.TilestoUpdateframe = "down";
} else if (direction == 3) {
tempy = -1;
this.TilestoUpdateflag = 8;
this.TilestoUpdateframe = "left";
}
tilex = arguments[0][0];
tiley = arguments[0][1];
this.myMap[tilex + tempx][tiley + tempy] = arguments[1];
this.TilestoUpdate = new Array([tilex, tiley], [tilex + 1, tiley], [tilex + 1, tiley - 1], [tilex + 1, tiley + 1], [tilex - 1, tiley], [tilex - 1, tiley + 1], [tilex - 1, tiley - 1], [tilex, tiley + 1], [tilex, tiley - 1]);
if (arguments[3] != 1) {
this.currentpercent++;
this.showPercent();
}
};
initWorld.prototype.zSort = function () {
temp1 = (((this.zMap - (((this.mapW * arguments[1][1]) + 1) * this.mapW)) + 20) + (arguments[1][0] * 5)) + 1;
this.Me[arguments[0]].swapDepths(temp1 + 1);
};
initWorld.prototype.Collision = function () {
temp = 0;
temp = this.myMap[arguments[0][0]][arguments[0][1]];
temp2 = 0;
if (arguments[1] == 0) {
temp2 = this.myMap[arguments[0][0] - 1][arguments[0][1]];
} else if (arguments[1] == 1) {
temp2 = this.myMap[arguments[0][0]][arguments[0][1] + 1];
} else if (arguments[1] == 2) {
temp2 = this.myMap[arguments[0][0] + 1][arguments[0][1]];
} else if (arguments[1] == 3) {
temp2 = this.myMap[arguments[0][0]][arguments[0][1] - 1];
}
return([temp, temp2]);
};
initWorld.prototype.checkVisibility = function () {
temp = true;
if ((arguments[0][0] < this.visXstart) || ((this.visXstart + this.visX) < arguments[0][0])) {
temp = false;
}
if ((arguments[0][1] < this.visYstart) || ((this.visYstart + this.visY) < arguments[0][1])) {
temp = false;
}
return(temp);
};
initWorld.prototype.registerChar = function () {
this.myMap[arguments[1][0]][arguments[1][1]] = arguments[2];
temp = this.myMap[arguments[0][0]][arguments[0][1]];
this.myMap[arguments[0][0]][arguments[0][1]] = -1;
return(temp);
};
initWorld.prototype.makeActor = function () {
this.actorList.push(new this.Me.initChar("actor_" + this.actorList.length, arguments[0], 0, this, false, arguments[0], false, arguments[1]));
if ((this.actorList[this.actorList.length - 1].tile[0] < this.visX) && (this.actorList[this.actorList.length - 1].tile[1] < this.visY)) {
this.showActor(this.actorList[this.actorList.length - 1]);
}
this.addPatrol(this.actorList[this.actorList.length - 1]);
};
initWorld.prototype.showActor = function () {
tempNo = int(arguments[0].Name.substr(arguments[0].Name.length - 1, 1));
tempcX = arguments[0].tile[0] * this.tileSize;
tempcZ = arguments[0].tile[1] * this.tileSize;
if (this.myMap[arguments[0].tile[0]][arguments[0].tile[1]] == 1) {
if (arguments[0].mainChar) {
this.Me.character_parent.duplicateMovieClip(arguments[0].Name, this.zDepth(arguments[0].tile[0], arguments[0].tile[1]) + 1);
} else {
this.Me.attachMovie("actor_clip", arguments[0].Name, this.zDepth(arguments[0].tile[0], arguments[0].tile[1]) + 1);
}
arguments[0].Me = this.Me[arguments[0].Name];
arguments[0].myX = tempcX;
arguments[0].myZ = tempcZ;
_root.truck_snd.start(0, 10000);
arguments[0].snowflag = false;
arguments[0].listPos = this.visibleActors.length;
arguments[0].drawMe(0, 0, "g");
arguments[0].tileBackup = this.myMap[arguments[0].tile[0]][arguments[0].tile[1]];
this.myMap[arguments[0].tile[0]][arguments[0].tile[1]] = -1;
this.visibleActors.push(arguments[0]);
}
};
initWorld.prototype.killCharacter = function () {
this.Me.character.removeMovieClip();
this.i = this.visXstart;
while (this.i < (this.visXstart + this.visX)) {
this.j = this.visYstart;
while (this.j < (this.visYstart + this.visY)) {
if (0 < this.myMap[this.i][this.j]) {
tempObj = this.Me[(("tile" + this.i) + "_") + this.j];
tempObj.removeMovieClip();
}
this.tileCnt++;
this.j++;
}
this.i++;
}
this.Me.bg_img.gotoAndStop(1);
this.Me.shadow_img.gotoAndStop(1);
this.Me.background._visible = false;
};
initWorld.prototype.addGravity = function () {
this.toDo.push(["gravity", arguments]);
};
initWorld.prototype.addPatrol = function () {
this.toDo.push(["patrol", arguments]);
};
initWorld.prototype.newUpdate = function () {
this.toDo.push(arguments);
};
initWorld.prototype.newSound = function () {
this.soundUpdateflag = true;
this.soundUpatefirst = 4;
if (arguments[0] == "push") {
_root.truck_push.start(0, 0);
} else if (arguments[0] == "move") {
_root.truck_move.start(0, 0);
} else if (arguments[0] == "pushno") {
_root.truck_pushno.start(0, 0);
}
_root.truck_snd.setVolume(30);
};
initWorld.prototype.updater = function () {
if (this.soundUpdateflag) {
if (0 < this.soundUpatefirst) {
this.soundUpatefirst--;
_root.truck_snd.setVolume(_root.truck_snd.getVolume() + 5);
} else {
_root.truck_snd.setVolume(100);
this.soundUpdateflag = false;
}
}
if (0 < this.toDo.length) {
a = 0;
while (a < this.toDo.length) {
if (this.toDo[a][0] == "gravity") {
this.toDo[a][1][0].gravity();
} else if ((this.toDo[a][0] == "patrol") && (this.updateAllFlag == false)) {
this.toDo[a][1][0].patrol();
}
a++;
}
this.timer = getTimer();
this.updateAllFlag = false;
if (this.toDoFlag) {
this.updaterDeleteFinished();
}
}
if (0 < this.TilestoUpdate.length) {
a = 0;
while (a < this.TilestoUpdate.length) {
tempObj = this.Me[(("tile" + this.TilestoUpdate[a][0]) + "_") + this.TilestoUpdate[a][1]];
tempObj._visible = true;
if (this.myMap[this.TilestoUpdate[a][0]][this.TilestoUpdate[a][1]] == -1) {
tempObj.gotoAndStop(1);
} else {
tempObj.gotoAndStop(this.myMap[this.TilestoUpdate[a][0]][this.TilestoUpdate[a][1]]);
if (this.TilestoUpdateflag == 0) {
tempObj.tile.gotoAndPlay(this.TilestoUpdateframe);
}
}
this.TilestoUpdateflag--;
a++;
}
this.TilestoUpdate = new Array();
}
if (0 < this.TilestoBuild.length) {
tempObj = this.Me[(("tile" + this.TilestoBuild[0][0]) + "_") + this.TilestoBuild[0][1]];
tempObj._visible = true;
temp = this.TilestoBuild.shift();
}
if (this.buildbgflag) {
this.buildBg();
this.buildbgflag = false;
}
};
initWorld.prototype.stopSounds = function () {
_root.truck_snd.stop();
};
initWorld.prototype.showPercent = function () {
if (this.currentpercent != 0) {
this.percentcleared = Math.floor((this.currentpercent / this.totalpercent) * 100);
}
_root.interface.fps = this.percentcleared + "%";
if ((this.percentcleared >= this.percentcomplete) && (this.currentpercent != 0)) {
if (_root.interface._currentframe < 2) {
_root.interface.gotoAndPlay("finish");
}
}
};
initWorld.prototype.updaterDeleteFinished = function () {
tempCnt = 0;
a = 0;
while (a < this.toDoDelete.length) {
this.toDo.splice(this.toDoDelete[a - tempCnt], 1);
tempCnt++;
a++;
}
this.toDoFlag = false;
this.toDoDelete = new Array();
};
initWorld.prototype.projectX = function () {
return((arguments[1] * this.sinY) + (arguments[0] * this.cosY));
};
initWorld.prototype.projectY = function () {
return((arguments[2] * this.cosX) - (((arguments[1] * this.cosY) - (arguments[0] * this.sinY)) / 2));
};
initWorld.prototype.zDepth = function () {
temp = ((this.zMap - (((this.mapW * arguments[1]) + 1) * this.mapW)) + 20) + (arguments[0] * 5);
return(temp);
};
initWorld.prototype.buildBg = function () {
tempx = this.projectX(0, this.tileSize * ((this.visXstart + this.visX) - 1));
tempy = this.projectY(0, this.tileSize * ((this.visXstart + this.visX) - 1), 0);
bg_img._x = tempx;
bg_img._y = tempy;
bg_img.gotoAndStop(_root.activelevel + 1);
duplicateMovieClip (shadow_parent, "shadow_img", this.zMap + 1);
shadow_img._x = tempx;
shadow_img._y = tempy;
shadow_img.gotoAndStop(2);
};
initWorld.prototype.buildMap = function () {
this.zMap = 10000;
this.tileCnt = 1;
this.cX = 0;
this.cZ = 0;
this.buildbgflag = true;
this.mapW = this.myMap[0].length;
this.mapH = this.myMap.length;
this.i = this.visXstart;
while (this.i < (this.visXstart + this.visX)) {
this.j = this.visYstart;
while (this.j < (this.visYstart + this.visY)) {
if (0 < this.myMap[this.i][this.j]) {
this.Me.tile_parent.duplicateMovieClip((("tile" + this.i) + "_") + this.j, this.zDepth(this.i, this.j));
tempObj = this.Me[(("tile" + this.i) + "_") + this.j];
tempObj._x = this.projectX(this.cX, this.cZ);
tempObj._y = this.projectY(this.cX, this.cZ, 0);
tempObj.zDepth = this.zDepth(this.i, this.j);
tempObj.type = this.myMap[this.i][this.j];
tempObj._visible = false;
tempObj.gotoAndStop(this.myMap[this.i][this.j]);
this.TilestoBuild.push([this.i, this.j]);
}
this.cZ = this.cZ + this.tileSize;
this.tileCnt++;
if ((1 < this.myMap[this.i][this.j]) && (this.myMap[this.i][this.j] < 7)) {
percentflag = true;
if ((this.i == 1) || (this.i == ((this.visXstart + this.visX) - 2))) {
percentflag = false;
}
if ((this.j == ((this.visYstart + this.visY) - 2)) || (this.j == 1)) {
percentflag = false;
}
if (percentflag) {
this.totalpercent++;
}
}
this.j++;
}
this.cZ = 0;
this.cX = this.cX + this.tileSize;
this.i++;
}
this.cZ = this.j * this.tileSize;
this.cX = this.i * this.tileSize;
this.Me.background._width = this.projectX(this.cX, this.cZ);
this.Me.background._yscale = this.Me.background._xscale;
this.Me.background._visible = true;
this.Me.background._alpha = 100;
this.Me.background._x = this.projectX(this.visXstart, this.visYstart - this.tileSize);
this.Me.background._y = this.projectY(this.visXstart, this.visYstart - this.tileSize, 0);
};
initWorld.prototype.positionBg = function () {
this.Me.background._x = this.projectX(this.visXstart * this.tileSize, (this.visYstart * this.tileSize) - this.tileSize);
this.Me.background._y = this.projectY(this.visXstart * this.tileSize, (this.visYstart * this.tileSize) - this.tileSize, 0);
};
Symbol 164 MovieClip Frame 3
function initChar() {
this.Name = arguments[0];
this.myY = arguments[2];
this.myWorld = arguments[3];
this.myX = arguments[1][0] * this.myWorld.tileSize;
this.myZ = arguments[1][1] * this.myWorld.tileSize;
this.FmyX = this.myX;
this.FmyZ = this.myZ;
this.scrollFlag = arguments[4];
this.tile = arguments[5];
this.mainChar = arguments[6];
this.patrolMode = arguments[7];
this.lastPatrol = getTimer();
this.lastStep = 0;
this.directions = ["up", "right", "down", "left"];
this.direction = arguments[8];
this.Me = null;
this.listPos = -1;
this.whichTile();
this.tilePos = this.tile;
}
initChar.prototype.walk2 = function () {
this.walk(this.directions[this.direction]);
};
initChar.prototype.walk = function () {
if (this.myY == 0) {
if (arguments[0] == "up") {
if (this.direction == 0) {
this.FmyX = this.myX - this.myWorld.tileSize;
} else {
this.look(0);
}
} else if (arguments[0] == "down") {
if (this.direction == 2) {
this.FmyX = this.myX + this.myWorld.tileSize;
} else {
this.look(2);
}
} else if (arguments[0] == "left") {
if (this.direction == 3) {
this.FmyZ = this.myZ - this.myWorld.tileSize;
} else {
this.look(3);
}
} else if (arguments[0] == "right") {
if (this.direction == 1) {
this.FmyZ = this.myZ + this.myWorld.tileSize;
} else {
this.look(1);
}
}
this.move();
}
};
initChar.prototype.walkback = function () {
if (this.myY == 0) {
if (this.direction == 0) {
this.FmyX = this.myX + this.myWorld.tileSize;
} else if (this.direction == 2) {
this.FmyX = this.myX - this.myWorld.tileSize;
} else if (this.direction == 3) {
this.FmyZ = this.myZ + this.myWorld.tileSize;
} else if (this.direction == 1) {
this.FmyZ = this.myZ - this.myWorld.tileSize;
}
this.moveback();
}
};
initChar.prototype.look2 = function () {
if (this.myY == 0) {
if (arguments[0] == "right") {
if (this.direction < 3) {
this.direction++;
} else {
this.direction = 0;
}
this.Me.gotoAndPlay("rotatecw" + this.direction);
} else if (arguments[0] == "left") {
if (0 < this.direction) {
this.direction--;
} else {
this.direction = 3;
}
this.Me.gotoAndPlay("rotateccw" + this.direction);
} else if (arguments[0] == "down") {
this.walkback();
}
}
};
initChar.prototype.moveback = function () {
moveflag = false;
this.whichTile();
tempc = this.myWorld.Collision([this.sqX, this.sqZ], this.direction);
NextTile = tempc[0];
if ((NextTile < 10) && (-1 < NextTile)) {
if (NextTile == 1) {
moveflag = true;
this.myWorld.newSound("move");
}
}
if (moveflag) {
this.myX = this.FmyX;
this.myZ = this.FmyZ;
this.drawMe("back");
} else {
this.FmyX = this.myX;
this.FmyZ = this.myZ;
this.whichTile();
}
this.tileBackup = this.myWorld.registerChar(this.tile, this.tilePos, this.tileBackup);
this.tilePos = this.tile;
};
initChar.prototype.move = function () {
snowflag = false;
moveflag = false;
this.whichTile();
tempc = this.myWorld.Collision([this.sqX, this.sqZ], this.direction);
NextTile = tempc[0];
PushedTile = tempc[1];
if ((NextTile < 10) && (-1 < NextTile)) {
if (NextTile == 1) {
moveflag = true;
this.myWorld.newSound("move");
} else if (NextTile < 7) {
if (9 < PushedTile) {
this.Me.smoke3.gotoAndPlay(2);
this.Me.smoke4.gotoAndPlay(2);
moveflag = false;
this.myWorld.newSound("pushno");
} else if ((PushedTile == 0) || (((PushedTile + NextTile) - 1) < 7)) {
snowflag = true;
moveflag = true;
this.myWorld.newSound("push");
} else {
this.Me.smoke3.gotoAndPlay(2);
this.Me.smoke4.gotoAndPlay(2);
moveflag = false;
this.myWorld.newSound("pushno");
}
}
}
if (9 < NextTile) {
this.Me.smoke3.gotoAndPlay(2);
this.Me.smoke4.gotoAndPlay(2);
this.myWorld.newSound("pushno");
}
if (moveflag) {
this.myX = this.FmyX;
this.myZ = this.FmyZ;
this.drawMe("", snowflag);
} else {
this.FmyX = this.myX;
this.FmyZ = this.myZ;
this.whichTile();
}
this.tileBackup = this.myWorld.registerChar(this.tile, this.tilePos, this.tileBackup);
this.tilePos = this.tile;
if (snowflag) {
this.myWorld.pushSnow(this.tile, (PushedTile + NextTile) - 1, this.direction, PushedTile);
this.tileBackup = 1;
}
};
initChar.prototype.drawMe = function () {
if (this.myWorld.checkVisibility(this.tile)) {
this.Me._visible = true;
this.myWorld.zSort(this.Name, this.tile, this.listPos);
this.Me.Name = this.Name;
this.Me.tile = this.tile;
this.Me.listPos = this.listPos;
this.Me.snowflag = arguments[1];
this.Me._x = this.myWorld.projectX(this.myX, this.myZ);
this.Me._y = this.myWorld.projectY(this.myX, this.myZ, this.myY);
if (arguments[0] == "back") {
this.Me.gotoAndPlay("back" + this.directions[this.direction]);
} else if (arguments[2] == "g") {
this.Me.gotoAndStop(this.directions[this.direction] + "fin");
} else {
this.Me.gotoAndPlay(this.directions[this.direction]);
}
} else {
this.Me._visible = false;
}
};
initChar.prototype.whichTile = function () {
this.sqX = Math.floor(this.FmyX / this.myWorld.tileSize);
this.sqZ = Math.floor(this.FmyZ / this.myWorld.tileSize);
this.tile = [this.sqX, this.sqZ];
};
initChar.prototype.gravity = function () {
if (this.myY < -1) {
this.myY = this.myY * 0.85;
this.drawMe(0, 0, "g");
} else if (this.myY < 0) {
this.myY = 0;
this.drawMe(0, 0, "g");
}
};
initChar.prototype.look = function () {
if (arguments[0] == 0) {
this.Me.gotoAndStop("upfin");
this.direction = 0;
} else if (arguments[0] == 1) {
this.Me.gotoAndStop("rightfin");
this.direction = 1;
} else if (arguments[0] == 2) {
this.Me.gotoAndStop("downfin");
this.direction = 2;
} else if (arguments[0] == 3) {
this.Me.gotoAndStop("leftfin");
this.direction = 3;
}
};
initChar.prototype.patrol = function () {
if ((this.Me != null) && ((this.lastPatrol + this.myWorld.pulse) < getTimer())) {
if (this.patrolMode[0] == 1) {
this.walk(this.directions[this.patrolMode[1]]);
this.lastPatrol = getTimer();
} else if (this.patrolMode[0] == 2) {
if (this.lastStep < this.patrolMode[2]) {
this.lastStep++;
this.walk(this.directions[this.patrolMode[1]]);
this.lastPatrol = getTimer();
} else {
if (this.patrolMode[1] < 2) {
this.patrolMode[1] = this.patrolMode[1] + 2;
} else {
this.patrolMode[1] = this.patrolMode[1] - 2;
}
this.lastStep = 0;
}
}
}
};
Symbol 164 MovieClip Frame 4
stop();
Instance of Symbol 164 MovieClip "world" in Symbol 165 MovieClip Frame 1
onClipEvent (enterFrame) {
_root.world.updater();
}
Symbol 172 MovieClip Frame 8
stop();
Symbol 180 Button
on (release) {
newLevel();
}
Symbol 184 Button
on (release) {
gotoAndStop (48);
}
Symbol 189 Button
on (release) {
submitflag = false;
gotoAndPlay (38);
}
Symbol 200 MovieClip Frame 1
stop();
Symbol 200 MovieClip Frame 2
stop();
Symbol 203 Button
on (rollOver) {
text.gotoAndStop(2);
}
on (rollOut, releaseOutside) {
text.gotoAndStop(1);
}
on (release) {
text.gotoAndStop(1);
_root.world.stopSounds();
_root.resetLevel();
}
Symbol 208 MovieClip Frame 1
stop();
Symbol 208 MovieClip Frame 2
stop();
Symbol 209 Button
on (release) {
_root.quitGame();
}
on (rollOver) {
exittext.gotoAndStop(2);
}
on (rollOut, releaseOutside) {
exittext.gotoAndStop(1);
}
Symbol 213 MovieClip Frame 1
stop();
Symbol 213 MovieClip Frame 2
stop();
Symbol 214 Button
on (release) {
text.gotoAndStop(1);
waittimer = getTimer();
gotoAndStop (4);
}
on (rollOver) {
text.gotoAndStop(2);
}
on (rollOut, releaseOutside) {
text.gotoAndStop(1);
}
Symbol 219 MovieClip Frame 10
stop();
Symbol 221 MovieClip Frame 1
stop();
Symbol 221 MovieClip Frame 2
stop();
Symbol 225 MovieClip Frame 1
stop();
Symbol 225 MovieClip Frame 2
play();
Symbol 225 MovieClip Frame 61
gotoAndStop (1);
Symbol 237 MovieClip Frame 2
value = _root.PercentToComplete + "%";
Symbol 238 MovieClip Frame 1
stop();
Symbol 238 MovieClip Frame 2
play();
Symbol 238 MovieClip Frame 109
_parent.gotoAndStop(1);
gotoAndStop (1);
Symbol 239 MovieClip Frame 1
percentsmall.gotoAndStop(1);
stop();
Symbol 239 MovieClip Frame 2
percentsmall.gotoAndStop(2);
play();
Symbol 239 MovieClip Frame 3
stop();
Symbol 239 MovieClip Frame 4
text.gotoAndPlay(2);
stop();
Instance of Symbol 225 MovieClip "text" in Symbol 239 MovieClip Frame 4
onClipEvent (enterFrame) {
if ((_parent.waittimer + 2600) < getTimer()) {
_root.nextLevel(_parent.fps);
_parent.gotoAndStop(1);
}
}
Symbol 239 MovieClip Frame 5
stop();
Symbol 246 MovieClip Frame 13
stop();
Symbol 254 Button
on (release) {
worldloaded = -1;
activelevel = -1;
levelcnt = 1;
submitflag = true;
gotoAndPlay (38);
}
Symbol 258 MovieClip Frame 8
gotoAndPlay (1);
Symbol 258 MovieClip Frame 9
stop();
Symbol 269 Button
on (release) {
worldloaded = -1;
activelevel = -1;
levelcnt = 1;
finalscore = 0;
finalscore2 = "0%";
playername = "";
gotoAndPlay (10);
}
Symbol 281 MovieClip Frame 1
stop();
Symbol 281 MovieClip Frame 2
stop();
Symbol 282 Button
on (release) {
gotoAndStop (15);
}
Symbol 309 MovieClip Frame 1
pushvar = 10;
Symbol 309 MovieClip Frame 86
if (0 < pushvar) {
pushvar--;
gotoAndPlay (72);
} else {
gotoAndPlay (1);
}