Frame 1
stop();
stop();
Stage.showMenu = false;
fscommand ("allowscale", "false");
fscommand ("showmenu", "false");
fscommand ("fullscreen", "false");
fscommand ("trapallkeys", "true");
_root._quality = "HIGH";
_root.tabEnabled = false;
_root.tabChildren = false;
this._lockroot = true;
Frame 2
Frame 3
nextFrame();
Frame 4
function sitelock(urls_allowed) {
lock = true;
domain_parts = _url.split("://");
real_domain = domain_parts[1].split("/");
domain.text = real_domain[0];
for (x in urls_allowed) {
if (real_domain[0].toLowerCase().indexOf(urls_allowed[x].toLowerCase(), 0) > -1) {
lock = false;
break;
}
}
if (lock) {
stop();
txt.text = "This version of the game is not intended to be release out on public domains. If you find this game else where together with this message please notify jayc@jumpropestudios.com to help the developer behind it. Thanks";
} else {
gotoAndStop (6);
}
}
urls_allowed = ["armorgames.com", "jaycsantos.com"];
stop();
sitelock(urls_allowed);
Frame 6
var game = new MainGame(this);
stop();
Frame 7
gotoAndStop (6);
Frame 12
stop();
Symbol 50 MovieClip Frame 1
stop();
Symbol 65 MovieClip Frame 1
stop();
Symbol 80 MovieClip Frame 1
this.onEnterFrame = function () {
var _local3 = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
preloadtxt.text = ("Loading... " + _local3) + "%";
if (_local3 == 100) {
preloadtxt.text = "";
play();
delete this.onEnterFrame;
} else {
gotoAndStop(int(_local3 / 9));
}
};
stop();
Symbol 80 MovieClip Frame 110
_parent.nextFrame();
stop();
_visible = false;
Symbol 99 MovieClip Frame 1
_root.stop();
gotoAndPlay (2);
Symbol 99 MovieClip Frame 225
_root.nextFrame();
Symbol 108 MovieClip [ballMC] Frame 1
stop();
Symbol 121 MovieClip Frame 9
gotoAndPlay (1);
Symbol 121 MovieClip Frame 19
stop();
Symbol 168 MovieClip Frame 1
stop();
Symbol 287 MovieClip [optionsMC] Frame 1
#initclip 46
Object.registerClass("optionsMC", MenuOption);
#endinitclip
stop();
Symbol 288 MovieClip [puttmenu] Frame 1
#initclip 42
Object.registerClass("puttmenu", MainMenu);
#endinitclip
Symbol 298 MovieClip [prompt] Frame 1
#initclip 43
Object.registerClass("prompt", jayc.common.mc.Prompt);
#endinitclip
Symbol 299 MovieClip [level_menu] Frame 1
#initclip 44
Object.registerClass("level_menu", MenuLevel);
#endinitclip
Symbol 338 MovieClip [Cursor] Frame 1
#initclip 45
Object.registerClass("Cursor", jayc.common.utils.Cursor);
#endinitclip
Symbol 381 MovieClip [tileMCmove] Frame 1
stop();
Symbol 551 MovieClip [summaryMC] Frame 1
stop();
Symbol 559 MovieClip Frame 1
stop();
Symbol 560 MovieClip Frame 13
gotoAndStop (1);
Symbol 572 MovieClip [tileMC] Frame 1
stop();
Symbol 619 MovieClip [__Packages.MainMenu] Frame 0
class MainMenu extends MovieClip
{
var gotoAndStop, mochi_board, createEmptyMovieClip, mcplayers, attachMovie, mclevels, tabChildren, tabEnabled, mute_btn, _currentframe, btn_play, btn_editor, btn_how, btn_player, btn_options, btn_walk, mctitle, mcdisplay, mchowto;
function MainMenu () {
super();
gotoAndStop(1);
mochi_board = createEmptyMovieClip("mochi_board", 1047002);
if (!mcplayers) {
mcplayers = attachMovie("player_select", "mcplayers", 400);
}
if (!mclevels) {
attachMovie("level_menu", "mclevels", 500);
}
mcplayers.gotoAndStop(1);
PlayerProfiler.init(mcplayers);
if (!PlayerProfiler.loadProfiles()) {
open("newplayer");
mcplayers.btn_cancel.disabled();
} else {
open("main");
}
tabChildren = false;
tabEnabled = false;
var _local3 = [0, 65.3, 152.2];
MainGame.sndMngr.playSound("bmg_main", _local3[int(Math.random() * 2)]);
mute_btn.onRelease = function () {
if (MainGame.sndMngr.mute) {
MainGame.sndMngr.muteSounds();
this.gotoAndPlay(13);
this.txt.text = "unmute";
} else {
MainGame.sndMngr.muteSounds(false);
this.gotoAndPlay(1);
this.txt.text = "mute";
}
PlayerProfiler.__get__active().np.opt[3] = MainGame.sndMngr.mute;
PlayerProfiler.updateOptions();
};
mute_btn.onRollOut = function () {
jayc.common.utils.Cursor.frameto(1);
this.txt.text = "";
};
mute_btn.onRollOver = function () {
if (jayc.common.utils.Cursor.getframe() == 1) {
jayc.common.utils.Cursor.frameto(2);
}
if (MainGame.sndMngr.mute) {
this.txt.text = "mute";
} else {
this.txt.text = "unmute";
}
};
if (MainGame.sndMngr.mute) {
mute_btn.gotoAndPlay(1);
} else {
mute_btn.gotoAndPlay(13);
}
}
function open(page) {
if (_currentframe == 1) {
gotoAndStop(2);
jayc.common.utils.MCButton.makeMC(btn_play);
jayc.common.utils.MCButton.makeMC(btn_editor);
jayc.common.utils.MCButton.makeMC(btn_how);
jayc.common.utils.MCButton.makeMC(btn_player);
jayc.common.utils.MCButton.makeMC(btn_options);
jayc.common.utils.MCButton.makeMC(btn_walk);
btn_editor.disabled();
mctitle._alpha = 0;
caurina.transitions.Tweener.addTween(mctitle, {_alpha:100, time:1, transition:"easeOutCubic"});
btn_walk.onRelease2 = function () {
MainGame.root.getURL("http://armorgames.com/guide/Putt-Base-Video-Guide", "_blank");
};
jayc.common.utils.MCButton.makeMC(mctitle.mc_jayc);
jayc.common.utils.MCButton.makeMC(mctitle.mc_jayc2);
mctitle.mc_jayc.onRelease2 = (mctitle.mc_jayc2.onRelease2 = function () {
MainGame.root.getURL("http://jaycsantos.com/?ref=puttbase", "_blank");
});
jayc.common.utils.MCButton.makeMC(mctitle.mc_ag);
jayc.common.utils.MCButton.makeMC(mctitle.mc_more);
jayc.common.utils.MCButton.makeMC(mctitle.mc_like);
mctitle.mc_ag.onRelease2 = (mctitle.mc_more.onRelease2 = function () {
this.getURL("http://armor.ag/MoreGames", "_blank");
});
mctitle.mc_like.onRelease2 = function () {
this.getURL("http://www.facebook.com/ArmorGames", "_blank");
};
} else {
gotoAndStop(2);
}
mclevels.gotoAndStop(1);
mcplayers.gotoAndStop(1);
switch (page) {
case "main" :
btn_play.onRelease2 = mx.utils.Delegate.create(this, function () {
MainGame.sndMngr.playSound("swoosh0");
this.open("levels");
});
btn_editor.onRelease2 = mx.utils.Delegate.create(this, function () {
this.open("editor");
});
btn_how.onRelease2 = mx.utils.Delegate.create(this, function () {
MainGame.sndMngr.playSound("swoosh0");
this.open("howtoplay");
});
btn_player.onRelease2 = mx.utils.Delegate.create(this, function () {
MainGame.sndMngr.playSound("swoosh0");
this.open("players");
});
btn_options.onRelease2 = mx.utils.Delegate.create(this, function () {
MainGame.sndMngr.playSound("swoosh0");
this.attachMovie("optionsMC", "mcoptions", 600);
this.mcoptions._alpha = 0;
this.mcoptions._y = 100;
});
if (!mcdisplay) {
attachMovie("menu_display", "mcdisplay", 300);
mcdisplay.gotoAndStop(1);
}
updateMCDisplay();
break;
case "levels" :
mclevels._alpha = 0;
mclevels._y = 50;
mclevels.init();
break;
case "playnow" :
btn_play.disabled();
btn_editor.disabled();
btn_how.disabled();
btn_player.disabled();
btn_options.disabled();
btn_walk.disabled();
caurina.transitions.Tweener.addTween(mctitle, {_alpha:0, time:0.6, delay:0.9, transition:"easeOutCubic"});
caurina.transitions.Tweener.addTween(mcdisplay, {_x:50, _alpha:0, time:0.3, delay:0.9, transition:"easeOutCubic", onComplete:function () {
MainGame.sndMngr.stopSound("bmg_main");
}});
caurina.transitions.Tweener.addTween(MainGame.root, {_x:150, time:1.5, delay:1, transition:"easeOutCubic", onComplete:function () {
MainGame.mainMenu.close();
MainGame.game.loadlevel(MainGame.mainMenu.mclevels.openmap.id);
}});
N.NEngine.gfx.rootbuffer._visible = true;
break;
case "editor" :
btn_play.disabled();
btn_editor.disabled();
btn_how.disabled();
btn_player.disabled();
btn_options.disabled();
btn_walk.disabled();
caurina.transitions.Tweener.addTween(mctitle, {_alpha:0, time:0.6, transition:"easeOutCubic"});
caurina.transitions.Tweener.addTween(mcdisplay, {_x:50, _alpha:0, time:0.3, transition:"easeOutCubic", onComplete:function () {
MainGame.sndMngr.stopSound("bmg_main");
}});
caurina.transitions.Tweener.addTween(MainGame.root, {_x:150, time:1.5, delay:0.6, transition:"easeOutCubic", onComplete:function () {
MainGame.mainMenu.close();
}});
break;
case "howtoplay" :
if (!mchowto) {
attachMovie("menu_howto", "mchowto", 800);
mchowto._y = -50;
mchowto._alpha = 0;
mchowto.gotoAndStop(2);
caurina.transitions.Tweener.addTween(mchowto, {_y:0, _alpha:100, time:0.6, transition:"easeOutCubic"});
var _local3 = 6;
var _local6;
while (_local3--) {
_local6 = mchowto["tab" + _local3];
_local6.id = _local3 + 2;
jayc.common.utils.MCButton.makeMC(_local6);
_local6.onRelease2 = function () {
MainGame.mainMenu.open("howtoplay", this.id);
MainGame.sndMngr.playSound("beep2");
};
}
jayc.common.utils.MCButton.makeMC(mchowto.btn_return);
mchowto.btn_return.onRelease2 = mx.utils.Delegate.create(this, function () {
MainGame.sndMngr.playSound("swoosh0");
caurina.transitions.Tweener.addTween(this.mchowto, {_y:-50, _alpha:0, time:0.6, transition:"easeOutCubic", onComplete:mx.utils.Delegate.create(this, function () {
this.mchowto.removeMovieClip();
})});
});
} else if (arguments[1]) {
var _local13 = arguments[1];
mchowto.gotoAndStop(_local13);
if (_local13 == 7) {
mchowto.btn_next.disabled();
} else {
mchowto.btn_next.disabled(1);
}
}
jayc.common.utils.MCButton.makeMC(mchowto.btn_next);
mchowto.btn_next.onRelease2 = mx.utils.Delegate.create(this, function () {
MainGame.sndMngr.playSound("beep2");
if (this.mchowto._currentframe == 6) {
this.mchowto.btn_next.onRollOut2();
}
this.open("howtoplay", this.mchowto._currentframe + 1);
});
break;
case "newplayer" :
mcplayers._x = 50;
mcplayers._alpha = 0;
mcplayers.gotoAndStop(2);
caurina.transitions.Tweener.addTween(mcplayers, {_x:0, _alpha:100, time:0.4, transition:"easeOutCubic"});
jayc.common.utils.MCButton.makeMC(mcplayers.btn_cancel);
jayc.common.utils.MCButton.makeMC(mcplayers.btn_ok);
mcplayers.txt.text = "type name here";
mcplayers.txt.onSetFocus = function () {
if (this.text == "type name here") {
this.text = "";
}
};
mcplayers.btn_cancel.onRelease2 = mx.utils.Delegate.create(this, function () {
MainGame.sndMngr.playSound("swoosh0");
caurina.transitions.Tweener.addTween(this.mcplayers, {_x:50, _alpha:0, time:0.6, transition:"easeOutCubic", onComplete:mx.utils.Delegate.create(this, function () {
this.open("main");
})});
});
if (!PlayerProfiler.count) {
mcplayers.btn_cancel.disabled();
}
mcplayers.btn_ok.onRelease2 = mx.utils.Delegate.create(this, function () {
var _local3 = PlayerProfiler.saveProfile(this.mcplayers.txt.text);
if (_local3 == 0) {
MainGame.sndMngr.playSound("swoosh0");
caurina.transitions.Tweener.addTween(this.mcplayers, {_x:50, _alpha:0, time:0.6, transition:"easeOutCubic", onComplete:mx.utils.Delegate.create(this, function () {
this.open("main");
})});
} else {
MainGame.sndMngr.playSound("beep3");
var _local2;
switch (_local3) {
case 1 :
_local2 = "Please type in a name.";
break;
case 2 :
_local2 = "All save slots is occupied.";
break;
case 3 :
_local2 = "That name is already used.";
break;
case 4 :
_local2 = "Name cannot contain spaces.";
break;
case 5 :
_local2 = "Limit name to 14 characters only.";
break;
case 6 :
_local2 = "That name is reserved to the developer, please use another.";
break;
default :
_local2 = "Unknown error occured, please contact jayc@jumpropestudios.com";
}
var _local4 = MainGame.root.attachMovie("prompt", "prompt", 1048001);
_local4.setType("ok", _local2);
}
});
break;
case "players" :
if (mcplayers._currentframe == 1) {
mcplayers._x = 50;
mcplayers._alpha = 0;
mcplayers.gotoAndStop(4);
caurina.transitions.Tweener.addTween(mcplayers, {_x:0, _alpha:100, time:0.6, transition:"easeOutCubic"});
}
jayc.common.utils.MCButton.makeMC(mcplayers.btn_return);
var _local3 = 4;
while (_local3--) {
jayc.common.utils.MCButton.makeMC(mcplayers["btn" + _local3]);
mcplayers["btn" + _local3].hitArea = mcplayers["btn" + _local3].hit;
mcplayers["btn" + _local3].txt.htmlText = "<font size=\"9px\" color=\"#666666\">new player</font>";
mcplayers["btn" + _local3].onRelease2 = mx.utils.Delegate.create(this, function () {
caurina.transitions.Tweener.addTween(this.mcplayers, {_x:50, _alpha:0, time:0.4, transition:"easeOutCubic", onComplete:mx.utils.Delegate.create(this, function () {
this.open("newplayer");
})});
});
jayc.common.utils.MCButton.makeMC(mcplayers["btn_select" + _local3]);
mcplayers["btn_select" + _local3].disabled();
jayc.common.utils.MCButton.makeMC(mcplayers["btn_delete" + _local3]);
mcplayers["btn_delete" + _local3].disabled();
}
var _local8 = PlayerProfiler.profiles;
var _local9;
var _local4;
var _local5;
_local3 = 0;
var _local11 = PlayerProfiler.__get__active();
for (_local9 in _local8) {
_local4 = _local8[_local9];
_local5 = mcplayers["btn" + _local3];
_local5.profile = _local4;
_local5.txt.text = _local4.name;
_local5.onRelease2 = function () {
MainGame.mainMenu.showplayerInfo(this.profile);
};
if (_local4.id != _local11.id) {
mcplayers["btn_select" + _local3].disabled(1);
mcplayers["btn_select" + _local3].profile = _local4;
mcplayers["btn_select" + _local3].onRelease2 = function () {
PlayerProfiler.__set__active(this.profile);
MainGame.mainMenu.mcplayers.btn_return.onRelease2();
};
}
mcplayers["btn_delete" + _local3].disabled(1);
mcplayers["btn_delete" + _local3].profile = _local4;
mcplayers["btn_delete" + _local3].onRelease2 = function () {
var _local2 = MainGame.root.attachMovie("prompt", "prompt", 1048001);
_local2.setType("okcancel", "Are you sure you want to delete this player?", this, function () {
PlayerProfiler.deleteProfile(this.profile.id);
if (!PlayerProfiler.count) {
MainGame.mainMenu.open("newplayer");
} else {
MainGame.mainMenu.open("players");
}
}, function () {
});
};
_local3++;
}
mcplayers.btn_return.onRelease2 = mx.utils.Delegate.create(this, function () {
MainGame.sndMngr.playSound("swoosh0");
caurina.transitions.Tweener.addTween(this.mcplayers, {_x:50, _alpha:0, time:0.6, transition:"easeOutCubic", onComplete:mx.utils.Delegate.create(this, function () {
this.open("main");
})});
});
mcplayers.sublevel.gotoAndStop(1);
break;
}
}
function showplayerInfo(p) {
if (mcplayers.sublevel._currentframe == 1) {
mcplayers.sublevel._x = -50;
mcplayers.sublevel._alpha = 0;
mcplayers.sublevel.gotoAndStop(2);
caurina.transitions.Tweener.addTween(mcplayers.sublevel, {_x:0, _alpha:100, time:0.6, transition:"easeOutCubic"});
}
jayc.common.utils.MCButton.makeMC(mcplayers.sublevel.btn_return);
mcplayers.sublevel.btn_return.onRelease2 = mx.utils.Delegate.create(this, function () {
caurina.transitions.Tweener.addTween(this.mcplayers.sublevel, {_x:-50, _alpha:0, time:0.6, transition:"easeOutCubic", onComplete:function () {
this.gotoAndStop(1);
}});
});
mcplayers.sublevel.plyrname.text = p.name;
mcplayers.sublevel.ts.text = p.info.tscore;
mcplayers.sublevel.gtitle.text = ("the \"" + PlayerProfiler.getTitle(p.id)) + "\"";
mcplayers.sublevel.kcount.text = p.info.kys;
mcplayers.sublevel.bcount.text = p.info.brnz;
mcplayers.sublevel.scount.text = p.info.slvr;
mcplayers.sublevel.gcount.text = p.info.gld;
if ((!isNaN(p.info.star)) && (p.info.star > 0)) {
mcplayers.sublevel.starcount.text = p.info.star;
mcplayers.sublevel.staricon.gotoAndStop(7);
} else {
mcplayers.sublevel.starcount.text = "";
mcplayers.sublevel.staricon.gotoAndStop(20);
}
mcplayers.sublevel.ttp.text = jayc.common.utils.Clock.strFormat(p.info.ttime, "hmmss", ":");
mcplayers.sublevel.gc.text = Math.round((p.info.access / (mclevels.ttlmaps - 1)) * 100) + "%";
}
function updateMCDisplay() {
if (mcdisplay._currentframe == 1) {
caurina.transitions.Tweener.addTween(mcdisplay, {_x:0, _alpha:100, time:0.3, transition:"easeOutCubic", onComplete:mx.utils.Delegate.create(this, function () {
this.updateMCDisplayNow();
})});
mcdisplay._x = 50;
mcdisplay._alpha = 0;
mcdisplay.gotoAndStop(2);
mcdisplay.btn_submit._visible = false;
mcdisplay.btn_hscore._visible = false;
if (jayc.common.control.ScoreCtrl.apiID != 0) {
mcdisplay.btn_hscore.disabled();
} else {
mcdisplay.btn_hscore.disabled(1);
}
mcdisplay.btn_submit.onRelease2 = mx.utils.Delegate.create(this, function () {
var _local2 = PlayerProfiler.__get__active();
if (!_local2.info.tscore) {
var _local3 = MainGame.root.attachMovie("prompt", "prompt", 1048001);
_local3.setType("ok", "You have a zero(0) score, please play a little before you submit.");
return(undefined);
}
if (jayc.common.control.ScoreCtrl.apiID == 0) {
MainGame.root.attachMovie("prompt", "prompt", 1048001).setType("yesno", ((("\"" + _local2.name) + " the ") + PlayerProfiler.getTitle(_local2.id)) + "\"\nSubmit name with title?\n\"No\" to submit name only.", this, mx.utils.Delegate.create(this, function () {
this.mcdisplay.btn_submit.submitscore(PlayerProfiler.getTitle(PlayerProfiler.__get__active().id));
}), mx.utils.Delegate.create(this, function () {
this.mcdisplay.btn_submit.submitscore();
}));
} else {
jayc.common.control.ScoreCtrl.submit({score:_local2.info.tscore});
}
});
mcdisplay.btn_submit.submitscore = function (title) {
var _local2 = PlayerProfiler.__get__active();
var _local3 = _local2.name + (title ? ((" the " + title) + "") : "");
MainGame.mainMenu.mcdisplay.gotoAndStop(4);
jayc.common.control.ScoreCtrl.submit({score:_local2.info.tscore, name:_local3, boardID:MainGame.mochiBoardID, onSuccessTarget:MainGame.mainMenu, onSuccess:function () {
MainGame.root.attachMovie("prompt", "prompt", 1048001).setType("ok", "Score successfully submitted.");
this.mcdisplay.gotoAndStop(2);
}, onError:mx.utils.Delegate.create(MainGame.mainMenu, function (num, msg) {
MainGame.root.attachMovie("prompt", "prompt", 1048001).setType("ok2", ("Err" + num) + ": An error occured will trying to connect to the highscore table. Try again later or contact author if it persist.");
this.mcdisplay.gotoAndStop(2);
})});
};
mcdisplay.btn_hscore.onRelease2 = mx.utils.Delegate.create(this, function () {
this.getURL("http://jayc.jumpropestudios.com/games/puttbase/?highscores", "_blank");
});
}
mcdisplay.gotoAndStop(2);
var _local2 = PlayerProfiler.__get__active();
mcdisplay.curplayer.text = _local2.name;
mcdisplay.curgtitle.text = ("the " + PlayerProfiler.getTitle(_local2.id)) + "";
mcdisplay.gcount.text = _local2.info.gld;
mcdisplay.scount.text = _local2.info.slvr;
mcdisplay.bcount.text = _local2.info.brnz;
mcdisplay.kcount.text = _local2.info.kys;
mcdisplay.tscore.text = _local2.info.tscore;
if ((!isNaN(_local2.info.star)) && (_local2.info.star > 0)) {
mcdisplay.starcount.text = _local2.info.star;
mcdisplay.staricon.gotoAndStop(7);
} else {
mcdisplay.starcount.text = "";
mcdisplay.staricon.gotoAndStop(20);
}
}
function close() {
gotoAndStop(1);
mcdisplay.gotoAndStop(1);
mclevels.gotoAndStop(1);
}
function reopen() {
caurina.transitions.Tweener.addTween(MainGame.root, {_x:0, time:1.5, delay:0.1, transition:"easeOutCubic", onComplete:function () {
MainGame.mainMenu.open("main");
}});
}
function reopenlevels() {
caurina.transitions.Tweener.addTween(MainGame.root, {_x:0, time:1.5, delay:0.1, transition:"easeOutCubic", onComplete:function () {
MainGame.mainMenu.open("main");
caurina.transitions.Tweener.addTween(MainGame.root, {time:0.1, onStart:function () {
MainGame.sndMngr.playSound("swoosh0");
}, onComplete:function () {
MainGame.mainMenu.open("levels");
caurina.transitions.Tweener.addTween(MainGame.root, {time:0.1, delay:0.3, onComplete:function () {
MainGame.mainMenu.mclevels.openLevel1(MainGame.mainMenu.mclevels.categories[MainGame.curmap.cat]);
}});
}});
}});
}
}
Symbol 620 MovieClip [__Packages.MenuLevel] Frame 0
class MenuLevel extends MovieClip
{
var categories, catcount, ttlmaps, plyr, gotoAndStop, btn_return, sublevel1, sublevel2, sublevel0;
function MenuLevel () {
super();
categories = new Object();
catcount = (ttlmaps = 0);
var _local3;
var _local7 = MainGame.categories;
for (_local3 in _local7) {
categories[_local3] = {name:_local3, levels:{}, req:_local7[_local3].req, count:0};
catcount++;
}
var _local6 = MainGame.maps;
var _local4;
var _local5;
for (_local3 in _local6) {
if (_local4) {
_local4.nxt = _local3;
}
_local4 = _local6[_local3];
_local5 = categories[_local4.cat];
_local5.count++;
_local5.levels[_local3] = _local4;
ttlmaps++;
}
PlayerProfiler.traceString(_local6);
}
function init() {
caurina.transitions.Tweener.addTween(this, {_y:0, _alpha:100, time:0.6, transition:"easeOutCubic"});
plyr = PlayerProfiler.active;
gotoAndStop(2);
jayc.common.utils.MCButton.makeMC(btn_return);
btn_return.onRelease = mx.utils.Delegate.create(this, function () {
this.closeLevel1();
caurina.transitions.Tweener.addTween(this, {_y:50, _alpha:0, time:0.6, transition:"easeOutCubic", onComplete:function () {
MainGame.mainMenu.open("main");
}});
});
sublevel1._visible = false;
sublevel1.enabled = false;
sublevel2._visible = false;
sublevel2.enabled = false;
var _local3 = 7;
while (_local3--) {
jayc.common.utils.MCButton.makeMC(sublevel0["btn" + _local3]);
sublevel0["btn" + _local3].disabled();
}
var _local8;
var _local4;
_local3 = catcount;
var _local2;
for (_local8 in categories) {
_local3--;
_local4 = categories[_local8];
_local2 = sublevel0["btn" + _local3];
_local2.disabled(1);
_local2.cat = _local4;
_local2.txt.text = _local4.name;
_local2.lock.gotoAndStop(20);
_local2.unlock.gotoAndStop(20);
_local2.kcount.text = "";
if (plyr.info.kys < _local4.req) {
_local2.lock.gotoAndStop(1);
_local2.kcount.text = _local4.req - plyr.info.kys;
_local2.onRelease2 = function () {
var _local4 = PlayerProfiler.__get__active().info.kys;
var _local2 = this.cat.req;
var _local3 = MainGame.root.attachMovie("prompt", "prompt", 1048001);
_local3.setType("ok2", ("You need " + (_local2 - _local4)) + " more key(s) to unlock this category and it`s levels.");
};
} else {
_local2.unlock.gotoAndStop(2);
_local2.onRelease2 = function () {
MainGame.mainMenu.mclevels.openLevel1(this.cat);
};
}
_local2.key.gotoAndStop(20);
}
jayc.common.utils.MCButton.makeMC(sublevel1.btn_back);
sublevel1.btn_back.onRelease = mx.utils.Delegate.create(this, closeLevel1);
}
function openLevel1(cat) {
if (sublevel1._currentframe != 1) {
return(undefined);
}
MainGame.sndMngr.playSound("swoosh0");
sublevel0.title.text = "Category: " + cat.name;
sublevel1.cat = cat;
sublevel1._x = -50;
sublevel1._alpha = 0;
sublevel1._visible = true;
sublevel1.enabled = true;
sublevel1.gotoAndStop(2);
caurina.transitions.Tweener.addTween(sublevel1, {_x:0, _alpha:100, time:0.6, transition:"easeOutCubic"});
var _local3 = 6;
while (_local3--) {
jayc.common.utils.MCButton.makeMC(sublevel1["btn" + _local3]);
sublevel1["btn" + _local3].disabled();
}
var _local8 = cat.levels;
var _local4;
_local3 = cat.count;
var map;
var _local2;
var _local9 = plyr.info.kys;
for (_local4 in _local8) {
_local3--;
map = _local8[_local4];
_local2 = sublevel1["btn" + _local3];
_local2.disabled(1);
_local2.map = map;
_local2.txt.text = map.name;
_local2.lock.gotoAndStop(20);
_local2.unlock.gotoAndStop(20);
_local2.kcount.text = "";
if (_local9 < map.req) {
_local2.lock.gotoAndStop(1);
_local2.kcount.text = map.req - _local9;
_local2.onRelease2 = function () {
var _local2 = PlayerProfiler.__get__active().info.kys;
var _local3 = this.map.req;
var _local4 = MainGame.root.attachMovie("prompt", "prompt", 1048001);
_local4.setType("ok", ("You need " + (_local3 - _local2)) + " more key(s) to unlock this level.");
};
} else {
_local2.unlock.gotoAndStop(2);
_local2.onRelease2 = function () {
MainGame.mainMenu.mclevels.openLevel2(this.map);
};
}
if (!plyr.lvls[_local4].goal) {
_local2.key.gotoAndStop(20);
} else {
_local2.key.gotoAndStop(plyr.lvls[_local4].goal + 2);
}
}
}
function closeLevel1() {
MainGame.sndMngr.playSound("swoosh0");
var _local4 = 0;
if (sublevel2._visible) {
_local4 = 0.15;
closeLevel2();
}
caurina.transitions.Tweener.addTween(sublevel1, {_x:-50, _alpha:0, time:0.3, delay:_local4, transition:"easeOutCubic", onComplete:mx.utils.Delegate.create(this, function () {
this.sublevel1._visible = false;
this.sublevel1.enabled = false;
this.sublevel0.title.text = "Select Category:";
})});
}
function openLevel2(map) {
if (sublevel2._currentframe != 1) {
return(undefined);
}
MainGame.sndMngr.playSound("swoosh0");
sublevel1.title.text = "Level: " + map.name;
sublevel2.title.text = map.name + " information";
sublevel2.map = map;
sublevel2._x = -50;
sublevel2._alpha = 0;
sublevel2._visible = true;
sublevel2.enabled = true;
sublevel2.gotoAndStop(2);
sublevel2.tweening = true;
caurina.transitions.Tweener.addTween(sublevel2, {_x:0, _alpha:100, time:0.6, transition:"easeOutCubic"});
jayc.common.utils.MCButton.makeMC(sublevel2.btn_back);
sublevel2.btn_back.onRelease = mx.utils.Delegate.create(this, closeLevel2);
sublevel2.desc.text = map.desc;
sublevel2.tbonus.text = ((jayc.common.utils.Clock.strFormat(map.ttime, "mss", ":") + " for ") + map.tts) + "pts";
var _local3 = plyr.lvls[map.id].goal;
sublevel2.yicon.gotoAndStop(20);
sublevel2.yicon2.gotoAndStop(20);
if (_local3) {
sublevel2.yicon.gotoAndStop(3);
if (_local3 > 1) {
sublevel2.yicon2.gotoAndStop(_local3 + 2);
}
}
sublevel2.ybest.text = plyr.lvls[map.id].score;
sublevel2.kscore.text = map.reward[0];
sublevel2.bscore.text = map.reward[1];
sublevel2.sscore.text = map.reward[2];
sublevel2.gscore.text = map.reward[3];
jayc.common.utils.MCButton.makeMC(sublevel2.btn_play);
sublevel2.btn_play.onRelease = mx.utils.Delegate.create(this, function () {
this.openmap = this.sublevel2.map;
this.btn_return.disabled();
this.closeLevel1();
caurina.transitions.Tweener.addTween(this, {_y:50, _alpha:0, time:0.3, delay:0.45, transition:"easeOutCubic", onComplete:function () {
MainGame.mainMenu.open("playnow");
}});
});
}
function closeLevel2() {
MainGame.sndMngr.playSound("swoosh0");
caurina.transitions.Tweener.addTween(sublevel2, {_x:-50, _alpha:0, time:0.3, transition:"easeOutCubic", onComplete:mx.utils.Delegate.create(this, function () {
this.sublevel2._visible = false;
this.sublevel2.enabled = false;
this.sublevel1.title.text = "Select Level:";
})});
}
}
Symbol 621 MovieClip [__Packages.MainGame] Frame 0
class MainGame
{
static var root, engine, game, level, sndMngr, timer, ball, panel, summary, curmap;
var fps_interval, _fps;
function MainGame (__root) {
if (__root) {
root = __root;
} else {
root = _root;
}
engine = N.NEngine.init();
game = this;
N.NEngine.GRAV = 0;
N.NEngine.DRAG = 1;
N.NEngine.DAMP = 0.99;
initMaps();
level = 0;
fps_interval = setInterval(fps_go, 1000, this);
_fps = 0;
ft = getTimer();
var _local3 = maps["level" + level];
N.NEngine.MAPSTR = _local3.str;
sndMngr = new jayc.common.control.SoundManager();
sndMngr.addSound("bmg_main", "bmg_main", true, Number.POSITIVE_INFINITY);
sndMngr.addSound("bmg_game", "bmg_game", true, Number.POSITIVE_INFINITY);
sndMngr.addSound("roll_loop", "roll_loop", false, Number.POSITIVE_INFINITY);
sndMngr.addSound("roll_hole", "roll_hole");
sndMngr.addSound("normal_collide", "normal_collide");
sndMngr.addSound("jelly_collide", "jelly_collide");
sndMngr.addSound("spring", "spring");
sndMngr.addSound("swoosh0", "swoosh0");
sndMngr.addSound("beep0", "beep0");
sndMngr.addSound("beep1", "beep1");
sndMngr.addSound("beep2", "beep2");
sndMngr.addSound("beep3", "beep3");
sndMngr.addSound("beep4", "beep4");
timer = new jayc.common.utils.Clock(0, 0);
ball = new Ball(new N.standard.Vector2(0, 0), 11);
panel = new Panel(this);
N.NEngine.loader = new N.tile.MapLoader();
N.NEngine.tiles = new BTileMap(13, 12, N.NEngine.TILERAD, N.NEngine.TILERAD);
N.NEngine.gfx.rootbuffer.onEnterFrame = function () {
if (!N.NEngine.tiles.Building()) {
delete N.NEngine.gfx.rootbuffer.onEnterFrame;
N.NEngine.loader.Load(N.NEngine.MAPSTR);
var _local1 = MainGame.root.attachMovie("puttmenu", "puttmenu", 2000);
MainGame.mainMenu = _local1;
}
};
summary = new Summary();
calltracker("223cfcf3", this, 10301, true);
level = 0;
}
static function calltracker(swfid, mc, lv, trk) {
}
function loadlevel(str) {
if (!maps[str]) {
return(undefined);
}
curmap = maps[str];
var _local2 = curmap;
N.NEngine.MAPSTR = _local2.str;
var _local3 = function () {
MainGame.panel.mc.timeleft.text = jayc.common.utils.Clock.strFormat(MainGame.timer.count, "mss", ":");
};
var _local4 = function () {
MainGame.summary.showTooLong();
MainGame.summary.mc.btn_stop.onRelease2();
};
timer.init(0, 1800, _local3, _local4);
_local3();
ball.init(new N.standard.Vector2((_local2.ball.x * 30) + 15, (_local2.ball.y * 30) + 15), _local2.ball.a);
panel.clear(_local2.extra);
ready = false;
N.NEngine.loader.onComplete = mx.utils.Delegate.create(this, function () {
N.NEngine.loader.onComplete = mx.utils.Delegate.create(this, this.standby);
MainGame.summary.showIntro();
this.ready = true;
var _local2 = [0, 36.1];
MainGame.sndMngr.playSound("bmg_game", _local2[int(Math.random())]);
});
clearmap();
sndMngr.stopSound("bmg_main");
}
function clearmap() {
panel.clear(curmap.extra);
N.NEngine.MAPSTR = curmap.str;
N.NEngine.gfx.rootbuffer.onEnterFrame = function () {
N.NEngine.TickLoad();
};
N.NEngine.loader.Load(N.NEngine.MAPSTR);
}
function standby() {
ball.standby();
panel.standby();
delete N.NEngine.gfx.rootbuffer.onEnterFrame;
}
function startEngine() {
if (ready) {
ball.startEngine();
panel.startEngine();
N.NEngine.gfx.rootbuffer.onEnterFrame = mx.utils.Delegate.create(this, run);
}
}
function sleep(callback) {
ball.sleep();
panel.clear();
panel.sleep();
callback = (callback ? (callback) : null);
N.NEngine.loader.onComplete = callback;
N.NEngine.gfx.rootbuffer.onEnterFrame = function () {
N.NEngine.TickLoad();
};
N.NEngine.loader.Load("");
}
function fps_go(src) {
root.fpstxt = src._fps + "fps";
src._fps = 0;
}
function run() {
ft = getTimer() - ft;
root.ftime = ft + "ms";
ft = getTimer();
ball.step();
root.ftime = root.ftime + ((newline + Number(getTimer() - ft)) + "as");
ft = getTimer();
_fps++;
}
static function normalizeMap(m) {
var _local3 = 13;
var _local6 = 13;
var _local4 = new Array();
var _local2 = 0;
while (_local2 < _local6) {
_local4.push("");
var _local1 = 0;
while (_local1 < _local3) {
_local4[_local2] = _local4[_local2] + (m.charAt((_local1 * _local3) + _local2) + "");
_local1++;
}
_local2++;
}
return(_local4.join(""));
}
static function initMaps() {
var _local6 = getMaps();
var _local1;
var _local2;
var _local4;
var _local5;
for (var _local9 in _local6) {
_local1 = _local6[_local9];
_local1.id = _local9;
_local1.str = normalizeMap(_local1.s.substr(0, 156));
_local4 = (_local1.s.indexOf(".", 157) - 157) / 2;
if (_local4 > 0) {
_local1.extra = [];
_local2 = _local1.s.substr(157, _local4 * 2);
var _local3 = -1;
while (_local3++ , _local3 < _local4) {
_local1.extra.push([_local2.charAt(_local3 * 2), Number(_local2.charAt((_local3 * 2) + 1))]);
}
}
_local5 = _local1.str.indexOf("+");
if (_local5 >= 0) {
_local1.ball = {x:int(_local5 / 12) + 1, y:(_local5 % 12) + 1};
}
var _local3 = 156;
_local1.hash = 0;
while (_local3--) {
_local1.hash = _local1.hash + _local1.s.charCodeAt(_local3);
}
_local6[_local9] = _local1;
}
maps = _local6;
}
static function getMaps() {
var _local2 = new Object();
_local2.Limited = {req:17};
_local2.Struggle = {req:13};
_local2.Challenge = {req:9};
_local2.Exercise = {req:4};
_local2.Alphabet = {req:0};
categories = _local2;
var _local1 = new Object();
var _local6;
_local6 = "0000000000111000000000004100000000000100010011100000000000011000068200000110!097100000116070111200000411010411000000068+004111000097000000000006000000000000.S8U8.";
_local1.lim0 = {n:18, cat:"Limited", name:"Diagonal Bump", req:17, ttime:180, tts:1000, reward:[1500, 2300, 2600, 2800, 3000], s:_local6, desc:"The limited choices mean you may have to use some serious trial and error. Be patient though as there are plenty of paths to look for!"};
_local6 = "111100000000098110!00000000+110000000000019000EF00E100160011000H100E1EEEE000000000E000000000000000000E00000000E0000000000GEI000000000GM000310006000000011600.W2U433K2J215.";
_local1.strug3 = {n:17, cat:"Struggle", name:"Quack Path", req:16, ttime:120, tts:600, reward:[1500, 2300, 2600, 2700, 2842], s:_local6, desc:"Sometimes going backwards is the only way to move forward."};
_local6 = "00000000EEE0000000000EM00000001000E0+000000410010000E20001001E000E1001E004E100E1001E0!0E100E100016031500E500011110000000000000000000000000000000000000000000.112242L2S2R1U1W1Y1X1.";
_local1.strug2 = {n:16, cat:"Struggle", name:"Hook", req:13, ttime:110, tts:600, reward:[1500, 1950, 2100, 2350, 2419], s:_local6, desc:"Don't let the bait get to you! Will you take the easier long route, or can you find a quicker one?"};
_local6 = "00000000E1000000GE0!0H100000000000010+000011111150000010000EE000000000000E000000000000E000000001000100000000100010000000100000000G00G10000000KEEEE1200000GEE.W1V2R1S3U18273.";
_local1.strug1 = {n:15, cat:"Struggle", name:"Curl Spine", req:13, ttime:100, tts:500, reward:[1500, 1950, 2100, 2250, 2324], s:_local6, desc:"Some sideways bumps might help you out here, and reversed paths could also be a good thing."};
_local6 = "EEI00000000EEE000000000001E0!0000000000I00000000000000E1EEEE1100003E000000E00001E000000E00011E000000E000EEE000E000000000001E0000000+0001E00000E000001EEEEE1E.X3V3W172625242.";
_local1.strug0 = {n:14, cat:"Struggle", name:"Ruby Angles", req:13, ttime:90, tts:500, reward:[1500, 2200, 2400, 2500, 2604], s:_local6, desc:"The next step\u2026 will you struggle? Just look at all that jelly! Bouncing is a no-no unless you use bumpers."};
_local6 = "0000000000000000000000000000000000000000000001EE2000000000111100000003600000000000111EE10000000008E1100000111160810+00001E1E101J0K000000000!1EE000000000001E.T2W1U1R18191J1.";
_local1.chal3 = {n:13, cat:"Challenge", name:"Alley", req:12, ttime:95, tts:800, reward:[1500, 2100, 2300, 2400, 2445], s:_local6, desc:"With long paths, there may be some shortcuts available. But be careful, because they might take you off course! Diagonals might be helpful to you here."};
_local6 = "11190000081009080!0010010000+600000710000011001111000001E00E000000001E00EEEEEE000000000000000000000000001111000EEE1009008E00000000J00KE00000000EEEEE00000000.1282F1Y1W1H1.";
_local1.chal2 = {n:12, cat:"Challenge", name:"Intersection", req:10, ttime:90, tts:700, reward:[1500, 2100, 2300, 2500, 2900], s:_local6, desc:"Sometimes they don't allow you to turn left or... you simply can't! Try taking the long road down, or force your way up front."};
_local6 = "E0E0E0E0E0EEE0000000000LEE00000000000EE00000000000EE000120000011100011116+79!8000EE11111000000EEEE115000003111100000000150000000000000000001J0K0000000001EEE.X1R2I2T1V1G2.";
_local1.chal1 = {n:11, cat:"Challenge", name:"Simulation", req:9, ttime:85, tts:700, reward:[1500, 2100, 2300, 2400, 2490], s:_local6, desc:"When the path is obvious what else could make it hard? Try to create the shortest and best path without using too many extra blocks."};
_local6 = "0000000000811000000000!7110000000007101000EEE11119+800HEEE11100000000LE1000000000F0H500EF00000M0000000000000111100E000000001100E000EF00000000000EE1200000000.1151F1U1V1R1Y1.";
_local1.chal0 = {n:10, cat:"Challenge", name:"Analysis", req:9, ttime:80, tts:700, reward:[1500, 1900, 2100, 2300, 2545], s:_local6, desc:"Enough of our starter levels, let's go for the challenging ones. Luck really won't help you much here. Analysis is the key to defeating this!"};
_local6 = "0001111500EEE0031500000LEE00190000000HE000000EEE000E000000LEM00001600000E00000111000!E+0000111000KE00000E1500GEE00000E0000EEI00000E000000000071E116000000011.U1W1R1F1718152.";
_local1.exer4 = {n:9, cat:"Exercise", name:"Exam", req:8, ttime:60, tts:300, reward:[1500, 2500, 2600, 2700, 2750], s:_local6, desc:"A fair test to get you thinking. It ain't that easy, it ain't that hard, but it definitely is cool looking and, most importantly, fun!"};
_local6 = "1111EXXXXXXEE11EEI000000LEEI0E000000000M00000K00J00E000000E0!E000000000LEEM00E0071000EI000E001100000000H0115000000000110000000000090000000031000+00071111111.V1S1R131412152.";
_local1.exer3 = {n:8, cat:"Exercise", name:"Push Push", req:6, ttime:70, tts:300, reward:[1500, 2200, 2350, 2400, 2495], s:_local6, desc:"Talk about pushy! Take advantage of the in-game bumpers to push push you down the hole."};
_local6 = "E000008190008E0000+0160!07E000007150004E000001100000I00000E100100000000E100100000000E1000000000GEE1000030001111500001000000000000100000000000000000003200000.R2W1S12131.";
_local1.exer2 = {n:7, cat:"Exercise", name:"Hoola", req:4, ttime:55, tts:600, reward:[1500, 1900, 2000, 2150, 2235], s:_local6, desc:"It's really fun when you're just beside the hole but can't get there easily. Ask for reinforcements from some blocks."};
_local6 = "11000000000001900000000000000000000000000000000000000000011100007112004150000111100010001110000001000EEE0+000010000LE0000001000!0EE0000010000KEEF00001EEEEEE.W1V1T1U151811121.";
_local1.exer1 = {n:6, cat:"Exercise", name:"Cycle", req:4, ttime:50, tts:400, reward:[1600, 2200, 2400, 2500, 2590], s:_local6, desc:"Sometimes the title is not related to the puzzle it self. But any strategy you have might actually work out if you just adjust a few angles here and there."};
_local6 = "000000190810000000000+00000000001000100EEE1115000411EM00000000081E000000000001E000000000071E0001EEEEEE11E000000HEM081E0000000E0!01EJ00000000001EEEF000000001.G131T1U2W1.";
_local1.exer0 = {n:5, cat:"Exercise", name:"Stretch", req:4, ttime:50, tts:400, reward:[1600, 2200, 2350, 2480, 2530], s:_local6, desc:"In a free environment, there's always a best way to achieve your goal. Stretch your mind, project your path, then go for the hole!"};
_local6 = "0000000000000011111111111001+0000000010010000000001000111100001000000100001000000100001000000110001111000100000000!10010000000001001111111111100000000000000.T1J1I131.";
_local1.Alpha3 = {n:4, cat:"Alphabet", name:"\"Z\" Grade", req:3, ttime:60, tts:600, reward:[1900, 2600, 2700, 2800, 2850], s:_local6, desc:"\u2026 And the letter \"Z\"'s grade is for combining the 3 block types. Use your skills and techniques to bounce and slide your ball to the goal!"};
_local6 = "0111000001110100010001000110+0100010!01100010001000110001000100011000100010001100010001000110001111100011000000000001010000000001000100000001000001111111000.U1R1V1W1.";
_local1.Alpha2 = {n:3, cat:"Alphabet", name:"\"U\" Bump", req:2, ttime:45, tts:500, reward:[1900, 2300, 2400, 2450, 2530], s:_local6, desc:"Bump your way through the letter \"U\". The time, use only the bumpers to push your ball all the way toward the hole."};
_local6 = "011111111000010000000100001000+000100000110001100000001000E00000000E000E00000000E000E00000000E000E00011000E000111100E00E0000000!0E001000000000E00111EEEE1110.K1J1F1G1.";
_local1.Alpha1 = {n:2, cat:"Alphabet", name:"\"L\" Jell", req:1, ttime:35, tts:300, reward:[1900, 2600, 2700, 2770, 2820], s:_local6, desc:"It's a letter \"L\" made of yummy jelly that wiggles!. Observe how the jelly tiles absorb impact, but also make your ball slide."};
_local6 = "0011111111100010000000!01001000000000100111000001110000100000100000010000010000001000001000000100000100001110000011100100000000010010000000+0100011111111100.31214151.";
_local1.Alpha0 = {n:1, cat:"Alphabet", name:"\"I\" Norm", req:0, ttime:30, tts:200, reward:[1900, 2600, 2700, 2750, 2790], s:_local6, desc:"It's a letter \"I\", but it's not actually straight so be warned. Make use of the normal blocks to give you a bounce!"};
_local6 = "11111111190811111111100+00111111110000011111111000001111111100000EEEEEEEEEE000EM00000000003E000000EE0001E000F00000001E0!0E0EE00001EJ0KE00000001EEEEEEE111111.91S1.";
_local1.TutLvl = {n:0, cat:"Alphabet", name:"Tutorial", req:0, ttime:0, tts:0, reward:[0, 0, 0, 0, 0], s:_local6, desc:"This is a tutorial level to teach you the basics, but it doesn't give a score. The ball's angle will be shown to help. Simply follow the instrustions to clear."};
return(_local1);
}
static var categories = {};
static var maps = {};
static var mochiID = "609ea57ad1b5aa5f";
static var mochiBoardID = "ed8a8b017fc5c677";
var ready = false;
var ft = 50;
}
Symbol 622 MovieClip [__Packages.N.NEngine] Frame 0
class N.NEngine
{
static var root, gfx, debug_rend, static_rend, input, GRAV, DAMP, DRAG, BOUNCE, FRICTION, MAPSTR, tiles, loader;
function NEngine ($root) {
root = $root || _root;
N.collision.ResolveCollision.init();
gfx = new N.util.NinjaGraphicsSystem();
debug_rend = new N.standard.VectorRenderer();
static_rend = new N.standard.VectorRenderer();
input = new N.standard.InputManager();
GRAV = 0.2;
DAMP = 0.99;
DRAG = 0.999999;
BOUNCE = 0.2;
FRICTION = 0.05;
MAPSTR = "";
MIN_F = 0;
MAX_F = 1;
MIN_B = 0;
MAX_B = 0.99;
MIN_G = 0;
MAX_G = 1;
XMIN = 0;
XMAX = 600;
YMIN = 0;
YMAX = 400;
}
static function init(root, mc) {
var _local1 = new N.NEngine(root);
if (typeof(mc) == "movieclip") {
gfx.DestroyMC();
gfx.rootbuffer = mc;
}
return(_local1);
}
static function TickInit() {
if (!tiles.Building()) {
gfx.rootbuffer.onEnterFrame = function () {
N.NEngine.TickLoad();
};
loader.Load(MAPSTR);
}
}
static function TickLoad() {
var _local1 = 18;
while (_local1--) {
if (!loader.Loading()) {
loader.onComplete();
delete gfx.rootbuffer.onEnterFrame;
}
}
}
static function prepare(onComplete, target) {
loader = new N.tile.MapLoader(onComplete, target);
gfx.rootbuffer.onEnterFrame = function () {
N.NEngine.TickInit();
};
}
static var TILERAD = 15;
static var MIN_F = 0;
static var MAX_F = 1;
static var MIN_B = 0;
static var MAX_B = 0.99;
static var MIN_G = 0;
static var MAX_G = 1;
static var XMIN = 0;
static var XMAX = 600;
static var YMIN = 0;
static var YMAX = 400;
static var fsp = 1;
}
Symbol 623 MovieClip [__Packages.N.tile.TileMap] Frame 0
class N.tile.TileMap
{
static var gfx;
var xw, yw, tw, th, rows, cols, fullrows, fullcols, minX, minY, maxX, maxY, grid, rend;
function TileMap (rows, cols, xw, yw) {
this.xw = xw;
this.yw = yw;
tw = 2 * this.xw;
th = 2 * this.yw;
this.rows = rows;
this.cols = cols;
fullrows = this.rows + 2;
fullcols = this.cols + 2;
minX = tw;
minY = th;
maxX = tw + (rows * tw);
maxY = th + (cols * th);
grid = new Object();
BUILD_STEPS_REMAINING = 9;
gfx = new N.util.NinjaGraphicsSystem(N.NEngine.gfx);
rend = new N.standard.VectorRenderer();
rend.Clear();
}
function Building() {
var _local7 = xw;
var _local6 = yw;
var _local4 = fullrows;
var _local2 = fullcols;
var _local8 = rows;
var _local9 = cols;
switch (BUILD_STEPS_REMAINING) {
case 9 :
var _local5 = 0;
while (_local5 < _local4) {
grid[_local5] = new Object();
var _local3 = 0;
while (_local3 < _local2) {
grid[_local5][_local3] = new N.tile.TileCell(_local5, _local3, _local7, _local6, xw, yw);
_local6 = _local6 + th;
_local3++;
}
_local7 = _local7 + tw;
_local6 = yw;
_local5++;
}
BUILD_STEPS_REMAINING--;
return(true);
case 8 :
_local5 = 0;
while (_local5 < (_local4 - 1)) {
var _local3 = 0;
while (_local3 < _local2) {
grid[_local5][_local3].LinkR(grid[_local5 + 1][_local3]);
_local3++;
}
_local5++;
}
BUILD_STEPS_REMAINING--;
return(true);
case 7 :
_local5 = 1;
while (_local5 < _local4) {
var _local3 = 0;
while (_local3 < _local2) {
grid[_local5][_local3].LinkL(grid[_local5 - 1][_local3]);
_local3++;
}
_local5++;
}
BUILD_STEPS_REMAINING--;
return(true);
case 6 :
_local5 = 0;
while (_local5 < _local4) {
var _local3 = 0;
while (_local3 < (_local2 - 1)) {
grid[_local5][_local3].LinkD(grid[_local5][_local3 + 1]);
_local3++;
}
_local5++;
}
BUILD_STEPS_REMAINING--;
return(true);
case 5 :
_local5 = 0;
while (_local5 < _local4) {
var _local3 = 1;
while (_local3 < _local2) {
grid[_local5][_local3].LinkU(grid[_local5][_local3 - 1]);
_local3++;
}
_local5++;
}
BUILD_STEPS_REMAINING--;
return(true);
case 4 :
_local5 = 0;
while (_local5 < _local4) {
grid[_local5][0].SetState(N.tile.TileCell.TID_FULL);
grid[_local5][0].mc.removeMovieClip();
_local5++;
}
BUILD_STEPS_REMAINING--;
return(true);
case 3 :
_local5 = 0;
while (_local5 < _local4) {
grid[_local5][_local2 - 1].SetState(N.tile.TileCell.TID_FULL);
grid[_local5][_local2 - 1].mc.removeMovieClip();
_local5++;
}
BUILD_STEPS_REMAINING--;
return(true);
case 2 :
_local5 = 0;
while (_local5 < _local2) {
grid[0][_local5].SetState(N.tile.TileCell.TID_FULL);
grid[0][_local5].mc.removeMovieClip();
_local5++;
}
BUILD_STEPS_REMAINING--;
return(true);
case 1 :
_local5 = 0;
while (_local5 < _local2) {
grid[_local4 - 1][_local5].SetState(N.tile.TileCell.TID_FULL);
grid[_local4 - 1][_local5].mc.removeMovieClip();
_local5++;
}
BUILD_STEPS_REMAINING--;
return(true);
}
return(false);
}
function ClearGrid() {
var _local2;
for (var _local4 in grid) {
_local2 = grid[_local4];
for (var _local3 in _local2) {
_local2[_local3].next = null;
_local2[_local3].prev = null;
}
}
}
function GetTile_S(x, y) {
return(grid[int(x / tw)][int(y / th)]);
}
function GetTile_V(p) {
return(grid[int(p.x / tw)][int(p.y / th)]);
}
function GetTile_I(i, j) {
return(grid[i][j]);
}
function GetIndex_S(v, x, y) {
v.x = int(x / tw);
v.y = int(y / th);
}
function GetIndex_V(v, p) {
v.x = int(p.x / tw);
v.y = int(p.y / th);
}
function GetTileStates() {
var _local8 = rows;
var _local6 = cols;
var _local7 = grid;
var _local5 = "";
var _local4;
var _local3 = 0;
while (_local3 < _local8) {
_local4 = _local7[_local3 + 1];
var _local2 = 0;
while (_local2 < _local6) {
_local5 = _local5 + String.fromCharCode(_local4[_local2 + 1].ID + CHAR_PAD);
_local2++;
}
_local3++;
}
return(_local5);
}
function SetTileState(i, j, char) {
var _local2 = char - CHAR_PAD;
grid[i + 1][j + 1].SetState(_local2);
}
function SetTileStates(instr) {
var _local9 = rows;
var _local6 = cols;
var _local11 = grid;
var _local5 = new Array();
var _local7 = 0;
var _local3 = 0;
while (_local3 < _local9) {
_local5[_local3] = new Array();
var _local2 = 0;
while (_local2 < _local6) {
var _local4 = instr.charCodeAt(_local7);
_local5[_local3][_local2] = _local4;
_local7++;
_local2++;
}
_local3++;
}
var _local8;
_local3 = 0;
while (_local3 < _local9) {
_local8 = _local11[_local3 + 1];
var _local2 = 0;
while (_local2 < _local6) {
_local8[_local2 + 1].SetState(_local5[_local3][_local2] - CHAR_PAD);
_local2++;
}
_local3++;
}
}
static var BUILD_STEPS_REMAINING = 9;
static var CHAR_PAD = 48;
}
Symbol 624 MovieClip [__Packages.N.standard.VectorRenderer] Frame 0
class N.standard.VectorRenderer
{
var buffer, thickness, rgb, alpha;
function VectorRenderer () {
buffer = N.NEngine.gfx.CreateEmptySprite();
buffer._x = 0;
buffer._y = 0;
thickness = 0;
rgb = 0;
alpha = 100;
}
function Clear() {
buffer.clear();
buffer.lineStyle(thickness, rgb, alpha);
}
function SetStyle(thick, rgb, alpha) {
buffer.lineStyle(thick, rgb, alpha);
}
function StartFill(x, y, rgb, alpha) {
buffer.moveTo(x, y);
buffer.beginFill(rgb, alpha);
}
function StopFill() {
buffer.endFill();
}
function DrawLine(va, vb) {
buffer.moveTo(va.x, va.y);
buffer.lineTo(vb.x, vb.y);
}
function DrawLine_S(x0, y0, x1, y1) {
buffer.moveTo(x0, y0);
buffer.lineTo(x1, y1);
}
function DrawLinestrip(vList) {
buffer.moveTo(vList[0].x, vList[0].y);
var _local2 = 0;
while (_local2 < vList.length) {
buffer.lineTo(vList[_local2].x, vList[_local2].y);
_local2++;
}
}
function DrawTri(va, vb, vc) {
buffer.moveTo(va.x, va.y);
buffer.lineTo(vb.x, vb.y);
buffer.lineTo(vc.x, vc.y);
buffer.lineTo(va.x, va.y);
}
function DrawTri_S(vax, vay, vbx, vby, vcx, vcy) {
buffer.moveTo(vax, vay);
buffer.lineTo(vbx, vby);
buffer.lineTo(vcx, vcy);
buffer.lineTo(vax, vay);
}
function DrawQuad(a, b, c, d) {
buffer.moveTo(a.x, a.y);
buffer.lineTo(b.x, b.y);
buffer.lineTo(c.x, c.y);
buffer.lineTo(d.x, d.y);
buffer.lineTo(a.x, a.y);
}
function DrawQuad_S(ax, ay, bx, by, cx, cy, dx, dy) {
buffer.moveTo(ax, ay);
buffer.lineTo(bx, by);
buffer.lineTo(cx, cy);
buffer.lineTo(dx, dy);
buffer.lineTo(ax, ay);
}
function DrawPlus(v) {
buffer.moveTo(v.x - 1, v.y);
buffer.lineTo(v.x + 1, v.y);
buffer.moveTo(v.x, v.y - 1);
buffer.lineTo(v.x, v.y + 1);
}
function DrawPlus_S(vx, vy) {
buffer.moveTo(vx - 1, vy);
buffer.lineTo(vx + 1, vy);
buffer.moveTo(vx, vy - 1);
buffer.lineTo(vx, vy + 1);
}
function DrawPlusR(v, r) {
buffer.moveTo(v.x - r, v.y);
buffer.lineTo(v.x + r, v.y);
buffer.moveTo(v.x, v.y - r);
buffer.lineTo(v.x, v.y + r);
}
function DrawCross(v) {
buffer.moveTo(v.x - 1, v.y - 1);
buffer.lineTo(v.x + 1, v.y + 1);
buffer.moveTo(v.x + 1, v.y - 1);
buffer.lineTo(v.x - 1, v.y + 1);
}
function DrawCross_S(vx, vy) {
buffer.moveTo(vx - 1, vy - 1);
buffer.lineTo(vx + 1, vy + 1);
buffer.moveTo(vx + 1, vy - 1);
buffer.lineTo(vx - 1, vy + 1);
}
function DrawCrossR(v, r) {
buffer.moveTo(v.x - r, v.y - r);
buffer.lineTo(v.x + r, v.y + r);
buffer.moveTo(v.x + r, v.y - r);
buffer.lineTo(v.x - r, v.y + r);
}
function DrawCircle(v, r) {
var _local4 = v.x;
var _local3 = v.y;
buffer.moveTo(_local4 + r, _local3);
buffer.curveTo(r + _local4, (0.4142 * r) + _local3, (0.7071 * r) + _local4, (0.7071 * r) + _local3);
buffer.curveTo((0.4142 * r) + _local4, r + _local3, _local4, r + _local3);
buffer.curveTo((-0.4142 * r) + _local4, r + _local3, (-0.7071 * r) + _local4, (0.7071 * r) + _local3);
buffer.curveTo((-r) + _local4, (0.4142 * r) + _local3, (-r) + _local4, _local3);
buffer.curveTo((-r) + _local4, (-0.4142 * r) + _local3, (-0.7071 * r) + _local4, (-0.7071 * r) + _local3);
buffer.curveTo((-0.4142 * r) + _local4, (-r) + _local3, _local4, (-r) + _local3);
buffer.curveTo((0.4142 * r) + _local4, (-r) + _local3, (0.7071 * r) + _local4, (-0.7071 * r) + _local3);
buffer.curveTo(r + _local4, (-0.4142 * r) + _local3, r + _local4, _local3);
}
function DrawCircle_S(x, y, r) {
buffer.moveTo(x + r, y);
buffer.curveTo(r + x, (0.4142 * r) + y, (0.7071 * r) + x, (0.7071 * r) + y);
buffer.curveTo((0.4142 * r) + x, r + y, x, r + y);
buffer.curveTo((-0.4142 * r) + x, r + y, (-0.7071 * r) + x, (0.7071 * r) + y);
buffer.curveTo((-r) + x, (0.4142 * r) + y, (-r) + x, y);
buffer.curveTo((-r) + x, (-0.4142 * r) + y, (-0.7071 * r) + x, (-0.7071 * r) + y);
buffer.curveTo((-0.4142 * r) + x, (-r) + y, x, (-r) + y);
buffer.curveTo((0.4142 * r) + x, (-r) + y, (0.7071 * r) + x, (-0.7071 * r) + y);
buffer.curveTo(r + x, (-0.4142 * r) + y, r + x, y);
}
function DrawArc(p0, p1, c) {
buffer.moveTo(p0.x, p0.y);
buffer.curveTo(c.x, c.y, p1.x, p1.y);
}
function DrawArc_S(x0, y0, x1, y1, xc, yc) {
buffer.moveTo(x0, y0);
buffer.curveTo(xc, yc, x1, y1);
}
function DrawAABB(p, xw, yw) {
var _local8 = new N.standard.Vector2(p.x + xw, p.y + yw);
var _local7 = new N.standard.Vector2(p.x - xw, p.y + yw);
var _local6 = new N.standard.Vector2(p.x - xw, p.y - yw);
var _local5 = new N.standard.Vector2(p.x + xw, p.y - yw);
DrawQuad(_local8, _local7, _local6, _local5);
}
function DrawAABB_S(minx, maxx, miny, maxy) {
var _local5 = new N.standard.Vector2(maxx, maxy);
var _local4 = new N.standard.Vector2(minx, maxy);
var _local3 = new N.standard.Vector2(minx, miny);
var _local2 = new N.standard.Vector2(maxx, miny);
DrawQuad(_local5, _local4, _local3, _local2);
}
function DrawConcaveCCWArc_S(cx, cy, px, py) {
var _local8 = px;
var _local7 = py;
var _local12 = _local8 - cx;
var _local11 = _local7 - cy;
var _local6 = Math.sqrt((_local12 * _local12) + (_local11 * _local11));
var _local17 = _local11;
var _local16 = -_local12;
var _local3 = (_local8 + _local17) - cx;
var _local2 = (_local7 + _local16) - cy;
var _local14 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
_local3 = _local3 / _local14;
_local2 = _local2 / _local14;
_local3 = _local3 * _local6;
_local2 = _local2 * _local6;
_local3 = _local3 + cx;
_local2 = _local2 + cy;
var _local5 = ((_local8 + _local3) * 0.5) - cx;
var _local4 = ((_local7 + _local2) * 0.5) - cy;
var _local13 = Math.sqrt((_local5 * _local5) + (_local4 * _local4));
var _local15 = _local6 - _local13;
_local5 = _local5 / _local13;
_local4 = _local4 / _local13;
_local5 = _local5 * (_local6 + _local15);
_local4 = _local4 * (_local6 + _local15);
_local5 = _local5 + cx;
_local4 = _local4 + cy;
buffer.moveTo(_local8, _local7);
buffer.curveTo(_local5, _local4, _local3, _local2);
_local8 = _local3;
_local7 = _local2;
_local12 = _local8 - cx;
_local11 = _local7 - cy;
_local6 = Math.sqrt((_local12 * _local12) + (_local11 * _local11));
_local17 = _local11;
_local16 = -_local12;
_local3 = (_local8 + _local17) - cx;
_local2 = (_local7 + _local16) - cy;
_local14 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
_local3 = _local3 / _local14;
_local2 = _local2 / _local14;
_local3 = _local3 * _local6;
_local2 = _local2 * _local6;
_local3 = _local3 + cx;
_local2 = _local2 + cy;
_local5 = ((_local8 + _local3) * 0.5) - cx;
_local4 = ((_local7 + _local2) * 0.5) - cy;
_local13 = Math.sqrt((_local5 * _local5) + (_local4 * _local4));
_local15 = _local6 - _local13;
_local5 = _local5 / _local13;
_local4 = _local4 / _local13;
_local5 = _local5 * (_local6 + _local15);
_local4 = _local4 * (_local6 + _local15);
_local5 = _local5 + cx;
_local4 = _local4 + cy;
buffer.curveTo(_local5, _local4, _local3, _local2);
}
}
Symbol 625 MovieClip [__Packages.N.standard.Vector2] Frame 0
class N.standard.Vector2
{
var x, y;
function Vector2 ($x, $y) {
if (!$x) {
$x = 0;
}
if (!$y) {
$y = 0;
}
x = $x;
y = $y;
}
function ToString() {
return(((("(" + x) + ",") + y) + ")");
}
function clone() {
var _local2 = new N.standard.Vector2(x, y);
return(_local2);
}
function plus(v2) {
var _local2 = new N.standard.Vector2(x + v2.x, y + v2.y);
return(_local2);
}
function minus(v2) {
var _local2 = new N.standard.Vector2(x - v2.x, y - v2.y);
return(_local2);
}
function normR() {
var _local2 = new N.standard.Vector2(y * -1, x);
return(_local2);
}
function dir() {
var _local2 = clone();
_local2.normalize();
return(_local2);
}
function proj(v2) {
var _local3 = v2.dot(v2);
var _local2;
if (_local3 == 0) {
_local2 = clone();
} else {
_local2 = v2.clone();
_local2.mult(dot(v2) / _local3);
}
return(_local2);
}
function projLen(v2) {
var _local2 = v2.dot(v2);
if (_local2 == 0) {
return(0);
}
return(Math.abs(dot(v2) / _local2));
}
function dot(v2) {
return((x * v2.x) + (y * v2.y));
}
function cross(v2) {
return((x * v2.y) - (y * v2.x));
}
function len() {
return(Math.sqrt((x * x) + (y * y)));
}
function copy(v2) {
x = v2.x;
y = v2.y;
}
function mult(s) {
x = x * s;
y = y * s;
}
function normalize() {
var _local2 = len();
if (_local2 != 0) {
x = x / _local2;
y = y / _local2;
}
}
function pluseq(v2) {
x = x + v2.x;
y = y + v2.y;
}
function minuseq(v2) {
x = x - v2.x;
y = y - v2.y;
}
function angle(v) {
if (!v) {
v = new N.standard.Vector2(0, 0);
}
var _local4 = Math.atan2(y - v.y, x - v.x);
if (arguments[1] == true) {
var _local5 = (_local4 / Math.PI) * 180;
return(_local5);
}
return(_local4);
}
static function forAngle(a) {
return(new N.standard.Vector2(Math.cos(a), Math.sin(a)));
}
function rotateR(radian) {
var _local3 = Math.cos(radian);
var _local2 = Math.sin(radian);
return(new N.standard.Vector2((_local3 * x) - (_local2 * y), (_local3 * y) + (_local2 * x)));
}
function rotate(angle) {
var _local2 = (angle * Math.PI) / 180;
return(rotateR(_local2));
}
function isZero(Void) {
if ((x == 0) && (y == 0)) {
return(true);
}
return(false);
}
}
Symbol 626 MovieClip [__Packages.N.util.NinjaGraphicsSystem] Frame 0
class N.util.NinjaGraphicsSystem
{
var rootbuffer, children, front_depth, stepsize, back_depth;
function NinjaGraphicsSystem (parentGfx) {
if (parentGfx && (parentGfx instanceof N.util.NinjaGraphicsSystem)) {
rootbuffer = parentGfx.CreateEmptySprite();
} else {
rootbuffer = N.NEngine.root.createEmptyMovieClip("rootbuffer", 100);
}
rootbuffer.tabChildren = false;
rootbuffer.tabEnabled = false;
children = new Array();
reset();
}
function CreateSprite(linkage) {
var _local3 = GetNextDepth_Front();
var _local2 = rootbuffer.attachMovie(linkage, linkage + _local3, _local3);
children.push(_local2);
return(_local2);
}
function CreateEmptySprite() {
var _local3 = GetNextDepth_Front();
var _local2 = rootbuffer.createEmptyMovieClip("emptyMC" + _local3, _local3);
children.push(_local2);
return(_local2);
}
function DestroyMC(mc) {
mc.swapDepths(1048000);
mc.removeMovieClip();
}
function GetNextDepth_Front() {
front_depth = front_depth + stepsize;
return(front_depth);
}
function GetNextDepth_Back() {
back_depth = back_depth - stepsize;
return(back_depth);
}
function reset() {
for (var _local2 in children) {
children[_local2].removeMovieClip();
}
front_depth = 1000;
back_depth = 1000;
stepsize = 2;
}
}
Symbol 627 MovieClip [__Packages.N.tile.TileCell] Frame 0
class N.tile.TileCell
{
var ID, CTYPE, i, j, nU, nD, nL, nR, eU, eD, eL, eR, gx, gy, d, next, prev, objcounter, pos, xw, yw, minx, maxx, miny, maxy, signx, signy, sx, sy, mc, offFrame, friction, bounce;
function TileCell (i, j, x, y, xw, yw) {
ID = TID_EMPTY;
CTYPE = CTYPE_EMPTY;
this.i = i;
this.j = j;
nU = null;
nD = null;
nL = null;
nR = null;
eU = EID_OFF;
eD = EID_OFF;
eL = EID_OFF;
eR = EID_OFF;
gx = 0;
gy = 0;
d = 0;
next = null;
prev = null;
objcounter = 0;
pos = new N.standard.Vector2(x, y);
this.xw = xw;
this.yw = yw;
minx = pos.x - this.xw;
maxx = pos.x + this.xw;
miny = pos.y - this.yw;
maxy = pos.y + this.yw;
signx = 0;
signy = 0;
sx = 0;
sy = 0;
var _local2 = false;
if (!_local2) {
mc = N.tile.TileMap.gfx.CreateSprite("tileMC");
mc.gotoAndStop(1);
mc._xscale = this.xw * 2;
mc._yscale = this.yw * 2;
mc._x = pos.x;
mc._y = pos.y;
} else {
mc = N.tile.TileMap.gfx.CreateSprite("tileMC2");
mc.gotoAndStop(1);
mc._xscale = this.xw * 2;
mc._yscale = this.yw * 2;
mc._x = pos.x;
mc._y = pos.y;
}
offFrame = 0;
friction = 1;
bounce = 0;
}
function LinkU(t) {
nU = t;
}
function LinkD(t) {
nD = t;
}
function LinkL(t) {
nL = t;
}
function LinkR(t) {
nR = t;
}
function ToString() {
var _local2 = ((("(" + i) + ",") + j) + ")";
return(_local2);
}
function Draw() {
mc.gotoAndStop((ID + 1) + offFrame);
mc.mc.mc.gotoAndStop((ID + 1) + offFrame);
}
function SetState(ID) {
if (ID == TID_EMPTY) {
Clear();
} else {
this.ID = ID;
UpdateType();
UpdateEdges();
UpdateNeighbors();
}
}
function Clear() {
ID = TID_EMPTY;
UpdateType();
UpdateEdges();
UpdateNeighbors();
Draw();
}
function UpdateNeighbors() {
if (nU != null) {
nU.UpdateEdges();
}
if (nD != null) {
nD.UpdateEdges();
}
if (nL != null) {
nL.UpdateEdges();
}
if (nR != null) {
nR.UpdateEdges();
}
}
function UpdateType() {
if (0 < ID) {
if (ID < CTYPE_45DEG) {
CTYPE = CTYPE_FULL;
signx = 0;
signy = 0;
sx = 0;
sy = 0;
} else if (ID < CTYPE_CONCAVE) {
CTYPE = CTYPE_45DEG;
if (ID == TID_45DEGpn) {
signx = 1;
signy = -1;
sx = signx / Math.SQRT2;
sy = signy / Math.SQRT2;
} else if (ID == TID_45DEGnn) {
signx = -1;
signy = -1;
sx = signx / Math.SQRT2;
sy = signy / Math.SQRT2;
} else if (ID == TID_45DEGnp) {
signx = -1;
signy = 1;
sx = signx / Math.SQRT2;
sy = signy / Math.SQRT2;
} else if (ID == TID_45DEGpp) {
signx = 1;
signy = 1;
sx = signx / Math.SQRT2;
sy = signy / Math.SQRT2;
} else {
return(false);
}
} else if (ID < CTYPE_CONVEX) {
CTYPE = CTYPE_CONCAVE;
if (ID == TID_CONCAVEpn) {
signx = 1;
signy = -1;
sx = 0;
sy = 0;
} else if (ID == TID_CONCAVEnn) {
signx = -1;
signy = -1;
sx = 0;
sy = 0;
} else if (ID == TID_CONCAVEnp) {
signx = -1;
signy = 1;
sx = 0;
sy = 0;
} else if (ID == TID_CONCAVEpp) {
signx = 1;
signy = 1;
sx = 0;
sy = 0;
} else {
return(false);
}
} else if (ID < CTYPE_22DEGs) {
CTYPE = CTYPE_CONVEX;
if (ID == TID_CONVEXpn) {
signx = 1;
signy = -1;
sx = 0;
sy = 0;
} else if (ID == TID_CONVEXnn) {
signx = -1;
signy = -1;
sx = 0;
sy = 0;
} else if (ID == TID_CONVEXnp) {
signx = -1;
signy = 1;
sx = 0;
sy = 0;
} else if (ID == TID_CONVEXpp) {
signx = 1;
signy = 1;
sx = 0;
sy = 0;
} else {
return(false);
}
} else if (ID < CTYPE_22DEGb) {
CTYPE = CTYPE_22DEGs;
if (ID == TID_22DEGpnS) {
signx = 1;
signy = -1;
var _local2 = 2.23606797749979;
sx = (signx * 1) / _local2;
sy = (signy * 2) / _local2;
} else if (ID == TID_22DEGnnS) {
signx = -1;
signy = -1;
var _local2 = 2.23606797749979;
sx = (signx * 1) / _local2;
sy = (signy * 2) / _local2;
} else if (ID == TID_22DEGnpS) {
signx = -1;
signy = 1;
var _local2 = 2.23606797749979;
sx = (signx * 1) / _local2;
sy = (signy * 2) / _local2;
} else if (ID == TID_22DEGppS) {
signx = 1;
signy = 1;
var _local2 = 2.23606797749979;
sx = (signx * 1) / _local2;
sy = (signy * 2) / _local2;
} else {
return(false);
}
} else if (ID < CTYPE_67DEGs) {
CTYPE = CTYPE_22DEGb;
if (ID == TID_22DEGpnB) {
signx = 1;
signy = -1;
var _local2 = 2.23606797749979;
sx = (signx * 1) / _local2;
sy = (signy * 2) / _local2;
} else if (ID == TID_22DEGnnB) {
signx = -1;
signy = -1;
var _local2 = 2.23606797749979;
sx = (signx * 1) / _local2;
sy = (signy * 2) / _local2;
} else if (ID == TID_22DEGnpB) {
signx = -1;
signy = 1;
var _local2 = 2.23606797749979;
sx = (signx * 1) / _local2;
sy = (signy * 2) / _local2;
} else if (ID == TID_22DEGppB) {
signx = 1;
signy = 1;
var _local2 = 2.23606797749979;
sx = (signx * 1) / _local2;
sy = (signy * 2) / _local2;
} else {
return(false);
}
} else if (ID < CTYPE_67DEGb) {
CTYPE = CTYPE_67DEGs;
if (ID == TID_67DEGpnS) {
signx = 1;
signy = -1;
var _local2 = 2.23606797749979;
sx = (signx * 2) / _local2;
sy = (signy * 1) / _local2;
} else if (ID == TID_67DEGnnS) {
signx = -1;
signy = -1;
var _local2 = 2.23606797749979;
sx = (signx * 2) / _local2;
sy = (signy * 1) / _local2;
} else if (ID == TID_67DEGnpS) {
signx = -1;
signy = 1;
var _local2 = 2.23606797749979;
sx = (signx * 2) / _local2;
sy = (signy * 1) / _local2;
} else if (ID == TID_67DEGppS) {
signx = 1;
signy = 1;
var _local2 = 2.23606797749979;
sx = (signx * 2) / _local2;
sy = (signy * 1) / _local2;
} else {
return(false);
}
} else if (ID < CTYPE_HALF) {
CTYPE = CTYPE_67DEGb;
if (ID == TID_67DEGpnB) {
signx = 1;
signy = -1;
var _local2 = 2.23606797749979;
sx = (signx * 2) / _local2;
sy = (signy * 1) / _local2;
} else if (ID == TID_67DEGnnB) {
signx = -1;
signy = -1;
var _local2 = 2.23606797749979;
sx = (signx * 2) / _local2;
sy = (signy * 1) / _local2;
} else if (ID == TID_67DEGnpB) {
signx = -1;
signy = 1;
var _local2 = 2.23606797749979;
sx = (signx * 2) / _local2;
sy = (signy * 1) / _local2;
} else if (ID == TID_67DEGppB) {
signx = 1;
signy = 1;
var _local2 = 2.23606797749979;
sx = (signx * 2) / _local2;
sy = (signy * 1) / _local2;
} else {
return(false);
}
} else {
CTYPE = CTYPE_HALF;
if (ID == TID_HALFd) {
signx = 0;
signy = -1;
sx = signx;
sy = signy;
} else if (ID == TID_HALFu) {
signx = 0;
signy = 1;
sx = signx;
sy = signy;
} else if (ID == TID_HALFl) {
signx = 1;
signy = 0;
sx = signx;
sy = signy;
} else if (ID == TID_HALFr) {
signx = -1;
signy = 0;
sx = signx;
sy = signy;
} else {
return(false);
}
}
} else {
CTYPE = CTYPE_EMPTY;
signx = 0;
signy = 0;
sx = 0;
sy = 0;
}
}
function UpdateEdges() {
var _local2 = nU;
if (ID == TID_EMPTY) {
if (_local2.ID == TID_EMPTY) {
eU = EID_OFF;
} else if (_local2.ID == TID_FULL) {
eU = EID_SOLID;
} else if ((((_local2.signy * -1) <= 0) || (_local2.ID == TID_67DEGpnS)) || (_local2.ID == TID_67DEGnnS)) {
eU = EID_INTERESTING;
} else {
eU = EID_SOLID;
}
} else if (ID == TID_FULL) {
if (_local2.ID == TID_FULL) {
eU = EID_OFF;
} else if (_local2.ID == TID_EMPTY) {
eU = EID_OFF;
} else if ((((_local2.signy * -1) <= 0) || (_local2.ID == TID_67DEGpnS)) || (_local2.ID == TID_67DEGnnS)) {
eU = EID_INTERESTING;
} else {
eU = EID_OFF;
}
} else if (0 <= (signy * -1)) {
if (_local2.ID == TID_EMPTY) {
eU = EID_OFF;
} else if (_local2.ID == TID_FULL) {
eU = EID_SOLID;
} else if ((((_local2.signy * -1) <= 0) || (_local2.ID == TID_67DEGpnS)) || (_local2.ID == TID_67DEGnnS)) {
eU = EID_INTERESTING;
} else {
eU = EID_SOLID;
}
} else if ((ID == TID_67DEGppS) || (ID == TID_67DEGnpS)) {
if (_local2.ID == TID_EMPTY) {
eU = EID_OFF;
} else if (_local2.ID == TID_FULL) {
eU = EID_SOLID;
} else if ((((_local2.signy * -1) <= 0) || (_local2.ID == TID_67DEGpnS)) || (_local2.ID == TID_67DEGnnS)) {
eU = EID_INTERESTING;
} else if ((0 < (_local2.signy * -1)) || (_local2.ID == TID_FULL)) {
eU = EID_SOLID;
} else {
eU = EID_OFF;
}
} else if (_local2.ID == TID_FULL) {
eU = EID_OFF;
} else if (_local2.ID == TID_EMPTY) {
eU = EID_OFF;
} else if ((((_local2.signy * -1) <= 0) || (_local2.ID == TID_67DEGpnS)) || (_local2.ID == TID_67DEGnnS)) {
eU = EID_INTERESTING;
} else {
eU = EID_OFF;
}
_local2 = nD;
if (ID == TID_EMPTY) {
if (_local2.ID == TID_EMPTY) {
eD = EID_OFF;
} else if (_local2.ID == TID_FULL) {
eD = EID_SOLID;
} else if ((((_local2.signy * 1) <= 0) || (_local2.ID == TID_67DEGppS)) || (_local2.ID == TID_67DEGnpS)) {
eD = EID_INTERESTING;
} else {
eD = EID_SOLID;
}
} else if (ID == TID_FULL) {
if (_local2.ID == TID_FULL) {
eD = EID_OFF;
} else if (_local2.ID == TID_EMPTY) {
eD = EID_OFF;
} else if ((((_local2.signy * 1) <= 0) || (_local2.ID == TID_67DEGppS)) || (_local2.ID == TID_67DEGnpS)) {
eD = EID_INTERESTING;
} else {
eD = EID_OFF;
}
} else if (0 <= (signy * 1)) {
if (_local2.ID == TID_EMPTY) {
eD = EID_OFF;
} else if (_local2.ID == TID_FULL) {
eD = EID_SOLID;
} else if ((((_local2.signy * 1) <= 0) || (_local2.ID == TID_67DEGppS)) || (_local2.ID == TID_67DEGnpS)) {
eD = EID_INTERESTING;
} else {
eD = EID_SOLID;
}
} else if ((ID == TID_67DEGpnS) || (ID == TID_67DEGnnS)) {
if (_local2.ID == TID_EMPTY) {
eD = EID_OFF;
} else if (_local2.ID == TID_FULL) {
eD = EID_SOLID;
} else if ((((_local2.signy * 1) <= 0) || (_local2.ID == TID_67DEGppS)) || (_local2.ID == TID_67DEGnpS)) {
eD = EID_INTERESTING;
} else if ((0 < (_local2.signy * 1)) || (_local2.ID == TID_FULL)) {
eD = EID_SOLID;
} else {
eD = EID_OFF;
}
} else if (_local2.ID == TID_FULL) {
eD = EID_OFF;
} else if (_local2.ID == TID_EMPTY) {
eD = EID_OFF;
} else if ((((_local2.signy * 1) <= 0) || (_local2.ID == TID_67DEGppS)) || (_local2.ID == TID_67DEGnpS)) {
eD = EID_INTERESTING;
} else {
eD = EID_OFF;
}
_local2 = nR;
if (ID == TID_EMPTY) {
if (_local2.ID == TID_EMPTY) {
eR = EID_OFF;
} else if (_local2.ID == TID_FULL) {
eR = EID_SOLID;
} else if ((((_local2.signx * 1) <= 0) || (_local2.ID == TID_22DEGpnS)) || (_local2.ID == TID_22DEGppS)) {
eR = EID_INTERESTING;
} else {
eR = EID_SOLID;
}
} else if (ID == TID_FULL) {
if (_local2.ID == TID_FULL) {
eR = EID_OFF;
} else if (_local2.ID == TID_EMPTY) {
eR = EID_OFF;
} else if ((((_local2.signx * 1) <= 0) || (_local2.ID == TID_22DEGpnS)) || (_local2.ID == TID_22DEGppS)) {
eR = EID_INTERESTING;
} else {
eR = EID_OFF;
}
} else if (0 <= (signx * 1)) {
if (_local2.ID == TID_EMPTY) {
eR = EID_OFF;
} else if (_local2.ID == TID_FULL) {
eR = EID_SOLID;
} else if ((((_local2.signx * 1) <= 0) || (_local2.ID == TID_22DEGpnS)) || (_local2.ID == TID_22DEGppS)) {
eR = EID_INTERESTING;
} else {
eR = EID_SOLID;
}
} else if ((ID == TID_22DEGnnS) || (ID == TID_22DEGnpS)) {
if (_local2.ID == TID_EMPTY) {
eR = EID_OFF;
} else if (_local2.ID == TID_FULL) {
eR = EID_SOLID;
} else if ((((_local2.signx * 1) <= 0) || (_local2.ID == TID_22DEGpnS)) || (_local2.ID == TID_22DEGppS)) {
eR = EID_INTERESTING;
} else if ((_local2.ID == TID_FULL) || (0 < (_local2.signx * 1))) {
eR = EID_SOLID;
} else {
eR = EID_OFF;
}
} else if (_local2.ID == TID_FULL) {
eR = EID_OFF;
} else if (_local2.ID == TID_EMPTY) {
eR = EID_OFF;
} else if ((((_local2.signx * 1) <= 0) || (_local2.ID == TID_22DEGpnS)) || (_local2.ID == TID_22DEGppS)) {
eR = EID_INTERESTING;
} else {
eR = EID_OFF;
}
_local2 = nL;
if (ID == TID_EMPTY) {
if (_local2.ID == TID_EMPTY) {
eL = EID_OFF;
} else if (_local2.ID == TID_FULL) {
eL = EID_SOLID;
} else if ((((_local2.signx * -1) <= 0) || (_local2.ID == TID_22DEGnnS)) || (_local2.ID == TID_22DEGnpS)) {
eL = EID_INTERESTING;
} else {
eL = EID_SOLID;
}
} else if (ID == TID_FULL) {
if (_local2.ID == TID_FULL) {
eL = EID_OFF;
} else if (_local2.ID == TID_EMPTY) {
eL = EID_OFF;
} else if ((((_local2.signx * -1) <= 0) || (_local2.ID == TID_22DEGnnS)) || (_local2.ID == TID_22DEGnpS)) {
eL = EID_INTERESTING;
} else {
eL = EID_OFF;
}
} else if (0 <= (signx * -1)) {
if (_local2.ID == TID_EMPTY) {
eL = EID_OFF;
} else if (_local2.ID == TID_FULL) {
eL = EID_SOLID;
} else if ((((_local2.signx * -1) <= 0) || (_local2.ID == TID_22DEGnnS)) || (_local2.ID == TID_22DEGnpS)) {
eL = EID_INTERESTING;
} else {
eL = EID_SOLID;
}
} else if ((ID == TID_22DEGpnS) || (ID == TID_22DEGppS)) {
if (_local2.ID == TID_EMPTY) {
eL = EID_OFF;
} else if (_local2.ID == TID_FULL) {
eL = EID_SOLID;
} else if ((((_local2.signx * -1) <= 0) || (_local2.ID == TID_22DEGnnS)) || (_local2.ID == TID_22DEGnpS)) {
eL = EID_INTERESTING;
} else if ((0 < (_local2.signx * -1)) || (_local2.ID == TID_FULL)) {
eL = EID_SOLID;
} else {
eL = EID_OFF;
}
} else if (_local2.ID == TID_FULL) {
eL = EID_OFF;
} else if (_local2.ID == TID_EMPTY) {
eL = EID_OFF;
} else if ((((_local2.signx * -1) <= 0) || (_local2.ID == TID_22DEGnnS)) || (_local2.ID == TID_22DEGnpS)) {
eL = EID_INTERESTING;
} else {
eL = EID_OFF;
}
Draw();
}
function InsertObj(obj) {
obj.next = next;
obj.prev = this;
prev = null;
if (next != null) {
next.prev = obj;
}
next = obj;
objcounter++;
}
function RemoveObj(obj) {
obj.prev.next = obj.next;
if (obj.next != null) {
obj.next.prev = obj.prev;
}
obj.next = null;
obj.prev = null;
objcounter--;
}
static var TID_EMPTY = 0;
static var TID_FULL = 1;
static var TID_45DEGpn = 2;
static var TID_45DEGnn = 3;
static var TID_45DEGnp = 4;
static var TID_45DEGpp = 5;
static var TID_CONCAVEpn = 6;
static var TID_CONCAVEnn = 7;
static var TID_CONCAVEnp = 8;
static var TID_CONCAVEpp = 9;
static var TID_CONVEXpn = 10;
static var TID_CONVEXnn = 11;
static var TID_CONVEXnp = 12;
static var TID_CONVEXpp = 13;
static var TID_22DEGpnS = 14;
static var TID_22DEGnnS = 15;
static var TID_22DEGnpS = 16;
static var TID_22DEGppS = 17;
static var TID_22DEGpnB = 18;
static var TID_22DEGnnB = 19;
static var TID_22DEGnpB = 20;
static var TID_22DEGppB = 21;
static var TID_67DEGpnS = 22;
static var TID_67DEGnnS = 23;
static var TID_67DEGnpS = 24;
static var TID_67DEGppS = 25;
static var TID_67DEGpnB = 26;
static var TID_67DEGnnB = 27;
static var TID_67DEGnpB = 28;
static var TID_67DEGppB = 29;
static var TID_HALFd = 30;
static var TID_HALFr = 31;
static var TID_HALFu = 32;
static var TID_HALFl = 33;
static var CTYPE_EMPTY = 0;
static var CTYPE_FULL = 1;
static var CTYPE_45DEG = 2;
static var CTYPE_CONCAVE = 6;
static var CTYPE_CONVEX = 10;
static var CTYPE_22DEGs = 14;
static var CTYPE_22DEGb = 18;
static var CTYPE_67DEGs = 22;
static var CTYPE_67DEGb = 26;
static var CTYPE_HALF = 30;
static var EID_OFF = 0;
static var EID_INTERESTING = 1;
static var EID_SOLID = 2;
}
Symbol 628 MovieClip [__Packages.N.tile.MapLoader] Frame 0
class N.tile.MapLoader
{
var CUR_CHAR, NUM_ROWS, NUM_COLS, CUR_COL, CUR_ROW, mapStr;
function MapLoader () {
Init(N.NEngine.tiles);
}
function Init(tiles) {
CUR_CHAR = 0;
NUM_ROWS = tiles.cols;
NUM_COLS = tiles.rows;
CUR_COL = 0;
CUR_ROW = 0;
mapStr = "";
}
function Load(str) {
Init(N.NEngine.tiles);
mapStr = str;
}
function Loading() {
var _local2 = N.NEngine.tiles;
if (NUM_ROWS <= CUR_ROW) {
CUR_COL++;
CUR_ROW = 0;
}
if (NUM_COLS <= CUR_COL) {
return(false);
}
_local2.SetTileState(CUR_COL, CUR_ROW, mapStr.charCodeAt(CUR_CHAR));
CUR_CHAR++;
CUR_ROW++;
return(true);
}
}
Symbol 629 MovieClip [__Packages.N.standard.InputManager] Frame 0
class N.standard.InputManager
{
var vrend, mPos, mOldpos, mDelta, mDownPos, mUpPos, onMouseDown, onMouseUp, mState, mOldState, mPressed, mReleased, kCode, kState, kOldState, tKey, tState;
function InputManager () {
vrend = new N.standard.VectorRenderer();
mPos = new N.standard.Vector2(vrend.buffer._xmouse, vrend.buffer._ymouse);
mOldpos = new N.standard.Vector2(vrend.buffer._xmouse, vrend.buffer._ymouse);
mDelta = new N.standard.Vector2(0, 0);
mDownPos = new N.standard.Vector2(0, 0);
mUpPos = new N.standard.Vector2(0, 0);
onMouseDown = CaptureMouseDown;
onMouseUp = CaptureMouseUp;
Mouse.addListener(this);
mState = false;
mOldState = false;
mPressed = false;
mReleased = false;
kCode = new Array();
kState = new Array();
kOldState = new Array();
tKey = new Array();
tState = new Array();
}
function RegisterKey(knum) {
var _local2 = kCode.length;
kCode.push(knum);
kState[_local2] = false;
kOldState[_local2] = false;
return(_local2);
}
function RegisterToggle(knum) {
var _local2 = tKey.length;
tKey.push(RegisterKey(knum));
tState[_local2] = false;
return(_local2);
}
function Update() {
mOldpos.x = mPos.x;
mOldpos.y = mPos.y;
mPos.x = vrend.buffer._xmouse;
mPos.y = vrend.buffer._ymouse;
mDelta.x = mPos.x - mOldpos.x;
mDelta.y = mPos.y - mOldpos.y;
if (mState && (!mOldState)) {
mPressed = true;
mOldState = true;
mDownPos.x = mPos.x;
mDownPos.y = mPos.y;
} else {
mPressed = false;
}
if ((!mState) && (mOldState)) {
mReleased = true;
mOldState = false;
mUpPos.x = mPos.x;
mUpPos.y = mPos.y;
} else {
mReleased = false;
}
if (mState) {
mUpPos.x = mPos.x;
mUpPos.y = mPos.y;
}
var _local2 = 0;
while (_local2 < kCode.length) {
kOldState[_local2] = Key.isDown(kCode[_local2]);
_local2++;
}
var _local3 = kOldState;
kOldState = kState;
kState = _local3;
_local2 = 0;
while (_local2 < tKey.length) {
if (Pressed(tKey[_local2])) {
tState[_local2] = !tState[_local2];
}
_local2++;
}
}
function CaptureMouseDown() {
mOldState = false;
mState = true;
}
function CaptureMouseUp() {
mOldState = true;
mState = false;
}
function getMousePos() {
return(mPos.clone());
}
function getMouseDelta() {
return(mDelta.clone());
}
function getMouseDragDelta() {
return(mUpPos.minus(mDownPos));
}
function getMouseDownPos() {
return(mDownPos.clone());
}
function getMouseUpPos() {
return(mUpPos.clone());
}
function MousePressed() {
return(mPressed);
}
function MouseReleased() {
return(mReleased);
}
function MouseDown() {
return(mState);
}
function Down(knum) {
return(kState[knum]);
}
function Pressed(knum) {
return(kState[knum] && (!kOldState[knum]));
}
function Released(knum) {
return((!kState[knum]) && (kOldState[knum]));
}
function Toggled(tnum) {
return(tState[tnum]);
}
}
Symbol 630 MovieClip [__Packages.N.collision.ResolveCollision] Frame 0
class N.collision.ResolveCollision
{
static var Proj_AABBTile, Proj_CircleTile;
function ResolveCollision () {
}
static function init() {
Proj_AABBTile = new Object();
Proj_AABBTile[N.tile.TileCell.CTYPE_FULL] = ProjAABB_Full;
Proj_AABBTile[N.tile.TileCell.CTYPE_45DEG] = ProjAABB_45Deg;
Proj_AABBTile[N.tile.TileCell.CTYPE_CONCAVE] = ProjAABB_Concave;
Proj_AABBTile[N.tile.TileCell.CTYPE_CONVEX] = ProjAABB_Convex;
Proj_AABBTile[N.tile.TileCell.CTYPE_22DEGs] = ProjAABB_22DegS;
Proj_AABBTile[N.tile.TileCell.CTYPE_22DEGb] = ProjAABB_22DegB;
Proj_AABBTile[N.tile.TileCell.CTYPE_67DEGs] = ProjAABB_67DegS;
Proj_AABBTile[N.tile.TileCell.CTYPE_67DEGb] = ProjAABB_67DegB;
Proj_AABBTile[N.tile.TileCell.CTYPE_HALF] = ProjAABB_Half;
Proj_CircleTile = new Object();
Proj_CircleTile[N.tile.TileCell.CTYPE_FULL] = ProjCircle_Full;
Proj_CircleTile[N.tile.TileCell.CTYPE_45DEG] = ProjCircle_45Deg;
Proj_CircleTile[N.tile.TileCell.CTYPE_CONCAVE] = ProjCircle_Concave;
Proj_CircleTile[N.tile.TileCell.CTYPE_CONVEX] = ProjCircle_Convex;
Proj_CircleTile[N.tile.TileCell.CTYPE_22DEGs] = ProjCircle_22DegS;
Proj_CircleTile[N.tile.TileCell.CTYPE_22DEGb] = ProjCircle_22DegB;
Proj_CircleTile[N.tile.TileCell.CTYPE_67DEGs] = ProjCircle_67DegS;
Proj_CircleTile[N.tile.TileCell.CTYPE_67DEGb] = ProjCircle_67DegB;
Proj_CircleTile[N.tile.TileCell.CTYPE_HALF] = ProjCircle_Half;
}
static function ProjCircle_Full(x, y, oH, oV, obj, t) {
if (oH == 0) {
if (oV == 0) {
if (x < y) {
var _local4 = obj.pos.x - t.pos.x;
if (_local4 < 0) {
obj.ReportCollisionVsWorld(-x, 0, -1, 0, t);
return(COL_AXIS);
}
obj.ReportCollisionVsWorld(x, 0, 1, 0, t);
return(COL_AXIS);
}
var _local3 = obj.pos.y - t.pos.y;
if (_local3 < 0) {
obj.ReportCollisionVsWorld(0, -y, 0, -1, t);
return(COL_AXIS);
}
obj.ReportCollisionVsWorld(0, y, 0, 1, t);
return(COL_AXIS);
}
obj.ReportCollisionVsWorld(0, y * oV, 0, oV, t);
return(COL_AXIS);
}
if (oV == 0) {
obj.ReportCollisionVsWorld(x * oH, 0, oH, 0, t);
return(COL_AXIS);
}
var _local12 = t.pos.x + (oH * t.xw);
var _local11 = t.pos.y + (oV * t.yw);
var _local4 = obj.pos.x - _local12;
var _local3 = obj.pos.y - _local11;
var _local5 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
var _local7 = obj.r - _local5;
if (0 < _local7) {
if (_local5 == 0) {
_local4 = oH / Math.SQRT2;
_local3 = oV / Math.SQRT2;
} else {
_local4 = _local4 / _local5;
_local3 = _local3 / _local5;
}
obj.ReportCollisionVsWorld(_local4 * _local7, _local3 * _local7, _local4, _local3, t);
return(COL_OTHER);
}
return(COL_NONE);
}
static function ProjCircle_Half(x, y, oH, oV, obj, t) {
var _local7 = t.signx;
var _local13 = t.signy;
var _local17 = (oH * _local7) + (oV * _local13);
if (0 < _local17) {
return(COL_NONE);
}
if (oH == 0) {
if (oV == 0) {
var _local23 = obj.r;
var _local21 = (obj.pos.x - (_local7 * _local23)) - t.pos.x;
var _local20 = (obj.pos.y - (_local13 * _local23)) - t.pos.y;
var _local9 = _local7;
var _local8 = _local13;
var _local16 = (_local21 * _local9) + (_local20 * _local8);
if (_local16 < 0) {
_local9 = _local9 * (-_local16);
_local8 = _local8 * (-_local16);
var _local22 = Math.sqrt((_local9 * _local9) + (_local8 * _local8));
var _local15 = Math.sqrt((x * x) + (y * y));
if (_local15 < _local22) {
obj.ReportCollisionVsWorld(x, y, x / _local15, y / _local15, t);
return(COL_AXIS);
}
obj.ReportCollisionVsWorld(_local9, _local8, t.signx, t.signy);
return(COL_OTHER);
}
} else if (_local17 == 0) {
var _local23 = obj.r;
var _local6 = obj.pos.x - t.pos.x;
if ((_local6 * _local7) < 0) {
obj.ReportCollisionVsWorld(0, y * oV, 0, oV, t);
return(COL_AXIS);
}
var _local5 = obj.pos.y - (t.pos.y + (oV * t.yw));
var _local10 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
var _local14 = obj.r - _local10;
if (0 < _local14) {
if (_local10 == 0) {
_local6 = _local7 / Math.SQRT2;
_local5 = oV / Math.SQRT2;
} else {
_local6 = _local6 / _local10;
_local5 = _local5 / _local10;
}
obj.ReportCollisionVsWorld(_local6 * _local14, _local5 * _local14, _local6, _local5, t);
return(COL_OTHER);
}
} else {
obj.ReportCollisionVsWorld(0, y * oV, 0, oV, t);
return(COL_AXIS);
}
} else {
if (oV == 0) {
if (_local17 == 0) {
var _local23 = obj.r;
var _local5 = obj.pos.y - t.pos.y;
if ((_local5 * _local13) < 0) {
obj.ReportCollisionVsWorld(x * oH, 0, oH, 0, t);
return(COL_AXIS);
}
var _local6 = obj.pos.x - (t.pos.x + (oH * t.xw));
var _local10 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
var _local14 = obj.r - _local10;
if (0 < _local14) {
if (_local10 == 0) {
_local6 = _local7 / Math.SQRT2;
_local5 = oV / Math.SQRT2;
} else {
_local6 = _local6 / _local10;
_local5 = _local5 / _local10;
}
obj.ReportCollisionVsWorld(_local6 * _local14, _local5 * _local14, _local6, _local5, t);
return(COL_OTHER);
}
// unexpected jump
}
obj.ReportCollisionVsWorld(x * oH, 0, oH, 0, t);
return(COL_AXIS);
}
var _local19 = t.pos.x + (oH * t.xw);
var _local18 = t.pos.y + (oV * t.yw);
var _local6 = obj.pos.x - _local19;
var _local5 = obj.pos.y - _local18;
var _local10 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
var _local14 = obj.r - _local10;
if (0 < _local14) {
if (_local10 == 0) {
_local6 = oH / Math.SQRT2;
_local5 = oV / Math.SQRT2;
} else {
_local6 = _local6 / _local10;
_local5 = _local5 / _local10;
}
obj.ReportCollisionVsWorld(_local6 * _local14, _local5 * _local14, _local6, _local5, t);
return(COL_OTHER);
}
}
return(COL_NONE);
}
static function ProjCircle_45Deg(x, y, oH, oV, obj, t) {
var _local12 = t.signx;
var _local11 = t.signy;
var _local16;
if (oH == 0) {
if (oV == 0) {
var _local15 = t.sx;
var _local14 = t.sy;
var _local4 = (obj.pos.x - (_local15 * obj.r)) - t.pos.x;
var _local3 = (obj.pos.y - (_local14 * obj.r)) - t.pos.y;
var _local21 = (_local4 * _local15) + (_local3 * _local14);
if (_local21 < 0) {
_local15 = _local15 * (-_local21);
_local14 = _local14 * (-_local21);
if (x < y) {
_local16 = x;
y = 0;
if ((obj.pos.x - t.pos.x) < 0) {
x = x * -1;
}
} else {
_local16 = y;
x = 0;
if ((obj.pos.y - t.pos.y) < 0) {
y = y * -1;
}
}
var _local22 = Math.sqrt((_local15 * _local15) + (_local14 * _local14));
if (_local16 < _local22) {
obj.ReportCollisionVsWorld(x, y, x / _local16, y / _local16, t);
return(COL_AXIS);
}
obj.ReportCollisionVsWorld(_local15, _local14, t.sx, t.sy, t);
return(COL_OTHER);
}
} else {
if ((_local11 * oV) < 0) {
obj.ReportCollisionVsWorld(0, y * oV, 0, oV, t);
return(COL_AXIS);
}
var _local15 = t.sx;
var _local14 = t.sy;
var _local4 = obj.pos.x - (t.pos.x - (_local12 * t.xw));
var _local3 = obj.pos.y - (t.pos.y + (oV * t.yw));
var _local18 = (_local4 * (-_local14)) + (_local3 * _local15);
if (0 < ((_local18 * _local12) * _local11)) {
var _local13 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
var _local17 = obj.r - _local13;
if (0 < _local17) {
_local4 = _local4 / _local13;
_local3 = _local3 / _local13;
obj.ReportCollisionVsWorld(_local4 * _local17, _local3 * _local17, _local4, _local3, t);
return(COL_OTHER);
}
} else {
var _local21 = (_local4 * _local15) + (_local3 * _local14);
var _local17 = obj.r - Math.abs(_local21);
if (0 < _local17) {
obj.ReportCollisionVsWorld(_local15 * _local17, _local14 * _local17, _local15, _local14, t);
return(COL_OTHER);
}
}
}
} else if (oV == 0) {
if ((_local12 * oH) < 0) {
obj.ReportCollisionVsWorld(x * oH, 0, oH, 0, t);
return(COL_AXIS);
}
var _local15 = t.sx;
var _local14 = t.sy;
var _local4 = obj.pos.x - (t.pos.x + (oH * t.xw));
var _local3 = obj.pos.y - (t.pos.y - (_local11 * t.yw));
var _local18 = (_local4 * (-_local14)) + (_local3 * _local15);
if (((_local18 * _local12) * _local11) < 0) {
var _local13 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
var _local17 = obj.r - _local13;
if (0 < _local17) {
_local4 = _local4 / _local13;
_local3 = _local3 / _local13;
obj.ReportCollisionVsWorld(_local4 * _local17, _local3 * _local17, _local4, _local3, t);
return(COL_OTHER);
}
} else {
var _local21 = (_local4 * _local15) + (_local3 * _local14);
var _local17 = obj.r - Math.abs(_local21);
if (0 < _local17) {
obj.ReportCollisionVsWorld(_local15 * _local17, _local14 * _local17, _local15, _local14, t);
return(COL_OTHER);
}
}
} else {
if (0 < ((_local12 * oH) + (_local11 * oV))) {
return(COL_NONE);
}
var _local20 = t.pos.x + (oH * t.xw);
var _local19 = t.pos.y + (oV * t.yw);
var _local7 = obj.pos.x - _local20;
var _local6 = obj.pos.y - _local19;
var _local13 = Math.sqrt((_local7 * _local7) + (_local6 * _local6));
var _local17 = obj.r - _local13;
if (0 < _local17) {
if (_local13 == 0) {
_local7 = oH / Math.SQRT2;
_local6 = oV / Math.SQRT2;
} else {
_local7 = _local7 / _local13;
_local6 = _local6 / _local13;
}
obj.ReportCollisionVsWorld(_local7 * _local17, _local6 * _local17, _local7, _local6, t);
return(COL_OTHER);
}
}
return(COL_NONE);
}
static function ProjCircle_Concave(x, y, oH, oV, obj, t) {
var _local14 = t.signx;
var _local13 = t.signy;
var _local12;
if (oH == 0) {
if (oV == 0) {
var _local8 = (t.pos.x + (_local14 * t.xw)) - obj.pos.x;
var _local7 = (t.pos.y + (_local13 * t.yw)) - obj.pos.y;
var _local16 = t.xw * 2;
var _local19 = Math.sqrt((_local16 * _local16) + 0);
var _local11 = Math.sqrt((_local8 * _local8) + (_local7 * _local7));
var _local15 = (_local11 + obj.r) - _local19;
if (0 < _local15) {
if (x < y) {
_local12 = x;
y = 0;
if ((obj.pos.x - t.pos.x) < 0) {
x = x * -1;
}
} else {
_local12 = y;
x = 0;
if ((obj.pos.y - t.pos.y) < 0) {
y = y * -1;
}
}
if (_local12 < _local15) {
obj.ReportCollisionVsWorld(x, y, x / _local12, y / _local12, t);
return(COL_AXIS);
}
_local8 = _local8 / _local11;
_local7 = _local7 / _local11;
obj.ReportCollisionVsWorld(_local8 * _local15, _local7 * _local15, _local8, _local7, t);
return(COL_OTHER);
}
return(COL_NONE);
}
if ((_local13 * oV) < 0) {
obj.ReportCollisionVsWorld(0, y * oV, 0, oV, t);
return(COL_AXIS);
}
var _local18 = t.pos.x - (_local14 * t.xw);
var _local17 = t.pos.y + (oV * t.yw);
var _local6 = obj.pos.x - _local18;
var _local5 = obj.pos.y - _local17;
var _local11 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
var _local15 = obj.r - _local11;
if (0 < _local15) {
if (_local11 == 0) {
_local6 = 0;
_local5 = oV;
} else {
_local6 = _local6 / _local11;
_local5 = _local5 / _local11;
}
obj.ReportCollisionVsWorld(_local6 * _local15, _local5 * _local15, _local6, _local5, t);
return(COL_OTHER);
}
} else if (oV == 0) {
if ((_local14 * oH) < 0) {
obj.ReportCollisionVsWorld(x * oH, 0, oH, 0, t);
return(COL_AXIS);
}
var _local18 = t.pos.x + (oH * t.xw);
var _local17 = t.pos.y - (_local13 * t.yw);
var _local6 = obj.pos.x - _local18;
var _local5 = obj.pos.y - _local17;
var _local11 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
var _local15 = obj.r - _local11;
if (0 < _local15) {
if (_local11 == 0) {
_local6 = oH;
_local5 = 0;
} else {
_local6 = _local6 / _local11;
_local5 = _local5 / _local11;
}
obj.ReportCollisionVsWorld(_local6 * _local15, _local5 * _local15, _local6, _local5, t);
return(COL_OTHER);
}
} else {
if (0 < ((_local14 * oH) + (_local13 * oV))) {
return(COL_NONE);
}
var _local18 = t.pos.x + (oH * t.xw);
var _local17 = t.pos.y + (oV * t.yw);
var _local6 = obj.pos.x - _local18;
var _local5 = obj.pos.y - _local17;
var _local11 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
var _local15 = obj.r - _local11;
if (0 < _local15) {
if (_local11 == 0) {
_local6 = oH / Math.SQRT2;
_local5 = oV / Math.SQRT2;
} else {
_local6 = _local6 / _local11;
_local5 = _local5 / _local11;
}
obj.ReportCollisionVsWorld(_local6 * _local15, _local5 * _local15, _local6, _local5, t);
return(COL_OTHER);
}
}
return(COL_NONE);
}
static function ProjCircle_Convex(x, y, oH, oV, obj, t) {
var _local7 = t.signx;
var _local6 = t.signy;
var _local14;
if (oH == 0) {
if (oV == 0) {
var _local9 = obj.pos.x - (t.pos.x - (_local7 * t.xw));
var _local8 = obj.pos.y - (t.pos.y - (_local6 * t.yw));
var _local16 = t.xw * 2;
var _local19 = Math.sqrt((_local16 * _local16) + 0);
var _local13 = Math.sqrt((_local9 * _local9) + (_local8 * _local8));
var _local15 = (_local19 + obj.r) - _local13;
if (0 < _local15) {
if (x < y) {
_local14 = x;
y = 0;
if ((obj.pos.x - t.pos.x) < 0) {
x = x * -1;
}
} else {
_local14 = y;
x = 0;
if ((obj.pos.y - t.pos.y) < 0) {
y = y * -1;
}
}
if (_local14 < _local15) {
obj.ReportCollisionVsWorld(x, y, x / _local14, y / _local14, t);
return(COL_AXIS);
}
_local9 = _local9 / _local13;
_local8 = _local8 / _local13;
obj.ReportCollisionVsWorld(_local9 * _local15, _local8 * _local15, _local9, _local8, t);
return(COL_OTHER);
}
} else {
if ((_local6 * oV) < 0) {
obj.ReportCollisionVsWorld(0, y * oV, 0, oV, t);
return(COL_AXIS);
}
var _local9 = obj.pos.x - (t.pos.x - (_local7 * t.xw));
var _local8 = obj.pos.y - (t.pos.y - (_local6 * t.yw));
var _local16 = t.xw * 2;
var _local19 = Math.sqrt((_local16 * _local16) + 0);
var _local13 = Math.sqrt((_local9 * _local9) + (_local8 * _local8));
var _local15 = (_local19 + obj.r) - _local13;
if (0 < _local15) {
_local9 = _local9 / _local13;
_local8 = _local8 / _local13;
obj.ReportCollisionVsWorld(_local9 * _local15, _local8 * _local15, _local9, _local8, t);
return(COL_OTHER);
}
}
} else if (oV == 0) {
if ((_local7 * oH) < 0) {
obj.ReportCollisionVsWorld(x * oH, 0, oH, 0, t);
return(COL_AXIS);
}
var _local9 = obj.pos.x - (t.pos.x - (_local7 * t.xw));
var _local8 = obj.pos.y - (t.pos.y - (_local6 * t.yw));
var _local16 = t.xw * 2;
var _local19 = Math.sqrt((_local16 * _local16) + 0);
var _local13 = Math.sqrt((_local9 * _local9) + (_local8 * _local8));
var _local15 = (_local19 + obj.r) - _local13;
if (0 < _local15) {
_local9 = _local9 / _local13;
_local8 = _local8 / _local13;
obj.ReportCollisionVsWorld(_local9 * _local15, _local8 * _local15, _local9, _local8, t);
return(COL_OTHER);
}
} else if (0 < ((_local7 * oH) + (_local6 * oV))) {
var _local9 = obj.pos.x - (t.pos.x - (_local7 * t.xw));
var _local8 = obj.pos.y - (t.pos.y - (_local6 * t.yw));
var _local16 = t.xw * 2;
var _local19 = Math.sqrt((_local16 * _local16) + 0);
var _local13 = Math.sqrt((_local9 * _local9) + (_local8 * _local8));
var _local15 = (_local19 + obj.r) - _local13;
if (0 < _local15) {
_local9 = _local9 / _local13;
_local8 = _local8 / _local13;
obj.ReportCollisionVsWorld(_local9 * _local15, _local8 * _local15, _local9, _local8, t);
return(COL_OTHER);
}
} else {
var _local18 = t.pos.x + (oH * t.xw);
var _local17 = t.pos.y + (oV * t.yw);
var _local4 = obj.pos.x - _local18;
var _local3 = obj.pos.y - _local17;
var _local13 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
var _local15 = obj.r - _local13;
if (0 < _local15) {
if (_local13 == 0) {
_local4 = oH / Math.SQRT2;
_local3 = oV / Math.SQRT2;
} else {
_local4 = _local4 / _local13;
_local3 = _local3 / _local13;
}
obj.ReportCollisionVsWorld(_local4 * _local15, _local3 * _local15, _local4, _local3, t);
return(COL_OTHER);
}
}
return(COL_NONE);
}
static function ProjCircle_22DegS(x, y, oH, oV, obj, t) {
var _local12 = t.signx;
var _local11 = t.signy;
var _local16;
if (0 < (_local11 * oV)) {
return(COL_NONE);
}
if (oH == 0) {
if (oV == 0) {
var _local15 = t.sx;
var _local14 = t.sy;
var _local17 = obj.r;
var _local4 = obj.pos.x - (t.pos.x - (_local12 * t.xw));
var _local3 = obj.pos.y - t.pos.y;
var _local19 = (_local4 * (-_local14)) + (_local3 * _local15);
if (0 < ((_local19 * _local12) * _local11)) {
var _local13 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
var _local18 = _local17 - _local13;
if (0 < _local18) {
_local4 = _local4 / _local13;
_local3 = _local3 / _local13;
obj.ReportCollisionVsWorld(_local4 * _local18, _local3 * _local18, _local4, _local3, t);
return(COL_OTHER);
}
} else {
_local4 = _local4 - (_local17 * _local15);
_local3 = _local3 - (_local17 * _local14);
var _local22 = (_local4 * _local15) + (_local3 * _local14);
if (_local22 < 0) {
_local15 = _local15 * (-_local22);
_local14 = _local14 * (-_local22);
var _local23 = Math.sqrt((_local15 * _local15) + (_local14 * _local14));
if (x < y) {
_local16 = x;
y = 0;
if ((obj.pos.x - t.pos.x) < 0) {
x = x * -1;
}
} else {
_local16 = y;
x = 0;
if ((obj.pos.y - t.pos.y) < 0) {
y = y * -1;
}
}
if (_local16 < _local23) {
obj.ReportCollisionVsWorld(x, y, x / _local16, y / _local16, t);
return(COL_AXIS);
}
obj.ReportCollisionVsWorld(_local15, _local14, t.sx, t.sy, t);
return(COL_OTHER);
}
}
// unexpected jump
}
obj.ReportCollisionVsWorld(0, y * oV, 0, oV, t);
return(COL_AXIS);
}
if (oV == 0) {
if ((_local12 * oH) < 0) {
var _local21 = t.pos.x - (_local12 * t.xw);
var _local20 = t.pos.y;
var _local6 = obj.pos.x - _local21;
var _local5 = obj.pos.y - _local20;
if ((_local5 * _local11) < 0) {
obj.ReportCollisionVsWorld(x * oH, 0, oH, 0, t);
return(COL_AXIS);
}
var _local13 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
var _local18 = obj.r - _local13;
if (0 < _local18) {
if (_local13 == 0) {
_local6 = oH / Math.SQRT2;
_local5 = oV / Math.SQRT2;
} else {
_local6 = _local6 / _local13;
_local5 = _local5 / _local13;
}
obj.ReportCollisionVsWorld(_local6 * _local18, _local5 * _local18, _local6, _local5, t);
return(COL_OTHER);
}
} else {
var _local15 = t.sx;
var _local14 = t.sy;
var _local4 = obj.pos.x - (t.pos.x + (oH * t.xw));
var _local3 = obj.pos.y - (t.pos.y - (_local11 * t.yw));
var _local19 = (_local4 * (-_local14)) + (_local3 * _local15);
if (((_local19 * _local12) * _local11) < 0) {
var _local13 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
var _local18 = obj.r - _local13;
if (0 < _local18) {
_local4 = _local4 / _local13;
_local3 = _local3 / _local13;
obj.ReportCollisionVsWorld(_local4 * _local18, _local3 * _local18, _local4, _local3, t);
return(COL_OTHER);
}
} else {
var _local22 = (_local4 * _local15) + (_local3 * _local14);
var _local18 = obj.r - Math.abs(_local22);
if (0 < _local18) {
obj.ReportCollisionVsWorld(_local15 * _local18, _local14 * _local18, _local15, _local14, t);
return(COL_OTHER);
}
}
}
} else {
var _local21 = t.pos.x + (oH * t.xw);
var _local20 = t.pos.y + (oV * t.yw);
var _local6 = obj.pos.x - _local21;
var _local5 = obj.pos.y - _local20;
var _local13 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
var _local18 = obj.r - _local13;
if (0 < _local18) {
if (_local13 == 0) {
_local6 = oH / Math.SQRT2;
_local5 = oV / Math.SQRT2;
} else {
_local6 = _local6 / _local13;
_local5 = _local5 / _local13;
}
obj.ReportCollisionVsWorld(_local6 * _local18, _local5 * _local18, _local6, _local5, t);
return(COL_OTHER);
}
}
return(COL_NONE);
}
static function ProjCircle_22DegB(x, y, oH, oV, obj, t) {
var _local4 = t.signx;
var _local3 = t.signy;
var _local12;
if (oH == 0) {
if (oV == 0) {
var _local14 = t.sx;
var _local13 = t.sy;
var _local17 = obj.r;
var _local23 = (obj.pos.x - (_local14 * _local17)) - (t.pos.x - (_local4 * t.xw));
var _local22 = (obj.pos.y - (_local13 * _local17)) - (t.pos.y + (_local3 * t.yw));
var _local16 = (_local23 * _local14) + (_local22 * _local13);
if (_local16 < 0) {
_local14 = _local14 * (-_local16);
_local13 = _local13 * (-_local16);
var _local24 = Math.sqrt((_local14 * _local14) + (_local13 * _local13));
if (x < y) {
_local12 = x;
y = 0;
if ((obj.pos.x - t.pos.x) < 0) {
x = x * -1;
}
} else {
_local12 = y;
x = 0;
if ((obj.pos.y - t.pos.y) < 0) {
y = y * -1;
}
}
if (_local12 < _local24) {
obj.ReportCollisionVsWorld(x, y, x / _local12, y / _local12, t);
return(COL_AXIS);
}
obj.ReportCollisionVsWorld(_local14, _local13, t.sx, t.sy, t);
return(COL_OTHER);
}
} else {
if ((_local3 * oV) < 0) {
obj.ReportCollisionVsWorld(0, y * oV, 0, oV, t);
return(COL_AXIS);
}
var _local14 = t.sx;
var _local13 = t.sy;
var _local23 = obj.pos.x - (t.pos.x - (_local4 * t.xw));
var _local22 = obj.pos.y - (t.pos.y + (_local3 * t.yw));
var _local19 = (_local23 * (-_local13)) + (_local22 * _local14);
if (0 < ((_local19 * _local4) * _local3)) {
var _local11 = Math.sqrt((_local23 * _local23) + (_local22 * _local22));
var _local15 = obj.r - _local11;
if (0 < _local15) {
_local23 = _local23 / _local11;
_local22 = _local22 / _local11;
obj.ReportCollisionVsWorld(_local23 * _local15, _local22 * _local15, _local23, _local22, t);
return(COL_OTHER);
}
} else {
var _local16 = (_local23 * _local14) + (_local22 * _local13);
var _local15 = obj.r - Math.abs(_local16);
if (0 < _local15) {
obj.ReportCollisionVsWorld(_local14 * _local15, _local13 * _local15, _local14, _local13, t);
return(COL_OTHER);
}
}
}
} else if (oV == 0) {
if ((_local4 * oH) < 0) {
obj.ReportCollisionVsWorld(x * oH, 0, oH, 0, t);
return(COL_AXIS);
}
var _local23 = obj.pos.x - (t.pos.x + (_local4 * t.xw));
var _local22 = obj.pos.y - t.pos.y;
if ((_local22 * _local3) < 0) {
obj.ReportCollisionVsWorld(x * oH, 0, oH, 0, t);
return(COL_AXIS);
}
var _local14 = t.sx;
var _local13 = t.sy;
var _local19 = (_local23 * (-_local13)) + (_local22 * _local14);
if (((_local19 * _local4) * _local3) < 0) {
var _local11 = Math.sqrt((_local23 * _local23) + (_local22 * _local22));
var _local15 = obj.r - _local11;
if (0 < _local15) {
_local23 = _local23 / _local11;
_local22 = _local22 / _local11;
obj.ReportCollisionVsWorld(_local23 * _local15, _local22 * _local15, _local23, _local22, t);
return(COL_OTHER);
}
} else {
var _local16 = (_local23 * _local14) + (_local22 * _local13);
var _local15 = obj.r - Math.abs(_local16);
if (0 < _local15) {
obj.ReportCollisionVsWorld(_local14 * _local15, _local13 * _local15, t.sx, t.sy, t);
return(COL_OTHER);
}
}
} else {
if (0 < ((_local4 * oH) + (_local3 * oV))) {
var _local18 = 2.23606797749979;
var _local14 = (_local4 * 1) / _local18;
var _local13 = (_local3 * 2) / _local18;
var _local17 = obj.r;
var _local23 = (obj.pos.x - (_local14 * _local17)) - (t.pos.x - (_local4 * t.xw));
var _local22 = (obj.pos.y - (_local13 * _local17)) - (t.pos.y + (_local3 * t.yw));
var _local16 = (_local23 * _local14) + (_local22 * _local13);
if (_local16 < 0) {
obj.ReportCollisionVsWorld((-_local14) * _local16, (-_local13) * _local16, t.sx, t.sy, t);
return(COL_OTHER);
}
return(COL_NONE);
}
var _local21 = t.pos.x + (oH * t.xw);
var _local20 = t.pos.y + (oV * t.yw);
var _local7 = obj.pos.x - _local21;
var _local6 = obj.pos.y - _local20;
var _local11 = Math.sqrt((_local7 * _local7) + (_local6 * _local6));
var _local15 = obj.r - _local11;
if (0 < _local15) {
if (_local11 == 0) {
_local7 = oH / Math.SQRT2;
_local6 = oV / Math.SQRT2;
} else {
_local7 = _local7 / _local11;
_local6 = _local6 / _local11;
}
obj.ReportCollisionVsWorld(_local7 * _local15, _local6 * _local15, _local7, _local6, t);
return(COL_OTHER);
}
}
return(COL_NONE);
}
static function ProjCircle_67DegS(x, y, oH, oV, obj, t) {
var _local12 = t.signx;
var _local11 = t.signy;
var _local14;
if (0 < (_local12 * oH)) {
return(COL_NONE);
}
if (oH == 0) {
if (oV == 0) {
var _local17 = t.sx;
var _local15 = t.sy;
var _local16 = obj.r;
var _local4 = obj.pos.x - t.pos.x;
var _local3 = obj.pos.y - (t.pos.y - (_local11 * t.yw));
var _local19 = (_local4 * (-_local15)) + (_local3 * _local17);
if (((_local19 * _local12) * _local11) < 0) {
var _local13 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
var _local18 = _local16 - _local13;
if (0 < _local18) {
_local4 = _local4 / _local13;
_local3 = _local3 / _local13;
obj.ReportCollisionVsWorld(_local4 * _local18, _local3 * _local18, _local4, _local3, t);
return(COL_OTHER);
}
} else {
_local4 = _local4 - (_local16 * _local17);
_local3 = _local3 - (_local16 * _local15);
var _local22 = (_local4 * _local17) + (_local3 * _local15);
if (_local22 < 0) {
_local17 = _local17 * (-_local22);
_local15 = _local15 * (-_local22);
var _local23 = Math.sqrt((_local17 * _local17) + (_local15 * _local15));
if (x < y) {
_local14 = x;
y = 0;
if ((obj.pos.x - t.pos.x) < 0) {
x = x * -1;
}
} else {
_local14 = y;
x = 0;
if ((obj.pos.y - t.pos.y) < 0) {
y = y * -1;
}
}
if (_local14 < _local23) {
obj.ReportCollisionVsWorld(x, y, x / _local14, y / _local14, t);
return(COL_AXIS);
}
obj.ReportCollisionVsWorld(_local17, _local15, t.sx, t.sy, t);
return(COL_OTHER);
}
}
} else if ((_local11 * oV) < 0) {
var _local21 = t.pos.x;
var _local20 = t.pos.y - (_local11 * t.yw);
var _local7 = obj.pos.x - _local21;
var _local6 = obj.pos.y - _local20;
if ((_local7 * _local12) < 0) {
obj.ReportCollisionVsWorld(0, y * oV, 0, oV, t);
return(COL_AXIS);
}
var _local13 = Math.sqrt((_local7 * _local7) + (_local6 * _local6));
var _local18 = obj.r - _local13;
if (0 < _local18) {
if (_local13 == 0) {
_local7 = oH / Math.SQRT2;
_local6 = oV / Math.SQRT2;
} else {
_local7 = _local7 / _local13;
_local6 = _local6 / _local13;
}
obj.ReportCollisionVsWorld(_local7 * _local18, _local6 * _local18, _local7, _local6, t);
return(COL_OTHER);
}
} else {
var _local17 = t.sx;
var _local15 = t.sy;
var _local4 = obj.pos.x - (t.pos.x - (_local12 * t.xw));
var _local3 = obj.pos.y - (t.pos.y + (oV * t.yw));
var _local19 = (_local4 * (-_local15)) + (_local3 * _local17);
if (0 < ((_local19 * _local12) * _local11)) {
var _local13 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
var _local18 = obj.r - _local13;
if (0 < _local18) {
_local4 = _local4 / _local13;
_local3 = _local3 / _local13;
obj.ReportCollisionVsWorld(_local4 * _local18, _local3 * _local18, _local4, _local3, t);
return(COL_OTHER);
}
} else {
var _local22 = (_local4 * _local17) + (_local3 * _local15);
var _local18 = obj.r - Math.abs(_local22);
if (0 < _local18) {
obj.ReportCollisionVsWorld(_local17 * _local18, _local15 * _local18, t.sx, t.sy, t);
return(COL_OTHER);
}
}
}
} else {
if (oV == 0) {
obj.ReportCollisionVsWorld(x * oH, 0, oH, 0, t);
return(COL_AXIS);
}
var _local21 = t.pos.x + (oH * t.xw);
var _local20 = t.pos.y + (oV * t.yw);
var _local7 = obj.pos.x - _local21;
var _local6 = obj.pos.y - _local20;
var _local13 = Math.sqrt((_local7 * _local7) + (_local6 * _local6));
var _local18 = obj.r - _local13;
if (0 < _local18) {
if (_local13 == 0) {
_local7 = oH / Math.SQRT2;
_local6 = oV / Math.SQRT2;
} else {
_local7 = _local7 / _local13;
_local6 = _local6 / _local13;
}
obj.ReportCollisionVsWorld(_local7 * _local18, _local6 * _local18, _local7, _local6, t);
return(COL_OTHER);
}
}
return(COL_NONE);
}
static function ProjCircle_67DegB(x, y, oH, oV, obj, t) {
var _local4 = t.signx;
var _local3 = t.signy;
var _local12;
if (oH == 0) {
if (oV == 0) {
var _local14 = t.sx;
var _local13 = t.sy;
var _local17 = obj.r;
var _local23 = (obj.pos.x - (_local14 * _local17)) - (t.pos.x + (_local4 * t.xw));
var _local22 = (obj.pos.y - (_local13 * _local17)) - (t.pos.y - (_local3 * t.yw));
var _local16 = (_local23 * _local14) + (_local22 * _local13);
if (_local16 < 0) {
_local14 = _local14 * (-_local16);
_local13 = _local13 * (-_local16);
var _local24 = Math.sqrt((_local14 * _local14) + (_local13 * _local13));
if (x < y) {
_local12 = x;
y = 0;
if ((obj.pos.x - t.pos.x) < 0) {
x = x * -1;
}
} else {
_local12 = y;
x = 0;
if ((obj.pos.y - t.pos.y) < 0) {
y = y * -1;
}
}
if (_local12 < _local24) {
obj.ReportCollisionVsWorld(x, y, x / _local12, y / _local12, t);
return(COL_AXIS);
}
obj.ReportCollisionVsWorld(_local14, _local13, t.sx, t.sy, t);
return(COL_OTHER);
}
} else {
if ((_local3 * oV) < 0) {
obj.ReportCollisionVsWorld(0, y * oV, 0, oV, t);
return(COL_AXIS);
}
var _local23 = obj.pos.x - t.pos.x;
var _local22 = obj.pos.y - (t.pos.y + (_local3 * t.yw));
if ((_local23 * _local4) < 0) {
obj.ReportCollisionVsWorld(0, y * oV, 0, oV, t);
return(COL_AXIS);
}
var _local14 = t.sx;
var _local13 = t.sy;
var _local19 = (_local23 * (-_local13)) + (_local22 * _local14);
if (0 < ((_local19 * _local4) * _local3)) {
var _local11 = Math.sqrt((_local23 * _local23) + (_local22 * _local22));
var _local15 = obj.r - _local11;
if (0 < _local15) {
_local23 = _local23 / _local11;
_local22 = _local22 / _local11;
obj.ReportCollisionVsWorld(_local23 * _local15, _local22 * _local15, _local23, _local22, t);
return(COL_OTHER);
}
} else {
var _local16 = (_local23 * _local14) + (_local22 * _local13);
var _local15 = obj.r - Math.abs(_local16);
if (0 < _local15) {
obj.ReportCollisionVsWorld(_local14 * _local15, _local13 * _local15, _local14, _local13, t);
return(COL_OTHER);
}
}
}
} else if (oV == 0) {
if ((_local4 * oH) < 0) {
obj.ReportCollisionVsWorld(x * oH, 0, oH, 0, t);
return(COL_AXIS);
}
var _local18 = 2.23606797749979;
var _local14 = (_local4 * 2) / _local18;
var _local13 = (_local3 * 1) / _local18;
var _local23 = obj.pos.x - (t.pos.x + (_local4 * t.xw));
var _local22 = obj.pos.y - (t.pos.y - (_local3 * t.yw));
var _local19 = (_local23 * (-_local13)) + (_local22 * _local14);
if (((_local19 * _local4) * _local3) < 0) {
var _local11 = Math.sqrt((_local23 * _local23) + (_local22 * _local22));
var _local15 = obj.r - _local11;
if (0 < _local15) {
_local23 = _local23 / _local11;
_local22 = _local22 / _local11;
obj.ReportCollisionVsWorld(_local23 * _local15, _local22 * _local15, _local23, _local22, t);
return(COL_OTHER);
}
} else {
var _local16 = (_local23 * _local14) + (_local22 * _local13);
var _local15 = obj.r - Math.abs(_local16);
if (0 < _local15) {
obj.ReportCollisionVsWorld(_local14 * _local15, _local13 * _local15, t.sx, t.sy, t);
return(COL_OTHER);
}
}
} else {
if (0 < ((_local4 * oH) + (_local3 * oV))) {
var _local14 = t.sx;
var _local13 = t.sy;
var _local17 = obj.r;
var _local23 = (obj.pos.x - (_local14 * _local17)) - (t.pos.x + (_local4 * t.xw));
var _local22 = (obj.pos.y - (_local13 * _local17)) - (t.pos.y - (_local3 * t.yw));
var _local16 = (_local23 * _local14) + (_local22 * _local13);
if (_local16 < 0) {
obj.ReportCollisionVsWorld((-_local14) * _local16, (-_local13) * _local16, t.sx, t.sy, t);
return(COL_OTHER);
}
return(COL_NONE);
}
var _local21 = t.pos.x + (oH * t.xw);
var _local20 = t.pos.y + (oV * t.yw);
var _local7 = obj.pos.x - _local21;
var _local6 = obj.pos.y - _local20;
var _local11 = Math.sqrt((_local7 * _local7) + (_local6 * _local6));
var _local15 = obj.r - _local11;
if (0 < _local15) {
if (_local11 == 0) {
_local7 = oH / Math.SQRT2;
_local6 = oV / Math.SQRT2;
} else {
_local7 = _local7 / _local11;
_local6 = _local6 / _local11;
}
obj.ReportCollisionVsWorld(_local7 * _local15, _local6 * _local15, _local7, _local6, t);
return(COL_OTHER);
}
}
return(COL_NONE);
}
static function ResolveCircleTile(x, y, oH, oV, obj, t) {
if (0 < t.ID) {
return(Proj_CircleTile[t.CTYPE](x, y, oH, oV, obj, t));
}
return(false);
}
static function ProjAABB_Full(x, y, obj, t) {
var _local1 = Math.sqrt((x * x) + (y * y));
obj.ReportCollisionVsWorld(x, y, x / _local1, y / _local1, t);
return(COL_AXIS);
}
static function ProjAABB_Half(x, y, obj, t) {
var _local3 = t.signx;
var _local2 = t.signy;
var _local10 = (obj.pos.x - (_local3 * obj.xw)) - t.pos.x;
var _local9 = (obj.pos.y - (_local2 * obj.yw)) - t.pos.y;
var _local6 = (_local10 * _local3) + (_local9 * _local2);
if (_local6 < 0) {
_local3 = _local3 * (-_local6);
_local2 = _local2 * (-_local6);
var _local11 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
var _local5 = Math.sqrt((x * x) + (y * y));
if (_local5 < _local11) {
obj.ReportCollisionVsWorld(x, y, x / _local5, y / _local5, t);
return(COL_AXIS);
}
obj.ReportCollisionVsWorld(_local3, _local2, t.signx, t.signy, t);
return(COL_OTHER);
}
return(COL_NONE);
}
static function ProjAABB_Concave(x, y, obj, t) {
var _local12 = t.signx;
var _local11 = t.signy;
var _local3 = (t.pos.x + (_local12 * t.xw)) - (obj.pos.x - (_local12 * obj.xw));
var _local2 = (t.pos.y + (_local11 * t.yw)) - (obj.pos.y - (_local11 * obj.yw));
var _local8 = t.xw * 2;
var _local13 = Math.sqrt((_local8 * _local8) + 0);
var _local6 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
var _local4 = _local6 - _local13;
if (0 < _local4) {
var _local7 = Math.sqrt((x * x) + (y * y));
if (_local7 < _local4) {
obj.ReportCollisionVsWorld(x, y, x / _local7, y / _local7, t);
return(COL_AXIS);
}
_local3 = _local3 / _local6;
_local2 = _local2 / _local6;
obj.ReportCollisionVsWorld(_local3 * _local4, _local2 * _local4, _local3, _local2, t);
return(COL_OTHER);
}
return(COL_NONE);
}
static function ProjAABB_Convex(x, y, obj, t) {
var _local8 = t.signx;
var _local7 = t.signy;
var _local3 = (obj.pos.x - (_local8 * obj.xw)) - (t.pos.x - (_local8 * t.xw));
var _local2 = (obj.pos.y - (_local7 * obj.yw)) - (t.pos.y - (_local7 * t.yw));
var _local5 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
var _local9 = t.xw * 2;
var _local13 = Math.sqrt((_local9 * _local9) + 0);
var _local6 = _local13 - _local5;
if (((_local8 * _local3) < 0) || ((_local7 * _local2) < 0)) {
var _local10 = Math.sqrt((x * x) + (y * y));
obj.ReportCollisionVsWorld(x, y, x / _local10, y / _local10, t);
return(COL_AXIS);
}
if (0 < _local6) {
_local3 = _local3 / _local5;
_local2 = _local2 / _local5;
obj.ReportCollisionVsWorld(_local3 * _local6, _local2 * _local6, _local3, _local2, t);
return(COL_OTHER);
}
return(COL_NONE);
}
static function ProjAABB_45Deg(x, y, obj, t) {
var _local13 = t.signx;
var _local12 = t.signy;
var _local10 = (obj.pos.x - (_local13 * obj.xw)) - t.pos.x;
var _local9 = (obj.pos.y - (_local12 * obj.yw)) - t.pos.y;
var _local3 = t.sx;
var _local2 = t.sy;
var _local6 = (_local10 * _local3) + (_local9 * _local2);
if (_local6 < 0) {
_local3 = _local3 * (-_local6);
_local2 = _local2 * (-_local6);
var _local11 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
var _local5 = Math.sqrt((x * x) + (y * y));
if (_local5 < _local11) {
obj.ReportCollisionVsWorld(x, y, x / _local5, y / _local5, t);
return(COL_AXIS);
}
obj.ReportCollisionVsWorld(_local3, _local2, t.sx, t.sy);
return(COL_OTHER);
}
return(COL_NONE);
}
static function ProjAABB_22DegS(x, y, obj, t) {
var _local13 = t.signx;
var _local8 = t.signy;
var _local14 = obj.pos.y - (_local8 * obj.yw);
var _local3 = t.pos.y - _local14;
if (0 < (_local3 * _local8)) {
var _local16 = (obj.pos.x - (_local13 * obj.xw)) - (t.pos.x + (_local13 * t.xw));
var _local15 = (obj.pos.y - (_local8 * obj.yw)) - (t.pos.y - (_local8 * t.yw));
var _local5 = t.sx;
var _local4 = t.sy;
var _local9 = (_local16 * _local5) + (_local15 * _local4);
if (_local9 < 0) {
_local5 = _local5 * (-_local9);
_local4 = _local4 * (-_local9);
var _local10 = Math.sqrt((_local5 * _local5) + (_local4 * _local4));
var _local7 = Math.sqrt((x * x) + (y * y));
var _local6 = Math.abs(_local3);
if (_local7 < _local10) {
if (_local6 < _local7) {
obj.ReportCollisionVsWorld(0, _local3, 0, _local3 / _local6, t);
return(COL_OTHER);
}
obj.ReportCollisionVsWorld(x, y, x / _local7, y / _local7, t);
return(COL_AXIS);
}
if (_local6 < _local10) {
obj.ReportCollisionVsWorld(0, _local3, 0, _local3 / _local6, t);
return(COL_OTHER);
}
obj.ReportCollisionVsWorld(_local5, _local4, t.sx, t.sy, t);
return(COL_OTHER);
}
}
return(COL_NONE);
}
static function ProjAABB_22DegB(x, y, obj, t) {
var _local10 = t.signx;
var _local9 = t.signy;
var _local12 = (obj.pos.x - (_local10 * obj.xw)) - (t.pos.x - (_local10 * t.xw));
var _local11 = (obj.pos.y - (_local9 * obj.yw)) - (t.pos.y + (_local9 * t.yw));
var _local3 = t.sx;
var _local2 = t.sy;
var _local6 = (_local12 * _local3) + (_local11 * _local2);
if (_local6 < 0) {
_local3 = _local3 * (-_local6);
_local2 = _local2 * (-_local6);
var _local13 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
var _local5 = Math.sqrt((x * x) + (y * y));
if (_local5 < _local13) {
obj.ReportCollisionVsWorld(x, y, x / _local5, y / _local5, t);
return(COL_AXIS);
}
obj.ReportCollisionVsWorld(_local3, _local2, t.sx, t.sy, t);
return(COL_OTHER);
}
return(COL_NONE);
}
static function ProjAABB_67DegS(x, y, obj, t) {
var _local8 = t.signx;
var _local13 = t.signy;
var _local14 = obj.pos.x - (_local8 * obj.xw);
var _local3 = t.pos.x - _local14;
if (0 < (_local3 * _local8)) {
var _local16 = (obj.pos.x - (_local8 * obj.xw)) - (t.pos.x - (_local8 * t.xw));
var _local15 = (obj.pos.y - (_local13 * obj.yw)) - (t.pos.y + (_local13 * t.yw));
var _local5 = t.sx;
var _local4 = t.sy;
var _local9 = (_local16 * _local5) + (_local15 * _local4);
if (_local9 < 0) {
_local5 = _local5 * (-_local9);
_local4 = _local4 * (-_local9);
var _local10 = Math.sqrt((_local5 * _local5) + (_local4 * _local4));
var _local7 = Math.sqrt((x * x) + (y * y));
var _local6 = Math.abs(_local3);
if (_local7 < _local10) {
if (_local6 < _local7) {
obj.ReportCollisionVsWorld(_local3, 0, _local3 / _local6, 0, t);
return(COL_OTHER);
}
obj.ReportCollisionVsWorld(x, y, x / _local7, y / _local7, t);
return(COL_AXIS);
}
if (_local6 < _local10) {
obj.ReportCollisionVsWorld(_local3, 0, _local3 / _local6, 0, t);
return(COL_OTHER);
}
obj.ReportCollisionVsWorld(_local5, _local4, t.sx, t.sy, t);
return(COL_OTHER);
}
}
return(COL_NONE);
}
static function ProjAABB_67DegB(x, y, obj, t) {
var _local10 = t.signx;
var _local9 = t.signy;
var _local12 = (obj.pos.x - (_local10 * obj.xw)) - (t.pos.x + (_local10 * t.xw));
var _local11 = (obj.pos.y - (_local9 * obj.yw)) - (t.pos.y - (_local9 * t.yw));
var _local3 = t.sx;
var _local2 = t.sy;
var _local6 = (_local12 * _local3) + (_local11 * _local2);
if (_local6 < 0) {
_local3 = _local3 * (-_local6);
_local2 = _local2 * (-_local6);
var _local13 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
var _local5 = Math.sqrt((x * x) + (y * y));
if (_local5 < _local13) {
obj.ReportCollisionVsWorld(x, y, x / _local5, y / _local5, t);
return(COL_AXIS);
}
obj.ReportCollisionVsWorld(_local3, _local2, t.sx, t.sy, t);
return(COL_OTHER);
}
return(COL_NONE);
}
static function ResolveBoxTile(x, y, box, t) {
if (0 < t.ID) {
return(Proj_AABBTile[t.CTYPE](x, y, box, t));
}
return(false);
}
static var COL_NONE = 0;
static var COL_AXIS = 1;
static var COL_OTHER = 2;
}
Symbol 631 MovieClip [__Packages.N.object.DynamicObject] Frame 0
class N.object.DynamicObject
{
var friction, bounce, damp, velocity, Verlet, pos, oldpos, CollideVsTileMap;
function DynamicObject () {
friction = 0.05;
bounce = 0.5;
damp = 1;
velocity = new N.standard.Vector2(0, 0);
}
function step() {
Verlet();
var _local2 = pos;
var _local3 = oldpos;
var _local5 = _local2.x - _local3.x;
var _local4 = _local2.y - _local3.y;
_local2.x = _local3.x + _local5;
_local2.y = _local3.y + _local4;
CollideVsTileMap();
}
function IntegrateVerlet() {
var _local12 = N.NEngine.DRAG;
var _local4 = N.NEngine.DAMP;
var _local11 = N.NEngine.GRAV;
var _local2 = pos;
var _local3 = oldpos;
var _local8 = _local3.x;
var _local7 = _local3.y;
var _local6 = (_local3.x = _local2.x);
var _local5 = (_local3.y = _local2.y);
var _local10 = ((_local6 - _local8) * _local4) * damp;
var _local9 = (((_local5 - _local7) * _local4) * damp) + _local11;
velocity = new N.standard.Vector2(_local10, _local9);
_local2.x = _local2.x + velocity.x;
_local2.y = _local2.y + velocity.y;
}
function ReportCollisionVsWorld(px, py, dx, dy, obj) {
var _local2 = pos;
var _local3 = oldpos;
var _local6 = _local2.x - _local3.x;
var _local5 = _local2.y - _local3.y;
var _local4 = (_local6 * dx) + (_local5 * dy);
var _local13 = _local4 * dx;
var _local12 = _local4 * dy;
var _local17 = _local6 - _local13;
var _local15 = _local5 - _local12;
var _local8;
var _local11;
var _local10;
var _local14;
var _local9;
var _local7;
if (_local4 < 0) {
_local14 = friction * obj.friction;
_local9 = _local17 * _local14;
_local7 = _local15 * _local14;
_local8 = (1 + bounce) + obj.bounce;
_local11 = _local13 * _local8;
_local10 = _local12 * _local8;
} else {
_local7 = 0;
_local9 = _local7;
_local10 = _local9;
_local11 = _local10;
}
_local2.x = _local2.x + px;
_local2.y = _local2.y + py;
_local3.x = _local3.x + ((px + _local11) + _local9);
_local3.y = _local3.y + ((py + _local10) + _local7);
}
static var OTYPE_AABB = 0;
static var OTYPE_CIRCLE = 1;
}
Symbol 632 MovieClip [__Packages.N.object.CircleObject] Frame 0
class N.object.CircleObject extends N.object.DynamicObject
{
var Verlet, CollideVsTileMap, OTYPE, pos, oldpos, r, MAXSPEED, ReportCollisionVsWorld;
function CircleObject (pos, r) {
super();
init(pos, r);
Verlet = super.IntegrateVerlet;
CollideVsTileMap = CollideCirclevsTileMap;
}
function init(pos, r) {
OTYPE = N.object.DynamicObject.OTYPE_AABB;
this.pos = pos.clone();
oldpos = this.pos.clone();
this.r = Math.abs(r);
MAXSPEED = r;
}
function Draw(rend) {
rend.DrawCircle(pos, r);
}
function CollideCirclevsTileMap() {
var _local8 = pos;
var _local11 = r;
var _local2 = N.NEngine.tiles.GetTile_V(_local8);
var _local24 = _local2.pos.x;
var _local23 = _local2.pos.y;
var _local26 = _local2.xw;
var _local25 = _local2.yw;
var _local4 = _local8.x - _local24;
var _local3 = _local8.y - _local23;
var _local16 = N.tile.TileCell.EID_SOLID;
var _local31 = N.collision.ResolveCollision.COL_NONE;
var _local17 = N.collision.ResolveCollision.COL_AXIS;
var _local33 = N.collision.ResolveCollision.COL_OTHER;
var _local14 = N.collision.ResolveCollision.ResolveCircleTile;
if (0 < _local2.ID) {
var _local13 = (_local26 + _local11) - Math.abs(_local4);
var _local12 = (_local25 + _local11) - Math.abs(_local3);
_local14(_local13, _local12, 0, 0, this, _local2);
}
var _local28 = false;
var _local19 = false;
_local3 = _local8.y - _local23;
var _local12 = (Math.abs(_local3) + _local11) - _local25;
var _local7;
var _local22;
var _local10;
if (0 < _local12) {
_local28 = true;
if (_local3 < 0) {
_local7 = _local2.eU;
_local22 = _local2.nU;
_local10 = 1;
} else {
_local7 = _local2.eD;
_local22 = _local2.nD;
_local10 = -1;
}
if (0 < _local7) {
if (_local7 == _local16) {
_local19 = _local17;
ReportCollisionVsWorld(0, _local12 * _local10, 0, _local10, _local22);
} else {
_local19 = _local14(0, _local12, 0, _local10, this, _local22);
}
}
}
var _local27 = false;
var _local18 = false;
var _local6;
var _local21;
var _local9;
_local4 = _local8.x - _local24;
var _local13 = (Math.abs(_local4) + _local11) - _local26;
if (0 < _local13) {
_local27 = true;
if (_local4 < 0) {
_local6 = _local2.eL;
_local21 = _local2.nL;
_local9 = 1;
} else {
_local6 = _local2.eR;
_local21 = _local2.nR;
_local9 = -1;
}
if (0 < _local6) {
if (_local6 == _local16) {
_local18 = _local17;
ReportCollisionVsWorld(_local13 * _local9, 0, _local9, 0, _local21);
} else {
_local18 = _local14(_local13, 0, _local9, 0, this, _local21);
}
}
}
if (((_local27 && (_local18 != _local17)) && (_local28)) && (_local19 != _local17)) {
var _local5;
var _local32 = false;
if ((_local4 < 0) && (_local3 < 0)) {
_local6 = _local2.nU.eL;
_local7 = _local2.nL.eU;
_local5 = _local2.nU.nL;
} else if ((_local4 < 0) && (0 < _local3)) {
_local6 = _local2.nD.eL;
_local7 = _local2.nL.eD;
_local5 = _local2.nD.nL;
} else if ((0 < _local4) && (0 < _local3)) {
_local6 = _local2.nD.eR;
_local7 = _local2.nR.eD;
_local5 = _local2.nD.nR;
} else if ((0 < _local4) && (_local3 < 0)) {
_local6 = _local2.nU.eR;
_local7 = _local2.nR.eU;
_local5 = _local2.nU.nR;
}
if (0 < (_local6 + _local7)) {
if ((_local6 == _local16) || (_local7 == _local16)) {
var _local30 = _local5.pos.x + (_local9 * _local5.xw);
var _local29 = _local5.pos.y + (_local10 * _local5.yw);
_local4 = pos.x - _local30;
_local3 = pos.y - _local29;
var _local15 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
var _local20 = r - _local15;
if (0 < _local20) {
if (_local15 == 0) {
_local4 = _local9 / Math.SQRT2;
_local3 = _local10 / Math.SQRT2;
} else {
_local4 = _local4 / _local15;
_local3 = _local3 / _local15;
}
ReportCollisionVsWorld(_local4 * _local20, _local3 * _local20, _local4, _local3, _local5);
}
} else {
_local4 = _local8.x - _local5.pos.x;
_local3 = _local8.y - _local5.pos.y;
_local13 = (Math.abs(_local4) + _local11) - _local5.xw;
_local12 = (Math.abs(_local3) + _local11) - _local5.yw;
_local14(_local13, _local12, _local9, _local10, this, _local5);
}
}
}
}
}
Symbol 633 MovieClip [__Packages.Ball] Frame 0
class Ball extends N.object.CircleObject
{
var lasttime, friction, bounce, damp, defr, rotation, mc, mc_shade, CollideVsTileMap, sndMngr, r, innerForce, outerForce, velocity, dist, cframe, defpos, defa, pos, Verlet, curtile, MAXSPEED, oldpos;
function Ball (pos, r) {
super(pos, r);
lasttime = 0;
friction = 0.02;
bounce = 0.28;
damp = 1;
defr = r;
rotation = 0;
mc = N.NEngine.gfx.CreateSprite("ballMC");
mc_shade = N.NEngine.gfx.CreateSprite("ballMCshade");
mc_shade.swapDepths(N.NEngine.gfx.GetNextDepth_Back());
init(pos);
sleep();
CollideVsTileMap = CollideCirclevsTileMap;
sndMngr = MainGame.sndMngr;
}
function init(pos) {
super.init(pos, r);
innerForce = new N.standard.Vector2(0, 0);
outerForce = new N.standard.Vector2(0, 0);
velocity = new N.standard.Vector2(0, 0);
if (MainGame.curmap.id != "TutLvl") {
rotation = int(Math.random() * 36) * 10;
} else {
rotation = 88;
}
dist = 0;
cframe = 1;
defpos = pos.clone();
defa = rotation;
mc.gotoAndStop(1);
mc_shade.gotoAndStop(1);
update();
}
function sleep() {
mc.gotoAndStop(5);
mc_shade.gotoAndStop(5);
delete mc.onRollOver;
delete mc.onRollOut;
delete mc.onPress;
delete mc.onRelease;
delete mc.onReleaseOutside;
}
function update() {
mc._x = pos.x;
mc._y = pos.y;
mc.ani._rotation = rotation;
mc_shade._x = pos.x;
mc_shade._y = pos.y;
var _local2 = velocity.len() * 4;
if ((cframe + _local2) > 9) {
cframe = ((cframe + _local2) % 9) + 1;
} else {
cframe = cframe + _local2;
}
mc.ani.gotoAndStop(int(cframe));
MainGame.panel.mc.travel.text = int(dist) + "mm";
}
function step() {
Verlet();
if (((velocity.len() < 0.2) && (outerForce.len() == 0)) && (((curtile.offFrame + curtile.ID) + 1) != 41)) {
MainGame.summary.showTryagain();
MainGame.panel.mc.btn_stop.onRelease2();
return(undefined);
}
var _local4 = 0;
var _local3 = 0;
var _local11 = innerForce.len();
MAXSPEED = (r * 9) / 10;
r = Math.min(r, maxr);
velocity = new N.standard.Vector2(pos.x - oldpos.x, pos.y - oldpos.y);
var _local2 = velocity.len();
rotation = velocity.angle(null, true);
dist = dist + (_local2 * 0.523809523809524);
if (outerForce.len()) {
_local4 = _local4 + outerForce.x;
_local3 = _local3 + outerForce.y;
outerForce.x = (outerForce.y = 0);
}
var _local5 = pos;
var _local6 = oldpos;
var _local8 = velocity.x;
var _local7 = velocity.y;
var _local10 = Math.min(MAXSPEED, Math.max(-MAXSPEED, _local8 + _local4));
var _local9 = Math.min(MAXSPEED, Math.max(-MAXSPEED, _local7 + _local3));
_local5.x = _local6.x + _local10;
_local5.y = _local6.y + _local9;
CollideVsTileMap();
if ((_local2 / MAXSPEED) > 0.2) {
sndMngr.sndVolume("roll_loop", (int(((_local2 / MAXSPEED) * 0.8) * 100) / 100) + 0.2);
} else {
sndMngr.sndVolume("roll_loop", 0);
}
MainGame.root.mymsg = "volume ay " + ((int(((_local2 / MAXSPEED) * 0.8) * 100) / 100) + 0.2);
MainGame.root.mymsg = MainGame.root.mymsg + ("\nat " + sndMngr.isPlaying("roll_loop"));
update();
}
function ReportCollisionVsWorld(px, py, dx, dy, obj) {
super.ReportCollisionVsWorld(px, py, dx, dy, obj);
var _local4 = 1;
var _local11 = pos.x - oldpos.x;
var _local9 = pos.y - oldpos.y;
var _local8 = new N.standard.Vector2(_local11, _local9);
var _local12 = velocity.angle(null, true);
var _local10 = _local8.angle(null, true);
if (Math.abs(N.util.MathUtil.angleDiff(_local12, _local10)) > (180 - ((135 * velocity.len()) / MAXSPEED))) {
_local4 = int((velocity.len() / MAXSPEED) * 10) / 10;
} else {
_local4 = 0;
}
var _local3 = 10;
switch ((obj.offFrame + obj.ID) + 1) {
case 31 :
if (!((dx < 0) || (dy > 0))) {
outerForce.x = outerForce.x + _local3;
outerForce.y = outerForce.y + (-_local3);
obj.mc.mc.play();
sndMngr.playSound("spring");
} else {
sndMngr.playSound("normal_collide", null, null, _local4);
}
break;
case 32 :
if (!((dx > 0) || (dy > 0))) {
outerForce.x = outerForce.x + (-_local3);
outerForce.y = outerForce.y + (-_local3);
obj.mc.mc.play();
sndMngr.playSound("spring");
} else {
sndMngr.playSound("normal_collide", null, null, _local4);
}
break;
case 33 :
if (!((dx > 0) || (dy < 0))) {
outerForce.x = outerForce.x + (-_local3);
outerForce.y = outerForce.y + _local3;
obj.mc.mc.play();
sndMngr.playSound("spring");
} else {
sndMngr.playSound("normal_collide", null, null, _local4);
}
break;
case 34 :
if (!((dx < 0) || (dy < 0))) {
outerForce.x = outerForce.x + _local3;
outerForce.y = outerForce.y + _local3;
obj.mc.mc.play();
sndMngr.playSound("spring");
} else {
sndMngr.playSound("normal_collide", null, null, _local4);
}
break;
case 36 :
if (dy < 0) {
outerForce.y = outerForce.y + (-_local3);
obj.mc.mc.play();
sndMngr.playSound("spring");
} else {
sndMngr.playSound("normal_collide", null, null, _local4);
}
break;
case 37 :
if (dx > 0) {
outerForce.x = outerForce.x + _local3;
obj.mc.mc.play();
sndMngr.playSound("spring");
} else {
sndMngr.playSound("normal_collide", null, null, _local4);
}
break;
case 38 :
if (dy > 0) {
outerForce.y = outerForce.y + _local3;
obj.mc.mc.play();
sndMngr.playSound("spring");
} else {
sndMngr.playSound("normal_collide", null, null, _local4);
}
break;
case 39 :
if (dx < 0) {
outerForce.x = outerForce.x + (-_local3);
obj.mc.mc.play();
sndMngr.playSound("spring");
} else {
sndMngr.playSound("normal_collide", null, null, _local4);
}
break;
case 17 :
case 18 :
case 19 :
case 20 :
case 21 :
case 22 :
case 23 :
case 14 :
case 15 :
obj.mc.mc.play();
sndMngr.playSound("jelly_collide", null, null, _local4);
break;
default :
sndMngr.playSound("normal_collide", null, null, _local4);
}
sndMngr.stopSound("roll_loop");
sndMngr.playSound("roll_loop");
}
function standby() {
mc.onRollOver = mx.utils.Delegate.create(this, rollover);
mc.onRollOut = mx.utils.Delegate.create(this, rollout);
mc.onPress = mx.utils.Delegate.create(this, press);
mc.onRelease = mx.utils.Delegate.create(this, release);
mc.onReleaseOutside = mc.onRelease;
mc.gotoAndStop(3);
pos = defpos.clone();
oldpos = pos.clone();
r = defr;
rotation = defa;
mc.arrow._rotation = rotation;
dist = 0;
sndMngr.stopSound("roll_loop");
update();
}
function rollover() {
mc.arrow._rotation = rotation;
jayc.common.utils.Cursor.frameto(2);
}
function rollout() {
jayc.common.utils.Cursor.frameto(1);
}
function press() {
mc.onMouseMove = mx.utils.Delegate.create(this, changeDir);
}
function release() {
delete mc.onMouseMove;
mc.angle.text = "";
rollout();
}
function changeDir() {
var _local2 = new N.standard.Vector2(mc._parent._xmouse - mc._x, mc._parent._ymouse - mc._y);
rotation = Math.round(_local2.angle(null, true) / 1) * 1;
if (MainGame.curmap.name == "Tutorial") {
if ((rotation > 77) && (rotation < 99)) {
rotation = Math.round(rotation / 4) * 4;
}
mc.angle.text = ((rotation < 0) ? (rotation + 360) : (rotation)) + "\u00B0";
}
defa = rotation;
mc.arrow._rotation = rotation;
}
function startEngine() {
delete mc.onRollOver;
delete mc.onRollOut;
delete mc.onPress;
delete mc.onRelease;
delete mc.onReleaseOutside;
delete mc.onMouseMove;
mc.gotoAndStop(2);
outerForce = new N.standard.Vector2(r, 0);
outerForce = outerForce.rotate(rotation);
velocity = new N.standard.Vector2(r * 50, 0);
velocity = velocity.rotate(rotation);
MAXSPEED = (r * 9) / 10;
sndMngr.playSound("roll_loop");
sndMngr.sndVolume("roll_loop", outerForce.len() / MAXSPEED);
}
function CollideCirclevsTileMap() {
var _local3 = N.NEngine.tiles.GetTile_V(pos);
curtile = _local3;
if (!(((_local3.offFrame + _local3.ID) + 1) === 41)) {
} else {
if ((pos.projLen(_local3.pos) < (15 + r)) && (velocity.len() < (r * 2))) {
var _local4 = _local3.pos.minus(pos);
_local4.mult(0.3);
pos = pos.plus(_local4);
if (velocity.isZero()) {
sndMngr.stopSound("roll_hole");
MainGame.summary.showComplete();
} else if (((_local4.len() < 0.2) && (velocity.len() < r)) && (!velocity.isZero())) {
oldpos = pos.clone();
MainGame.timer.stop();
}
if ((lasttime + 700) < getTimer()) {
sndMngr.playSound("roll_hole");
lasttime = getTimer();
}
} else {
sndMngr.stopSound("roll_hole");
lasttime = getTimer() - 700;
}
return(undefined);
}
super.CollideCirclevsTileMap();
}
static var maxr = 18;
}
Symbol 634 MovieClip [__Packages.jayc.common.control.SoundManager] Frame 0
class jayc.common.control.SoundManager
{
static var instance, mc;
var bmg_vol, sfx_vol, mute, sfx_count, bmg_count, sfx, bmg;
function SoundManager ($b, $s, $root) {
bmg_vol = ((!isNaN($b)) ? ($b) : 0.5);
sfx_vol = ((!isNaN($s)) ? ($s) : 0.75);
mute = 1;
sfx_count = 0;
bmg_count = 0;
sfx = new Object();
bmg = new Object();
if (instance) {
instance.Destroy();
}
instance = this;
var _local3 = $root || _root;
mc = _local3.createEmptyMovieClip("MCsndMngr", 1048002);
}
function addSound(linkage, nickname, isbmg, loop, secondOffset) {
var _local4 = (isbmg ? "bmg" : "sfx");
nickname = ((!nickname) ? (linkage) : (nickname));
var _local2;
_local2 = mc.createEmptyMovieClip("SNDMC_" + nickname, mc.getNextHighestDepth());
_local2.stype = _local4;
var _local3 = new Sound(_local2);
_local3.attachSound(linkage);
_local3.setVolume(this[_local4 + "_vol"]);
if (loop == Number.POSITIVE_INFINITY) {
_local3.onSoundComplete = _local3.start;
} else if (!isNaN(loop)) {
_local2.loopcount = loop;
} else {
_local2.loopcount = 0;
}
if (!isNaN(secondOffset)) {
_local2.secondOffset = secondOffset;
} else {
_local2.secondOffset = 0;
}
_local2.snd = _local3;
this[_local4][nickname] = _local3;
if (this[_local4][nickname]) {
}
}
function playSound(nickname, secondOffset, loop, volume, temp) {
var _local2 = mc["SNDMC_" + nickname];
var _local5 = _local2.snd;
if (!temp) {
if (!isNaN(loop)) {
_local2.loopcount = loop;
}
if (!isNaN(secondOffset)) {
_local2.secondOffset = secondOffset;
}
}
loop = ((!isNaN(loop)) ? (loop) : (_local2.loopcount));
secondOffset = ((!isNaN(secondOffset)) ? (secondOffset) : (_local2.secondOffset));
if (!isNaN(volume)) {
_local5.setVolume(Math.min(((volume * 100) * this[_local2.stype + "_vol"]) * mute, 100));
} else {
_local5.setVolume(Math.min((100 * this[_local2.stype + "_vol"]) * mute, 100));
}
_local5.start(secondOffset, loop);
}
function isPlaying(nickname) {
var _local2 = mc["SNDMC_" + nickname];
var _local1 = _local2.snd;
return(_local1.getPosition() > 0);
}
function sndVolume(nickname, volume) {
var _local2 = mc["SNDMC_" + nickname];
var _local3 = _local2.snd;
_local3.setVolume(Math.min(int(((volume * 100) * this[_local2.stype + "_vol"]) * mute), 100));
}
function stopSound(nickname) {
mc["SNDMC_" + nickname].snd.stop();
}
function muteSounds(sw) {
if (sw == undefined) {
sw = true;
}
mute = (sw ? 0 : 1);
bmg_volume = (bmg_volume);
}
function set bmg_volume(n) {
bmg_vol = Math.min(n, 1);
for (var _local2 in bmg) {
bmg[_local2].setVolume(Math.min((bmg_vol * 100) * mute, 100));
}
//return(bmg_volume);
}
function get bmg_volume() {
return(bmg_vol);
}
function set sfx_volume(n) {
sfx_vol = n;
//return(sfx_volume);
}
function get sfx_volume() {
return(sfx_vol);
}
function destroySound(nickname) {
var _local2 = mc["SNDMC_" + nickname];
if (typeof(_local2) != "movieclip") {
return(false);
}
delete this[_local2.stype][nickname];
_local2.removeMovieClip();
}
function Destroy() {
mc.removeMovieClip();
delete instance;
}
}
Symbol 635 MovieClip [__Packages.N.util.MathUtil] Frame 0
class N.util.MathUtil
{
function MathUtil () {
}
static function angleDiff(a, b) {
a = a - b;
while (a < -180) {
a = a + 360;
}
while (a >= 180) {
a = a - 360;
}
return(a);
}
static function normalizeAngle(a) {
while (a < -180) {
a = a + 360;
}
while (a >= 180) {
a = a - 360;
}
return(a);
}
}
Symbol 636 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 637 MovieClip [__Packages.jayc.common.utils.Cursor] Frame 0
class jayc.common.utils.Cursor extends MovieClip
{
static var cur;
var swapDepths, _x, _xmouse, _y, _ymouse, onMouseMove2, hitTest, _parent, frame;
function Cursor () {
super();
Mouse.hide();
gotoAndStop(1);
if (cur) {
cur.removeMovieClip();
}
cur = this;
swapDepths(1048031);
}
function onMouseMove() {
_x = _x + _xmouse;
_y = _y + _ymouse;
onMouseMove2();
}
function onMouseDown() {
if (hitTest(_parent) && (cur.enabled)) {
Mouse.hide();
} else {
Mouse.show();
}
}
function gotoAndStop(f) {
super.gotoAndStop(f);
frame = f;
}
static function disable(enable) {
if (!cur) {
return(false);
}
cur.enabled = Boolean(enable);
if (cur.enabled) {
Mouse.hide();
} else {
Mouse.show();
}
}
static function gotoFrame(f) {
if (!cur) {
return(undefined);
}
cur.gotoAndStop(f);
}
static function frameto(f) {
gotoFrame(f);
}
static function getFrame(getFrameNumber) {
if (!cur) {
return(null);
}
if (getFrameNumber) {
return(cur._currentframe);
}
return(cur.frame);
}
static function getframe(f) {
return(getFrame(f));
}
}
Symbol 638 MovieClip [__Packages.Panel] Frame 0
class Panel
{
var game, mc, keyGet, gridmc, gextra, dummy, tilesaved;
function Panel (main) {
game = main;
mc = N.NEngine.gfx.CreateSprite("panelMC");
var _local4 = -1;
var _local6;
mc.btn_stop._visible = false;
jayc.common.utils.MCButton.makeMC(mc.btn_rel);
jayc.common.utils.MCButton.makeMC(mc.btn_stop);
jayc.common.utils.MCButton.makeMC(mc.btn_clear);
mc.btn_rel.onRelease2 = mx.utils.Delegate.create(game, game.startEngine);
mc.btn_stop.onRelease2 = mx.utils.Delegate.create(game, game.standby);
mc.btn_clear.onRelease2 = mx.utils.Delegate.create(game, game.clearmap);
jayc.common.utils.MCButton.makeMC(mc.btn_walk);
mc.btn_walk.disabled(1);
mc.btn_walk.onRelease2 = function () {
MainGame.root.getURL("http://armorgames.com/guide/Putt-Base-Video-Guide", "_blank");
};
jayc.common.utils.MCButton.makeMC(mc.btn_pause);
mc.btn_pause.disabled(1);
mc.btn_pause.onRelease2 = mx.utils.Delegate.create(this, function () {
if (MainGame.summary.mc._currentframe != 1) {
return(undefined);
}
if (N.NEngine.gfx.rootbuffer.onEnterFrame) {
this.mc.btn_stop.onRelease2();
}
MainGame.summary.pauseGame();
this.mc.btn_pause.disabled();
this.mc.btn_walk.disabled();
});
keyGet = {k32:false, k27:false, k13:false};
keyGet.onKeyUp = mx.utils.Delegate.create(this, function () {
switch (Key.getCode()) {
case 32 :
this.keyGet.k32 = false;
break;
case 27 :
this.keyGet.k27 = false;
break;
case 13 :
this.keyGet.k13 = false;
break;
}
});
keyGet.onKeyDown = mx.utils.Delegate.create(this, function () {
if (this.mc._currentframe != 2) {
return(undefined);
}
if (((MainGame.summary.mc._currentframe != 1) && (Key.getCode() != 13)) && (MainGame.curmap.name != "Tutorial")) {
return(undefined);
}
switch (Key.getCode()) {
case 32 :
this.keyGet.k32 = true;
if (this.mc.btn_rel.enabled) {
this.mc.btn_rel.onRelease2();
} else if (this.mc.btn_stop.enabled) {
this.mc.btn_stop.onRelease2();
}
break;
case 27 :
this.keyGet.k27 = true;
if (this.mc.btn_clear.enabled) {
this.mc.btn_clear.onRelease2();
}
break;
case 13 :
this.keyGet.k13 = true;
if (MainGame.curmap.name == "Tutorial") {
return(undefined);
}
if (this.mc.btn_pause.enabled) {
this.mc.btn_pause.onRelease2();
} else if (((MainGame.summary.mc._currentframe == 81) && (MainGame.summary.mc.btn_continue.enabled)) && (!MainGame.root.getInstanceAtDepth(1048001))) {
MainGame.summary.mc.btn_continue.onRelease2();
}
break;
}
});
gridmc = mc.createEmptyMovieClip("gridmc", 2);
sleep();
}
function sleep() {
Key.removeListener(keyGet);
mc.btn_rel.disabled();
mc.btn_stop.disabled();
mc.btn_clear.disabled();
gridmc._visible = false;
mc.gotoAndStop(1);
}
function clear(xtras) {
mc.gotoAndStop(2);
gextra = xtras;
var _local5 = xtras.length;
var _local3 = -1;
var _local4;
var _local2;
gridmc._visible = true;
gridmc.removeMovieClip();
gridmc = mc.createEmptyMovieClip("gridmc", 2);
while ((_local3++) < 12) {
_local2 = mc["tile" + _local3];
_local2.txt = mc["txt" + _local3];
_local2._visible = false;
_local2.txt.text = " ";
}
_local3 = -1;
while (_local3++ , _local3 < _local5) {
_local2 = mc["tile" + _local3];
_local2.txt = mc["txt" + _local3];
_local2.charcode = xtras[_local3][0].charCodeAt(0);
_local4 = BTileMap.getTileInfo(_local2.charcode);
if (_local4.tileID == 0) {
continue;
}
_local2.frame = (_local4.tileID + _local4.offFrame) + 1;
_local2.tileID = _local4.tileID;
_local2.count = xtras[_local3][1];
_local2.index = _local3;
_local2._visible = true;
_local2.gotoAndStop(_local2.frame);
_local2.txt.text = _local2.count + "x";
makeTileBtn(_local2);
}
if (MainGame.curmap.name == "Tutorial") {
mc.btn_pause.disabled();
mc.btn_pause._visible = false;
mc.btn_walk.disabled();
mc.btn_walk._visible = false;
} else {
mc.btn_pause.disabled(1);
mc.btn_pause._visible = true;
mc.btn_walk.disabled(1);
mc.btn_walk._visible = true;
}
mc.btn_rel.disabled(1);
mc.btn_stop.disabled(1);
mc.btn_clear.disabled(1);
Key.addListener(keyGet);
_local3 = -1;
while (_local3++ , _local3 < _local5) {
mc["tile" + _local3].gotoAndStop(mc["tile" + _local3].frame);
}
}
static function makeTileBtn(tmc) {
jayc.common.utils.MCButton.makeMC(tmc);
tmc.onRollOut = function () {
jayc.common.utils.Cursor.frameto(1);
};
tmc.onRollOver = function () {
if (jayc.common.utils.Cursor.getframe() == 1) {
jayc.common.utils.Cursor.frameto(2);
}
};
tmc.onPress = function () {
if (this.count > 0) {
jayc.common.utils.Cursor.frameto(4);
MainGame.panel.makeDummyTile(this);
this.count--;
this.txt.text = this.count + "x";
if (this.frombox && (this.count == 0)) {
this.gotoAndStop(1);
this.txt.text = "";
} else if (this.charcode == 43) {
MainGame.ball.sleep();
}
} else {
jayc.common.utils.Cursor.frameto(5);
}
};
tmc.onRelease = tmc.onRollOut;
tmc.onReleaseOutside = function () {
jayc.common.utils.Cursor.frameto(1);
};
tmc.onDragOut = function () {
if (jayc.common.utils.Cursor.getframe() == 5) {
jayc.common.utils.Cursor.frameto(1);
}
};
}
function makeDummyTile(tmc) {
if (!dummy) {
dummy = N.NEngine.gfx.CreateSprite("tileMCmove");
dummy._alpha = 50;
}
dummy.tile = tmc;
dummy.i = 10000;
dummy.j = 10000;
dummy.gotoAndStop(tmc.frame);
dummy.onMouseMove = function () {
var inside = false;
with (this) {
if ((((_parent._xmouse >= 30) && (_parent._xmouse < 420)) && (_parent._ymouse >= 30)) && (_parent._ymouse < 390)) {
_x = (30 * int((_xmouse + _x) / 30)) + 15;
_y = (30 * int((_ymouse + _y) / 30)) + 15;
inside = true;
} else {
_x = _x + _xmouse;
_y = _y + _ymouse;
}
var $i = int(_x / 30);
var $j = int(_y / 30);
if ((i != $i) || (j != $j)) {
var ctile = N.NEngine.tiles.grid[$i][$j];
if (inside && (ctile.charcode != 48)) {
jayc.common.utils.Cursor.frameto(5);
} else {
jayc.common.utils.Cursor.frameto(4);
}
}
i = $i;
j = $j;
}
};
dummy.onMouseMove();
dummy.onMouseUp = function () {
jayc.common.utils.Cursor.frameto(1);
with (this) {
var xm = _parent._xmouse;
var ym = _parent._ymouse;
if ((((xm >= 30) && (xm < 420)) && (ym >= 30)) && (ym < 390)) {
MainGame.panel.catchDummy();
} else if (MainGame.panel.mc._currentframe > 3) {
if ((((xm >= -135) && (xm < -5)) && (ym >= 25)) && (ym < 260)) {
if (!MainGame.panel.catchXtraDummy()) {
tile.count++;
}
} else {
tile.count++;
}
} else {
tile.count++;
tile.txt.text = tile.count + "x";
}
gotoAndStop(1);
delete this.onMouseMove;
delete this.onMouseUp;
}
};
}
function standby() {
mc.btn_clear.enabled = true;
mc.btn_clear.gotoAndStop(1);
mc.btn_rel._visible = true;
mc.btn_rel.enabled = true;
mc.btn_stop._visible = false;
mc.btn_stop.enabled = false;
gridmc._visible = true;
var _local3;
var _local2 = -1;
var _local4 = gextra.length;
while (_local2++ , _local2 < _local4) {
_local3 = mc["tile" + _local2];
_local3.enabled = true;
}
}
function startEngine() {
mc.btn_clear.enabled = false;
mc.btn_clear.gotoAndStop(5);
mc.btn_rel._visible = false;
mc.btn_rel.enabled = false;
mc.btn_stop._visible = true;
mc.btn_stop.enabled = true;
var _local2;
gridmc._visible = false;
tilesaved = 0;
var _local3 = -1;
var _local4 = gextra.length;
while (_local3++ , _local3 < _local4) {
_local2 = mc["tile" + _local3];
_local2.enabled = false;
tilesaved = tilesaved + ((!isNaN(_local2.count)) ? (_local2.count) : 0);
}
}
function catchDummy() {
var tile = N.NEngine.tiles.grid[dummy.i][dummy.j];
if (tile.charcode != 48) {
dummy.tile.count++;
dummy.tile.txt.text = dummy.tile.count + "x";
return(undefined);
}
var tmc = gridmc.attachMovie("tileMCmove", (("t" + dummy.i) + "_") + dummy.j, (dummy.i * 1000) + (dummy.j * 2));
tmc.prev_charcode = tile.charcode;
if (dummy.tile.frombox) {
tmc.tile = mc.mc_ctwin[dummy.tile.src];
} else {
tmc.tile = dummy.tile;
}
tmc._x = dummy._x;
tmc._y = dummy._y;
tmc.i = dummy.i;
tmc.j = dummy.j;
tmc.gotoAndStop(1);
tmc._alpha = 0;
if (MainGame.curmap.name == "Tutorial") {
if (((dummy.i == 12) && (dummy.j == 11)) && (dummy.tile.charcode == 83)) {
MainGame.summary.loadTutorial(5);
}
} else if (mc._currentframe >= 5) {
if (dummy.tile.charcode == 43) {
MainGame.ball.init(new N.standard.Vector2((dummy.i * 30) + 15, (dummy.j * 30) + 15));
}
}
N.NEngine.tiles.SetTileState(dummy.i - 1, dummy.j - 1, dummy.tile.charcode);
tmc.onPress = function () {
jayc.common.utils.Cursor.frameto(4);
if (!isNaN(this.prev_charcode)) {
N.NEngine.tiles.SetTileState(this.i - 1, this.j - 1, this.prev_charcode);
delete tmc.prev_charcode;
}
MainGame.panel.makeDummyTile(this.tile);
this.removeMovieClip();
};
tmc.onRelease = function () {
jayc.common.utils.Cursor.frameto(1);
};
tmc.onRollOver = function () {
if (jayc.common.utils.Cursor.getframe() == 1) {
jayc.common.utils.Cursor.frameto(2);
}
};
tmc.onRollOut = tmc.onRelease;
tmc.onReleaseOutside = function () {
jayc.common.utils.Cursor.frameto(1);
};
}
}
Symbol 639 MovieClip [__Packages.jayc.common.utils.MCButton] Frame 0
class jayc.common.utils.MCButton
{
function MCButton () {
}
static function makeMC(bmc) {
bmc.onRollOut = function () {
this.onRollOut2();
jayc.common.utils.Cursor.gotoFrame(1);
this.gotoAndStop(1);
};
bmc.onRollOver = function () {
this.onRollOver2();
if ((jayc.common.utils.Cursor.getFrame() == 1) && (this.enabled)) {
jayc.common.utils.Cursor.gotoFrame(2);
}
this.gotoAndStop(2);
};
bmc.onPress = function () {
this.gotoAndStop(3);
this.onPress2();
};
bmc.onRelease = function () {
this.gotoAndStop(2);
this.onRelease2();
};
bmc.onReleaseOutside = function () {
this.onRollOut();
this.onReleaseOutside2();
};
bmc.gotoAndStop(1);
bmc.tabChildren = false;
bmc.tabEnabled = false;
bmc.disabled = function (sw) {
if (sw == undefined) {
this.gotoAndStop(5);
this.enabled = false;
} else {
this.gotoAndStop(1);
this.enabled = true;
}
};
}
}
Symbol 640 MovieClip [__Packages.BTileMap] Frame 0
class BTileMap extends N.tile.TileMap
{
var grid;
function BTileMap (rows, cols, xw, yw) {
super(rows, cols, xw, yw);
N.tile.TileMap.gfx.rootbuffer.swapDepths(N.NEngine.gfx.GetNextDepth_Back());
}
function SetTileState(i, j, char) {
if (isNaN(char)) {
char = 48;
}
var _local5;
var _local3 = grid[i + 1][j + 1];
var _local2 = getTileInfo(char);
_local5 = _local2.tileID;
_local3.offFrame = _local2.offFrame;
_local3.charcode = char;
_local3.friction = (_local2.friction ? (_local2.friction) : 1);
_local3.bounce = (_local2.bounce ? (_local2.bounce) : 0);
if (char == 43) {
}
_local3.SetState(_local5);
}
static function getTileInfo(char) {
switch (String.fromCharCode(char)) {
case "+" :
return({tileID:0, offFrame:0});
case "!" :
return({tileID:0, offFrame:40});
case "1" :
case "2" :
case "2" :
case "3" :
case "4" :
case "5" :
case "6" :
case "7" :
case "8" :
case "9" :
return({tileID:char - N.tile.TileMap.CHAR_PAD, offFrame:0});
case "E" :
case "F" :
case "G" :
case "H" :
case "I" :
case "J" :
case "K" :
case "L" :
case "M" :
return({tileID:(char - N.tile.TileMap.CHAR_PAD) - 20, offFrame:15, friction:0.0001, bounce:-0.22});
case "R" :
return({tileID:1, offFrame:29});
case "S" :
return({tileID:1, offFrame:30});
case "T" :
return({tileID:1, offFrame:31});
case "U" :
return({tileID:1, offFrame:32});
case "V" :
return({tileID:1, offFrame:34});
case "W" :
return({tileID:1, offFrame:35});
case "X" :
return({tileID:1, offFrame:36});
case "Y" :
return({tileID:1, offFrame:37});
}
return({tileID:0, offFrame:0});
}
}
Symbol 641 MovieClip [__Packages.jayc.common.utils.Clock] Frame 0
class jayc.common.utils.Clock
{
var count, defNum, endNum, onChange, onComplete, start, intervalID;
function Clock ($defNum, $endNum, $onChange, $onComplete) {
init($defNum, $endNum, $onChange, $onComplete);
}
function init($defNum, $endNum, $onChange, $onComplete) {
count = $defNum;
defNum = $defNum;
endNum = $endNum;
stop();
if (typeof($onChange) == "function") {
onChange = $onChange;
} else {
onChange = stop;
}
if (typeof($onComplete) == "function") {
onComplete = $onComplete;
} else {
onComplete = stop;
}
if ($defNum < $endNum) {
start = start_timer;
} else if ($defNum > $endNum) {
start = start_countdown;
}
}
function start_timer() {
stop();
intervalID = setInterval(this, "countup", 1000);
}
function start_countdown() {
stop();
intervalID = setInterval(this, "countdown", 1000);
}
function stop() {
clearInterval(intervalID);
}
function reset() {
stop();
count = defNum;
}
function countup() {
if ((++count) == endNum) {
stop();
onComplete();
}
onChange();
}
function countdown() {
if ((--count) == endNum) {
stop();
onComplete();
}
onChange();
}
static function strFormat(c, f) {
var _local5;
var _local4;
var _local6;
var _local7;
var _local3 = (arguments[2] ? (arguments[2]) : "");
switch (f) {
case "ss" :
_local6 = int(c % 60);
if (_local6 < 10) {
return("0" + _local6);
}
return(_local6 + "");
case "m" :
_local4 = int(c / 60);
return(_local4 + "");
case "mm" :
_local4 = int(c / 60);
if (_local4 < 10) {
return("0" + _local4);
}
return(_local4 + "");
case "h" :
_local5 = int(c / 3600);
return(_local5 + "");
case "hh" :
_local5 = int(c / 3600);
if (_local5 < 10) {
return("0" + _local5);
}
return(_local5 + "");
case "hhmmss" :
return((((strFormat(c, "hh") + _local3) + strFormat(c, "mm")) + _local3) + strFormat(c, "ss"));
case "hmmss" :
return((((strFormat(c, "h") + _local3) + strFormat(c, "mm")) + _local3) + strFormat(c, "ss"));
case "hmm" :
return((strFormat(c, "h") + _local3) + strFormat(c, "mm"));
case "mmss" :
return((strFormat(c, "mm") + _local3) + strFormat(c, "ss"));
case "mss" :
return((strFormat(c, "m") + _local3) + strFormat(c, "ss"));
}
return(c + "");
}
}
Symbol 642 MovieClip [__Packages.Summary] Frame 0
class Summary
{
var mc, tscore, nxtl2, tdist, ttile, ttimeb, score, lvltime;
function Summary () {
mc = N.NEngine.gfx.CreateSprite("summaryMC");
mc.gotoAndStop(1);
mc.clss = this;
tscore = 0;
}
function pauseGame() {
MainGame.timer.stop();
MainGame.mainMenu.mute_btn._visible = false;
mc._x = (mc._y = 0);
caurina.transitions.Tweener.addTween(mc, {_x:0, _alpha:100, time:0.3, transition:"easeOutCubic"});
mc._x = -50;
mc._alpha = 0;
mc.gotoAndStop(81);
jayc.common.utils.MCButton.makeMC(mc.btn_continue);
jayc.common.utils.MCButton.makeMC(mc.btn_options);
jayc.common.utils.MCButton.makeMC(mc.btn_mainmenu);
mc.btn_continue.onRelease2 = mx.utils.Delegate.create(this, function () {
caurina.transitions.Tweener.addTween(this.mc, {_x:-50, _alpha:0, time:0.3, transition:"easeOutCubic", onComplete:function () {
this.gotoAndStop(1);
if (MainGame.curmap.name != "Tutorial") {
MainGame.timer.start();
}
MainGame.mainMenu.mute_btn._visible = true;
MainGame.panel.mc.btn_pause.disabled(1);
MainGame.panel.mc.btn_walk.disabled(1);
}});
});
mc.btn_options.onRelease2 = mx.utils.Delegate.create(this, function () {
this.mc.attachMovie("optionsMC", "mcoptions", 600);
this.mc.mcoptions._alpha = 0;
this.mc.mcoptions._y = 100;
this.mc.mcoptions._x = -150;
});
mc.btn_mainmenu.onRelease2 = mx.utils.Delegate.create(this, function () {
var _local2 = MainGame.root.attachMovie("prompt", "prompt", 1048001, {_x:-150});
_local2.setType("okcancel", "Are you sure you want to leave current level?", this, function () {
caurina.transitions.Tweener.addTween(MainGame.summary.mc, {_x:-50, _alpha:0, time:0.3, transition:"easeOutCubic", onComplete:function () {
this.gotoAndStop(1);
MainGame.mainMenu.mute_btn._visible = true;
MainGame.game.sleep(mx.utils.Delegate.create(MainGame.mainMenu, MainGame.mainMenu.reopenlevels));
MainGame.sndMngr.stopSound("bmg_game");
MainGame.root.stopAllSounds();
var _local2 = [31.2, 40, 57, 84, 102.5, 126.1, 144, 160, 168];
MainGame.sndMngr.playSound("bmg_main", _local2[int(Math.random() * 8)]);
}});
}, function () {
});
});
}
function showIntro() {
var _local2 = MainGame.curmap;
mc._x = (mc._y = 0);
if (_local2.name == "Tutorial") {
mc.gotoAndStop(1);
loadTutorial(1);
} else {
mc._y = 50;
mc._alpha = 0;
mc.gotoAndStop(2);
MainGame.sndMngr.playSound("swoosh0");
caurina.transitions.Tweener.addTween(mc, {_y:0, _alpha:100, time:0.6, transition:"easeOutCubic", onComplete:function () {
MainGame.timer.start();
}});
caurina.transitions.Tweener.addTween(mc, {_y:-50, _alpha:0, time:0.6, delay:0.7, transition:"easeOutCubic", onStart:function () {
MainGame.sndMngr.playSound("swoosh0");
}, onComplete:function () {
this.gotoAndStop(1);
}});
}
}
function showTooLong() {
mc._y = 50;
mc._alpha = 0;
mc.gotoAndStop(10);
MainGame.sndMngr.playSound("swoosh0");
caurina.transitions.Tweener.addTween(mc, {_y:0, _alpha:100, time:0.6, transition:"easeOutCubic", onComplete:function () {
MainGame.timer.start();
}});
jayc.common.utils.MCButton.makeMC(mc.btn_retry);
jayc.common.utils.MCButton.makeMC(mc.btn_levels);
mc.btn_retry.onRelease2 = mx.utils.Delegate.create(this, function () {
MainGame.sndMngr.playSound("swoosh0");
caurina.transitions.Tweener.addTween(this.mc, {_y:-50, _alpha:0, time:0.3, transition:"easeOutCubic", onComplete:function () {
this.gotoAndStop(1);
MainGame.game.loadlevel(MainGame.curmap.id);
}});
});
mc.btn_levels.onRelease2 = mx.utils.Delegate.create(this, function () {
MainGame.sndMngr.playSound("swoosh0");
caurina.transitions.Tweener.addTween(this.mc, {_y:-50, _alpha:0, time:0.3, transition:"easeOutCubic", onComplete:function () {
this.gotoAndStop(1);
MainGame.game.sleep(mx.utils.Delegate.create(MainGame.mainMenu, MainGame.mainMenu.reopenlevels));
}});
});
}
function showTryagain() {
if (MainGame.curmap.name == "Tutorial") {
var _local2 = MainGame.ball;
var _local4 = int(_local2.pos.x / 30);
var _local3 = int(_local2.pos.y / 30);
if (mc._currentframe == 55) {
if (((((_local3 > 8) && (_local3 < 12)) && (_local4 > 1)) && (_local4 < 5)) && (mc._currentframe == 55)) {
loadTutorial(6);
} else {
var _local5 = MainGame.root.attachMovie("prompt", "prompt", 1048001, {_x:-150});
_local5.setType("ok2", "You have to set the ball`s angle to 88\u00B0 to get close enough.\nTry again.");
}
}
return(undefined);
}
mc._y = 50;
mc._alpha = 0;
mc.gotoAndStop(4);
MainGame.sndMngr.playSound("swoosh0");
caurina.transitions.Tweener.addTween(mc, {_y:0, _alpha:100, time:0.4, transition:"easeOutCubic"});
caurina.transitions.Tweener.addTween(mc, {_y:-50, _alpha:0, time:0.4, delay:1, transition:"easeOutCubic", onStart:function () {
MainGame.sndMngr.playSound("swoosh0");
}, onComplete:function () {
this.gotoAndStop(1);
}});
}
function loadTutorial(p) {
var _local4 = mx.utils.Delegate.create(MainGame.game, function () {
this.clearmap();
this.timer.start();
});
if (mc._currentframe == 1) {
MainGame.sndMngr.playSound("swoosh0");
caurina.transitions.Tweener.addTween(mc, {_x:0, _alpha:100, time:0.6, transition:"easeOutCubic", onComplete:_local4});
mc._x = 50;
mc._y = 0;
mc._alpha = 0;
MainGame.calltracker("c102353e", this, 10301, true);
}
mc.gotoAndStop(50 + p);
if (p < 4) {
jayc.common.utils.MCButton.makeMC(mc.btn_next);
mc.btn_next.onRelease2 = mx.utils.Delegate.create(this, function () {
MainGame.sndMngr.playSound("beep2");
this.loadTutorial(this.mc._currentframe - 49);
});
} else if (p == 7) {
jayc.common.utils.MCButton.makeMC(mc.btn_levels);
mc.btn_levels.onRelease2 = mx.utils.Delegate.create(this, function () {
MainGame.sndMngr.playSound("swoosh0");
caurina.transitions.Tweener.addTween(this.mc, {_y:-50, _alpha:0, time:0.3, transition:"easeOutCubic", onComplete:function () {
this.gotoAndStop(1);
MainGame.game.sleep(mx.utils.Delegate.create(MainGame.mainMenu, MainGame.mainMenu.reopenlevels));
MainGame.calltracker("3bf2ef82", this, 10301, true);
}});
});
}
jayc.common.utils.MCButton.makeMC(mc.btn_exit);
mc.btn_exit.onRelease2 = mx.utils.Delegate.create(this, function () {
MainGame.root.attachMovie("prompt", "prompt", 1048001, {_x:-150}).setType("okcancel", "Are you sure you want to the leave tutorial?", this, function () {
caurina.transitions.Tweener.addTween(MainGame.summary.mc, {_x:-50, _alpha:0, time:0.3, transition:"easeOutCubic", onComplete:function () {
this.gotoAndStop(1);
MainGame.mainMenu.mute_btn._visible = true;
MainGame.game.sleep(mx.utils.Delegate.create(MainGame.mainMenu, MainGame.mainMenu.reopenlevels));
MainGame.sndMngr.stopSound("bmg_game");
MainGame.root.stopAllSounds();
var _local2 = [31.2, 40, 57, 84, 102.5, 126.1, 144, 160, 168];
MainGame.sndMngr.playSound("bmg_main", _local2[int(Math.random() * 8)]);
}});
}, function () {
});
});
}
function showComplete() {
var _local5 = MainGame.timer;
var _local2 = MainGame.panel;
var _local3 = MainGame.ball;
delete N.NEngine.gfx.rootbuffer.onEnterFrame;
if (_local2.mc._currentframe > 3) {
return(undefined);
}
_local5.stop();
_local2.gridmc._visible = true;
_local2.mc.btn_stop.disabled();
_local2.mc.btn_pause.disabled();
_local2.mc.btn_walk.disabled();
MainGame.sndMngr.stopSound("bmg_game");
MainGame.root.stopAllSounds();
var _local12 = [31.2, 40, 57, 84, 102.5, 126.1, 144, 160, 168];
MainGame.sndMngr.playSound("bmg_main", _local12[int(Math.random() * 8)]);
if (MainGame.curmap.name == "Tutorial") {
if (mc._currentframe == 56) {
loadTutorial(7);
}
return(undefined);
}
mc._x = (mc._y = 0);
mc.gotoAndStop(6);
nxtl2 = mc.nxtl2;
nxtl2.gotoAndStop(1);
MainGame.sndMngr.playSound("swoosh0");
caurina.transitions.Tweener.addTween(mc, {_y:0, _alpha:100, time:0.5, delay:1, transition:"easeOutCubic", onComplete:mx.utils.Delegate.create(this, function () {
this.mc.onEnterFrame = mx.utils.Delegate.create(this, this.rollscore);
})});
mc._alpha = 0;
mc._y = 50;
if (int(_local3.dist) <= 1000) {
mc.travelled.text = int(_local3.dist) + ")";
} else {
mc.travelled.htmlText = ("<font color=\"#660000\">" + int(_local3.dist)) + "</font>)";
_local3.dist = 1000;
}
var _local7 = MainGame.curmap.ttime;
var _local4 = _local5.count;
mc.timebonus.text = ("(" + jayc.common.utils.Clock.strFormat(_local7, "mss", ":")) + " > ";
if (_local5.count <= _local7) {
mc.timebonus.text = mc.timebonus.text + (jayc.common.utils.Clock.strFormat(_local4, "mss", ":") + ") / 5");
} else {
mc.timebonus.htmlText = mc.timebonus.htmlText + (("<font color=\"#660000\">" + jayc.common.utils.Clock.strFormat(_local4, "mss", ":")) + "</font>) / 5");
}
mc.savedtiles.text = _local2.tilesaved;
tdist = int((1000 - int(_local3.dist)) * travel_m);
ttile = int(_local2.tilesaved * tile_m);
ttimeb = ((_local7 > _local4) ? (MainGame.curmap.tts) : 0);
mc.travelled_t.text = tdist;
mc.savedtiles_t.text = ttile;
mc.timebonus_t.text = ttimeb;
score = (tdist + ttile) + ttimeb;
tscore = 0;
mc.levelscore.text = "0";
lvltime = _local4;
jayc.common.utils.MCButton.makeMC(mc.btn_retry);
jayc.common.utils.MCButton.makeMC(mc.btn_levels);
jayc.common.utils.MCButton.makeMC(mc.btn_next);
jayc.common.utils.MCButton.makeMC(mc.btn_continue);
jayc.common.utils.MCButton.makeMC(mc.btn_submit);
jayc.common.utils.MCButton.makeMC(mc.btn_more);
mc.btn_submit._visible = false;
mc.btn_submit.disabled();
mc.btn_continue.disabled();
mc.yicon.gotoAndStop(20);
mc.yicon2.gotoAndStop(20);
mc.tts.text = PlayerProfiler.__get__active().info.tscore;
if (MainGame.maps[MainGame.curmap.nxt] && (MainGame.maps[MainGame.curmap.nxt].cat == MainGame.curmap.cat)) {
if (PlayerProfiler.__get__active().info.kys < MainGame.maps[MainGame.curmap.nxt].req) {
mc.licon.gotoAndStop(1);
} else {
mc.licon.gotoAndStop(2);
}
} else {
mc.licon.gotoAndStop(20);
mc.btn_next.disabled();
mc.btn_levels._x = mc.btn_next._x;
}
mc.btn_retry.onRelease2 = mx.utils.Delegate.create(this, function () {
if (this.tscore != this.score) {
this.finalizescore();
delete this.mc.onEnterFrame;
} else {
MainGame.sndMngr.playSound("swoosh0");
caurina.transitions.Tweener.addTween(this.mc, {_y:-50, _alpha:0, time:0.3, transition:"easeOutCubic", onComplete:function () {
this.gotoAndStop(1);
MainGame.game.loadlevel(MainGame.curmap.id);
}});
}
});
mc.btn_levels.onRelease2 = mx.utils.Delegate.create(this, function () {
if (this.tscore != this.score) {
this.finalizescore();
delete this.mc.onEnterFrame;
} else {
MainGame.sndMngr.playSound("swoosh0");
caurina.transitions.Tweener.addTween(this.mc, {_y:-50, _alpha:0, time:0.3, transition:"easeOutCubic", onComplete:function () {
this.gotoAndStop(1);
MainGame.game.sleep(mx.utils.Delegate.create(MainGame.mainMenu, MainGame.mainMenu.reopenlevels));
}});
}
});
mc.btn_next.onRelease2 = mx.utils.Delegate.create(this, function () {
if (this.tscore != this.score) {
this.finalizescore();
delete this.mc.onEnterFrame;
} else {
var _local3 = PlayerProfiler.__get__active().info.kys;
var _local2 = MainGame.maps[MainGame.curmap.nxt].req;
if (_local3 < _local2) {
MainGame.root.attachMovie("prompt", "prompt", 1048001, {_x:-150}).setType("ok2", ("You need " + (_local2 - _local3)) + " more key(s) to unlock the next level. Try again or select another level.");
} else {
this.showNextLevel();
}
}
});
mc.btn_more.onRelease2 = function () {
getURL ("http://armor.ag/MoreGames", "_blank");
};
mc.btn_submit.onRelease2 = mx.utils.Delegate.create(this, function () {
if (this.tscore != this.score) {
this.finalizescore();
delete this.mc.onEnterFrame;
} else {
var _local2 = PlayerProfiler.__get__active();
if (jayc.common.control.ScoreCtrl.apiID == 0) {
MainGame.root.attachMovie("prompt", "prompt", 1048001, {_x:-150}).setType("yesno", ((("\"" + _local2.name) + " the ") + PlayerProfiler.getTitle(_local2.id)) + "\"\nDo you want to submit your name & title?\nNo to submit your name only.", this, mx.utils.Delegate.create(this, function () {
this.mc.btn_submit.submitscore(PlayerProfiler.getTitle(PlayerProfiler.__get__active().id));
}), mx.utils.Delegate.create(this, function () {
this.mc.btn_submit.submitscore();
}));
} else {
jayc.common.control.ScoreCtrl.submit({score:_local2.info.tscore});
this.mc.btn_mainmenu.sumitted = true;
}
}
});
mc.btn_submit.submitscore = function (title) {
MainGame.summary.mc.gotoAndStop(8);
MainGame.summary.mc.btn_mainmenu.sumitted = true;
var _local2 = PlayerProfiler.__get__active();
var _local3 = _local2.name + (title ? (" the " + title) : "");
jayc.common.control.ScoreCtrl.submit({score:_local2.info.tscore, name:_local3, boardID:MainGame.mochiBoardID, onSuccessTarget:MainGame.summary, onSuccess:function () {
MainGame.root.attachMovie("prompt", "prompt", 1048001, {_x:-150}).setType("ok", "Score successfully submitted.");
this.mc.gotoAndStop(6);
this.mc.btn_mainmenu.sumitted = false;
}, onError:mx.utils.Delegate.create(MainGame.mainMenu, function (num, msg) {
MainGame.root.attachMovie("prompt", "prompt", 1048001, {_x:-150}).setType("ok2", ("Err" + num) + ": An error occured will trying to connect to the highscore table. Try again later or contact author if it persist.");
this.mc.gotoAndStop(6);
})});
};
if (jayc.common.control.ScoreCtrl.apiID == 3) {
mc.btn_next.btn_submit.onRelease2();
}
if (!MainGame.curmap.nxt) {
mc.btn_next.disabled();
mc.btn_levels.disabled();
mc.btn_submit.disabled();
mc.licon.gotoAndStop(20);
mc.btn_continue.disabled(1);
mc.btn_continue.onRelease2 = mx.utils.Delegate.create(this, function () {
caurina.transitions.Tweener.addTween(this.mc, {_y:-50, _alpha:0, time:0.4, transition:"easeOutCubic", onComplete:function () {
MainGame.summary.showFinishGame();
}});
});
mc.btn_continue._y = mc.btn_next._y;
}
}
function rollscore() {
var _local6 = MainGame.timer;
var _local5 = MainGame.panel;
var _local4 = MainGame.ball;
var _local2 = tscore;
var _local3;
if (tdist > 0) {
_local3 = Math.max(tdist * 0.05, 15);
_local2 = _local2 + _local3;
tdist = tdist - _local3;
if (tdist < 10) {
_local2 = _local2 + tdist;
tdist = 0;
}
mc.travelled_t.text = int(tdist);
} else if (ttile > 0) {
_local3 = Math.max(ttile * 0.05, 8);
_local2 = _local2 + _local3;
ttile = ttile - _local3;
if (ttile < 10) {
_local2 = _local2 + ttile;
ttile = 0;
}
mc.savedtiles_t.text = int(ttile);
} else if (ttimeb > 0) {
_local3 = Math.max(ttimeb * 0.05, 8);
_local2 = _local2 + _local3;
ttimeb = ttimeb - _local3;
if (ttimeb < 10) {
_local2 = _local2 + ttimeb;
ttimeb = 0;
}
mc.timebonus_t.text = int(ttimeb);
} else {
_local2 = score;
finalizescore();
delete mc.onEnterFrame;
tscore = int(_local2);
return(undefined);
}
mc.levelscore.text = int(_local2) + "";
tscore = _local2;
MainGame.sndMngr.playSound("beep0");
}
function finalizescore() {
var _local4 = MainGame.curmap.reward;
if (score > _local4[0]) {
mc.yicon.gotoAndStop(3);
if (score >= _local4[1]) {
mc.yicon2.gotoAndStop(4);
if (score >= _local4[2]) {
mc.yicon2.gotoAndStop(5);
if (score >= _local4[3]) {
mc.yicon2.gotoAndStop(6);
if (score >= _local4[4]) {
mc.yicon2.gotoAndStop(7);
}
}
}
}
mc.msg.text = "Recieved!";
} else {
mc.msg.htmlText = "<font color=\"#660000\">Score is below key score. You can do better.</font>";
}
mc.levelscore.text = score;
mc.travelled_t.text = "0";
mc.savedtiles_t.text = "0";
mc.timebonus_t.text = "0";
var _local3 = PlayerProfiler.__get__active();
var _local2 = _local3.lvls[MainGame.curmap.id];
var _local5 = 0;
var _local7 = PlayerProfiler.getTitle(_local3.id);
if (!mc.btn_next.enabled) {
mc.licon.gotoAndStop(20);
if (!_local2.goal) {
switch (MainGame.curmap.nxt) {
case "exer0" :
MainGame.calltracker("1f3b4c27", this, 10301, true);
break;
case "chal0" :
MainGame.calltracker("768854a9", this, 10301, true);
break;
case "strug0" :
MainGame.calltracker("c18c1c08", this, 10301, true);
break;
case "lim0" :
MainGame.calltracker("38b8103b", this, 10301, true);
break;
}
}
}
if (score >= _local2.score) {
_local2.score = score;
}
if (score > _local4[0]) {
_local5 = 1;
}
if ((mc.yicon2._currentframe > 3) && (mc.yicon2._currentframe < 8)) {
_local5 = mc.yicon2._currentframe - 2;
}
if (_local5 >= _local2.goal) {
_local2.goal = _local5;
}
_local2.rep++;
_local2.time = _local2.time + lvltime;
_local3.lvls[MainGame.curmap.id] = _local2;
tscore = score;
PlayerProfiler.updateProfile();
MainGame.sndMngr.playSound("beep3");
var _local6 = PlayerProfiler.getTitle(_local3.id);
if (_local7 == _local6) {
mc.msg.text = mc.msg.text + (((("\nYou`re still known as.. \"" + _local3.name) + " the ") + _local6) + "\"");
} else {
mc.msg.text = mc.msg.text + (((("\nYou`re renowned as.. \"" + _local3.name) + " the ") + _local6) + "\"");
}
if (mc.btn_next.enabled) {
if (PlayerProfiler.__get__active().info.kys >= MainGame.maps[MainGame.curmap.nxt].req) {
mc.licon.gotoAndStop(2);
} else {
mc.licon.gotoAndStop(1);
}
}
mc.tts.text = PlayerProfiler.__get__active().info.tscore;
}
function showNextLevel() {
if (nxtl2._currentframe != 1) {
return(undefined);
}
var _local2 = MainGame.maps[MainGame.curmap.nxt];
MainGame.sndMngr.playSound("swoosh0");
nxtl2.map = _local2;
nxtl2._x = -50;
nxtl2._alpha = 0;
nxtl2._visible = true;
nxtl2.enabled = true;
nxtl2.gotoAndStop(2);
nxtl2.tweening = true;
caurina.transitions.Tweener.addTween(nxtl2, {_x:0, _alpha:100, time:0.6, transition:"easeOutCubic"});
nxtl2.title.text = "Category " + _local2.cat;
nxtl2.subtitle.text = "Next Level: " + _local2.name;
jayc.common.utils.MCButton.makeMC(nxtl2.btn_back);
nxtl2.btn_back.onRelease = mx.utils.Delegate.create(this, function () {
MainGame.sndMngr.playSound("swoosh0");
caurina.transitions.Tweener.addTween(this.nxtl2, {_x:-50, _alpha:0, time:0.3, transition:"easeOutCubic", onComplete:function () {
this.gotoAndStop(1);
}});
});
nxtl2.desc.text = _local2.desc;
nxtl2.tbonus.text = ((jayc.common.utils.Clock.strFormat(_local2.ttime, "mss", ":") + " for ") + _local2.tts) + "pts";
nxtl2.kscore.text = _local2.reward[0];
nxtl2.bscore.text = _local2.reward[1];
nxtl2.sscore.text = _local2.reward[2];
nxtl2.gscore.text = _local2.reward[3];
jayc.common.utils.MCButton.makeMC(nxtl2.btn_play);
nxtl2.btn_play.onRelease = mx.utils.Delegate.create(this, function () {
MainGame.sndMngr.playSound("swoosh0");
caurina.transitions.Tweener.addTween(this.mc, {_y:-50, _alpha:0, time:0.3, transition:"easeOutCubic", onComplete:function () {
this.gotoAndStop(1);
MainGame.game.loadlevel(MainGame.curmap.nxt);
}});
});
}
function showFinishGame() {
mc._alpha = 0;
mc._y = 50;
mc.gotoAndStop(66);
caurina.transitions.Tweener.addTween(mc, {_y:0, _alpha:100, time:0.5, transition:"easeOutCubic"});
var _local2 = PlayerProfiler.__get__active();
mc.plyrname.text = _local2.name;
mc.ts.text = _local2.info.tscore;
mc.gtitle.text = ("the \"" + PlayerProfiler.getTitle(_local2.id)) + "\"";
mc.kcount.text = _local2.info.kys;
mc.bcount.text = _local2.info.brnz;
mc.scount.text = _local2.info.slvr;
mc.gcount.text = _local2.info.gld;
if ((!isNaN(_local2.info.star)) && (_local2.info.star > 0)) {
mc.starcount.text = _local2.info.star;
mc.staricon.gotoAndStop(7);
} else {
mc.starcount.text = "";
mc.staricon.gotoAndStop(20);
}
mc.ttp.text = jayc.common.utils.Clock.strFormat(_local2.info.ttime, "hmmss", ":");
mc.gc.text = Math.round((_local2.info.kys / (MainGame.mainMenu.mclevels.ttlmaps - 1)) * 100) + "%";
mc.btn_submit._visible = false;
mc.btn_hscore._visible = false;
jayc.common.utils.MCButton.makeMC(mc.btn_mainmenu);
jayc.common.utils.MCButton.makeMC(mc.btn_more);
mc.btn_more.onRelease2 = function () {
getURL ("http://armor.ag/MoreGames", "_blank");
};
if (jayc.common.control.ScoreCtrl.apiID != 0) {
mc.btn_hscore.disabled();
}
mc.btn_submit.onRelease2 = mx.utils.Delegate.create(this, function () {
if (this.tscore != this.score) {
this.finalizescore();
delete this.mc.onEnterFrame;
} else {
var _local2 = PlayerProfiler.__get__active();
if (jayc.common.control.ScoreCtrl.apiID == 0) {
MainGame.root.attachMovie("prompt", "prompt", 1048001, {_x:-150}).setType("yesno", ((("\"" + _local2.name) + " the ") + PlayerProfiler.getTitle(_local2.id)) + "\nSubmit name with title?\n\"No\" to submit name only.", this, mx.utils.Delegate.create(this, function () {
this.mc.btn_submit.submitscore(PlayerProfiler.getTitle(PlayerProfiler.__get__active().id));
}), mx.utils.Delegate.create(this, function () {
this.mc.btn_submit.submitscore();
}));
} else {
jayc.common.control.ScoreCtrl.submit({score:_local2.info.tscore});
this.mc.btn_mainmenu.sumitted = true;
}
}
});
mc.btn_submit.submitscore = function (title) {
MainGame.summary.mc.gotoAndStop(68);
MainGame.summary.mc.btn_mainmenu.sumitted = true;
var _local2 = PlayerProfiler.__get__active();
var _local3 = _local2.name + (title ? (" the " + title) : "");
jayc.common.control.ScoreCtrl.submit({score:_local2.info.tscore, name:_local3, boardID:MainGame.mochiBoardID, onSuccessTarget:MainGame.summary, onSuccess:function () {
MainGame.root.attachMovie("prompt", "prompt", 1048001, {_x:-150}).setType("ok", "Score successfully submitted.");
this.mc.gotoAndStop(66);
this.mc.btn_mainmenu.sumitted = false;
}, onError:mx.utils.Delegate.create(MainGame.mainMenu, function (num, msg) {
MainGame.root.attachMovie("prompt", "prompt", 1048001, {_x:-150}).setType("ok2", ("Err" + num) + ": An error occured will trying to connect to the highscore table. Try again later or contact author if it persist.");
this.mc.gotoAndStop(66);
})});
};
mc.btn_hscore.onRelease2 = mx.utils.Delegate.create(this, function () {
});
mc.btn_mainmenu.onRelease2 = mx.utils.Delegate.create(this, function () {
MainGame.sndMngr.playSound("swoosh0");
caurina.transitions.Tweener.addTween(this.mc, {_y:-50, _alpha:0, time:0.3, transition:"easeOutCubic", onComplete:function () {
this.gotoAndStop(1);
MainGame.game.sleep(mx.utils.Delegate.create(MainGame.mainMenu, MainGame.mainMenu.reopen));
}});
});
MainGame.calltracker("569cfd2e", this, 10301, true);
}
static var travel_m = 3;
static var time_m = 0.2;
static var tile_m = 40;
}
Symbol 643 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 644 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 645 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 646 MovieClip [__Packages.caurina.transitions.Tweener] Frame 0
class caurina.transitions.Tweener
{
static var _specialPropertySplitterList, _specialPropertyModifierList, _specialPropertyList, _transitionList, _currentTimeFrame, _currentTime, _tweenList;
function Tweener () {
}
static function addTween(p_scopes, p_parameters) {
if (p_scopes == undefined) {
return(false);
}
var _local3;
var _local7;
var _local2;
var _local11;
if (p_scopes instanceof Array) {
_local11 = p_scopes.concat();
} else {
_local11 = [p_scopes];
}
var _local5 = caurina.transitions.TweenListObj.makePropertiesChain(p_parameters);
if (!_inited) {
init();
}
if ((!_engineExists) || (_root[getControllerName()] == undefined)) {
startEngine();
}
var _local19 = (isNaN(_local5.time) ? 0 : (_local5.time));
var _local12 = (isNaN(_local5.delay) ? 0 : (_local5.delay));
var _local4 = new Object();
var _local24 = {time:true, delay:true, useFrames:true, skipUpdates:true, transition:true, transitionParams:true, onStart:true, onUpdate:true, onComplete:true, onOverwrite:true, onError:true, rounded:true, onStartParams:true, onUpdateParams:true, onCompleteParams:true, onOverwriteParams:true, onStartScope:true, onUpdateScope:true, onCompleteScope:true, onOverwriteScope:true, onErrorScope:true, quickAdd:true};
var _local13 = new Object();
for (_local2 in _local5) {
if (!_local24[_local2]) {
if (_specialPropertySplitterList[_local2] != undefined) {
var _local8 = _specialPropertySplitterList[_local2].splitValues(_local5[_local2], _specialPropertySplitterList[_local2].parameters);
_local3 = 0;
while (_local3 < _local8.length) {
if (_specialPropertySplitterList[_local8[_local3].name] != undefined) {
var _local9 = _specialPropertySplitterList[_local8[_local3].name].splitValues(_local8[_local3].value, _specialPropertySplitterList[_local8[_local3].name].parameters);
_local7 = 0;
while (_local7 < _local9.length) {
_local4[_local9[_local7].name] = {valueStart:undefined, valueComplete:_local9[_local7].value, arrayIndex:_local9[_local7].arrayIndex, isSpecialProperty:false};
_local7++;
}
} else {
_local4[_local8[_local3].name] = {valueStart:undefined, valueComplete:_local8[_local3].value, arrayIndex:_local8[_local3].arrayIndex, isSpecialProperty:false};
}
_local3++;
}
} else if (_specialPropertyModifierList[_local2] != undefined) {
var _local10 = _specialPropertyModifierList[_local2].modifyValues(_local5[_local2]);
_local3 = 0;
while (_local3 < _local10.length) {
_local13[_local10[_local3].name] = {modifierParameters:_local10[_local3].parameters, modifierFunction:_specialPropertyModifierList[_local2].getValue};
_local3++;
}
} else {
_local4[_local2] = {valueStart:undefined, valueComplete:_local5[_local2]};
}
}
}
for (_local2 in _local4) {
if (_specialPropertyList[_local2] != undefined) {
_local4[_local2].isSpecialProperty = true;
} else if (_local11[0][_local2] == undefined) {
printError(((("The property '" + _local2) + "' doesn't seem to be a normal object property of ") + _local11[0].toString()) + " or a registered special property.");
}
}
for (_local2 in _local13) {
if (_local4[_local2] != undefined) {
_local4[_local2].modifierParameters = _local13[_local2].modifierParameters;
_local4[_local2].modifierFunction = _local13[_local2].modifierFunction;
}
}
var _local21;
if (typeof(_local5.transition) == "string") {
var _local26 = _local5.transition.toLowerCase();
_local21 = _transitionList[_local26];
} else {
_local21 = _local5.transition;
}
if (_local21 == undefined) {
_local21 = _transitionList.easeoutexpo;
}
var _local14;
var _local6;
var _local20;
_local3 = 0;
while (_local3 < _local11.length) {
_local14 = new Object();
for (_local2 in _local4) {
_local14[_local2] = new caurina.transitions.PropertyInfoObj(_local4[_local2].valueStart, _local4[_local2].valueComplete, _local4[_local2].valueComplete, _local4[_local2].arrayIndex, {}, _local4[_local2].isSpecialProperty, _local4[_local2].modifierFunction, _local4[_local2].modifierParameters);
}
if (_local5.useFrames == true) {
_local6 = new caurina.transitions.TweenListObj(_local11[_local3], _currentTimeFrame + (_local12 / _timeScale), _currentTimeFrame + ((_local12 + _local19) / _timeScale), true, _local21, _local5.transitionParams);
} else {
_local6 = new caurina.transitions.TweenListObj(_local11[_local3], _currentTime + ((_local12 * 1000) / _timeScale), _currentTime + (((_local12 * 1000) + (_local19 * 1000)) / _timeScale), false, _local21, _local5.transitionParams);
}
_local6.properties = _local14;
_local6.onStart = _local5.onStart;
_local6.onUpdate = _local5.onUpdate;
_local6.onComplete = _local5.onComplete;
_local6.onOverwrite = _local5.onOverwrite;
_local6.onError = _local5.onError;
_local6.onStartParams = _local5.onStartParams;
_local6.onUpdateParams = _local5.onUpdateParams;
_local6.onCompleteParams = _local5.onCompleteParams;
_local6.onOverwriteParams = _local5.onOverwriteParams;
_local6.onStartScope = _local5.onStartScope;
_local6.onUpdateScope = _local5.onUpdateScope;
_local6.onCompleteScope = _local5.onCompleteScope;
_local6.onOverwriteScope = _local5.onOverwriteScope;
_local6.onErrorScope = _local5.onErrorScope;
_local6.rounded = _local5.rounded;
_local6.skipUpdates = _local5.skipUpdates;
if (!_local5.quickAdd) {
removeTweensByTime(_local6.scope, _local6.properties, _local6.timeStart, _local6.timeComplete);
}
_tweenList.push(_local6);
if ((_local19 == 0) && (_local12 == 0)) {
_local20 = _tweenList.length - 1;
updateTweenByIndex(_local20);
removeTweenByIndex(_local20);
}
_local3++;
}
return(true);
}
static function addCaller(p_scopes, p_parameters) {
if (p_scopes == undefined) {
return(false);
}
var _local5;
var _local6;
if (p_scopes instanceof Array) {
_local6 = p_scopes.concat();
} else {
_local6 = [p_scopes];
}
var _local3 = p_parameters;
if (!_inited) {
init();
}
if ((!_engineExists) || (_root[getControllerName()] == undefined)) {
startEngine();
}
var _local7 = (isNaN(_local3.time) ? 0 : (_local3.time));
var _local4 = (isNaN(_local3.delay) ? 0 : (_local3.delay));
var _local9;
if (typeof(_local3.transition) == "string") {
var _local11 = _local3.transition.toLowerCase();
_local9 = _transitionList[_local11];
} else {
_local9 = _local3.transition;
}
if (_local9 == undefined) {
_local9 = _transitionList.easeoutexpo;
}
var _local2;
var _local8;
_local5 = 0;
while (_local5 < _local6.length) {
if (_local3.useFrames == true) {
_local2 = new caurina.transitions.TweenListObj(_local6[_local5], _currentTimeFrame + (_local4 / _timeScale), _currentTimeFrame + ((_local4 + _local7) / _timeScale), true, _local9, _local3.transitionParams);
} else {
_local2 = new caurina.transitions.TweenListObj(_local6[_local5], _currentTime + ((_local4 * 1000) / _timeScale), _currentTime + (((_local4 * 1000) + (_local7 * 1000)) / _timeScale), false, _local9, _local3.transitionParams);
}
_local2.properties = undefined;
_local2.onStart = _local3.onStart;
_local2.onUpdate = _local3.onUpdate;
_local2.onComplete = _local3.onComplete;
_local2.onOverwrite = _local3.onOverwrite;
_local2.onStartParams = _local3.onStartParams;
_local2.onUpdateParams = _local3.onUpdateParams;
_local2.onCompleteParams = _local3.onCompleteParams;
_local2.onOverwriteParams = _local3.onOverwriteParams;
_local2.onStartScope = _local3.onStartScope;
_local2.onUpdateScope = _local3.onUpdateScope;
_local2.onCompleteScope = _local3.onCompleteScope;
_local2.onOverwriteScope = _local3.onOverwriteScope;
_local2.onErrorScope = _local3.onErrorScope;
_local2.isCaller = true;
_local2.count = _local3.count;
_local2.waitFrames = _local3.waitFrames;
_tweenList.push(_local2);
if ((_local7 == 0) && (_local4 == 0)) {
_local8 = _tweenList.length - 1;
updateTweenByIndex(_local8);
removeTweenByIndex(_local8);
}
_local5++;
}
return(true);
}
static function removeTweensByTime(p_scope, p_properties, p_timeStart, p_timeComplete) {
var _local5 = false;
var _local4;
var _local1;
var _local7 = _tweenList.length;
var _local2;
_local1 = 0;
while (_local1 < _local7) {
if (p_scope == _tweenList[_local1].scope) {
if ((p_timeComplete > _tweenList[_local1].timeStart) && (p_timeStart < _tweenList[_local1].timeComplete)) {
_local4 = false;
for (_local2 in _tweenList[_local1].properties) {
if (p_properties[_local2] != undefined) {
if (_tweenList[_local1].onOverwrite != undefined) {
var _local3 = ((_tweenList[_local1].onOverwriteScope != undefined) ? (_tweenList[_local1].onOverwriteScope) : (_tweenList[_local1].scope));
try {
_tweenList[_local1].onOverwrite.apply(_local3, _tweenList[_local1].onOverwriteParams);
} catch(e:Error) {
handleError(_tweenList[_local1], e, "onOverwrite");
}
}
_tweenList[_local1].properties[_local2] = undefined;
delete _tweenList[_local1].properties[_local2];
_local4 = true;
_local5 = true;
}
}
if (_local4) {
if (caurina.transitions.AuxFunctions.getObjectLength(_tweenList[_local1].properties) == 0) {
removeTweenByIndex(_local1);
}
}
}
}
_local1++;
}
return(_local5);
}
static function removeTweens(p_scope) {
var _local3 = new Array();
var _local2;
_local2 = 1;
while (_local2 < arguments.length) {
if ((typeof(arguments[_local2]) == "string") && (!caurina.transitions.AuxFunctions.isInArray(arguments[_local2], _local3))) {
_local3.push(arguments[_local2]);
}
_local2++;
}
return(affectTweens(removeTweenByIndex, p_scope, _local3));
}
static function removeAllTweens() {
var _local2 = false;
var _local1;
_local1 = 0;
while (_local1 < _tweenList.length) {
removeTweenByIndex(_local1);
_local2 = true;
_local1++;
}
return(_local2);
}
static function pauseTweens(p_scope) {
var _local3 = new Array();
var _local2;
_local2 = 1;
while (_local2 < arguments.length) {
if ((typeof(arguments[_local2]) == "string") && (!caurina.transitions.AuxFunctions.isInArray(arguments[_local2], _local3))) {
_local3.push(arguments[_local2]);
}
_local2++;
}
return(affectTweens(pauseTweenByIndex, p_scope, _local3));
}
static function pauseAllTweens() {
var _local2 = false;
var _local1;
_local1 = 0;
while (_local1 < _tweenList.length) {
pauseTweenByIndex(_local1);
_local2 = true;
_local1++;
}
return(_local2);
}
static function resumeTweens(p_scope) {
var _local3 = new Array();
var _local2;
_local2 = 1;
while (_local2 < arguments.length) {
if ((typeof(arguments[_local2]) == "string") && (!caurina.transitions.AuxFunctions.isInArray(arguments[_local2], _local3))) {
_local3.push(arguments[_local2]);
}
_local2++;
}
return(affectTweens(resumeTweenByIndex, p_scope, _local3));
}
static function resumeAllTweens() {
var _local2 = false;
var _local1;
_local1 = 0;
while (_local1 < _tweenList.length) {
resumeTweenByIndex(_local1);
_local2 = true;
_local1++;
}
return(_local2);
}
static function affectTweens(p_affectFunction, p_scope, p_properties) {
var _local5 = false;
var _local2;
if (!_tweenList) {
return(false);
}
_local2 = 0;
while (_local2 < _tweenList.length) {
if (_tweenList[_local2].scope == p_scope) {
if (p_properties.length == 0) {
p_affectFunction(_local2);
_local5 = true;
} else {
var _local4 = new Array();
var _local1;
_local1 = 0;
while (_local1 < p_properties.length) {
if (_tweenList[_local2].properties[p_properties[_local1]] != undefined) {
_local4.push(p_properties[_local1]);
}
_local1++;
}
if (_local4.length > 0) {
var _local7 = caurina.transitions.AuxFunctions.getObjectLength(_tweenList[_local2].properties);
if (_local7 == _local4.length) {
p_affectFunction(_local2);
_local5 = true;
} else {
var _local8 = splitTweens(_local2, _local4);
p_affectFunction(_local8);
_local5 = true;
}
}
}
}
_local2++;
}
return(_local5);
}
static function splitTweens(p_tween, p_properties) {
var _local6 = _tweenList[p_tween];
var _local5 = _local6.clone(false);
var _local1;
var _local2;
_local1 = 0;
while (_local1 < p_properties.length) {
_local2 = p_properties[_local1];
if (_local6.properties[_local2] != undefined) {
_local6.properties[_local2] = undefined;
delete _local6.properties[_local2];
}
_local1++;
}
var _local4;
for (_local2 in _local5.properties) {
_local4 = false;
_local1 = 0;
while (_local1 < p_properties.length) {
if (p_properties[_local1] == _local2) {
_local4 = true;
break;
}
_local1++;
}
if (!_local4) {
_local5.properties[_local2] = undefined;
delete _local5.properties[_local2];
}
}
_tweenList.push(_local5);
return(_tweenList.length - 1);
}
static function updateTweens() {
if (_tweenList.length == 0) {
return(false);
}
var _local1;
_local1 = 0;
while (_local1 < _tweenList.length) {
if (!_tweenList[_local1].isPaused) {
if (!updateTweenByIndex(_local1)) {
removeTweenByIndex(_local1);
}
if (_tweenList[_local1] == null) {
removeTweenByIndex(_local1, true);
_local1--;
}
}
_local1++;
}
return(true);
}
static function removeTweenByIndex(p_tween, p_finalRemoval) {
_tweenList[p_tween] = null;
if (p_finalRemoval) {
_tweenList.splice(p_tween, 1);
}
return(true);
}
static function pauseTweenByIndex(p_tween) {
var _local1 = _tweenList[p_tween];
if ((_local1 == null) || (_local1.isPaused)) {
return(false);
}
_local1.timePaused = getCurrentTweeningTime(_local1);
_local1.isPaused = true;
return(true);
}
static function resumeTweenByIndex(p_tween) {
var _local1 = _tweenList[p_tween];
if ((_local1 == null) || (!_local1.isPaused)) {
return(false);
}
var _local2 = getCurrentTweeningTime(_local1);
_local1.timeStart = _local1.timeStart + (_local2 - _local1.timePaused);
_local1.timeComplete = _local1.timeComplete + (_local2 - _local1.timePaused);
_local1.timePaused = undefined;
_local1.isPaused = false;
return(true);
}
static function updateTweenByIndex(i) {
var _local1 = _tweenList[i];
if ((_local1 == null) || (!_local1.scope)) {
return(false);
}
var _local13 = false;
var _local14;
var _local3;
var _local7;
var _local10;
var _local9;
var _local6;
var _local2;
var _local12;
var _local5;
var _local8 = getCurrentTweeningTime(_local1);
var _local4;
if (_local8 >= _local1.timeStart) {
_local5 = _local1.scope;
if (_local1.isCaller) {
do {
_local7 = ((_local1.timeComplete - _local1.timeStart) / _local1.count) * (_local1.timesCalled + 1);
_local10 = _local1.timeStart;
_local9 = _local1.timeComplete - _local1.timeStart;
_local6 = _local1.timeComplete - _local1.timeStart;
_local3 = _local1.transition(_local7, _local10, _local9, _local6, _local1.transitionParams);
if (_local8 >= _local3) {
if (_local1.onUpdate != undefined) {
_local12 = ((_local1.onUpdateScope != undefined) ? (_local1.onUpdateScope) : (_local5));
try {
_local1.onUpdate.apply(_local12, _local1.onUpdateParams);
} catch(e:Error) {
handleError(_local1, e, "onUpdate");
}
}
_local1.timesCalled++;
if (_local1.timesCalled >= _local1.count) {
_local13 = true;
break;
}
if (_local1.waitFrames) {
break;
}
}
} while (_local8 >= _local3);
} else {
_local14 = ((_local1.skipUpdates < 1) || (_local1.skipUpdates == undefined)) || (_local1.updatesSkipped >= _local1.skipUpdates);
if (_local8 >= _local1.timeComplete) {
_local13 = true;
_local14 = true;
}
if (!_local1.hasStarted) {
if (_local1.onStart != undefined) {
_local12 = ((_local1.onStartScope != undefined) ? (_local1.onStartScope) : (_local5));
try {
_local1.onStart.apply(_local12, _local1.onStartParams);
} catch(e:Error) {
handleError(_local1, e, "onStart");
}
}
var _local11;
for (_local2 in _local1.properties) {
if (_local1.properties[_local2].isSpecialProperty) {
if (_specialPropertyList[_local2].preProcess != undefined) {
_local1.properties[_local2].valueComplete = _specialPropertyList[_local2].preProcess(_local5, _specialPropertyList[_local2].parameters, _local1.properties[_local2].originalValueComplete, _local1.properties[_local2].extra);
}
_local11 = _specialPropertyList[_local2].getValue(_local5, _specialPropertyList[_local2].parameters, _local1.properties[_local2].extra);
} else {
_local11 = _local5[_local2];
}
_local1.properties[_local2].valueStart = (isNaN(_local11) ? (_local1.properties[_local2].valueComplete) : (_local11));
}
_local14 = true;
_local1.hasStarted = true;
}
if (_local14) {
for (_local2 in _local1.properties) {
_local4 = _local1.properties[_local2];
if (_local13) {
_local3 = _local4.valueComplete;
} else if (_local4.hasModifier) {
_local7 = _local8 - _local1.timeStart;
_local6 = _local1.timeComplete - _local1.timeStart;
_local3 = _local1.transition(_local7, 0, 1, _local6, _local1.transitionParams);
_local3 = _local4.modifierFunction(_local4.valueStart, _local4.valueComplete, _local3, _local4.modifierParameters);
} else {
_local7 = _local8 - _local1.timeStart;
_local10 = _local4.valueStart;
_local9 = _local4.valueComplete - _local4.valueStart;
_local6 = _local1.timeComplete - _local1.timeStart;
_local3 = _local1.transition(_local7, _local10, _local9, _local6, _local1.transitionParams);
}
if (_local1.rounded) {
_local3 = Math.round(_local3);
}
if (_local4.isSpecialProperty) {
_specialPropertyList[_local2].setValue(_local5, _local3, _specialPropertyList[_local2].parameters, _local1.properties[_local2].extra);
} else {
_local5[_local2] = _local3;
}
}
_local1.updatesSkipped = 0;
if (_local1.onUpdate != undefined) {
_local12 = ((_local1.onUpdateScope != undefined) ? (_local1.onUpdateScope) : (_local5));
try {
_local1.onUpdate.apply(_local12, _local1.onUpdateParams);
} catch(e:Error) {
handleError(_local1, e, "onUpdate");
}
}
} else {
_local1.updatesSkipped++;
}
}
if (_local13 && (_local1.onComplete != undefined)) {
_local12 = ((_local1.onCompleteScope != undefined) ? (_local1.onCompleteScope) : (_local5));
try {
_local1.onComplete.apply(_local12, _local1.onCompleteParams);
} catch(e:Error) {
handleError(_local1, e, "onComplete");
}
}
return(!_local13);
}
return(true);
}
static function init() {
_inited = true;
_transitionList = new Object();
caurina.transitions.Equations.init();
_specialPropertyList = new Object();
_specialPropertyModifierList = new Object();
_specialPropertySplitterList = new Object();
}
static function registerTransition(p_name, p_function) {
if (!_inited) {
init();
}
_transitionList[p_name] = p_function;
}
static function registerSpecialProperty(p_name, p_getFunction, p_setFunction, p_parameters, p_preProcessFunction) {
if (!_inited) {
init();
}
var _local1 = new caurina.transitions.SpecialProperty(p_getFunction, p_setFunction, p_parameters, p_preProcessFunction);
_specialPropertyList[p_name] = _local1;
}
static function registerSpecialPropertyModifier(p_name, p_modifyFunction, p_getFunction) {
if (!_inited) {
init();
}
var _local1 = new caurina.transitions.SpecialPropertyModifier(p_modifyFunction, p_getFunction);
_specialPropertyModifierList[p_name] = _local1;
}
static function registerSpecialPropertySplitter(p_name, p_splitFunction, p_parameters) {
if (!_inited) {
init();
}
var _local1 = new caurina.transitions.SpecialPropertySplitter(p_splitFunction, p_parameters);
_specialPropertySplitterList[p_name] = _local1;
}
static function startEngine() {
_engineExists = true;
_tweenList = new Array();
var _local2 = Math.floor(Math.random() * 999999);
var _local3 = _root.createEmptyMovieClip(getControllerName(), 31338 + _local2);
_local3.onEnterFrame = function () {
caurina.transitions.Tweener.onEnterFrame();
};
_currentTimeFrame = 0;
updateTime();
}
static function stopEngine() {
_engineExists = false;
_tweenList = null;
_currentTime = 0;
_currentTimeFrame = 0;
delete _root[getControllerName()].onEnterFrame;
_root[getControllerName()].removeMovieClip();
}
static function updateTime() {
_currentTime = getTimer();
}
static function updateFrame() {
_currentTimeFrame++;
}
static function onEnterFrame() {
updateTime();
updateFrame();
var _local1 = false;
_local1 = updateTweens();
if (!_local1) {
stopEngine();
}
}
static function setTimeScale(p_time) {
var _local1;
var _local2;
if (isNaN(p_time)) {
p_time = 1;
}
if (p_time < 1E-5) {
p_time = 1E-5;
}
if (p_time != _timeScale) {
_local1 = 0;
while (_local1 < _tweenList.length) {
_local2 = getCurrentTweeningTime(_tweenList[_local1]);
_tweenList[_local1].timeStart = _local2 - (((_local2 - _tweenList[_local1].timeStart) * _timeScale) / p_time);
_tweenList[_local1].timeComplete = _local2 - (((_local2 - _tweenList[_local1].timeComplete) * _timeScale) / p_time);
if (_tweenList[_local1].timePaused != undefined) {
_tweenList[_local1].timePaused = _local2 - (((_local2 - _tweenList[_local1].timePaused) * _timeScale) / p_time);
}
_local1++;
}
_timeScale = p_time;
}
}
static function isTweening(p_scope) {
var _local1;
_local1 = 0;
while (_local1 < _tweenList.length) {
if (_tweenList[_local1].scope == p_scope) {
return(true);
}
_local1++;
}
return(false);
}
static function getTweens(p_scope) {
var _local1;
var _local2;
var _local3 = new Array();
_local1 = 0;
while (_local1 < _tweenList.length) {
if (_tweenList[_local1].scope == p_scope) {
for (_local2 in _tweenList[_local1].properties) {
_local3.push(_local2);
}
}
_local1++;
}
return(_local3);
}
static function getTweenCount(p_scope) {
var _local1;
var _local2 = 0;
_local1 = 0;
while (_local1 < _tweenList.length) {
if (_tweenList[_local1].scope == p_scope) {
_local2 = _local2 + caurina.transitions.AuxFunctions.getObjectLength(_tweenList[_local1].properties);
}
_local1++;
}
return(_local2);
}
static function handleError(pTweening, pError, pCallBackName) {
if ((pTweening.onError != undefined) && (typeof(pTweening.onError == "function"))) {
var _local3 = ((pTweening.onErrorScope != undefined) ? (pTweening.onErrorScope) : (pTweening.scope));
try {
pTweening.onError.apply(_local3, [pTweening.scope, pError]);
} catch(metaError:Error) {
printError((((pTweening.scope.toString() + " raised an error while executing the 'onError' handler. Original error:\n ") + pError) + "\nonError error: ") + metaError);
}
} else if (pTweening.onError == undefined) {
printError((((pTweening.scope.toString() + " raised an error while executing the '") + pCallBackName.toString()) + "'handler. \n") + pError);
}
}
static function getCurrentTweeningTime(p_tweening) {
return((p_tweening.useFrames ? (_currentTimeFrame) : (_currentTime)));
}
static function getVersion() {
return("AS2 1.31.71");
}
static function getControllerName() {
return("__tweener_controller__" + getVersion());
}
static function printError(p_message) {
}
static var _engineExists = false;
static var _inited = false;
static var _timeScale = 1;
}
Symbol 647 MovieClip [__Packages.caurina.transitions.TweenListObj] Frame 0
class caurina.transitions.TweenListObj
{
var scope, timeStart, timeComplete, useFrames, transition, transitionParams, properties, isPaused, timePaused, isCaller, updatesSkipped, timesCalled, skipUpdates, hasStarted, onStart, onUpdate, onComplete, onOverwrite, onError, onStartParams, onUpdateParams, onCompleteParams, onOverwriteParams, onStartScope, onUpdateScope, onCompleteScope, onOverwriteScope, onErrorScope, rounded, count, waitFrames;
function TweenListObj (p_scope, p_timeStart, p_timeComplete, p_useFrames, p_transition, p_transitionParams) {
scope = p_scope;
timeStart = p_timeStart;
timeComplete = p_timeComplete;
useFrames = p_useFrames;
transition = p_transition;
transitionParams = p_transitionParams;
properties = new Object();
isPaused = false;
timePaused = undefined;
isCaller = false;
updatesSkipped = 0;
timesCalled = 0;
skipUpdates = 0;
hasStarted = false;
}
function clone(omitEvents) {
var _local2 = new caurina.transitions.TweenListObj(scope, timeStart, timeComplete, useFrames, transition, transitionParams);
_local2.properties = new Object();
for (var _local3 in properties) {
_local2.properties[_local3] = properties[_local3].clone();
}
_local2.skipUpdates = skipUpdates;
_local2.updatesSkipped = updatesSkipped;
if (!omitEvents) {
_local2.onStart = onStart;
_local2.onUpdate = onUpdate;
_local2.onComplete = onComplete;
_local2.onOverwrite = onOverwrite;
_local2.onError = onError;
_local2.onStartParams = onStartParams;
_local2.onUpdateParams = onUpdateParams;
_local2.onCompleteParams = onCompleteParams;
_local2.onOverwriteParams = onOverwriteParams;
_local2.onStartScope = onStartScope;
_local2.onUpdateScope = onUpdateScope;
_local2.onCompleteScope = onCompleteScope;
_local2.onOverwriteScope = onOverwriteScope;
_local2.onErrorScope = onErrorScope;
}
_local2.rounded = rounded;
_local2.isPaused = isPaused;
_local2.timePaused = timePaused;
_local2.isCaller = isCaller;
_local2.count = count;
_local2.timesCalled = timesCalled;
_local2.waitFrames = waitFrames;
_local2.hasStarted = hasStarted;
return(_local2);
}
function toString() {
var _local2 = "\n[TweenListObj ";
_local2 = _local2 + ("scope:" + String(scope));
_local2 = _local2 + ", properties:";
var _local3 = true;
for (var _local4 in properties) {
if (!_local3) {
_local2 = _local2 + ",";
}
_local2 = _local2 + ("[name:" + properties[_local4].name);
_local2 = _local2 + (",valueStart:" + properties[_local4].valueStart);
_local2 = _local2 + (",valueComplete:" + properties[_local4].valueComplete);
_local2 = _local2 + "]";
_local3 = false;
}
_local2 = _local2 + (", timeStart:" + String(timeStart));
_local2 = _local2 + (", timeComplete:" + String(timeComplete));
_local2 = _local2 + (", useFrames:" + String(useFrames));
_local2 = _local2 + (", transition:" + String(transition));
_local2 = _local2 + (", transitionParams:" + String(transitionParams));
if (skipUpdates) {
_local2 = _local2 + (", skipUpdates:" + String(skipUpdates));
}
if (updatesSkipped) {
_local2 = _local2 + (", updatesSkipped:" + String(updatesSkipped));
}
if (onStart) {
_local2 = _local2 + (", onStart:" + String(onStart));
}
if (onUpdate) {
_local2 = _local2 + (", onUpdate:" + String(onUpdate));
}
if (onComplete) {
_local2 = _local2 + (", onComplete:" + String(onComplete));
}
if (onOverwrite) {
_local2 = _local2 + (", onOverwrite:" + String(onOverwrite));
}
if (onError) {
_local2 = _local2 + (", onError:" + String(onError));
}
if (onStartParams) {
_local2 = _local2 + (", onStartParams:" + String(onStartParams));
}
if (onUpdateParams) {
_local2 = _local2 + (", onUpdateParams:" + String(onUpdateParams));
}
if (onCompleteParams) {
_local2 = _local2 + (", onCompleteParams:" + String(onCompleteParams));
}
if (onOverwriteParams) {
_local2 = _local2 + (", onOverwriteParams:" + String(onOverwriteParams));
}
if (onStartScope) {
_local2 = _local2 + (", onStartScope:" + String(onStartScope));
}
if (onUpdateScope) {
_local2 = _local2 + (", onUpdateScope:" + String(onUpdateScope));
}
if (onCompleteScope) {
_local2 = _local2 + (", onCompleteScope:" + String(onCompleteScope));
}
if (onOverwriteScope) {
_local2 = _local2 + (", onOverwriteScope:" + String(onOverwriteScope));
}
if (onErrorScope) {
_local2 = _local2 + (", onErrorScope:" + String(onErrorScope));
}
if (rounded) {
_local2 = _local2 + (", rounded:" + String(rounded));
}
if (isPaused) {
_local2 = _local2 + (", isPaused:" + String(isPaused));
}
if (timePaused) {
_local2 = _local2 + (", timePaused:" + String(timePaused));
}
if (isCaller) {
_local2 = _local2 + (", isCaller:" + String(isCaller));
}
if (count) {
_local2 = _local2 + (", count:" + String(count));
}
if (timesCalled) {
_local2 = _local2 + (", timesCalled:" + String(timesCalled));
}
if (waitFrames) {
_local2 = _local2 + (", waitFrames:" + String(waitFrames));
}
if (hasStarted) {
_local2 = _local2 + (", hasStarted:" + String(hasStarted));
}
_local2 = _local2 + "]\n";
return(_local2);
}
static function makePropertiesChain(p_obj) {
var _local6 = p_obj.base;
if (_local6) {
var _local5 = {};
var _local2;
if (_local6 instanceof Array) {
_local2 = [];
var _local3 = 0;
while (_local3 < _local6.length) {
_local2.push(_local6[_local3]);
_local3++;
}
} else {
_local2 = [_local6];
}
_local2.push(p_obj);
var _local4;
var _local7 = _local2.length;
var _local1 = 0;
while (_local1 < _local7) {
if (_local2[_local1].base) {
_local4 = caurina.transitions.AuxFunctions.concatObjects(makePropertiesChain(_local2[_local1].base), _local2[_local1]);
} else {
_local4 = _local2[_local1];
}
_local5 = caurina.transitions.AuxFunctions.concatObjects(_local5, _local4);
_local1++;
}
if (_local5.base) {
delete _local5.base;
}
return(_local5);
}
return(p_obj);
}
}
Symbol 648 MovieClip [__Packages.caurina.transitions.AuxFunctions] Frame 0
class caurina.transitions.AuxFunctions
{
function AuxFunctions () {
}
static function numberToR(p_num) {
return((p_num & 16711680) >> 16);
}
static function numberToG(p_num) {
return((p_num & 65280) >> 8);
}
static function numberToB(p_num) {
return(p_num & 255);
}
static function isInArray(p_string, p_array) {
var _local2 = p_array.length;
var _local1 = 0;
while (_local1 < _local2) {
if (p_array[_local1] == p_string) {
return(true);
}
_local1++;
}
return(false);
}
static function getObjectLength(p_object) {
var _local1 = 0;
for (var _local2 in p_object) {
_local1++;
}
return(_local1);
}
static function concatObjects() {
var _local4 = {};
var _local2;
var _local3 = 0;
while (_local3 < arguments.length) {
_local2 = arguments[_local3];
for (var _local5 in _local2) {
if (_local2[_local5] == null) {
delete _local4[_local5];
} else {
_local4[_local5] = _local2[_local5];
}
}
_local3++;
}
return(_local4);
}
}
Symbol 649 MovieClip [__Packages.caurina.transitions.PropertyInfoObj] Frame 0
class caurina.transitions.PropertyInfoObj
{
var valueStart, valueComplete, originalValueComplete, arrayIndex, extra, isSpecialProperty, hasModifier, modifierFunction, modifierParameters;
function PropertyInfoObj (p_valueStart, p_valueComplete, p_originalValueComplete, p_arrayIndex, p_extra, p_isSpecialProperty, p_modifierFunction, p_modifierParameters) {
valueStart = p_valueStart;
valueComplete = p_valueComplete;
originalValueComplete = p_originalValueComplete;
arrayIndex = p_arrayIndex;
extra = p_extra;
isSpecialProperty = p_isSpecialProperty;
hasModifier = p_modifierFunction != undefined;
modifierFunction = p_modifierFunction;
modifierParameters = p_modifierParameters;
}
function clone() {
var _local2 = new caurina.transitions.PropertyInfoObj(valueStart, valueComplete, originalValueComplete, arrayIndex, extra, isSpecialProperty, modifierFunction, modifierParameters);
return(_local2);
}
function toString() {
var _local2 = "\n[PropertyInfoObj ";
_local2 = _local2 + ("valueStart:" + String(valueStart));
_local2 = _local2 + ", ";
_local2 = _local2 + ("valueComplete:" + String(valueComplete));
_local2 = _local2 + ", ";
_local2 = _local2 + ("originalValueComplete:" + String(originalValueComplete));
_local2 = _local2 + ", ";
_local2 = _local2 + ("arrayIndex:" + String(arrayIndex));
_local2 = _local2 + ", ";
_local2 = _local2 + ("extra:" + String(extra));
_local2 = _local2 + ", ";
_local2 = _local2 + ("isSpecialProperty:" + String(isSpecialProperty));
_local2 = _local2 + ", ";
_local2 = _local2 + ("hasModifier:" + String(hasModifier));
_local2 = _local2 + ", ";
_local2 = _local2 + ("modifierFunction:" + String(modifierFunction));
_local2 = _local2 + ", ";
_local2 = _local2 + ("modifierParameters:" + String(modifierParameters));
_local2 = _local2 + "]\n";
return(_local2);
}
}
Symbol 650 MovieClip [__Packages.caurina.transitions.Equations] Frame 0
class caurina.transitions.Equations
{
function Equations () {
}
static function init() {
caurina.transitions.Tweener.registerTransition("easenone", easeNone);
caurina.transitions.Tweener.registerTransition("linear", easeNone);
caurina.transitions.Tweener.registerTransition("easeinquad", easeInQuad);
caurina.transitions.Tweener.registerTransition("easeoutquad", easeOutQuad);
caurina.transitions.Tweener.registerTransition("easeinoutquad", easeInOutQuad);
caurina.transitions.Tweener.registerTransition("easeoutinquad", easeOutInQuad);
caurina.transitions.Tweener.registerTransition("easeincubic", easeInCubic);
caurina.transitions.Tweener.registerTransition("easeoutcubic", easeOutCubic);
caurina.transitions.Tweener.registerTransition("easeinoutcubic", easeInOutCubic);
caurina.transitions.Tweener.registerTransition("easeoutincubic", easeOutInCubic);
caurina.transitions.Tweener.registerTransition("easeinquart", easeInQuart);
caurina.transitions.Tweener.registerTransition("easeoutquart", easeOutQuart);
caurina.transitions.Tweener.registerTransition("easeinoutquart", easeInOutQuart);
caurina.transitions.Tweener.registerTransition("easeoutinquart", easeOutInQuart);
caurina.transitions.Tweener.registerTransition("easeinquint", easeInQuint);
caurina.transitions.Tweener.registerTransition("easeoutquint", easeOutQuint);
caurina.transitions.Tweener.registerTransition("easeinoutquint", easeInOutQuint);
caurina.transitions.Tweener.registerTransition("easeoutinquint", easeOutInQuint);
caurina.transitions.Tweener.registerTransition("easeinsine", easeInSine);
caurina.transitions.Tweener.registerTransition("easeoutsine", easeOutSine);
caurina.transitions.Tweener.registerTransition("easeinoutsine", easeInOutSine);
caurina.transitions.Tweener.registerTransition("easeoutinsine", easeOutInSine);
caurina.transitions.Tweener.registerTransition("easeincirc", easeInCirc);
caurina.transitions.Tweener.registerTransition("easeoutcirc", easeOutCirc);
caurina.transitions.Tweener.registerTransition("easeinoutcirc", easeInOutCirc);
caurina.transitions.Tweener.registerTransition("easeoutincirc", easeOutInCirc);
caurina.transitions.Tweener.registerTransition("easeinexpo", easeInExpo);
caurina.transitions.Tweener.registerTransition("easeoutexpo", easeOutExpo);
caurina.transitions.Tweener.registerTransition("easeinoutexpo", easeInOutExpo);
caurina.transitions.Tweener.registerTransition("easeoutinexpo", easeOutInExpo);
caurina.transitions.Tweener.registerTransition("easeinelastic", easeInElastic);
caurina.transitions.Tweener.registerTransition("easeoutelastic", easeOutElastic);
caurina.transitions.Tweener.registerTransition("easeinoutelastic", easeInOutElastic);
caurina.transitions.Tweener.registerTransition("easeoutinelastic", easeOutInElastic);
caurina.transitions.Tweener.registerTransition("easeinback", easeInBack);
caurina.transitions.Tweener.registerTransition("easeoutback", easeOutBack);
caurina.transitions.Tweener.registerTransition("easeinoutback", easeInOutBack);
caurina.transitions.Tweener.registerTransition("easeoutinback", easeOutInBack);
caurina.transitions.Tweener.registerTransition("easeinbounce", easeInBounce);
caurina.transitions.Tweener.registerTransition("easeoutbounce", easeOutBounce);
caurina.transitions.Tweener.registerTransition("easeinoutbounce", easeInOutBounce);
caurina.transitions.Tweener.registerTransition("easeoutinbounce", easeOutInBounce);
}
static function easeNone(t, b, c, d, p_params) {
return(((c * t) / d) + b);
}
static function easeInQuad(t, b, c, d, p_params) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOutQuad(t, b, c, d, p_params) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOutQuad(t, b, c, d, p_params) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
static function easeOutInQuad(t, b, c, d, p_params) {
if (t < (d / 2)) {
return(easeOutQuad(t * 2, b, c / 2, d, p_params));
}
return(easeInQuad((t * 2) - d, b + (c / 2), c / 2, d, p_params));
}
static function easeInCubic(t, b, c, d, p_params) {
t = t / d;
return((((c * t) * t) * t) + b);
}
static function easeOutCubic(t, b, c, d, p_params) {
t = (t / d) - 1;
return((c * (((t * t) * t) + 1)) + b);
}
static function easeInOutCubic(t, b, c, d, p_params) {
t = t / (d / 2);
if (t < 1) {
return(((((c / 2) * t) * t) * t) + b);
}
t = t - 2;
return(((c / 2) * (((t * t) * t) + 2)) + b);
}
static function easeOutInCubic(t, b, c, d, p_params) {
if (t < (d / 2)) {
return(easeOutCubic(t * 2, b, c / 2, d, p_params));
}
return(easeInCubic((t * 2) - d, b + (c / 2), c / 2, d, p_params));
}
static function easeInQuart(t, b, c, d, p_params) {
t = t / d;
return(((((c * t) * t) * t) * t) + b);
}
static function easeOutQuart(t, b, c, d, p_params) {
t = (t / d) - 1;
return(((-c) * ((((t * t) * t) * t) - 1)) + b);
}
static function easeInOutQuart(t, b, c, d, p_params) {
t = t / (d / 2);
if (t < 1) {
return((((((c / 2) * t) * t) * t) * t) + b);
}
t = t - 2;
return((((-c) / 2) * ((((t * t) * t) * t) - 2)) + b);
}
static function easeOutInQuart(t, b, c, d, p_params) {
if (t < (d / 2)) {
return(easeOutQuart(t * 2, b, c / 2, d, p_params));
}
return(easeInQuart((t * 2) - d, b + (c / 2), c / 2, d, p_params));
}
static function easeInQuint(t, b, c, d, p_params) {
t = t / d;
return((((((c * t) * t) * t) * t) * t) + b);
}
static function easeOutQuint(t, b, c, d, p_params) {
t = (t / d) - 1;
return((c * (((((t * t) * t) * t) * t) + 1)) + b);
}
static function easeInOutQuint(t, b, c, d, p_params) {
t = t / (d / 2);
if (t < 1) {
return(((((((c / 2) * t) * t) * t) * t) * t) + b);
}
t = t - 2;
return(((c / 2) * (((((t * t) * t) * t) * t) + 2)) + b);
}
static function easeOutInQuint(t, b, c, d, p_params) {
if (t < (d / 2)) {
return(easeOutQuint(t * 2, b, c / 2, d, p_params));
}
return(easeInQuint((t * 2) - d, b + (c / 2), c / 2, d, p_params));
}
static function easeInSine(t, b, c, d, p_params) {
return((((-c) * Math.cos((t / d) * (Math.PI/2))) + c) + b);
}
static function easeOutSine(t, b, c, d, p_params) {
return((c * Math.sin((t / d) * (Math.PI/2))) + b);
}
static function easeInOutSine(t, b, c, d, p_params) {
return((((-c) / 2) * (Math.cos((Math.PI * t) / d) - 1)) + b);
}
static function easeOutInSine(t, b, c, d, p_params) {
if (t < (d / 2)) {
return(easeOutSine(t * 2, b, c / 2, d, p_params));
}
return(easeInSine((t * 2) - d, b + (c / 2), c / 2, d, p_params));
}
static function easeInExpo(t, b, c, d, p_params) {
return(((t == 0) ? (b) : (((c * Math.pow(2, 10 * ((t / d) - 1))) + b) - (c * 0.001))));
}
static function easeOutExpo(t, b, c, d, p_params) {
return(((t == d) ? (b + c) : (((c * 1.001) * ((-Math.pow(2, (-10 * t) / d)) + 1)) + b)));
}
static function easeInOutExpo(t, b, c, d, p_params) {
if (t == 0) {
return(b);
}
if (t == d) {
return(b + c);
}
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * Math.pow(2, 10 * (t - 1))) + b) - (c * 0.0005));
}
t--;
return((((c / 2) * 1.0005) * ((-Math.pow(2, -10 * t)) + 2)) + b);
}
static function easeOutInExpo(t, b, c, d, p_params) {
if (t < (d / 2)) {
return(easeOutExpo(t * 2, b, c / 2, d, p_params));
}
return(easeInExpo((t * 2) - d, b + (c / 2), c / 2, d, p_params));
}
static function easeInCirc(t, b, c, d, p_params) {
t = t / d;
return(((-c) * (Math.sqrt(1 - (t * t)) - 1)) + b);
}
static function easeOutCirc(t, b, c, d, p_params) {
t = (t / d) - 1;
return((c * Math.sqrt(1 - (t * t))) + b);
}
static function easeInOutCirc(t, b, c, d, p_params) {
t = t / (d / 2);
if (t < 1) {
return((((-c) / 2) * (Math.sqrt(1 - (t * t)) - 1)) + b);
}
t = t - 2;
return(((c / 2) * (Math.sqrt(1 - (t * t)) + 1)) + b);
}
static function easeOutInCirc(t, b, c, d, p_params) {
if (t < (d / 2)) {
return(easeOutCirc(t * 2, b, c / 2, d, p_params));
}
return(easeInCirc((t * 2) - d, b + (c / 2), c / 2, d, p_params));
}
static function easeInElastic(t, b, c, d, p_params) {
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
var _local2 = ((p_params.period == undefined) ? (d * 0.3) : (p_params.period));
var _local5;
var _local1 = p_params.amplitude;
if ((!_local1) || (_local1 < Math.abs(c))) {
_local1 = c;
_local5 = _local2 / 4;
} else {
_local5 = (_local2 / (Math.PI*2)) * Math.asin(c / _local1);
}
t = t - 1;
return((-((_local1 * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local5) * (Math.PI*2)) / _local2))) + b);
}
static function easeOutElastic(t, b, c, d, p_params) {
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
var _local3 = ((p_params.period == undefined) ? (d * 0.3) : (p_params.period));
var _local5;
var _local1 = p_params.amplitude;
if ((!_local1) || (_local1 < Math.abs(c))) {
_local1 = c;
_local5 = _local3 / 4;
} else {
_local5 = (_local3 / (Math.PI*2)) * Math.asin(c / _local1);
}
return((((_local1 * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local5) * (Math.PI*2)) / _local3)) + c) + b);
}
static function easeInOutElastic(t, b, c, d, p_params) {
if (t == 0) {
return(b);
}
t = t / (d / 2);
if (t == 2) {
return(b + c);
}
var _local3 = ((p_params.period == undefined) ? (d * 0.45) : (p_params.period));
var _local5;
var _local1 = p_params.amplitude;
if ((!_local1) || (_local1 < Math.abs(c))) {
_local1 = c;
_local5 = _local3 / 4;
} else {
_local5 = (_local3 / (Math.PI*2)) * Math.asin(c / _local1);
}
if (t < 1) {
t = t - 1;
return((-0.5 * ((_local1 * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local5) * (Math.PI*2)) / _local3))) + b);
}
t = t - 1;
return(((((_local1 * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local5) * (Math.PI*2)) / _local3)) * 0.5) + c) + b);
}
static function easeOutInElastic(t, b, c, d, p_params) {
if (t < (d / 2)) {
return(easeOutElastic(t * 2, b, c / 2, d, p_params));
}
return(easeInElastic((t * 2) - d, b + (c / 2), c / 2, d, p_params));
}
static function easeInBack(t, b, c, d, p_params) {
var _local1 = ((p_params.overshoot == undefined) ? 1.70158 : (p_params.overshoot));
t = t / d;
return((((c * t) * t) * (((_local1 + 1) * t) - _local1)) + b);
}
static function easeOutBack(t, b, c, d, p_params) {
var _local2 = ((p_params.overshoot == undefined) ? 1.70158 : (p_params.overshoot));
t = (t / d) - 1;
return((c * (((t * t) * (((_local2 + 1) * t) + _local2)) + 1)) + b);
}
static function easeInOutBack(t, b, c, d, p_params) {
var _local2 = ((p_params.overshoot == undefined) ? 1.70158 : (p_params.overshoot));
t = t / (d / 2);
if (t < 1) {
_local2 = _local2 * 1.525;
return(((c / 2) * ((t * t) * (((_local2 + 1) * t) - _local2))) + b);
}
t = t - 2;
_local2 = _local2 * 1.525;
return(((c / 2) * (((t * t) * (((_local2 + 1) * t) + _local2)) + 2)) + b);
}
static function easeOutInBack(t, b, c, d, p_params) {
if (t < (d / 2)) {
return(easeOutBack(t * 2, b, c / 2, d, p_params));
}
return(easeInBack((t * 2) - d, b + (c / 2), c / 2, d, p_params));
}
static function easeInBounce(t, b, c, d, p_params) {
return((c - easeOutBounce(d - t, 0, c, d)) + b);
}
static function easeOutBounce(t, b, c, d, p_params) {
t = t / d;
if (t < 0.363636363636364) {
return((c * ((7.5625 * t) * t)) + b);
}
if (t < 0.727272727272727) {
t = t - 0.545454545454545;
return((c * (((7.5625 * t) * t) + 0.75)) + b);
}
if (t < 0.909090909090909) {
t = t - 0.818181818181818;
return((c * (((7.5625 * t) * t) + 0.9375)) + b);
}
t = t - 0.954545454545455;
return((c * (((7.5625 * t) * t) + 0.984375)) + b);
}
static function easeInOutBounce(t, b, c, d, p_params) {
if (t < (d / 2)) {
return((easeInBounce(t * 2, 0, c, d) * 0.5) + b);
}
return(((easeOutBounce((t * 2) - d, 0, c, d) * 0.5) + (c * 0.5)) + b);
}
static function easeOutInBounce(t, b, c, d, p_params) {
if (t < (d / 2)) {
return(easeOutBounce(t * 2, b, c / 2, d, p_params));
}
return(easeInBounce((t * 2) - d, b + (c / 2), c / 2, d, p_params));
}
}
Symbol 651 MovieClip [__Packages.caurina.transitions.SpecialProperty] Frame 0
class caurina.transitions.SpecialProperty
{
var getValue, setValue, parameters, preProcess;
function SpecialProperty (p_getFunction, p_setFunction, p_parameters, p_preProcessFunction) {
getValue = p_getFunction;
setValue = p_setFunction;
parameters = p_parameters;
preProcess = p_preProcessFunction;
}
function toString() {
var _local2 = "";
_local2 = _local2 + "[SpecialProperty ";
_local2 = _local2 + ("getValue:" + getValue.toString());
_local2 = _local2 + ", ";
_local2 = _local2 + ("setValue:" + setValue.toString());
_local2 = _local2 + ", ";
_local2 = _local2 + ("parameters:" + parameters.toString());
_local2 = _local2 + ", ";
_local2 = _local2 + ("preProcess:" + preProcess.toString());
_local2 = _local2 + "]";
return(_local2);
}
}
Symbol 652 MovieClip [__Packages.caurina.transitions.SpecialPropertyModifier] Frame 0
class caurina.transitions.SpecialPropertyModifier
{
var modifyValues, getValue;
function SpecialPropertyModifier (p_modifyFunction, p_getFunction) {
modifyValues = p_modifyFunction;
getValue = p_getFunction;
}
function toString() {
var _local2 = "";
_local2 = _local2 + "[SpecialPropertyModifier ";
_local2 = _local2 + ("modifyValues:" + modifyValues.toString());
_local2 = _local2 + ", ";
_local2 = _local2 + ("getValue:" + getValue.toString());
_local2 = _local2 + "]";
return(_local2);
}
}
Symbol 653 MovieClip [__Packages.caurina.transitions.SpecialPropertySplitter] Frame 0
class caurina.transitions.SpecialPropertySplitter
{
var parameters;
function SpecialPropertySplitter (p_splitFunction, p_parameters) {
splitValues = p_splitFunction;
parameters = p_parameters;
}
function splitValues(p_value, p_parameters) {
return([]);
}
function toString() {
var _local2 = "";
_local2 = _local2 + "[SpecialPropertySplitter ";
_local2 = _local2 + ("splitValues:" + splitValues.toString());
_local2 = _local2 + ", ";
_local2 = _local2 + ("parameters:" + parameters.toString());
_local2 = _local2 + "]";
return(_local2);
}
}
Symbol 654 MovieClip [__Packages.PlayerProfiler] Frame 0
class PlayerProfiler
{
static var activeprofile, mc;
function PlayerProfiler () {
}
static function get active() {
return(activeprofile);
}
static function set active(n) {
activeprofile = n;
var _local1 = SharedObject.getLocal("jaycPuttbaseProfiles2207", "/");
_local1.data.lastid = activeprofile.id;
//return(active);
}
static function init($mc) {
mc = $mc;
}
static function updateProfile() {
var _local4 = SharedObject.getLocal("jaycPuttbaseProfiles2207", "/");
var _local1 = _local4.data[activeprofile.id];
var _local2 = activeprofile.lvls;
_local1.info.tscore = (_local1.info.ttime = (_local1.info.access = (_local1.info.kys = (_local1.info.brnz = (_local1.info.slvr = (_local1.info.gld = (_local1.info.star = 0)))))));
for (var _local3 in _local2) {
_local1.info.tscore = _local1.info.tscore + _local2[_local3].score;
_local1.info.ttime = _local1.info.ttime + _local2[_local3].time;
_local1.info.access++;
_local1.info.kys++;
switch (_local2[_local3].goal) {
case 1 :
break;
case 2 :
_local1.info.brnz++;
break;
case 3 :
_local1.info.slvr++;
break;
case 4 :
_local1.info.gld++;
break;
case 5 :
_local1.info.star++;
break;
default :
_local1.info.access--;
_local1.info.kys--;
}
}
_local1.lvls = _local2;
_local4.data[activeprofile.id] = _local1;
_local4.flush();
activeprofile = _local1;
profiles[_local1.id] = activeprofile;
}
static function updateOptions() {
var _local1 = SharedObject.getLocal("jaycPuttbaseProfiles2207", "/");
_local1.data[activeprofile.id].opt = activeprofile.opt;
_local1.flush();
profiles[activeprofile.id] = activeprofile;
}
static function saveProfile(newName) {
if (((!newName) || (newName.length < 2)) || (newName.indexOf("type name here", 0) >= 0)) {
return(1);
}
if (count >= 4) {
return(2);
}
if ((count > 0) && (newName == profiles[("p_" + newName) + "_profile"].name.toLowerCase())) {
return(3);
}
if (newName.indexOf("_", 0) >= 0) {
return(4);
}
if (newName.length > 16) {
return(5);
}
var _local9 = {};
var _local1 = MainGame.maps;
for (var _local10 in _local1) {
_local9[_local10] = {hash:_local1[_local10].hash, score:0, goal:0, rep:0, time:0};
}
var _local12 = SharedObject.getLocal("jaycPuttbaseProfiles2207", "/");
var _local11 = (("p_" + newName) + "_profile").toLowerCase();
var _local7 = new Object();
_local7.id = _local11;
_local7.name = newName;
_local7.info = {tscore:0, kys:0, brnz:0, slvr:0, gld:0, star:0, access:0, ttime:0};
_local7.lvls = _local9;
_local7.opt = new Array(3, 0.5, 0.75, 1, 32, 46);
profiles[_local11] = _local7;
_local12.data[_local11] = _local7;
_local12.data.profilecount = ++count;
_local12.data.lastid = _local11;
_local12.flush();
activeprofile = _local7;
return(0);
}
static function deleteProfile(id) {
if (!id) {
return(undefined);
}
var _local2 = SharedObject.getLocal("jaycPuttbaseProfiles2207", "/");
_local2.data[id] = null;
delete _local2.data[id];
delete profiles[id];
count--;
var _local1;
if (id == activeprofile.id) {
for (var _local3 in profiles) {
_local1 = profiles[_local3];
break;
}
if (_local1) {
active = (_local1);
} else {
delete _local2.data.lastid;
}
}
_local2.data.profilecount = count;
_local2.flush();
}
static function traceString(o) {
var _local2 = 0;
for (var _local3 in o) {
switch (typeof(o[_local3])) {
case "object" :
case "array" :
traceString(o[_local3]);
break;
}
_local2++;
}
if (!_local2) {
}
}
static function loadProfiles() {
var _local3 = SharedObject.getLocal("jaycPuttbaseProfiles2207", "/");
var _local16 = _local3.data.profilecount;
if (isNaN(_local16) || (_local16 == 0)) {
return(false);
}
count = _local16;
var _local2;
var _local1;
var _local4 = MainGame.maps;
var _local5;
traceString(_local3.data);
var _local12 = 0;
for (var _local14 in _local3.data) {
_local2 = _local3.data[_local14];
_local5 = false;
if ((_local2.id == (("p_" + _local2.name.toLowerCase()) + "_profile")) && (_local2.id != undefined)) {
profiles[_local2.id] = _local2;
_local1 = _local2.lvls;
for (var _local11 in _local4) {
if ((!_local1[_local11]) || (_local1[_local11].hash != _local4[_local11].hash)) {
_local1[_local11] = {hash:_local4[_local11].hash, score:0, goal:0, rep:0, time:(_local1[_local11] ? (_local1[_local11].time) : 0)};
_local5 = true;
}
}
if (_local5) {
_local2.lvls = _local1;
activeprofile = _local2;
updateProfile();
}
_local12++;
} else {
if (_local3.data.lastid == _local2.id) {
_local3.data.lastid = null;
}
_local3.data[_local14] = null;
delete _local3.data[_local14];
}
}
_local3.data.profilecount = _local12;
_local3.flush();
if (!_local3.data.lastid) {
for (var _local15 in profiles) {
_local3.data.lastid = profiles[_local15].id;
break;
}
}
active = (profiles[_local3.data.lastid]);
var _local13 = profiles[_local3.data.lastid];
switch (_local13.opt[0]) {
case 0 :
MainGame.root._quality = "LOW";
break;
case 1 :
MainGame.root._quality = "MEDIUM";
break;
case 2 :
default :
MainGame.root._quality = "HIGH";
}
MainGame.sndMngr.__set__bmg_volume(_local13.opt[1]);
MainGame.sndMngr.__set__sfx_volume(_local13.opt[2]);
MainGame.sndMngr.mute = Math.min(_local13.opt[3], 1);
return(true);
}
static function getTitle(id) {
var _local7 = profiles[id];
var _local5 = _local7.lvls;
var _local9 = ["Whoa!", "Lucky", "Newbie", "Weak", "Beginner", "Trainee", "Rookie", "Apprentice", "Gamer", "Puzzler", "Brain", "Ace", "Pro Puzzler", "Prince", "Profesional", "Master", "King", "Hardcore", "Brute", "Monsterous", "Demonic", "Titan", "DemiGod", "Godlike"];
var _local11 = "";
var _local8 = _local7.info.tscore;
var _local12 = 0;
var _local1 = MainGame.maps;
var _local4 = _local7.info.kys;
var _local2 = 0;
if (_local8 > 0) {
var _local3 = 0;
for (var _local6 in _local1) {
if (_local5[_local6].req >= _local4) {
_local3 = _local3 + _local1[_local6].reward[3];
_local2++;
} else if (_local6 != "TutLvl") {
break;
}
}
var _local10 = Math.min;
_local2 = (_local2 / 18) * 21;
return(_local9[_local10(int((_local8 / _local3) * _local2), 23)]);
}
return("Guest");
}
static var profiles = new Object();
static var count = 0;
}
Symbol 655 MovieClip [__Packages.jayc.common.control.ScoreCtrl] Frame 0
class jayc.common.control.ScoreCtrl
{
static var onError, params, submit, ScoreAPI, showScores;
function ScoreCtrl () {
}
static function init(options, forceURL) {
var _local3;
if (forceURL == undefined) {
_local3 = _root._url.toLowerCase().split("://");
} else {
_local3 = forceURL.toLowerCase().split("://");
}
real_domain = _local3[1].split("/");
domain_name = real_domain[0];
if (options.onError != undefined) {
onError = options.onError;
}
params = options;
do {
if ((domain_name.indexOf("mindjolt.com") > -1) && (_root.com_mindjolt_api)) {
submit = submitMindjolt;
ScoreAPI = new LocalConnection();
apiID = 1;
} else if ((domain_name.indexOf("kongregate.com") > -1) && (_root.kongregateServices)) {
submit = submitKong;
_root.kongregateServices.connect();
apiID = 2;
} else if ((domain_name.indexOf("hallpass.com") > -1) && (_root.HPScoreService)) {
submit = submitHallpass;
if (!_root.HPScoreService) {
_root.HPScoreService = _global.scoreService;
}
apiID = 3;
} else {
submit = submitDefault;
showScores = showScoresDefault;
apiID = 0;
mochi.MochiServices.connect(params.mochiID, params.clip, function () {
jayc.common.control.ScoreCtrl.throwErr(6, "Cannot connect to mochi services");
});
}
} while (false);
}
static function throwErr(num, msg) {
if (onError != undefined) {
onError(num, msg);
}
}
static function submitDefault(options) {
if (options.onError != undefined) {
onError = options.onError;
}
if ((isNaN(options.score) || (!options.name.length)) || (!options.boardID.length)) {
throwErr(5, (((("Insufficient parameters supplied, score:" + options.score) + ", name:") + options.name) + ", boardID:") + options.boardID);
return(undefined);
}
mochi.MochiServices.connect(params.mochiID, params.clip, function () {
jayc.common.control.ScoreCtrl.throwErr(6, "Cannot connect to mochi services");
});
if (options.justSubmit || (params.justSubmit)) {
mochi.MochiScores.setBoardID(options.boardID);
mochi.MochiScores.submit(options.score, options.name, options.onSuccessTarget, options.onSuccess);
} else {
mochi.MochiScores.showLeaderboard(options);
}
}
static function showScoresDefault(options) {
mochi.MochiServices.connect(params.mochiID, params.clip, function () {
jayc.common.control.ScoreCtrl.throwErr(3, "Cannot connect to mochi services");
});
mochi.MochiScores.showLeaderboard(options);
}
static function submitMindjolt(options) {
if (isNaN(options.score)) {
throwErr(5, "Insufficient parameters supplied, score:" + options.score);
return(undefined);
}
if ((!options.modeStr.length) || (options.modeStr == undefined)) {
ScoreAPI.send(_root.com_mindjolt_api, "submitScore", options.score);
} else {
ScoreAPI.send(_root.com_mindjolt_api, "submitScore", options.score, options.modeStr);
}
}
static function submitKong(options) {
if (isNaN(options.score)) {
throwErr(5, "Insufficient parameters supplied, score:" + options.score);
return(undefined);
}
if ((!options.modeStr.length) || (options.modeStr == undefined)) {
_root.kongregateScores.submit(options.score);
} else {
_root.kongregateScores.setMode(options.modeStr);
_root.kongregateScores.submit(options.score);
}
if (options.onSuccessTarget != undefined) {
options.onSuccess.apply(options.onSuccessTarget);
}
}
static function submitHallpass(options) {
if (isNaN(options.score)) {
throwErr(5, "Insufficient parameters supplied, score:" + options.score);
return(undefined);
}
if ((!options.modeStr.length) || (options.modeStr == undefined)) {
_root.HPScoreService.postScore(options.score, "");
} else {
_root.HPScoreService.postScore(options.score, options.modeStr);
}
}
static var apiID = 0;
static var domain_name = "";
static var real_domain = "";
static var DOMAINS = {};
}
Symbol 656 MovieClip [__Packages.mochi.MochiServices] Frame 0
class mochi.MochiServices
{
static var _id, _container, _clip, _sendChannelName, _rcvChannelName, __get__comChannelName, onError, _listenChannel, _rcvChannel, _loader, _loaderListener, _sendChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function get childClip() {
return(_clip);
}
static function getVersion() {
return("1.32");
}
static function allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
_rcvChannelName = val;
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
if ((!_connected) && (_clip == undefined)) {
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.MochiServices.onError = onError;
} else if (mochi.MochiServices.onError == undefined) {
mochi.MochiServices.onError = function (errorCode) {
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
_rcvChannel.close();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var _local2 = "_mochiservices_com_" + id;
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
allowDomains(_gatewayURL);
_clip = clip.createEmptyMovieClip(_local2, 10336, false);
_loader = new MovieClipLoader();
if (_loaderListener.waitInterval != null) {
clearInterval(_loaderListener.waitInterval);
}
_loaderListener = {};
_loaderListener.onLoadError = function (target_mc, errorCode, httpStatus) {
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, [errorCode]);
};
_loaderListener.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_loaderListener.startTime = getTimer();
_loaderListener.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_loaderListener.waitInterval = setInterval(_loaderListener, "wait", 1000);
_loader.addListener(_loaderListener);
_loader.loadClip(_gatewayURL, _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
_rcvChannel = new LocalConnection();
_rcvChannel.allowDomain = function (d) {
return(true);
};
_rcvChannel.allowInsecureDomain = _rcvChannel.allowDomain;
_rcvChannel._nextcallbackID = 0;
_rcvChannel._callbacks = {};
listen();
return(_clip);
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel.connect(_listenChannelName);
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_clip, version:getVersion()});
_rcvChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_rcvChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_rcvChannel.onError = function () {
mochi.MochiServices.onError.apply(null, ["IOError"]);
};
_rcvChannel.connect(_rcvChannelName);
_connecting = false;
_connected = true;
_listenChannel.close();
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _rcvChannel._callbacks[_local1.callbackID];
}
delete _rcvChannel._callbacks[_local1.callbackID];
if (error) {
handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ["NotConnected"]);
}
if ((args.options != null) && (args.options.onError != null)) {
args.options.onError.apply(null, ["NotConnected"]);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = "NotConnected";
if ((callbackObject != null) && (typeof(callbackMethod) == "string")) {
callbackObject[callbackMethod](args);
} else if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
onError.apply(null, ["NotConnected"]);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
}
_rcvChannel._callbacks[_rcvChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_rcvChannel._nextcallbackID++;
}
static var _gatewayURL = "http://www.mochiads.com/static/lib/services/services.swf";
static var _listenChannelName = "__mochiservices";
static var _connecting = false;
static var _connected = false;
}
Symbol 657 MovieClip [__Packages.mochi.MochiScores] Frame 0
class mochi.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.MochiScores.boardID = boardID;
mochi.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
if (options.clip != null) {
if ((options.clip != mochi.MochiServices.__get__clip()) || (mochi.MochiServices.__get__childClip()._target == undefined)) {
mochi.MochiServices.disconnect();
mochi.MochiServices.connect(mochi.MochiServices.__get__id(), options.clip);
}
delete options.clip;
}
if (options.name != null) {
if (typeof(options.name) == "object") {
if (options.name.text != undefined) {
options.name = options.name.text;
}
}
}
if (options.score != null) {
if (typeof(options.score) == "object") {
if (options.score.text != undefined) {
options.score = options.score.text;
}
}
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
mochi.MochiServices.__get__clip().play();
};
}
if (options.onError != null) {
onError = options.onError;
} else {
onError = onClose;
}
if (options.boardID == null) {
if (boardID != null) {
options.boardID = boardID;
}
}
mochi.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function closeLeaderboard() {
mochi.MochiServices.send("scores_closeLeaderboard");
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
static function scoresArrayToObjects(scores) {
var _local5 = {};
var _local1;
var _local4;
var _local2;
var _local6;
for (var _local8 in scores) {
if (typeof(scores[_local8]) == "object") {
if ((scores[_local8].cols != null) && (scores[_local8].rows != null)) {
_local5[_local8] = [];
_local2 = scores[_local8];
_local4 = 0;
while (_local4 < _local2.rows.length) {
_local6 = {};
_local1 = 0;
while (_local1 < _local2.cols.length) {
_local6[_local2.cols[_local1]] = _local2.rows[_local4][_local1];
_local1++;
}
_local5[_local8].push(_local6);
_local4++;
}
} else {
_local5[_local8] = {};
for (var _local7 in scores[_local8]) {
_local5[_local8][_local7] = scores[_local8][_local7];
}
}
} else {
_local5[_local8] = scores[_local8];
}
}
return(_local5);
}
static function doClose(args) {
if (args.error == true) {
if (args.errorCode == undefined) {
args.errorCode = "IOError";
}
onError.apply(null, [args.errorCode]);
} else {
onClose.apply();
}
}
}
Symbol 658 MovieClip [__Packages.jayc.common.mc.Prompt] Frame 0
class jayc.common.mc.Prompt extends MovieClip
{
var swapDepths, gotoAndStop, btn_cancel, msg, btn_ok, btn_cover, bgbtn;
function Prompt () {
super();
swapDepths(1048001);
gotoAndStop(1);
}
function setType(n, str, target, onOK, onCancel, input) {
switch (n) {
case "okcancel" :
gotoAndStop(2);
jayc.common.utils.MCButton.makeMC(btn_cancel);
pressOK(str, target, onOK);
btn_cancel.onRelease3 = mx.utils.Delegate.create(target, onCancel);
btn_cancel.onRelease2 = mx.utils.Delegate.create(this, function () {
jayc.common.utils.Cursor.gotoFrame(1);
this.btn_cancel.onRelease3();
this.gotoAndStop(1);
this.removeMovieClip();
});
break;
case "ok" :
gotoAndStop(3);
pressOK(str, target, onOK);
break;
case "ok2" :
gotoAndStop(4);
pressOK(str, target, onOK);
break;
case "script" :
gotoAndStop(5);
pressOK(str, target, onOK);
msg.onSetFocus = function () {
Selection.setSelection(0, this.text.length());
};
break;
case "input" :
gotoAndStop(6);
pressOK("", target, onOK);
btn_ok.onRelease2 = mx.utils.Delegate.create(this, function () {
var _local2 = this.btn_ok.onRelease3;
jayc.common.utils.Cursor.gotoFrame(1);
this.gotoAndStop(1);
this.removeMovieClip();
_local2(this.msg.text);
});
jayc.common.utils.MCButton.makeMC(btn_cancel);
btn_cancel.onRelease3 = mx.utils.Delegate.create(target, onCancel);
btn_cancel.onRelease2 = mx.utils.Delegate.create(this, function () {
var _local2 = this.btn_cancel.onRelease3;
jayc.common.utils.Cursor.gotoFrame(1);
this.gotoAndStop(1);
this.removeMovieClip();
_local2();
});
break;
case "yesno" :
gotoAndStop(7);
jayc.common.utils.MCButton.makeMC(btn_cancel);
pressOK(str, target, onOK);
btn_cancel.onRelease3 = mx.utils.Delegate.create(target, onCancel);
btn_cancel.onRelease2 = mx.utils.Delegate.create(this, function () {
var _local2 = this.btn_cancel.onRelease3;
jayc.common.utils.Cursor.gotoFrame(1);
this.gotoAndStop(1);
this.removeMovieClip();
_local2();
});
break;
case "input_sm_yn" :
gotoAndStop(8);
pressOK(str, target, onOK);
btn_ok.onRelease2 = mx.utils.Delegate.create(this, function () {
var _local2 = this.inputtxt.text;
if ((((_local2.length < 2) || (_local2.charCodeAt(0) < 48)) || (_local2.charCodeAt(0) > 122)) || (((_local2.charCodeAt(0) + _local2.charCodeAt(1)) + _local2.charCodeAt(2)) < 144)) {
return(undefined);
}
var _local3 = this.btn_ok.onRelease3;
jayc.common.utils.Cursor.gotoFrame(1);
this.gotoAndStop(1);
this.removeMovieClip();
_local3(_local2);
});
jayc.common.utils.MCButton.makeMC(btn_cancel);
btn_cancel.onRelease3 = mx.utils.Delegate.create(target, onCancel);
btn_cancel.onRelease2 = mx.utils.Delegate.create(this, function () {
var _local2 = this.btn_cancel.onRelease3;
jayc.common.utils.Cursor.gotoFrame(1);
this.gotoAndStop(1);
this.removeMovieClip();
_local2();
});
break;
}
jayc.common.utils.MCButton.makeMC(btn_cover);
btn_cover.useHandCursor = false;
}
function pressOK(str, target, onOK, onCancel) {
jayc.common.utils.MCButton.makeMC(btn_ok);
bgbtn.onPress = (bgbtn.onRelease = function () {
});
msg.text = str;
btn_ok.onRelease3 = mx.utils.Delegate.create(target, onOK);
btn_ok.onRelease2 = mx.utils.Delegate.create(this, function () {
var _local2 = this.btn_ok.onRelease3;
jayc.common.utils.Cursor.gotoFrame(1);
this.gotoAndStop(1);
this.removeMovieClip();
_local2();
});
}
}
Symbol 659 MovieClip [__Packages.MenuOption] Frame 0
class MenuOption extends MovieClip
{
var qscroll, qscrollbg, sscroll, sscrollbg, escroll, escrollbg, btn_return, onoff_btn;
function MenuOption () {
super();
caurina.transitions.Tweener.addTween(this, {_y:0, _alpha:100, time:0.4, transition:"easeOutCubic"});
init();
}
function init() {
jayc.common.utils.MCButton.makeMC(qscroll);
jayc.common.utils.MCButton.makeMC(qscrollbg);
jayc.common.utils.MCButton.makeMC(sscroll);
jayc.common.utils.MCButton.makeMC(sscrollbg);
jayc.common.utils.MCButton.makeMC(escroll);
jayc.common.utils.MCButton.makeMC(escrollbg);
jayc.common.utils.MCButton.makeMC(btn_return);
qscroll.onPress = mx.utils.Delegate.create(this, function () {
this.qscroll.onMouseMove = mx.utils.Delegate.create(this, this.drag_qscroll);
});
qscroll.onMouseUp = mx.utils.Delegate.create(this, function () {
delete this.qscroll.onMouseMove;
});
qscroll.onReleaseOutside = qscroll.onMouseUp;
qscroll.onRelease = qscroll.onMouseUp;
qscrollbg.onPress = mx.utils.Delegate.create(this, drag_qscroll);
sscroll.onPress = mx.utils.Delegate.create(this, function () {
this.sscroll.onMouseMove = mx.utils.Delegate.create(this, this.drag_sscroll);
});
sscroll.onMouseUp = mx.utils.Delegate.create(this, function () {
delete this.sscroll.onMouseMove;
});
sscroll.onReleaseOutside = sscroll.onMouseUp;
sscroll.onRelease = sscroll.onMouseUp;
sscrollbg.onPress = mx.utils.Delegate.create(this, drag_sscroll);
escroll.onPress = mx.utils.Delegate.create(this, function () {
this.escroll.onMouseMove = mx.utils.Delegate.create(this, this.drag_escroll);
});
escroll.onMouseUp = mx.utils.Delegate.create(this, function () {
delete this.escroll.onMouseMove;
});
escroll.onReleaseOutside = qscroll.onMouseUp;
escroll.onRelease = escroll.onMouseUp;
escrollbg.onPress = mx.utils.Delegate.create(this, drag_escroll);
switch (MainGame.root._quality) {
case "LOW" :
qscroll._x = qscrollbg._x;
break;
case "MEDIUM" :
qscroll._x = qscrollbg._x + 75;
break;
case "HIGH" :
default :
qscroll._x = qscrollbg._x + 150;
}
sscroll._x = sscrollbg._x + (MainGame.sndMngr.__get__bmg_volume() * 150);
escroll._x = escrollbg._x + (MainGame.sndMngr.__get__sfx_volume() * 150);
btn_return.onPress2 = mx.utils.Delegate.create(this, function () {
MainGame.sndMngr.playSound("swoosh0");
PlayerProfiler.updateOptions();
this.btn_return.onPress3();
caurina.transitions.Tweener.addTween(this, {_y:100, _alpha:0, time:0.4, transition:"easeOutCubic", onComplete:mx.utils.Delegate.create(this, this.removeMovieClip)});
});
onoff_btn.onRelease = function () {
MainGame.mainMenu.mute_btn.onRelease();
this.gotoAndStop(MainGame.sndMngr.mute + 1);
MainGame.mainMenu.mute_btn.txt.text = "";
};
onoff_btn.onRollOut = function () {
jayc.common.utils.Cursor.frameto(1);
};
onoff_btn.onRollOver = function () {
if (jayc.common.utils.Cursor.getframe() == 1) {
jayc.common.utils.Cursor.frameto(2);
}
};
onoff_btn.gotoAndStop(MainGame.sndMngr.mute + 1);
}
function setReturnBTN(btnreturnCallback) {
btn_return.onPress3 = btnreturnCallback;
}
function drag_qscroll() {
var _local2 = Math.max(qscrollbg._x, Math.min(qscrollbg._x + 152, qscroll._x + qscroll._xmouse));
var _local3 = Math.round((_local2 - qscrollbg._x) / 75);
qscroll._x = _local2;
switch (_local3) {
case 0 :
MainGame.root._quality = "LOW";
break;
case 1 :
MainGame.root._quality = "MEDIUM";
break;
case 2 :
default :
MainGame.root._quality = "HIGH";
}
PlayerProfiler.__get__active().np.opt[0] = _local2;
}
function drag_sscroll() {
var _local2 = Math.max(sscrollbg._x, Math.min(sscrollbg._x + 152, sscroll._x + sscroll._xmouse));
_local2 = int(_local2 / 1.5) * 1.5;
sscroll._x = _local2;
var _local3 = int(((_local2 - sscrollbg._x) / 150) * 100) / 100;
MainGame.sndMngr.__set__bmg_volume(_local3);
PlayerProfiler.__get__active().opt[1] = _local3;
if ((!MainGame.sndMngr.mute) && (_local3 > 0)) {
onoff_btn.onRelease();
}
}
function drag_escroll() {
var _local2 = Math.max(escrollbg._x, Math.min(escrollbg._x + 152, escroll._x + escroll._xmouse));
_local2 = int(_local2 / 1.5) * 1.5;
escroll._x = _local2;
var _local3 = int(((_local2 - escrollbg._x) / 150) * 100) / 100;
MainGame.sndMngr.__set__sfx_volume(_local3);
PlayerProfiler.__get__active().opt[2] = _local3;
if ((!MainGame.sndMngr.mute) && (_local3 > 0)) {
onoff_btn.onRelease();
}
}
}