Frame 1
function CreateControlPanel(aname) {
_root[aname].state = "alive";
_root.attachMovie("control panel", aname, 25);
_root[aname]._X = 320;
_root[aname]._Y = 437;
_level0.color = true;
}
if (_level0.controlpanel.state != "alive") {
CreateControlPanel("alive");
}
stop();
Instance of Symbol 138 MovieClip in Frame 1
onClipEvent (enterFrame) {
if (_level0.gamerunning == true) {
i = 0;
while (i < _root.TheOBjectList.length) {
if (_level0.CurrentRoomNumber == _root[_root.TheOBjectList[i]].myRoom) {
_root[_root.TheOBjectList[i]].myFrameScript();
}
i++;
}
}
}
onClipEvent (keyDown) {
if (_level0.gamerunning == true) {
_level0.KeyDownHandler();
}
}
onClipEvent (keyUp) {
if (_level0.gamerunning == true) {
_level0.KeyUpHandler();
}
}
Frame 5
if (_level0.gamerunning == true) {
_root.man._y = _root.man._y + (_root.man.NextPlayerStep[1] * _root.man.MySpeed);
_root.man._x = _root.man._x + (_root.man.NextPlayerStep[0] * _root.man.MySpeed);
if (_root.StageHeight < _root.man._y) {
_root.man._y = 0;
_root.GoRoom(3);
} else if (_root.man._y < 0) {
_root.man._y = _root.StageHeight;
_root.GoRoom(1);
}
if (_root.StageWidth < _root.man._x) {
_root.man._x = 0;
_root.GoRoom(2);
} else if (_root.man._x < 0) {
_root.man._x = _root.StageWidth - 1;
_root.GoRoom(0);
}
}
Frame 6
gotoAndPlay(_currentframe - 1);
Frame 15
prevFrame();
Symbol 13 MovieClip Frame 1
stop();
Symbol 14 MovieClip Frame 1
stop();
Symbol 15 MovieClip [GateID] Frame 1
function shoutout() {
}
stop();
Instance of Symbol 13 MovieClip in Symbol 15 MovieClip [GateID] Frame 1
onClipEvent (mouseDown) {
}
Symbol 15 MovieClip [GateID] Frame 19
_level0[myname].mystate = "open";
Symbol 15 MovieClip [GateID] Frame 20
stop();
Symbol 15 MovieClip [GateID] Frame 42
Symbol 15 MovieClip [GateID] Frame 43
if (_level0[MyName].hitTest(_level0[_level0[MyName].MyKey])) {
gotoAndPlay (42);
} else {
_level0[MyName].MyState = "closed";
gotoAndStop (1);
}
Symbol 17 Button
on (release) {
BlockDownScript();
}
Symbol 46 MovieClip Frame 1
stop();
Symbol 46 MovieClip Frame 4
stop();
Symbol 53 MovieClip Frame 1
stop();
Symbol 53 MovieClip Frame 5
stop();
Symbol 60 MovieClip Frame 1
stop();
Symbol 60 MovieClip Frame 5
stop();
Symbol 67 MovieClip Frame 1
stop();
Symbol 67 MovieClip Frame 5
stop();
Symbol 74 MovieClip Frame 1
stop();
Symbol 74 MovieClip Frame 6
stop();
Symbol 81 MovieClip Frame 1
stop();
Symbol 81 MovieClip Frame 6
stop();
Symbol 82 Button
on (press) {
var ButName = but1;
if (ButName.butstate == true) {
_level0.SNDbutdown.stop();
_level0.SNDbutdown.start();
ButName.butstate = false;
ButName.gotoAndPlay("off");
_level0.GameOff();
} else {
_level0.SNDbutdown.stop();
_level0.SNDbutup.stop();
_level0.SNDbutup.start();
ButName.butstate = true;
ButName.gotoAndPlay("on");
_level0.GameON();
}
}
Symbol 83 Button
on (press) {
var ButName = but2;
if (ButName.butstate == true) {
_level0.SNDbutdown.stop();
_level0.SNDbutdown.start();
ButName.butstate = false;
ButName.gotoAndPlay("off");
_level0.scripts.ColorSwitch(false);
} else {
_level0.SNDbutdown.stop();
_level0.SNDbutup.stop();
_level0.SNDbutup.start();
ButName.butstate = true;
ButName.gotoAndPlay("on");
_level0.scripts.ColorSwitch(true);
}
}
Symbol 84 Button
on (press) {
var ButName = but3;
if (ButName.butstate == true) {
_level0.SNDbutdown.stop();
_level0.SNDbutdown.start();
ButName.butstate = false;
ButName.gotoAndPlay("off");
_level0.bob.MyStrikeTime = _level0.bob.MyStrikeTime - 30;
_level0.sam.MyStrikeTime = _level0.sam.MyStrikeTime - 30;
_level0.lou.MyStrikeTime = _level0.lou.MyStrikeTime - 30;
} else {
_level0.SNDbutdown.stop();
_level0.SNDbutup.stop();
_level0.SNDbutup.start();
ButName.butstate = true;
ButName.gotoAndPlay("on");
_level0.bob.MyStrikeTime = _level0.bob.MyStrikeTime + 30;
_level0.sam.MyStrikeTime = _level0.sam.MyStrikeTime + 30;
_level0.lou.MyStrikeTime = _level0.lou.MyStrikeTime + 30;
}
}
Symbol 85 Button
on (press) {
var ButName = but4;
if (ButName.butstate == true) {
_level0.SNDbutdown.stop();
_level0.SNDbutdown.start();
ButName.butstate = false;
ButName.gotoAndPlay("off");
_level0.bob.myspeed++;
_level0.sam.myspeed++;
_level0.lou.myspeed++;
} else {
_level0.SNDbutdown.stop();
_level0.SNDbutup.stop();
_level0.SNDbutup.start();
ButName.butstate = true;
ButName.gotoAndPlay("on");
_level0.bob.myspeed--;
_level0.sam.myspeed--;
_level0.lou.myspeed--;
}
}
Symbol 86 Button
on (press) {
_level0.SNDslidedown.stop();
_level0.SNDslidedown.start();
var ButName = but5;
ButName.gotoAndPlay("off");
}
on (release, releaseOutside) {
_level0.SNDslidedown.stop();
_level0.SNDslideup.stop();
_level0.SNDslideup.start();
var ButName = but5;
ButName.gotoAndPlay("on");
if (1 < _level0._currentframe) {
_level0.scripts.gameselect();
}
}
Symbol 87 Button
on (press) {
_level0.SNDslidedown.stop();
_level0.SNDslidedown.start();
var ButName = but6;
ButName.gotoAndPlay("off");
}
on (release, releaseOutside) {
_level0.SNDslidedown.stop();
_level0.SNDslideup.stop();
_level0.SNDslideup.start();
var ButName = but6;
ButName.gotoAndPlay("on");
if (_level0.GameStatus == "ON") {
_level0.scripts.startgame();
}
}
Symbol 88 MovieClip [control panel] Frame 1
function resetbuttons() {
}
Instance of Symbol 46 MovieClip "but1" in Symbol 88 MovieClip [control panel] Frame 1
onClipEvent (load) {
_parent.but1.butstate = true;
_parent.but2.butstate = true;
_parent.but3.butstate = true;
_parent.but4.butstate = true;
_parent.but5.butstate = true;
_parent.but6.butstate = true;
}
Symbol 113 MovieClip [scripts] Frame 1
function createMonster(aname, acolor, levelDepth, speed, startingRoom, startingX, startingY, MyStrikeTime) {
_root.attachMovie("MonsterID", aname, levelDepth);
_root[aname].myColor = new Color(_root[aname]);
_root[aname].myColor.setRGB(acolor);
_root[aname].mySpeed = speed;
_root[aname].myX = startingX;
_root[aname].myY = startingY;
_root[aname].myName = aname;
_root[aname]._x = -60;
_root[aname]._y = 0;
_root[aname].myFrameScript = MonsterFrameScript;
_root[aname].myRoom = startingRoom;
_root[aname].MonsterStrike = false;
_root[aname].MyState = "alive";
_root[aname].MonsterStrikeTimer = 0;
_root[aname].MyStrikeTime = MyStrikeTime;
}
function MonsterFrameScript() {
if (_level0[myname].MyState == "alive") {
_level0.CHeckWalls(myname);
if (!_level0[myname].MonsterStrike) {
var pX = _root.man._x;
var pY = _root.man._y;
if (_level0[myname]._x < pX) {
_level0[myname]._x = _level0[myname]._x + _level0[myname].mySpeed;
} else {
_level0[myname]._x = _level0[myname]._x - _level0[myname].mySpeed;
}
if (_level0[myname]._y < pY) {
_level0[myname]._y = _level0[myname]._y + _level0[myname].mySpeed;
} else {
_level0[myname]._y = _level0[myname]._y - _level0[myname].mySpeed;
}
if (_level0[myname].hitTest(_root.man)) {
_level0.SNDattack.start();
var NowpX = _root.man._x;
var NowpY = _root.man._y;
_level0[myname]._x = NowpX + 10;
_level0[myname]._y = NowpY + 26;
_level0[myname].MonsterStrike = true;
_level0[myname].MonsterStrikeTimer = this.MyStrikeTime;
_level0[myname].gotoAndStop("Strike");
}
} else {
_level0[myname].MonsterStrikeTimer = _level0[myname].MonsterStrikeTimer - 1;
if (_level0[myname].MonsterStrikeTimer < 1) {
if (_level0[myname].hitTest(_root.man)) {
_level0.SNDdead.start();
_level0.man._x = _level0[MyName]._x + 3;
_level0.man._y = _level0[MyName]._y + 9;
_root.attachMovie("batID", "bat", 50);
_root.bat._x = _level0.StageWidth / 2;
_root.bat._y = _level0.StageHeight / 2;
_root.chalice.removeMovieClip();
_level0.gamerunning = false;
}
_level0[myname].MonsterStrike = false;
_level0[myname].gotoAndStop("Normal");
}
}
}
}
Symbol 113 MovieClip [scripts] Frame 2
function createKey(aname, acolor, levelDepth, startingRoom, startingX, startingY, gate, aGuardian) {
_root.attachMovie("KeyID", aname, levelDepth);
_root[aname].myX = startingX;
_root[aname].myY = startingY;
_root[aname].myName = aname;
_root[aname]._x = -80;
_root[aname]._y = -80;
_root[aname].myFrameScript = KeyFrameScript;
_root[aname].myRoom = startingRoom;
_root[aname].myGate = gate;
_root[aname].myGuardian = aGuardian;
myColor = new Color(_root[aname]);
myColor.setRGB(acolor);
}
function KeyFrameScript() {
if (_root.man.CurrentObject == myName) {
_level0[MyName]._x = _root.man._x + _root.man.CurrentObjectXOffset;
_level0[MyName]._y = _root.man._y + _root.man.CurrentObjectYOffset;
} else if (_level0[MyName].hitTest(_root.man)) {
_level0.SNDpickup.stop();
_level0.SNDpickup.start();
_root.man.CurrentObject = myName;
_root.man.CurrentObjectXOffset = _level0[MyName]._x - _root.man._x;
_root.man.CurrentObjectYOffset = _level0[MyName]._y - _root.man._y;
}
if (_level0[MyName].hitTest(_level0[_level0[MyName].mygate])) {
if (_level0[_level0[MyName].mygate].myState == "closed") {
_level0[_level0[MyName].mygate].myState = "animating";
_level0[myGate].gotoAndPlay("Open");
}
if (_level0[_level0[MyName].mygate].myState == "open") {
if (_root.man.NextPlayerStep[1] == 1) {
_level0[_level0[MyName].mygate].myState = "animating";
_level0[_level0[MyName].mygate].gotoAndPlay("Close");
}
}
}
}
Symbol 113 MovieClip [scripts] Frame 3
function createArrow(aname, color, levelDepth, startingRoom, startingX, startingY) {
_root.attachMovie("ArrowID", aname, levelDepth);
_root[aname].myX = startingX;
_root[aname].myY = startingY;
_root[aname].myName = aname;
_root[aname]._x = -90;
_root[aname]._y = -90;
_root[aname].myFrameScript = ArrowFrameScript;
_root[aname].myRoom = startingRoom;
}
function ArrowFrameScript() {
if (_root.man.CurrentObject == "arrow") {
this._x = _root.man._x + _root.man.CurrentObjectXOffset;
this._y = _root.man._y + _root.man.CurrentObjectYOffset;
} else if (this.hitTest(_root.man)) {
_level0.SNDpickup.stop();
_level0.SNDpickup.start();
_root.man.CurrentObject = "arrow";
_root.man.CurrentObjectXOffset = this._x - _root.man._x;
_root.man.CurrentObjectYOffset = this._y - _root.man._y;
}
if (this.hitTest(_root.bob)) {
monstername = "bob";
if (_root[monstername].MyState != "dead") {
_level0.SNDkill.stop();
_level0.SNDkill.start();
_root[monstername].MyState = "dead";
_root[monstername].gotoAndStop("Dead");
_root[monstername].MyX = _root[monstername]._X;
_root[monstername].MyY = _root[monstername]._Y;
}
} else if (this.hitTest(_root.sam)) {
monstername = "sam";
if (_root[monstername].MyState != "dead") {
_level0.SNDkill.stop();
_level0.SNDkill.start();
_root[monstername].MyState = "dead";
_root[monstername].gotoAndStop("Dead");
_root[monstername].MyX = _root[monstername]._X;
_root[monstername].MyY = _root[monstername]._Y;
}
} else if (this.hitTest(_root.lou)) {
monstername = "lou";
if (_root[monstername].MyState != "dead") {
_level0.SNDkill.stop();
_level0.SNDkill.start();
_root[monstername].MyState = "dead";
_root[monstername].gotoAndStop("Dead");
_root[monstername].MyX = _root[monstername]._X;
_root[monstername].MyY = _root[monstername]._Y;
}
}
}
Symbol 113 MovieClip [scripts] Frame 4
function createman(aname, levelDepth, speed, startingRoom, startingX, startingY) {
_root.attachMovie("ManID", aname, levelDepth);
_root[aname].mySpeed = speed;
_root[aname].NextPlayerStep = new Array(0, 0);
_root[aname].myX = startingX;
_root[aname].myY = startingY;
_root[aname].myName = aname;
_root[aname]._x = -320;
_root[aname]._y = 320;
_root[aname].CurrentObject = "nada";
_root[aname].CurrentObjectXOffset = 0;
_root[aname].CurrentObjectYOffset = 0;
_root[aname].myRoom = startingRoom;
}
function ManFrameScript() {
}
Symbol 113 MovieClip [scripts] Frame 5
function createGate(aname, color, levelDepth, startingRoom, startingX, startingY, key) {
_root.attachMovie("GateID", aname, levelDepth);
_root[aname].myX = startingX;
_root[aname].myY = startingY;
_root[aname].myName = aname;
_root[aname]._x = -50;
_root[aname]._y = -50;
_root[aname].myFrameScript = GateFrameScript;
_root[aname].myRoom = startingRoom;
_root[aname].myKey = key;
_root[aname].myState = "closed";
}
function GateFrameScript() {
if (_root[myName].myState == "open") {
if (_level0[MyName].hitTest(_level0.man)) {
_root.man._y = _root.StageHeight;
_root.GoRoom(1);
}
}
}
Symbol 113 MovieClip [scripts] Frame 8
function loadroom(roomtoload) {
unloadMovieNum (10);
_root.attachMovie("rm" + roomtoload, "background", 10);
_level0.background._y = 192;
_level0.background._x = 320;
i = 0;
while (i < _root.TheOBjectList.length) {
if (_level0.CurrentRoomNumber == _root[_root.TheOBjectList[i]].myRoom) {
_root[_root.TheOBjectList[i]]._x = _root[_root.TheOBjectList[i]].myX;
_root[_root.TheOBjectList[i]]._y = _root[_root.TheOBjectList[i]].myY;
} else if (_root.TheOBjectList[i] != "background") {
_root[_root.TheOBjectList[i]]._x = -100;
}
i++;
}
if (_root.man.CurrentObject != "nada") {
_root[_root.man.CurrentObject].myRoom = roomtoload;
}
_root.background.MyName = "rm" + roomtoload;
_root.background.myFrameScript = WallFrameScript;
_root.background.myRoom = roomtoload;
}
function WallFrameScript() {
_level0.CHeckWalls("background");
}
_level0.loadroom = loadroom;
_level0.WallFrameScript = WallFrameScript;
Symbol 113 MovieClip [scripts] Frame 9
function createchalice(aname, levelDepth, startingRoom, startingX, startingY, finishingroom, aGuardian) {
_root.attachMovie("ChaliceID", aname, levelDepth);
_root[aname].myX = startingX;
_root[aname].myY = startingY;
_root[aname].myName = aname;
_root[aname]._x = -100;
_root[aname]._y = -100;
_root[aname].myFrameScript = ChaliceFrameScript;
_root[aname].myRoom = startingRoom;
_root[aname].myGuardian = aGuardian;
_root[aname].chaliceanimationcounter = 0;
}
function ChaliceFrameScript() {
if (_root.man.CurrentObject == myName) {
_level0[MyName]._x = _root.man._x + _root.man.CurrentObjectXOffset;
_level0[MyName]._y = _root.man._y + _root.man.CurrentObjectYOffset;
} else if (_level0[MyName].hitTest(_root.man)) {
_level0.SNDpickup.stop();
_level0.SNDpickup.start();
_root.man.CurrentObject = myName;
_root.man.CurrentObjectXOffset = _level0[MyName]._x - _root.man._x;
_root.man.CurrentObjectYOffset = _level0[MyName]._y - _root.man._y;
}
if (_level0.CurrentRoomNumber == 2) {
_root[MyName].chaliceanimationcounter++;
if ((_root[MyName].chaliceanimationcounter = 10)) {
_level0.SNDwin.start();
_level0.gamerunning = false;
unloadMovieNum (10);
_root.attachMovie("rmwin", "background", 10);
_level0.background._y = 192;
_level0.background._x = 320;
}
}
}
Symbol 113 MovieClip [scripts] Frame 10
function createMagent(aname, acolor, levelDepth, startingRoom, startingX, startingY, ActractionList, attractionspeed) {
_root.attachMovie("MagnetID", aname, levelDepth);
_root[aname].myX = startingX;
_root[aname].myY = startingY;
_root[aname].myName = aname;
_root[aname]._x = -80;
_root[aname]._y = -80;
_root[aname].myFrameScript = MagnetFrameScript;
_root[aname].myRoom = startingRoom;
_root[aname].myActractionList = ActractionList;
_root[aname].mySpeed = attractionspeed;
}
function MagnetFrameScript() {
if (_root.man.CurrentObject == myName) {
_level0[MyName]._x = _root.man._x + _root.man.CurrentObjectXOffset;
_level0[MyName]._y = _root.man._y + _root.man.CurrentObjectYOffset;
} else if (_level0[MyName].hitTest(_root.man)) {
_level0.SNDpickup.stop();
_level0.SNDpickup.start();
_root.man.CurrentObject = myName;
_root.man.CurrentObjectXOffset = _level0[MyName]._x - _root.man._x;
_root.man.CurrentObjectYOffset = _level0[MyName]._y - _root.man._y;
}
end = _level0[myName].myActractionList[i].length;
i = 0;
while (i < end) {
var ObjectToAttract = _level0[_level0[myName].myActractionList[i]];
if (_level0.CurrentRoomNumber == _level0[_level0[myName].myActractionList[i]].myRoom) {
if (_level0[MyName].hitTest(_level0[_level0[myName].myActractionList[i]])) {
_level0[_level0[myName].myActractionList[i]].myX = _level0[_level0[myName].myActractionList[i]]._x;
_level0[_level0[myName].myActractionList[i]].myY = _level0[_level0[myName].myActractionList[i]]._y;
} else {
var pX = _level0[_level0[myName].myActractionList[i]]._x;
var pY = (_level0[_level0[myName].myActractionList[i]]._y - 20);
if (_level0[myname]._x < pX) {
_level0[_level0[myName].myActractionList[i]]._x = _level0[_level0[myName].myActractionList[i]]._x - _level0[myname].mySpeed;
} else {
ObjectToAttract._x = ObjectToAttract._x + _level0[myname].mySpeed;
}
if (_level0[myname]._y < pY) {
ObjectToAttract._y = ObjectToAttract._y - _level0[myname].mySpeed;
} else {
ObjectToAttract._y = ObjectToAttract._y + _level0[myname].mySpeed;
}
return;
}
}
i++;
}
}
Symbol 113 MovieClip [scripts] Frame 12
function test() {
}
function intializemovie() {
initializesounds();
i = 0;
while (i < _root.TheOBjectList.length) {
_root[TheOBjectList[i]].removeMovieClip();
i++;
}
_root.man.removeMovieClip();
_root.background.removeMovieClip();
_root.bat.removeMovieClip();
_root.weblink.removeMovieClip();
_level0.TheOBjectList = new Array();
_level0.GameStatus = "ON";
_level0.StageWidth = 640;
_level0.StageHeight = 384;
_level0.CurrentRoomNumber = 1;
_level0.RoomMap = new array(new array(0, 2, 0, 3), new array(0, 0, 0, 1), new array(6, 1, 4, 0), new array(3, 13, 0, 5), new array(0, 4, 0, 0), new array(0, 7, 3, 0), new array(8, 9, 8, 6), new array(7, 10, 7, 13), new array(10, 0, 13, 7), new array(9, 11, 9, 8), new array(0, 12, 0, 10), new array(0, 14, 0, 11), new array(9, 16, 15, 4), new array(0, 0, 0, 12), new array(13, 11, 10, 16), new array(7, 15, 7, 13));
loadroom(14);
_level0.CurrentRoomNumber = 14;
_level0.TheOBjectList.push("background");
createman("man", 5, 4, 1, 320, 320);
createMonster("bob", 16767056, 12, 2, 6, 220, 256, 80);
_level0.TheOBjectList.push("bob");
createMonster("sam", 8443936, 16, 3, 5, 200, 200, 70);
_level0.TheOBjectList.push("sam");
createMonster("lou", 13631488, 19, 4, 14, 200, 200, 60);
_level0.TheOBjectList.push("lou");
createArrow("arrow", 16767056, 13, 2, 500, 100);
_level0.TheOBjectList.push("arrow");
createKey("yellowkey", 16767056, 17, 6, 160, 280, "yellowgate", "bob");
_level0.TheOBjectList.push("yellowkey");
createKey("blackkey", 0, 14, 5, 250, 300, "blackGate", "sam");
_level0.TheOBjectList.push("blackkey");
createGate("yellowgate", 16767056, 8, 1, 320, 256, "yellowkey");
_level0.TheOBjectList.push("yellowgate");
createGate("blackgate", 0, 9, 11, 320, 256, "blackkey");
_level0.TheOBjectList.push("blackgate");
createchalice("chalice", 18, 14, 200, 200, 2, "lou");
_level0.TheOBjectList.push("chalice");
createMagent("magnet", acolor, 20, 3, 500, 250, new Array("chalice", "blackkey", "yellowkey", "arrow"), 2);
_level0.TheOBjectList.push("magnet");
_level0.KeyDownHandler = KeyDownHandler;
_level0.KeyUpHandler = keyUpHandler;
_level0.CHeckWalls = CHeckWalls;
_level0.GoRoom = GoRoom;
_root.attachMovie("weblinkID", "weblink", 30);
_root.weblink._X = 584;
_root.weblink._Y = 484;
}
function startgame() {
if (_level0.keylock == "bonzi") {
intializemovie();
_level0.gamerunning = true;
_level0.CurrentRoomNumber = 1;
loadroom(1);
_level0.gotoAndPlay("main");
_root.man._x = 320;
}
}
function GoRoom(dir) {
i = 0;
while (i < _root.TheOBjectList.length) {
if (_level0.CurrentRoomNumber == _root[_root.TheOBjectList[i]].myRoom) {
_root[_root.TheOBjectList[i]].myX = _root[_root.TheOBjectList[i]]._X;
_root[_root.TheOBjectList[i]].myY = _root[_root.TheOBjectList[i]]._y;
}
i++;
}
i = 0;
while (i < _root.TheOBjectList.length) {
_root[_root.TheOBjectList[i]].MonsterStrike = false;
if (_root[_root.TheOBjectList[i]].myState == "alive") {
_root[_root.TheOBjectList[i]].gotoAndStop("Normal");
}
i++;
}
if (((_level0.CurrentRoomNumber == 2) or (_level0.CurrentRoomNumber == 12)) and (dir == 3)) {
_level0.man._y = 256;
_level0.man._x = 320;
}
if (_root.man.CurrentObject == "nada") {
i = 0;
while (i < _root.TheOBjectList.length) {
if (_level0.CurrentRoomNumber == _root[_root.TheOBjectList[i]].myRoom) {
if (_root[_root[_root.TheOBjectList[i]].myguardian].mystate == "alive") {
_root[_root[_root.TheOBjectList[i]].myguardian].myX = _root[_root.TheOBjectList[i]]._X;
_root[_root[_root.TheOBjectList[i]].myguardian].myY = _root[_root.TheOBjectList[i]]._Y;
}
}
i++;
}
}
NextRoom = _root.RoomMap[CurrentRoomNumber - 1][dir];
_level0.CurrentRoomNumber = NextRoom;
if (_root.man.CurrentObject != "nada") {
if ((_root[_root[_root.man.CurrentObject].myguardian].mystate == "alive") and (NextRoom != 2)) {
_root[_root[_root.man.CurrentObject].myguardian].myroom = NextRoom;
if (dir == 0) {
var i;
i = _root[_root[_root.man.CurrentObject].myguardian]._x;
i = i + _level0.StageWidth;
_root[_root[_root.man.CurrentObject].myguardian]._x = i;
_root[_root[_root.man.CurrentObject].myguardian].myX = i;
_root[_root[_root.man.CurrentObject].myguardian].myY = _root[_root[_root.man.CurrentObject].myguardian]._y;
}
if (dir == 2) {
var i;
i = _root[_root[_root.man.CurrentObject].myguardian]._x;
i = i - _level0.StageWidth;
_root[_root[_root.man.CurrentObject].myguardian]._x = i;
_root[_root[_root.man.CurrentObject].myguardian].myX = i;
_root[_root[_root.man.CurrentObject].myguardian].myY = _root[_root[_root.man.CurrentObject].myguardian]._y;
}
if (dir == 1) {
var i;
i = _root[_root[_root.man.CurrentObject].myguardian]._y;
i = i + _level0.StageHeight;
_root[_root[_root.man.CurrentObject].myguardian]._y = i;
_root[_root[_root.man.CurrentObject].myguardian].myY = i;
_root[_root[_root.man.CurrentObject].myguardian].myX = _root[_root[_root.man.CurrentObject].myguardian]._x;
}
if (dir == 3) {
var i;
i = _root[_root[_root.man.CurrentObject].myguardian]._y;
i = i - _level0.StageHeight;
_root[_root[_root.man.CurrentObject].myguardian]._y = i;
_root[_root[_root.man.CurrentObject].myguardian].myY = i;
_root[_root[_root.man.CurrentObject].myguardian].myX = _root[_root[_root.man.CurrentObject].myguardian]._x;
}
}
}
loadroom(NextRoom);
if (_level0.color == false) {
_level0.scripts.ColorSwitch(false);
}
}
function KeyDownHandler() {
thekey = Key.getCode();
if (Key.isDown(37)) {
_root.GoLeft = true;
_root.man.NextPlayerStep[0] = -1;
}
if (Key.isDown(38)) {
_root.GoUp = true;
_root.man.NextPlayerStep[1] = -1;
}
if (Key.isDown(39)) {
_root.GoRight = true;
_root.man.NextPlayerStep[0] = 1;
}
if (Key.isDown(40)) {
_root.GoDown = true;
_root.man.NextPlayerStep[1] = 1;
}
if (Key.isDown(Key.SPACE)) {
if (_root.man.CurrentObject == "arrow") {
_level0.SNDdrop.start();
TheObject = "arrow";
_root[TheObject]._x = _root.man._x + (_root.man.CurrentObjectXOffset * 2);
_root[TheObject]._y = _root.man._y + (_root.man.CurrentObjectYOffset * 2);
_root[_root.man.CurrentObject].MyX = _root[TheObject]._x;
_root[_root.man.CurrentObject].MyY = _root[TheObject]._y;
_root.man.CurrentObject = "nada";
}
if (_root.man.CurrentObject == "yellowkey") {
_level0.SNDdrop.start();
TheObject = "yellowkey";
_root[TheObject]._x = _root.man._x + (_root.man.CurrentObjectXOffset * 2);
_root[TheObject]._y = _root.man._y + (_root.man.CurrentObjectYOffset * 2);
_root[_root.man.CurrentObject].MyX = _root[TheObject]._x;
_root[_root.man.CurrentObject].MyY = _root[TheObject]._y;
_root.man.CurrentObject = "nada";
}
if (_root.man.CurrentObject == "blackkey") {
_level0.SNDdrop.start();
TheObject = "blackkey";
_root[TheObject]._x = _root.man._x + (_root.man.CurrentObjectXOffset * 2);
_root[TheObject]._y = _root.man._y + (_root.man.CurrentObjectYOffset * 2);
_root[_root.man.CurrentObject].MyX = _root[TheObject]._x;
_root[_root.man.CurrentObject].MyY = _root[TheObject]._y;
_root.man.CurrentObject = "nada";
}
if (_root.man.CurrentObject == "chalice") {
_level0.SNDdrop.start();
TheObject = "chalice";
_root[TheObject]._x = _root.man._x + (_root.man.CurrentObjectXOffset * 2);
_root[TheObject]._y = _root.man._y + (_root.man.CurrentObjectYOffset * 2);
_root[_root.man.CurrentObject].MyX = _root[TheObject]._x;
_root[_root.man.CurrentObject].MyY = _root[TheObject]._y;
_root.man.CurrentObject = "nada";
}
if (_root.man.CurrentObject == "magnet") {
_level0.SNDdrop.start();
TheObject = "magnet";
_root[TheObject]._x = _root.man._x + (_root.man.CurrentObjectXOffset * 2);
_root[TheObject]._y = _root.man._y + (_root.man.CurrentObjectYOffset * 2);
_root[_root.man.CurrentObject].MyX = _root[TheObject]._x;
_root[_root.man.CurrentObject].MyY = _root[TheObject]._y;
_root.man.CurrentObject = "nada";
}
}
}
function KeyUpHandler() {
thekey = Key.getCode();
if (thekey == 37) {
_root.GoLeft = false;
if (!_root.GoRight) {
_root.man.NextPlayerStep[0] = 0;
}
}
if (thekey == 38) {
_root.GoUp = false;
if (!_root.GoDown) {
_root.man.NextPlayerStep[1] = 0;
}
}
if (thekey == 39) {
_root.GoRight = false;
if (!_root.GoLeft) {
_root.man.NextPlayerStep[0] = 0;
}
}
if (thekey == 40) {
_root.GoDown = false;
if (!_root.GoUp) {
_root.man.NextPlayerStep[1] = 0;
}
}
}
function CHeckWalls(me) {
var NowpX = _root.man._x;
var NowpY = _root.man._y;
var NextpX = _root.man._x;
var NextpY = _root.man._y;
NextpX = NextpX + (_root.man.NextPlayerStep[0] * _root.man.mySpeed);
NextpY = NextpY + (_root.man.NextPlayerStep[1] * _root.man.mySpeed);
var pw = (_root.man._width / 2);
var ph = (_root.man._height / 2);
if (_root.GoRight) {
if (_level0[me].hitTest(NextpX + pw, (NowpY - ph) + 1, true) || (_level0[me].hitTest(NextpX + pw, (NowpY + ph) - 1, true))) {
_root.man.NextPlayerStep[0] = 0;
}
} else if (_root.GoLeft) {
if (_level0[me].hitTest(NextpX - pw, (NowpY - ph) + 1, true) || (_level0[me].hitTest(NextpX - pw, (NowpY + ph) - 1, true))) {
_root.man.NextPlayerStep[0] = 0;
}
}
if (_root.GoDown) {
if (_level0[me].hitTest((NowpX - pw) + 1, NextpY + ph, true) || (_level0[me].hitTest((NowpX + pw) - 1, NextpY + ph, true))) {
_root.man.NextPlayerStep[1] = 0;
}
} else if (_root.GoUp) {
if (_level0[me].hitTest((NowpX - pw) + 1, NextpY - ph, true) || (_level0[me].hitTest((NowpX + pw) - 1, NextpY - ph, true))) {
_root.man.NextPlayerStep[1] = 0;
}
}
}
function gameOFF() {
_level0.gamerunning = false;
_level0.gotoandplay("GameOFF");
i = 0;
while (i < _root.TheOBjectList.length) {
_root[TheOBjectList[i]].removeMovieClip();
i++;
}
_root.man.removeMovieClip();
_root.background.removeMovieClip();
_root.bat.removeMovieClip();
_root.TheOBjectList = 0;
_level0.GameStatus = "OFF";
_level0.SNDnoise.start(0, 999);
}
function gameON() {
_level0.color = true;
_level0.gotoandplay("GameON");
_level0.SNDnoise.stop();
}
function gameselect() {
_level0.gamerunning = false;
_level0.gotoandplay("GameON");
intializemovie();
}
function ColorSwitch(state) {
_level0.color = state;
if (state == true) {
unloadMovieNum (10);
_root.attachMovie("rm" + _level0.CurrentRoomNumber, "background", 10);
_level0.background._y = 192;
_level0.background._x = 320;
} else {
myColor = new Color(_root.background);
myColor.setRGB(0);
}
}
function initializesounds() {
soundlist = new array("SNDnoise", "SNDattack", "SNDbutdown", "SNDbutup", "SNDdead", "SNDdead", "SNDdrop", "SNDpickup", "SNDslidedown", "SNDslideup", "SNDwin", "SNDkill");
i = 0;
while (i < soundlist.length) {
_level0[soundlist[i]] = new Sound();
_level0[soundlist[i]].attachSound(soundlist[i]);
i++;
}
}
loadVariablesNum ("keylock/keylock.txt", 0);
intializemovie();
_level0.startgame = startgame;
_level0.intializemovie = intializemovie;
_level0.gameON = gameON;
_level0.gameOFF = gameOFF;
_level0.scripts = this;
stop();
Symbol 119 MovieClip [MonsterID] Frame 1
stop();
Symbol 125 MovieClip [ChaliceID] Frame 1
Symbol 126 MovieClip [ChaliceID] Frame 1
Symbol 130 MovieClip [batID] Frame 268
gotoAndPlay (1);
Instance of Symbol 134 MovieClip in Symbol 135 MovieClip [weblinkID] Frame 1
onClipEvent (keyDown) {
fscommand ("hyperlink", "scottpehnke");
}
Symbol 136 MovieClip [scripts] Frame 1
function createMonster(aname, acolor, levelDepth, speed, startingRoom, startingX, startingY, MyStrikeTime) {
_root.attachMovie("MonsterID", aname, levelDepth);
_root[aname].myColor = new Color(_root[aname]);
_root[aname].myColor.setRGB(acolor);
_root[aname].mySpeed = speed;
_root[aname].myX = startingX;
_root[aname].myY = startingY;
_root[aname].myName = aname;
_root[aname]._x = -60;
_root[aname]._y = 0;
_root[aname].myFrameScript = MonsterFrameScript;
_root[aname].myRoom = startingRoom;
_root[aname].MonsterStrike = false;
_root[aname].MyState = "alive";
_root[aname].MonsterStrikeTimer = 0;
_root[aname].MyStrikeTime = MyStrikeTime;
}
function MonsterFrameScript() {
if (_level0[myname].MyState == "alive") {
_level0.CHeckWalls(myname);
if (!_level0[myname].MonsterStrike) {
var pX = _root.man._x;
var pY = _root.man._y;
if (_level0[myname]._x < pX) {
_level0[myname]._x = _level0[myname]._x + _level0[myname].mySpeed;
} else {
_level0[myname]._x = _level0[myname]._x - _level0[myname].mySpeed;
}
if (_level0[myname]._y < pY) {
_level0[myname]._y = _level0[myname]._y + _level0[myname].mySpeed;
} else {
_level0[myname]._y = _level0[myname]._y - _level0[myname].mySpeed;
}
if (_level0[myname].hitTest(_root.man)) {
_level0.SNDattack.start();
var NowpX = _root.man._x;
var NowpY = _root.man._y;
_level0[myname]._x = NowpX + 10;
_level0[myname]._y = NowpY + 26;
_level0[myname].MonsterStrike = true;
_level0[myname].MonsterStrikeTimer = this.MyStrikeTime;
_level0[myname].gotoAndStop("Strike");
}
} else {
_level0[myname].MonsterStrikeTimer = _level0[myname].MonsterStrikeTimer - 1;
if (_level0[myname].MonsterStrikeTimer < 1) {
if (_level0[myname].hitTest(_root.man)) {
_level0.SNDdead.start();
_level0.man._x = _level0[MyName]._x + 3;
_level0.man._y = _level0[MyName]._y + 9;
_root.attachMovie("batID", "bat", 50);
_root.bat._x = _level0.StageWidth / 2;
_root.bat._y = _level0.StageHeight / 2;
_root.chalice.removeMovieClip();
_level0.gamerunning = false;
}
_level0[myname].MonsterStrike = false;
_level0[myname].gotoAndStop("Normal");
}
}
}
}
Symbol 136 MovieClip [scripts] Frame 2
function createKey(aname, acolor, levelDepth, startingRoom, startingX, startingY, gate, aGuardian) {
_root.attachMovie("KeyID", aname, levelDepth);
_root[aname].myX = startingX;
_root[aname].myY = startingY;
_root[aname].myName = aname;
_root[aname]._x = -80;
_root[aname]._y = -80;
_root[aname].myFrameScript = KeyFrameScript;
_root[aname].myRoom = startingRoom;
_root[aname].myGate = gate;
_root[aname].myGuardian = aGuardian;
myColor = new Color(_root[aname]);
myColor.setRGB(acolor);
}
function KeyFrameScript() {
if (_root.man.CurrentObject == myName) {
_level0[MyName]._x = _root.man._x + _root.man.CurrentObjectXOffset;
_level0[MyName]._y = _root.man._y + _root.man.CurrentObjectYOffset;
} else if (_level0[MyName].hitTest(_root.man)) {
_level0.SNDpickup.stop();
_level0.SNDpickup.start();
_root.man.CurrentObject = myName;
_root.man.CurrentObjectXOffset = _level0[MyName]._x - _root.man._x;
_root.man.CurrentObjectYOffset = _level0[MyName]._y - _root.man._y;
}
if (_level0[MyName].hitTest(_level0[_level0[MyName].mygate])) {
if (_level0[_level0[MyName].mygate].myState == "closed") {
_level0[_level0[MyName].mygate].myState = "animating";
_level0[myGate].gotoAndPlay("Open");
}
if (_level0[_level0[MyName].mygate].myState == "open") {
if (_root.man.NextPlayerStep[1] == 1) {
_level0[_level0[MyName].mygate].myState = "animating";
_level0[_level0[MyName].mygate].gotoAndPlay("Close");
}
}
}
}
Symbol 136 MovieClip [scripts] Frame 3
function createArrow(aname, color, levelDepth, startingRoom, startingX, startingY) {
_root.attachMovie("ArrowID", aname, levelDepth);
_root[aname].myX = startingX;
_root[aname].myY = startingY;
_root[aname].myName = aname;
_root[aname]._x = -90;
_root[aname]._y = -90;
_root[aname].myFrameScript = ArrowFrameScript;
_root[aname].myRoom = startingRoom;
}
function ArrowFrameScript() {
if (_root.man.CurrentObject == "arrow") {
this._x = _root.man._x + _root.man.CurrentObjectXOffset;
this._y = _root.man._y + _root.man.CurrentObjectYOffset;
} else if (this.hitTest(_root.man)) {
_level0.SNDpickup.stop();
_level0.SNDpickup.start();
_root.man.CurrentObject = "arrow";
_root.man.CurrentObjectXOffset = this._x - _root.man._x;
_root.man.CurrentObjectYOffset = this._y - _root.man._y;
}
if (this.hitTest(_root.bob)) {
monstername = "bob";
if (_root[monstername].MyState != "dead") {
_level0.SNDkill.stop();
_level0.SNDkill.start();
_root[monstername].MyState = "dead";
_root[monstername].gotoAndStop("Dead");
_root[monstername].MyX = _root[monstername]._X;
_root[monstername].MyY = _root[monstername]._Y;
}
} else if (this.hitTest(_root.sam)) {
monstername = "sam";
if (_root[monstername].MyState != "dead") {
_level0.SNDkill.stop();
_level0.SNDkill.start();
_root[monstername].MyState = "dead";
_root[monstername].gotoAndStop("Dead");
_root[monstername].MyX = _root[monstername]._X;
_root[monstername].MyY = _root[monstername]._Y;
}
} else if (this.hitTest(_root.lou)) {
monstername = "lou";
if (_root[monstername].MyState != "dead") {
_level0.SNDkill.stop();
_level0.SNDkill.start();
_root[monstername].MyState = "dead";
_root[monstername].gotoAndStop("Dead");
_root[monstername].MyX = _root[monstername]._X;
_root[monstername].MyY = _root[monstername]._Y;
}
}
}
Symbol 136 MovieClip [scripts] Frame 4
function createman(aname, levelDepth, speed, startingRoom, startingX, startingY) {
_root.attachMovie("ManID", aname, levelDepth);
_root[aname].mySpeed = speed;
_root[aname].NextPlayerStep = new Array(0, 0);
_root[aname].myX = startingX;
_root[aname].myY = startingY;
_root[aname].myName = aname;
_root[aname]._x = -320;
_root[aname]._y = 320;
_root[aname].CurrentObject = "nada";
_root[aname].CurrentObjectXOffset = 0;
_root[aname].CurrentObjectYOffset = 0;
_root[aname].myRoom = startingRoom;
}
function ManFrameScript() {
}
Symbol 136 MovieClip [scripts] Frame 5
function createGate(aname, color, levelDepth, startingRoom, startingX, startingY, key) {
_root.attachMovie("GateID", aname, levelDepth);
_root[aname].myX = startingX;
_root[aname].myY = startingY;
_root[aname].myName = aname;
_root[aname]._x = -50;
_root[aname]._y = -50;
_root[aname].myFrameScript = GateFrameScript;
_root[aname].myRoom = startingRoom;
_root[aname].myKey = key;
_root[aname].myState = "closed";
}
function GateFrameScript() {
if (_root[myName].myState == "open") {
if (_level0[MyName].hitTest(_level0.man)) {
_root.man._y = _root.StageHeight;
_root.GoRoom(1);
}
}
}
Symbol 136 MovieClip [scripts] Frame 8
function loadroom(roomtoload) {
unloadMovieNum (10);
_root.attachMovie("rm" + roomtoload, "background", 10);
_level0.background._y = 192;
_level0.background._x = 320;
i = 0;
while (i < _root.TheOBjectList.length) {
if (_level0.CurrentRoomNumber == _root[_root.TheOBjectList[i]].myRoom) {
_root[_root.TheOBjectList[i]]._x = _root[_root.TheOBjectList[i]].myX;
_root[_root.TheOBjectList[i]]._y = _root[_root.TheOBjectList[i]].myY;
} else if (_root.TheOBjectList[i] != "background") {
_root[_root.TheOBjectList[i]]._x = -100;
}
i++;
}
if (_root.man.CurrentObject != "nada") {
_root[_root.man.CurrentObject].myRoom = roomtoload;
}
_root.background.MyName = "rm" + roomtoload;
_root.background.myFrameScript = WallFrameScript;
_root.background.myRoom = roomtoload;
}
function WallFrameScript() {
_level0.CHeckWalls("background");
}
_level0.loadroom = loadroom;
_level0.WallFrameScript = WallFrameScript;
Symbol 136 MovieClip [scripts] Frame 9
function createchalice(aname, levelDepth, startingRoom, startingX, startingY, finishingroom, aGuardian) {
_root.attachMovie("ChaliceID", aname, levelDepth);
_root[aname].myX = startingX;
_root[aname].myY = startingY;
_root[aname].myName = aname;
_root[aname]._x = -100;
_root[aname]._y = -100;
_root[aname].myFrameScript = ChaliceFrameScript;
_root[aname].myRoom = startingRoom;
_root[aname].myGuardian = aGuardian;
_root[aname].chaliceanimationcounter = 0;
}
function ChaliceFrameScript() {
if (_root.man.CurrentObject == myName) {
_level0[MyName]._x = _root.man._x + _root.man.CurrentObjectXOffset;
_level0[MyName]._y = _root.man._y + _root.man.CurrentObjectYOffset;
} else if (_level0[MyName].hitTest(_root.man)) {
_level0.SNDpickup.stop();
_level0.SNDpickup.start();
_root.man.CurrentObject = myName;
_root.man.CurrentObjectXOffset = _level0[MyName]._x - _root.man._x;
_root.man.CurrentObjectYOffset = _level0[MyName]._y - _root.man._y;
}
if (_level0.CurrentRoomNumber == 2) {
_root[MyName].chaliceanimationcounter++;
if ((_root[MyName].chaliceanimationcounter = 10)) {
_level0.SNDwin.start();
_level0.gamerunning = false;
unloadMovieNum (10);
_root.attachMovie("rmwin", "background", 10);
_level0.background._y = 192;
_level0.background._x = 320;
}
}
}
Symbol 136 MovieClip [scripts] Frame 10
function createMagent(aname, acolor, levelDepth, startingRoom, startingX, startingY, ActractionList, attractionspeed) {
_root.attachMovie("MagnetID", aname, levelDepth);
_root[aname].myX = startingX;
_root[aname].myY = startingY;
_root[aname].myName = aname;
_root[aname]._x = -80;
_root[aname]._y = -80;
_root[aname].myFrameScript = MagnetFrameScript;
_root[aname].myRoom = startingRoom;
_root[aname].myActractionList = ActractionList;
_root[aname].mySpeed = attractionspeed;
}
function MagnetFrameScript() {
if (_root.man.CurrentObject == myName) {
_level0[MyName]._x = _root.man._x + _root.man.CurrentObjectXOffset;
_level0[MyName]._y = _root.man._y + _root.man.CurrentObjectYOffset;
} else if (_level0[MyName].hitTest(_root.man)) {
_level0.SNDpickup.stop();
_level0.SNDpickup.start();
_root.man.CurrentObject = myName;
_root.man.CurrentObjectXOffset = _level0[MyName]._x - _root.man._x;
_root.man.CurrentObjectYOffset = _level0[MyName]._y - _root.man._y;
}
end = _level0[myName].myActractionList[i].length;
i = 0;
while (i < end) {
var ObjectToAttract = _level0[_level0[myName].myActractionList[i]];
if (_level0.CurrentRoomNumber == _level0[_level0[myName].myActractionList[i]].myRoom) {
if (_level0[MyName].hitTest(_level0[_level0[myName].myActractionList[i]])) {
_level0[_level0[myName].myActractionList[i]].myX = _level0[_level0[myName].myActractionList[i]]._x;
_level0[_level0[myName].myActractionList[i]].myY = _level0[_level0[myName].myActractionList[i]]._y;
} else {
var pX = _level0[_level0[myName].myActractionList[i]]._x;
var pY = (_level0[_level0[myName].myActractionList[i]]._y - 20);
if (_level0[myname]._x < pX) {
_level0[_level0[myName].myActractionList[i]]._x = _level0[_level0[myName].myActractionList[i]]._x - _level0[myname].mySpeed;
} else {
ObjectToAttract._x = ObjectToAttract._x + _level0[myname].mySpeed;
}
if (_level0[myname]._y < pY) {
ObjectToAttract._y = ObjectToAttract._y - _level0[myname].mySpeed;
} else {
ObjectToAttract._y = ObjectToAttract._y + _level0[myname].mySpeed;
}
return;
}
}
i++;
}
}
Symbol 136 MovieClip [scripts] Frame 12
function test() {
}
function intializemovie() {
initializesounds();
i = 0;
while (i < _root.TheOBjectList.length) {
_root[TheOBjectList[i]].removeMovieClip();
i++;
}
_root.man.removeMovieClip();
_root.background.removeMovieClip();
_root.bat.removeMovieClip();
_root.weblink.removeMovieClip();
_level0.TheOBjectList = new Array();
_level0.GameStatus = "ON";
_level0.StageWidth = 640;
_level0.StageHeight = 384;
_level0.CurrentRoomNumber = 1;
_level0.RoomMap = new array(new array(0, 2, 0, 3), new array(0, 0, 0, 1), new array(6, 1, 4, 0), new array(3, 13, 0, 5), new array(0, 4, 0, 0), new array(0, 7, 3, 0), new array(8, 9, 8, 6), new array(7, 10, 7, 13), new array(10, 0, 13, 7), new array(9, 11, 9, 8), new array(0, 12, 0, 10), new array(0, 14, 0, 11), new array(9, 16, 15, 4), new array(0, 0, 0, 12), new array(13, 11, 10, 16), new array(7, 15, 7, 13));
loadroom(14);
_level0.CurrentRoomNumber = 14;
_level0.TheOBjectList.push("background");
createman("man", 5, 4, 1, 320, 320);
createMonster("bob", 16767056, 12, 2, 6, 220, 256, 80);
_level0.TheOBjectList.push("bob");
createMonster("sam", 8443936, 16, 3, 5, 200, 200, 70);
_level0.TheOBjectList.push("sam");
createMonster("lou", 13631488, 19, 4, 14, 200, 200, 60);
_level0.TheOBjectList.push("lou");
createArrow("arrow", 16767056, 13, 2, 500, 100);
_level0.TheOBjectList.push("arrow");
createKey("yellowkey", 16767056, 17, 6, 160, 280, "yellowgate", "bob");
_level0.TheOBjectList.push("yellowkey");
createKey("blackkey", 0, 14, 5, 250, 300, "blackGate", "sam");
_level0.TheOBjectList.push("blackkey");
createGate("yellowgate", 16767056, 8, 1, 320, 256, "yellowkey");
_level0.TheOBjectList.push("yellowgate");
createGate("blackgate", 0, 9, 11, 320, 256, "blackkey");
_level0.TheOBjectList.push("blackgate");
createchalice("chalice", 18, 14, 200, 200, 2, "lou");
_level0.TheOBjectList.push("chalice");
createMagent("magnet", acolor, 20, 3, 500, 250, new Array("chalice", "blackkey", "yellowkey", "arrow"), 2);
_level0.TheOBjectList.push("magnet");
_level0.KeyDownHandler = KeyDownHandler;
_level0.KeyUpHandler = keyUpHandler;
_level0.CHeckWalls = CHeckWalls;
_level0.GoRoom = GoRoom;
_root.attachMovie("weblinkID", "weblink", 30);
_root.weblink._X = 584;
_root.weblink._Y = 484;
}
function startgame() {
if (_level0.keylock == "bonzi") {
intializemovie();
_level0.gamerunning = true;
_level0.CurrentRoomNumber = 1;
loadroom(1);
_level0.gotoAndPlay("main");
_root.man._x = 320;
}
}
function GoRoom(dir) {
i = 0;
while (i < _root.TheOBjectList.length) {
if (_level0.CurrentRoomNumber == _root[_root.TheOBjectList[i]].myRoom) {
_root[_root.TheOBjectList[i]].myX = _root[_root.TheOBjectList[i]]._X;
_root[_root.TheOBjectList[i]].myY = _root[_root.TheOBjectList[i]]._y;
}
i++;
}
i = 0;
while (i < _root.TheOBjectList.length) {
_root[_root.TheOBjectList[i]].MonsterStrike = false;
if (_root[_root.TheOBjectList[i]].myState == "alive") {
_root[_root.TheOBjectList[i]].gotoAndStop("Normal");
}
i++;
}
if (((_level0.CurrentRoomNumber == 2) or (_level0.CurrentRoomNumber == 12)) and (dir == 3)) {
_level0.man._y = 256;
_level0.man._x = 320;
}
if (_root.man.CurrentObject == "nada") {
i = 0;
while (i < _root.TheOBjectList.length) {
if (_level0.CurrentRoomNumber == _root[_root.TheOBjectList[i]].myRoom) {
if (_root[_root[_root.TheOBjectList[i]].myguardian].mystate == "alive") {
_root[_root[_root.TheOBjectList[i]].myguardian].myX = _root[_root.TheOBjectList[i]]._X;
_root[_root[_root.TheOBjectList[i]].myguardian].myY = _root[_root.TheOBjectList[i]]._Y;
}
}
i++;
}
}
NextRoom = _root.RoomMap[CurrentRoomNumber - 1][dir];
_level0.CurrentRoomNumber = NextRoom;
if (_root.man.CurrentObject != "nada") {
if ((_root[_root[_root.man.CurrentObject].myguardian].mystate == "alive") and (NextRoom != 2)) {
_root[_root[_root.man.CurrentObject].myguardian].myroom = NextRoom;
if (dir == 0) {
var i;
i = _root[_root[_root.man.CurrentObject].myguardian]._x;
i = i + _level0.StageWidth;
_root[_root[_root.man.CurrentObject].myguardian]._x = i;
_root[_root[_root.man.CurrentObject].myguardian].myX = i;
_root[_root[_root.man.CurrentObject].myguardian].myY = _root[_root[_root.man.CurrentObject].myguardian]._y;
}
if (dir == 2) {
var i;
i = _root[_root[_root.man.CurrentObject].myguardian]._x;
i = i - _level0.StageWidth;
_root[_root[_root.man.CurrentObject].myguardian]._x = i;
_root[_root[_root.man.CurrentObject].myguardian].myX = i;
_root[_root[_root.man.CurrentObject].myguardian].myY = _root[_root[_root.man.CurrentObject].myguardian]._y;
}
if (dir == 1) {
var i;
i = _root[_root[_root.man.CurrentObject].myguardian]._y;
i = i + _level0.StageHeight;
_root[_root[_root.man.CurrentObject].myguardian]._y = i;
_root[_root[_root.man.CurrentObject].myguardian].myY = i;
_root[_root[_root.man.CurrentObject].myguardian].myX = _root[_root[_root.man.CurrentObject].myguardian]._x;
}
if (dir == 3) {
var i;
i = _root[_root[_root.man.CurrentObject].myguardian]._y;
i = i - _level0.StageHeight;
_root[_root[_root.man.CurrentObject].myguardian]._y = i;
_root[_root[_root.man.CurrentObject].myguardian].myY = i;
_root[_root[_root.man.CurrentObject].myguardian].myX = _root[_root[_root.man.CurrentObject].myguardian]._x;
}
}
}
loadroom(NextRoom);
if (_level0.color == false) {
_level0.scripts.ColorSwitch(false);
}
}
function KeyDownHandler() {
thekey = Key.getCode();
if (Key.isDown(37)) {
_root.GoLeft = true;
_root.man.NextPlayerStep[0] = -1;
}
if (Key.isDown(38)) {
_root.GoUp = true;
_root.man.NextPlayerStep[1] = -1;
}
if (Key.isDown(39)) {
_root.GoRight = true;
_root.man.NextPlayerStep[0] = 1;
}
if (Key.isDown(40)) {
_root.GoDown = true;
_root.man.NextPlayerStep[1] = 1;
}
if (Key.isDown(Key.SPACE)) {
if (_root.man.CurrentObject == "arrow") {
_level0.SNDdrop.start();
TheObject = "arrow";
_root[TheObject]._x = _root.man._x + (_root.man.CurrentObjectXOffset * 2);
_root[TheObject]._y = _root.man._y + (_root.man.CurrentObjectYOffset * 2);
_root[_root.man.CurrentObject].MyX = _root[TheObject]._x;
_root[_root.man.CurrentObject].MyY = _root[TheObject]._y;
_root.man.CurrentObject = "nada";
}
if (_root.man.CurrentObject == "yellowkey") {
_level0.SNDdrop.start();
TheObject = "yellowkey";
_root[TheObject]._x = _root.man._x + (_root.man.CurrentObjectXOffset * 2);
_root[TheObject]._y = _root.man._y + (_root.man.CurrentObjectYOffset * 2);
_root[_root.man.CurrentObject].MyX = _root[TheObject]._x;
_root[_root.man.CurrentObject].MyY = _root[TheObject]._y;
_root.man.CurrentObject = "nada";
}
if (_root.man.CurrentObject == "blackkey") {
_level0.SNDdrop.start();
TheObject = "blackkey";
_root[TheObject]._x = _root.man._x + (_root.man.CurrentObjectXOffset * 2);
_root[TheObject]._y = _root.man._y + (_root.man.CurrentObjectYOffset * 2);
_root[_root.man.CurrentObject].MyX = _root[TheObject]._x;
_root[_root.man.CurrentObject].MyY = _root[TheObject]._y;
_root.man.CurrentObject = "nada";
}
if (_root.man.CurrentObject == "chalice") {
_level0.SNDdrop.start();
TheObject = "chalice";
_root[TheObject]._x = _root.man._x + (_root.man.CurrentObjectXOffset * 2);
_root[TheObject]._y = _root.man._y + (_root.man.CurrentObjectYOffset * 2);
_root[_root.man.CurrentObject].MyX = _root[TheObject]._x;
_root[_root.man.CurrentObject].MyY = _root[TheObject]._y;
_root.man.CurrentObject = "nada";
}
if (_root.man.CurrentObject == "magnet") {
_level0.SNDdrop.start();
TheObject = "magnet";
_root[TheObject]._x = _root.man._x + (_root.man.CurrentObjectXOffset * 2);
_root[TheObject]._y = _root.man._y + (_root.man.CurrentObjectYOffset * 2);
_root[_root.man.CurrentObject].MyX = _root[TheObject]._x;
_root[_root.man.CurrentObject].MyY = _root[TheObject]._y;
_root.man.CurrentObject = "nada";
}
}
}
function KeyUpHandler() {
thekey = Key.getCode();
if (thekey == 37) {
_root.GoLeft = false;
if (!_root.GoRight) {
_root.man.NextPlayerStep[0] = 0;
}
}
if (thekey == 38) {
_root.GoUp = false;
if (!_root.GoDown) {
_root.man.NextPlayerStep[1] = 0;
}
}
if (thekey == 39) {
_root.GoRight = false;
if (!_root.GoLeft) {
_root.man.NextPlayerStep[0] = 0;
}
}
if (thekey == 40) {
_root.GoDown = false;
if (!_root.GoUp) {
_root.man.NextPlayerStep[1] = 0;
}
}
}
function CHeckWalls(me) {
var NowpX = _root.man._x;
var NowpY = _root.man._y;
var NextpX = _root.man._x;
var NextpY = _root.man._y;
NextpX = NextpX + (_root.man.NextPlayerStep[0] * _root.man.mySpeed);
NextpY = NextpY + (_root.man.NextPlayerStep[1] * _root.man.mySpeed);
var pw = (_root.man._width / 2);
var ph = (_root.man._height / 2);
if (_root.GoRight) {
if (_level0[me].hitTest(NextpX + pw, (NowpY - ph) + 1, true) || (_level0[me].hitTest(NextpX + pw, (NowpY + ph) - 1, true))) {
_root.man.NextPlayerStep[0] = 0;
}
} else if (_root.GoLeft) {
if (_level0[me].hitTest(NextpX - pw, (NowpY - ph) + 1, true) || (_level0[me].hitTest(NextpX - pw, (NowpY + ph) - 1, true))) {
_root.man.NextPlayerStep[0] = 0;
}
}
if (_root.GoDown) {
if (_level0[me].hitTest((NowpX - pw) + 1, NextpY + ph, true) || (_level0[me].hitTest((NowpX + pw) - 1, NextpY + ph, true))) {
_root.man.NextPlayerStep[1] = 0;
}
} else if (_root.GoUp) {
if (_level0[me].hitTest((NowpX - pw) + 1, NextpY - ph, true) || (_level0[me].hitTest((NowpX + pw) - 1, NextpY - ph, true))) {
_root.man.NextPlayerStep[1] = 0;
}
}
}
function gameOFF() {
_level0.gamerunning = false;
_level0.gotoandplay("GameOFF");
i = 0;
while (i < _root.TheOBjectList.length) {
_root[TheOBjectList[i]].removeMovieClip();
i++;
}
_root.man.removeMovieClip();
_root.background.removeMovieClip();
_root.bat.removeMovieClip();
_root.TheOBjectList = 0;
_level0.GameStatus = "OFF";
_level0.SNDnoise.start(0, 999);
}
function gameON() {
_level0.color = true;
_level0.gotoandplay("GameON");
_level0.SNDnoise.stop();
}
function gameselect() {
_level0.gamerunning = false;
_level0.gotoandplay("GameON");
intializemovie();
}
function ColorSwitch(state) {
_level0.color = state;
if (state == true) {
unloadMovieNum (10);
_root.attachMovie("rm" + _level0.CurrentRoomNumber, "background", 10);
_level0.background._y = 192;
_level0.background._x = 320;
} else {
myColor = new Color(_root.background);
myColor.setRGB(0);
}
}
function initializesounds() {
soundlist = new array("SNDnoise", "SNDattack", "SNDbutdown", "SNDbutup", "SNDdead", "SNDdead", "SNDdrop", "SNDpickup", "SNDslidedown", "SNDslideup", "SNDwin", "SNDkill");
i = 0;
while (i < soundlist.length) {
_level0[soundlist[i]] = new Sound();
_level0[soundlist[i]].attachSound(soundlist[i]);
i++;
}
}
loadVariablesNum ("keylock/keylock.txt", 0);
intializemovie();
_level0.startgame = startgame;
_level0.intializemovie = intializemovie;
_level0.gameON = gameON;
_level0.gameOFF = gameOFF;
_level0.scripts = this;
stop();