if (scaleset ne true) { scaleset = true; fscommand("allowscale", false); } if (setstage ne true) { mapx = "h"; mapy = 1; setstage = true; this.attachMovie( ("map_"+ mapx + mapy), "map", 2 ); this.attachMovie( "hero", "hero", 4 ); this.attachMovie( "status", "status", 10 ); setProperty("map", _y, 57); setProperty("hero", _y, 128); setProperty("hero", _x, 96); } if (hero._x < 4 and scroll ne "left") { newx = String.fromCharCode(mapx.charCodeAt(0) - 1); scroll = "left"; this.attachMovie( ("map_"+ newx + mapy), "map2", 3 ); setProperty("map2", _y, 57); setProperty("map2", _x, -256); } else if (hero._x > 236 and scroll ne "right") { newx = String.fromCharCode(mapx.charCodeAt(0) + 1); scroll = "right"; this.attachMovie( ("map_"+ newx + mapy), "map2", 3 ); setProperty("map2", _y, 57); setProperty("map2", _x, 256); } else if (hero._y < 64 and scroll ne "up") { newy = mapy + 1; scroll = "up"; this.attachMovie( ("map_"+ mapx + newy), "map2", 3 ); setProperty("map2", _y, -110); setProperty("map2", _x, 0); } else if (hero._y > 200 and scroll ne "down") { newy = mapy - 1; scroll = "down"; this.attachMovie( ("map_"+ mapx + newy), "map2", 3 ); setProperty("map2", _y, 210); setProperty("map2", _x, 0); } if (scroll == "left") { setProperty("map", _x, map._x + 8); setProperty("map2", _x, map2._x + 8); setProperty("hero", _x, hero._x + 7); if (map2._x == 0) { scroll = false; map.removeMovieClip(); map2.duplicateMovieClip("map", 2 ); map2.removeMovieClip(); mapx = newx; } } else if (scroll == "right") { setProperty("map", _x, map._x - 8); setProperty("map2", _x, map2._x - 8); setProperty("hero", _x, hero._x - 7); if (map2._x == 0) { scroll = false; map.removeMovieClip(); map2.duplicateMovieClip("map", 2 ); map2.removeMovieClip(); mapx = newx; } } else if (scroll == "up") { setProperty("map", _y, map._y + 8); setProperty("map2", _y, map2._y + 8); setProperty("hero", _y, hero._y + 6); if (map2._y > 56 ) { scroll = false; map.removeMovieClip(); map2.duplicateMovieClip("map", 2 ); map2.removeMovieClip(); mapy = newy; setProperty("map", _y, 57); } } else if (scroll == "down") { setProperty("map", _y, map._y - 8); setProperty("map2", _y, map2._y - 8); setProperty("hero", _y, hero._y - 6); if (map2._y < 58 ) { scroll = false; map.removeMovieClip(); map2.duplicateMovieClip("map", 2 ); map2.removeMovieClip(); mapy = newy; setProperty("map", _y, 57); } } else { if (Key.isDown(Key.DOWN) and hero._y < 208) { if (collision and direction == "down") { } else if (collision and direction == "up") { setProperty("hero", _y, hero._y + 2); direction = "down"; collision = false; setProperty("hero", _y, hero._y + 2); } else if (collision and direction == "left") { setProperty("hero", _x, hero._x + 2); direction = "down"; collision = false; setProperty("hero", _y, hero._y + 2); } else if (collision and direction == "right") { setProperty("hero", _x, hero._x - 2); direction = "down"; collision = false; setProperty("hero", _y, hero._y + 2); } else { direction = "down"; collision = false; setProperty("hero", _y, hero._y + 2); } if (keyflag < 3) { hero.gotoAndStop(1); keyflag = keyflag + 1; } else { hero.gotoAndStop(2); keyflag = keyflag + 1; if (keyflag > 5) { keyflag = 0; } } } else if (Key.isDown(Key.UP) and hero._y > 58) { if (collision and direction == "up") { } else if (collision and direction == "down") { setProperty("hero", _y, hero._y - 2); direction = "up"; collision = false; setProperty("hero", _y, hero._y - 2); } else if (collision and direction == "left") { setProperty("hero", _x, hero._x + 2); direction = "up"; collision = false; setProperty("hero", _y, hero._y - 2); } else if (collision and direction == "right") { setProperty("hero", _x, hero._x - 2); direction = "up"; collision = false; setProperty("hero", _y, hero._y - 2); } else { direction = "up"; collision = false; setProperty("hero", _y, hero._y - 2); } if (keyflag < 3) { hero.gotoAndStop(3); keyflag = keyflag + 1; } else { hero.gotoAndStop(4); keyflag = keyflag + 1; if (keyflag > 5) { keyflag = 0; } } } else if (Key.isDown(Key.LEFT) and hero._x > 0) { if (collision and direction == "left") { } else if (collision and direction == "up") { setProperty("hero", _y, hero._y + 2); direction = "left"; collision = false; setProperty("hero", _x, hero._x - 2); } else if (collision and direction == "down") { setProperty("hero", _y, hero._y - 2); direction = "left"; collision = false; setProperty("hero", _x, hero._x - 2); } else if (collision and direction == "right") { setProperty("hero", _x, hero._x - 2); direction = "left"; collision = false; setProperty("hero", _x, hero._x - 2); } else { direction = "left"; collision = false; setProperty("hero", _x, hero._x - 1); } if (keyflag < 6) { hero.gotoAndStop(5); keyflag = keyflag + 1; } else { hero.gotoAndStop(6); keyflag = keyflag + 1; if (keyflag > 11) { keyflag = 0; } } } else if (Key.isDown(Key.RIGHT) and hero._x < 240) { if (collision and direction == "right") { } else if (collision and direction == "up") { setProperty("hero", _y, hero._y + 2); direction = "right"; collision = false; setProperty("hero", _x, hero._x + 2); } else if (collision and direction == "down") { setProperty("hero", _y, hero._y - 2); direction = "right"; collision = false; setProperty("hero", _x, hero._x + 2); } else if (collision and direction == "left") { setProperty("hero", _x, hero._x + 2); direction = "right"; collision = false; setProperty("hero", _x, hero._x + 2); } else { direction = "right"; collision = false; setProperty("hero", _x, hero._x + 2); } if (keyflag < 3) { hero.gotoAndStop(7); keyflag = keyflag + 1; } else { hero.gotoAndStop(8); keyflag = keyflag + 1; if (keyflag > 5) { keyflag = 0; } } } }