STORY LOOP FURRY PORN GAMES C SERVICES [?] [R] RND POPULAR | Archived flashes: 229494 |
/disc/ · /res/ — /show/ · /fap/ · /gg/ · /swf/ | P0001 · P2575 · P5149 |
This is the info page for Flash #117161 |
- |
- |
- |
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 1stop();Instance of Symbol 28 MovieClip "progressbar" in Frame 1onClipEvent (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 2stop();Frame 3stop(); 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 3onClipEvent (enterFrame) { _root.detectKeys(); }Frame 4stop();Frame 5stop(); 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 5onClipEvent (enterFrame) { _root.detectKeys(); }Frame 6stop();Frame 7stop(); 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 7onClipEvent (enterFrame) { _root.detectKeys(); }Frame 8stop();Frame 9stop(); 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 9onClipEvent (enterFrame) { _root.detectKeys(); }Frame 10stop();Frame 11stop(); 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 11onClipEvent (enterFrame) { _root.detectKeys(); }Frame 12stop();Frame 13stop(); 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 13onClipEvent (enterFrame) { _root.detectKeys(); }Frame 14stop();Frame 15stop(); 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 15onClipEvent (enterFrame) { _root.detectKeys(); }Frame 16stop();Frame 17stop(); 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 17onClipEvent (enterFrame) { _root.detectKeys(); }Frame 36stop();Frame 41stop();Frame 46stop();Symbol 10 MovieClip [item] Frame 1stop();Symbol 10 MovieClip [item] Frame 2stop();Symbol 10 MovieClip [item] Frame 3stop();Symbol 10 MovieClip [item] Frame 4stop();Symbol 21 MovieClip [char] Frame 1stop();Symbol 39 Buttonon (release, keyPress "<Enter>") { gotoAndStop (3); stopAllSounds(); }Symbol 44 Buttonon (release, keyPress "<Enter>") { gotoAndStop (46); }Symbol 52 MovieClip Frame 4stop();Symbol 54 MovieClip Frame 1stop();Symbol 59 Buttonon (release, keyPress "<Enter>") { gotoAndPlay (5); }Symbol 62 MovieClip Frame 1stop();Symbol 64 Buttonon (release, keyPress "<Enter>") { gotoAndPlay (7); }Symbol 66 Buttonon (release, keyPress "<Enter>") { gotoAndPlay (9); }Symbol 68 Buttonon (release, keyPress "<Enter>") { gotoAndPlay (11); }Symbol 70 Buttonon (release, keyPress "<Enter>") { gotoAndPlay (13); }Symbol 72 Buttonon (release, keyPress "<Enter>") { gotoAndPlay (15); }Symbol 74 Buttonon (release, keyPress "<Enter>") { gotoAndPlay (17); }Symbol 81 Buttonon (release, keyPress "<Enter>") { gotoAndStop (2); }Symbol 94 Buttonon (release, keyPress "<Enter>") { stopAllSounds(); gotoAndStop (2); }
Library Items
Symbol 1 Graphic | Used by:7 | |
Symbol 2 Graphic | Used by:7 | |
Symbol 3 Graphic | Used by:7 | |
Symbol 4 Graphic | Used by:7 | |
Symbol 5 Sound | Used by:7 | |
Symbol 6 Graphic | Used by:7 | |
Symbol 7 MovieClip [tile] | Uses:1 2 3 4 5 6 | |
Symbol 8 Graphic | Used by:10 | |
Symbol 9 Graphic | Used by:10 | |
Symbol 10 MovieClip [item] | Uses:8 9 | |
Symbol 11 MovieClip [empty] | ||
Symbol 12 Graphic | Used by:15 19 52 | |
Symbol 13 Graphic | Used by:15 19 | |
Symbol 14 Graphic | Used by:15 19 | |
Symbol 15 MovieClip | Uses:12 13 14 | Used by:16 17 18 |
Symbol 16 MovieClip | Uses:15 | Used by:21 |
Symbol 17 MovieClip | Uses:15 | Used by:21 |
Symbol 18 MovieClip | Uses:15 | Used by:21 |
Symbol 19 MovieClip | Uses:12 13 14 | Used by:20 |
Symbol 20 MovieClip | Uses:19 | Used by:21 |
Symbol 21 MovieClip [char] | Uses:16 17 18 20 | |
Symbol 22 Graphic | Used by:23 24 | |
Symbol 23 MovieClip [enemy1] | Uses:22 | |
Symbol 24 MovieClip [enemy1] | Uses:22 | Used by:Timeline |
Symbol 25 MovieClip [empty] | Used by:Timeline | |
Symbol 26 Graphic | Used by:Timeline | |
Symbol 27 Graphic | Used by:28 | |
Symbol 28 MovieClip | Uses:27 | Used by:Timeline |
Symbol 29 Font | Used by:30 31 32 45 46 49 63 65 67 69 71 73 75 83 85 86 89 95 | |
Symbol 30 EditableText | Uses:29 | Used by:Timeline |
Symbol 31 EditableText | Uses:29 | Used by:Timeline |
Symbol 32 EditableText | Uses:29 | Used by:Timeline |
Symbol 33 Graphic | Used by:Timeline | |
Symbol 34 Graphic | Used by:Timeline | |
Symbol 35 Graphic | Used by:39 | |
Symbol 36 Graphic | Used by:39 | |
Symbol 37 Graphic | Used by:39 | |
Symbol 38 Graphic | Used by:39 | |
Symbol 39 Button | Uses:35 36 37 38 | Used by:Timeline |
Symbol 40 Graphic | Used by:44 | |
Symbol 41 Graphic | Used by:44 | |
Symbol 42 Graphic | Used by:44 | |
Symbol 43 Graphic | Used by:44 | |
Symbol 44 Button | Uses:40 41 42 43 | Used by:Timeline |
Symbol 45 Text | Uses:29 | Used by:Timeline |
Symbol 46 Text | Uses:29 | Used by:Timeline |
Symbol 47 Graphic | Used by:Timeline | |
Symbol 48 Sound | Used by:Timeline | |
Symbol 49 EditableText | Uses:29 | Used by:Timeline |
Symbol 50 Graphic | Used by:52 | |
Symbol 51 Graphic | Used by:52 | |
Symbol 52 MovieClip | Uses:12 50 51 | Used by:Timeline |
Symbol 53 Sound | Used by:54 62 | |
Symbol 54 MovieClip | Uses:53 | Used by:Timeline |
Symbol 55 Graphic | Used by:59 64 66 68 70 72 74 | |
Symbol 56 Graphic | Used by:59 64 66 68 70 72 74 | |
Symbol 57 Graphic | Used by:59 64 66 68 70 72 74 | |
Symbol 58 Graphic | Used by:59 64 66 68 70 72 74 | |
Symbol 59 Button | Uses:55 56 57 58 | Used by:Timeline |
Symbol 60 Graphic | Used by:Timeline | |
Symbol 61 Sound | Used by:Timeline | |
Symbol 62 MovieClip | Uses:53 | Used by:Timeline |
Symbol 63 EditableText | Uses:29 | Used by:Timeline |
Symbol 64 Button | Uses:55 56 57 58 | Used by:Timeline |
Symbol 65 EditableText | Uses:29 | Used by:Timeline |
Symbol 66 Button | Uses:55 56 57 58 | Used by:Timeline |
Symbol 67 EditableText | Uses:29 | Used by:Timeline |
Symbol 68 Button | Uses:55 56 57 58 | Used by:Timeline |
Symbol 69 EditableText | Uses:29 | Used by:Timeline |
Symbol 70 Button | Uses:55 56 57 58 | Used by:Timeline |
Symbol 71 EditableText | Uses:29 | Used by:Timeline |
Symbol 72 Button | Uses:55 56 57 58 | Used by:Timeline |
Symbol 73 EditableText | Uses:29 | Used by:Timeline |
Symbol 74 Button | Uses:55 56 57 58 | Used by:Timeline |
Symbol 75 EditableText | Uses:29 | Used by:Timeline |
Symbol 76 Graphic | Used by:Timeline | |
Symbol 77 Graphic | Used by:81 | |
Symbol 78 Graphic | Used by:81 | |
Symbol 79 Graphic | Used by:81 | |
Symbol 80 Graphic | Used by:81 | |
Symbol 81 Button | Uses:77 78 79 80 | Used by:Timeline |
Symbol 82 Graphic | Used by:Timeline | |
Symbol 83 Text | Uses:29 | Used by:Timeline |
Symbol 84 Sound | Used by:Timeline | |
Symbol 85 Text | Uses:29 | Used by:Timeline |
Symbol 86 Text | Uses:29 | Used by:Timeline |
Symbol 87 Graphic | Used by:Timeline | |
Symbol 88 Graphic | Used by:Timeline | |
Symbol 89 Text | Uses:29 | Used by:Timeline |
Symbol 90 Graphic | Used by:94 | |
Symbol 91 Graphic | Used by:94 | |
Symbol 92 Graphic | Used by:94 | |
Symbol 93 Graphic | Used by:94 | |
Symbol 94 Button | Uses:90 91 92 93 | Used by:Timeline |
Symbol 95 Text | Uses:29 | Used by:Timeline |
Instance Names
"progressbar" | Frame 1 | Symbol 28 MovieClip |
"mylifes" | Frame 3 | Symbol 52 MovieClip |
"youdied" | Frame 3 | Symbol 54 MovieClip |
"mylifes" | Frame 5 | Symbol 52 MovieClip |
"youdied" | Frame 5 | Symbol 62 MovieClip |
"mylifes" | Frame 7 | Symbol 52 MovieClip |
"youdied" | Frame 7 | Symbol 62 MovieClip |
"mylifes" | Frame 9 | Symbol 52 MovieClip |
"youdied" | Frame 9 | Symbol 62 MovieClip |
"mylifes" | Frame 11 | Symbol 52 MovieClip |
"youdied" | Frame 11 | Symbol 62 MovieClip |
"mylifes" | Frame 13 | Symbol 52 MovieClip |
"youdied" | Frame 13 | Symbol 62 MovieClip |
"mylifes" | Frame 15 | Symbol 52 MovieClip |
"youdied" | Frame 15 | Symbol 54 MovieClip |
"mylifes" | Frame 17 | Symbol 52 MovieClip |
"youdied" | Frame 17 | Symbol 62 MovieClip |
"mychar" | Symbol 21 MovieClip [char] Frame 2 | Symbol 17 MovieClip |
"mychar" | Symbol 21 MovieClip [char] Frame 4 | Symbol 18 MovieClip |
"mychar" | Symbol 21 MovieClip [char] Frame 5 | Symbol 20 MovieClip |
Special Tags
ExportAssets (56) | Timeline Frame 1 | Symbol 7 as "tile" |
ExportAssets (56) | Timeline Frame 1 | Symbol 10 as "item" |
ExportAssets (56) | Timeline Frame 1 | Symbol 11 as "empty" |
ExportAssets (56) | Timeline Frame 1 | Symbol 21 as "char" |
ExportAssets (56) | Timeline Frame 1 | Symbol 23 as "enemy1" |
ExportAssets (56) | Timeline Frame 1 | Symbol 24 as "enemy1" |
ExportAssets (56) | Timeline Frame 1 | Symbol 25 as "empty" |
ExportAssets (56) | Timeline Frame 3 | Symbol 25 as "empty" |
ExportAssets (56) | Timeline Frame 5 | Symbol 25 as "empty" |
ExportAssets (56) | Timeline Frame 7 | Symbol 25 as "empty" |
ExportAssets (56) | Timeline Frame 9 | Symbol 25 as "empty" |
ExportAssets (56) | Timeline Frame 11 | Symbol 25 as "empty" |
ExportAssets (56) | Timeline Frame 13 | Symbol 25 as "empty" |
ExportAssets (56) | Timeline Frame 15 | Symbol 25 as "empty" |
ExportAssets (56) | Timeline Frame 17 | Symbol 25 as "empty" |
ExportAssets (56) | Timeline Frame 46 | Symbol 24 as "enemy1" |
Labels
"movie start" | Frame 2 |
Dynamic Text Variables
bytesMessage | Symbol 30 EditableText | "-" |
speedMessage | Symbol 31 EditableText | "-" |
timeMessage | Symbol 32 EditableText | "-" |
|