STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
228050
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2560 · P5120

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/92369678?noj=FRM92369678-24DC" width="1" height="1"></div>

Troglodite.swf

This is the info page for
Flash #117161

(Click the ID number above for more basic data on this flash file.)


Text
-

-

-

Guide the trogolodite through the cave,
collecting gems to open doors and
avoiding the ghosts

Guide the trogolodite through the cave,
collecting gems to open doors and
avoiding the ghosts

<P ALIGN="LEFT"><FONT FACE="Weathered SF" SIZE="10" COLOR="#FFCC33">Lives - </FONT></P>

<P ALIGN="LEFT"><FONT FACE="Weathered SF" SIZE="10" COLOR="#FFCC33">Lives - </FONT></P>

<P ALIGN="LEFT"><FONT FACE="Weathered SF" SIZE="10" COLOR="#FFCC33">Lives - </FONT></P>

<P ALIGN="LEFT"><FONT FACE="Weathered SF" SIZE="10" COLOR="#FFCC33">Lives - </FONT></P>

<P ALIGN="LEFT"><FONT FACE="Weathered SF" SIZE="10" COLOR="#FFCC33">Lives - </FONT></P>

<P ALIGN="LEFT"><FONT FACE="Weathered SF" SIZE="10" COLOR="#FFCC33">Lives - </FONT></P>

<P ALIGN="LEFT"><FONT FACE="Weathered SF" SIZE="10" COLOR="#FFCC33">Lives - </FONT></P>

<P ALIGN="LEFT"><FONT FACE="Weathered SF" SIZE="10" COLOR="#FFCC33">Lives - </FONT></P>

Game Over

Well Done!
(You've completed the game)

Well Done!
(You've completed the game)

Thanks to Paul Wright who
submitted this game as an open
file to Flashkit.com
(Originally called Spider Key)
Graphics and Level Editing by
Oliver Klinkenberg
Music by various kind artists who
submitted their work as Freeware to
Flashkit.com

Thanks to Paul Wright who
submitted this game as an open
file to Flashkit.com
(Originally called Spider Key)
Graphics and Level Editing by
Oliver Klinkenberg
Music by various kind artists who
submitted their work as Freeware to
Flashkit.com

ActionScript [AS1/AS2]

Frame 1
stop();
Instance of Symbol 28 MovieClip "progressbar" in Frame 1
onClipEvent (load) { totalFileSize = _root.getBytesTotal(); startTime = getTimer(); startBytes = _root.getBytesLoaded(); this._xscale = 0; } onClipEvent (enterFrame) { bytesLoaded = _root.getBytesLoaded(); amountLoaded = bytesLoaded / totalFileSize; percentLoaded = int(100 * amountLoaded); this._xscale = percentLoaded; timeSoFar = getTimer() - startTime; speed = bytesLoaded / timeSoFar; bytesLeft = totalFileSize - bytesLoaded; timeLeft = (bytesLeft / 1000) * (speed / 1000); speed = int(10 * speed) / 10; _root.bytesMessage = ((int(bytesLoaded / 1000) + "kb/") + int(totalFileSize / 1000)) + "kb"; _root.speedMessage = speed + "k/sec"; _root.timeMessage = int(timeLeft) + " seconds remaining"; if (amountLoaded >= 1) { _root.gotoAndPlay("movie start"); } }
Frame 2
stop();
Frame 3
stop(); function buildMap(map) { _root.attachMovie("empty", "tiles", ++d); game.clip = _root.tiles; game.clip._x = 30; game.clip._y = 30; var mapWidth = map[0].length; var mapHeight = map.length; var i = 0; while (i < mapHeight) { var j = 0; while (j < mapWidth) { var name = ((("t_" + i) + "_") + j); game[name] = new game["Tile" + map[i][j]](); game.clip.attachMovie("tile", name, (i * 100) + (j * 2)); game.clip[name]._x = j * game.tileW; game.clip[name]._y = i * game.tileH; game.clip[name].gotoandstop(game[name].frame); j++; } i++; } game.items = myItems; var i = 0; while (i < game.items.length) { var name = ((("item" + game.items[i][2]) + "_") + game.items[i][1]); game[name] = new game["Item" + game.items[i][0]](); game[name].position = i; game.clip.attachMovie("item", name, 10012 + i); game[name].clip = game.clip[name]; game[name].clip._x = (game.items[i][1] * game.tileW) + (game.tileW / 2); game[name].clip._y = (game.items[i][2] * game.tileH) + (game.tileH / 2); game[name].clip.gotoandstop(game.items[i][0]); i++; } _root.points = game.points; var enemies = myEnemies; game.currentEnemies = enemies.length; var i = 0; while (i < game.currentEnemies) { var name = ("enemy" + i); game[name] = new game["Enemyp" + enemies[i][0]](); game.clip.attachMovie("enemy1", name, 10001 + i); game[name].clip = game.clip[name]; game[name].xtile = enemies[i][1]; game[name].ytile = enemies[i][2]; game[name].width = game.clip[name]._width / 2; game[name].height = game.clip[name]._height / 2; game[name].x = (game[name].xtile * game.tileW) + (game.tileW / 2); game[name].y = (game[name].ytile * game.tileH) + (game.tileH / 2); game[name].clip._x = game[name].x; game[name].clip._y = game[name].y; i++; } game.clip.attachMovie("char", "char", 1000); char.clip = game.clip.char; char.x = (char.xtile * game.tileW) + (game.tileW / 2); char.y = (char.ytile * game.tileH) + (game.tileH / 2); char.width = char.clip._width / 2; char.height = char.clip._height / 2; char.clip._x = char.x; char.clip._y = char.y; } function enemyBrain() { var i = 0; while (i < 5) { var name = ("enemy" + i); var ob = game[name]; getMyCorners(ob.x + (ob.speed * ob.xMove), ob.y + (ob.speed * ob.yMove), ob); if (((ob.downleft and ob.upleft) and ob.downright) and ob.upleft) { moveChar(ob, ob.xMove, ob.yMove); } else { ob.xMove = -ob.xMove; ob.yMove = -ob.yMove; } var xdist = (ob.x - char.x); var ydist = (ob.y - char.y); if (math.sqrt((xdist * xdist) + (ydist * ydist)) < (ob.width + char.width)) { char.x = (startingXtile * game.tileW) + (game.tileW / 2); char.y = (startingYtile * game.tileH) + (game.tileH / 2); char.clip._x = char.x; char.clip._y = char.y; _root.lifes = _root.lifes - 1; youdied.gotoandplay(2); mylifes.gotoandstop(_root.lifes); if (lifes == 0) { removeMovieClip(_root.tiles); gotoAndStop (36); } } i++; } } function detectKeys() { var ob = _root.char; var keypressed = false; if (key.isDown(Key.RIGHT)) { keyPressed = _root.moveChar(ob, 1, 0); } else if (key.isDown(Key.LEFT)) { keyPressed = _root.moveChar(ob, -1, 0); } else if (key.isDown(Key.UP)) { keyPressed = _root.moveChar(ob, 0, -1); } else if (key.isDown(Key.DOWN)) { keyPressed = _root.moveChar(ob, 0, 1); } if (!KeyPressed) { ob.clip.mychar.gotoandstop(1); } else { ob.clip.mychar.play(); } _root.enemyBrain(); } function moveChar(ob, dirx, diry) { getMyCorners(ob.x, ob.y + (ob.speed * diry), ob); if (diry == -1) { if (ob.upleft and ob.upright) { ob.y = ob.y + (ob.speed * diry); } else { ob.y = (ob.ytile * game.tileH) + ob.height; } } if (diry == 1) { if (ob.downleft and ob.downright) { ob.y = ob.y + (ob.speed * diry); } else { ob.y = ((ob.ytile + 1) * game.tileH) - ob.height; } } getMyCorners(ob.x + (ob.speed * dirx), ob.y, ob); if (dirx == -1) { if (ob.downleft and ob.upleft) { ob.x = ob.x + (ob.speed * dirx); } else { ob.x = (ob.xtile * game.tileW) + ob.width; } } if (dirx == 1) { if (ob.upright and ob.downright) { ob.x = ob.x + (ob.speed * dirx); } else { ob.x = ((ob.xtile + 1) * game.tileW) - ob.width; } } ob.clip._x = ob.x; ob.clip._y = ob.y; ob.clip.gotoandstop((dirx + (diry * 2)) + 3); ob.xtile = Math.floor(ob.clip._x / game.tileW); ob.ytile = Math.floor(ob.clip._y / game.tileH); var itemname = game[(("item" + ob.ytile) + "_") + ob.xtile]; if (itemname and (ob == _root.char)) { game.points = true; removeMovieClip(itemname.clip); game.items[itemname.position] = 0; delete game[(("item" + ob.ytile) + "_") + ob.xtile]; if ((game.points = true)) { opendoorname = (("t_" + unlockY) + "_") + unlockX; game.clip[opendoorname].gotoandstop(4); game.Tile2.prototype.walkable = true; } } if ((_root.char.ytile == unlockY) && (_root.char.xtile == unlockX)) { removeMovieClip(_root.tiles); gotoAndStop (4); } return(true); } function getMyCorners(x, y, ob) { ob.downY = Math.floor(((y + ob.height) - 1) / game.tileH); ob.upY = Math.floor((y - ob.height) / game.tileH); ob.leftX = Math.floor((x - ob.width) / game.tileW); ob.rightX = Math.floor(((x + ob.width) - 1) / game.tileW); ob.upleft = game[(("t_" + ob.upY) + "_") + ob.leftX].walkable; ob.downleft = game[(("t_" + ob.downY) + "_") + ob.leftX].walkable; ob.upright = game[(("t_" + ob.upY) + "_") + ob.rightX].walkable; ob.downright = game[(("t_" + ob.downY) + "_") + ob.rightX].walkable; } fscommand ("allowscale", false); myMap1 = [[5, 5, 5, 5, 5, 5, 5, 5, 5, 5], [5, 5, 1, 1, 1, 5, 5, 5, 5, 5], [5, 5, 1, 0, 1, 1, 1, 1, 5, 5], [5, 5, 1, 0, 0, 0, 0, 1, 5, 5], [5, 5, 1, 0, 0, 0, 0, 1, 5, 5], [5, 5, 1, 0, 0, 1, 0, 1, 5, 5], [5, 5, 1, 1, 1, 1, 2, 1, 5, 5], [5, 5, 5, 5, 5, 1, 1, 1, 5, 5], [5, 5, 5, 5, 5, 5, 5, 5, 5, 5]]; game = {tileW:30, tileH:30, currentMap:1, points:false}; game.Tile0 = function () { }; game.Tile0.prototype.walkable = true; game.Tile0.prototype.frame = 1; game.Tile1 = function () { }; game.Tile1.prototype.walkable = false; game.Tile1.prototype.frame = 2; game.Tile2 = function () { }; game.Tile2.prototype.walkable = false; game.Tile2.prototype.frame = 3; game.Tile5 = function () { }; game.Tile5.prototype.walkable = false; game.Tile5.prototype.frame = 5; unlockY = 6; unlockX = 6; char = {xtile:3, ytile:4, speed:3}; startingXtile = char.xtile; startingYtile = char.ytile; myEnemies = [[1, 4, 4]]; game.Enemyp1 = function () { }; game.Enemyp1.prototype.xMove = 0; game.Enemyp1.prototype.yMove = -1; game.Enemyp1.prototype.speed = 0.5; myItems = [[1, 3, 3]]; game.Item1 = function () { }; game.Item1.prototype.points = false; lifes = 4; buildMap(_root["myMap" + game.currentMap]); stop();
Instance of Symbol 25 MovieClip [empty] in Frame 3
onClipEvent (enterFrame) { _root.detectKeys(); }
Frame 4
stop();
Frame 5
stop(); function buildMap(map) { _root.attachMovie("empty", "tiles", ++d); game.clip = _root.tiles; game.clip._x = 30; game.clip._y = 30; var mapWidth = map[0].length; var mapHeight = map.length; var i = 0; while (i < mapHeight) { var j = 0; while (j < mapWidth) { var name = ((("t_" + i) + "_") + j); game[name] = new game["Tile" + map[i][j]](); game.clip.attachMovie("tile", name, (i * 100) + (j * 2)); game.clip[name]._x = j * game.tileW; game.clip[name]._y = i * game.tileH; game.clip[name].gotoandstop(game[name].frame); j++; } i++; } game.items = myItems; var i = 0; while (i < game.items.length) { var name = ((("item" + game.items[i][2]) + "_") + game.items[i][1]); game[name] = new game["Item" + game.items[i][0]](); game[name].position = i; game.clip.attachMovie("item", name, 10009 + i); game[name].clip = game.clip[name]; game[name].clip._x = (game.items[i][1] * game.tileW) + (game.tileW / 2); game[name].clip._y = (game.items[i][2] * game.tileH) + (game.tileH / 2); game[name].clip.gotoandstop(game.items[i][0]); i++; } var enemies = myEnemies; game.currentEnemies = enemies.length; var i = 0; while (i < game.currentEnemies) { var name = ("enemy" + i); game[name] = new game["Enemyp" + enemies[i][0]](); game.clip.attachMovie("enemy1", name, 10001 + i); game[name].clip = game.clip[name]; game[name].xtile = enemies[i][1]; game[name].ytile = enemies[i][2]; game[name].width = game.clip[name]._width / 2; game[name].height = game.clip[name]._height / 2; game[name].x = (game[name].xtile * game.tileW) + (game.tileW / 2); game[name].y = (game[name].ytile * game.tileH) + (game.tileH / 2); game[name].clip._x = game[name].x; game[name].clip._y = game[name].y; i++; } game.clip.attachMovie("char", "char", 1000); char.clip = game.clip.char; char.x = (char.xtile * game.tileW) + (game.tileW / 2); char.y = (char.ytile * game.tileH) + (game.tileH / 2); char.width = char.clip._width / 2; char.height = char.clip._height / 2; char.clip._x = char.x; char.clip._y = char.y; } function enemyBrain() { var i = 0; while (i < 5) { var name = ("enemy" + i); var ob = game[name]; getMyCorners(ob.x + (ob.speed * ob.xMove), ob.y + (ob.speed * ob.yMove), ob); if (((ob.downleft and ob.upleft) and ob.downright) and ob.upleft) { moveChar(ob, ob.xMove, ob.yMove); } else { ob.xMove = -ob.xMove; ob.yMove = -ob.yMove; } var xdist = (ob.x - char.x); var ydist = (ob.y - char.y); if (math.sqrt((xdist * xdist) + (ydist * ydist)) < (ob.width + char.width)) { char.x = (startingXtile * game.tileW) + (game.tileW / 2); char.y = (startingYtile * game.tileH) + (game.tileH / 2); char.clip._x = char.x; char.clip._y = char.y; _root.lifes = _root.lifes - 1; youdied.gotoandplay(2); mylifes.gotoandstop(_root.lifes); if (lifes == 0) { removeMovieClip(_root.tiles); gotoAndStop (36); } } i++; } } function detectKeys() { var ob = _root.char; var keypressed = false; if (key.isDown(Key.RIGHT)) { keyPressed = _root.moveChar(ob, 1, 0); } else if (key.isDown(Key.LEFT)) { keyPressed = _root.moveChar(ob, -1, 0); } else if (key.isDown(Key.UP)) { keyPressed = _root.moveChar(ob, 0, -1); } else if (key.isDown(Key.DOWN)) { keyPressed = _root.moveChar(ob, 0, 1); } if (!KeyPressed) { ob.clip.mychar.gotoandstop(1); } else { ob.clip.mychar.play(); } _root.enemyBrain(); } function moveChar(ob, dirx, diry) { getMyCorners(ob.x, ob.y + (ob.speed * diry), ob); if (diry == -1) { if (ob.upleft and ob.upright) { ob.y = ob.y + (ob.speed * diry); } else { ob.y = (ob.ytile * game.tileH) + ob.height; } } if (diry == 1) { if (ob.downleft and ob.downright) { ob.y = ob.y + (ob.speed * diry); } else { ob.y = ((ob.ytile + 1) * game.tileH) - ob.height; } } getMyCorners(ob.x + (ob.speed * dirx), ob.y, ob); if (dirx == -1) { if (ob.downleft and ob.upleft) { ob.x = ob.x + (ob.speed * dirx); } else { ob.x = (ob.xtile * game.tileW) + ob.width; } } if (dirx == 1) { if (ob.upright and ob.downright) { ob.x = ob.x + (ob.speed * dirx); } else { ob.x = ((ob.xtile + 1) * game.tileW) - ob.width; } } ob.clip._x = ob.x; ob.clip._y = ob.y; ob.clip.gotoandstop((dirx + (diry * 2)) + 3); ob.xtile = Math.floor(ob.clip._x / game.tileW); ob.ytile = Math.floor(ob.clip._y / game.tileH); var itemname = game[(("item" + ob.ytile) + "_") + ob.xtile]; if (itemname and (ob == _root.char)) { game.points = true; removeMovieClip(itemname.clip); game.items[itemname.position] = 0; delete game[(("item" + ob.ytile) + "_") + ob.xtile]; if ((game.points = true)) { opendoorname = (("t_" + unlockY) + "_") + unlockX; game.clip[opendoorname].gotoandstop(4); game.Tile2.prototype.walkable = true; } } if ((_root.char.ytile == unlockY) && (_root.char.xtile == unlockX)) { removeMovieClip(_root.tiles); lostlifes = lifes; gotoAndStop (6); } return(true); } function getMyCorners(x, y, ob) { ob.downY = Math.floor(((y + ob.height) - 1) / game.tileH); ob.upY = Math.floor((y - ob.height) / game.tileH); ob.leftX = Math.floor((x - ob.width) / game.tileW); ob.rightX = Math.floor(((x + ob.width) - 1) / game.tileW); ob.upleft = game[(("t_" + ob.upY) + "_") + ob.leftX].walkable; ob.downleft = game[(("t_" + ob.downY) + "_") + ob.leftX].walkable; ob.upright = game[(("t_" + ob.upY) + "_") + ob.rightX].walkable; ob.downright = game[(("t_" + ob.downY) + "_") + ob.rightX].walkable; } fscommand ("allowscale", false); myMap1 = [[5, 5, 5, 5, 5, 5, 5, 5, 5, 5], [5, 5, 5, 1, 1, 1, 5, 5, 5, 5], [5, 1, 1, 1, 2, 1, 1, 1, 1, 5], [5, 1, 0, 1, 0, 0, 1, 0, 1, 5], [5, 1, 0, 0, 0, 0, 0, 0, 1, 5], [5, 1, 0, 1, 0, 0, 1, 0, 1, 5], [5, 1, 1, 1, 0, 1, 1, 1, 1, 5], [5, 5, 5, 1, 1, 1, 5, 5, 5, 5], [5, 5, 5, 5, 5, 5, 5, 5, 5, 5]]; game = {tileW:30, tileH:30, currentMap:1, points:false}; game.Tile0 = function () { }; game.Tile0.prototype.walkable = true; game.Tile0.prototype.frame = 1; game.Tile1 = function () { }; game.Tile1.prototype.walkable = false; game.Tile1.prototype.frame = 2; game.Tile2 = function () { }; game.Tile2.prototype.walkable = false; game.Tile2.prototype.frame = 3; game.Tile5 = function () { }; game.Tile5.prototype.walkable = false; game.Tile5.prototype.frame = 5; unlockY = 2; unlockX = 4; char = {xtile:2, ytile:4, speed:3}; startingXtile = char.xtile; startingYtile = char.ytile; mylifes.gotoandstop(_root.lifes); myEnemies = [[2, 4, 5], [2, 7, 5]]; game.Enemyp1 = function () { }; game.Enemyp1.prototype.xMove = 1; game.Enemyp1.prototype.yMove = 0; game.Enemyp1.prototype.speed = 1; game.Enemyp2 = function () { }; game.Enemyp2.prototype.xMove = 0; game.Enemyp2.prototype.yMove = 1; game.Enemyp2.prototype.speed = 1; myItems = [[1, 7, 4]]; game.Item1 = function () { }; game.Item1.prototype.points = false; buildMap(_root["myMap" + game.currentMap]); stop();
Instance of Symbol 25 MovieClip [empty] in Frame 5
onClipEvent (enterFrame) { _root.detectKeys(); }
Frame 6
stop();
Frame 7
stop(); function buildMap(map) { _root.attachMovie("empty", "tiles", ++d); game.clip = _root.tiles; game.clip._x = 30; game.clip._y = 30; var mapWidth = map[0].length; var mapHeight = map.length; var i = 0; while (i < mapHeight) { var j = 0; while (j < mapWidth) { var name = ((("t_" + i) + "_") + j); game[name] = new game["Tile" + map[i][j]](); game.clip.attachMovie("tile", name, (i * 100) + (j * 2)); game.clip[name]._x = j * game.tileW; game.clip[name]._y = i * game.tileH; game.clip[name].gotoandstop(game[name].frame); j++; } i++; } game.items = myItems; var i = 0; while (i < game.items.length) { var name = ((("item" + game.items[i][2]) + "_") + game.items[i][1]); game[name] = new game["Item" + game.items[i][0]](); game[name].position = i; game.clip.attachMovie("item", name, 10009 + i); game[name].clip = game.clip[name]; game[name].clip._x = (game.items[i][1] * game.tileW) + (game.tileW / 2); game[name].clip._y = (game.items[i][2] * game.tileH) + (game.tileH / 2); game[name].clip.gotoandstop(game.items[i][0]); i++; } var enemies = myEnemies; game.currentEnemies = enemies.length; var i = 0; while (i < game.currentEnemies) { var name = ("enemy" + i); game[name] = new game["Enemyp" + enemies[i][0]](); game.clip.attachMovie("enemy1", name, 10001 + i); game[name].clip = game.clip[name]; game[name].xtile = enemies[i][1]; game[name].ytile = enemies[i][2]; game[name].width = game.clip[name]._width / 2; game[name].height = game.clip[name]._height / 2; game[name].x = (game[name].xtile * game.tileW) + (game.tileW / 2); game[name].y = (game[name].ytile * game.tileH) + (game.tileH / 2); game[name].clip._x = game[name].x; game[name].clip._y = game[name].y; i++; } game.clip.attachMovie("char", "char", 1000); char.clip = game.clip.char; char.x = (char.xtile * game.tileW) + (game.tileW / 2); char.y = (char.ytile * game.tileH) + (game.tileH / 2); char.width = char.clip._width / 2; char.height = char.clip._height / 2; char.clip._x = char.x; char.clip._y = char.y; } function enemyBrain() { var i = 0; while (i < 5) { var name = ("enemy" + i); var ob = game[name]; getMyCorners(ob.x + (ob.speed * ob.xMove), ob.y + (ob.speed * ob.yMove), ob); if (((ob.downleft and ob.upleft) and ob.downright) and ob.upleft) { moveChar(ob, ob.xMove, ob.yMove); } else { ob.xMove = -ob.xMove; ob.yMove = -ob.yMove; } var xdist = (ob.x - char.x); var ydist = (ob.y - char.y); if (math.sqrt((xdist * xdist) + (ydist * ydist)) < (ob.width + char.width)) { char.x = (startingXtile * game.tileW) + (game.tileW / 2); char.y = (startingYtile * game.tileH) + (game.tileH / 2); char.clip._x = char.x; char.clip._y = char.y; _root.lifes = _root.lifes - 1; youdied.gotoandplay(2); mylifes.gotoandstop(_root.lifes); if (lifes == 0) { removeMovieClip(_root.tiles); gotoAndStop (36); } } i++; } } function detectKeys() { var ob = _root.char; var keypressed = false; if (key.isDown(Key.RIGHT)) { keyPressed = _root.moveChar(ob, 1, 0); } else if (key.isDown(Key.LEFT)) { keyPressed = _root.moveChar(ob, -1, 0); } else if (key.isDown(Key.UP)) { keyPressed = _root.moveChar(ob, 0, -1); } else if (key.isDown(Key.DOWN)) { keyPressed = _root.moveChar(ob, 0, 1); } if (!KeyPressed) { ob.clip.mychar.gotoandstop(1); } else { ob.clip.mychar.play(); } _root.enemyBrain(); } function moveChar(ob, dirx, diry) { getMyCorners(ob.x, ob.y + (ob.speed * diry), ob); if (diry == -1) { if (ob.upleft and ob.upright) { ob.y = ob.y + (ob.speed * diry); } else { ob.y = (ob.ytile * game.tileH) + ob.height; } } if (diry == 1) { if (ob.downleft and ob.downright) { ob.y = ob.y + (ob.speed * diry); } else { ob.y = ((ob.ytile + 1) * game.tileH) - ob.height; } } getMyCorners(ob.x + (ob.speed * dirx), ob.y, ob); if (dirx == -1) { if (ob.downleft and ob.upleft) { ob.x = ob.x + (ob.speed * dirx); } else { ob.x = (ob.xtile * game.tileW) + ob.width; } } if (dirx == 1) { if (ob.upright and ob.downright) { ob.x = ob.x + (ob.speed * dirx); } else { ob.x = ((ob.xtile + 1) * game.tileW) - ob.width; } } ob.clip._x = ob.x; ob.clip._y = ob.y; ob.clip.gotoandstop((dirx + (diry * 2)) + 3); ob.xtile = Math.floor(ob.clip._x / game.tileW); ob.ytile = Math.floor(ob.clip._y / game.tileH); var itemname = game[(("item" + ob.ytile) + "_") + ob.xtile]; if (itemname and (ob == _root.char)) { game.points = true; removeMovieClip(itemname.clip); game.items[itemname.position] = 0; delete game[(("item" + ob.ytile) + "_") + ob.xtile]; if ((game.points = true)) { opendoorname = (("t_" + unlockY) + "_") + unlockX; game.clip[opendoorname].gotoandstop(4); game.Tile2.prototype.walkable = true; } } if ((_root.char.ytile == unlockY) && (_root.char.xtile == unlockX)) { removeMovieClip(_root.tiles); lostlifes = lifes; gotoAndStop (8); } return(true); } function getMyCorners(x, y, ob) { ob.downY = Math.floor(((y + ob.height) - 1) / game.tileH); ob.upY = Math.floor((y - ob.height) / game.tileH); ob.leftX = Math.floor((x - ob.width) / game.tileW); ob.rightX = Math.floor(((x + ob.width) - 1) / game.tileW); ob.upleft = game[(("t_" + ob.upY) + "_") + ob.leftX].walkable; ob.downleft = game[(("t_" + ob.downY) + "_") + ob.leftX].walkable; ob.upright = game[(("t_" + ob.upY) + "_") + ob.rightX].walkable; ob.downright = game[(("t_" + ob.downY) + "_") + ob.rightX].walkable; } fscommand ("allowscale", false); myMap1 = [[5, 5, 5, 5, 5, 5, 5, 5, 5, 5], [5, 5, 5, 5, 5, 5, 5, 5, 5, 5], [5, 1, 1, 1, 1, 1, 1, 5, 1, 5], [5, 1, 0, 1, 2, 0, 1, 1, 1, 5], [5, 1, 0, 0, 0, 0, 0, 0, 1, 5], [5, 1, 0, 1, 0, 0, 1, 0, 1, 5], [5, 1, 1, 1, 0, 1, 1, 1, 1, 5], [5, 5, 5, 1, 1, 1, 5, 5, 5, 5], [5, 5, 5, 5, 5, 5, 5, 5, 5, 5]]; game = {tileW:30, tileH:30, currentMap:1, points:false}; game.Tile0 = function () { }; game.Tile0.prototype.walkable = true; game.Tile0.prototype.frame = 1; game.Tile1 = function () { }; game.Tile1.prototype.walkable = false; game.Tile1.prototype.frame = 2; game.Tile2 = function () { }; game.Tile2.prototype.walkable = false; game.Tile2.prototype.frame = 3; game.Tile5 = function () { }; game.Tile5.prototype.walkable = false; game.Tile5.prototype.frame = 5; unlockY = 3; unlockX = 4; char = {xtile:2, ytile:4, speed:3}; startingXtile = char.xtile; startingYtile = char.ytile; mylifes.gotoandstop(_root.lifes); myEnemies = [[2, 4, 5], [2, 5, 5], [2, 7, 5]]; game.Enemyp1 = function () { }; game.Enemyp1.prototype.xMove = 1; game.Enemyp1.prototype.yMove = 0; game.Enemyp1.prototype.speed = 1; game.Enemyp2 = function () { }; game.Enemyp2.prototype.xMove = 0; game.Enemyp2.prototype.yMove = 1; game.Enemyp2.prototype.speed = 1; myItems = [[1, 7, 4]]; game.Item1 = function () { }; game.Item1.prototype.points = false; buildMap(_root["myMap" + game.currentMap]); stop();
Instance of Symbol 25 MovieClip [empty] in Frame 7
onClipEvent (enterFrame) { _root.detectKeys(); }
Frame 8
stop();
Frame 9
stop(); function buildMap(map) { _root.attachMovie("empty", "tiles", ++d); game.clip = _root.tiles; game.clip._x = 30; game.clip._y = 30; var mapWidth = map[0].length; var mapHeight = map.length; var i = 0; while (i < mapHeight) { var j = 0; while (j < mapWidth) { var name = ((("t_" + i) + "_") + j); game[name] = new game["Tile" + map[i][j]](); game.clip.attachMovie("tile", name, (i * 100) + (j * 2)); game.clip[name]._x = j * game.tileW; game.clip[name]._y = i * game.tileH; game.clip[name].gotoandstop(game[name].frame); j++; } i++; } game.items = myItems; var i = 0; while (i < game.items.length) { var name = ((("item" + game.items[i][2]) + "_") + game.items[i][1]); game[name] = new game["Item" + game.items[i][0]](); game[name].position = i; game.clip.attachMovie("item", name, 10009 + i); game[name].clip = game.clip[name]; game[name].clip._x = (game.items[i][1] * game.tileW) + (game.tileW / 2); game[name].clip._y = (game.items[i][2] * game.tileH) + (game.tileH / 2); game[name].clip.gotoandstop(game.items[i][0]); i++; } var enemies = myEnemies; game.currentEnemies = enemies.length; var i = 0; while (i < game.currentEnemies) { var name = ("enemy" + i); game[name] = new game["Enemyp" + enemies[i][0]](); game.clip.attachMovie("enemy1", name, 10001 + i); game[name].clip = game.clip[name]; game[name].xtile = enemies[i][1]; game[name].ytile = enemies[i][2]; game[name].width = game.clip[name]._width / 2; game[name].height = game.clip[name]._height / 2; game[name].x = (game[name].xtile * game.tileW) + (game.tileW / 2); game[name].y = (game[name].ytile * game.tileH) + (game.tileH / 2); game[name].clip._x = game[name].x; game[name].clip._y = game[name].y; i++; } game.clip.attachMovie("char", "char", 1000); char.clip = game.clip.char; char.x = (char.xtile * game.tileW) + (game.tileW / 2); char.y = (char.ytile * game.tileH) + (game.tileH / 2); char.width = char.clip._width / 2; char.height = char.clip._height / 2; char.clip._x = char.x; char.clip._y = char.y; } function enemyBrain() { var i = 0; while (i < 5) { var name = ("enemy" + i); var ob = game[name]; getMyCorners(ob.x + (ob.speed * ob.xMove), ob.y + (ob.speed * ob.yMove), ob); if (((ob.downleft and ob.upleft) and ob.downright) and ob.upleft) { moveChar(ob, ob.xMove, ob.yMove); } else { ob.xMove = -ob.xMove; ob.yMove = -ob.yMove; } var xdist = (ob.x - char.x); var ydist = (ob.y - char.y); if (math.sqrt((xdist * xdist) + (ydist * ydist)) < (ob.width + char.width)) { char.x = (startingXtile * game.tileW) + (game.tileW / 2); char.y = (startingYtile * game.tileH) + (game.tileH / 2); char.clip._x = char.x; char.clip._y = char.y; _root.lifes = _root.lifes - 1; youdied.gotoandplay(2); mylifes.gotoandstop(_root.lifes); if (lifes == 0) { removeMovieClip(_root.tiles); gotoAndStop (36); } } i++; } } function detectKeys() { var ob = _root.char; var keypressed = false; if (key.isDown(Key.RIGHT)) { keyPressed = _root.moveChar(ob, 1, 0); } else if (key.isDown(Key.LEFT)) { keyPressed = _root.moveChar(ob, -1, 0); } else if (key.isDown(Key.UP)) { keyPressed = _root.moveChar(ob, 0, -1); } else if (key.isDown(Key.DOWN)) { keyPressed = _root.moveChar(ob, 0, 1); } if (!KeyPressed) { ob.clip.mychar.gotoandstop(1); } else { ob.clip.mychar.play(); } _root.enemyBrain(); } function moveChar(ob, dirx, diry) { getMyCorners(ob.x, ob.y + (ob.speed * diry), ob); if (diry == -1) { if (ob.upleft and ob.upright) { ob.y = ob.y + (ob.speed * diry); } else { ob.y = (ob.ytile * game.tileH) + ob.height; } } if (diry == 1) { if (ob.downleft and ob.downright) { ob.y = ob.y + (ob.speed * diry); } else { ob.y = ((ob.ytile + 1) * game.tileH) - ob.height; } } getMyCorners(ob.x + (ob.speed * dirx), ob.y, ob); if (dirx == -1) { if (ob.downleft and ob.upleft) { ob.x = ob.x + (ob.speed * dirx); } else { ob.x = (ob.xtile * game.tileW) + ob.width; } } if (dirx == 1) { if (ob.upright and ob.downright) { ob.x = ob.x + (ob.speed * dirx); } else { ob.x = ((ob.xtile + 1) * game.tileW) - ob.width; } } ob.clip._x = ob.x; ob.clip._y = ob.y; ob.clip.gotoandstop((dirx + (diry * 2)) + 3); ob.xtile = Math.floor(ob.clip._x / game.tileW); ob.ytile = Math.floor(ob.clip._y / game.tileH); var itemname = game[(("item" + ob.ytile) + "_") + ob.xtile]; if (itemname and (ob == _root.char)) { game.points = true; removeMovieClip(itemname.clip); game.items[itemname.position] = 0; delete game[(("item" + ob.ytile) + "_") + ob.xtile]; if ((game.points = true)) { opendoorname = (("t_" + unlockY) + "_") + unlockX; game.clip[opendoorname].gotoandstop(4); game.Tile2.prototype.walkable = true; } } if ((_root.char.ytile == unlockY) && (_root.char.xtile == unlockX)) { removeMovieClip(_root.tiles); lostlifes = lifes; gotoAndStop (10); } return(true); } function getMyCorners(x, y, ob) { ob.downY = Math.floor(((y + ob.height) - 1) / game.tileH); ob.upY = Math.floor((y - ob.height) / game.tileH); ob.leftX = Math.floor((x - ob.width) / game.tileW); ob.rightX = Math.floor(((x + ob.width) - 1) / game.tileW); ob.upleft = game[(("t_" + ob.upY) + "_") + ob.leftX].walkable; ob.downleft = game[(("t_" + ob.downY) + "_") + ob.leftX].walkable; ob.upright = game[(("t_" + ob.upY) + "_") + ob.rightX].walkable; ob.downright = game[(("t_" + ob.downY) + "_") + ob.rightX].walkable; } fscommand ("allowscale", false); myMap1 = [[1, 1, 5, 5, 5, 5, 5, 5, 1, 1], [1, 2, 1, 5, 5, 5, 5, 1, 0, 1], [1, 0, 1, 5, 5, 5, 1, 1, 0, 1], [1, 0, 0, 1, 1, 1, 1, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1, 0, 0, 1], [1, 1, 0, 0, 0, 0, 0, 0, 1, 5], [5, 1, 1, 0, 0, 1, 1, 1, 5, 5], [5, 5, 1, 1, 1, 5, 5, 5, 5, 5], [5, 5, 5, 5, 5, 5, 5, 5, 5, 5]]; game = {tileW:30, tileH:30, currentMap:1, points:false}; game.Tile0 = function () { }; game.Tile0.prototype.walkable = true; game.Tile0.prototype.frame = 1; game.Tile1 = function () { }; game.Tile1.prototype.walkable = false; game.Tile1.prototype.frame = 2; game.Tile2 = function () { }; game.Tile2.prototype.walkable = false; game.Tile2.prototype.frame = 3; game.Tile5 = function () { }; game.Tile5.prototype.walkable = false; game.Tile5.prototype.frame = 5; unlockY = 1; unlockX = 1; char = {xtile:8, ytile:1, speed:3}; startingXtile = char.xtile; startingYtile = char.ytile; mylifes.gotoandstop(_root.lifes); myEnemies = [[1, 1, 4], [3, 1, 3], [2, 2, 5]]; game.Enemyp1 = function () { }; game.Enemyp1.prototype.xMove = 1; game.Enemyp1.prototype.yMove = 0; game.Enemyp1.prototype.speed = 2; game.Enemyp2 = function () { }; game.Enemyp2.prototype.xMove = 1; game.Enemyp2.prototype.yMove = 0; game.Enemyp2.prototype.speed = 1; game.Enemyp3 = function () { }; game.Enemyp3.prototype.xMove = 1; game.Enemyp3.prototype.yMove = 1; game.Enemyp3.prototype.speed = 1; myItems = [[1, 4, 6]]; game.Item1 = function () { }; game.Item1.prototype.points = false; buildMap(_root["myMap" + game.currentMap]); stop();
Instance of Symbol 25 MovieClip [empty] in Frame 9
onClipEvent (enterFrame) { _root.detectKeys(); }
Frame 10
stop();
Frame 11
stop(); function buildMap(map) { _root.attachMovie("empty", "tiles", ++d); game.clip = _root.tiles; game.clip._x = 30; game.clip._y = 30; var mapWidth = map[0].length; var mapHeight = map.length; var i = 0; while (i < mapHeight) { var j = 0; while (j < mapWidth) { var name = ((("t_" + i) + "_") + j); game[name] = new game["Tile" + map[i][j]](); game.clip.attachMovie("tile", name, (i * 100) + (j * 2)); game.clip[name]._x = j * game.tileW; game.clip[name]._y = i * game.tileH; game.clip[name].gotoandstop(game[name].frame); j++; } i++; } game.items = myItems; var i = 0; while (i < game.items.length) { var name = ((("item" + game.items[i][2]) + "_") + game.items[i][1]); game[name] = new game["Item" + game.items[i][0]](); game[name].position = i; game.clip.attachMovie("item", name, 10009 + i); game[name].clip = game.clip[name]; game[name].clip._x = (game.items[i][1] * game.tileW) + (game.tileW / 2); game[name].clip._y = (game.items[i][2] * game.tileH) + (game.tileH / 2); game[name].clip.gotoandstop(game.items[i][0]); i++; } var enemies = myEnemies; game.currentEnemies = enemies.length; var i = 0; while (i < game.currentEnemies) { var name = ("enemy" + i); game[name] = new game["Enemyp" + enemies[i][0]](); game.clip.attachMovie("enemy1", name, 10001 + i); game[name].clip = game.clip[name]; game[name].xtile = enemies[i][1]; game[name].ytile = enemies[i][2]; game[name].width = game.clip[name]._width / 2; game[name].height = game.clip[name]._height / 2; game[name].x = (game[name].xtile * game.tileW) + (game.tileW / 2); game[name].y = (game[name].ytile * game.tileH) + (game.tileH / 2); game[name].clip._x = game[name].x; game[name].clip._y = game[name].y; i++; } game.clip.attachMovie("char", "char", 1000); char.clip = game.clip.char; char.x = (char.xtile * game.tileW) + (game.tileW / 2); char.y = (char.ytile * game.tileH) + (game.tileH / 2); char.width = char.clip._width / 2; char.height = char.clip._height / 2; char.clip._x = char.x; char.clip._y = char.y; } function enemyBrain() { var i = 0; while (i < 5) { var name = ("enemy" + i); var ob = game[name]; getMyCorners(ob.x + (ob.speed * ob.xMove), ob.y + (ob.speed * ob.yMove), ob); if (((ob.downleft and ob.upleft) and ob.downright) and ob.upleft) { moveChar(ob, ob.xMove, ob.yMove); } else { ob.xMove = -ob.xMove; ob.yMove = -ob.yMove; } var xdist = (ob.x - char.x); var ydist = (ob.y - char.y); if (math.sqrt((xdist * xdist) + (ydist * ydist)) < (ob.width + char.width)) { char.x = (startingXtile * game.tileW) + (game.tileW / 2); char.y = (startingYtile * game.tileH) + (game.tileH / 2); char.clip._x = char.x; char.clip._y = char.y; _root.lifes = _root.lifes - 1; youdied.gotoandplay(2); mylifes.gotoandstop(_root.lifes); if (lifes == 0) { removeMovieClip(_root.tiles); gotoAndStop (36); } } i++; } } function detectKeys() { var ob = _root.char; var keypressed = false; if (key.isDown(Key.RIGHT)) { keyPressed = _root.moveChar(ob, 1, 0); } else if (key.isDown(Key.LEFT)) { keyPressed = _root.moveChar(ob, -1, 0); } else if (key.isDown(Key.UP)) { keyPressed = _root.moveChar(ob, 0, -1); } else if (key.isDown(Key.DOWN)) { keyPressed = _root.moveChar(ob, 0, 1); } if (!KeyPressed) { ob.clip.mychar.gotoandstop(1); } else { ob.clip.mychar.play(); } _root.enemyBrain(); } function moveChar(ob, dirx, diry) { getMyCorners(ob.x, ob.y + (ob.speed * diry), ob); if (diry == -1) { if (ob.upleft and ob.upright) { ob.y = ob.y + (ob.speed * diry); } else { ob.y = (ob.ytile * game.tileH) + ob.height; } } if (diry == 1) { if (ob.downleft and ob.downright) { ob.y = ob.y + (ob.speed * diry); } else { ob.y = ((ob.ytile + 1) * game.tileH) - ob.height; } } getMyCorners(ob.x + (ob.speed * dirx), ob.y, ob); if (dirx == -1) { if (ob.downleft and ob.upleft) { ob.x = ob.x + (ob.speed * dirx); } else { ob.x = (ob.xtile * game.tileW) + ob.width; } } if (dirx == 1) { if (ob.upright and ob.downright) { ob.x = ob.x + (ob.speed * dirx); } else { ob.x = ((ob.xtile + 1) * game.tileW) - ob.width; } } ob.clip._x = ob.x; ob.clip._y = ob.y; ob.clip.gotoandstop((dirx + (diry * 2)) + 3); ob.xtile = Math.floor(ob.clip._x / game.tileW); ob.ytile = Math.floor(ob.clip._y / game.tileH); var itemname = game[(("item" + ob.ytile) + "_") + ob.xtile]; if (itemname and (ob == _root.char)) { game.points = true; removeMovieClip(itemname.clip); game.items[itemname.position] = 0; delete game[(("item" + ob.ytile) + "_") + ob.xtile]; var name = "enemy3"; game[name] = new game.Enemyp3(); game.clip.attachMovie("enemy1", name, 10005); game[name].clip = game.clip[name]; game[name].xtile = 4; game[name].ytile = 2; game[name].width = game.clip[name]._width / 2; game[name].height = game.clip[name]._height / 2; game[name].x = (game[name].xtile * game.tileW) + (game.tileW / 2); game[name].y = (game[name].ytile * game.tileH) + (game.tileH / 2); game[name].clip._x = game[name].x; game[name].clip._y = game[name].y; if ((game.points = true)) { opendoorname = (("t_" + unlockY) + "_") + unlockX; game.clip[opendoorname].gotoandstop(4); game.Tile2.prototype.walkable = true; } } if ((_root.char.ytile == unlockY) && (_root.char.xtile == unlockX)) { removeMovieClip(_root.tiles); lostlifes = lifes; gotoAndStop (12); } if ((_root.char.ytile == 4) && (_root.char.xtile == 4)) { var name = "enemy3"; game[name].xMove = 0; game[name].yMove = -1; game[name].speed = 0.5; } return(true); } function getMyCorners(x, y, ob) { ob.downY = Math.floor(((y + ob.height) - 1) / game.tileH); ob.upY = Math.floor((y - ob.height) / game.tileH); ob.leftX = Math.floor((x - ob.width) / game.tileW); ob.rightX = Math.floor(((x + ob.width) - 1) / game.tileW); ob.upleft = game[(("t_" + ob.upY) + "_") + ob.leftX].walkable; ob.downleft = game[(("t_" + ob.downY) + "_") + ob.leftX].walkable; ob.upright = game[(("t_" + ob.upY) + "_") + ob.rightX].walkable; ob.downright = game[(("t_" + ob.downY) + "_") + ob.rightX].walkable; } fscommand ("allowscale", false); myMap1 = [[5, 5, 1, 1, 1, 1, 5, 5, 5, 5], [5, 5, 1, 2, 0, 1, 1, 5, 5, 5], [5, 5, 1, 1, 0, 0, 1, 5, 5, 5], [5, 5, 1, 0, 0, 1, 1, 1, 1, 1], [5, 5, 1, 0, 0, 0, 0, 0, 0, 1], [5, 5, 1, 0, 0, 0, 1, 0, 1, 1], [5, 5, 1, 1, 0, 1, 1, 1, 1, 5], [5, 5, 1, 0, 0, 1, 5, 5, 5, 5], [5, 5, 1, 1, 1, 5, 5, 5, 5, 5]]; game = {tileW:30, tileH:30, currentMap:1, points:false}; game.Tile0 = function () { }; game.Tile0.prototype.walkable = true; game.Tile0.prototype.frame = 1; game.Tile1 = function () { }; game.Tile1.prototype.walkable = false; game.Tile1.prototype.frame = 2; game.Tile2 = function () { }; game.Tile2.prototype.walkable = false; game.Tile2.prototype.frame = 3; game.Tile5 = function () { }; game.Tile5.prototype.walkable = false; game.Tile5.prototype.frame = 5; unlockY = 1; unlockX = 3; char = {xtile:4, ytile:7, speed:3}; startingXtile = char.xtile; startingYtile = char.ytile; mylifes.gotoandstop(_root.lifes); myEnemies = [[1, 3, 4], [2, 4, 2]]; game.Enemyp1 = function () { }; game.Enemyp1.prototype.xMove = 1; game.Enemyp1.prototype.yMove = 0; game.Enemyp1.prototype.speed = 1; game.Enemyp2 = function () { }; game.Enemyp2.prototype.xMove = 1; game.Enemyp2.prototype.yMove = 0; game.Enemyp2.prototype.speed = 1; game.Enemyp3 = function () { }; game.Enemyp3.prototype.xMove = 0; game.Enemyp3.prototype.yMove = 1; game.Enemyp3.prototype.speed = 1; myItems = [[1, 7, 5]]; game.Item1 = function () { }; game.Item1.prototype.points = false; buildMap(_root["myMap" + game.currentMap]); stop();
Instance of Symbol 25 MovieClip [empty] in Frame 11
onClipEvent (enterFrame) { _root.detectKeys(); }
Frame 12
stop();
Frame 13
stop(); function buildMap(map) { _root.attachMovie("empty", "tiles", ++d); game.clip = _root.tiles; game.clip._x = 30; game.clip._y = 30; var mapWidth = map[0].length; var mapHeight = map.length; var i = 0; while (i < mapHeight) { var j = 0; while (j < mapWidth) { var name = ((("t_" + i) + "_") + j); game[name] = new game["Tile" + map[i][j]](); game.clip.attachMovie("tile", name, (i * 100) + (j * 2)); game.clip[name]._x = j * game.tileW; game.clip[name]._y = i * game.tileH; game.clip[name].gotoandstop(game[name].frame); j++; } i++; } game.items = myItems; var i = 0; while (i < game.items.length) { var name = ((("item" + game.items[i][2]) + "_") + game.items[i][1]); game[name] = new game["Item" + game.items[i][0]](); game[name].position = i; game.clip.attachMovie("item", name, 10009 + i); game[name].clip = game.clip[name]; game[name].clip._x = (game.items[i][1] * game.tileW) + (game.tileW / 2); game[name].clip._y = (game.items[i][2] * game.tileH) + (game.tileH / 2); game[name].clip.gotoandstop(game.items[i][0]); i++; } var enemies = myEnemies; game.currentEnemies = enemies.length; var i = 0; while (i < game.currentEnemies) { var name = ("enemy" + i); game[name] = new game["Enemyp" + enemies[i][0]](); game.clip.attachMovie("enemy1", name, 10001 + i); game[name].clip = game.clip[name]; game[name].xtile = enemies[i][1]; game[name].ytile = enemies[i][2]; game[name].width = game.clip[name]._width / 2; game[name].height = game.clip[name]._height / 2; game[name].x = (game[name].xtile * game.tileW) + (game.tileW / 2); game[name].y = (game[name].ytile * game.tileH) + (game.tileH / 2); game[name].clip._x = game[name].x; game[name].clip._y = game[name].y; i++; } game.clip.attachMovie("char", "char", 1000); char.clip = game.clip.char; char.x = (char.xtile * game.tileW) + (game.tileW / 2); char.y = (char.ytile * game.tileH) + (game.tileH / 2); char.width = char.clip._width / 2; char.height = char.clip._height / 2; char.clip._x = char.x; char.clip._y = char.y; } function enemyBrain() { var i = 0; while (i < 5) { var name = ("enemy" + i); var ob = game[name]; getMyCorners(ob.x + (ob.speed * ob.xMove), ob.y + (ob.speed * ob.yMove), ob); if (((ob.downleft and ob.upleft) and ob.downright) and ob.upleft) { moveChar(ob, ob.xMove, ob.yMove); } else { ob.xMove = -ob.xMove; ob.yMove = -ob.yMove; } var xdist = (ob.x - char.x); var ydist = (ob.y - char.y); if (math.sqrt((xdist * xdist) + (ydist * ydist)) < (ob.width + char.width)) { char.x = (startingXtile * game.tileW) + (game.tileW / 2); char.y = (startingYtile * game.tileH) + (game.tileH / 2); char.clip._x = char.x; char.clip._y = char.y; _root.lifes = _root.lifes - 1; youdied.gotoandplay(2); mylifes.gotoandstop(_root.lifes); if (lifes == 0) { removeMovieClip(_root.tiles); gotoAndStop (36); } } i++; } } function detectKeys() { var ob = _root.char; var keypressed = false; if (key.isDown(Key.RIGHT)) { keyPressed = _root.moveChar(ob, 1, 0); } else if (key.isDown(Key.LEFT)) { keyPressed = _root.moveChar(ob, -1, 0); } else if (key.isDown(Key.UP)) { keyPressed = _root.moveChar(ob, 0, -1); } else if (key.isDown(Key.DOWN)) { keyPressed = _root.moveChar(ob, 0, 1); } if (!KeyPressed) { ob.clip.mychar.gotoandstop(1); } else { ob.clip.mychar.play(); } _root.enemyBrain(); } function moveChar(ob, dirx, diry) { getMyCorners(ob.x, ob.y + (ob.speed * diry), ob); if (diry == -1) { if (ob.upleft and ob.upright) { ob.y = ob.y + (ob.speed * diry); } else { ob.y = (ob.ytile * game.tileH) + ob.height; } } if (diry == 1) { if (ob.downleft and ob.downright) { ob.y = ob.y + (ob.speed * diry); } else { ob.y = ((ob.ytile + 1) * game.tileH) - ob.height; } } getMyCorners(ob.x + (ob.speed * dirx), ob.y, ob); if (dirx == -1) { if (ob.downleft and ob.upleft) { ob.x = ob.x + (ob.speed * dirx); } else { ob.x = (ob.xtile * game.tileW) + ob.width; } } if (dirx == 1) { if (ob.upright and ob.downright) { ob.x = ob.x + (ob.speed * dirx); } else { ob.x = ((ob.xtile + 1) * game.tileW) - ob.width; } } ob.clip._x = ob.x; ob.clip._y = ob.y; ob.clip.gotoandstop((dirx + (diry * 2)) + 3); ob.xtile = Math.floor(ob.clip._x / game.tileW); ob.ytile = Math.floor(ob.clip._y / game.tileH); var itemname = game[(("item" + ob.ytile) + "_") + ob.xtile]; if (itemname and (ob == _root.char)) { game.points = true; removeMovieClip(itemname.clip); game.items[itemname.position] = 0; delete game[(("item" + ob.ytile) + "_") + ob.xtile]; var name = "enemy3"; game[name] = new game.Enemyp1(); game.clip.attachMovie("enemy1", name, 10005); game[name].clip = game.clip[name]; game[name].xtile = 2; game[name].ytile = 2; game[name].width = game.clip[name]._width / 2; game[name].height = game.clip[name]._height / 2; game[name].x = (game[name].xtile * game.tileW) + (game.tileW / 2); game[name].y = (game[name].ytile * game.tileH) + (game.tileH / 2); game[name].clip._x = game[name].x; game[name].clip._y = game[name].y; var name = "enemy4"; game[name] = new game.Enemyp2(); game.clip.attachMovie("enemy1", name, 10006); game[name].clip = game.clip[name]; game[name].xtile = 2; game[name].ytile = 2; game[name].width = game.clip[name]._width / 2; game[name].height = game.clip[name]._height / 2; game[name].x = (game[name].xtile * game.tileW) + (game.tileW / 2); game[name].y = (game[name].ytile * game.tileH) + (game.tileH / 2); game[name].clip._x = game[name].x; game[name].clip._y = game[name].y; var name = "enemy2"; game[name].xMove = 1; game[name].yMove = 0; game[name].speed = 2; if ((game.points = true)) { opendoorname = (("t_" + unlockY) + "_") + unlockX; game.clip[opendoorname].gotoandstop(4); game.Tile2.prototype.walkable = true; } } if ((_root.char.ytile == 4) && (_root.char.xtile == 2)) { var name = "enemy3"; game[name].xMove = 0; game[name].yMove = -1; game[name].speed = 1.2; var name = "enemy4"; game[name].xMove = 0; game[name].yMove = -1; game[name].speed = 1.5; } if ((_root.char.ytile == unlockY) && (_root.char.xtile == unlockX)) { removeMovieClip(_root.tiles); lostlifes = lifes; gotoAndStop (14); } return(true); } function getMyCorners(x, y, ob) { ob.downY = Math.floor(((y + ob.height) - 1) / game.tileH); ob.upY = Math.floor((y - ob.height) / game.tileH); ob.leftX = Math.floor((x - ob.width) / game.tileW); ob.rightX = Math.floor(((x + ob.width) - 1) / game.tileW); ob.upleft = game[(("t_" + ob.upY) + "_") + ob.leftX].walkable; ob.downleft = game[(("t_" + ob.downY) + "_") + ob.leftX].walkable; ob.upright = game[(("t_" + ob.upY) + "_") + ob.rightX].walkable; ob.downright = game[(("t_" + ob.downY) + "_") + ob.rightX].walkable; } fscommand ("allowscale", false); myMap1 = [[5, 5, 5, 5, 5, 5, 5, 5, 5, 5], [5, 1, 1, 1, 1, 1, 1, 1, 1, 5], [5, 1, 2, 1, 0, 0, 0, 0, 1, 5], [5, 1, 0, 1, 1, 0, 0, 0, 1, 5], [5, 1, 0, 0, 1, 1, 0, 0, 1, 5], [5, 1, 0, 1, 1, 1, 1, 0, 1, 5], [5, 1, 0, 0, 0, 0, 0, 0, 1, 5], [5, 1, 1, 1, 1, 1, 1, 0, 1, 5], [5, 5, 5, 5, 5, 5, 1, 1, 1, 5]]; game = {tileW:30, tileH:30, currentMap:1, points:false}; game.Tile0 = function () { }; game.Tile0.prototype.walkable = true; game.Tile0.prototype.frame = 1; game.Tile1 = function () { }; game.Tile1.prototype.walkable = false; game.Tile1.prototype.frame = 2; game.Tile2 = function () { }; game.Tile2.prototype.walkable = false; game.Tile2.prototype.frame = 3; game.Tile5 = function () { }; game.Tile5.prototype.walkable = false; game.Tile5.prototype.frame = 5; unlockY = 2; unlockX = 2; char = {xtile:6, ytile:6, speed:3}; startingXtile = char.xtile; startingYtile = char.ytile; mylifes.gotoandstop(_root.lifes); myEnemies = [[3, 7, 4], [2, 6, 2], [2, 5, 2]]; game.Enemyp1 = function () { }; game.Enemyp1.prototype.xMove = 0; game.Enemyp1.prototype.yMove = 1; game.Enemyp1.prototype.speed = 2; game.Enemyp2 = function () { }; game.Enemyp2.prototype.xMove = 0; game.Enemyp2.prototype.yMove = 1; game.Enemyp2.prototype.speed = 0.5; game.Enemyp3 = function () { }; game.Enemyp3.prototype.xMove = 0; game.Enemyp3.prototype.yMove = 1; game.Enemyp3.prototype.speed = 1; myItems = [[1, 7, 2]]; game.Item1 = function () { }; game.Item1.prototype.points = false; buildMap(_root["myMap" + game.currentMap]); stop();
Instance of Symbol 25 MovieClip [empty] in Frame 13
onClipEvent (enterFrame) { _root.detectKeys(); }
Frame 14
stop();
Frame 15
stop(); function buildMap(map) { _root.attachMovie("empty", "tiles", ++d); game.clip = _root.tiles; game.clip._x = 30; game.clip._y = 30; var mapWidth = map[0].length; var mapHeight = map.length; var i = 0; while (i < mapHeight) { var j = 0; while (j < mapWidth) { var name = ((("t_" + i) + "_") + j); game[name] = new game["Tile" + map[i][j]](); game.clip.attachMovie("tile", name, (i * 100) + (j * 2)); game.clip[name]._x = j * game.tileW; game.clip[name]._y = i * game.tileH; game.clip[name].gotoandstop(game[name].frame); j++; } i++; } game.items = myItems; var i = 0; while (i < game.items.length) { var name = ((("item" + game.items[i][2]) + "_") + game.items[i][1]); game[name] = new game["Item" + game.items[i][0]](); game[name].position = i; game.clip.attachMovie("item", name, 10020 + i); game[name].clip = game.clip[name]; game[name].clip._x = (game.items[i][1] * game.tileW) + (game.tileW / 2); game[name].clip._y = (game.items[i][2] * game.tileH) + (game.tileH / 2); game[name].clip.gotoandstop(game.items[i][0]); i++; } var enemies = myEnemies; game.currentEnemies = enemies.length; var i = 0; while (i < game.currentEnemies) { var name = ("enemy" + i); game[name] = new game["Enemyp" + enemies[i][0]](); game.clip.attachMovie("enemy1", name, 10010 + i); game[name].clip = game.clip[name]; game[name].xtile = enemies[i][1]; game[name].ytile = enemies[i][2]; game[name].width = game.clip[name]._width / 2; game[name].height = game.clip[name]._height / 2; game[name].x = (game[name].xtile * game.tileW) + (game.tileW / 2); game[name].y = (game[name].ytile * game.tileH) + (game.tileH / 2); game[name].clip._x = game[name].x; game[name].clip._y = game[name].y; i++; } game.clip.attachMovie("char", "char", 10000); char.clip = game.clip.char; char.x = (char.xtile * game.tileW) + (game.tileW / 2); char.y = (char.ytile * game.tileH) + (game.tileH / 2); char.width = char.clip._width / 2; char.height = char.clip._height / 2; char.clip._x = char.x; char.clip._y = char.y; } function enemyBrain() { var i = 0; while (i < 10) { var name = ("enemy" + i); var ob = game[name]; getMyCorners(ob.x + (ob.speed * ob.xMove), ob.y + (ob.speed * ob.yMove), ob); if (((ob.downleft and ob.upleft) and ob.downright) and ob.upleft) { moveChar(ob, ob.xMove, ob.yMove); } else { ob.xMove = -ob.xMove; ob.yMove = -ob.yMove; } var xdist = (ob.x - char.x); var ydist = (ob.y - char.y); if (math.sqrt((xdist * xdist) + (ydist * ydist)) < (ob.width + char.width)) { char.x = (startingXtile * game.tileW) + (game.tileW / 2); char.y = (startingYtile * game.tileH) + (game.tileH / 2); char.clip._x = char.x; char.clip._y = char.y; _root.lifes = _root.lifes - 1; youdied.gotoandplay(2); mylifes.gotoandstop(_root.lifes); if (lifes == 0) { removeMovieClip(_root.tiles); gotoAndStop (36); } } i++; } } function detectKeys() { var ob = _root.char; var keypressed = false; if (key.isDown(Key.RIGHT)) { keyPressed = _root.moveChar(ob, 1, 0); } else if (key.isDown(Key.LEFT)) { keyPressed = _root.moveChar(ob, -1, 0); } else if (key.isDown(Key.UP)) { keyPressed = _root.moveChar(ob, 0, -1); } else if (key.isDown(Key.DOWN)) { keyPressed = _root.moveChar(ob, 0, 1); } if (!KeyPressed) { ob.clip.mychar.gotoandstop(1); } else { ob.clip.mychar.play(); } _root.enemyBrain(); } function moveChar(ob, dirx, diry) { getMyCorners(ob.x, ob.y + (ob.speed * diry), ob); if (diry == -1) { if (ob.upleft and ob.upright) { ob.y = ob.y + (ob.speed * diry); } else { ob.y = (ob.ytile * game.tileH) + ob.height; } } if (diry == 1) { if (ob.downleft and ob.downright) { ob.y = ob.y + (ob.speed * diry); } else { ob.y = ((ob.ytile + 1) * game.tileH) - ob.height; } } getMyCorners(ob.x + (ob.speed * dirx), ob.y, ob); if (dirx == -1) { if (ob.downleft and ob.upleft) { ob.x = ob.x + (ob.speed * dirx); } else { ob.x = (ob.xtile * game.tileW) + ob.width; } } if (dirx == 1) { if (ob.upright and ob.downright) { ob.x = ob.x + (ob.speed * dirx); } else { ob.x = ((ob.xtile + 1) * game.tileW) - ob.width; } } ob.clip._x = ob.x; ob.clip._y = ob.y; ob.clip.gotoandstop((dirx + (diry * 2)) + 3); ob.xtile = Math.floor(ob.clip._x / game.tileW); ob.ytile = Math.floor(ob.clip._y / game.tileH); var itemname = game[(("item" + ob.ytile) + "_") + ob.xtile]; if (itemname and (ob == _root.char)) { game.points = game.points + itemname.points; removeMovieClip(itemname.clip); game.items[itemname.position] = 0; delete game[(("item" + ob.ytile) + "_") + ob.xtile]; } if (game.points == 1) { openwallname = "t_1_6"; game.clip[openwallname].gotoandstop(1); openwallname = "t_3_3"; game.clip[openwallname].gotoandstop(1); openwallname2 = "t_2_3"; game.clip[openwallname2].gotoandstop(1); openwallname3 = "t_1_3"; game.clip[openwallname3].gotoandstop(1); game.Tile7.prototype.walkable = true; } if (game.points == 1) { opendoorname = (("t_" + unlockY) + "_") + unlockX; game.clip[opendoorname].gotoandstop(4); game.Tile2.prototype.walkable = true; } if ((_root.char.ytile == unlockY) && (_root.char.xtile == unlockX)) { removeMovieClip(_root.tiles); lostlifes = lifes; gotoAndStop (16); } if (((((((_root.char.ytile == 7) && (_root.char.xtile == 2)) || ((_root.char.ytile == 1) && (_root.char.xtile == 9))) || ((_root.char.ytile == 5) && (_root.char.xtile == 4))) || ((_root.char.ytile == 0) && (_root.char.xtile == 0))) || ((_root.char.ytile == 7) && (_root.char.xtile == 2))) || ((_root.char.ytile == 7) && (_root.char.xtile == 3))) { _root.char.speed = 0.5; } else { _root.char.speed = 3; } return(true); } function getMyCorners(x, y, ob) { ob.downY = Math.floor(((y + ob.height) - 1) / game.tileH); ob.upY = Math.floor((y - ob.height) / game.tileH); ob.leftX = Math.floor((x - ob.width) / game.tileW); ob.rightX = Math.floor(((x + ob.width) - 1) / game.tileW); ob.upleft = game[(("t_" + ob.upY) + "_") + ob.leftX].walkable; ob.downleft = game[(("t_" + ob.downY) + "_") + ob.leftX].walkable; ob.upright = game[(("t_" + ob.upY) + "_") + ob.rightX].walkable; ob.downright = game[(("t_" + ob.downY) + "_") + ob.rightX].walkable; } fscommand ("allowscale", false); myMap1 = [[1, 0, 1, 0, 1, 0, 1, 0, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 6], [1, 0, 1, 0, 1, 0, 1, 0, 1, 1], [1, 0, 1, 0, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 0, 1, 1, 0, 1, 1], [1, 0, 0, 0, 6, 0, 0, 0, 1, 1], [1, 1, 1, 0, 1, 1, 1, 0, 0, 1], [1, 2, 6, 6, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]; game = {tileW:30, tileH:30, currentMap:1, points:0, wallkey:false}; game.Tile0 = function () { }; game.Tile0.prototype.walkable = true; game.Tile0.prototype.frame = 1; game.Tile1 = function () { }; game.Tile1.prototype.walkable = false; game.Tile1.prototype.frame = 2; game.Tile2 = function () { }; game.Tile2.prototype.walkable = false; game.Tile2.prototype.frame = 3; game.Tile5 = function () { }; game.Tile5.prototype.walkable = false; game.Tile5.prototype.frame = 5; game.Tile6 = function () { }; game.Tile6.prototype.walkable = true; game.Tile6.prototype.frame = 6; game.Tile7 = function () { }; game.Tile7.prototype.walkable = false; game.Tile7.prototype.frame = 2; unlockY = 7; unlockX = 1; char = {xtile:8, ytile:7, speed:3}; startingXtile = char.xtile; startingYtile = char.ytile; mylifes.gotoandstop(_root.lifes); myEnemies = [[1, 1, 2], [1, 3, 2], [3, 3, 1], [3, 5, 5], [3, 2, 7], [1, 7, 1], [2, 5, 2]]; game.Enemyp1 = function () { }; game.Enemyp1.prototype.xMove = 0; game.Enemyp1.prototype.yMove = 1; game.Enemyp1.prototype.speed = 1.5; game.Enemyp2 = function () { }; game.Enemyp2.prototype.xMove = 0; game.Enemyp2.prototype.yMove = 1; game.Enemyp2.prototype.speed = 0.5; game.Enemyp3 = function () { }; game.Enemyp3.prototype.xMove = 1; game.Enemyp3.prototype.yMove = 0; game.Enemyp3.prototype.speed = 1; game.Enemyp4 = function () { }; game.Enemyp4.prototype.xMove = 0; game.Enemyp4.prototype.yMove = 1; game.Enemyp4.prototype.speed = 1.5; game.Enemyp5 = function () { }; game.Enemyp5.prototype.xMove = 1; game.Enemyp5.prototype.yMove = 0; game.Enemyp5.prototype.speed = 0.5; myItems = [[1, 1, 0], [2, 3, 0], [3, 5, 0], [4, 7, 0]]; myRandom = (math.random() * 3) + 1; myRandom = math.round(myRandom); game.Item1 = function () { }; if (myRandom == 1) { game.Item1.prototype.points = 1; } else { game.Item1.prototype.points = 0; } game.Item2 = function () { }; if (myRandom == 2) { game.Item2.prototype.points = 1; } else { game.Item2.prototype.points = 0; } game.Item3 = function () { }; if (myRandom == 3) { game.Item3.prototype.points = 1; } else { game.Item3.prototype.points = 0; } game.Item4 = function () { }; if (myRandom == 4) { game.Item4.prototype.points = 1; } else { game.Item4.prototype.points = 0; } buildMap(_root["myMap" + game.currentMap]); stop();
Instance of Symbol 25 MovieClip [empty] in Frame 15
onClipEvent (enterFrame) { _root.detectKeys(); }
Frame 16
stop();
Frame 17
stop(); function buildMap(map) { _root.attachMovie("empty", "tiles", ++d); game.clip = _root.tiles; game.clip._x = 30; game.clip._y = 30; var mapWidth = map[0].length; var mapHeight = map.length; var i = 0; while (i < mapHeight) { var j = 0; while (j < mapWidth) { var name = ((("t_" + i) + "_") + j); game[name] = new game["Tile" + map[i][j]](); game.clip.attachMovie("tile", name, (i * 100) + (j * 2)); game.clip[name]._x = j * game.tileW; game.clip[name]._y = i * game.tileH; game.clip[name].gotoandstop(game[name].frame); j++; } i++; } game.items = myItems; var i = 0; while (i < game.items.length) { var name = ((("item" + game.items[i][2]) + "_") + game.items[i][1]); game[name] = new game["Item" + game.items[i][0]](); game[name].position = i; game.clip.attachMovie("item", name, 10008 + i); game[name].clip = game.clip[name]; game[name].clip._x = (game.items[i][1] * game.tileW) + (game.tileW / 2); game[name].clip._y = (game.items[i][2] * game.tileH) + (game.tileH / 2); game[name].clip.gotoandstop(game.items[i][0]); i++; } var enemies = myEnemies; game.currentEnemies = enemies.length; var i = 0; while (i < game.currentEnemies) { var name = ("enemy" + i); game[name] = new game["Enemyp" + enemies[i][0]](); game.clip.attachMovie("enemy1", name, 10010 + i); game[name].clip = game.clip[name]; game[name].xtile = enemies[i][1]; game[name].ytile = enemies[i][2]; game[name].width = game.clip[name]._width / 2; game[name].height = game.clip[name]._height / 2; game[name].x = (game[name].xtile * game.tileW) + (game.tileW / 2); game[name].y = (game[name].ytile * game.tileH) + (game.tileH / 2); game[name].clip._x = game[name].x; game[name].clip._y = game[name].y; i++; } game.clip.attachMovie("char", "char", 10000); char.clip = game.clip.char; char.x = (char.xtile * game.tileW) + (game.tileW / 2); char.y = (char.ytile * game.tileH) + (game.tileH / 2); char.width = char.clip._width / 2; char.height = char.clip._height / 2; char.clip._x = char.x; char.clip._y = char.y; } function enemyBrain() { var i = 0; while (i < 10) { var name = ("enemy" + i); var ob = game[name]; getMyCorners(ob.x + (ob.speed * ob.xMove), ob.y + (ob.speed * ob.yMove), ob); if (((ob.downleft and ob.upleft) and ob.downright) and ob.upleft) { moveChar(ob, ob.xMove, ob.yMove); } else { ob.xMove = -ob.xMove; ob.yMove = -ob.yMove; } var xdist = (ob.x - char.x); var ydist = (ob.y - char.y); if (math.sqrt((xdist * xdist) + (ydist * ydist)) < (ob.width + char.width)) { char.x = (startingXtile * game.tileW) + (game.tileW / 2); char.y = (startingYtile * game.tileH) + (game.tileH / 2); char.clip._x = char.x; char.clip._y = char.y; _root.lifes = _root.lifes - 1; youdied.gotoandplay(2); mylifes.gotoandstop(_root.lifes); if (lifes == 0) { removeMovieClip(_root.tiles); gotoAndStop (36); } } i++; } } function detectKeys() { var ob = _root.char; var keypressed = false; if (key.isDown(Key.RIGHT)) { keyPressed = _root.moveChar(ob, 1, 0); } else if (key.isDown(Key.LEFT)) { keyPressed = _root.moveChar(ob, -1, 0); } else if (key.isDown(Key.UP)) { keyPressed = _root.moveChar(ob, 0, -1); } else if (key.isDown(Key.DOWN)) { keyPressed = _root.moveChar(ob, 0, 1); } if (!KeyPressed) { ob.clip.mychar.gotoandstop(1); } else { ob.clip.mychar.play(); } _root.enemyBrain(); } function moveChar(ob, dirx, diry) { getMyCorners(ob.x, ob.y + (ob.speed * diry), ob); if (diry == -1) { if (ob.upleft and ob.upright) { ob.y = ob.y + (ob.speed * diry); } else { ob.y = (ob.ytile * game.tileH) + ob.height; } } if (diry == 1) { if (ob.downleft and ob.downright) { ob.y = ob.y + (ob.speed * diry); } else { ob.y = ((ob.ytile + 1) * game.tileH) - ob.height; } } getMyCorners(ob.x + (ob.speed * dirx), ob.y, ob); if (dirx == -1) { if (ob.downleft and ob.upleft) { ob.x = ob.x + (ob.speed * dirx); } else { ob.x = (ob.xtile * game.tileW) + ob.width; } } if (dirx == 1) { if (ob.upright and ob.downright) { ob.x = ob.x + (ob.speed * dirx); } else { ob.x = ((ob.xtile + 1) * game.tileW) - ob.width; } } ob.clip._x = ob.x; ob.clip._y = ob.y; ob.clip.gotoandstop((dirx + (diry * 2)) + 3); ob.xtile = Math.floor(ob.clip._x / game.tileW); ob.ytile = Math.floor(ob.clip._y / game.tileH); var itemname = game[(("item" + ob.ytile) + "_") + ob.xtile]; if (itemname and (ob == _root.char)) { game.points = game.points + itemname.points; removeMovieClip(itemname.clip); game.items[itemname.position] = 0; delete game[(("item" + ob.ytile) + "_") + ob.xtile]; } if (game.points == 1) { openwallname = "t_1_6"; game.clip[openwallname].gotoandstop(1); openwallname = "t_3_3"; game.clip[openwallname].gotoandstop(1); openwallname2 = "t_2_3"; game.clip[openwallname2].gotoandstop(1); openwallname3 = "t_1_3"; game.clip[openwallname3].gotoandstop(1); game.Tile7.prototype.walkable = true; } if (game.points == 2) { opendoorname = (("t_" + unlockY) + "_") + unlockX; game.clip[opendoorname].gotoandstop(4); game.Tile2.prototype.walkable = true; } if ((_root.char.ytile == unlockY) && (_root.char.xtile == unlockX)) { removeMovieClip(_root.tiles); lostlifes = lifes; gotoAndStop (41); } if ((((((((_root.char.ytile == 7) && (_root.char.xtile == 2)) || ((_root.char.ytile == 7) && (_root.char.xtile == 3))) || ((_root.char.ytile == 7) && (_root.char.xtile == 6))) || ((_root.char.ytile == 1) && (_root.char.xtile == 7))) || ((_root.char.ytile == 2) && (_root.char.xtile == 4))) || ((_root.char.ytile == 3) && (_root.char.xtile == 4))) || ((_root.char.ytile == 3) && (_root.char.xtile == 2))) { _root.char.speed = 0.5; } else { _root.char.speed = 3; } return(true); } function getMyCorners(x, y, ob) { ob.downY = Math.floor(((y + ob.height) - 1) / game.tileH); ob.upY = Math.floor((y - ob.height) / game.tileH); ob.leftX = Math.floor((x - ob.width) / game.tileW); ob.rightX = Math.floor(((x + ob.width) - 1) / game.tileW); ob.upleft = game[(("t_" + ob.upY) + "_") + ob.leftX].walkable; ob.downleft = game[(("t_" + ob.downY) + "_") + ob.leftX].walkable; ob.upright = game[(("t_" + ob.upY) + "_") + ob.rightX].walkable; ob.downright = game[(("t_" + ob.downY) + "_") + ob.rightX].walkable; } fscommand ("allowscale", false); myMap1 = [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 7, 0, 0, 7, 6, 0, 1], [1, 0, 0, 7, 6, 0, 0, 1, 0, 1], [1, 0, 6, 7, 6, 0, 0, 0, 1, 1], [1, 2, 0, 1, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 0, 0, 0, 1], [1, 0, 1, 1, 0, 1, 0, 0, 1, 1], [1, 0, 6, 6, 0, 0, 6, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]; game = {tileW:30, tileH:30, currentMap:1, points:0, wallkey:false}; game.Tile0 = function () { }; game.Tile0.prototype.walkable = true; game.Tile0.prototype.frame = 1; game.Tile1 = function () { }; game.Tile1.prototype.walkable = false; game.Tile1.prototype.frame = 2; game.Tile2 = function () { }; game.Tile2.prototype.walkable = false; game.Tile2.prototype.frame = 3; game.Tile5 = function () { }; game.Tile5.prototype.walkable = false; game.Tile5.prototype.frame = 5; game.Tile6 = function () { }; game.Tile6.prototype.walkable = true; game.Tile6.prototype.frame = 6; game.Tile7 = function () { }; game.Tile7.prototype.walkable = false; game.Tile7.prototype.frame = 2; unlockY = 4; unlockX = 1; char = {xtile:1, ytile:6, speed:3}; startingXtile = char.xtile; startingYtile = char.ytile; mylifes.gotoandstop(_root.lifes); myEnemies = [[2, 1, 2], [2, 2, 1], [5, 1, 1], [3, 2, 2], [3, 1, 3], [3, 6, 7], [3, 7, 4], [2, 6, 2], [2, 5, 2], [2, 7, 4]]; game.Enemyp1 = function () { }; game.Enemyp1.prototype.xMove = 0; game.Enemyp1.prototype.yMove = 1; game.Enemyp1.prototype.speed = 2; game.Enemyp2 = function () { }; game.Enemyp2.prototype.xMove = 0; game.Enemyp2.prototype.yMove = 1; game.Enemyp2.prototype.speed = 0.5; game.Enemyp3 = function () { }; game.Enemyp3.prototype.xMove = 1; game.Enemyp3.prototype.yMove = 0; game.Enemyp3.prototype.speed = 1; game.Enemyp4 = function () { }; game.Enemyp4.prototype.xMove = 0; game.Enemyp4.prototype.yMove = 1; game.Enemyp4.prototype.speed = 1.5; game.Enemyp5 = function () { }; game.Enemyp5.prototype.xMove = 1; game.Enemyp5.prototype.yMove = 0; game.Enemyp5.prototype.speed = 0.5; myItems = [[1, 8, 1], [2, 6, 3]]; game.Item1 = function () { }; game.Item1.prototype.points = 1; game.Item2 = function () { }; game.Item2.prototype.points = 1; buildMap(_root["myMap" + game.currentMap]); stop();
Instance of Symbol 25 MovieClip [empty] in Frame 17
onClipEvent (enterFrame) { _root.detectKeys(); }
Frame 36
stop();
Frame 41
stop();
Frame 46
stop();
Symbol 10 MovieClip [item] Frame 1
stop();
Symbol 10 MovieClip [item] Frame 2
stop();
Symbol 10 MovieClip [item] Frame 3
stop();
Symbol 10 MovieClip [item] Frame 4
stop();
Symbol 21 MovieClip [char] Frame 1
stop();
Symbol 39 Button
on (release, keyPress "<Enter>") { gotoAndStop (3); stopAllSounds(); }
Symbol 44 Button
on (release, keyPress "<Enter>") { gotoAndStop (46); }
Symbol 52 MovieClip Frame 4
stop();
Symbol 54 MovieClip Frame 1
stop();
Symbol 59 Button
on (release, keyPress "<Enter>") { gotoAndPlay (5); }
Symbol 62 MovieClip Frame 1
stop();
Symbol 64 Button
on (release, keyPress "<Enter>") { gotoAndPlay (7); }
Symbol 66 Button
on (release, keyPress "<Enter>") { gotoAndPlay (9); }
Symbol 68 Button
on (release, keyPress "<Enter>") { gotoAndPlay (11); }
Symbol 70 Button
on (release, keyPress "<Enter>") { gotoAndPlay (13); }
Symbol 72 Button
on (release, keyPress "<Enter>") { gotoAndPlay (15); }
Symbol 74 Button
on (release, keyPress "<Enter>") { gotoAndPlay (17); }
Symbol 81 Button
on (release, keyPress "<Enter>") { gotoAndStop (2); }
Symbol 94 Button
on (release, keyPress "<Enter>") { stopAllSounds(); gotoAndStop (2); }

Library Items

Symbol 1 GraphicUsed by:7
Symbol 2 GraphicUsed by:7
Symbol 3 GraphicUsed by:7
Symbol 4 GraphicUsed by:7
Symbol 5 SoundUsed by:7
Symbol 6 GraphicUsed by:7
Symbol 7 MovieClip [tile]Uses:1 2 3 4 5 6
Symbol 8 GraphicUsed by:10
Symbol 9 GraphicUsed by:10
Symbol 10 MovieClip [item]Uses:8 9
Symbol 11 MovieClip [empty]
Symbol 12 GraphicUsed by:15 19 52
Symbol 13 GraphicUsed by:15 19
Symbol 14 GraphicUsed by:15 19
Symbol 15 MovieClipUses:12 13 14Used by:16 17 18
Symbol 16 MovieClipUses:15Used by:21
Symbol 17 MovieClipUses:15Used by:21
Symbol 18 MovieClipUses:15Used by:21
Symbol 19 MovieClipUses:12 13 14Used by:20
Symbol 20 MovieClipUses:19Used by:21
Symbol 21 MovieClip [char]Uses:16 17 18 20
Symbol 22 GraphicUsed by:23 24
Symbol 23 MovieClip [enemy1]Uses:22
Symbol 24 MovieClip [enemy1]Uses:22Used by:Timeline
Symbol 25 MovieClip [empty]Used by:Timeline
Symbol 26 GraphicUsed by:Timeline
Symbol 27 GraphicUsed by:28
Symbol 28 MovieClipUses:27Used by:Timeline
Symbol 29 FontUsed by:30 31 32 45 46 49 63 65 67 69 71 73 75 83 85 86 89 95
Symbol 30 EditableTextUses:29Used by:Timeline
Symbol 31 EditableTextUses:29Used by:Timeline
Symbol 32 EditableTextUses:29Used by:Timeline
Symbol 33 GraphicUsed by:Timeline
Symbol 34 GraphicUsed by:Timeline
Symbol 35 GraphicUsed by:39
Symbol 36 GraphicUsed by:39
Symbol 37 GraphicUsed by:39
Symbol 38 GraphicUsed by:39
Symbol 39 ButtonUses:35 36 37 38Used by:Timeline
Symbol 40 GraphicUsed by:44
Symbol 41 GraphicUsed by:44
Symbol 42 GraphicUsed by:44
Symbol 43 GraphicUsed by:44
Symbol 44 ButtonUses:40 41 42 43Used by:Timeline
Symbol 45 TextUses:29Used by:Timeline
Symbol 46 TextUses:29Used by:Timeline
Symbol 47 GraphicUsed by:Timeline
Symbol 48 SoundUsed by:Timeline
Symbol 49 EditableTextUses:29Used by:Timeline
Symbol 50 GraphicUsed by:52
Symbol 51 GraphicUsed by:52
Symbol 52 MovieClipUses:12 50 51Used by:Timeline
Symbol 53 SoundUsed by:54 62
Symbol 54 MovieClipUses:53Used by:Timeline
Symbol 55 GraphicUsed by:59 64 66 68 70 72 74
Symbol 56 GraphicUsed by:59 64 66 68 70 72 74
Symbol 57 GraphicUsed by:59 64 66 68 70 72 74
Symbol 58 GraphicUsed by:59 64 66 68 70 72 74
Symbol 59 ButtonUses:55 56 57 58Used by:Timeline
Symbol 60 GraphicUsed by:Timeline
Symbol 61 SoundUsed by:Timeline
Symbol 62 MovieClipUses:53Used by:Timeline
Symbol 63 EditableTextUses:29Used by:Timeline
Symbol 64 ButtonUses:55 56 57 58Used by:Timeline
Symbol 65 EditableTextUses:29Used by:Timeline
Symbol 66 ButtonUses:55 56 57 58Used by:Timeline
Symbol 67 EditableTextUses:29Used by:Timeline
Symbol 68 ButtonUses:55 56 57 58Used by:Timeline
Symbol 69 EditableTextUses:29Used by:Timeline
Symbol 70 ButtonUses:55 56 57 58Used by:Timeline
Symbol 71 EditableTextUses:29Used by:Timeline
Symbol 72 ButtonUses:55 56 57 58Used by:Timeline
Symbol 73 EditableTextUses:29Used by:Timeline
Symbol 74 ButtonUses:55 56 57 58Used by:Timeline
Symbol 75 EditableTextUses:29Used by:Timeline
Symbol 76 GraphicUsed by:Timeline
Symbol 77 GraphicUsed by:81
Symbol 78 GraphicUsed by:81
Symbol 79 GraphicUsed by:81
Symbol 80 GraphicUsed by:81
Symbol 81 ButtonUses:77 78 79 80Used by:Timeline
Symbol 82 GraphicUsed by:Timeline
Symbol 83 TextUses:29Used by:Timeline
Symbol 84 SoundUsed by:Timeline
Symbol 85 TextUses:29Used by:Timeline
Symbol 86 TextUses:29Used by:Timeline
Symbol 87 GraphicUsed by:Timeline
Symbol 88 GraphicUsed by:Timeline
Symbol 89 TextUses:29Used by:Timeline
Symbol 90 GraphicUsed by:94
Symbol 91 GraphicUsed by:94
Symbol 92 GraphicUsed by:94
Symbol 93 GraphicUsed by:94
Symbol 94 ButtonUses:90 91 92 93Used by:Timeline
Symbol 95 TextUses:29Used by:Timeline

Instance Names

"progressbar"Frame 1Symbol 28 MovieClip
"mylifes"Frame 3Symbol 52 MovieClip
"youdied"Frame 3Symbol 54 MovieClip
"mylifes"Frame 5Symbol 52 MovieClip
"youdied"Frame 5Symbol 62 MovieClip
"mylifes"Frame 7Symbol 52 MovieClip
"youdied"Frame 7Symbol 62 MovieClip
"mylifes"Frame 9Symbol 52 MovieClip
"youdied"Frame 9Symbol 62 MovieClip
"mylifes"Frame 11Symbol 52 MovieClip
"youdied"Frame 11Symbol 62 MovieClip
"mylifes"Frame 13Symbol 52 MovieClip
"youdied"Frame 13Symbol 62 MovieClip
"mylifes"Frame 15Symbol 52 MovieClip
"youdied"Frame 15Symbol 54 MovieClip
"mylifes"Frame 17Symbol 52 MovieClip
"youdied"Frame 17Symbol 62 MovieClip
"mychar"Symbol 21 MovieClip [char] Frame 2Symbol 17 MovieClip
"mychar"Symbol 21 MovieClip [char] Frame 4Symbol 18 MovieClip
"mychar"Symbol 21 MovieClip [char] Frame 5Symbol 20 MovieClip

Special Tags

ExportAssets (56)Timeline Frame 1Symbol 7 as "tile"
ExportAssets (56)Timeline Frame 1Symbol 10 as "item"
ExportAssets (56)Timeline Frame 1Symbol 11 as "empty"
ExportAssets (56)Timeline Frame 1Symbol 21 as "char"
ExportAssets (56)Timeline Frame 1Symbol 23 as "enemy1"
ExportAssets (56)Timeline Frame 1Symbol 24 as "enemy1"
ExportAssets (56)Timeline Frame 1Symbol 25 as "empty"
ExportAssets (56)Timeline Frame 3Symbol 25 as "empty"
ExportAssets (56)Timeline Frame 5Symbol 25 as "empty"
ExportAssets (56)Timeline Frame 7Symbol 25 as "empty"
ExportAssets (56)Timeline Frame 9Symbol 25 as "empty"
ExportAssets (56)Timeline Frame 11Symbol 25 as "empty"
ExportAssets (56)Timeline Frame 13Symbol 25 as "empty"
ExportAssets (56)Timeline Frame 15Symbol 25 as "empty"
ExportAssets (56)Timeline Frame 17Symbol 25 as "empty"
ExportAssets (56)Timeline Frame 46Symbol 24 as "enemy1"

Labels

"movie start"Frame 2

Dynamic Text Variables

bytesMessageSymbol 30 EditableText"-"
speedMessageSymbol 31 EditableText"-"
timeMessageSymbol 32 EditableText"-"




http://swfchan.com/24/117161/info.shtml
Created: 8/3 -2019 02:48:21 Last modified: 8/3 -2019 02:48:21 Server time: 24/04 -2024 12:40:03