Frame 1
var my_cm = new ContextMenu();
my_cm.hideBuiltInItems();
this.menu = my_cm;
MochiAd.showPreloaderAd({id:"95ee66498a4a5e22", res:"600x550"});
Frame 3
if (_root.getBytesLoaded() < _root.getBytesTotal()) {
gotoAndStop ("loading");
}
Instance of Symbol 152 MovieClip in Frame 4
//component parameters
onClipEvent (construct) {
_game_name = "the_return";
score_var = "_root.score";
}
Frame 5
stop();
stop();
Frame 7
function globalInit() {
if (bGlobalInited) {
return(undefined);
}
bGlobalInited = true;
sHard = "MEDIUM";
_quality = "MEDIUM";
bFistNoted = false;
loadSceneMask();
initSoundArray();
loadSD();
initMusic();
initSD();
}
function loadSceneMask() {
kill(sceneMasker);
newMasker();
}
function clearScene() {
clearInterval(gameInter);
clearInterval(mcLevel.heightInter);
var _local3 = new Array("mcLevel", "mcLayout", "mcMenu", "mcPause", "mcPass", "mcOver", "mcEnd");
for (var _local4 in _local3) {
var _local2 = _root[_local3[_local4]];
kill(_local2);
}
delete onEnterFrame;
}
function activeGame() {
bStart = true;
bPause = false;
trace("::::\u6E38\u620F\u88AB\u6FC0\u6D3B\uFF01::::");
}
function pauseGame() {
bStart = false;
bPause = true;
trace("::::\u6E38\u620F\u6682\u505C\uFF01::::");
}
function initGame() {
nLevel = 1;
nMaxLevel = 50;
levelScore = 0;
score = 0;
life = 5;
heightScore = 20;
waterScore = 200;
lifeScore = 1000;
timeScore = 50;
conectionScore = 10;
baseTime = 180;
}
function gameReset() {
trace("\u6E38\u620F\u88AB\u91CD\u7F6E");
bStart = false;
bPause = true;
bPass = false;
bOver = false;
bEnd = false;
levelScore = 0;
}
function loadLevel() {
atMc(this, "mcLevel", "mcLevel");
atMc(this, "mcLayout");
loadSceneMask();
}
function playGame() {
turnTo("gameScene");
clearScene();
gameReset();
loadLevel();
}
function startGame() {
activeGame();
}
function tryAgain() {
clearScene();
gameReset();
initGame();
turnTo("gameScene");
loadLevel();
pauseGame();
}
function continueGame() {
clearScene();
gameReset();
loadLevel();
}
function instructions() {
bNoted = true;
turnTo("instructions");
}
function backToFrontPage() {
turnTo("frontPage");
_root.frontAnim.gotoAndStop("end");
}
function initLayoutBt(mc) {
mc.btPlay.onPress = function () {
_root.playGame();
};
mc.btReturn.onPress = function () {
_root.bPause = false;
this._parent.removeMovieClip();
};
mc.btContinue.onPress = function () {
_root.continueGame();
};
mc.btTryAgain.onPress = function () {
_root.tryAgain();
};
mc.btNextLevel.onPress = function () {
_root.nextLevel();
};
mc.btInstructions.onPress = function () {
_root.instructions();
};
mc.btViewScore.onPress = function () {
viewHighscore();
};
mc.btMore.onPress = function () {
getURL ("http://www.freeworldgroup.com/", "_blank");
};
mc.btDownload.onPress = function () {
getURL ("http://www.ifungames.com", "_blank");
};
mc.btSetting.onPress = function () {
};
mc.btAddGame.onPress = function () {
getURL ("http://www.freeworldgroup.com/koalafiles.htm", "_blank");
};
mc.btMainMenu.onPress = function () {
turnTo("frontPage");
};
}
function initSoundArray() {
aSDType = new Array("aMusic", "aSound");
aMusic = new Array("mainMusic");
aSound = new Array("sdBomb", "sdRope", "sdHook");
aMuscVol = new Array();
aMuscVol.push(20);
aSoundVol = new Array(20, 10, 20);
bMusicOn = true;
bSoundOn = true;
musicHolder = newMc(_root, "musicHolder");
sdHolder = newMc(_root, "sdHolder");
}
function loadSD() {
for (var _local8 in aSDType) {
var _local3 = _root[aSDType[_local8]];
var _local7 = _local3.length;
var _local2 = 0;
while (_local2 < _local7) {
var _local4 = _local3[_local2];
var _local5 = _local4 + "mc";
var _local6 = newMc(_root, _local5);
_root[_local3[_local2]] = new Sound(_local6);
_root[_local3[_local2]].attachSound(_local4);
if (_local3 == aMusic) {
_root[_local3[_local2]].setVolume(aMuscVol[_local2]);
} else if (_local3 == aSound) {
_root[_local3[_local2]].setVolume(aSoundVol[_local2]);
}
_local2++;
}
}
}
function initMusic() {
var _local4 = aMusic.length;
var _local2 = 0;
while (_local2 < _local4) {
if (bMusicOn) {
var _local3 = aMuscVol[_local2];
} else {
var _local3 = 0;
}
_root[aMusic[_local2]].setVolume(_local3);
_local2++;
}
}
function stopVoice() {
mainMusic.setVolume(20);
sdInstructions.stop();
}
function startVoice() {
mainMusic.setVolume(4);
sdInstructions.start();
}
function initSD() {
var _local4 = aSound.length;
var _local2 = 0;
while (_local2 < _local4) {
if (bSoundOn) {
var _local3 = aSoundVol[_local2];
} else {
var _local3 = 0;
}
_root[aSound[_local2]].setVolume(_local3);
_local2++;
}
}
new global.GlobalFun();
stop();
trace("::::\u8FDB\u5165\u6E38\u620F\u9996\u9875::::");
globalInit();
clearScene();
initGame();
initLayoutBt(this);
sdInstructions.stop();
mainMusic.stop();
mainMusic.start(0, 999);
bossMusic.stop();
stopVoice();
Instance of Symbol 615 MovieClip in Frame 7
on (release) {
getURL ("http://www.freeworldgroup.com/", "_blank");
}
Frame 24
function addScore(_score) {
score = score + _score;
}
function loseScore(_score) {
score = score - _score;
if (score < 0) {
score = 0;
}
}
function loseLife() {
life = life - 1;
if (life < 0) {
life = 0;
}
}
function dcOver() {
if (bPass) {
return(undefined);
}
if (life == 0) {
bOver = true;
}
if (bOver) {
turnTo("temp");
bPause = true;
bStart = false;
if (life > 0) {
atMc(this, "mcOver");
}
delete onEnterFrame;
}
}
function dcPass() {
if (bOver) {
return(undefined);
}
if (mcLevel.pNeck.coord.y <= -27250) {
bPass = true;
}
if (bPass) {
bPause = true;
bStart = false;
turnTo("temp");
timeBonus();
if (_root.sHard == "MEDIUM") {
addScore(3000);
} else if (_root.sHard == "HARD") {
addScore(5000);
} else if (_root.sHard == "INSANE") {
addScore(7000);
}
atMc(this, "mcEnd");
delete onEnterFrame;
}
}
function timeBonus() {
var _local1 = baseTime - gameTime;
score = score + (_local1 * timeScore);
}
function dcPause() {
if (bPass) {
return(undefined);
}
if (bOver) {
return(undefined);
}
if (bEnd) {
return(undefined);
}
if (mcMenu instanceof MovieClip) {
return(undefined);
}
if (bStart) {
if (!(mcPause instanceof MovieClip)) {
pauseGame();
kill(mcPause);
atMc(this, "mcPause");
}
} else if (mcPause instanceof MovieClip) {
activeGame();
kill(mcPause);
}
}
function getGameTime() {
clearInterval(gameInter);
if (bOver) {
return(undefined);
}
gameInter = setInterval(this, "getGameTime", 1000);
if (bPause) {
return(undefined);
}
if (!bStart) {
return(undefined);
}
gameTime = gameTime + 1;
var _local2 = gameTime % 60;
var _local3 = Math.floor(gameTime / 60);
if (_local3 >= 10) {
minText = _local3;
} else {
minText = "0" + _local3;
}
if (_local2 >= 10) {
secText = _local2;
} else {
secText = "0" + _local2;
}
}
function onEnterFrame() {
dcOver();
dcPass();
}
stop();
trace("::::\u5F00\u59CB\u6E38\u620F::::");
gameTime = 0;
minText = "00";
secText = "00";
getGameTime();
var myLis = new Object();
bKeyDown = false;
myLis.onKeyDown = function () {
if (bKeyDown) {
return(undefined);
}
if (Key.isDown(80)) {
dcPause();
bKeyDown = true;
}
};
myLis.onKeyUp = function () {
bKeyDown = false;
};
Key.addListener(myLis);
Frame 39
stop();
Frame 51
_root.frontAnim.gotoAndStop("bg");
Symbol 5 MovieClip Frame 1
onEnterFrame = function () {
var _local4 = _root.getBytesLoaded();
var _local3 = _root.getBytesTotal();
var _local5 = int((_local4 / _local3) * 100);
num_txt.text = _local5 + "%";
if (_local4 == _local3) {
delete this.onEnterFrame;
if ((_root._mochiad instanceof MovieClip) != true) {
_root.play();
}
}
};
Symbol 9 MovieClip Frame 1
this._visible = false;
Symbol 9 MovieClip Frame 2
this._visible = true;
Symbol 9 MovieClip Frame 39
stop();
Instance of Symbol 2 MovieClip in Symbol 9 MovieClip Frame 39
on (release) {
getURL ("http://www.freeworldgroup.com/", "_blank");
}
Symbol 641 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("1.5");
}
static function showPreloaderAd(options) {
var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local27);
var clip = options.clip;
var _local23 = 11000;
var _local26 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local7._x = 10;
_local7._y = _local13 - 20;
var _local22 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local7.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local7.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local22);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local6 = _local7.createEmptyMovieClip("_outline", 3);
_local6.lineStyle(0, _local24, 100);
_local6.moveTo(0, 0);
_local6.lineTo(_local4 - 20, 0);
_local6.lineTo(_local4 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
chk.ad_msec = _local23;
chk.ad_timeout = _local26;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showTimedAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
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 _loadCommunicator(options) {
var _local25 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local25);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
_allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local24 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local24);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb) {
cb = parseInt(cb);
var _local4 = this._callbacks[cb];
if (!_local4) {
return(undefined);
}
delete this._callbacks[cb];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}
static function fetchHighScores(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}
static function sendHighScore(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local7 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local7._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local7.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local7._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
if (_local7._url.indexOf("http") != 0) {
options.no_page = true;
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local9 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local9;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local9);
_local6.lc = _local5;
_local4.lc = _local9;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local4);
}
}
Symbol 642 MovieClip [__Packages.engine.obj.Particle] Frame 0
class engine.obj.Particle
{
var PARENT, mc, mass, radius, v, F, coord, prevCoord;
function Particle (_ox, _oy, _mass, _PARENT, _mc) {
_global.initGlobalFun(this);
PARENT = _PARENT;
mc = _mc;
mass = _mass;
radius = 20;
v = new global.Vector(0, 0);
F = new global.Vector(0, 0);
coord = new global.Vector(_ox, _oy);
prevCoord = new global.Vector(_ox, _oy);
}
function setR(_radius) {
radius = _radius;
}
function setGFoce(_G, _friction) {
v = coord.minusNew(prevCoord);
prevCoord = coord.clone();
v.mult(_friction);
coord.plus(v);
coord.plus(_G);
}
function addForce(_F) {
coord.plus(_F);
}
function setPosition(newx, newy) {
prevCoord.reset(newx, newy);
coord.reset(newx, newy);
}
function checkMc() {
mc._x = coord.x;
mc._y = coord.y;
}
function checkSurface(_surface, _engine) {
var _local2 = _surface;
_local2.checkHit(this, _engine);
}
}
Symbol 643 MovieClip [__Packages.global.Vector] Frame 0
class global.Vector
{
var x, y;
function Vector (ox, oy) {
x = ox;
y = oy;
}
function clone() {
return(new global.Vector(x, y));
}
function reset(newx, newy) {
x = newx;
y = newy;
}
function equals(v) {
return((x == v.x) && (y == v.y));
}
function normalize(len) {
var _local2 = len / length;
x = x * _local2;
y = y * _local2;
}
function normalizeNew(len) {
return(new global.Vector((x * len) / length, (y * len) / length));
}
function get length() {
return(Math.sqrt((x * x) + (y * y)));
}
function getLength() {
return(Math.sqrt((x * x) + (y * y)));
}
function plus(v) {
x = x + v.x;
y = y + v.y;
}
function plusNew(v) {
return(new global.Vector(x + v.x, y + v.y));
}
function minus(v) {
x = x - v.x;
y = y - v.y;
}
function minusNew(v) {
return(new global.Vector(x - v.x, y - v.y));
}
function dot(v) {
return((x * v.x) + (y * v.y));
}
function cross(v) {
return((x * v.y) - (y * v.x));
}
function mult(s) {
x = x * s;
y = y * s;
}
function multNew(s) {
return(new global.Vector(x * s, y * s));
}
function div(n) {
x = x / n;
y = y / n;
}
function divNew(n) {
return(new global.Vector(x / n, y / n));
}
function negate() {
x = x * -1;
y = y * -1;
}
function negateNew() {
return(new global.Vector(-x, -y));
}
function distance(v) {
var _local3 = x - v.x;
var _local2 = y - v.y;
return(Math.sqrt((_local3 * _local3) + (_local2 * _local2)));
}
function projectNew(v) {
var _local4 = dot(v);
var _local5 = (v.x * v.x) + (v.y * v.y);
var _local3 = new global.Vector(0, 0);
_local3.x = (_local4 / _local5) * v.x;
_local3.y = (_local4 / _local5) * v.y;
return(_local3);
}
static function momHit(v1, v2, _mass1, _mass2) {
var _local4 = _mass1;
var _local1 = _mass2;
var _local5 = v1.minusNew(v2);
var _local3 = v1.clone();
var _local2 = v2.clone();
_local3.mult(_local4 - _local1);
_local2.mult(2 * _local1);
v1 = _local3.plusNew(_local2);
v1.div(_local4 + _local1);
v2 = _local5.plusNew(v1);
return({v1:v1, v2:v2});
}
function rotate(ang) {
var _local3 = _global.cosD(ang);
var _local4 = _global.sinD(ang);
var _local6 = x;
var _local5 = y;
x = (_local6 * _local3) - (_local5 * _local4);
y = (_local6 * _local4) + (_local5 * _local3);
}
function getAng() {
return(_global.atan2D(y, x));
}
function setAng(ang) {
var _local3 = length;
x = _local3 * _global.cosD(ang);
y = _local3 * _global.sinD(ang);
}
function angBetween(v) {
var _local3 = dot(v);
var _local4 = _local3 / (length * v.__get__length());
return(_global.acosD(_local4));
}
function angDispersion(v) {
var _local4 = cross(v);
var _local3 = dot(v);
return(_global.atan2D(_local4, _local3));
}
function getNormalNew() {
return(new global.Vector(-y, x));
}
function isPerpTo(v) {
return(dot(v) == 0);
}
function toString(Void) {
return(((("( x = " + x) + ", y = ") + y) + ")");
}
}
Symbol 644 MovieClip [__Packages.engine.surface.Surface] Frame 0
interface engine.surface.Surface
{
}
Symbol 645 MovieClip [__Packages.engine.PhysicsEngine] Frame 0
class engine.PhysicsEngine
{
var LEVEL, G, friction, decay, aObjects, aBody, aPoles, aConstraints, aSurfaces;
function PhysicsEngine () {
trace(":::\u65B0\u5EFA\u7269\u7406\u5F15\u64CE:::");
_global.initGlobalFun(this);
LEVEL = _root.mcLevel;
G = new global.Vector(0, 0.7);
friction = 0.98;
decay = 1;
aObjects = new Array();
aBody = new Array();
aPoles = new Array();
aConstraints = new Array();
aSurfaces = new Array();
}
function enterFrame() {
setGFoce();
checkConstraints();
checkHit();
checkPole();
}
function setG(_G) {
G = _G;
}
function setFriction(_f) {
friction = _f;
}
function addObjects(_particle) {
aObjects.push(_particle);
}
function addBody(_particle) {
aBody.push(_particle);
}
function addPoles(_pole) {
aPoles.push(_pole);
}
function addSurface(_surface) {
aSurfaces.push(_surface);
}
function addConstraint(_constraint) {
aConstraints.push(_constraint);
}
function setGFoce() {
for (var _local2 in aObjects) {
aObjects[_local2].setGFoce(G, friction);
aObjects[_local2].checkMc();
}
}
function checkPole() {
for (var _local2 in aPoles) {
aPoles[_local2].checkMc();
}
}
function checkConstraints() {
for (var _local2 in aConstraints) {
aConstraints[_local2].checkConstraint();
}
}
function checkHit() {
LEVEL.checkBodyHit(aBody);
}
}
Symbol 646 MovieClip [__Packages.engine.obj.Pole] Frame 0
class engine.obj.Pole
{
var p1, p2, mc, poleLength, poleAng, getAng, cosD, sinD;
function Pole (_p1, _p2, _poleLength, _mc) {
_global.initGlobalFun(this);
p1 = _p1;
p2 = _p2;
mc = _mc;
poleLength = _poleLength;
poleAng = 0;
}
function checkMc() {
getPoleAng();
getP2Coord();
mc._rotation = poleAng;
mc._x = p1.coord.x;
mc._y = p1.coord.y;
}
function getPoleAng() {
poleAng = getAng(p1.coord.x, p1.coord.y, p2.coord.x, p2.coord.y);
}
function getP2Coord() {
p2.coord.x = p1.coord.x + (poleLength * cosD(poleAng));
p2.coord.y = p1.coord.y + (poleLength * sinD(poleAng));
}
}
Symbol 647 MovieClip [__Packages.engine.constraint.Constraint] Frame 0
interface engine.constraint.Constraint
{
}
Symbol 648 MovieClip [__Packages.engine.constraint.AngConstraint] Frame 0
class engine.constraint.AngConstraint implements engine.constraint.Constraint
{
var pCenter, p1, p2, minAng, maxAng, stiffness, fixAng;
function AngConstraint (_pCenter, _p1, _p2, _minAng, _maxAng) {
_global.initGlobalFun(this);
pCenter = _pCenter;
p1 = _p1;
p2 = _p2;
minAng = _minAng;
maxAng = _maxAng;
stiffness = 0.5;
}
function checkConstraint() {
var _local3 = p1.coord.minusNew(pCenter.coord);
var _local2 = p2.coord.minusNew(pCenter.coord);
var _local4 = fixAng(_local3.angDispersion(_local2));
var _local6 = getCentroid();
if (_local4 < minAng) {
var _local7 = ((minAng - _local4) * 0.5) * stiffness;
_local3.rotate(-_local7);
_local2.rotate(_local7);
p1.coord = pCenter.coord.plusNew(_local3);
p2.coord = pCenter.coord.plusNew(_local2);
var _local8 = getCentroid();
var _local5 = _local8.minusNew(_local6);
pCenter.coord.minus(_local5);
p1.coord.minus(_local5);
p2.coord.minus(_local5);
} else if (_local4 > maxAng) {
var _local7 = ((_local4 - maxAng) * 0.5) * stiffness;
_local3.rotate(_local7);
_local2.rotate(-_local7);
p1.coord = pCenter.coord.plusNew(_local3);
p2.coord = pCenter.coord.plusNew(_local2);
var _local8 = getCentroid();
var _local5 = _local8.minusNew(_local6);
pCenter.coord.minus(_local5);
p1.coord.minus(_local5);
p2.coord.minus(_local5);
}
}
function getCentroid() {
var _local3 = ((pCenter.coord.x + p1.coord.x) + p2.coord.x) / 3;
var _local2 = ((pCenter.coord.y + p1.coord.y) + p2.coord.y) / 3;
return(new global.Vector(_local3, _local2));
}
}
Symbol 649 MovieClip [__Packages.engine.constraint.SpringConstraint] Frame 0
class engine.constraint.SpringConstraint implements engine.constraint.Constraint
{
var p1, p2, restLength, stiffness;
function SpringConstraint (_p1, _p2) {
_global.initGlobalFun(this);
p1 = _p1;
p2 = _p2;
restLength = p1.coord.distance(p2.coord);
stiffness = 0.5;
}
function setRestLength(_restLength) {
restLength = _restLength;
}
function setStiffness(_stiffness) {
stiffness = _stiffness;
}
function checkConstraint() {
var _local5 = p1.coord.clone();
var _local4 = p1.coord.minusNew(p2.coord);
var _local2 = _local4.__get__length();
var _local6 = (_local2 - restLength) / _local2;
var _local3 = _local4.multNew(_local6 * stiffness);
p1.coord.minus(_local3);
p2.coord.plus(_local3);
var _local7 = p1.coord.minusNew(_local5);
}
}
Symbol 650 MovieClip [__Packages.as.Sea] Frame 0
class as.Sea extends MovieClip
{
var LEVEL, v, increaseRate, inSeaMaxTime, inSeaTime, bInSea, onEnterFrame, _y, _x, inSeaInter, atMc2;
function Sea () {
super();
_global.initGlobalFun(this);
LEVEL = _root.mcLevel;
v = 2;
increaseRate = 0.0015;
inSeaMaxTime = 3;
inSeaTime = inSeaMaxTime;
bInSea = false;
initFrame();
}
function setIncreaseRate() {
if (_root.sHard == "MEDIUM") {
increaseRate = 0.0015;
} else if (_root.sHard == "HARD") {
increaseRate = 0.002;
} else if (_root.sHard == "INSANE") {
increaseRate = 0.0024;
}
}
function initFrame() {
onEnterFrame = function () {
if (_root.bPause) {
return(undefined);
}
this.mv();
this.dcRole();
};
}
function mv() {
if ((LEVEL.pNeck.coord.y - _y) < 550) {
v = v + increaseRate;
_y = _y - v;
_x = -LEVEL._x;
} else {
_y = LEVEL.pNeck.coord.y - 550;
_x = -LEVEL._x;
}
}
function dcRole() {
var _local3 = LEVEL.pNeck.coord.y;
var _local2 = _y - _local3;
if (_local2 > 0) {
if (bInSea) {
bInSea = false;
LEVEL.gameEngine.setG(LEVEL.G);
LEVEL.gameEngine.setFriction(LEVEL.friction);
clearInterval(inSeaInter);
}
} else if (!bInSea) {
bInSea = true;
LEVEL.gameEngine.setG(LEVEL.seaG);
LEVEL.gameEngine.setFriction(LEVEL.seaFriction);
inSeaTime = inSeaMaxTime;
clearInterval(inSeaInter);
inSeaInter = setInterval(this, "addNote", 1000);
}
}
function addNote() {
clearInterval(inSeaInter);
inSeaInter = setInterval(this, "addNote", 1000);
if (_root.bPause) {
return(undefined);
}
var _local4 = ("note" + inSeaTime) + "Anim";
var _local3 = atMc2(LEVEL, _local4);
_local3._x = LEVEL.pNeck.coord.x;
_local3._y = LEVEL.pNeck.coord.y - 50;
if (inSeaTime > 0) {
inSeaTime = inSeaTime - 1;
_root.loseScore(_root.waterScore);
} else {
_root.bOver = true;
_root.loseScore(_root.lifeScore);
clearInterval(inSeaInter);
}
}
}
Symbol 651 MovieClip [__Packages.global.GlobalFun] Frame 0
class global.GlobalFun
{
function GlobalFun () {
initFun();
}
function initFun() {
_global.initGlobalFun = function (_mc) {
var _local2 = _mc;
_local2.turnTo = _global.turnTo;
_local2.kill = _global.kill;
_local2.nextDepth = _global.nextDepth;
_local2.atMc = _global.atMc;
_local2.atMc2 = _global.atMc2;
_local2.newMc = _global.newMc;
_local2.newMc2 = _global.newMc2;
_local2.killInter = _global.killInter;
_local2.killArrayElem = _global.killArrayElem;
_local2.funManage = _global.funManage;
_local2.funManage2 = _global.funManage2;
_local2.fixUI2 = _global.fixUI2;
_local2.oddsManage = _global.oddsManage;
_local2.frame2Time = _global.frame2Time;
_local2.time2Frame = _global.time2Frame;
_local2.changeColor = _global.changeColor;
_local2.newFPS = _global.newFPS;
_local2.drawLine = _global.drawLine;
_local2.drawManage = _global.drawManage;
_local2.newMasker = _global.newMasker;
_local2.keyManage = _global.keyManage;
_local2.classMenu = _global.classMenu;
_local2.randPlay = _global.randPlay;
_local2.car2Flash = _global.car2Flash;
_local2.flash2Car = _global.flash2Car;
_local2.car2Polar = _global.car2Polar;
_local2.polar2Car = _global.polar2Car;
_local2.getCoordG = _global.getCoordG;
_local2.getCoordG2 = _global.getCoordG2;
_local2.getCoordL = _global.getCoordL;
_local2.randPole = _global.randPole;
_local2.rand = _global.rand;
_local2.intRand = _global.intRand;
_local2.floor = _global.floor;
_local2.ceil = _global.ceil;
_local2.round = _global.round;
_local2.sqrt = _global.sqrt;
_local2.abs = _global.abs;
_local2.getDis = _global.getDis;
_local2.getL2 = _global.getL2;
_local2.getL3 = _global.getL3;
_local2.sinD = _global.sinD;
_local2.cosD = _global.cosD;
_local2.atan2D = _global.atan2D;
_local2.asinD = _global.asinD;
_local2.acosD = _global.acosD;
_local2.tanD = _global.tanD;
_local2.d2r = _global.d2r;
_local2.r2d = _global.r2d;
_local2.fixAng = _global.fixAng;
_local2.getAng = _global.getAng;
_local2.getAng2 = _global.getAng2;
_local2.getOutAng = _global.getOutAng;
_local2.getRo = _global.getRo;
_local2.classRo = _global.classRo;
_local2.classRo2 = _global.classRo2;
};
_global.turnTo = function (_sFrame) {
var _local2 = _root;
_local2.gotoAndStop(_sFrame);
};
_global.kill = function (_mc) {
_mc.removeMovieClip();
if (_mc) {
_mc.swapDepths(0);
_mc.removeMovieClip();
}
};
_global.nextDepth = function (_mc) {
var _local1 = _mc.getNextHighestDepth();
return(_local1);
};
_global.atMc = function (_dir, _mc, _newName) {
var _local2 = _dir.getNextHighestDepth();
if (!_newName) {
_newName = _mc;
}
var _local1 = _dir.attachMovie(_mc, _newName, _local2);
return(_local1);
};
_global.atMc2 = function (_dir, _mc, _newName) {
var _local1 = _dir.getNextHighestDepth();
if (!_newName) {
_newName = _mc;
}
var _local2 = _dir.attachMovie(_mc, _newName + _local1, _local1);
return(_local2);
};
_global.newMc = function (_dir, _mc) {
var _local2 = _dir.getNextHighestDepth();
var _local1 = _dir.createEmptyMovieClip(_mc, _local2);
return(_local1);
};
_global.newMc2 = function (_dir, _mc) {
var _local1 = _dir.getNextHighestDepth();
var _local2 = _dir.createEmptyMovieClip(_mc + _local1, _local1);
return(_local2);
};
_global.killInter = function (_dir, _aInter) {
_dir.onUnload = function () {
for (var _local1 in _aInter) {
clearInterval(_dir[_aInter[_local1]]);
}
};
};
_global.killArrayElem = function (_a, _elem) {
var _local6 = _elem;
var _local2 = _a;
var _local5 = _local2.length;
var _local1 = 0;
var _local4 = 0;
var _local3 = false;
while (_local1 < _local5) {
if (_local6 == _local2[_local1]) {
_local4 = _local1;
_local3 = true;
break;
}
_local1++;
}
if (_local3) {
_local2.splice(_local4, 1);
}
};
_global.funManage = function (_dir, _aFun) {
var _local3 = _dir;
var _local2 = _aFun;
for (var _local5 in _local2) {
var _local1 = _local2[_local5];
for (var _local4 in _local1) {
_local3[_local1[_local4]]();
}
}
};
_global.funManage2 = function (_dir, _aFun) {
var _local6 = _dir;
var _local5 = _aFun;
for (var _local8 in _local5) {
var _local4 = _local5[_local8];
for (var _local7 in _local4) {
var _local2 = _local6[_local4[_local7]];
var _local3 = _local2.aFun;
this.funManage(_local2, [_local3]);
}
}
};
_global.fixUI2 = function () {
_root.reserved.swapDepths(-2);
_root.focusManager.swapDepths(-1);
};
_global.oddsManage = function (_dir, _aOdds, _aFun) {
var _local8 = _aOdds.length;
var _local6 = Math.random();
var _local7 = 0;
var _local2 = 0;
while (_local2 < _local8) {
var _local3 = 0;
var _local4 = _aOdds[_local2];
var _local1 = 0;
while (_local1 < _local2) {
_local3 = _local3 + _aOdds[_local1];
_local1++;
}
_local4 = _local4 + _local3;
if (_local6 >= _local3) {
if (_local6 < _local4) {
_local7 = _local2;
break;
}
}
_local2++;
}
return(_dir[_aFun[_local7]]());
};
_global.frame2Time = function (_nFrames, _FPS) {
var _local1 = (_nFrames / _FPS) * 1000;
return(_local1);
};
_global.time2Frame = function (_T, _FPS) {
var _local1 = (_T / 1000) * _FPS;
return(_local1);
};
_global.changeColor = function (_mc, _colorTrans) {
var _local1 = new Color(_mc);
_local1.setTransform(_colorTrans);
};
_global.newFPS = function (_vis) {
var mcFPS = this.newMc(_root, "mcFPS");
if (_vis == undefined) {
_vis = true;
}
if (_vis) {
mcFPS.createTextField("FPSTextField", this.nextDepth(mcFPS), 20, 10, 50, 20);
}
var fps = 0;
mcFPS.onEnterFrame = function () {
fps++;
};
mcFPS.calcFPS = function () {
if (_vis) {
mcFPS.FPSTextField.text = String("FPS: " + fps);
}
fps = 0;
};
setInterval(mcFPS, "calcFPS", 1000);
};
_global.drawLine = function (_mc, x1, y1, x2, y2) {
var _local1 = _mc;
_local1.clear();
_local1.lineStyle(1, 0, 100);
_local1.moveTo(x1, y1);
_local1.lineTo(x2, y2);
};
_global.drawManage = function (_mc, aLineStyle, aCoord, aFillColor, baseName) {
var _local7 = _mc;
_local7.lineStyle(aLineStyle[0], aLineStyle[1], aLineStyle[2]);
var _local4 = aCoord[0][0];
var _local3 = aCoord[0][1];
_local7.moveTo(_local4, _local3);
if (aFillColor) {
if (typeof(aFillColor[0]) == "number") {
_local7.beginFill(aFillColor[0], aFillColor[1]);
} else {
_local7.beginBitmapFill(aFillColor[0], aFillColor[1], aFillColor[2], aFillColor[3]);
}
}
var _local5 = 1;
var _local11 = aCoord.length;
while (_local5 < _local11) {
if (baseName) {
var _local2 = this.newMc2(_local7, baseName);
_local2.cacheAsBitmap = true;
_local2.lineStyle(aLineStyle[0], aLineStyle[1], aLineStyle[2]);
_local2.moveTo(_local4, _local3);
}
_local4 = aCoord[_local5][0];
_local3 = aCoord[_local5][1];
_local7.lineTo(_local4, _local3);
if (_local2) {
_local2.lineTo(_local4, _local3);
}
_local5++;
}
if (aFillColor) {
_local7.endFill();
}
};
_global.newMasker = function (aColor, _dir, w, h, L) {
if (!aColor) {
aColor = [0, 100];
}
if (!_dir) {
_dir = _root;
}
if (!w) {
w = Stage.width;
}
if (!h) {
h = Stage.height;
}
if (!L) {
L = 500;
}
this.kill(_dir[_dir._name + "Masker"]);
var _local7 = this.newMc(_dir, _dir._name + "Masker");
var _local12 = [[-L, -L], [w + L, -L], [w + L, 0], [-L, 0]];
var _local11 = [[-L, h], [w + L, h], [w + L, h + L], [-L, h + L]];
var _local10 = [[-L, -L], [0, -L], [0, h + L], [-L, h + L]];
var _local9 = [[w, -L], [w + L, -L], [w + L, h + L], [w, h + L]];
this.drawManage(_local7, [1, 0, 0], _local12, [aColor[0], aColor[1]]);
this.drawManage(_local7, [1, 0, 0], _local11, [aColor[0], aColor[1]]);
this.drawManage(_local7, [1, 0, 0], _local10, [aColor[0], aColor[1]]);
this.drawManage(_local7, [1, 0, 0], _local9, [aColor[0], aColor[1]]);
};
_global.keyManage = function (_dir, aKey, aFun, aExtFun) {
var keyManager = this.newMc(_dir, _dir._name + "KeyManager");
for (var _local4 in aKey) {
var _local2 = aKey[_local4];
keyManager["bDown" + _local2] = false;
}
var len = aKey.length;
keyManager.onEnterFrame = function () {
var _local2 = 0;
while (_local2 < len) {
var _local1 = aKey[_local2];
if (Key.isDown(_local1)) {
if (!keyManager["bDown" + _local1]) {
_dir[aFun[_local2][1]]();
keyManager["bDown" + _local1] = true;
}
_dir[aFun[_local2][0]]();
}
if (!Key.isDown(_local1)) {
if (keyManager["bDown" + _local1]) {
_dir[aFun[_local2][2]]();
keyManager["bDown" + _local1] = false;
}
}
_local2++;
}
_dir[aExtFun]();
};
};
_global.classMenu = function (_dir, aMenu, aFun, aExtFun) {
var _local4 = aMenu.length;
var _local3 = 0;
while (_local3 < _local4) {
var _local2 = _dir[aMenu[_local3]];
_local2.onRollOver = function () {
this.gotoAndPlay(2);
_dir[aExtFun[0]]();
};
_local2.onRollOut = function () {
this.gotoAndPlay(this._totalframes - this._currentframe);
_dir[aExtFun[1]]();
};
if (aFun) {
_local2.id = _local3;
_local2.onPress = function () {
_dir[aFun[this.id]]();
};
}
_local3++;
}
};
_global.classMenu2 = function (_dir, aMenu, aExtFun) {
var len = aMenu.length;
var _local6 = this.newMc2(_dir, "mcHit");
_local6.onEnterFrame = function () {
var _local3 = 0;
while (_local3 < len) {
var _local2 = _dir[aMenu[_local3]];
var _local4 = _local2.hitTest(_root._xmouse, _root._ymouse, true);
if (_local4) {
if (!_local2.bHited) {
_local2.gotoAndPlay(2);
_dir[aExtFun[0]]();
_local2.bHited = true;
}
} else if (_local2.bHited) {
_local2.gotoAndPlay(_local2._totalframes - _local2._currentframe);
_dir[aExtFun[1]]();
_local2.bHited = false;
}
_local3++;
}
};
};
_global.randPlay = function (_mc) {
if (!_mc.bInited) {
_mc.gotoAndPlay(this.intRand(_mc._totalframes));
_mc.bInited = true;
}
};
_global.car2Flash = function (_o) {
_o._y = _o._y * -1;
_o._rotation = _o._rotation * -1;
};
_global.flash2Car = function (_o) {
return(this.car2Flash(_o));
};
_global.car2Polar = function (x, y) {
var _local2 = Math.sqrt((x * x) + (y * y));
var _local5 = this.atan2D(y, x);
return({r:_local2, a:_local5});
};
_global.polar2Car = function (len, ang) {
var _local3 = len * this.cosD(ang);
var _local2 = len * this.sinD(ang);
return({x:_local3, y:_local2});
};
_global.getCoordG = function (_mc) {
var _local1 = {x:_mc._x, y:_mc._y};
_mc._parent.localToGlobal(_local1);
return(_local1);
};
_global.getCoordG2 = function (_mc, xx, yy) {
var _local1 = {x:xx, y:yy};
_mc.localToGlobal(_local1);
return(_local1);
};
_global.getCoordL = function (_mc, xx, yy) {
var _local1 = {x:xx, y:yy};
_mc._parent.globalToLocal(_local1);
return(_local1);
};
_global.randPole = function () {
var _local1 = ((Math.random() > 0.5) ? 1 : -1);
return(_local1);
};
_global.rand = function (_n) {
if (!_n) {
_n = 1;
}
var _local2 = Math.random() * _n;
return(_local2);
};
_global.intRand = function (_n) {
var _local1 = Math.floor(Math.random() * _n);
return(_local1);
};
_global.floor = function (_n) {
var _local1 = Math.floor(_n);
return(_local1);
};
_global.ceil = function (_n) {
var _local1 = Math.ceil(_n);
return(_local1);
};
_global.round = function (_n) {
var _local1 = Math.round(_n);
return(_local1);
};
_global.sqrt = function (_n) {
var _local1 = Math.sqrt(_n);
return(_local1);
};
_global.abs = function (_n) {
var _local1 = Math.abs(_n);
return(_local1);
};
_global.getDis = function (x1, y1, x2, y2) {
var _local2 = x2 - x1;
var _local1 = y2 - y1;
var _local3 = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
return(_local3);
};
_global.getL2 = function (l1, l3) {
var _local1 = Math.sqrt((l3 * l3) - (l1 * l1));
return(_local1);
};
_global.getL3 = function (l1, l2) {
var _local1 = Math.sqrt((l1 * l1) + (l2 * l2));
return(_local1);
};
_global.sinD = function (_angle) {
var _local1 = Math.sin((_angle * 3.141593) / 180);
return(_local1);
};
_global.cosD = function (_angle) {
var _local1 = Math.cos((_angle * 3.141593) / 180);
return(_local1);
};
_global.atan2D = function (y, x) {
var _local1 = Math.atan2(y, x) * 57.29578;
return(_local1);
};
_global.asinD = function (_ratio) {
var _local1 = Math.asin(_ratio) * 57.29578;
return(_local1);
};
_global.acosD = function (_ratio) {
var _local1 = Math.acos(_ratio) * 57.29578;
return(_local1);
};
_global.tanD = function (_angle) {
var _local1 = Math.tan((_angle * 3.141593) / 180);
return(_local1);
};
_global.d2r = function (_angle) {
var _local1 = _angle * 0.017453;
return(_local1);
};
_global.r2d = function (_radian) {
var _local1 = _radian * 57.29578;
return(_local1);
};
_global.fixAng = function (_ang) {
var _local1 = _ang % 360;
var _local2 = (((_local1 % 360) < 0) ? (_local1 + 360) : (_local1));
return(_local2);
};
_global.getAng = function (x1, y1, x2, y2) {
var _local1 = Math.atan2(y2 - y1, x2 - x1) * 57.29578;
return(_local1);
};
_global.getAng2 = function (_a1, _a2) {
var _local4 = this.fixAng(_a1);
var _local3 = this.fixAng(_a2);
var _local2 = this.abs(_local3 - _local4);
if (_local2 > 180) {
_local2 = 360 - _local2;
}
_local2 = this.fixAng(_local2);
return(_local2);
};
_global.getOutAng = function (_lineAng, _inAng) {
var _local1 = (_lineAng * 2) - _inAng;
return(_local1);
};
_global.getRo = function (_a1, _a2, _mod, _r, _m) {
var _local7 = this.fixAng(_a1);
var _local2 = this.fixAng(_a2);
var _local5 = _r;
var _local6 = _local7 - _local2;
var _local3 = this.abs(_local6);
if (_local3 < _m) {
return(_local2);
}
var _local4 = _local3 / _local6;
if (_local3 > 180) {
_local3 = 360 - _local3;
_local4 = -_local4;
}
if (_mod == 1) {
_local2 = _local2 + ((_local4 * _local3) * _local5);
} else {
_local2 = _local2 + (_local4 * _local5);
}
_local2 = this.fixAng(_local2);
return(_local2);
};
_global.classRo = function (xx, yy, _ang, _ox, _oy) {
var _local8 = xx;
var _local7 = yy;
var _local2 = _ang;
var _local6 = _ox;
var _local5 = _oy;
_local8 = _local8 - _local6;
_local7 = _local7 - _local5;
var _local4 = (this.cosD(_local2) * _local8) - (this.sinD(_local2) * _local7);
var _local3 = (this.cosD(_local2) * _local7) + (this.sinD(_local2) * _local8);
_local4 = _local4 + _local6;
_local3 = _local3 + _local5;
return({x:_local4, y:_local3});
};
_global.classRo2 = function (xx, yy, _mc, offsetAng) {
var _local5 = xx;
var _local4 = yy;
var _local2 = this.atan2D(_local4, _local5);
if (_mc) {
if (!offsetAng) {
offsetAng = 0;
}
_mc._rotation = _local2 + offsetAng;
}
return(_local2);
};
}
}
Symbol 60 MovieClip Frame 1
_visible = false;
Symbol 83 MovieClip Frame 1
Symbol 105 Button
on (release) {
viewHighscore();
}
Symbol 108 Button
on (release) {
getURL ("http://www.freeworldgroup.com/", "_blank");
}
Symbol 111 Button
on (release) {
getURL ("http://www.ifungames.com", "_blank");
}
Symbol 114 Button
on (release) {
getURL ("http://www.freeworldgroup.com/koalafiles.htm", "_blank");
}
Symbol 117 Button
on (release) {
_root.backToFrontPage();
}
Symbol 129 Button
on (release) {
gotoAndStop ("submit");
}
Symbol 134 Button
on (release) {
gotoAndStop (1);
}
Symbol 145 Button
on (release) {
gotoAndStop ("submited");
}
Symbol 151 Button
on (release) {
viewHighscore();
}
Symbol 152 MovieClip Frame 1
stop();
_global.game_name = _game_name;
var highscore = eval (score_var);
_global.viewHighscore = function () {
getURL ("http://www.freeworldgroup.com/score/index.asp?game=" + game_name, "_blank");
};
if (highscore <= 0) {
this._visible = false;
}
trace(game_name);
trace(highscore);
trace("http://www.freeworldgroup.com/score/index.asp?game=" + game_name);
Symbol 152 MovieClip Frame 3
function sendData() {
send_var.game = game_name;
send_var.score = highscore;
send_var.name = name_txt.text;
if (send_var.name == "") {
send_var.name = "guest" + int(Math.random() * 1000);
}
send_var.sendAndLoad("http://www.freeworldgroup.com/score/score.asp", load_var, "POST");
gotoAndStop ("sending");
}
stop();
gold_txt.text = highscore;
send_var = new LoadVars();
load_var = new LoadVars();
ok_btn.onRelease = sendData;
load_var.onLoad = function () {
gotoAndStop ("done");
};
Instance of Symbol 131 MovieClip in Symbol 152 MovieClip Frame 3
on (release) {
}
Symbol 153 MovieClip Frame 16
stop();
Instance of Symbol 152 MovieClip in Symbol 153 MovieClip Frame 16
//component parameters
onClipEvent (construct) {
_game_name = "the_return";
score_var = "_root.score";
}
Symbol 154 MovieClip Frame 261
stop();
Symbol 155 MovieClip [mcEnd] Frame 164
stop();
Symbol 168 MovieClip Frame 1
stop();
Symbol 168 MovieClip Frame 2
stop();
Symbol 174 MovieClip Frame 1
stop();
Symbol 174 MovieClip Frame 2
stop();
Symbol 178 MovieClip Frame 1
stop();
Symbol 178 MovieClip Frame 2
stop();
Symbol 180 MovieClip Frame 1
if (!_parent.flash_start) {
gotoAndStop (10);
}
Symbol 180 MovieClip Frame 10
stop();
Symbol 181 MovieClip Frame 9
stop();
_parent.flash_start = true;
Symbol 185 MovieClip Frame 1
stop();
Symbol 185 MovieClip Frame 2
stop();
Symbol 187 MovieClip Frame 1
stop();
Symbol 187 MovieClip Frame 2
stop();
Symbol 189 MovieClip Frame 1
stop();
Symbol 189 MovieClip Frame 2
stop();
Symbol 191 MovieClip Frame 1
stop();
Symbol 191 MovieClip Frame 2
stop();
Symbol 192 MovieClip Frame 1
stop();
Symbol 192 MovieClip Frame 10
function quality_init() {
switch (_quality) {
case "LOW" :
bt4.gotoAndStop(2);
return;
case "MEDIUM" :
bt3.gotoAndStop(2);
return;
case "HIGH" :
bt2.gotoAndStop(2);
return;
case "BEST" :
bt1.gotoAndStop(2);
}
}
function bt_init() {
bt1.gotoAndStop(1);
bt2.gotoAndStop(1);
bt3.gotoAndStop(1);
bt4.gotoAndStop(1);
}
stop();
quality_init();
bt1.bt.onPress = function () {
bt_init();
_quality = "BEST";
quality_init();
bt1.gotoAndStop(2);
};
bt2.bt.onPress = function () {
bt_init();
_quality = "HIGH";
quality_init();
bt2.gotoAndStop(2);
};
bt3.bt.onPress = function () {
bt_init();
_quality = "MEDIUM";
quality_init();
bt3.gotoAndStop(2);
};
bt4.bt.onPress = function () {
bt_init();
_quality = "LOW";
quality_init();
bt4.gotoAndStop(2);
};
Symbol 193 MovieClip Frame 1
hit = false;
opend = false;
onEnterFrame = function () {
dcHitMenu();
dcMenu();
};
dcHitMenu = function () {
var _local2 = btQuality.hitTest(_root._xmouse, _root._ymouse, false);
if (_local2) {
hit = true;
} else {
hit = false;
}
};
dcMenu = function () {
if (hit && (!opend)) {
if (_root.bPause) {
return(undefined);
}
if (!_root.bStart) {
return(undefined);
}
qualityMenu.gotoAndPlay(1);
btQuality.gotoAndStop(2);
opend = true;
}
if (!hit) {
if (opend) {
qualityMenu.gotoAndPlay(11);
opend = false;
}
btQuality.gotoAndStop(1);
}
};
if (!_root.bMusicOn) {
btMusic.gotoAndStop(2);
}
if (!_root.bSoundOn) {
btSound.gotoAndStop(2);
}
btMusic.onPress = function () {
if (_root.bPause) {
return(undefined);
}
if (!_root.bStart) {
return(undefined);
}
btMusic.play();
_root.bMusicOn = !_root.bMusicOn;
_root.initMusic();
};
btSound.onPress = function () {
if (_root.bPause) {
return(undefined);
}
if (!_root.bStart) {
return(undefined);
}
btSound.play();
_root.bSoundOn = !_root.bSoundOn;
_root.initSD();
};
Instance of Symbol 168 MovieClip "btMusic" in Symbol 193 MovieClip Frame 1
on (release) {
_root.setMusic(this);
}
Instance of Symbol 174 MovieClip "btSound" in Symbol 193 MovieClip Frame 1
on (release) {
_root.setSound(this);
}
Symbol 223 MovieClip Frame 1
Symbol 229 MovieClip Frame 1
stop();
Symbol 233 MovieClip Frame 1
stop();
Symbol 237 MovieClip Frame 1
stop();
Symbol 240 Button
on (release) {
gotoAndStop ("start");
}
Symbol 244 Button
on (release) {
_root.backToFrontPage();
}
Symbol 248 Button
on (release) {
gotoAndStop ("mode");
}
Symbol 253 Button
on (release) {
gotoAndStop ("control");
}
Symbol 256 Button
on (release) {
_root.startGame();
_root.mcLevel.sea.setIncreaseRate();
gotoAndStop ("gameStart");
}
Symbol 257 Button
on (release) {
gotoAndStop ("start");
}
Symbol 268 MovieClip Frame 1
function action() {
if (actionInter == 0) {
foot1ActionID = foot1ActionID + 1;
foot2ActionID = foot2ActionID + 1;
if (foot1ActionID == maxFootAction) {
foot1ActionID = 0;
}
if (foot2ActionID == maxFootAction) {
foot2ActionID = 0;
}
var _local2 = aFootAction[foot1ActionID][0];
var _local1 = aFootAction[foot1ActionID][1];
foot1F.reset(_local2, _local1);
_local2 = aFootAction[foot2ActionID][0];
_local1 = aFootAction[foot2ActionID][1];
foot2F.reset(_local2, _local1);
hand1ActionID = hand1ActionID + 1;
hand2ActionID = hand2ActionID + 1;
if (hand1ActionID == maxHandAction) {
hand1ActionID = 0;
}
if (hand2ActionID == maxHandAction) {
hand2ActionID = 0;
}
if (selRope != pRopeA0) {
_local2 = aHandAction[hand1ActionID][0];
_local1 = aHandAction[hand1ActionID][1];
hand1F.reset(_local2, _local1);
}
if (selRope != pRopeB0) {
_local2 = aHandAction[hand2ActionID][0];
_local1 = aHandAction[hand2ActionID][1];
hand2F.reset(_local2, _local1);
}
actionInter = maxActionInter;
}
if (selRope == pRopeA0) {
hand1F.reset(0, 0);
} else {
hand2F.reset(0, 0);
}
pFoot1.addForce(foot1F);
pFoot2.addForce(foot2F);
actionInter = actionInter - 1;
}
function linkHook() {
var _local2 = pRopeA0.coord.x;
var _local1 = pRopeA0.coord.y;
var _local6 = pRopeA1.coord.x;
var _local5 = pRopeA1.coord.y;
var _local4 = pRopeB0.coord.x;
var _local3 = pRopeB0.coord.y;
var _local8 = pRopeB1.coord.x;
var _local7 = pRopeB1.coord.y;
hook1._x = _local2;
hook1._y = _local1;
hook2._x = _local4;
hook2._y = _local3;
var _local10 = getAng(_local2, _local1, _local6, _local5);
var _local9 = getAng(_local4, _local3, _local8, _local7);
hook1._rotation = _local10 - 90;
hook2._rotation = _local9 - 90;
}
function drawRope() {
var _local3 = mcRope;
_local3.clear();
_local3.lineStyle(1, 0, 100);
var _local5 = this["pRopeA" + (ropeNum - 1)].coord;
var _local4 = this.pHand1.coord;
_local3.moveTo(_local5.x, _local5.y);
_local3.lineTo(_local4.x, _local4.y);
_local5 = this["pRopeB" + (ropeNum - 1)].coord;
_local4 = this.pHand2.coord;
_local3.moveTo(_local5.x, _local5.y);
_local3.lineTo(_local4.x, _local4.y);
var _local2 = 0;
while (_local2 < (ropeNum - 1)) {
_local5 = this["pRopeA" + _local2].coord;
_local4 = this["pRopeA" + (_local2 + 1)].coord;
_local3.moveTo(_local5.x, _local5.y);
_local3.lineTo(_local4.x, _local4.y);
_local5 = this["pRopeB" + _local2].coord;
_local4 = this["pRopeB" + (_local2 + 1)].coord;
_local3.moveTo(_local5.x, _local5.y);
_local3.lineTo(_local4.x, _local4.y);
_local2++;
}
}
function setPose() {
pNeck.setPosition(neckCoord[0] + xoffset, neckCoord[1] + yoffset);
pSpine.setPosition(spineCoord[0] + xoffset, spineCoord[1] + yoffset);
pKnee1.setPosition(knee1Coord[0] + xoffset, knee1Coord[1] + yoffset);
pFoot1.setPosition(foot1Coord[0] + xoffset, foot1Coord[1] + yoffset);
pKnee2.setPosition(knee2Coord[0] + xoffset, knee2Coord[1] + yoffset);
pFoot2.setPosition(foot2Coord[0] + xoffset, foot2Coord[1] + yoffset);
pElbow1.setPosition(elbow1Coord[0] + xoffset, elbow1Coord[1] + yoffset);
pHand1.setPosition(hand1Coord[0] + xoffset, hand1Coord[1] + yoffset);
pElbow2.setPosition(elbow2Coord[0] + xoffset, elbow2Coord[1] + yoffset);
pHand2.setPosition(hand2Coord[0] + xoffset, hand2Coord[1] + yoffset);
}
function hang() {
pRopeB0.setPosition(100, 10);
}
function headShake() {
var _local1 = new global.Vector(headXF, -2);
pNeck.addForce(_local1);
NeckTime = NeckTime - 1;
if (NeckTime == 0) {
NeckTime = NeckMaxTime;
if (headXF == 1) {
headXF = -1;
} else {
headXF = 1;
}
}
}
function onEnterFrame() {
gameEngine.enterFrame();
action();
headShake();
linkHook();
drawRope();
hang();
}
trace("::::\u5173\u5361\u52A0\u8F7D\u6210\u529F::::");
var gameEngine = (new engine.PhysicsEngine());
var G = (new global.Vector(0, 0.7));
var friction = 0.97;
var seaG = (new global.Vector(0, 0.15));
var seaFriction = 0.95;
LEVEL.gameEngine.setG(G);
LEVEL.gameEngine.setFriction(friction);
var unitLen = 24;
var bodyLen = 30;
var headLen = 15;
var ropeUnitLen = 1;
var ropeLen = 500;
var ropeNum = 9;
var xoffset = 100;
var yoffset = 300;
var aRopeA = new Array();
var aRopeB = new Array();
var aRopeASC = new Array();
var aRopeBSC = new Array();
var neckCoord = new Array(mcBodyCoord.mcNeck._x, mcBodyCoord.mcNeck._y);
var elbow1Coord = new Array(mcBodyCoord.mcElbow1._x, mcBodyCoord.mcElbow1._y);
var elbow2Coord = new Array(mcBodyCoord.mcElbow2._x, mcBodyCoord.mcElbow2._y);
var hand1Coord = new Array(mcBodyCoord.mcHand1._x, mcBodyCoord.mcHand1._y);
var hand2Coord = new Array(mcBodyCoord.mcHand2._x, mcBodyCoord.mcHand2._y);
var spineCoord = new Array(mcBodyCoord.mcSpine._x, mcBodyCoord.mcSpine._y);
var knee1Coord = new Array(mcBodyCoord.mcKnee1._x, mcBodyCoord.mcKnee1._y);
var knee2Coord = new Array(mcBodyCoord.mcKnee2._x, mcBodyCoord.mcKnee2._y);
var foot1Coord = new Array(mcBodyCoord.mcFoot1._x, mcBodyCoord.mcFoot1._y);
var foot2Coord = new Array(mcBodyCoord.mcFoot2._x, mcBodyCoord.mcFoot2._y);
var hook1Coord = new Array(mcBodyCoord.mcHook1._x, mcBodyCoord.mcHook1._y);
var hook2Coord = new Array(mcBodyCoord.mcHook2._x, mcBodyCoord.mcHook2._y);
var bodyOffset = 0;
kill(mcBodyCoord);
var pRopeA0 = (new engine.obj.Particle(hook1Coord[0] + xoffset, hook1Coord[1] + yoffset, 1, this));
var pRopeA1 = (new engine.obj.Particle(hook1Coord[0] + xoffset, (hook1Coord[1] + yoffset) - 1, 1, this));
var pRopeA2 = (new engine.obj.Particle(hook1Coord[0] + xoffset, (hook1Coord[1] + yoffset) - 2, 1, this));
var pRopeA3 = (new engine.obj.Particle(hook1Coord[0] + xoffset, (hook1Coord[1] + yoffset) - 3, 1, this));
var pRopeA4 = (new engine.obj.Particle(hook1Coord[0] + xoffset, (hook1Coord[1] + yoffset) - 4, 1, this));
var pRopeA5 = (new engine.obj.Particle(hook1Coord[0] + xoffset, (hook1Coord[1] + yoffset) - 5, 1, this));
var pRopeA6 = (new engine.obj.Particle(hook1Coord[0] + xoffset, (hook1Coord[1] + yoffset) - 6, 1, this));
var pRopeA7 = (new engine.obj.Particle(hook1Coord[0] + xoffset, (hook1Coord[1] + yoffset) - 7, 1, this));
var pRopeA8 = (new engine.obj.Particle(hook1Coord[0] + xoffset, (hook1Coord[1] + yoffset) - 8, 1, this));
aRopeA.push(pRopeA0);
aRopeA.push(pRopeA1);
aRopeA.push(pRopeA2);
aRopeA.push(pRopeA3);
aRopeA.push(pRopeA4);
aRopeA.push(pRopeA5);
aRopeA.push(pRopeA6);
aRopeA.push(pRopeA7);
aRopeA.push(pRopeA8);
var ropeASC0 = (new engine.constraint.SpringConstraint(pRopeA0, pRopeA1));
var ropeASC1 = (new engine.constraint.SpringConstraint(pRopeA1, pRopeA2));
var ropeASC2 = (new engine.constraint.SpringConstraint(pRopeA2, pRopeA3));
var ropeASC3 = (new engine.constraint.SpringConstraint(pRopeA3, pRopeA4));
var ropeASC4 = (new engine.constraint.SpringConstraint(pRopeA4, pRopeA5));
var ropeASC5 = (new engine.constraint.SpringConstraint(pRopeA5, pRopeA6));
var ropeASC6 = (new engine.constraint.SpringConstraint(pRopeA6, pRopeA7));
var ropeASC7 = (new engine.constraint.SpringConstraint(pRopeA7, pRopeA8));
aRopeASC.push(ropeASC0);
aRopeASC.push(ropeASC1);
aRopeASC.push(ropeASC2);
aRopeASC.push(ropeASC3);
aRopeASC.push(ropeASC4);
aRopeASC.push(ropeASC5);
aRopeASC.push(ropeASC6);
aRopeASC.push(ropeASC7);
var pRopeB0 = (new engine.obj.Particle(hook2Coord[0] + xoffset, hook2Coord[1] + yoffset, 1, this));
var pRopeB1 = (new engine.obj.Particle(hook2Coord[0] + xoffset, (hook2Coord[1] + yoffset) - 1, 1, this));
var pRopeB2 = (new engine.obj.Particle(hook2Coord[0] + xoffset, (hook2Coord[1] + yoffset) - 2, 1, this));
var pRopeB3 = (new engine.obj.Particle(hook2Coord[0] + xoffset, (hook2Coord[1] + yoffset) - 3, 1, this));
var pRopeB4 = (new engine.obj.Particle(hook2Coord[0] + xoffset, (hook2Coord[1] + yoffset) - 4, 1, this));
var pRopeB5 = (new engine.obj.Particle(hook2Coord[0] + xoffset, (hook2Coord[1] + yoffset) - 5, 1, this));
var pRopeB6 = (new engine.obj.Particle(hook2Coord[0] + xoffset, (hook2Coord[1] + yoffset) - 6, 1, this));
var pRopeB7 = (new engine.obj.Particle(hook2Coord[0] + xoffset, (hook2Coord[1] + yoffset) - 7, 1, this));
var pRopeB8 = (new engine.obj.Particle(hook2Coord[0] + xoffset, (hook2Coord[1] + yoffset) - 8, 1, this));
aRopeB.push(pRopeB0);
aRopeB.push(pRopeB1);
aRopeB.push(pRopeB2);
aRopeB.push(pRopeB3);
aRopeB.push(pRopeB4);
aRopeB.push(pRopeB5);
aRopeB.push(pRopeB6);
aRopeB.push(pRopeB7);
aRopeB.push(pRopeB8);
var RopeBSC0 = (new engine.constraint.SpringConstraint(pRopeB0, pRopeB1));
var RopeBSC1 = (new engine.constraint.SpringConstraint(pRopeB1, pRopeB2));
var RopeBSC2 = (new engine.constraint.SpringConstraint(pRopeB2, pRopeB3));
var RopeBSC3 = (new engine.constraint.SpringConstraint(pRopeB3, pRopeB4));
var RopeBSC4 = (new engine.constraint.SpringConstraint(pRopeB4, pRopeB5));
var RopeBSC5 = (new engine.constraint.SpringConstraint(pRopeB5, pRopeB6));
var RopeBSC6 = (new engine.constraint.SpringConstraint(pRopeB6, pRopeB7));
var RopeBSC7 = (new engine.constraint.SpringConstraint(pRopeB7, pRopeB8));
aRopeBSC.push(RopeBSC0);
aRopeBSC.push(RopeBSC1);
aRopeBSC.push(RopeBSC2);
aRopeBSC.push(RopeBSC3);
aRopeBSC.push(RopeBSC4);
aRopeBSC.push(RopeBSC5);
aRopeBSC.push(RopeBSC6);
aRopeBSC.push(RopeBSC7);
for (var i in aRopeA) {
gameEngine.addObjects(aRopeA[i]);
}
for (var i in aRopeB) {
gameEngine.addObjects(aRopeB[i]);
}
for (var i in aRopeASC) {
aRopeASC[i].setRestLength(ropeUnitLen);
aRopeASC[i].setStiffness(0.5);
gameEngine.addConstraint(aRopeASC[i]);
}
for (var i in aRopeBSC) {
aRopeBSC[i].setRestLength(ropeUnitLen);
aRopeBSC[i].setStiffness(0.5);
gameEngine.addConstraint(aRopeBSC[i]);
}
var pNeck = (new engine.obj.Particle(300, 160 + bodyOffset, 1, this));
gameEngine.addObjects(pNeck);
gameEngine.addBody(pNeck);
var pSpine = (new engine.obj.Particle(300, 200 + bodyOffset, 10, this));
gameEngine.addObjects(pSpine);
gameEngine.addBody(pSpine);
var pKnee1 = (new engine.obj.Particle(300, 250 + bodyOffset, 1, this));
gameEngine.addObjects(pKnee1);
gameEngine.addBody(pKnee1);
var pFoot1 = (new engine.obj.Particle(350, 250 + bodyOffset, 1, this));
gameEngine.addObjects(pFoot1);
gameEngine.addBody(pFoot1);
var pKnee2 = (new engine.obj.Particle(350, 250 + bodyOffset, 1, this));
gameEngine.addObjects(pKnee2);
gameEngine.addBody(pKnee2);
var pFoot2 = (new engine.obj.Particle(350, 300 + bodyOffset, 1, this));
gameEngine.addObjects(pFoot2);
gameEngine.addBody(pFoot2);
var pElbow1 = (new engine.obj.Particle(250, 200 + bodyOffset, 1, this));
gameEngine.addObjects(pElbow1);
gameEngine.addBody(pElbow1);
var pHand1 = (new engine.obj.Particle(250, 250 + bodyOffset, 1, this));
gameEngine.addObjects(pHand1);
gameEngine.addBody(pHand1);
var pElbow2 = (new engine.obj.Particle(350, 200 + bodyOffset, 1, this));
gameEngine.addObjects(pElbow2);
gameEngine.addBody(pElbow2);
var pHand2 = (new engine.obj.Particle(350, 250 + bodyOffset, 1, this));
gameEngine.addObjects(pHand2);
gameEngine.addBody(pHand2);
var bodyPole = (new engine.obj.Pole(pNeck, pSpine, bodyLen, mcBody));
gameEngine.addPoles(bodyPole);
var forearmPole1 = (new engine.obj.Pole(pElbow1, pHand1, unitLen, mcForearm1));
gameEngine.addPoles(forearmPole1);
var armPole1 = (new engine.obj.Pole(pNeck, pElbow1, unitLen, mcArm1));
gameEngine.addPoles(armPole1);
var forearmPole2 = (new engine.obj.Pole(pElbow2, pHand2, unitLen, mcForearm2));
gameEngine.addPoles(forearmPole2);
var armPole2 = (new engine.obj.Pole(pNeck, pElbow2, unitLen, mcArm2));
gameEngine.addPoles(armPole2);
var calfPole1 = (new engine.obj.Pole(pKnee1, pFoot1, unitLen, mcCalf1));
gameEngine.addPoles(calfPole1);
var legPole1 = (new engine.obj.Pole(pSpine, pKnee1, unitLen, mcLeg1));
gameEngine.addPoles(legPole1);
var calfPole2 = (new engine.obj.Pole(pKnee2, pFoot2, unitLen, mcCalf2));
gameEngine.addPoles(calfPole2);
var legPole2 = (new engine.obj.Pole(pSpine, pKnee2, unitLen, mcLeg2));
gameEngine.addPoles(legPole2);
var bodySC1 = (new engine.constraint.SpringConstraint(pSpine, pNeck));
bodySC1.setRestLength(bodyLen);
gameEngine.addConstraint(bodySC1);
var armSC1 = (new engine.constraint.SpringConstraint(pElbow1, pNeck));
armSC1.setRestLength(unitLen);
gameEngine.addConstraint(armSC1);
var forearmSC1 = (new engine.constraint.SpringConstraint(pHand1, pElbow1));
forearmSC1.setRestLength(unitLen);
gameEngine.addConstraint(forearmSC1);
var armSC2 = (new engine.constraint.SpringConstraint(pElbow2, pNeck));
armSC2.setRestLength(unitLen);
gameEngine.addConstraint(armSC2);
var forearmSC2 = (new engine.constraint.SpringConstraint(pHand2, pElbow2));
forearmSC2.setRestLength(unitLen);
gameEngine.addConstraint(forearmSC2);
var legSC1 = (new engine.constraint.SpringConstraint(pKnee1, pSpine));
legSC1.setRestLength(unitLen);
gameEngine.addConstraint(legSC1);
var calfSC1 = (new engine.constraint.SpringConstraint(pFoot1, pKnee1));
calfSC1.setRestLength(unitLen);
gameEngine.addConstraint(calfSC1);
var legSC2 = (new engine.constraint.SpringConstraint(pKnee2, pSpine));
legSC2.setRestLength(unitLen);
gameEngine.addConstraint(legSC2);
var calfSC2 = (new engine.constraint.SpringConstraint(pFoot2, pKnee2));
calfSC2.setRestLength(unitLen);
gameEngine.addConstraint(calfSC2);
var ropeABodySC = (new engine.constraint.SpringConstraint(this["pRopeA" + (ropeNum - 1)], pHand1));
ropeABodySC.setRestLength(1);
gameEngine.addConstraint(ropeABodySC);
var ropeBBodySC = (new engine.constraint.SpringConstraint(this["pRopeB" + (ropeNum - 1)], pHand2));
ropeBBodySC.setRestLength(1);
gameEngine.addConstraint(ropeBBodySC);
var legBody1AC = (new engine.constraint.AngConstraint(pSpine, pNeck, pKnee1, 90, 270));
gameEngine.addConstraint(legBody1AC);
var legBody2AC = (new engine.constraint.AngConstraint(pSpine, pNeck, pKnee2, 90, 270));
gameEngine.addConstraint(legBody2AC);
var arm1AC = (new engine.constraint.AngConstraint(pElbow1, pNeck, pHand1, 90, 180));
gameEngine.addConstraint(arm1AC);
var arm2AC = (new engine.constraint.AngConstraint(pElbow2, pNeck, pHand2, 90, 180));
gameEngine.addConstraint(arm2AC);
var leg1AC = (new engine.constraint.AngConstraint(pKnee1, pSpine, pFoot1, 60, 180));
gameEngine.addConstraint(leg1AC);
var leg2AC = (new engine.constraint.AngConstraint(pKnee2, pSpine, pFoot2, 60, 180));
gameEngine.addConstraint(leg2AC);
mcGuide._visible = false;
var aBodyMC = new Array(mcHead, mcBody, mcArm1, mcForearm1, mcArm2, mcForearm2, mcLeg1, mcCalf1, mcLeg2, mcCalf2);
var maxActionInter = 20;
var actionInter = maxActionInter;
var headF = (new global.Vector(0, 0));
var foot1F = (new global.Vector(0, 0));
var foot2F = (new global.Vector(0, 0));
var hand1F = (new global.Vector(0, 0));
var hand2F = (new global.Vector(0, 0));
var aFootAction = new Array([0.5, 0], [-0.5, 0]);
var foot1ActionID = 0;
var foot2ActionID = 1;
var maxFootAction = aFootAction.length;
var aHandAction = new Array([1, 0], [-1, 0]);
var hand1ActionID = 0;
var hand2ActionID = 1;
var maxHandAction = aHandAction.length;
setPose();
var NeckMaxTime = 70;
var NeckTime = NeckMaxTime;
var headXF = 1;
stop();
this.gotoAndStop("mode");
Symbol 268 MovieClip Frame 13
function initMode() {
switch (_root.sHard) {
case "MEDIUM" :
mcMedium.gotoAndStop("on");
currMc = mcMedium;
break;
case "HARD" :
mcHard.gotoAndStop("on");
currMc = mcHard;
break;
case "INSANE" :
mcInsane.gotoAndStop("on");
currMc = mcInsane;
}
}
stop();
mcMedium.onPress = function () {
currMc.gotoAndStop("off");
currMc = this;
currMc.gotoAndStop("on");
_root.sHard = "MEDIUM";
_root.initNormalMode();
};
mcHard.onPress = function () {
currMc.gotoAndStop("off");
currMc = this;
currMc.gotoAndStop("on");
_root.sHard = "HARD";
_root.initNormalMode();
};
mcInsane.onPress = function () {
currMc.gotoAndStop("off");
currMc = this;
currMc.gotoAndStop("on");
_root.sHard = "INSANE";
_root.initNormalMode();
};
initMode();
Symbol 268 MovieClip Frame 24
stop();
Symbol 268 MovieClip Frame 45
stop();
kill(this);
Symbol 269 MovieClip [mcLayout] Frame 1
function initLayoutBt(mc) {
with (mc) {
btMenu.onPress = function () {
if (_root.mcPause instanceof MovieClip) {
return(undefined);
}
if (_root.bPause) {
return(undefined);
}
if (!_root.bStart) {
return(undefined);
}
_root.bPause = true;
atMc(_root, "mcMenu");
};
}
}
initLayoutBt(this);
Symbol 272 Button
on (release) {
_root.bPause = false;
this.removeMovieClip();
}
Symbol 281 Button
on (release) {
_root.tryAgain();
}
Symbol 282 MovieClip Frame 16
stop();
Symbol 283 MovieClip [mcOver] Frame 30
stop();
Instance of Symbol 152 MovieClip in Symbol 283 MovieClip [mcOver] Frame 30
//component parameters
onClipEvent (construct) {
_game_name = "the_return";
score_var = "_root.score";
}
Symbol 361 MovieClip [sea_load] Frame 1
#initclip 12
Object.registerClass("sea_load", as.Sea);
#endinitclip
Symbol 362 MovieClip [mcLevel] Frame 1
function onMouseDown() {
if (_root.bPause) {
return(undefined);
}
if (_root.bOver) {
return(undefined);
}
if (_root.bEnd) {
return(undefined);
}
var _local2 = bg.hitTest(_root._xmouse, _root._ymouse, true);
if (!_local2) {
addNote("hookNoteAnim", _xmouse, _ymouse);
return(undefined);
}
_root.sdRope.start();
setPose = null;
bFire = true;
bHolding = false;
selRope = ((selRope == pRopeA0) ? (pRopeB0) : (pRopeA0));
selHand = ((selRope == pRopeA0) ? (pHand1) : (pHand2));
aimx = _xmouse;
aimy = _ymouse;
fireTime = maxFireTime;
}
function onMouseUp() {
bFire = false;
}
function addNote(_noteName, x, y) {
var _local3 = atMc2(this, _noteName);
_local3._x = x;
_local3._y = y;
if (_local3._x < (300 - this._x)) {
_local3._x = _local3._x + 80;
} else {
_local3._x = _local3._x - 80;
}
if (_noteName != "conectionNoteAnim") {
conectionNum = 0;
} else {
_root.sdHook.start();
conectionNum = conectionNum + 1;
if (conectionNum > 1) {
_local3.mcText.gotoAndStop(2);
}
_local3.mcText.tCon.text = conectionNum;
var _local4 = conectionNum * _root.conectionScore;
if (_local4 > 200) {
_local4 = 200;
}
if (_root.sHard == "HARD") {
_local4 = Math.floor(_local4 * 1.5);
} else if (_root.sHard == "INSANE") {
_local4 = Math.floor(_local4 * 2);
}
_local3.mcText.tScore.text = _local4;
_root.addScore(_local4);
}
}
function shooting() {
if (!bFire) {
return(undefined);
}
fireTime = fireTime - 1;
if (fireTime == 0) {
bFire = false;
bHolding = false;
addNote("hookNoteAnim", aimx, aimy);
return(undefined);
}
var _local4 = ((selRope == pRopeA0) ? (pHand1) : (pHand2));
var _local12 = _local4.coord.x;
var _local11 = _local4.coord.y;
var _local3 = selRope.coord.x;
var _local2 = selRope.coord.y;
var _local5 = new global.Vector(aimx - _local3, aimy - _local2);
_local5.div(2);
selRope.addForce(_local5);
var _local10 = _local3 + this._x;
var _local9 = _local2 + this._y;
var _local8 = bg.hitTest(_local10, _local9, true);
if (_local8) {
var _local6 = getDis(aimx, aimy, _local3, _local2);
if (_local6 < 100) {
var _local7 = pinCoord[1] - _local2;
if (_local7 < 80) {
addNote("heightNoteAnim", aimx, aimy);
} else {
addNote("conectionNoteAnim", aimx, aimy);
}
holdTime = maxHoldTime;
pinCoord = new Array(_local3, _local2);
bHolding = true;
bFire = false;
return(undefined);
}
}
}
function holding() {
if (!bHolding) {
return(undefined);
}
selRope.setPosition(pinCoord[0], pinCoord[1]);
var _local3 = selHand.coord.x;
var _local2 = selHand.coord.y;
var _local1 = new global.Vector(pinCoord[0] - _local3, pinCoord[1] - _local2);
_local1.div(10);
selHand.addForce(_local1);
holdTime = holdTime - 1;
if (holdTime == 0) {
bHolding = false;
}
}
function action() {
if (actionInter == 0) {
foot1ActionID = foot1ActionID + 1;
foot2ActionID = foot2ActionID + 1;
if (foot1ActionID == maxFootAction) {
foot1ActionID = 0;
}
if (foot2ActionID == maxFootAction) {
foot2ActionID = 0;
}
var _local2 = aFootAction[foot1ActionID][0];
var _local1 = aFootAction[foot1ActionID][1];
foot1F.reset(_local2, _local1);
_local2 = aFootAction[foot2ActionID][0];
_local1 = aFootAction[foot2ActionID][1];
foot2F.reset(_local2, _local1);
hand1ActionID = hand1ActionID + 1;
hand2ActionID = hand2ActionID + 1;
if (hand1ActionID == maxHandAction) {
hand1ActionID = 0;
}
if (hand2ActionID == maxHandAction) {
hand2ActionID = 0;
}
if (selRope != pRopeA0) {
_local2 = aHandAction[hand1ActionID][0];
_local1 = aHandAction[hand1ActionID][1];
hand1F.reset(_local2, _local1);
}
if (selRope != pRopeB0) {
_local2 = aHandAction[hand2ActionID][0];
_local1 = aHandAction[hand2ActionID][1];
hand2F.reset(_local2, _local1);
}
actionInter = maxActionInter;
}
if (selRope == pRopeA0) {
hand1F.reset(0, 0);
} else {
hand2F.reset(0, 0);
}
pFoot1.addForce(foot1F);
pFoot2.addForce(foot2F);
pHand1.addForce(hand1F);
pHand2.addForce(hand2F);
if (bHitBg) {
if (!bHeadHitBg) {
headF.reset(0, -3);
} else {
headF.reset(0, 0);
}
} else {
headF.reset(0, 0);
}
pNeck.addForce(headF);
actionInter = actionInter - 1;
}
function checkBodyHit(_aObjects) {
bHitBg = false;
bHeadHitBg = false;
for (var _local12 in _aObjects) {
var _local3 = _aObjects[_local12];
var _local9 = bg;
var _local4 = _local3.coord.x + this._x;
var _local8 = _local3.coord.y + this._y;
var _local6 = _local9.hitTest(_local4, _local8, true);
if (_local6) {
if (_local3 == pNeck) {
bHeadHitBg = true;
}
bHitBg = true;
_local3.coord = _local3.prevCoord.clone();
for (var _local11 in aWall) {
var _local2 = aWall[_local11];
_local6 = _local2.hitTest(_local4, _local8, true);
if (_local6) {
var _local5 = ((this._x + bg._x) + _local2._parent._x) + _local2._x;
if (_local4 > _local5) {
var _local7 = new global.Vector(5, 0);
} else {
var _local7 = new global.Vector(-5, 0);
}
_local3.addForce(_local7);
}
}
}
}
}
function linkHook() {
var _local2 = pRopeA0.coord.x;
var _local1 = pRopeA0.coord.y;
var _local6 = pRopeA1.coord.x;
var _local5 = pRopeA1.coord.y;
var _local4 = pRopeB0.coord.x;
var _local3 = pRopeB0.coord.y;
var _local8 = pRopeB1.coord.x;
var _local7 = pRopeB1.coord.y;
hook1._x = _local2;
hook1._y = _local1;
hook2._x = _local4;
hook2._y = _local3;
var _local10 = getAng(_local2, _local1, _local6, _local5);
var _local9 = getAng(_local4, _local3, _local8, _local7);
hook1._rotation = _local10 - 90;
hook2._rotation = _local9 - 90;
}
function drawRope() {
var _local3 = mcRope;
_local3.clear();
_local3.lineStyle(1, 0, 100);
var _local5 = this["pRopeA" + (ropeNum - 1)].coord;
var _local4 = this.pElbow1.coord;
_local3.moveTo(_local5.x, _local5.y);
_local3.lineTo(_local4.x, _local4.y);
_local5 = this["pRopeB" + (ropeNum - 1)].coord;
_local4 = this.pElbow2.coord;
_local3.moveTo(_local5.x, _local5.y);
_local3.lineTo(_local4.x, _local4.y);
var _local2 = 0;
while (_local2 < (ropeNum - 1)) {
_local5 = this["pRopeA" + _local2].coord;
_local4 = this["pRopeA" + (_local2 + 1)].coord;
_local3.moveTo(_local5.x, _local5.y);
_local3.lineTo(_local4.x, _local4.y);
_local5 = this["pRopeB" + _local2].coord;
_local4 = this["pRopeB" + (_local2 + 1)].coord;
_local3.moveTo(_local5.x, _local5.y);
_local3.lineTo(_local4.x, _local4.y);
_local2++;
}
}
function initMap() {
aMap = new Array();
aUseMapName = new Array();
aUseMap = new Array();
aMapCoord = new Array();
aMapCoord.push({x:0, y:levelH});
aMap.push(["bg0"]);
aMap.push(["bg1"]);
aMap.push(["bg1", "bg2"]);
aMap.push(["bg2", "bg5", "bg7"]);
aMap.push(["bg2", "bg3", "bg7", "bg5"]);
aMap.push(["bg4", "bg8"]);
aMap.push(["bg1", "bg2", "bg3"]);
aMap.push(["bg2", "bg3", "bg4", "bg5"]);
aMap.push(["bg4", "bg5", "bg6"]);
aMap.push(["bg6", "bg7"]);
aMap.push(["bg3", "bg4", "bg8"]);
aMap.push(["bg4", "bg5", "bg6", "bg7"]);
aMap.push(["bg7", "bg3", "bg9"]);
aMap.push(["bg6", "bg9"]);
aMap.push(["bg6", "bg7", "bg9"]);
aMap.push(["bg4", "bg8", "bg11"]);
aMap.push(["bg2", "bg3", "bg4", "bg11"]);
aMap.push(["bg5", "bg6", "bg7", "bg8", "bg9", "bg10"]);
aMap.push(["bg8", "bg9", "bg10"]);
aMap.push(["bg6", "bg7", "bg9", "bg10"]);
aMap.push(["bg5", "bg6", "bg8", "bg9", "bg10", "bg11"]);
aMap.push(["bg6", "bg7", "bg9", "bg10"]);
aMap.push(["bg11"]);
aMap.push(["bg7", "bg10"]);
aMap.push(["bg8"]);
aMap.push(["bg6"]);
var _local6 = aMap.length;
var _local2 = 0;
while (_local2 < _local6) {
var _local3 = aMap[_local2];
id = Math.floor(Math.random() * _local3.length);
var _local5 = _local3[id];
aUseMapName.push(_local5);
_local2++;
}
_local6 = aUseMapName.length;
_local2 = 0;
while (_local2 < _local6) {
var _local1 = atMc2(bg, aUseMapName[_local2], "map");
var _local4 = aMapCoord.length - 1;
_local1._x = aMapCoord[_local4].x;
_local1._y = aMapCoord[_local4].y;
aUseMap.push(_local1);
getMapCoord(_local1);
_local2++;
}
}
function getMapCoord(_map) {
var _local1 = _map.mcCoord;
var _local4 = new Array();
for (var _local5 in _local1) {
if (_local1[_local5] instanceof MovieClip) {
var _local3 = (_local1[_local5]._x - 300) + _local1._parent._x;
}
var _local2 = _local1[_local5]._y + _local1._parent._y;
_local4.push({x:_local3, y:_local2});
}
_local4.sortOn("y", Array.NUMERIC | Array.DESCENDING);
aMapCoord = aMapCoord.concat(_local4);
kill(_local1);
}
function screenRoll() {
var _local12 = pNeck.coord.y;
this._y = 400 - pNeck.coord.y;
var _local8 = new Object();
var _local7 = new Object();
var _local13 = aMapCoord.length;
var _local3 = 0;
while (_local3 < _local13) {
if (_local12 > aMapCoord[_local3].y) {
_local7 = aMapCoord[_local3];
_local8 = aMapCoord[_local3 - 1];
var _local4 = new global.Vector(_local8.x, _local8.y);
var _local6 = new global.Vector(_local7.x, _local7.y);
var _local5 = _local6.minusNew(_local4);
var _local10 = _local4.y - _local6.y;
var _local9 = _local4.y - _local12;
_local5.normalize((_local5.__get__length() * _local9) / _local10);
_local4.plus(_local5);
var _local11 = _local4.x;
this._x = -_local11;
break;
}
_local3++;
}
tempLevel = Math.floor(this._y / levelH);
cuurLevel = tempLevel;
_root.nLevel = cuurLevel + 1;
var _local15 = cuurLevel + 1;
var _local14 = cuurLevel - 1;
}
function getAllWall() {
aWall = new Array();
for (var _local3 in aUseMap) {
var _local1 = aUseMap[_local3];
for (var _local2 in _local1) {
if (_local1[_local2] instanceof MovieClip) {
aWall.push(_local1[_local2]);
}
}
}
}
function changeColor() {
cuurHeight = this._y / levelH;
if (cuurHeight <= 8) {
wallColor.rb = 0;
wallColor.gb = -90 - (cuurHeight * 7.8);
wallColor.bb = -250;
} else if ((cuurHeight > 8) && (cuurHeight <= 16)) {
wallColor.rb = -((cuurHeight - 8) * 7.8);
wallColor.gb = -150 + ((cuurHeight - 8) * 5);
wallColor.bb = -250;
} else {
wallColor.rb = -60 - ((cuurHeight - 16) * 27);
wallColor.gb = -110 + ((cuurHeight - 16) * 6);
wallColor.bb = -250;
}
for (var _local4 in aWall) {
var _local2 = aWall[_local4];
var _local3 = new Color(_local2);
_local3.setTransform(wallColor);
}
}
function liteMapCtr() {
var _local2 = _root.mcLayout.liteMap.role;
var _local3 = _root.mcLayout.liteMap.water;
_local2._y = liteMapH * (pNeck.coord.y / cliffH);
_local3._y = liteMapH * (sea._y / cliffH);
}
function getRoleH() {
clearInterval(heightInter);
heightInter = setInterval(this, "getRoleH", 1000);
h = Math.floor((maxHeight * (-pNeck.coord.y)) / (25 * levelH));
if (h < 0) {
h = 0;
}
if (h > maxRoleHeight) {
var _local3 = h - maxRoleHeight;
maxRoleHeight = h;
_root.addScore(_local3 * _root.heightScore);
}
roleHeight = h + " M";
_root.mcLayout.liteMap.role.tHeight.text = roleHeight;
}
function setPose() {
var _local2 = 300;
var _local1 = 415;
pNeck.setPosition(neckCoord[0] + _local2, neckCoord[1] + _local1);
pSpine.setPosition(spineCoord[0] + _local2, spineCoord[1] + _local1);
pKnee1.setPosition(knee1Coord[0] + _local2, knee1Coord[1] + _local1);
pFoot1.setPosition(foot1Coord[0] + _local2, foot1Coord[1] + _local1);
pKnee2.setPosition(knee2Coord[0] + _local2, knee2Coord[1] + _local1);
pFoot2.setPosition(foot2Coord[0] + _local2, foot2Coord[1] + _local1);
pElbow1.setPosition(elbow1Coord[0] + _local2, elbow1Coord[1] + _local1);
pHand1.setPosition(hand1Coord[0] + _local2, hand1Coord[1] + _local1);
pElbow2.setPosition(elbow2Coord[0] + _local2, elbow2Coord[1] + _local1);
pHand2.setPosition(hand2Coord[0] + _local2, hand2Coord[1] + _local1);
}
function solve() {
setPose();
action();
gameEngine.enterFrame();
shooting();
holding();
linkHook();
drawRope();
screenRoll();
changeColor();
liteMapCtr();
if (pNeck.coord.y > 490) {
_root.bOver = true;
}
}
function onEnterFrame() {
if (_root.bPause) {
return(undefined);
}
solve();
}
trace("::::\u5173\u5361\u52A0\u8F7D\u6210\u529F::::");
var gameEngine = (new engine.PhysicsEngine());
var G = (new global.Vector(0, 0.7));
var friction = 0.97;
var seaG = (new global.Vector(0, 0.15));
var seaFriction = 0.95;
LEVEL.gameEngine.setG(G);
LEVEL.gameEngine.setFriction(friction);
var unitLen = 24;
var bodyLen = 30;
var headLen = 15;
var ropeUnitLen = 1;
var ropeLen = 500;
var ropeNum = 9;
var aRopeA = new Array();
var aRopeB = new Array();
var aRopeASC = new Array();
var aRopeBSC = new Array();
var neckCoord = new Array(mcBodyCoord.mcNeck._x, mcBodyCoord.mcNeck._y);
var elbow1Coord = new Array(mcBodyCoord.mcElbow1._x, mcBodyCoord.mcElbow1._y);
var elbow2Coord = new Array(mcBodyCoord.mcElbow2._x, mcBodyCoord.mcElbow2._y);
var hand1Coord = new Array(mcBodyCoord.mcHand1._x, mcBodyCoord.mcHand1._y);
var hand2Coord = new Array(mcBodyCoord.mcHand2._x, mcBodyCoord.mcHand2._y);
var spineCoord = new Array(mcBodyCoord.mcSpine._x, mcBodyCoord.mcSpine._y);
var knee1Coord = new Array(mcBodyCoord.mcKnee1._x, mcBodyCoord.mcKnee1._y);
var knee2Coord = new Array(mcBodyCoord.mcKnee2._x, mcBodyCoord.mcKnee2._y);
var foot1Coord = new Array(mcBodyCoord.mcFoot1._x, mcBodyCoord.mcFoot1._y);
var foot2Coord = new Array(mcBodyCoord.mcFoot2._x, mcBodyCoord.mcFoot2._y);
var hook1Coord = new Array(mcBodyCoord.mcHook1._x, mcBodyCoord.mcHook1._y);
var hook2Coord = new Array(mcBodyCoord.mcHook2._x, mcBodyCoord.mcHook2._y);
var bodyOffset = 0;
var xoffset = 300;
var yoffset = 415;
kill(mcBodyCoord);
var pRopeA0 = (new engine.obj.Particle(hook1Coord[0] + xoffset, hook1Coord[1] + yoffset, 1, this));
var pRopeA1 = (new engine.obj.Particle(hook1Coord[0] + xoffset, (hook1Coord[1] + yoffset) - 1, 1, this));
var pRopeA2 = (new engine.obj.Particle(hook1Coord[0] + xoffset, (hook1Coord[1] + yoffset) - 2, 1, this));
var pRopeA3 = (new engine.obj.Particle(hook1Coord[0] + xoffset, (hook1Coord[1] + yoffset) - 3, 1, this));
var pRopeA4 = (new engine.obj.Particle(hook1Coord[0] + xoffset, (hook1Coord[1] + yoffset) - 4, 1, this));
var pRopeA5 = (new engine.obj.Particle(hook1Coord[0] + xoffset, (hook1Coord[1] + yoffset) - 5, 1, this));
var pRopeA6 = (new engine.obj.Particle(hook1Coord[0] + xoffset, (hook1Coord[1] + yoffset) - 6, 1, this));
var pRopeA7 = (new engine.obj.Particle(hook1Coord[0] + xoffset, (hook1Coord[1] + yoffset) - 7, 1, this));
var pRopeA8 = (new engine.obj.Particle(hook1Coord[0] + xoffset, (hook1Coord[1] + yoffset) - 8, 1, this));
aRopeA.push(pRopeA0);
aRopeA.push(pRopeA1);
aRopeA.push(pRopeA2);
aRopeA.push(pRopeA3);
aRopeA.push(pRopeA4);
aRopeA.push(pRopeA5);
aRopeA.push(pRopeA6);
aRopeA.push(pRopeA7);
aRopeA.push(pRopeA8);
var ropeASC0 = (new engine.constraint.SpringConstraint(pRopeA0, pRopeA1));
var ropeASC1 = (new engine.constraint.SpringConstraint(pRopeA1, pRopeA2));
var ropeASC2 = (new engine.constraint.SpringConstraint(pRopeA2, pRopeA3));
var ropeASC3 = (new engine.constraint.SpringConstraint(pRopeA3, pRopeA4));
var ropeASC4 = (new engine.constraint.SpringConstraint(pRopeA4, pRopeA5));
var ropeASC5 = (new engine.constraint.SpringConstraint(pRopeA5, pRopeA6));
var ropeASC6 = (new engine.constraint.SpringConstraint(pRopeA6, pRopeA7));
var ropeASC7 = (new engine.constraint.SpringConstraint(pRopeA7, pRopeA8));
aRopeASC.push(ropeASC0);
aRopeASC.push(ropeASC1);
aRopeASC.push(ropeASC2);
aRopeASC.push(ropeASC3);
aRopeASC.push(ropeASC4);
aRopeASC.push(ropeASC5);
aRopeASC.push(ropeASC6);
aRopeASC.push(ropeASC7);
var pRopeB0 = (new engine.obj.Particle(hook2Coord[0] + xoffset, hook2Coord[1] + yoffset, 1, this));
var pRopeB1 = (new engine.obj.Particle(hook2Coord[0] + xoffset, (hook2Coord[1] + yoffset) - 1, 1, this));
var pRopeB2 = (new engine.obj.Particle(hook2Coord[0] + xoffset, (hook2Coord[1] + yoffset) - 2, 1, this));
var pRopeB3 = (new engine.obj.Particle(hook2Coord[0] + xoffset, (hook2Coord[1] + yoffset) - 3, 1, this));
var pRopeB4 = (new engine.obj.Particle(hook2Coord[0] + xoffset, (hook2Coord[1] + yoffset) - 4, 1, this));
var pRopeB5 = (new engine.obj.Particle(hook2Coord[0] + xoffset, (hook2Coord[1] + yoffset) - 5, 1, this));
var pRopeB6 = (new engine.obj.Particle(hook2Coord[0] + xoffset, (hook2Coord[1] + yoffset) - 6, 1, this));
var pRopeB7 = (new engine.obj.Particle(hook2Coord[0] + xoffset, (hook2Coord[1] + yoffset) - 7, 1, this));
var pRopeB8 = (new engine.obj.Particle(hook2Coord[0] + xoffset, (hook2Coord[1] + yoffset) - 8, 1, this));
aRopeB.push(pRopeB0);
aRopeB.push(pRopeB1);
aRopeB.push(pRopeB2);
aRopeB.push(pRopeB3);
aRopeB.push(pRopeB4);
aRopeB.push(pRopeB5);
aRopeB.push(pRopeB6);
aRopeB.push(pRopeB7);
aRopeB.push(pRopeB8);
var RopeBSC0 = (new engine.constraint.SpringConstraint(pRopeB0, pRopeB1));
var RopeBSC1 = (new engine.constraint.SpringConstraint(pRopeB1, pRopeB2));
var RopeBSC2 = (new engine.constraint.SpringConstraint(pRopeB2, pRopeB3));
var RopeBSC3 = (new engine.constraint.SpringConstraint(pRopeB3, pRopeB4));
var RopeBSC4 = (new engine.constraint.SpringConstraint(pRopeB4, pRopeB5));
var RopeBSC5 = (new engine.constraint.SpringConstraint(pRopeB5, pRopeB6));
var RopeBSC6 = (new engine.constraint.SpringConstraint(pRopeB6, pRopeB7));
var RopeBSC7 = (new engine.constraint.SpringConstraint(pRopeB7, pRopeB8));
aRopeBSC.push(RopeBSC0);
aRopeBSC.push(RopeBSC1);
aRopeBSC.push(RopeBSC2);
aRopeBSC.push(RopeBSC3);
aRopeBSC.push(RopeBSC4);
aRopeBSC.push(RopeBSC5);
aRopeBSC.push(RopeBSC6);
aRopeBSC.push(RopeBSC7);
for (var i in aRopeA) {
gameEngine.addObjects(aRopeA[i]);
}
for (var i in aRopeB) {
gameEngine.addObjects(aRopeB[i]);
}
for (var i in aRopeASC) {
aRopeASC[i].setRestLength(ropeUnitLen);
aRopeASC[i].setStiffness(0.5);
gameEngine.addConstraint(aRopeASC[i]);
}
for (var i in aRopeBSC) {
aRopeBSC[i].setRestLength(ropeUnitLen);
aRopeBSC[i].setStiffness(0.5);
gameEngine.addConstraint(aRopeBSC[i]);
}
var pNeck = (new engine.obj.Particle(300, 160 + bodyOffset, 1, this));
gameEngine.addObjects(pNeck);
gameEngine.addBody(pNeck);
var pSpine = (new engine.obj.Particle(300, 200 + bodyOffset, 10, this));
gameEngine.addObjects(pSpine);
gameEngine.addBody(pSpine);
var pKnee1 = (new engine.obj.Particle(300, 250 + bodyOffset, 1, this));
gameEngine.addObjects(pKnee1);
gameEngine.addBody(pKnee1);
var pFoot1 = (new engine.obj.Particle(350, 250 + bodyOffset, 1, this));
gameEngine.addObjects(pFoot1);
gameEngine.addBody(pFoot1);
var pKnee2 = (new engine.obj.Particle(350, 250 + bodyOffset, 1, this));
gameEngine.addObjects(pKnee2);
gameEngine.addBody(pKnee2);
var pFoot2 = (new engine.obj.Particle(350, 300 + bodyOffset, 1, this));
gameEngine.addObjects(pFoot2);
gameEngine.addBody(pFoot2);
var pElbow1 = (new engine.obj.Particle(250, 200 + bodyOffset, 1, this));
gameEngine.addObjects(pElbow1);
gameEngine.addBody(pElbow1);
var pHand1 = (new engine.obj.Particle(250, 250 + bodyOffset, 1, this));
gameEngine.addObjects(pHand1);
gameEngine.addBody(pHand1);
var pElbow2 = (new engine.obj.Particle(350, 200 + bodyOffset, 1, this));
gameEngine.addObjects(pElbow2);
gameEngine.addBody(pElbow2);
var pHand2 = (new engine.obj.Particle(350, 250 + bodyOffset, 1, this));
gameEngine.addObjects(pHand2);
gameEngine.addBody(pHand2);
var bodyPole = (new engine.obj.Pole(pNeck, pSpine, bodyLen, mcBody));
gameEngine.addPoles(bodyPole);
var forearmPole1 = (new engine.obj.Pole(pElbow1, pHand1, unitLen, mcForearm1));
gameEngine.addPoles(forearmPole1);
var armPole1 = (new engine.obj.Pole(pNeck, pElbow1, unitLen, mcArm1));
gameEngine.addPoles(armPole1);
var forearmPole2 = (new engine.obj.Pole(pElbow2, pHand2, unitLen, mcForearm2));
gameEngine.addPoles(forearmPole2);
var armPole2 = (new engine.obj.Pole(pNeck, pElbow2, unitLen, mcArm2));
gameEngine.addPoles(armPole2);
var calfPole1 = (new engine.obj.Pole(pKnee1, pFoot1, unitLen, mcCalf1));
gameEngine.addPoles(calfPole1);
var legPole1 = (new engine.obj.Pole(pSpine, pKnee1, unitLen, mcLeg1));
gameEngine.addPoles(legPole1);
var calfPole2 = (new engine.obj.Pole(pKnee2, pFoot2, unitLen, mcCalf2));
gameEngine.addPoles(calfPole2);
var legPole2 = (new engine.obj.Pole(pSpine, pKnee2, unitLen, mcLeg2));
gameEngine.addPoles(legPole2);
var bodySC1 = (new engine.constraint.SpringConstraint(pSpine, pNeck));
bodySC1.setRestLength(bodyLen);
gameEngine.addConstraint(bodySC1);
var armSC1 = (new engine.constraint.SpringConstraint(pElbow1, pNeck));
armSC1.setRestLength(unitLen);
gameEngine.addConstraint(armSC1);
var forearmSC1 = (new engine.constraint.SpringConstraint(pHand1, pElbow1));
forearmSC1.setRestLength(unitLen);
gameEngine.addConstraint(forearmSC1);
var armSC2 = (new engine.constraint.SpringConstraint(pElbow2, pNeck));
armSC2.setRestLength(unitLen);
gameEngine.addConstraint(armSC2);
var forearmSC2 = (new engine.constraint.SpringConstraint(pHand2, pElbow2));
forearmSC2.setRestLength(unitLen);
gameEngine.addConstraint(forearmSC2);
var legSC1 = (new engine.constraint.SpringConstraint(pKnee1, pSpine));
legSC1.setRestLength(unitLen);
gameEngine.addConstraint(legSC1);
var calfSC1 = (new engine.constraint.SpringConstraint(pFoot1, pKnee1));
calfSC1.setRestLength(unitLen);
gameEngine.addConstraint(calfSC1);
var legSC2 = (new engine.constraint.SpringConstraint(pKnee2, pSpine));
legSC2.setRestLength(unitLen);
gameEngine.addConstraint(legSC2);
var calfSC2 = (new engine.constraint.SpringConstraint(pFoot2, pKnee2));
calfSC2.setRestLength(unitLen);
gameEngine.addConstraint(calfSC2);
var ropeABodySC = (new engine.constraint.SpringConstraint(this["pRopeA" + (ropeNum - 1)], pHand1));
ropeABodySC.setRestLength(1);
gameEngine.addConstraint(ropeABodySC);
var ropeBBodySC = (new engine.constraint.SpringConstraint(this["pRopeB" + (ropeNum - 1)], pHand2));
ropeBBodySC.setRestLength(1);
gameEngine.addConstraint(ropeBBodySC);
var legBody1AC = (new engine.constraint.AngConstraint(pSpine, pNeck, pKnee1, 90, 270));
gameEngine.addConstraint(legBody1AC);
var legBody2AC = (new engine.constraint.AngConstraint(pSpine, pNeck, pKnee2, 90, 270));
gameEngine.addConstraint(legBody2AC);
var armBody1AC = (new engine.constraint.AngConstraint(pNeck, pElbow1, pSpine, 40, 320));
gameEngine.addConstraint(armBody1AC);
var armBody2AC = (new engine.constraint.AngConstraint(pNeck, pElbow2, pSpine, 40, 320));
gameEngine.addConstraint(armBody2AC);
var arm1AC = (new engine.constraint.AngConstraint(pElbow1, pNeck, pHand1, 90, 180));
gameEngine.addConstraint(arm1AC);
var arm2AC = (new engine.constraint.AngConstraint(pElbow2, pNeck, pHand2, 90, 180));
gameEngine.addConstraint(arm2AC);
var leg1AC = (new engine.constraint.AngConstraint(pKnee1, pSpine, pFoot1, 60, 180));
gameEngine.addConstraint(leg1AC);
var leg2AC = (new engine.constraint.AngConstraint(pKnee2, pSpine, pFoot2, 60, 180));
gameEngine.addConstraint(leg2AC);
mcGuide._visible = false;
var aBodyMC = new Array(mcHead, mcBody, mcArm1, mcForearm1, mcArm2, mcForearm2, mcLeg1, mcCalf1, mcLeg2, mcCalf2);
bHolding = true;
bFire = false;
maxHoldTime = 100;
holdTime = maxHoldTime;
maxFireTime = 15;
fireTime = maxFireTime;
pinCoord = new Array();
conectionNum = 0;
var maxActionInter = 20;
var actionInter = maxActionInter;
var headF = (new global.Vector(0, 0));
var foot1F = (new global.Vector(0, 0));
var foot2F = (new global.Vector(0, 0));
var hand1F = (new global.Vector(0, 0));
var hand2F = (new global.Vector(0, 0));
var aFootAction = new Array([0.5, 0], [-0.5, 0]);
var foot1ActionID = 0;
var foot2ActionID = 1;
var maxFootAction = aFootAction.length;
var aHandAction = new Array([1, 0], [-1, 0]);
var hand1ActionID = 0;
var hand2ActionID = 1;
var maxHandAction = aHandAction.length;
var bHitBg = false;
var bHeadHitBg = false;
var levelH = 1100;
var cuurLevel = 0;
initMap();
for (var i in aMapCoord) {
}
getAllWall();
var wallColor = new Object();
wallColor.ra = 100;
wallColor.ga = 100;
wallColor.ba = 100;
wallColor.rb = 0;
wallColor.gb = -100;
wallColor.bb = -255;
wallColor.aa = 100;
wallColor.ab = 0;
var cliffH = (25 * levelH);
var liteMapH = 100;
maxRoleHeight = 0;
maxHeight = 500;
roleHeight = "0 M";
getRoleH();
solve();
Symbol 369 MovieClip Frame 1
stop();
Symbol 369 MovieClip Frame 2
stop();
Symbol 370 MovieClip [conectionNoteAnim] Frame 54
stop();
kill(this);
Symbol 374 MovieClip [heightNoteAnim] Frame 54
stop();
kill(this);
Symbol 377 MovieClip [hookNoteAnim] Frame 54
stop();
kill(this);
Symbol 381 MovieClip [note3Anim] Frame 20
stop();
kill(this);
Symbol 384 MovieClip [note2Anim] Frame 20
stop();
kill(this);
Symbol 387 MovieClip [note1Anim] Frame 20
stop();
kill(this);
Symbol 390 MovieClip [note0Anim] Frame 20
stop();
kill(this);
Symbol 395 MovieClip Frame 1
stop();
Symbol 416 MovieClip Frame 146
_root.nextFrame();
Symbol 420 Button
on (release) {
gotoAndStop ("frontPage");
}
Symbol 496 MovieClip Frame 85
_root.nextFrame();
Symbol 497 Button
on (release) {
getURL ("http://www.freeworldgroup.com/", "_blank");
}
Symbol 506 Button
on (release) {
_root.frontAnim.gotoAndStop("end");
}
Symbol 587 MovieClip Frame 42
stop();
Symbol 602 MovieClip Frame 23
stop();
Symbol 607 MovieClip Frame 111
stop();
Symbol 608 MovieClip Frame 35
stop();
Symbol 612 Button
on (release) {
_root.playGame();
}
Symbol 613 MovieClip Frame 71
_root.sdBomb.start();
Symbol 613 MovieClip Frame 406
stop();
Symbol 619 Button
on (release) {
gotoAndStop ("credits");
}
Symbol 622 Button
on (release) {
getURL ("http://www.freeworldgroup.com/", _blank);
}
Symbol 639 Button
on (release) {
_root.backToFrontPage();
}
Symbol 640 MovieClip Frame 15
stop();