Frame 1
var rt = this;
var loader_mc = this.load_mc.loadbar_mc;
rt.onEnterFrame = function () {
var _local2 = rt.getBytesLoaded();
var _local3 = rt.getBytesTotal();
var _local1 = Math.floor((_local2 / _local3) * 100);
loader_mc.gotoAndStop(_local1);
if (_local1 >= 100) {
delete rt.onEnterFrame;
rt.gotoAndPlay(3);
}
};
stop();
Frame 3
trace(" frame 3, play ");
Frame 10
var menuin_snd = new Sound();
menuin_snd.attachSound("menu_in");
var menu_loop_snd = new Sound();
menu_loop_snd.attachSound("menu_loop");
var menu_out = new Sound();
menu_out.attachSound("menu_out");
menuin_snd.onSoundComplete = function () {
menu_loop_snd.start(0, 9999);
};
menuin_snd.start();
Frame 25
this.play_mc.onRelease = function () {
};
Frame 67
play_mc.onRelease = function () {
var _local2 = new Date().getTime();
loadMovieNum ("tracker.swf?" + _local2, 10000);
this._parent.play();
};
stop();
Frame 73
this.go_mc.onRelease = function () {
};
Frame 96
go_mc.onRelease = function () {
menu_loop_snd.stop();
menu_out.start();
this._parent.play();
};
stop();
Frame 107
stop();
var m = this;
m.snd_mc.onRelease = function () {
if (PlaySound.toggleSound()) {
m.snd_mc.gotoAndStop(3);
} else {
m.snd_mc.gotoAndStop(1);
}
};
m.onEnterFrame = function () {
if (Game.GAME_OVER) {
trace(" spotted game over ");
m.root_mc.removeMovieClip();
delete m.onEnterFrame;
m.play();
}
if (Game.IS_DEAD) {
trace(" out of lives ");
trace((" curr frame [ " + m._currentframe) + " ] ");
m.root_mc.removeMovieClip();
m.gotoAndPlay(130);
trace((" curr frame [ " + m._currentframe) + " ] ");
delete m.onEnterFrame;
}
};
Frame 108
trace(" curretnframe " + _currentframe);
Frame 115
Frame 121
this.pTimer = 90;
this.onEnterFrame = function () {
if ((--this.pTimer) == 0) {
delete this.onEnterFrame;
play();
}
};
stop();
Frame 129
Frame 137
Frame 153
this.playagain_mc.onRelease = function () {
this._parent.gotoAndPlay("menubuild");
};
stop();
stopAllSounds();
this.best_mc.your_txt.text = Score.Scr;
this.best_mc.best_txt.text = Game.BEST;
var menuin_snd = new Sound();
menuin_snd.attachSound("menu_in");
var menu_loop_snd = new Sound();
menu_loop_snd.attachSound("menu_loop");
var menu_out = new Sound();
menu_out.attachSound("menu_out");
menuin_snd.onSoundComplete = function () {
menu_loop_snd.start(0, 9999);
};
menuin_snd.start();
Game.reset();
Symbol 7 MovieClip Frame 1
this._alpha = 0;
this._parent.hitarea = this;
stop();
Symbol 12 MovieClip [mc.soundclip] Frame 1
function setVol(x) {
pVol = 100 * x;
pDive.setVolume(pVol);
pMenuLoop.setVolume(pVol);
pMenuIntro.setVolume(pVol);
pGameIntro.setVolume(pVol);
pOctoShot.setVolume(pVol);
pStinkShot.setVolume(pVol);
pOctoBoom.setVolume(pVol);
pBoom.setVolume(pVol);
pGameIntro.setVolume(pVol);
if (this.pAB == "A") {
pGameLoopA.setVolume(pVol);
pHover.setVolume(pVol);
pBoatA.setVolume(pVol * this.pBoatVol);
} else {
pGameLoopB.setVolume(pVol);
pWater.setVolume(pVol);
pBoatB.setVolume(pVol * this.pBoatVol);
}
}
function playsound(snd) {
eval (snd).start();
}
function playmenu() {
pGameIntro.stop();
pGameLoopA.stop();
pGameLoopB.stop();
pMenuIntro.stop();
pMenuLoop.stop();
pMenuIntro.start();
pMenuIntro.onSoundComplete = function () {
pMenuLoop.start(0, 999);
};
}
function playmusic() {
pMenuIntro.stop();
pMenuLoop.stop();
pGameIntro.stop();
pGameLoopA.stop();
pGameLoopB.stop();
pBoatA.stop();
pBoatB.stop();
pGameIntro.start();
pBoatA.start(0, 999);
pBoatB.start(0, 999);
pBoatA.setVolume(30);
pBoatB.setVolume(0);
pGameIntro.onSoundComplete = function () {
pGameLoopA.start(0, 999);
pGameLoopB.start(0, 999);
};
}
function water() {
pWater.start(0, 999);
}
function mutate(ab) {
this.pAB = ab;
if (this.pAB == "A") {
pGameLoopA.setVolume(pVol);
pGameLoopB.setVolume(0);
pWater.stop();
pHover.start(0, 999);
pBoatA.setVolume(pVol);
pBoatB.setVolume(0);
} else {
pHover.stop();
pWater.start(0, 999);
pGameLoopB.setVolume(pVol);
pGameLoopA.setVolume(0);
pBoatB.setVolume(30);
pBoatA.setVolume(0);
}
}
function gameover() {
pGameIntro.stop();
pGameLoopA.stop();
pGameLoopB.stop();
}
function setBoatVol(tx) {
}
function onRelease() {
if (pVol == 100) {
pVol = 0;
this.setVol(0);
gotoAndStop (3);
} else {
pVol = 100;
this.setVol(1);
gotoAndStop (2);
}
}
var pVol = 100;
var pGoto = "menu";
var pBoost = 1;
this._x = 24;
this._y = 1351;
this.pVOover = 1;
this.pAB = "B";
this.pBoatVol = 50;
var i = 1;
while (i <= 25) {
this.createEmptyMovieClip(i + "_mc", this.getNextHighestDepth());
i++;
}
var pDive = new Sound("1_mc");
pDive.attachSound("divein");
var pBoatA = new Sound("2_mc");
pBoatA.attachSound("boatA");
var pBoatB = new Sound("3_mc");
pBoatB.attachSound("boatB");
var pMenuLoop = new Sound("4_mc");
pMenuLoop.attachSound("menuloop");
var pMenuIntro = new Sound("5_mc");
pMenuIntro.attachSound("menuintro");
var pGameIntro = new Sound("6_mc");
pGameIntro.attachSound("gameintro");
var pGameLoopA = new Sound("7_mc");
pGameLoopA.attachSound("loopA");
var pGameLoopB = new Sound("8_mc");
pGameLoopB.attachSound("loopB");
var pOctoShot = new Sound("9_mc");
pOctoShot.attachSound("octoshot");
var pStinkShot = new Sound("10_mc");
pStinkShot.attachSound("stinkflyshot");
var pOctoBoom = new Sound("11_mc");
pOctoBoom.attachSound("octoboom");
var pBoom = new Sound("12_mc");
pBoom.attachSound("s-grenade");
var pSplat = new Sound("13_mc");
pSplat.attachSound("splat");
var pGrenadeLaunch = new Sound("14_mc");
pGrenadeLaunch.attachSound("s-grenadelaunch");
var pMine = new Sound("15_mc");
pMine.attachSound("s-mine");
var pOcto = new Sound("16_mc");
pOcto.attachSound("octo_robots");
var pAttack = new Sound("17_mc");
pAttack.attachSound("s-attack");
var pMutate = new Sound("18_mc");
pMutate.attachSound("s-transform");
var pMutateA = new Sound("19_mc");
pMutateA.attachSound("s-mutateA");
var pMutateW = new Sound("20_mc");
pMutateW.attachSound("s-mutateW");
var pMan0 = new Sound("21_mc");
pMan0.attachSound("s-man0");
var pMan1 = new Sound("22_mc");
pMan1.attachSound("s-man1");
var pMan2 = new Sound("23_mc");
pMan2.attachSound("s-man2");
var pHover = new Sound("24_mc");
pHover.attachSound("s-hover");
var pWater = new Sound("25_mc");
pWater.attachSound("s-underwater");
this.setVol(1);
stop();
Symbol 15 MovieClip [mouse_listen] Frame 1
#initclip 19
Object.registerClass("mouse_listen", MouseState);
#endinitclip
Symbol 299 MovieClip [__Packages.MouseState] Frame 0
class MouseState extends MovieClip
{
var m_down, m_up, mx, _xmouse, my, _ymouse;
function MouseState () {
super();
}
function get Down() {
var _local2 = m_down;
m_down = false;
return(_local2);
}
function get Up() {
var _local2 = m_up;
m_up = false;
return(_local2);
}
function init() {
m_down = false;
m_up = false;
mx = _xmouse;
my = _ymouse;
}
function onMouseDown() {
m_down = true;
}
function onMouseUp() {
m_up = true;
}
function onMouseMove() {
mx = _xmouse;
my = _ymouse;
}
}
Symbol 300 MovieClip [__Packages.Game] Frame 0
class Game
{
static var _instance;
var fpsText, root, ms, fps, _so, levels, platforms, objects, starts, fins, is_switch_down, is_down, is_num_down, is_print_down, game_rec, bounds_rec, bg_mc, omnitrix_mc, bitmap_mc, buffer, d, c, obs, maus, pixels, p, m;
function Game () {
}
static function getInstance() {
if (_instance == undefined) {
_instance = new Game();
}
return(_instance);
}
static function reset() {
LEVEL = 0;
NEW_LEVEL = (GAME_OVER = (REBUILD = false));
IS_DEAD = false;
MODE = "PLAY";
}
static function getItemIndex(arr, item) {
var _local2 = arr.length;
var _local1 = 0;
while (_local1 < _local2) {
if (arr[_local1] == item) {
return(_local1);
}
_local1++;
}
return(-1);
}
function initFps() {
fpsText = root.createTextField("fps_txt", root.getNextHighestDepth(), -10, 0, 100, 100);
fpsText.selectable = false;
fpsText.border = true;
fpsText.background = true;
fpsText.backgroundColor = 16777215 /* 0xFFFFFF */;
ms = getTimer();
fps = 0;
}
function calcFps() {
if ((getTimer() - 1000) > ms) {
ms = getTimer();
fpsText.text = (fps >> 0).toString();
fps = 0;
} else {
fps++;
}
}
function init(game_mc, bg_mc, obj_mc, omnitrix_mc, char_mc, maus, pen_mc, canvas_mc, bitmap_mc) {
LevelData.init();
is_first = true;
Score.reset();
reset();
_so = SharedObject.getLocal("caverunner_edit");
if (IS_EDITOR) {
if (_so.data.uname == undefined) {
trace(" new editor shared object ");
_so.data.uname = "bogdan";
levels = [];
platforms = [];
objects = [];
starts = [];
fins = [];
_so.data.best_score = 0;
_so.data.levels = levels;
} else {
starts = LevelData.Sts;
fins = LevelData.Fin;
levels = _so.data.levels.slice();
platforms = LevelData.Plats;
objects = LevelData.Objs;
}
} else {
if (_so.data.uname == undefined) {
trace(" new game shared object ");
_so.data.uname = "ben";
_so.data.best_score = 0;
} else {
trace((" played before, prev score [ " + _so.data.best_score) + " ] ");
}
starts = LevelData.Sts;
fins = LevelData.Fin;
platforms = LevelData.Plats;
objects = LevelData.Objs;
}
is_switch_down = (is_down = (is_num_down = (is_print_down = false)));
game_rec = new flash.geom.Rectangle(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
bounds_rec = game_rec.clone();
bounds_rec.inflate(15, 40);
root = game_mc;
this.bg_mc = bg_mc;
this.omnitrix_mc = omnitrix_mc;
omnitrix_mc._visible = false;
this.bitmap_mc = bitmap_mc;
buffer = new flash.display.BitmapData(SCREEN_WIDTH, SCREEN_HEIGHT, true, 0);
bitmap_mc.attachBitmap(buffer, 1);
d = new Data();
c = new Char(char_mc, bg_mc, omnitrix_mc);
obs = new ObjPool(obj_mc, d);
this.maus = maus;
maus.init();
pixels = new PixelPool();
p = new Pen(pen_mc, maus, pixels);
m = new Main(root, c, p, obs, game_rec, bounds_rec, canvas_mc, pixels, buffer);
p.init(m, d);
d.init(p, m);
obs.init(c);
var _local2 = 0;
d.set_start(starts[_local2]);
d.set_finish(fins[_local2]);
d.set_level_data(levels[_local2].slice());
d.set_plat_data(platforms[_local2].slice());
d.set_ob_data(objects[_local2].slice());
root.onEnterFrame = com.playerthree.util.Proxy.create(this, update);
}
function update() {
if (is_first) {
trace(" is first draw level ");
d.draw_level();
is_first = false;
}
if (REBUILD) {
reset_level();
rebuild(LEVEL);
REBUILD = false;
}
if (NEW_LEVEL) {
LEVEL++;
if (LEVEL > 9) {
trace(" FINISHED ");
GAME_OVER = true;
var _local2 = _so.data.best_score;
if (Score.__get__Scr() > _local2) {
trace((" new best score [ " + Score.__get__Scr()) + " ] ");
_so.data.best_score = Score.Scr;
BEST = Score.Scr;
_so.flush();
} else {
trace((((" you didnt do as well as before [ " + _local2) + " ] today [ ") + Score.__get__Scr()) + " ] ");
BEST = _local2;
}
} else {
reset_level();
rebuild(LEVEL);
trace((" level [ " + LEVEL) + " ] ");
trace(" draw new level ");
}
NEW_LEVEL = false;
}
if (IS_EDITOR) {
editor_keys();
}
buffer.fillRect(game_rec, 0);
m.update();
}
function toggle_mode() {
if (MODE == "PLAY") {
MODE = "EDIT";
m.obs.setEdit(true);
} else {
MODE = "PLAY";
save_changes(8);
reset_level();
rebuild(8);
m.obs.setEdit(false);
}
Debug.output((" toggle mode, now MODE [ " + MODE) + " ] ");
}
function clear_so() {
_so.clear();
_so.flush();
}
function save_changes(lvl) {
starts[lvl] = m.obs.get_start();
fins[lvl] = m.obs.get_finish();
levels[lvl] = d.get_level_data();
platforms[lvl] = m.obs.get_plats();
objects[lvl] = m.obs.get_obs();
_so.data.starts = starts;
_so.data.fins = fins;
_so.data.levels = levels;
_so.data.platforms = platforms;
_so.data.objects = objects;
trace("objects[8][0] " + objects[8][0]);
trace("objects[8][1] " + objects[8][1]);
trace("objects[8][2] " + objects[8][2]);
trace("objects[8][3] " + objects[8][3]);
trace("platforms[8][0] " + platforms[8][0]);
trace("platforms[8][1] " + platforms[8][1]);
trace("platforms[8][2] " + platforms[8][2]);
trace("starts[8][0] " + starts[8][0]);
trace("starts[8][1] " + starts[8][1]);
trace("fins[8][0] " + fins[8][0]);
trace("fins[8][1] " + fins[8][1]);
_so.flush();
}
function reset_level() {
m.clear_out();
d.reset();
}
function rebuild(lvl) {
d.set_start(starts[lvl].slice());
d.set_finish(fins[lvl].slice());
d.set_plat_data(platforms[lvl].slice());
d.set_ob_data(objects[lvl].slice());
d.draw_level();
}
function editor_keys() {
if (Key.isDown(36)) {
if (!is_print_down) {
d.print_out();
is_print_down = true;
}
} else if (is_print_down) {
is_print_down = false;
}
if (Key.isDown(46)) {
if (!is_switch_down) {
toggle_mode();
is_switch_down = true;
}
} else if (is_switch_down) {
is_switch_down = false;
}
if (Key.isDown(Key.getCode())) {
var _local2 = Key.getCode();
if ((_local2 >= 48) && (_local2 <= 57)) {
if (!is_num_down) {
Debug.output((" pressed key [ " + (_local2 - 48)) + " ] ");
save_changes(_local2 - 48);
is_num_down = true;
}
}
} else if (is_num_down) {
is_num_down = false;
}
if (Key.isDown(45)) {
if (!is_down) {
m.reset();
d.reset();
Debug.output(" reset level ");
}
} else if (is_down) {
is_down = false;
}
if (Key.isDown(33)) {
d.draw_level();
Debug.output(" draw level ");
}
if (Key.isDown(34)) {
clear_so();
}
}
function button_reset() {
if (!FADE_ON) {
trace(" BUTTON RESET ");
m.soft_reset();
m.kill_char();
} else {
trace(" CANT RESET ");
}
}
static var BEST = 0;
static var FADE_ON = false;
static var IS_EDITOR = false;
static var NEW_LEVEL = false;
static var LEVEL = 0;
static var GAME_OVER = false;
static var IS_DEAD = false;
static var REBUILD = false;
static var SCREEN_WIDTH = 600;
static var SCREEN_HEIGHT = 400;
static var MODE = "PLAY";
var is_first = true;
}
Symbol 301 MovieClip [__Packages.Pen] Frame 0
class Pen
{
var maus, mc, pixels, tool_mc, canvas, seg_count, lastX, dir, down, lock, snap_len, m, _data, pin;
function Pen (mc, maus, pixels) {
this.maus = maus;
this.mc = mc;
this.pixels = pixels;
tool_mc = mc.tool_mc;
canvas = mc.canvas_mc;
seg_count = (lastX = 0);
dir = 1;
down = false;
lock = false;
snap_len = 15;
}
function init(m, _data) {
this.m = m;
this._data = _data;
}
function update() {
mouse();
animate();
draw_lines(maus.mx, maus.my, true, false, 0);
}
function draw_lines(mx, my, save, _lock, _type) {
if (_type == undefined) {
_type = 0;
}
if (down) {
var _local3 = 5 + random(3);
while (_local3-- , _local3 > -1) {
pixels.create(mx, my);
}
var _local5 = new PointX(int(mx), int(my));
if (_local5.x == pin.x) {
_local5.x = _local5.x + 1;
} else if (_local5.y == pin.y) {
_local5.y = _local5.y + 1;
}
canvas.clear();
canvas.lineStyle(0.5, 16763904, 100);
canvas.moveTo(pin.x, pin.y);
canvas.lineTo(_local5.x, _local5.y);
if (flash.geom.Point.distance(_local5, pin) >= snap_len) {
var _local4 = new Segment(pin, _local5, ++seg_count, _lock, _type);
if (m.add_seg(_local4)) {
var _local2 = m.get_neighbours(pin);
_local2 = _local2.concat(m.get_neighbours(_local5));
for (_local3 in _local2) {
_local2[_local3].addNeighbour(_local4);
_local4.addNeighbour(_local2[_local3]);
}
}
if (save) {
_data.add_data(pin.x, pin.y, _local5.x, _local5.y);
}
pin = _local5.clone();
}
}
}
function mouse() {
if (maus.__get__Down()) {
pen_down(maus.mx, maus.my);
}
if (maus.__get__Up()) {
pen_up();
}
}
function pen_down(mx, my, mute) {
if (mute == undefined) {
mute = false;
}
down = true;
pin = m.getPoint(int(mx), int(my));
if (!mute) {
PlaySound.playClip("draw_loop");
PlaySound.playClip("start_draw");
}
}
function pen_up(mute) {
if (mute == undefined) {
mute = false;
}
down = false;
pin = null;
canvas.clear();
if (!mute) {
PlaySound.playClip("stop_draw");
PlaySound.playClip("end_draw_loop");
}
}
function animate() {
var _local2;
var _local3;
_local2 = maus.mx;
_local3 = maus.my;
if (down) {
if (tool_mc._currentframe != 5) {
tool_mc.gotoAndStop(5);
}
if (_local2 > lastX) {
if (dir != -1) {
dir = -1;
}
} else if (_local2 < lastX) {
if (dir != 1) {
dir = 1;
}
}
} else {
if (tool_mc._currentframe != 1) {
tool_mc.gotoAndStop(1);
}
dir = 0;
}
tool_mc._x = _local2;
tool_mc._y = _local3;
lastX = _local2;
}
}
Symbol 302 MovieClip [__Packages.Main] Frame 0
class Main
{
var root, c, p, obs, game_rec, bounds_rec, canvas, pixels, buffer, save_canvas, cellsize, grid, segments, count_wait, is_print, is_drawn, timer, IS_COUNT, fade_timer, init_timer, tmp_level_score, tmp_display_score, fade_in, fade_int;
function Main (root, c, p, obs, game_rec, bounds_rec, canvas_mc, pixels, buffer) {
this.root = root;
this.c = c;
this.p = p;
this.obs = obs;
this.game_rec = game_rec;
this.bounds_rec = bounds_rec;
canvas = canvas_mc;
this.pixels = pixels;
this.buffer = buffer;
save_canvas = new flash.display.BitmapData(buffer.width, buffer.height, true, 0);
cellsize = 20;
grid = [];
segments = [];
count_wait = COUNT;
is_print = false;
is_drawn = false;
timer = 0;
IS_COUNT = true;
fade_timer = 0;
init_timer = Blackout.INIT_TIME;
}
function clear_out() {
grid = [];
segments = [];
save_canvas = new flash.display.BitmapData(Game.SCREEN_WIDTH, Game.SCREEN_HEIGHT, true, 0);
is_drawn = true;
obs.reset();
canvas.clear();
IS_COUNT = true;
Score.timer_display(TIME_TO_COMPLETE / 10);
Score.soft_reset();
c.step_reset();
Score.steps_display(0);
Score.level_reset();
}
function kill_char() {
if (!c.take_life()) {
Score.brute_score();
var _local2 = SharedObject.getLocal("caverunner_edit");
var _local3 = _local2.data.best_score;
if (Score.__get__Scr() > _local3) {
trace((" new best score [ " + Score.__get__Scr()) + " ] ");
_local2.data.best_score = Score.Scr;
Game.BEST = Score.Scr;
_local2.flush();
} else {
trace((((" you didnt do as well as before [ " + _local3) + " ] today [ ") + Score.__get__Scr()) + " ] ");
Game.BEST = _local3;
}
Game.IS_DEAD = true;
}
Score.lives_display(c.__get__LivesLeft());
}
function reset() {
clear_out();
Game.NEW_LEVEL = true;
}
function update() {
obs.update();
if (Game.MODE == "PLAY") {
p.update();
}
c.update();
if (c._state < 2) {
collision();
}
update_canvas(buffer);
pixels.update(buffer);
in_bounds();
countdown();
if (c.skip_frame) {
c.skip_frame = false;
}
if (c._state == 3) {
stop_countdown();
Score.add_score(Score.__get__LevScr());
var _local2;
_local2 = int((TIME_TO_COMPLETE - timer) / 10);
_local2 = Score.calc_bonus(_local2);
tmp_level_score = Score.__get__Scr() + _local2;
tmp_display_score = _local2;
Blackout.show_bonus(tmp_display_score);
start_fade();
c._state = 4;
}
c.render();
}
function start_fade() {
Game.FADE_ON = true;
fade_in = false;
fade_timer = 0;
init_timer = Blackout.INIT_TIME;
if (fade_int != null) {
clearInterval(fade_int);
}
fade_int = setInterval(this, "fader", 20);
}
function fader() {
if (init_timer > 0) {
init_timer--;
} else if (!fade_in) {
if (fade_timer < Blackout.FADE_TIME) {
fade_timer = fade_timer + 5;
Blackout.fade(true, fade_timer);
} else if (count_wait > 0) {
if (count_wait == COUNT) {
Blackout.show_bonus(tmp_display_score);
}
count_wait--;
} else if (calc_score()) {
c.reset_dir();
c.change_type(0);
reset();
fade_in = true;
}
} else if (fade_timer > 0) {
fade_timer = fade_timer - 10;
Blackout.fade(true, fade_timer);
} else {
Game.FADE_ON = false;
count_wait = COUNT;
clearInterval(fade_int);
}
}
function calc_score() {
var _local2 = Score.__get__Scr();
if (_local2 < tmp_level_score) {
Blackout.show_bonus(tmp_display_score);
tmp_display_score = tmp_display_score - 100;
Score.add_score(100);
} else {
Blackout.show_bonus(0);
return(true);
}
return(false);
}
function update_canvas(buffer) {
if (is_drawn) {
save_canvas.draw(canvas);
is_drawn = false;
canvas.clear();
}
buffer.copyPixels(save_canvas, game_rec, new flash.geom.Point(0, 0));
}
function stop_countdown() {
timer = 0;
IS_COUNT = false;
}
function countdown() {
if (IS_COUNT) {
timer++;
var _local2 = int((TIME_TO_COMPLETE - timer) / 10);
if (_local2 < 1) {
_local2 = 0;
c.time_out();
}
Score.timer_display(_local2);
}
}
function in_bounds() {
var _local2 = c.get_mid_p();
if (!bounds_rec.containsPoint(_local2)) {
soft_reset();
kill_char();
}
}
function soft_reset() {
c.reset();
c.change_type(0);
obs.soft_reset();
Game.REBUILD = true;
}
function collision() {
var _local8 = getCell(c.pos.x, c.pos.y);
var _local7 = getCell(c.old_pos.x, c.old_pos.y);
var _local11 = Math.max(_local8.x, _local7.x);
var _local10 = Math.max(_local8.y, _local7.y);
var _local4;
var _local2;
var _local3 = [];
_local4 = Math.min(_local8.x, _local7.x);
while (_local4 <= _local11) {
_local2 = Math.min(_local8.y, _local7.y);
while (_local2 <= _local10) {
if (grid[_local4][_local2] != undefined) {
if (grid[_local4][_local2].length > 0) {
_local3 = _local3.concat(grid[_local4][_local2]);
}
}
_local2++;
}
_local4++;
}
if (_local3.length > 0) {
var _local6;
var _local9;
var _local5 = c.pos.clone();
for (var _local12 in _local3) {
if (_local3[_local12].num == undefined) {
} else if (Game.getItemIndex(c.local_segs, _local3[_local12]) == -1) {
_local9 = _local3[_local12].intersect(_local5, c.old_pos);
if (_local9 != _local5) {
_local5 = _local9;
_local6 = _local3[_local12];
}
}
if (_local6 != undefined) {
if ((_local6._type == 1) && (c.char_type == 3)) {
trace(" pass through ");
} else {
c.joinSegment(_local6, _local5);
}
}
}
}
}
function getCell(x, y) {
var _local2 = new flash.geom.Point();
_local2.x = Math.floor(x / cellsize);
_local2.y = Math.floor(y / cellsize);
return(_local2);
}
function lineIntersectRec(s, rec) {
if (rec.containsPoint(s.start) || (rec.containsPoint(s.end))) {
return(true);
}
var _local6;
var _local4;
var _local7;
var _local5;
_local6 = new PointX(rec.left, rec.top);
_local6.subP(s.start);
_local4 = new PointX(rec.right, rec.top);
_local4.subP(s.start);
_local7 = new PointX(rec.left, rec.bottom);
_local7.subP(s.start);
_local5 = new PointX(rec.right, rec.bottom);
_local5.subP(s.start);
var _local3;
_local3 = ((s.normal.dotZeroOne(_local6) + s.normal.dotZeroOne(_local4)) + s.normal.dotZeroOne(_local7)) + s.normal.dotZeroOne(_local5);
if ((_local3 == 0) || (_local3 == 4)) {
return(false);
}
return(true);
}
function findDup(s, x, y) {
if (grid[x][y].length > 0) {
var _local2;
for (_local2 in grid[x][y].length > 0) {
if (grid[x][y][_local2].start.equals(s.start) && (grid[x][y][_local2].end.equals(s.end))) {
return(true);
}
}
}
return(false);
}
function add_seg(seg) {
var _local10;
var _local2;
var _local3;
var _local7 = getCell(seg.start.x, seg.start.y);
var _local6 = getCell(seg.end.x, seg.end.y);
var _local9 = Math.max(_local7.x, _local6.x);
var _local8 = Math.max(_local7.y, _local6.y);
_local2 = Math.min(_local7.x, _local6.x);
while (_local2 <= _local9) {
_local3 = Math.min(_local7.y, _local6.y);
while (_local3 <= _local8) {
var _local4 = new flash.geom.Rectangle();
_local4.x = _local2 * cellsize;
_local4.y = _local3 * cellsize;
_local4.width = (_local4.height = cellsize);
if (lineIntersectRec(seg, _local4)) {
if (grid[_local2] == undefined) {
grid[_local2] = [];
}
if (grid[_local2][_local3] == undefined) {
grid[_local2][_local3] = [];
}
if (findDup(seg, _local2, _local3)) {
trace(" dup found ");
return(false);
}
grid[_local2][_local3].push(seg);
}
_local3++;
}
_local2++;
}
drawSegment(seg, false);
segments.push(seg);
return(true);
}
function get_neighbours(p) {
var _local6 = [];
var _local2 = getCell(p.x, p.y);
if (grid[_local2.x] != undefined) {
if (grid[_local2.x][_local2.y] != undefined) {
if (grid[_local2.x][_local2.y].length > 0) {
var _local5;
var _local3;
for (_local5 in grid[_local2.x][_local2.y]) {
_local3 = grid[_local2.x][_local2.y][_local5];
if (_local3.start.equals(p) || (_local3.end.equals(p))) {
_local6.push(_local3);
}
}
}
}
}
return(_local6);
}
function getPoint(x, y) {
var _local6 = new PointX(x, y);
var _local2 = getCell(x, y);
if (grid[_local2.x] != undefined) {
if (grid[_local2.x][_local2.y] != undefined) {
if (grid[_local2.x][_local2.y].length > 0) {
var _local3;
var _local5 = 8;
var _local7 = new PointX(x, y);
for (_local3 in grid[_local2.x][_local2.y]) {
var _local4;
_local4 = flash.geom.Point.distance(_local6, grid[_local2.x][_local2.y][_local3].start);
if (_local4 < _local5) {
_local5 = 1;
_local7 = grid[_local2.x][_local2.y][_local3].start.clone();
}
_local4 = flash.geom.Point.distance(_local6, grid[_local2.x][_local2.y][_local3].end);
if (_local4 < _local5) {
_local5 = 1;
_local7 = grid[_local2.x][_local2.y][_local3].end.clone();
}
}
_local6 = _local7;
}
}
}
return(_local6);
}
function drawSegment(seg, n) {
if (seg.locked) {
return(undefined);
}
canvas.lineStyle(2, 15400917, 100, false, "none");
canvas.moveTo(seg.start.x, seg.start.y);
canvas.lineTo(seg.end.x, seg.end.y);
is_drawn = true;
}
static var TIME_TO_COMPLETE = 20000;
static var COUNT = 40;
}
Symbol 303 MovieClip [__Packages.Char] Frame 0
class Char
{
var mc, ani_mc, bg_mc, count_mc, omnitrix_mc, pos, old_pos, speed, start_pos, dir, local_segs, distance, _state, _savestate, pause_time, angle, _pause, is_playing, hitwall, step_cnt, lives, _savetype, char_type, _saveframe, curr_segment;
function Char (mc, bg_mc, omnitrix_mc) {
this.mc = mc;
ani_mc = mc.ani_mc;
this.bg_mc = bg_mc;
count_mc = mc.count_mc;
this.omnitrix_mc = omnitrix_mc;
pos = new PointX(0, 0);
old_pos = new PointX(0, 0);
speed = new PointX(0, 0);
start_pos = new PointX(64, 0);
dir = 1;
local_segs = [];
distance = 0;
_state = -1;
_savestate = _state;
pause_time = PAUSE_NUM;
angle = 0;
_pause = 0;
is_playing = false;
hitwall = 0;
change_type(0);
step_cnt = 0;
lives = INIT_LIVES;
render();
}
function get LivesLeft() {
return(lives);
}
function reset_lives() {
lives = INIT_LIVES;
}
function take_life() {
if (lives > 0) {
lives--;
trace((" now lives [ " + lives) + " ] ");
return(true);
}
trace((" trying to kill with [ " + lives) + " ] lives ");
return(false);
}
function step_reset() {
step_cnt = 0;
}
function react(ob) {
switch (ob._type) {
case 0 :
_savetype = ob._char;
PlaySound.playClip("bip");
ob.remove();
stop_watch();
var _local3 = ["ben10", "cannonball", "diamondhead", "ghostfreak"];
Debug.output(("pickup watch, change char to [" + _local3[char_type]) + "]");
Score.add_level_score(250);
break;
case 1 :
if (char_type != 3) {
if (hitwall == 0) {
change_dir();
}
hitwall = 3;
}
trace(" collision with wall ");
break;
case 2 :
Debug.output("hit boulder");
if (char_type != 2) {
knock(ob);
}
break;
case 3 :
Score.add_level_score(ob._value);
PlaySound.playClip("bip");
ob.remove();
return(true);
case 4 :
trace(" collision with other wlal ");
break;
case 7 :
Score.add_level_score(1000);
Debug.output(" reached finish ");
_state = 3;
change_type(0);
bg_mc.gotoAndPlay(1);
ani_mc.gotoAndPlay("win");
PlaySound.playClip("untransform");
trace(" does this HAPPENN ");
}
return(false);
}
function time_out() {
_state = 2;
speed.x = speed.x * -1;
ani_mc.gotoAndPlay("fall");
is_playing = false;
}
function knock(ob) {
_state = 2;
var _local4 = new PointX(ob.pos.x - pos.x, ob.pos.y - pos.y);
var _local3 = _local4.clone();
_local3.normalize(1);
var _local2 = _local4.reflectOffUnit(_local3, 1);
_local2.normalize(3);
speed.x = _local2.x;
speed.y = _local2.y;
ani_mc.gotoAndPlay("fall");
is_playing = false;
}
function change_type(n) {
if (n == null) {
trace(" bad save state ");
}
if (char_type == n) {
Debug.output(" change_type fail " + n);
return(false);
}
char_type = n;
mc.gotoAndStop(n + 1);
Debug.output(" change type success ");
return(true);
}
function reset_dir() {
dir = 1;
mc._xscale = 100;
}
function reset() {
pos = new PointX(0, 0);
old_pos = new PointX(0, 0);
speed = new PointX(0, 0);
local_segs = [];
distance = 0;
angle = 0;
_state = -1;
_pause = 0;
is_playing = false;
reset_dir();
set_start(start_pos.x, start_pos.y);
}
function set_start(x, y) {
_state = -1;
start_pos.x = x;
start_pos.y = y;
pos.x = start_pos.x;
pos.y = start_pos.y;
old_pos.x = pos.x;
old_pos.y = pos.y;
render();
}
function stop_watch() {
trace(" FIX : pause moving objects, too ");
_savestate = _state;
_saveframe = ani_mc._currentframe;
ani_mc.stop();
omnitrix_mc._visible = true;
omnitrix_mc.gotoAndPlay(1);
omnitrix_mc.omni_mc.gotoAndPlay(1);
omnitrix_mc.omni_mc.char_mc.gotoAndStop(_savetype + 1);
_state = -2;
}
function update() {
switch (_state) {
case -2 :
if (pause_time > 0) {
pause_time--;
} else {
_state = _savestate;
ani_mc.gotoAndPlay(_saveframe);
change_type(_savetype);
_savetype = null;
omnitrix_mc._visible = false;
PlaySound.playClip("transform");
bg_mc.gotoAndPlay(1);
pause_time = PAUSE_NUM;
}
break;
case -1 :
if (wait_time > 0) {
if (wait_time == WAIT) {
ani_mc.gotoAndPlay("breath");
count_mc.gotoAndPlay(2);
}
wait_time--;
} else {
_state = 0;
wait_time = WAIT;
}
break;
case 0 :
speed.offset(0, 0.5);
old_pos = pos.clone();
pos.addP(speed);
if ((pos.y > old_pos.y) && ((pos.y - old_pos.y) < 1)) {
ani_mc.gotoAndPlay("fall");
}
break;
case 1 :
var _local2;
if (char_type == 1) {
_local2 = STEP_NUM * 2;
} else if (char_type == 3) {
_local2 = STEP_NUM - 1;
} else if (char_type == 2) {
_local2 = STEP_NUM - 0.5;
} else {
_local2 = STEP_NUM;
}
var _local3 = false;
move_on_seg(_local2, _local3);
step_cnt++;
Score.steps_display(int(step_cnt / 7));
break;
case 2 :
speed.offset(0, 0.5);
old_pos = pos.clone();
pos.addP(speed);
break;
case 3 :
}
if (hitwall > 0) {
hitwall--;
}
}
function get_mid_p() {
var _local2 = pos.clone();
return(_local2);
}
function move_on_seg(step, is_overlap) {
if (_pause > 0) {
_pause--;
return(undefined);
}
if (_pause == 0) {
if (!is_playing) {
ani_mc.gotoAndPlay("run");
is_playing = true;
}
}
if (!is_overlap) {
old_pos = pos.clone();
}
var _local2 = (step * dir) * (1 + (curr_segment.speed * dir));
distance = distance + _local2;
var _local3 = 0;
if (dir == 1) {
if (distance > curr_segment.length) {
pos = curr_segment.end.clone();
_local3 = distance - curr_segment.length;
loadNextSegment(_local3);
} else {
pos.offset(curr_segment.unit.x * _local2, curr_segment.unit.y * _local2);
}
} else if (distance < 0) {
pos = curr_segment.start.clone();
_local3 = Math.abs(distance);
loadNextSegment(_local3);
} else {
pos.offset(curr_segment.unit.x * _local2, curr_segment.unit.y * _local2);
}
}
function render() {
mc._x = pos.x;
mc._y = pos.y;
}
function loadNextSegment(_overlap) {
if (dir == 1) {
if (curr_segment.right != undefined) {
if (curr_segment.right.platform) {
curr_segment = curr_segment.right;
distance = 0;
change_angle(curr_segment.angle);
local_segs = [];
if (curr_segment.left != undefined) {
local_segs.push(curr_segment.left);
}
local_segs.push(curr_segment);
if (curr_segment.right != undefined) {
local_segs.push(curr_segment.right);
}
move_on_seg(_overlap, true);
return(undefined);
}
change_dir();
return(undefined);
}
jump();
} else {
if (curr_segment.left != undefined) {
if (curr_segment.left.platform) {
curr_segment = curr_segment.left;
distance = curr_segment.length;
change_angle(curr_segment.angle);
local_segs = [];
if (curr_segment.right != undefined) {
local_segs.push(curr_segment.right);
}
local_segs.push(curr_segment);
if (curr_segment.left != undefined) {
local_segs.push(curr_segment.left);
}
move_on_seg(_overlap, true);
return(undefined);
}
change_dir();
return(undefined);
}
jump();
}
}
function jump() {
pos.offset((curr_segment.normal.x * dir) * 2, (curr_segment.normal.y * dir) * 2);
if (dir == 1) {
pos = curr_segment.end.clone();
} else {
pos = curr_segment.start.clone();
}
old_pos = pos.clone();
var _local3;
var _local2;
if (char_type == 1) {
_local3 = 8 * dir;
_local2 = -7;
} else if (char_type == 3) {
_local3 = 3 * dir;
_local2 = -4;
} else if (char_type == 2) {
_local3 = 4 * dir;
_local2 = -4.5;
} else {
_local3 = 4 * dir;
_local2 = -5;
}
speed.x = _local3;
speed.y = _local2;
_state = 0;
curr_segment = undefined;
local_segs = [];
ani_mc.gotoAndPlay("jump");
is_playing = false;
}
function joinSegment(_seg, _pos) {
if (skip_frame) {
return(false);
}
skip_frame = true;
if (_seg.platform) {
if (_seg._type == 2) {
_state = 3;
change_type(0);
bg_mc.gotoAndPlay(1);
ani_mc.gotoAndPlay("win");
PlaySound.playClip("untransform");
}
if (_state == 0) {
_state = 1;
if (speed.y > 6) {
_pause = Math.ceil(speed.y - 6) + 2;
ani_mc.gotoAndPlay("land");
} else {
ani_mc.gotoAndPlay("run");
is_playing = true;
}
}
local_segs = [];
local_segs.push(_seg);
if (_seg.right != undefined) {
local_segs.push(_seg.right);
}
if (_seg.left != undefined) {
local_segs.push(_seg.left);
}
curr_segment = _seg;
change_angle(_seg.angle);
distance = flash.geom.Point.distance(_seg.start, _pos);
pos = _pos;
old_pos = _pos.clone();
} else {
bounce_off(_seg, _pos);
}
return(true);
}
function bounce_off(_seg, _pos) {
var _local2 = _seg.reflect(pos, old_pos);
pos = _pos;
speed = _local2.clone();
_local2.mul(0.1);
pos.addP(_local2);
speed.mul(0.9);
if (_state == 0) {
_pause = 0;
}
if (_local2.x > 0) {
if (dir == -1) {
change_dir();
}
} else if (dir == 1) {
change_dir();
}
}
function change_dir() {
if (dir > 0) {
dir = -1;
} else {
dir = 1;
}
mc._xscale = 100 * dir;
}
function change_angle(n) {
angle = n;
mc._rotation = angle / 4;
}
static var STEP_NUM = 3.5;
static var WAIT = 120;
static var PAUSE_NUM = 37;
static var INIT_LIVES = 10;
var skip_frame = false;
var wait_time = WAIT;
}
Symbol 304 MovieClip [__Packages.PointX] Frame 0
class PointX extends flash.geom.Point
{
var x, y;
function PointX (tX, tY) {
super();
x = tX;
y = tY;
}
function subtract(p) {
var _local2 = new PointX(x - p.x, y - p.y);
return(_local2);
}
function clone() {
var _local2 = new PointX(x, y);
return(_local2);
}
function dot(p) {
return((x * p.x) + (y * p.y));
}
function dotZeroOne(p) {
var _local2 = dot(p);
if (_local2 > 0) {
return(1);
}
return(0);
}
function addP(p) {
x = x + p.x;
y = y + p.y;
}
function subP(p) {
x = x - p.x;
y = y - p.y;
}
function mul(n) {
x = x * n;
y = y * n;
}
function div(n) {
x = x / n;
y = y / n;
}
function rot90(d) {
var _local2 = clone();
if (d > 0) {
x = -_local2.y;
y = _local2.x;
} else {
x = _local2.y;
y = -_local2.x;
}
}
function rot(r) {
var _local2 = rMatrix(r);
var _local4 = (x * _local2[0][0]) + (y * _local2[1][0]);
var _local3 = (x * _local2[0][1]) + (y * _local2[1][1]);
x = _local4;
y = _local3;
}
function reflectOffUnit(unit, percent) {
var _local3 = parallelToUnit(this, unit);
_local3.mul(-1 - percent);
var _local2 = clone();
_local2.addP(_local3);
return(_local2);
}
static function rMatrix(r) {
var _local2 = Math.cos(r);
var _local1 = Math.sin(r);
return([[_local2, _local1], [-_local1, _local2]]);
}
static function parallelToUnit(vector, unit) {
var _local1 = unit.clone();
var _local2 = vector.dot(unit);
_local1.mul(_local2);
return(_local1);
}
}
Symbol 305 MovieClip [__Packages.Segment] Frame 0
class Segment
{
var _type, num, start, end, unit, length, normal, rect, angle, platform, wall, speed, left, right, lineLeft, lineRight, locked;
function Segment (p1, p2, n, lock, _type) {
if (_type == undefined) {
this._type = 0;
} else {
this._type = _type;
}
num = n;
if (p1.x < p2.x) {
start = p1;
end = p2;
} else {
start = p2;
end = p1;
}
unit = end.subtract(start);
length = unit.length;
unit.normalize(1);
normal = unit.clone();
normal.rot90(-1);
rect = new flash.geom.Rectangle();
rect.x = Math.min(start.x, end.x);
rect.y = Math.min(start.y, end.y);
rect.width = Math.abs(start.x - end.x);
rect.height = Math.abs(start.y - end.y);
angle = (Math.atan2(normal.x, -normal.y) * 180) / Math.PI;
platform = Math.abs(angle) <= 60;
wall = !platform;
speed = angle / 150;
left = null;
right = null;
lineLeft = null;
lineRight = null;
locked = lock;
}
function print_start_end() {
return((((((((" start x[" + start.x) + "]y[") + start.y) + "] end x[") + end.x) + "]y[") + end.y) + "]");
}
function addNeighbour(seg) {
if (seg.start.equals(start) && (seg.end.equals(end))) {
return(undefined);
}
if (seg.start.equals(end) || (seg.end.equals(end))) {
lineRight = seg;
} else {
lineLeft = seg;
}
if (wall) {
return(undefined);
}
if (seg.start.equals(end) || (seg.end.equals(end))) {
if (right != undefined) {
var _local4 = right.angle;
if (right.end.equals(end)) {
_local4 = _local4 + -180;
}
}
if (seg.wall) {
if (seg.start.equals(end)) {
var _local5 = seg.angle;
} else if (seg.unit.y < 0) {
var _local5 = 180 + seg.angle;
} else {
var _local5 = -180 + seg.angle;
}
if (_local5 > 0) {
return(undefined);
}
if (right == undefined) {
right = seg;
} else if (_local5 < _local4) {
right = seg;
}
} else if (seg.start.equals(end)) {
if (right == undefined) {
right = seg;
} else if (seg.angle < _local4) {
right = seg;
}
}
} else {
if (left != undefined) {
var _local3 = left.angle;
if (left.start.equals(start)) {
_local3 = _local3 + 180;
}
}
if (seg.wall) {
if (seg.end.equals(start)) {
var _local5 = seg.angle;
} else if (seg.unit.y < 0) {
var _local5 = 180 + seg.angle;
} else {
var _local5 = -180 + seg.angle;
}
if (_local5 < 0) {
return(undefined);
}
if (left == undefined) {
left = seg;
} else if (_local5 > _local3) {
left = seg;
}
} else if (seg.end.equals(start)) {
if (left == undefined) {
left = seg;
} else if (seg.angle > _local3) {
left = seg;
}
}
}
}
function remove() {
if (!locked) {
die();
}
}
function die() {
if (left != undefined) {
left.removeNeighbour(1);
}
if (right != undefined) {
right.removeNeighbour(-1);
}
if (lineLeft != undefined) {
lineLeft.removeLine(this);
}
if (lineRight != undefined) {
lineRight.removeLine(this);
}
delete num;
delete start;
delete end;
delete unit;
delete normal;
delete length;
delete rect;
delete platform;
delete wall;
delete angle;
delete speed;
delete left;
delete right;
delete lineLeft;
delete lineRight;
delete locked;
}
function removeNeighbour(side) {
if (side == 1) {
right = undefined;
} else {
left = undefined;
}
}
function removeLine(seg) {
if (lineRight == seg) {
lineRight = undefined;
} else if (lineLeft == seg) {
lineLeft = undefined;
}
}
function intersect(pos, old) {
var _local12 = old.subtract(start);
var _local11 = pos.subtract(start);
var _local8 = pos.subtract(old);
if (platform) {
var _local13 = _local8.dot(normal);
if (_local13 > 0) {
return(pos);
}
}
var _local2 = _local12.dot(normal);
var _local5 = _local11.dot(normal);
var _local4 = false;
if (_local2 > 0) {
_local4 = _local5 < 0;
} else if (_local2 < 0) {
_local4 = _local5 > 0;
}
if (_local4) {
var _local14 = Math.abs(_local2) / Math.abs(_local2 + (-_local5));
var _local3 = _local8.clone();
_local3.mul(_local14);
_local3.addP(old);
var _local10 = _local3.subtract(start);
var _local6 = _local10.dot(unit);
if ((_local6 > 0) && (_local6 <= length)) {
return(_local3);
}
}
return(pos);
}
function reflect(pos, old) {
var _local3 = old.subtract(pos);
var _local2 = _local3.reflectOffUnit(unit, 1);
return(_local2);
}
}
Symbol 306 MovieClip [__Packages.Obj] Frame 0
class Obj
{
var mc, pos, start_pos, speed, is_dead, _type, is_active, rad, _value, _char;
function Obj (mc) {
this.mc = mc;
pos = new PointX(0, 0);
start_pos = new PointX(0, 0);
speed = new PointX(0, 0);
}
function set_drag(enable) {
if (enable) {
mc.onRollOver = com.playerthree.util.Proxy.create(this, over);
mc.onRollOut = com.playerthree.util.Proxy.create(this, out);
mc.onPress = com.playerthree.util.Proxy.create(this, grab);
mc.onMouseUp = com.playerthree.util.Proxy.create(this, drop);
} else {
mc.onRollOut = null;
mc.onRollOver = null;
mc.onPress = null;
mc.onRelease = null;
}
}
function over() {
trace(" over obj ");
}
function out() {
}
function grab() {
is_drag = true;
}
function drop() {
is_drag = false;
start_pos.x = pos.x;
start_pos.y = pos.y;
}
function get Dead() {
return(is_dead);
}
function remove() {
is_dead = true;
}
function init(x, y, _type, _char) {
pos.x = x;
pos.y = y;
start_pos.x = x;
start_pos.y = y;
this._type = _type;
speed.x = SPEED_VEC[_type][0];
speed.y = SPEED_VEC[_type][1];
is_active = true;
if (((_type != 7) && (_type != 5)) && (_type != 6)) {
mc.gotoAndStop(_type + 1);
}
rad = mc.hit_mc._width * 0.5;
_value = VAL;
is_dead = false;
this._char = _char;
render();
}
function reset() {
pos.x = start_pos.x;
pos.y = -40;
}
function update() {
if (is_drag) {
pos.x = _root._xmouse;
pos.y = _root._ymouse;
}
switch (_type) {
case 0 :
break;
case 1 :
case 2 :
pos.x = pos.x + speed.x;
pos.y = pos.y + speed.y;
if (pos.x > (Game.SCREEN_WIDTH + 100)) {
pos.x = -100;
} else if (pos.x < -100) {
pos.x = Game.SCREEN_WIDTH + 100;
}
if (pos.y > (Game.SCREEN_HEIGHT + 30)) {
pos.y = -30;
} else {
if (pos.y >= -100) {
break;
}
pos.y = Game.SCREEN_HEIGHT + 100;
}
}
}
function collide(p) {
if (!is_active) {
return(false);
}
if (_type == 1) {
if (p.x < (pos.x + 2)) {
return(false);
}
if (p.x > (pos.x + 24)) {
return(false);
}
trace(" wall collision ");
return(true);
}
var _local2 = flash.geom.Point.distance(pos, p);
var _local3 = rad + 16;
if (_local2 < _local3) {
is_active = false;
return(true);
}
return(false);
}
function render() {
mc._x = pos.x;
mc._y = pos.y;
}
static var VAL = 100;
static var SPEED_VEC = [[0, 0], [0, 0], [0, 2], [0, 0]];
var is_drag = false;
}
Symbol 307 MovieClip [__Packages.com.playerthree.util.Proxy] Frame 0
class com.playerthree.util.Proxy
{
function Proxy () {
}
static function create(oTarget, fFunction) {
var aParameters = new Array();
var _local2 = 2;
while (_local2 < arguments.length) {
aParameters[_local2 - 2] = arguments[_local2];
_local2++;
}
var _local4 = function () {
var _local2 = arguments.concat(aParameters);
fFunction.apply(oTarget, _local2);
};
return(_local4);
}
}
Symbol 308 MovieClip [__Packages.PlaySound] Frame 0
class PlaySound
{
static var MC;
function PlaySound () {
}
static function toggleSound() {
if (!IS_MUTE) {
trace(" mute sound ");
MC.gotoAndPlay("end_loop");
stopAllSounds();
IS_MUTE = true;
return(true);
}
trace(" unmute ");
MC.gotoAndPlay("start_loop");
IS_MUTE = false;
return(false);
}
static function init(mc) {
trace(" init sound ");
MC = mc;
MC.gotoAndPlay("start_loop");
trace(" MC " + MC);
}
static function playClip(str) {
if (IS_MUTE) {
return(false);
}
MC.gotoAndPlay(str);
return(true);
}
static var IS_MUTE = false;
}
Symbol 309 MovieClip [__Packages.Debug] Frame 0
class Debug
{
static var MC, TXT;
function Debug () {
}
static function init(mc) {
MC = mc;
TXT = MC.debug_txt;
}
static function output(s) {
var _local1 = TXT.text;
_local1 = (s + newline) + _local1;
TXT.text = _local1;
}
}
Symbol 310 MovieClip [__Packages.Score] Frame 0
class Score
{
static var MC, TXT, TIME_TXT, STEPS_TXT, LIVES_TXT;
function Score () {
}
static function init(mc) {
MC = mc;
TXT = MC.score_mc.score_txt;
TXT.text = SCR_STRING;
TIME_TXT = MC.timer_mc.score_txt;
TIME_TXT.text = TIMER_STRING;
STEPS_TXT = MC.steps_mc.score_txt;
STEPS_TXT.text = STEPS_STRING;
LIVES_TXT = MC.lives_mc.score_txt;
LIVES_TXT.text = "10";
}
static function soft_reset() {
STEPS_NUM = (TIME_NUM = 0);
}
static function calc_bonus(n) {
var _local1 = n;
_local1 = _local1 - (STEPS_NUM * 10);
return(_local1);
}
static function add_level_score(n) {
LEVEL_BONUS = LEVEL_BONUS + n;
var _local3 = SCR_NUM + LEVEL_BONUS;
var _local2 = _local3.toString();
var _local1 = SCR_STRING;
_local1 = _local1.substr(0, _local1.length - _local2.length);
_local1 = _local1 + _local2;
TXT.text = _local1;
}
static function brute_score() {
SCR_NUM = SCR_NUM + LEVEL_BONUS;
}
static function add_score(n) {
SCR_NUM = SCR_NUM + n;
var _local2 = SCR_NUM.toString();
var _local1 = SCR_STRING;
_local1 = _local1.substr(0, _local1.length - _local2.length);
_local1 = _local1 + _local2;
TXT.text = _local1;
}
static function steps_display(n) {
STEPS_NUM = n;
var _local1 = STEPS_STRING;
var _local2 = STEPS_NUM.toString();
_local1 = _local1.substr(0, _local1.length - _local2.length);
_local1 = _local1 + _local2;
STEPS_TXT.text = _local1;
}
static function lives_display(n) {
LIVES_TXT.text = n.toString();
}
static function timer_display(n) {
TIME_NUM = n;
var _local1 = TIMER_STRING;
_local1 = _local1.substr(0, _local1.length - n.toString().length);
_local1 = _local1 + n.toString();
TIME_TXT.text = _local1;
}
static function get Scr() {
return(SCR_NUM);
}
static function get LevScr() {
return(LEVEL_BONUS);
}
static function level_reset() {
LEVEL_BONUS = 0;
var _local3 = SCR_NUM + LEVEL_BONUS;
var _local2 = _local3.toString();
var _local1 = SCR_STRING;
_local1 = _local1.substr(0, _local1.length - _local2.length);
_local1 = _local1 + _local2;
TXT.text = _local1;
}
static function reset() {
SCR_NUM = 0;
TIME_NUM = 0;
STEPS_NUM = 0;
LEVEL_BONUS = 0;
}
static var TOTAL_TIME = 10000;
static var SCR_NUM = 0;
static var TIME_NUM = 0;
static var STEPS_NUM = 0;
static var SCR_STRING = "00000";
static var TIMER_STRING = "0000";
static var STEPS_STRING = "000";
static var LEVEL_BONUS = 0;
}
Symbol 311 MovieClip [__Packages.ObjPool] Frame 0
class ObjPool
{
var mc, d, objs, plats, c, start_ob, finish_ob, _id;
function ObjPool (mc, d) {
this.mc = mc;
this.d = d;
objs = [];
plats = [];
}
function init(c) {
this.c = c;
}
function create_platform(x, y, _type) {
var _local2 = mc.attachMovie("platform", (("platform" + x) + "_") + y, mc.getNextHighestDepth());
_local2._x = x;
_local2._y = y;
_local2.gotoAndStop(_type + 1);
var _local3 = new Obj(_local2);
_local3.init(x, y, 5, _type);
objs.push(_local3);
}
function setEdit(is_edit) {
if (is_edit) {
var _local2 = objs.length;
while (_local2-- , _local2 > -1) {
objs[_local2].set_drag(true);
}
} else {
var _local2 = objs.length;
while (_local2-- , _local2 > -1) {
objs[_local2].set_drag(false);
}
}
}
function create_start(x, y) {
var _local3 = mc.attachMovie("start", "start_mc", mc.getNextHighestDepth());
var _local2 = new Obj(_local3);
_local2.init(x, y, 6, 0);
objs.push(_local2);
start_ob = _local2;
}
function create_finish(x, y) {
var _local3 = mc.attachMovie("finish", "finish_mc", mc.getNextHighestDepth());
var _local2 = new Obj(_local3);
_local2.init(x, y, 7, 0);
objs.push(_local2);
finish_ob = _local2;
}
function create_ob(x, y, _type, _char) {
_id = ID;
ID++;
var _local3 = mc.attachMovie("obj", "obj" + _id, mc.getNextHighestDepth());
var _local2 = new Obj(_local3);
_local2.init(x, y, _type, _char);
objs.push(_local2);
}
function soft_reset() {
var _local3 = objs.length;
while (_local3-- , _local3 > -1) {
var _local2 = objs[_local3];
if (_local2._type == 2) {
_local2.reset();
}
}
}
function reset() {
var _local3 = objs.length;
while (_local3-- , _local3 > -1) {
var _local2 = objs[_local3];
_local2.remove();
}
}
function get_start() {
var _local2;
_local2 = [];
_local2.push(start_ob.pos.x, start_ob.pos.y);
trace(_local2.toString() + " < start ");
return(_local2);
}
function get_finish() {
var _local2;
_local2 = [];
_local2.push(finish_ob.pos.x, finish_ob.pos.y);
trace(_local2.toString() + " < finish ");
return(_local2);
}
function get_obs() {
var _local3;
_local3 = [];
_local3.push([], [], [], []);
var _local8 = objs.length;
while (_local8-- , _local8 > -1) {
var _local2 = objs[_local8];
if (((_local2._type != 5) && (_local2._type != 4)) && (_local2._type != 6)) {
var _local6 = _local2.pos.x;
var _local5 = _local2.pos.y;
var _local4 = _local2._type;
var _local7 = _local2._char;
_local3[0].push(_local6);
_local3[1].push(_local5);
_local3[2].push(_local4);
_local3[3].push(_local7);
}
}
return(_local3);
}
function get_plats() {
var _local3;
_local3 = [];
_local3.push([], [], [], []);
var _local7;
_local7 = objs.length;
while (_local7-- , _local7 > -1) {
var _local2 = objs[_local7];
if (_local2._type == 5) {
var _local6 = _local2.pos.x;
var _local5 = _local2.pos.y;
var _local4 = _local2._char;
_local3[0].push(_local6);
_local3[1].push(_local5);
_local3[2].push(_local4);
}
}
return(_local3);
}
function update() {
var _local5 = objs.length;
while (_local5-- , _local5 > -1) {
var _local2 = objs[_local5];
if (!_local2.__get__Dead()) {
_local2.update();
var _local3 = new PointX(0, 0);
_local3.x = c.pos.x;
_local3.y = c.pos.y - 16;
if (_local2.collide(_local3)) {
if (c.react(_local2)) {
var _local4 = mc.attachMovie("plum", "plum" + _local5, mc.getNextHighestDepth());
_local4._x = _local2.mc._x;
_local4._y = _local2.mc._y;
_local4.txt_mc.plum_txt.text = _local2._value.toString();
}
}
_local2.render();
} else {
_local2.mc.removeMovieClip();
objs.splice(_local5, 1);
}
}
}
static var ID = 0;
}
Symbol 312 MovieClip [__Packages.Data] Frame 0
class Data
{
var xp, yp, xpp, ypp, obx, oby, obtype, obchar, platx, platy, plattype, start_x, start_y, finish_x, finish_y, p, m;
function Data () {
xp = [];
yp = [];
xpp = [];
ypp = [];
obx = [];
oby = [];
obtype = [];
obchar = [];
obx = [-100, -50, -100, -50, -100, -50, -100, -50, -100, -50, -100, -50, -100, -50, -100, -50, -100, -50, -100, -50, -100, -50, -100, -50, -100, -50, -100, -50, -100, -50, -150, 0, -150];
oby = [20, 20, 40, 40, 60, 60, 80, 80, 100, 100, 120, 120, 140, 140, 160, 160, 180, 180, 200, 200, 220, 220, 240, 240, 260, 260, 300, 300, 320, 320, 20, 440, 0];
obtype = [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 2, 0, 0, 1, 4, 2];
obchar = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 2, 0, 0, 0];
platx = [];
platy = [];
plattype = [];
platx = [200, 400, 360, 640, 640, 640, 640, 640, 640, 640, 640];
platy = [120, 80, 255, 100, 120, 140, 160, 180, 200, 220, 240];
plattype = [0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1];
start_x = 64;
start_y = 64;
finish_x = 64;
finish_y = 312;
}
function reset() {
xp = [];
yp = [];
xpp = [];
ypp = [];
}
function init(p, m) {
this.p = p;
this.m = m;
}
function add_data(px, py, x, y) {
xpp.push(px);
ypp.push(py);
xp.push(x);
yp.push(y);
}
function set_start(s) {
if (s[0] == undefined) {
start_x = 64;
start_y = 64;
trace(" default start ");
return(false);
}
start_x = s[0];
start_y = s[1];
return(true);
}
function set_finish(f) {
if (f[0] == undefined) {
finish_x = 200;
finish_y = 200;
trace(" default finish ");
return(false);
}
finish_x = f[0];
finish_y = f[1];
return(true);
}
function set_plat_data(obj_data) {
if (obj_data[0] == undefined) {
return(false);
}
platx = obj_data[0];
platy = obj_data[1];
plattype = obj_data[2];
return(true);
}
function set_level_data(level) {
if (level[0] == undefined) {
return(false);
}
xpp = level[0].slice();
ypp = level[1].slice();
xp = level[2].slice();
yp = level[3].slice();
return(true);
}
function set_ob_data(objects) {
if (objects[0] == undefined) {
return(false);
}
obx = objects[0];
oby = objects[1];
obtype = objects[2];
obchar = objects[3];
return(true);
}
function get_platforms() {
var _local2 = new Array();
_local2.push(platx, platy, plattype);
return(_local2);
}
function get_objects() {
var _local2 = new Array();
_local2.push(obx, oby, obtype, obchar);
return(_local2);
}
function get_level_data() {
var _local1 = new Array();
_local1.push([], [], [], []);
return(_local1);
}
function print_out() {
trace(" xpp : " + xpp.toString());
trace(" ypp : " + ypp.toString());
trace(" xp : " + xp.toString());
trace(" yp : " + yp.toString());
}
function draw_level() {
var _local5 = xpp.length;
while (_local5-- , _local5 > -1) {
p.pen_down(xpp[_local5], ypp[_local5], true);
p.draw_lines(xp[_local5], yp[_local5], false);
p.pen_up(true);
}
create_start();
create_finish();
var _local7 = platx.length;
while (_local7-- , _local7 > -1) {
create_platform(platx[_local7], platy[_local7], plattype[_local7]);
}
var _local4 = obx.length;
while (_local4-- , _local4 > -1) {
var _local3 = obx[_local4];
var _local2 = oby[_local4];
var _local6 = obtype[_local4];
var _local8 = obchar[_local4];
m.obs.create_ob(_local3, _local2, _local6, _local8);
if (_local6 == 4) {
trace(" drawn horizontal wall ");
p.pen_down(_local3, _local2, true);
p.draw_lines(_local3 + 660, _local2, true, true, 1);
p.pen_up(true);
p.pen_down(_local3 + 660, _local2 + 36, true);
p.draw_lines(_local3, _local2 + 36, true, true, 1);
p.pen_up(true);
}
if (_local6 == 1) {
p.pen_down(_local3, _local2, true);
p.draw_lines(_local3 + 1, _local2 + 440, true, true, 1);
p.pen_up(true);
p.pen_down(_local3 + 35, _local2, true);
p.draw_lines(_local3 + 36, _local2 + 438, true, true, 1);
p.pen_up(true);
}
}
}
function create_platform(x, y, _type) {
var _local2 = PLAT_WIDTH[_type];
p.pen_down(x - _local2, y, true);
p.draw_lines(x + _local2, y, false, true);
p.pen_up(true);
m.obs.create_platform(x, y, _type);
}
function create_start() {
p.pen_down(start_x - 16, start_y, true);
p.draw_lines(start_x + 16, start_y, false, true);
p.pen_up(true);
m.obs.create_start(start_x, start_y, true);
m.c.set_start(start_x, start_y - 2);
}
function create_finish() {
p.pen_down(finish_x - 90, finish_y, true);
p.draw_lines(finish_x + 30, finish_y, false, true, 2);
p.pen_up(true);
m.obs.create_finish(finish_x, finish_y);
}
static var PLAT_WIDTH = [30, 16];
}
Symbol 313 MovieClip [__Packages.PixelPool] Frame 0
class PixelPool
{
var pixels;
function PixelPool () {
pixels = [];
}
function create(x, y) {
var _local2 = new Pixel(x, y, 4294967295);
pixels.push(_local2);
}
function update(buffer) {
var _local7;
var _local6;
var _local4;
var _local3;
var _local15;
var _local14;
var _local18;
var _local19;
var _local21;
var _local5;
var _local13 = pixels.length;
while (_local13-- , _local13 > -1) {
var _local2 = pixels[_local13];
if (!_local2.is_dead) {
if (_local2.lifespan < 30) {
_local2.lifespan++;
} else {
_local2.remove();
}
_local7 = _local2.sx;
_local6 = _local2.sy;
_local4 = _local2.vx;
_local3 = _local2.vy;
if (_local2.is_first) {
var _local10 = Math.random() * 8;
if (_local10 > 4) {
_local10 = _local10 - 8;
}
_local4 = _local10;
_local3 = (-Math.random()) * 8;
_local2.is_first = false;
}
_local15 = _local2.tx - _local7;
_local14 = _local2.ty - _local6;
_local4 = _local4 * DAMP;
_local3 = _local3 * DAMP;
var _local16 = 0.9;
_local3 = _local3 + _local16;
_local7 = _local7 + _local4;
_local6 = _local6 + _local3;
_local2.sx = _local7;
_local2.sy = _local6;
_local2.vx = _local4;
_local2.vy = _local3;
_local2.rec.x = _local7;
_local2.rec.y = _local6;
_local18 = (_local15 * _local15) + (_local14 * _local14);
_local19 = (0.25 - _local18) / 0.25;
_local5 = _local2.color;
var _local11 = (_local5 & 4278190080) >>> 24;
var _local8 = (_local5 & 16711680) >>> 16;
var _local17 = (_local5 & 65280) >>> 8;
var _local9 = _local5 & 255;
_local11 = Math.max(0, _local11 - 12);
_local8 = Math.max(0, _local8 - 12);
_local9 = Math.max(0, _local9 - 12);
var _local12 = (((_local11 << 24) | (_local8 << 16)) | (_local17 << 8)) | _local9;
_local2.color = _local12;
buffer.fillRect(_local2.rec, _local12);
} else {
pixels.splice(_local13, 1);
}
}
}
static var DAMP = 0.9;
static var RAD = 30;
}
Symbol 314 MovieClip [__Packages.Pixel] Frame 0
class Pixel
{
var is_dead, rec, color, sx, tx, sy, ty, fade, vx, vy;
function Pixel (x, y, color) {
is_dead = false;
rec = new flash.geom.Rectangle(0, 0, 2, 2);
if (color == undefined) {
this.color = 4294967295;
} else {
this.color = color;
}
sx = (tx = x);
sy = (ty = y);
fade = (vx = (vy = 0));
}
function reset() {
fade = 0;
vx = 0;
vy = 0;
sx = tx;
sy = ty;
rec.x = sx;
rec.y = sy;
remove();
}
function remove() {
is_dead = true;
}
var is_first = true;
var lifespan = 0;
}
Symbol 315 MovieClip [__Packages.Blackout] Frame 0
class Blackout
{
static var MC, TXT;
function Blackout () {
}
static function init(mc) {
MC = mc;
TXT = MC.bonus_txt;
TXT._alpha = 0;
MC._alpha = 0;
}
static function fade(is_fade, n) {
if (is_fade) {
MC._alpha = n;
if (n < 50) {
TXT._alpha = 0;
} else {
TXT._alpha = n;
}
}
}
static function show_bonus(n) {
if (n < 1) {
n = 0;
}
TXT.text = n.toString();
}
static var FADE_TIME = 100;
static var INIT_TIME = 10;
}
Symbol 316 MovieClip [__Packages.LevelData] Frame 0
class LevelData
{
static var objects, starts, fins, platforms;
function LevelData () {
}
static function init() {
objects = [];
starts = [];
fins = [];
platforms = [];
var _local7 = [];
var _local6 = [];
var _local2 = [];
_local7.push(146, 388, 283, 249, 640, 640, 640, 549, 640, 640, 640);
_local6.push(189, 220, 222, 78, 120, 140, 160, 306, 200, 220, 240);
_local2.push(0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1);
platforms.push([_local7, _local6, _local2]);
var _local4 = [];
var _local3 = [];
var _local1 = [];
var _local5 = [];
_local4.push(-100, -50, -100, -50, -100, -50, -100, 263, -100, 386, -100, 234, -100, 550, -100, 132, -100, 162, -100, 270, -100, 298, -100, -50, -100, -50, -100, 620, -100, -50, 663, 620, 620, 630, -10);
_local3.push(20, 20, 40, 40, 60, 60, 80, 58, 100, 196, 120, 59, 140, 289, 160, 172, 180, 173, 200, 206, 220, 207, 240, 240, 260, 260, 300, 446, 320, 320, 6, 446, 0, 0, 440);
_local1.push(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 2, 0, 0, 1, 2, 2, 2, 4);
_local5.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 2, 0, 0, 0, 0, 0);
objects.push([_local4, _local3, _local1, _local5]);
starts.push([43, 179]);
fins.push([544, 168]);
_local7 = [];
_local6 = [];
_local2 = [];
_local7.push(138, 418, 317, 243, 119, 640, 545, 549, 640, 640, 640);
_local6.push(84, 256, 314, 78, 279, 140, 226, 306, 200, 220, 240);
_local2.push(0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1);
platforms.push([_local7, _local6, _local2]);
_local4 = [];
_local3 = [];
_local1 = [];
_local5 = [];
_local4.push(-100, -50, -100, -50, -100, -50, -100, 258, 135, 413, 333, 230, 102, 550, 306, 400, 366, 192, 532, 123, 561, 154, 385, -50, -100, -50, -100, 620, -100, 312, 663, 484, 484, 484);
_local3.push(20, 20, 40, 40, 60, 60, 80, 60, 262, 219, 297, 59, 262, 289, 297, 171, 101, 49, 207, 63, 207, 63, 132, 240, 260, 260, 300, 154, 320, 48, 6, 154, 20, 310);
_local1.push(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 2, 0, 0, 1, 2, 2, 2);
_local5.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 2, 0, 0, 0, 0);
objects.push([_local4, _local3, _local1, _local5]);
starts.push([41, 80]);
fins.push([546, 95]);
_local7 = [];
_local6 = [];
_local2 = [];
_local7.push(199, 419, 325, 543, 449, 640, 198, 326, 672, 660, 640);
_local6.push(97, 117, 277, 167, 256, 140, 295, 119, 190, 209, 240);
_local2.push(0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1);
platforms.push([_local7, _local6, _local2]);
_local4 = [];
_local3 = [];
_local1 = [];
_local5 = [];
_local4.push(420, 188, 324, 217, 339, -100, 310, -100, -50, -100, -50, -100, -50, 499, 620, -100, -50, 620, -10);
_local3.push(96, 277, 96, 277, 259, 200, 259, 220, 220, 240, 240, 260, 260, 101, 458, 320, 320, -1, 204);
_local1.push(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 2, 0, 0, 1, 4);
_local5.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 2, 0, 0);
objects.push([_local4, _local3, _local1, _local5]);
starts.push([64, 80]);
fins.push([78, 325]);
_local7 = [];
_local6 = [];
_local2 = [];
_local7.push(200, 534, 312, 532, 433, 210, 640, 275, 122, 640, 640);
_local6.push(113, 156, 245, 83, 282, 263, 160, 56, 279, 220, 240);
_local2.push(0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1);
platforms.push([_local7, _local6, _local2]);
_local4 = [];
_local3 = [];
_local1 = [];
_local5 = [];
_local4.push(-100, -50, -100, -50, -100, -50, -100, 553, -100, 448, 417, 514, -100, 533, -100, 187, -100, 216, -100, 297, -100, 327, -100, -50, -100, -50, 276, 620, -100, -50, 360, 620);
_local3.push(20, 20, 40, 40, 60, 60, 80, 63, 100, 262, 261, 62, 140, 136, 160, 96, 180, 96, 200, 224, 220, 224, 240, 240, 260, 260, 25, 264, 320, 320, -19, 264);
_local1.push(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 2, 0, 0, 1, 2);
_local5.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 2, 0, 0);
objects.push([_local4, _local3, _local1, _local5]);
starts.push([49, 296]);
fins.push([546, 300]);
_local7 = [];
_local6 = [];
_local2 = [];
_local7.push(44, 560, 562, 640, 640, 640, 640, 640, 640, 640, 640);
_local6.push(296, 189, 275, 100, 120, 140, 160, 180, 200, 220, 240);
_local2.push(0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1);
platforms.push([_local7, _local6, _local2]);
_local4 = [];
_local3 = [];
_local1 = [];
_local5 = [];
_local4.push(-100, -50, 148, 71, 110, 29, 80, 572, 110, 37, 65, 550, -100, 560, -100, 140, -100, 104, -100, 68, -100, 101, -100, -50, -100, -50, -100, 365, -100, 52, 620, 320, 404, 320, 404);
_local3.push(20, 20, 55, 237, 67, 100, 80, 256, 255, 218, 116, 255, 140, 174, 160, 161, 180, 139, 200, 200, 220, 181, 240, 240, 260, 260, 300, 82, 320, 48, 20, -66, 412, 200, 300);
_local1.push(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 2, 0, 0, 1, 2, 2, 2, 2);
_local5.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 2, 0, 0, 0, 0, 0);
objects.push([_local4, _local3, _local1, _local5]);
starts.push([128, 303]);
fins.push([555, 87]);
_local7 = [];
_local6 = [];
_local2 = [];
_local7.push(138, 388, 283, 133, 456, 640, 640, 551, 466, 640, 29);
_local6.push(297, 220, 222, 76, 122, 140, 160, 309, 309, 220, 296);
_local2.push(0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1);
platforms.push([_local7, _local6, _local2]);
_local4 = [];
_local3 = [];
_local1 = [];
_local5 = [];
_local4.push(-100, -50, -100, -50, -100, 443, -100, 150, -100, 386, -100, 116, -100, 550, -100, -127, -100, 27, -100, 270, -100, 298, -100, 464, -100, 470, -100, 392, -100, 139, 663, 284, 441, 473, 284, 441, 473);
_local3.push(20, 20, 40, 40, 60, 102, 80, 54, 100, 196, 120, 54, 140, 289, 160, 330, 180, 276, 200, 206, 220, 207, 240, 287, 260, 101, 300, 26, 320, 262, 6, -84, 416, 50, 200, 0, 360);
_local1.push(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 2, 0, 0, 1, 2, 2, 2, 2, 2, 2);
_local5.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0);
objects.push([_local4, _local3, _local1, _local5]);
starts.push([38, 71]);
fins.push([547, 87]);
_local7 = [];
_local6 = [];
_local2 = [];
_local7.push(146, 483, 405, 233, 640, 299, 352, 193, 439, 43, 119);
_local6.push(189, 238, 252, 93, 120, 267, 120, 287, 143, 285, 66);
_local2.push(0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1);
platforms.push([_local7, _local6, _local2]);
_local4 = [];
_local3 = [];
_local1 = [];
_local5 = [];
_local4.push(-100, 118, -100, -50, -100, -50, -100, 314, -100, 483, -100, 286, -100, 194, -100, 132, -100, 44, -100, 389, -100, 420, -100, -50, -100, -50, -100, 286, 227, -50, 663, 639, 353, 457);
_local3.push(20, 48, 40, 40, 60, 60, 80, 248, 100, 221, 120, 247, 140, 270, 160, 172, 180, 265, 200, 234, 220, 236, 240, 240, 260, 260, 300, 166, 59, 320, 6, -78, 288, 498);
_local1.push(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 2, 0, 0, 1, 2, 2, 2);
_local5.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 2, 0, 0, 0, 0);
objects.push([_local4, _local3, _local1, _local5]);
starts.push([59, 140]);
fins.push([546, 225]);
_local7 = [];
_local6 = [];
_local2 = [];
_local7.push(425, 554, 283, 249, 640, 640, 640, 452, 640, 640, 640);
_local6.push(81, 97, 222, 78, 120, 140, 160, 300, 200, 220, 240);
_local2.push(0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1);
platforms.push([_local7, _local6, _local2]);
_local4 = [];
_local3 = [];
_local1 = [];
_local5 = [];
_local4.push(-100, -50, -100, -50, -100, -50, -100, 263, -100, 557, -100, 234, -100, 453, -100, 439, -100, 410, -100, 270, -100, 298, -100, -50, -100, -50, 85, 500, -100, -50, 158, 499, 632, 644);
_local3.push(20, 20, 40, 40, 60, 60, 80, 58, 100, 78, 120, 59, 140, 285, 160, 64, 180, 64, 200, 206, 220, 207, 240, 240, 260, 260, 46, 276, 320, 320, -24, 497, 250, 250);
_local1.push(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 2, 0, 0, 1, 2, 2, 2);
_local5.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 2, 0, 0, 0, 0);
objects.push([_local4, _local3, _local1, _local5]);
starts.push([76, 312]);
fins.push([552, 299]);
_local7 = [];
_local6 = [];
_local2 = [];
_local7.push(652, 637, 649, 158, 640, 640, 640, 665, 640, 640, 640);
_local6.push(336, 306, 275, 219, 120, 140, 160, 309, 200, 220, 240);
_local2.push(0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1);
platforms.push([_local7, _local6, _local2]);
_local4 = [];
_local3 = [];
_local1 = [];
_local5 = [];
_local4.push(335, 433, 300, 408, 373, 369, 371, 256, 419, 299, 326, 283, 332, 299, 371, 457, 288, 463, 335, 270, 338, 259, 381, 405, 420, 439, -100, 220, -100, 158, 663, 647, 620, 630);
_local3.push(152, 138, 162, 116, 161, 127, 200, 268, 207, 302, 222, 238, 255, 266, 231, 109, 192, 161, 286, 206, 185, 297, 263, 171, 249, 177, 300, 348, 320, 187, 6, 174, 328, 328);
_local1.push(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 2, 0, 0, 1, 2, 2, 2);
_local5.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0);
objects.push([_local4, _local3, _local1, _local5]);
starts.push([43, 179]);
fins.push([551, 81]);
_local7 = [];
_local6 = [];
_local2 = [];
_local7.push(78, 364, -103, 468, 525, 325, 640, 512, 426, 640, 640);
_local6.push(318, 257, 325, 198, 90, 89, 160, 314, 89, 220, 240);
_local2.push(0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1);
platforms.push([_local7, _local6, _local2]);
_local4 = [];
_local3 = [];
_local1 = [];
_local5 = [];
_local4.push(509, 540, 308, 339, -100, -50, -100, 143, -100, 362, -100, 453, 423, 511, -100, 188, 482, 233, -100, 278, -100, 326, -100, -50, -100, -50, 80, 218, -100, -50, 663, 620, 287, 288, -10);
_local3.push(69, 69, 70, 70, 60, 60, 80, 276, 100, 240, 120, 178, 71, 288, 160, 264, 178, 243, 200, 221, 220, 216, 240, 240, 260, 260, 287, 16, 320, 320, 6, 364, 434, 120, 160);
_local1.push(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 2, 0, 0, 1, 2, 2, 2, 4);
_local5.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 2, 0, 0, 0, 0, 0);
objects.push([_local4, _local3, _local1, _local5]);
starts.push([428, 314]);
fins.push([53, 73]);
}
static function get Sts() {
return(starts);
}
static function get Plats() {
return(platforms);
}
static function get Objs() {
return(objects);
}
static function get Fin() {
return(fins);
}
}
Symbol 41 MovieClip Frame 1
if (_parent._parent._parent.is_light) {
gotoAndPlay ("opening");
}
Symbol 41 MovieClip Frame 23
stop();
Symbol 41 MovieClip Frame 47
stop();
Symbol 46 MovieClip Frame 10
stop();
Symbol 46 MovieClip Frame 22
trace(" parent parent is light " + _parent._parent.is_light);
if (_parent._parent.is_light) {
stop();
}
Symbol 50 MovieClip [finish] Frame 1
this.hit_mc._visible = false;
is_light = true;
this.door_mc.light_mc.gotoAndPlay("opening");
Symbol 64 MovieClip Frame 1
stop();
Symbol 66 MovieClip [watch] Frame 8
stop();
Symbol 79 MovieClip [obj] Frame 1
stop();
this.hit_mc._visible = false;
Symbol 79 MovieClip [obj] Frame 2
trace(" new wall <<<<<<<<< ");
Symbol 87 MovieClip [plum] Frame 20
stop();
this.removeMovieClip();
Symbol 95 MovieClip [help] Frame 10
stop();
Symbol 115 MovieClip Frame 13
stop();
Symbol 116 MovieClip Frame 9
stop();
Symbol 123 MovieClip Frame 11
stop();
Symbol 126 MovieClip Frame 13
stop();
Symbol 131 MovieClip Frame 9
stop();
Symbol 135 MovieClip Frame 1
stop();
var roll_snd = new Sound();
roll_snd.attachSound("rollover");
var click_snd = new Sound();
click_snd.attachSound("click");
Symbol 135 MovieClip Frame 2
roll_snd.start();
Symbol 135 MovieClip Frame 3
click_snd.start();
Symbol 145 MovieClip Frame 1
this.hit_mc._visible = false;
is_light = true;
this.door_mc.light_mc.gotoAndPlay("opening");
Symbol 153 MovieClip Frame 1
stop();
var roll_snd = new Sound();
roll_snd.attachSound("rollover");
var click_snd = new Sound();
click_snd.attachSound("click");
Symbol 153 MovieClip Frame 2
roll_snd.start();
Symbol 153 MovieClip Frame 3
click_snd.start();
Symbol 163 MovieClip Frame 1
stop();
Symbol 163 MovieClip Frame 5
stop();
Symbol 163 MovieClip Frame 13
stop();
Symbol 163 MovieClip Frame 23
stop();
Symbol 163 MovieClip Frame 33
stop();
Symbol 163 MovieClip Frame 43
stop();
Symbol 163 MovieClip Frame 51
stop();
Symbol 163 MovieClip Frame 59
stop();
Symbol 163 MovieClip Frame 70
stop();
Symbol 163 MovieClip Frame 82
stop();
Symbol 173 MovieClip Frame 1
stop();
Symbol 178 MovieClip Frame 10
this.omni_mc.gotoAndPlay(1);
Symbol 178 MovieClip Frame 37
stop();
Symbol 190 MovieClip Frame 16
gotoAndPlay ("run");
Symbol 190 MovieClip Frame 21
stop();
Symbol 190 MovieClip Frame 28
gotoAndPlay ("run");
Symbol 190 MovieClip Frame 37
stop();
Symbol 190 MovieClip Frame 59
stop();
Symbol 190 MovieClip Frame 79
this.gotoAndPlay("breath");
this._parent.breath();
Symbol 190 MovieClip Frame 87
gotoAndPlay ("run");
Symbol 190 MovieClip Frame 127
this.gotoAndPlay("breath");
Symbol 190 MovieClip Frame 155
this.gotoAndPlay("breath");
Symbol 190 MovieClip Frame 203
this.gotoAndPlay("breath");
Symbol 190 MovieClip Frame 227
stop();
Symbol 190 MovieClip Frame 250
stop();
Symbol 190 MovieClip Frame 283
this.gotoAndPlay("win");
Symbol 194 MovieClip Frame 1
stop();
Symbol 209 MovieClip Frame 20
gotoAndPlay ("run");
Symbol 209 MovieClip Frame 25
stop();
Symbol 209 MovieClip Frame 32
gotoAndPlay ("run");
Symbol 209 MovieClip Frame 41
stop();
Symbol 209 MovieClip Frame 63
stop();
Symbol 209 MovieClip Frame 82
gotoAndPlay ("run");
Symbol 222 MovieClip Frame 16
gotoAndPlay ("run");
Symbol 222 MovieClip Frame 21
stop();
Symbol 222 MovieClip Frame 28
gotoAndPlay ("run");
Symbol 222 MovieClip Frame 37
stop();
Symbol 222 MovieClip Frame 59
stop();
Symbol 222 MovieClip Frame 78
gotoAndPlay ("run");
Symbol 235 MovieClip Frame 20
gotoAndPlay ("run");
Symbol 235 MovieClip Frame 25
stop();
Symbol 235 MovieClip Frame 32
gotoAndPlay ("run");
Symbol 235 MovieClip Frame 45
stop();
Symbol 235 MovieClip Frame 67
stop();
Symbol 235 MovieClip Frame 86
gotoAndPlay ("run");
Symbol 275 MovieClip Frame 1
var roll_snd = new Sound();
roll_snd.attachSound("rollover");
var click_snd = new Sound();
click_snd.attachSound("click");
Symbol 275 MovieClip Frame 2
roll_snd.start();
Symbol 275 MovieClip Frame 3
click_snd.start();
Symbol 279 MovieClip Frame 1
function clear() {
if (wint != null) {
clearInterval(wint);
}
}
function wait_timer(str) {
wait = 0;
hover = 0;
h_mc.removeMovieClip();
if (wint != null) {
clearInterval(wint);
}
wint = setInterval(this, "show_help", 30, str);
}
function show_help(str) {
if (wait < 20) {
wait++;
} else if (hover < 30) {
if (hover == 0) {
h_mc = p.attachMovie("help", "help" + str, p.getNextHighestDepth());
h_mc._x = p._xmouse;
h_mc._y = p._ymouse;
h_mc.mc.help_txt.text = str;
h_mc.mc.help_txt.backgroundColor = 0;
}
hover++;
} else {
h_mc.removeMovieClip();
wait = 0;
hover = 0;
clearInterval(wint);
}
}
this.timer_mc.label_txt.text = "TIMER";
this.score_mc.label_txt.text = "SCORE";
this.steps_mc.label_txt.text = "STEPS";
var p = this._parent;
var wint;
var wait = 0;
var hover = 0;
var h_mc;
this.reset_mc.onRollOver = function () {
this.gotoAndStop(2);
wait_timer("RESET");
};
this.reset_mc.onRollOut = function () {
this.gotoAndStop(1);
clear();
};
this.timer_mc.onRollOver = function () {
wait_timer("TIME");
};
this.timer_mc.onRollOut = function () {
clear();
};
this.steps_mc.onRollOver = function () {
wait_timer("STEPS");
};
this.steps_mc.onRollOut = function () {
clear();
};
this.lives_mc.onRollOut = function () {
clear();
};
this.lives_mc.onRollOver = function () {
wait_timer("LIVES");
};
Symbol 280 MovieClip Frame 11
stop();
PlaySound.init(this.sound_mc);
Debug.init(this.debug_mc);
Blackout.init(this.blackout_mc);
Score.init(this.scr_mc);
var g = Game.getInstance();
this.scr_mc.reset_mc.gotoAndStop(1);
this.scr_mc.reset_mc.onRelease = function () {
g.button_reset();
this.gotoAndStop(1);
};
g.init(this.game_mc, this.bg_mc, this.obj_mc, this.omnitrix_mc, this.char_mc, this.mouse_mc, this.pen_mc, this.canvas_mc, this.bitmap_mc);
Symbol 282 MovieClip Frame 1
this._parent.hitArea = this;
this._alpha = 0;
stop();
Symbol 286 MovieClip Frame 1
stop();
Symbol 293 MovieClip Frame 1
stop();