Frame 2
loadPercent = Math.floor((getBytesLoaded() / getBytesTotal()) * 100);
if (isNaN(loadPercent)) {
loadPercent = 1;
}
loadDisplay.percent = loadPercent;
if (loadPercent == 100) {
loadDisplay.gotoAndPlay("ready");
stop();
} else {
loadDisplay.gotoAndStop(loadPercent + 1);
gotoAndPlay (1);
}
Frame 36
stop();
Frame 45
function playSound($soundObj) {
var _local1 = $soundObj;
if ((_local1.position == 0) || (_local1.position == _local1.duration)) {
_local1.start();
}
}
function playPelletSound() {
pelletSound2.start();
}
function TileClass($walkable, $frame, $style) {
var _local1 = this;
_local1.walkable = $walkable;
_local1.frame = $frame;
_local1.style = $style;
}
function DoorClass($newCharX, $newCharY) {
var _local1 = this;
_local1.newCharX = $newCharX;
_local1.newCharY = $newCharY;
_local1.newMap = 1;
_local1.frame = 20;
_local1.walkable = true;
_local1.style = "door";
}
function getMyCorners($x, $y, $ob) {
var _local1 = $ob;
_local1.downY = Math.floor(($y + _local1.height) / game.tileH);
_local1.upY = Math.floor(($y - _local1.height) / game.tileH);
_local1.leftX = Math.floor(($x - _local1.width) / game.tileW);
_local1.rightX = Math.floor(($x + _local1.width) / game.tileW);
_local1.upLeft = game[(("tile" + _local1.upY) + "_") + _local1.leftX].walkable;
_local1.upRight = game[(("tile" + _local1.upY) + "_") + _local1.rightX].walkable;
_local1.downLeft = game[(("tile" + _local1.downY) + "_") + _local1.leftX].walkable;
_local1.downRight = game[(("tile" + _local1.downY) + "_") + _local1.rightX].walkable;
if (_local1 == _root.hero) {
if (!_local1.upLeft) {
_local1.upLeft = game[(("tile" + _local1.upY) + "_") + _local1.leftX].style == "openGoalDoor";
}
if (!_local1.upRight) {
_local1.upRight = game[(("tile" + _local1.upY) + "_") + _local1.rightX].style == "openGoalDoor";
}
if (!_local1.downLeft) {
_local1.downLeft = game[(("tile" + _local1.downY) + "_") + _local1.leftX].style == "openGoalDoor";
}
if (!_local1.downRight) {
_local1.downRight = game[(("tile" + _local1.downY) + "_") + _local1.rightX].style == "openGoalDoor";
}
}
return(((_local1.upLeft && (_local1.downLeft)) && (_local1.upRight)) && (_local1.downRight));
}
function moveChar($ob, $dirX, $dirY) {
var _local1 = $ob;
var _local3 = _root;
if (getMyCorners(_local1.x + (_local1.speed * $dirX), _local1.y + (_local1.speed * $dirY), _local1)) {
_local1.y = _local1.y + (_local1.speed * $dirY);
_local1.x = _local1.x + (_local1.speed * $dirX);
_local1.clip._x = _local1.x;
_local1.clip._y = _local1.y;
_local1.xTile = Math.floor(_local1.clip._x / game.tileW);
_local1.ytile = Math.floor(_local1.clip._y / game.tileH);
_local1.clip.gotoAndStop(_local1.curDir);
if (_local1 == _local3.hero) {
if (game.totalPellets > 0) {
var _local2 = (("tile" + _local1.yTile) + "_") + _local1.xTile;
switch (game[_local2].style) {
case "pellet" :
game[_local2] = _local3.Tile1;
game.clip[_local2].gotoAndStop(game[_local2].frame);
game.totalPellets--;
score = score + 10;
playPelletSound();
break;
case "powerPellet" :
game[_local2] = _local3.Tile1;
game.clip[_local2].gotoAndStop(game[_local2].frame);
game.totalPellets--;
score = score + 20;
powerUp();
playSound(ppSound);
break;
case "keyLeft" :
playSound(keySound);
game[_local2] = _local3.Tile1;
game.clip[_local2].gotoAndStop(game[_local2].frame);
game[(("tile" + _local1.yTile) + "_") + (_local1.xTile + 1)] = _local3.Tile1;
game.clip[(("tile" + _local1.yTile) + "_") + (_local1.xTile + 1)].gotoAndStop(game[_local2].frame);
game[(("tile" + _local1.yTile) + "_") + (_local1.xTile + 2)] = _local3.Tile1;
game.clip[(("tile" + _local1.yTile) + "_") + (_local1.xTile + 2)].gotoAndStop(game[_local2].frame);
game.totalPellets = game.totalPellets - 3;
score = score + 30;
break;
case "keyMiddle" :
playSound(keySound);
game[_local2] = _local3.Tile1;
game.clip[_local2].gotoAndStop(game[_local2].frame);
game[(("tile" + _local1.yTile) + "_") + (_local1.xTile - 1)] = _local3.Tile1;
game.clip[(("tile" + _local1.yTile) + "_") + (_local1.xTile - 1)].gotoAndStop(game[_local2].frame);
game[(("tile" + _local1.yTile) + "_") + (_local1.xTile + 1)] = _local3.Tile1;
game.clip[(("tile" + _local1.yTile) + "_") + (_local1.xTile + 1)].gotoAndStop(game[_local2].frame);
game.totalPellets = game.totalPellets - 3;
score = score + 30;
break;
case "keyRight" :
playSound(keySound);
game[_local2] = _local3.Tile1;
game.clip[_local2].gotoAndStop(game[_local2].frame);
game[(("tile" + _local1.yTile) + "_") + (_local1.xTile - 2)] = _local3.Tile1;
game.clip[(("tile" + _local1.yTile) + "_") + (_local1.xTile - 2)].gotoAndStop(game[_local2].frame);
game[(("tile" + _local1.yTile) + "_") + (_local1.xTile - 1)] = _local3.Tile1;
game.clip[(("tile" + _local1.yTile) + "_") + (_local1.xTile - 1)].gotoAndStop(game[_local2].frame);
game.totalPellets = game.totalPellets - 3;
score = score + 30;
}
if (game.totalPellets == 0) {
game[game.goalDoor] = _local3.Tile11;
game.clip[game.goalDoor].gotoAndStop(game[game.goalDoor].frame);
game.clip.cage.gotoAndPlay("open");
}
} else if (game[(("tile" + _local1.yTile) + "_") + _local1.xTile].style == "goal") {
game.interaction = false;
levelUp.gotoAndPlay("reveal");
}
}
if (game[(("tile" + _local1.yTile) + "_") + _local1.xTile].style == "door") {
changeMap(_local1);
}
return(true);
}
if (_local1 == _local3.hero) {
heroChangeDirections();
return(false);
}
_local1.x = (_local1.xTile + 0.5) * game.tileW;
_local1.y = (_local1.yTile + 0.5) * game.tileH;
_local1.clip._x = _local1.x;
_local1.clip._y = _local1.y;
return(undefined);
}
function EnemyClass($dir) {
var _local1 = this;
_local1.dir = 2;
_local1.speeds = {normal:5.25, afraid:3, eaten:0, grace:5.25};
_local1.speed = _local1.speeds.normal;
_local1.iq = base10;
_local1.state = "normal";
_local1.grace = 0;
}
function enemyBrain() {
var i = 0;
while (i < game.currentEnemies) {
var enemyName = ("enemy" + i);
var _local1 = game[enemyName];
if (_local1.state == "eaten") {
if ((--_local1.reviveCount) <= 0) {
_local1.xTile = 11;
_local1.yTile = 1;
_local1.x = (_local1.xTile + 0.5) * game.tileW;
_local1.y = (_local1.yTile + 0.5) * game.tileH;
_local1.clip._x = _local1.x;
_local1.clip._y = _local1.y;
_local1.dir = 3;
_local1.state = "grace";
_local1.clip.gotoAndPlay("grace");
_local1.grace = 20;
}
} else {
_local1.speed = _local1.speeds[_local1.state];
if ((_local1.x == ((_local1.xTile + 0.5) * game.tileW)) && (_local1.y == ((_local1.yTile + 0.5) * game.tileH))) {
var motionChoice = "roam";
switch (_local1.state) {
case "grace" :
_local1.grace--;
if (_local1.grace <= 0) {
_local1.state = "normal";
_local1.clip.gotoAndPlay("normal");
}
break;
case "afraid" :
var motionChoice = "flee";
break;
default :
if ((Math.abs(_local1.xTile - hero.xTile) <= 6) && (Math.abs(_local1.yTile - hero.yTile) <= 6)) {
if ((Math.random() * 100) < Math.min(90, 30 + (5 * game.level))) {
motionChoice = "hunt";
}
} else {
if (!((_local1.xTile == hero.xTile) || (_local1.yTile == hero.yTile))) {
break;
}
if ((Math.random() * 100) >= Math.min(90, 30 + (5 * game.level))) {
break;
}
motionChoice = "hunt";
}
}
var reverseDir = 0;
switch (_local1.dir) {
case 1 :
reverseDir = 3;
break;
case 2 :
reverseDir = 4;
break;
case 3 :
reverseDir = 1;
break;
case 4 :
reverseDir = 2;
}
switch (motionChoice) {
case "flee" :
var dirChoices = [];
dirChoices.push(null);
dirChoices.push(game[(("tile" + (_local1.yTile - 1)) + "_") + _local1.xTile].walkable && (_local1.dir != 3));
dirChoices.push(game[(("tile" + _local1.yTile) + "_") + (_local1.xTile + 1)].walkable && (_local1.dir != 4));
dirChoices.push(game[(("tile" + (_local1.yTile + 1)) + "_") + _local1.xTile].walkable && (_local1.dir != 1));
dirChoices.push(game[(("tile" + _local1.yTile) + "_") + (_local1.xTile - 1)].walkable && (_local1.dir != 2));
var _local2 = new Array();
var _local3 = ((random(2) == 0) ? 1 : -1);
if (Math.abs(hero.xTile - _local1.xTile) >= Math.abs(hero.yTile - _local1.yTile)) {
if (hero.xTile < _local1.xTile) {
if (dirChoices[2]) {
_local2.push(2);
}
if (dirChoices[2 - _local3]) {
_local2.push(2 - _local3);
}
if (dirChoices[2 + _local3]) {
_local2.push(2 + _local3);
}
if (dirChoices[4]) {
_local2.push(4);
}
} else {
if (dirChoices[4]) {
_local2.push(4);
}
if (dirChoices[2 - _local3]) {
_local2.push(2 - _local3);
}
if (dirChoices[2 + _local3]) {
_local2.push(2 + _local3);
}
if (dirChoices[2]) {
_local2.push(2);
}
}
} else if (hero.yTile < _local1.yTile) {
if (dirChoices[3]) {
_local2.push(3);
}
if (dirChoices[3 - _local3]) {
_local2.push(3 - _local3);
}
if (dirChoices[3 + _local3]) {
_local2.push(3 + _local3);
}
if (dirChoices[1]) {
_local2.push(1);
}
} else {
if (dirChoices[1]) {
_local2.push(1);
}
if (dirChoices[3 - _local3]) {
_local2.push(3 - _local3);
}
if (dirChoices[3 + _local3]) {
_local2.push(3 + _local3);
}
if (dirChoices[3]) {
_local2.push(3);
}
}
var dirX = 0;
var dirY = 0;
_local1.dir = _local2[0];
break;
case "hunt" :
var dirChoices = [];
dirChoices.push(null);
dirChoices.push(game[(("tile" + (_local1.yTile - 1)) + "_") + _local1.xTile].walkable && (_local1.dir != 3));
dirChoices.push(game[(("tile" + _local1.yTile) + "_") + (_local1.xTile + 1)].walkable && (_local1.dir != 4));
dirChoices.push(game[(("tile" + (_local1.yTile + 1)) + "_") + _local1.xTile].walkable && (_local1.dir != 1));
dirChoices.push(game[(("tile" + _local1.yTile) + "_") + (_local1.xTile - 1)].walkable && (_local1.dir != 2));
_local2 = new Array();
_local3 = ((random(2) == 0) ? 1 : -1);
if (Math.abs(hero.xTile - _local1.xTile) >= Math.abs(hero.yTile - _local1.yTile)) {
if (hero.xTile < _local1.xTile) {
if (dirChoices[4]) {
_local2.push(4);
}
if (dirChoices[2 - _local3]) {
_local2.push(2 - _local3);
}
if (dirChoices[2 + _local3]) {
_local2.push(2 + _local3);
}
if (dirChoices[2]) {
_local2.push(2);
}
} else {
if (dirChoices[2]) {
_local2.push(2);
}
if (dirChoices[2 - _local3]) {
_local2.push(2 - _local3);
}
if (dirChoices[2 + _local3]) {
_local2.push(2 + _local3);
}
if (dirChoices[4]) {
_local2.push(4);
}
}
} else if (hero.yTile < _local1.yTile) {
if (dirChoices[1]) {
_local2.push(1);
}
if (dirChoices[3 - _local3]) {
_local2.push(3 - _local3);
}
if (dirChoices[3 + _local3]) {
_local2.push(3 + _local3);
}
if (dirChoices[3]) {
_local2.push(3);
}
} else {
if (dirChoices[3]) {
_local2.push(3);
}
if (dirChoices[3 - _local3]) {
_local2.push(3 - _local3);
}
if (dirChoices[3 + _local3]) {
_local2.push(3 + _local3);
}
if (dirChoices[1]) {
_local2.push(1);
}
}
var dirX = 0;
var dirY = 0;
_local1.dir = _local2[0];
break;
case "roam" :
var dirChoices = [];
if (game[(("tile" + (_local1.yTile - 1)) + "_") + _local1.xTile].walkable && (_local1.dir != 3)) {
dirChoices.push(1);
}
if (game[(("tile" + _local1.yTile) + "_") + (_local1.xTile + 1)].walkable && (_local1.dir != 4)) {
dirChoices.push(2);
}
if (game[(("tile" + (_local1.yTile + 1)) + "_") + _local1.xTile].walkable && (_local1.dir != 1)) {
dirChoices.push(3);
}
if (game[(("tile" + _local1.yTile) + "_") + (_local1.xTile - 1)].walkable && (_local1.dir != 2)) {
dirChoices.push(4);
}
if ((Math.abs(dirChoices[0] - reverseDir) == 2) && (dirChoices.length == 1)) {
break;
}
_local1.dir = dirChoices[Math.floor(Math.random() * dirChoices.length)];
}
}
_local1.clip.dir = _local1.dir;
var dirX = 0;
var dirY = 0;
switch (_local1.dir) {
case 1 :
dirX = 0;
dirY = -1;
break;
case 2 :
dirX = 1;
dirY = 0;
break;
case 3 :
dirX = 0;
dirY = 1;
break;
case 4 :
dirX = -1;
dirY = 0;
}
moveChar(_local1, dirX, dirY);
var xDist = (_local1.x - hero.x);
var yDist = (_local1.y - hero.y);
if (Math.sqrt((xDist * xDist) + (yDist * yDist)) < ((_local1.width + hero.width) + 5)) {
if (_local1.state == "normal") {
playSound(deathSound);
game.interaction = false;
hero.clip.gotoAndPlay("die");
livesDisplay.removeOne();
} else if (_local1.state == "afraid") {
playSound(deadEnemySound);
_local1.state = "eaten";
game.eatenEnemies++;
var eatenPoints = (10 * game.eatenEnemies);
score = score + eatenPoints;
_local1.clip.pointValue = eatenPoints;
_local1.clip.gotoAndPlay("eaten");
_local1.reviveCount = 100;
}
}
}
i++;
}
}
function moveHero() {
var _local1 = _root.hero;
var _local3 = 0;
var _local2 = 0;
if (_local1.nextDir != 0) {
var nextDirX = 0;
var nextDirY = 0;
switch (_local1.nextDir) {
case 5 :
nextDirX = 0;
nextDirY = 0;
break;
case 1 :
nextDirX = 0;
nextDirY = -1;
break;
case 2 :
nextDirX = 1;
nextDirY = 0;
break;
case 3 :
nextDirX = 0;
nextDirY = 1;
break;
case 4 :
nextDirX = -1;
nextDirY = 0;
}
if (getMyCorners(_local1.x + (_local1.speed * nextDirX), _local1.y + (_local1.speed * nextDirY), _local1)) {
_local1.curDir = _local1.nextDir;
_local1.nextDir = 0;
_local3 = nextDirX;
_local2 = nextDirY;
}
}
if ((_local3 == 0) && (_local2 == 0)) {
switch (_local1.curDir) {
case 1 :
_local3 = 0;
_local2 = -1;
break;
case 2 :
_local3 = 1;
_local2 = 0;
break;
case 3 :
_local3 = 0;
_local2 = 1;
break;
case 4 :
_local3 = -1;
_local2 = 0;
}
}
moveChar(_local1, _local3, _local2);
}
function heroChangeDirections() {
hero.curDir = hero.nextDir;
hero.nextDir = 0;
}
function buildMap($map, $buildMap) {
game.clip = _root.tiles;
if ($buildMap) {
level = game.level;
var mapWidth = $map[0].length;
var mapHeight = $map.length;
var i = 0;
while (i < mapHeight) {
var _local3 = 0;
while (_local3 < mapWidth) {
var _local1 = (("tile" + i) + "_") + _local3;
game[_local1] = _root["Tile" + $map[i][_local3]];
switch (game[_local1].style) {
case "pellet" :
case "powerPellet" :
case "keyLeft" :
case "keyMiddle" :
case "keyRight" :
game.totalPellets++;
break;
case "goalDoor" :
game.goalDoor = _local1;
}
game.clip.attachMovie("tile", _local1, (i * 100) + (_local3 * 2));
game.clip[_local1]._x = _local3 * game.tileW;
game.clip[_local1]._y = i * game.tileH;
game.clip[_local1].gotoAndStop(game[_local1].frame);
_local3++;
}
i++;
}
}
var enemies = enemyList[game.currentMap];
game.currentEnemies = enemies.length;
var i = 0;
while (i < game.currentEnemies) {
var _local2 = "enemy" + i;
game[_local2] = _root["Enemy" + enemies[i][0]];
game.clip.attachMovie("enemy" + enemies[i][0], _local2, 10001 + i);
game[_local2].state = "normal";
game[_local2].clip = game.clip[_local2];
game[_local2].xTile = enemies[i][1];
game[_local2].yTile = enemies[i][2];
game[_local2].width = 6.9;
game[_local2].height = 6.9;
game[_local2].x = (game[_local2].xTile * game.tileW) + (game.tileW / 2);
game[_local2].y = (game[_local2].yTile * game.tileH) + (game.tileH / 2);
game[_local2].clip._x = game[_local2].x;
game[_local2].clip._y = game[_local2].y;
i++;
}
game.clip.attachMovie("hero", "hero", 10000);
hero.clip = game.clip.hero;
hero.clip.gotoAndStop(2);
hero.curDir = 0;
hero.nextDir = 0;
hero.xTile = 11;
hero.yTile = 15;
hero.x = (hero.xTile * game.tileW) + (game.tileW / 2);
hero.y = (hero.yTile * game.tileH) + (game.tileH / 2);
hero.width = 6.9;
hero.height = 6.9;
hero.clip._x = hero.x;
hero.clip._y = hero.y;
game.powerUp = 0;
}
function changeMap($ob) {
var _local1 = $ob;
var _local2 = (("tile" + _local1.yTile) + "_") + _local1.xTile;
_local1.yTile = game[_local2].newCharY;
_local1.xTile = game[_local2].newCharX;
_local1.x = (_local1.xTile * game.tileW) + (game.tileW / 2);
_local1.y = (_local1.yTile * game.tileH) + (game.tileH / 2);
}
function powerUp() {
if (game.powerUp == 0) {
game.eatenEnemies = 0;
}
game.powerUp = 250;
var _local2 = 0;
while (_local2 < game.currentEnemies) {
var _local1 = game["enemy" + _local2];
if ((_local1.state == "normal") || (_local1.state == "grace")) {
_local1.state = "afraid";
_local1.clip.gotoAndPlay("afraid");
switch (_local1.dir) {
case 1 :
_local1.dir = 3;
break;
case 2 :
_local1.dir = 4;
break;
case 3 :
_local1.dir = 1;
break;
case 4 :
_local1.dir = 2;
}
}
_local2++;
}
}
function powerUpCount() {
if (game.powerUp == 0) {
var _local1 = 0;
while (_local1 < game.currentEnemies) {
var _local2 = "enemy" + _local1;
if (game[_local2].state == "afraid") {
game[_local2].state = "normal";
game[_local2].clip.gotoAndPlay("normal");
}
_local1++;
}
} else {
switch (game.powerUp) {
case 10 :
case 22 :
case 34 :
case 46 :
case 58 :
case 70 :
var _local1 = 0;
for(;;){
if (_local1 >= game.currentEnemies) {
break;
}
var _local2 = "enemy" + _local1;
if (game[_local2].state == "afraid") {
game[_local2].clip.gotoAndPlay("blink");
}
_local1++;
};
}
game.powerUp--;
}
}
function onHeroDeath() {
if ((--game.lives) <= 0) {
gotoAndPlay ("gameOver");
} else {
buildMap(_root["map" + game.currentMap], false);
countdown.gotoAndPlay(1);
}
}
function onLevelUp() {
game.level++;
game.clip.bg.nextFrame();
game.clip.cage.gotoAndPlay("closed");
buildMap(_root["map" + game.currentMap], true);
countdown.gotoAndPlay(1);
}
game = {tileW:21, tileH:21, currentMap:1, totalPellets:0, goalDoor:null, interaction:false, level:1, lives:3, score:0, powerUp:0, eatenEnemies:0};
score = 0;
level = 0;
livesDisplay.reset();
unInstBtn._visible = false;
pelletSound = new Sound();
pelletSound.attachSound("pelletSound");
pelletSound2 = new Sound();
pelletSound2.attachSound("pelletSound2");
ppSound = new Sound();
ppSound.attachSound("ppSound");
keySound = new Sound();
keySound.attachSound("keySound");
deadEnemySound = new Sound();
deadEnemySound.attachSound("deadEnemySound");
deathSound = new Sound();
deathSound.attachSound("deathSound");
var pelletBool = true;
map1 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 2, 3, 2, 0, 4, 5, 6, 0, 0, 0, 2, 0, 0, 0, 4, 5, 6, 0, 2, 3, 2, 0], [0, 2, 0, 2, 0, 2, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 2, 0, 2, 0, 2, 0], [0, 2, 0, 2, 2, 2, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 2, 2, 2, 0, 2, 0], [0, 2, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 2, 0], [0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 5, 6, 2, 2, 2, 2, 2, 2, 2, 0, 2, 0], [0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 2, 0, 0, 0, 2, 0], [0, 2, 0, 0, 0, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 0, 2, 0], [0, 2, 0, 0, 0, 2, 0, 2, 0, 2, 0, 7, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0], [0, 2, 2, 2, 2, 2, 0, 2, 2, 2, 0, 1, 0, 2, 0, 2, 2, 2, 0, 2, 2, 2, 0], [0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 10, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0], [0, 2, 2, 2, 2, 2, 0, 2, 2, 2, 0, 0, 0, 2, 0, 2, 2, 2, 0, 2, 2, 2, 0], [0, 2, 0, 0, 0, 2, 0, 2, 0, 2, 0, 0, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0], [0, 2, 0, 0, 0, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 0, 2, 0], [0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 2, 0, 0, 0, 2, 0], [0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 0], [0, 2, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 2, 0], [0, 2, 0, 2, 2, 2, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 2, 2, 2, 0, 2, 0], [0, 2, 0, 2, 0, 2, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 2, 0, 2, 0, 2, 0], [0, 2, 3, 2, 0, 4, 5, 6, 0, 0, 0, 2, 0, 0, 0, 4, 5, 6, 0, 2, 3, 2, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
Tile0 = new TileClass(false, 1, "wall");
Tile1 = new TileClass(true, 2, "blank");
Tile2 = new TileClass(true, 3, "pellet");
Tile3 = new TileClass(true, 4, "powerPellet");
Tile4 = new TileClass(true, 5, "keyLeft");
Tile5 = new TileClass(true, 6, "keyMiddle");
Tile6 = new TileClass(true, 7, "keyRight");
Tile7 = new TileClass(false, 8, "goalDoor");
Tile8 = new DoorClass(11, 19);
Tile9 = new DoorClass(11, 1);
Tile10 = new TileClass(true, 2, "goal");
Tile11 = new TileClass(false, 11, "openGoalDoor");
_root.createEmptyMovieClip("controller", 10);
controller.onEnterFrame = function () {
if (game.interaction) {
moveHero();
enemyBrain();
if (game.powerUp >= 0) {
powerUpCount();
}
}
};
Enemy1 = new EnemyClass(1);
Enemy2 = new EnemyClass(1);
Enemy3 = new EnemyClass(1);
enemyList = [[0], [[1, 7, 5], [2, 15, 5], [3, 11, 7]]];
hero = {curDir:0, nextDir:0, xTile:11, yTile:15, speed:5.25};
myKeyListener = {};
Key.addListener(myKeyListener);
myKeyListener.onKeyDown = function () {
if (game.interaction) {
var _local1 = 0;
switch (Key.getCode()) {
case 38 :
_local1 = 1;
break;
case 39 :
_local1 = 2;
break;
case 40 :
_local1 = 3;
break;
case 37 :
_local1 = 4;
break;
case 32 :
_local1 = 5;
}
if ((_local1 != hero.curDir) && (_local1 != hero.nextDir)) {
if (hero.curDir == 0) {
hero.curDir = _local1;
hero.nextDir = 0;
} else {
hero.nextDir = _local1;
}
}
}
};
buildMap(_root["map" + game.currentMap], true);
Frame 46
stop();
Frame 76
stop();
Symbol 49 MovieClip Frame 1
stop();
Symbol 49 MovieClip Frame 30
_parent.play();
stop();
Symbol 54 MovieClip Frame 1
stop();
Symbol 54 MovieClip Frame 103
mBW.play();
Symbol 54 MovieClip Frame 109
stop();
Symbol 54 MovieClip Frame 137
_parent.gotoAndPlay("loaded");
stop();
Symbol 68 Button
on (release) {
getURL ("javascript:window.self.close()");
}
Symbol 75 Button
on (release) {
getURL ("http://disney.go.com/disneyvideos/animatedfilms/threemusketeers/", "dis3musk");
}
Symbol 101 Button
on (release) {
gotoAndPlay ("newGame");
}
Symbol 105 MovieClip Frame 1
stop();
Symbol 105 MovieClip Frame 6
gotoAndStop (1);
Symbol 111 MovieClip Frame 42
gotoAndPlay ("loop");
Symbol 112 MovieClip Frame 2
stop();
Symbol 112 MovieClip Frame 32
stop();
Symbol 117 MovieClip Frame 1
stop();
Symbol 117 MovieClip Frame 55
_parent.onLevelUp();
stop();
Symbol 118 MovieClip Frame 2
stop();
Symbol 118 MovieClip Frame 6
stop();
Symbol 128 MovieClip Frame 1
function removeOne() {
gotoAndPlay ("change");
}
function reset() {
numLives = 3;
}
numLives = 3;
stop();
Symbol 128 MovieClip Frame 10
numLives--;
Symbol 128 MovieClip Frame 16
stop();
Symbol 134 Button
on (release) {
unInstBtn._visible = true;
instBtn._visible = false;
instructions.gotoAndPlay("reveal");
_root.game.interaction = false;
}
Symbol 136 Button
on (release) {
instBtn._visible = true;
unInstBtn._visible = false;
instructions.gotoAndPlay("hide");
_root.game.interaction = true;
}
Symbol 140 MovieClip Frame 1
killer.useHandCursor = false;
Symbol 150 MovieClip Frame 1
stop();
_name = "numbers";
Symbol 152 MovieClip Frame 32
if (numbers._currentframe == numbers._totalframes) {
_parent.game.interaction = true;
gotoAndPlay ("hide");
} else {
gotoAndPlay ("loop");
numbers.nextFrame();
}
Symbol 152 MovieClip Frame 38
stop();
Symbol 162 MovieClip [enemy1] Frame 1
lr = 2;
onEnterFrame = function () {
if ((dir != head._currentframe) && ((dir % 2) == 0)) {
lr = dir;
}
head.gotoAndStop(lr);
};
Instance of Symbol 156 MovieClip "head" in Symbol 162 MovieClip [enemy1] Frame 1
onClipEvent (load) {
gotoAndStop(_parent.lr);
}
Symbol 162 MovieClip [enemy1] Frame 6
stop();
Instance of Symbol 156 MovieClip "head" in Symbol 162 MovieClip [enemy1] Frame 10
onClipEvent (load) {
gotoAndStop(_parent.lr);
}
Symbol 162 MovieClip [enemy1] Frame 17
gotoAndPlay ("grace");
Instance of Symbol 160 MovieClip "head" in Symbol 162 MovieClip [enemy1] Frame 20
onClipEvent (load) {
gotoAndStop(_parent.lr);
}
Symbol 162 MovieClip [enemy1] Frame 21
stop();
Instance of Symbol 156 MovieClip "head" in Symbol 162 MovieClip [enemy1] Frame 25
onClipEvent (load) {
gotoAndStop(_parent.lr);
}
Symbol 162 MovieClip [enemy1] Frame 29
gotoAndPlay ("afraid");
Symbol 162 MovieClip [enemy1] Frame 56
stop();
Symbol 164 MovieClip Frame 1
gotoAndStop(((_parent.leftRight == "left") ? 2 : 1));
Symbol 165 MovieClip Frame 1
gotoAndStop(((_parent.leftRight == "left") ? 2 : 1));
Symbol 166 MovieClip [hero] Frame 1
stop();
Symbol 166 MovieClip [hero] Frame 2
leftRight = "right";
Symbol 166 MovieClip [hero] Frame 4
leftRight = "left";
Symbol 166 MovieClip [hero] Frame 38
stop();
_root.onHeroDeath();
Symbol 179 MovieClip [enemy3] Frame 1
lr = 2;
onEnterFrame = function () {
if ((dir != head._currentframe) && ((dir % 2) == 0)) {
lr = dir;
}
head.gotoAndStop(lr);
};
Instance of Symbol 174 MovieClip "head" in Symbol 179 MovieClip [enemy3] Frame 1
onClipEvent (load) {
gotoAndStop(_parent.lr);
}
Symbol 179 MovieClip [enemy3] Frame 6
stop();
Instance of Symbol 174 MovieClip "head" in Symbol 179 MovieClip [enemy3] Frame 10
onClipEvent (load) {
gotoAndStop(_parent.lr);
}
Symbol 179 MovieClip [enemy3] Frame 17
stop();
Instance of Symbol 178 MovieClip "head" in Symbol 179 MovieClip [enemy3] Frame 21
onClipEvent (load) {
gotoAndStop(_parent.lr);
}
Symbol 179 MovieClip [enemy3] Frame 22
stop();
Instance of Symbol 174 MovieClip "head" in Symbol 179 MovieClip [enemy3] Frame 26
onClipEvent (load) {
gotoAndStop(_parent.lr);
}
Symbol 179 MovieClip [enemy3] Frame 30
gotoAndPlay ("afraid");
Symbol 179 MovieClip [enemy3] Frame 57
stop();
Symbol 188 MovieClip [enemy2] Frame 1
lr = 2;
onEnterFrame = function () {
if ((dir != head._currentframe) && ((dir % 2) == 0)) {
lr = dir;
}
head.gotoAndStop(lr);
};
Instance of Symbol 183 MovieClip "head" in Symbol 188 MovieClip [enemy2] Frame 1
onClipEvent (load) {
gotoAndStop(_parent.lr);
}
Symbol 188 MovieClip [enemy2] Frame 6
stop();
Instance of Symbol 183 MovieClip "head" in Symbol 188 MovieClip [enemy2] Frame 10
onClipEvent (load) {
gotoAndStop(_parent.lr);
}
Symbol 188 MovieClip [enemy2] Frame 17
stop();
Instance of Symbol 187 MovieClip "head" in Symbol 188 MovieClip [enemy2] Frame 21
onClipEvent (load) {
gotoAndStop(_parent.lr);
}
Symbol 188 MovieClip [enemy2] Frame 22
stop();
Instance of Symbol 183 MovieClip "head" in Symbol 188 MovieClip [enemy2] Frame 26
onClipEvent (load) {
gotoAndStop(_parent.lr);
}
Symbol 188 MovieClip [enemy2] Frame 30
gotoAndPlay ("afraid");
Symbol 188 MovieClip [enemy2] Frame 57
stop();
Symbol 196 Button
on (release) {
_root.gotoAndPlay("newGame");
}