Frame 2
iBytesTotal = _root.getBytesTotal();
iBytesLoaded = _root.getBytesLoaded();
iBytes = Math.ceil((iBytesLoaded / iBytesTotal) * 100);
_root.txtLoading.text = iBytes + "%";
Frame 3
if (iBytes < 100) {
gotoAndPlay (2);
} else {
gotoAndPlay (4);
}
Frame 5
function startGame() {
ScoreValue = 5;
FlagKilled = false;
SnakeSpeed = 1000;
Level = 1;
mylives.resetLives();
myscore.resetScore();
myhouses.resetScore();
mylevel.setScore(1);
YFW.setGameStatus(true);
mykeyboard.enable(true);
reset();
}
function resetMainChars() {
if (YFW.getGameStatus()) {
var _local3 = _root.mcSnake._myrow;
var _local2 = _root.mcSnake._mycol;
_root.mcSnake._myrow = 6;
_root.mcSnake._mycol = 5;
_root.aChars[_local3][_local2] = 0;
_root.aChars[6][5] = 9;
moveChar("mcSnake");
_local3 = _root.mcBird._myrow;
_local2 = _root.mcBird._mycol;
_root.mcBird._myrow = 0;
_root.mcBird._mycol = 0;
_root.aChars[_local3][_local2] = 0;
_root.aChars[0][0] = 1;
moveChar("mcBird");
FlagKilled = false;
moveSnake();
}
}
function resetFrogs() {
var _local2 = 1;
while (_local2 <= 2) {
var _local4 = _root["mcFrog" + _local2]._myrow;
var _local3 = _root["mcFrog" + _local2]._mycol;
if (_local2 == 1) {
_root["mcFrog" + _local2]._myrow = 3;
_root["mcFrog" + _local2]._mycol = 2;
} else {
_root["mcFrog" + _local2]._myrow = 4;
_root["mcFrog" + _local2]._mycol = 4;
}
_root.aChars[_local4][_local3] = 0;
if (_local2 == 1) {
_root.aChars[3][2] = 5;
} else {
_root.aChars[4][4] = 5;
}
moveChar("mcFrog" + _local2);
_local2++;
}
}
function reset() {
YFW.fillMatrix("aChars", 7, 6, 0);
_root.aChars[0][0] = 1;
_root.aChars[6][5] = 9;
var _local3 = 0;
while (_local3 <= 6) {
var _local2 = 0;
while (_local2 <= 5) {
_root[("mcSquare" + _local3) + _local2]._alpha = 100;
_root[("mcSquare" + _local3) + _local2]._myfactor = 0;
_local2++;
}
_local3++;
}
CapturedSquares = 0;
resetMainChars();
resetFrogs();
}
function checkAvailableSquares(therow, thecol) {
var _local3 = 0;
while (_local3 <= 6) {
var _local2 = 0;
while (_local2 <= 5) {
if ((((((_local3 == (therow - 1)) and (_local2 == thecol)) and (aChars[_local3][_local2] == 0)) or (((_local3 == (therow + 1)) and (_local2 == thecol)) and (aChars[_local3][_local2] == 0))) or (((_local2 == (thecol - 1)) and (_local3 == therow)) and (aChars[_local3][_local2] == 0))) or (((_local2 == (thecol + 1)) and (_local3 == therow)) and (aChars[_local3][_local2] == 0))) {
_root[("mcSquare" + _local3) + _local2].attachMovie("mcDot", "mcDot", 2);
_root[("mcSquare" + _local3) + _local2].mcDot._x = 27;
_root[("mcSquare" + _local3) + _local2].mcDot._y = 12;
}
_local2++;
}
_local3++;
}
}
function birdJump(direction) {
var _local3 = _root.mcBird._myrow;
var _local2 = _root.mcBird._mycol;
switch (direction) {
case "up" :
if (isFree("mcBird", "up")) {
_root.mcBird._myrow--;
}
break;
case "down" :
if (isFree("mcBird", "down")) {
_root.mcBird._myrow++;
}
break;
case "left" :
if (isFree("mcBird", "left")) {
_root.mcBird._mycol--;
}
break;
case "right" :
if (!isFree("mcBird", "right")) {
break;
}
_root.mcBird._mycol++;
}
if ((_local3 != _root.mcBird._myrow) or (_local2 != _root.mcBird._mycol)) {
_root.aChars[_local3][_local2] = 0;
_root.aChars[_root.mcBird._myrow][_root.mcBird._mycol] = 1;
moveChar("mcBird");
if (_root[("mcSquare" + _root.mcBird._myrow) + _root.mcBird._mycol]._alpha != 0) {
_root[("mcSquare" + _root.mcBird._myrow) + _root.mcBird._mycol]._alpha = _root[("mcSquare" + _root.mcBird._myrow) + _root.mcBird._mycol]._alpha - (100 / Level);
_root[("mcSquare" + _root.mcBird._myrow) + _root.mcBird._mycol]._myfactor++;
if (_root[("mcSquare" + _root.mcBird._myrow) + _root.mcBird._mycol]._myfactor == Level) {
_root[("mcSquare" + _root.mcBird._myrow) + _root.mcBird._mycol]._alpha = 0;
CapturedSquares++;
myscore.addScore(ScoreValue);
myhouses.addScore(1);
if (CapturedSquares == 42) {
_root.NextLevel();
}
}
}
}
}
function moveChar(charname) {
_root[charname]._x = ((_root[charname]._mycol * 62) + 150) - (_root[charname]._myrow * 17);
_root[charname]._y = (_root[charname]._myrow * 44) + 17;
}
function isFree(charname, direction) {
switch (direction) {
case "up" :
if ((aChars[parseInt(_root[charname]._myrow) - 1][_root[charname]._mycol] == 0) or ((aChars[parseInt(_root[charname]._myrow) - 1][_root[charname]._mycol] == 1) and (charname == "mcSnake"))) {
return(true);
}
return(false);
case "down" :
if ((aChars[parseInt(_root[charname]._myrow) + 1][_root[charname]._mycol] == 0) or ((aChars[parseInt(_root[charname]._myrow) + 1][_root[charname]._mycol] == 1) and (charname == "mcSnake"))) {
return(true);
}
return(false);
case "left" :
if ((aChars[_root[charname]._myrow][parseInt(_root[charname]._mycol) - 1] == 0) or ((aChars[_root[charname]._myrow][parseInt(_root[charname]._mycol) - 1] == 1) and (charname == "mcSnake"))) {
return(true);
}
return(false);
case "right" :
if ((aChars[_root[charname]._myrow][parseInt(_root[charname]._mycol) + 1] == 0) or ((aChars[_root[charname]._myrow][parseInt(_root[charname]._mycol) + 1] == 1) and (charname == "mcSnake"))) {
return(true);
}
return(false);
}
}
function goFrog(z) {
var _local6 = false;
var _local4 = _root["mcFrog" + z]._myrow;
var _local3 = _root["mcFrog" + z]._mycol;
var _local5 = YFW.randomize(4);
switch (_local5) {
case 1 :
if (isFree("mcFrog" + z, "up")) {
_root["mcFrog" + z]._myrow--;
}
break;
case 2 :
if (isFree("mcFrog" + z, "down")) {
_root["mcFrog" + z]._myrow++;
}
break;
case 3 :
if (isFree("mcFrog" + z, "left")) {
_root["mcFrog" + z]._mycol--;
}
break;
case 4 :
if (!isFree("mcFrog" + z, "right")) {
break;
}
_root["mcFrog" + z]._mycol++;
}
if ((_root["mcFrog" + z]._myrow != _local4) or (_root["mcFrog" + z]._mycol != _local3)) {
_root.aChars[_local4][_local3] = 0;
_root.aChars[_root["mcFrog" + z]._myrow][_root["mcFrog" + z]._mycol] = 5;
moveChar("mcFrog" + z);
}
}
function moveSnake() {
WaitToSnake = setInterval(goSnake, SnakeSpeed);
}
function goSnake() {
clearInterval(WaitToSnake);
if (!FlagKilled) {
var _local2 = false;
var _local4 = _root.mcSnake._myrow;
var _local3 = _root.mcSnake._mycol;
if ((_root.mcSnake._myrow > _root.mcBird._myrow) and (!_local2)) {
if (isFree("mcSnake", "up")) {
_root.mcSnake._myrow--;
_local2 = true;
}
}
if ((_root.mcSnake._myrow < _root.mcBird._myrow) and (!_local2)) {
if (isFree("mcSnake", "down")) {
_root.mcSnake._myrow++;
_local2 = true;
}
}
if ((_root.mcSnake._mycol > _root.mcBird._mycol) and (!_local2)) {
if (isFree("mcSnake", "left")) {
_root.mcSnake._mycol--;
_local2 = true;
}
}
if ((_root.mcSnake._mycol < _root.mcBird._mycol) and (!_local2)) {
if (isFree("mcSnake", "right")) {
_root.mcSnake._mycol++;
_local2 = true;
}
}
if ((_local4 != _root.mcSnake._myrow) or (_local3 != _root.mcSnake._mycol)) {
_root.aChars[_local4][_local3] = 0;
_root.aChars[_root.mcSnake._myrow][_root.mcSnake._mycol] = 9;
moveChar("mcSnake");
}
if ((_root.mcSnake._mycol == _root.mcBird._mycol) and (_root.mcSnake._myrow == _root.mcBird._myrow)) {
KillBird();
} else {
moveSnake();
}
}
}
function KillBird() {
FlagKilled = true;
_root.mcBird.gotoAndPlay("die");
}
function NextLevel() {
clearInterval(WaitToSnake);
WaitToSnake = undefined;
myhouses.resetScore();
Level++;
mylevel.addScore(1);
if (SnakeSpeed > 500) {
SnakeSpeed = SnakeSpeed - 50;
}
ScoreValue = ScoreValue + 5;
reset();
}
function GameOver() {
YFW.setGameStatus(false);
if (myscore.getScore() > Best) {
Best = myscore.getScore();
myscore.setScore(Best);
mybest.setScore(Best);
}
mykeyboard.enable(false);
_root.mcGameOver._visible = true;
_root.mcGameOver.gotoAndPlay("in");
}
stop();
YFW.initializeEnvironment();
YFW.createMatrix("aChars", 7, 6);
var myscore = new Score();
var mybest = new Score();
var myhouses = new Score();
var mylevel = new Score();
myscore.attachScore("mcScore", "txtScore", 0, 0, false);
mybest.attachScore("mcBest", "txtBest", 0, 0, false);
myhouses.attachScore("mcHouses", "txtHouses", 0, 0, false);
mylevel.attachScore("mcLevel", "txtLevel", 1, 0, false);
var mylives = new Lives();
mylives.attachLives("mcLives", "mcLife", 4);
mcLives.onZero = "GameOver";
var mykeyboard = new Keyboard();
Key.addListener(mykeyboard);
mykeyboard.associate("38", "", "birdJump", "up");
mykeyboard.associate("40", "", "birdJump", "down");
mykeyboard.associate("37", "", "birdJump", "left");
mykeyboard.associate("39", "", "birdJump", "right");
frogspeed1 = YFW.randomize(1000) + YFW.randomize(1000);
frogspeed2 = YFW.randomize(1000) + YFW.randomize(1000);
WaitToFrog = setInterval(goFrog, frogspeed1, 1);
WaitToFrog = setInterval(goFrog, frogspeed2, 2);
Best = 0;
Symbol 10 Button
on (release) {
getURL ("http://www.lostjungle.com");
}
Symbol 11 Button
on (release) {
getURL ("http://www.lostjungle.com/add.php?game=qturkey");
}
Symbol 36 MovieClip [YKM2000_Games] Frame 1
#initclip 11
Object.registerClass("YKM2000_Games", packager);
#endinitclip
Symbol 43 MovieClip [__Packages.Score] Frame 0
class Score
{
var movname, scoreTXT;
function Score () {
}
function attachScore(mcname, scoretext, initialvalue, goal, admitnegative, xcoord, ycoord) {
mcname = YFW.newMC(mcname, pntScore);
movname = mcname;
scoreTXT = scoretext;
_root[movname].onGoal = "";
_root[movname]._goal = goal;
_root[movname]._score = initialvalue;
_root[movname]._admitNegative = admitnegative;
_root[movname]._x = xcoord;
_root[movname]._y = ycoord;
updateScorePanel();
}
function getTotalScore() {
return(_root[movname]._score);
}
function getScoreName() {
return(movname);
}
function getScore() {
return(_root[movname]._score);
}
function getGoal() {
return(_root[movname]._goal);
}
function setGoal(goal) {
_root[movname]._goal = goal;
}
function setScore(amount) {
_root[movname]._score = amount;
if (!_root[movname]._admitNegative) {
if (_root[movname]._score < 0) {
_root[movname]._score = 0;
}
}
updateScorePanel();
}
function addScore(amount) {
_root[movname]._score = _root[movname]._score + amount;
if (!_root[movname]._admitNegative) {
if (_root[movname]._score < 0) {
_root[movname]._score = 0;
}
}
updateScorePanel();
}
function updateScorePanel() {
_root[movname][scoreTXT].text = _root[movname]._score;
if (_root[movname]._score == _root[movname]._goal) {
YFW.execEvent(_root[movname].onGoal);
}
}
function resetScore() {
_root[movname]._score = 0;
updateScorePanel();
}
var pntScore = 5000;
}
Symbol 39 MovieClip [__Packages.Keyboard] Frame 0
class Keyboard
{
var aKeyMatch, Keypressed, aKeyMatchDefault;
function Keyboard () {
aKeyMatch = new Array();
}
function enable(status) {
if (status) {
_enabled = true;
} else {
_enabled = false;
}
}
function getStatus() {
return(_enabled);
}
function onKeyDown() {
switch (Key.getAscii()) {
case 9 :
Keypressed = "TAB";
break;
case 32 :
Keypressed = "SPACE";
break;
case 8 :
Keypressed = "BS";
break;
case 46 :
Keypressed = "DEL";
break;
case 40 :
Keypressed = "DOWN";
break;
case 38 :
Keypressed = "UP ARROW";
break;
case 37 :
Keypressed = "LEFT";
break;
case 39 :
Keypressed = "RIGHT";
break;
case 35 :
Keypressed = "END";
break;
case 13 :
Keypressed = "ENTER";
break;
case 27 :
Keypressed = "ESC";
break;
case 36 :
Keypressed = "HOME";
break;
case 45 :
Keypressed = "INS";
break;
case 33 :
Keypressed = "PGU";
break;
case 34 :
Keypressed = "PGD";
break;
default :
var _local3 = Key.getCode();
Keypressed = String(Key.getCode());
if ((_local3 >= 112) and (_local3 <= 123)) {
Keypressed = "F" + (_local3 - 111);
} else {
Keypressed = _local3;
}
}
if (_debug) {
trace(Keypressed);
}
switch (keymode) {
case "play" :
if (_enabled) {
executeFunction(Keypressed);
}
break;
case "config" :
if (Keypressed == "TAB") {
if (ConfigPointer < (aKeyMatch.length - 1)) {
ConfigPointer++;
} else {
ConfigPointer = 0;
}
_root.mcConfigScreen.mcConfigMark._x = _root.mcConfigScreen["txtKey" + ConfigPointer]._x;
_root.mcConfigScreen.mcConfigMark._y = _root.mcConfigScreen["txtKey" + ConfigPointer]._y;
} else {
configKey(aKeyMatch[ConfigPointer].identifier, Keypressed);
}
break;
case "main" :
}
}
function configKey(identifier, key) {
var _local3 = 0;
while (_local3 <= 8) {
if (aKeyMatch[_local3] == key) {
_root.mcConfigScreen["txtKey" + _local3].text = "?";
aKeyMatch[_local3] = undefined;
}
_local3++;
}
var _local4 = false;
switch (key) {
case "BS" :
_root.mcConfigScreen["txtKey" + ConfigPointer].text = "BACKSPACE";
_local4 = true;
break;
case "DEL" :
case "46" :
_root.mcConfigScreen["txtKey" + ConfigPointer].text = "DELETE";
_local4 = true;
break;
case "DOWN" :
case "40" :
_root.mcConfigScreen["txtKey" + ConfigPointer].text = "DOWN ARROW";
_local4 = true;
break;
case "END" :
case "35" :
_root.mcConfigScreen["txtKey" + ConfigPointer].text = "END";
_local4 = true;
break;
case "HOME" :
case "36" :
_root.mcConfigScreen["txtKey" + ConfigPointer].text = "HOME";
_local4 = true;
break;
case "SPACE" :
_root.mcConfigScreen["txtKey" + ConfigPointer].text = "SPACE";
_local4 = true;
break;
case "INS" :
case "45" :
_root.mcConfigScreen["txtKey" + ConfigPointer].text = "INSERT";
_local4 = true;
break;
case "LEFT" :
case "37" :
_root.mcConfigScreen["txtKey" + ConfigPointer].text = "LEFT";
_local4 = true;
break;
case "RIGHT" :
case "39" :
_root.mcConfigScreen["txtKey" + ConfigPointer].text = "RIGHT";
_local4 = true;
break;
case "UP" :
case "38" :
_root.mcConfigScreen["txtKey" + ConfigPointer].text = "UP";
_local4 = true;
break;
case "PGU" :
case "33" :
_root.mcConfigScreen["txtKey" + ConfigPointer].text = "PAGE UP";
_local4 = true;
break;
case "PGD" :
case "34" :
_root.mcConfigScreen["txtKey" + ConfigPointer].text = "PAGE DOWN";
_local4 = true;
break;
case "187" :
_root.mcConfigScreen["txtKey" + ConfigPointer].text = "+";
_local4 = true;
break;
case "188" :
_root.mcConfigScreen["txtKey" + ConfigPointer].text = "<";
_local4 = true;
break;
case "191" :
_root.mcConfigScreen["txtKey" + ConfigPointer].text = ":";
_local4 = true;
break;
case "193" :
_root.mcConfigScreen["txtKey" + ConfigPointer].text = "?";
_local4 = true;
break;
case "226" :
_root.mcConfigScreen["txtKey" + ConfigPointer].text = "\\";
_local4 = true;
break;
default :
if (Keypressed == "ENTER") {
break;
}
if ((key.substring(0, 1) == "F") and (key.length > 1)) {
_root.mcConfigScreen["txtKey" + ConfigPointer].text = key;
_local4 = true;
} else {
if (!(((key >= 65) and (key <= 90)) || ((key >= 48) and (key <= 57)))) {
break;
}
_root.mcConfigScreen["txtKey" + ConfigPointer].text = chr(Number(key));
_local4 = true;
}
}
if (!_local4) {
aKeyMatch[ConfigPointer].key = undefined;
_root.mcConfigScreen["txtKey" + ConfigPointer].text = "! ILLEGAL KEY !";
}
aKeyMatch[ConfigPointer].key = key;
}
function loadDefaults() {
var _local2 = 0;
while (_local2 <= (aKeyMatch.length - 1)) {
aKeyMatch[_local2].key = aKeyMatchDefault[_local2].key;
aKeyMatch[_local2].identifier = aKeyMatchDefault[_local2].identifier;
aKeyMatch[_local2].functiontoexecute = aKeyMatchDefault[_local2].functiontoexecute;
aKeyMatch[_local2].parameters = aKeyMatchDefault[_local2].parameters;
_local2++;
}
}
function setMode(keymode) {
this.keymode = keymode;
if (keymode == "config") {
if (aKeyMatchDefault == undefined) {
aKeyMatchDefault = new Array();
var _local3 = 0;
while (_local3 <= (aKeyMatch.length - 1)) {
aKeyMatchDefault[_local3] = {key:"", identifier:"", functiontoexecute:"", parameters:""};
aKeyMatchDefault[_local3].key = aKeyMatch[_local3].key;
aKeyMatchDefault[_local3].identifier = aKeyMatch[_local3].identifier;
aKeyMatchDefault[_local3].functiontoexecute = aKeyMatch[_local3].functiontoexecute;
aKeyMatchDefault[_local3].parameters = aKeyMatch[_local3].parameters;
_local3++;
}
}
_root.mcConfigScreen.mcConfigMark._x = _root.mcConfigScreen.txtKey0._x;
_root.mcConfigScreen.mcConfigMark._y = _root.mcConfigScreen.txtKey0._y;
ConfigPointer = 0;
}
}
function getMode() {
return(keymode);
}
function getMatchList() {
return(aKeyMatch);
}
function executeFunction(key) {
var _local4 = 0;
while (_local4 <= (aKeyMatch.length - 1)) {
if (aKeyMatch[_local4].key == key) {
var _local3 = new Array();
var _local5 = "";
_local3 = YFW.miniArray((aKeyMatch[_local4].functiontoexecute + ",") + aKeyMatch[_local4].parameters);
if (_local3.length > 1) {
_root[_local3[0]](_local3[1], _local3[2], _local3[3], _local3[4], _local3[5], _local3[6], _local3[7], _local3[8], _local3[9], _local3[10]);
} else {
_root[_local3[0]]();
}
}
_local4++;
}
}
function associate(key, identifier, functiontoexecute, parameters) {
var _local3 = false;
var _local2 = 0;
while (_local2 <= (aKeyMatch.length - 1)) {
if (aKeyMatch[_local2].key == key) {
aKeyMatch[_local2] = {key:key, functiontoexecute:functiontoexecute, parameters:parameters};
_local3 = true;
}
_local2++;
}
if (!_local3) {
aKeyMatch[aKeyMatch.length] = {key:key, identifier:identifier, functiontoexecute:functiontoexecute, parameters:parameters};
}
}
function getKeypressed() {
return(Keypressed);
}
var ConfigPointer = 0;
var keymode = "play";
var _enabled = true;
var _debug = false;
}
Symbol 42 MovieClip [__Packages.Lives] Frame 0
class Lives
{
var movname, _totalLives, defaultTotalLives, eachLifeMC;
function Lives () {
}
function attachLives(mcname, eachlifemc, totallives, xcoord, ycoord) {
mcname = YFW.newMC(mcname, pntLives);
movname = mcname;
var _local3 = 0;
while (_local3 <= totallives) {
_root.livesmc[eachlifemc + _local3]._visible = true;
_local3++;
}
_totalLives = totallives;
defaultTotalLives = totallives;
eachLifeMC = eachlifemc;
_root[movname]._x = xcoord;
_root[movname]._y = ycoord;
_root[movname].onZero = "";
}
function decLives(ammount) {
if (_totalLives > 0) {
_root[movname][eachLifeMC + _totalLives]._visible = false;
if (ammount == undefined) {
ammount = 1;
}
_totalLives = _totalLives - ammount;
if (_totalLives < 0) {
_totalLives = 0;
}
if (_totalLives <= 0) {
YFW.execEvent(_root[movname].onZero);
}
}
}
function getLives() {
return(_totalLives);
}
function getLivesName() {
return(movname);
}
function setLives(quantity) {
_totalLives = quantity;
var _local3 = 1;
while (_local3 <= quantity) {
_root[movname][eachLifeMC + _local3]._visible = true;
_local3++;
}
}
function resetLives() {
_totalLives = defaultTotalLives;
var _local3 = 1;
while (_local3 <= defaultTotalLives) {
_root[movname][eachLifeMC + _local3]._visible = true;
_local3++;
}
}
var pntLives = 2000;
}
Symbol 37 MovieClip [__Packages.YFW] Frame 0
class YFW
{
function YFW () {
}
static function getVersion() {
trace("YKM2000_Games v. 2006.1");
trace("---------------------------------------------");
trace("Copyright (c) 2006 by YKM2000");
trace("Todos os direitos reservados.");
trace("Proibida a distribui\u00E7\u00E3o e/ou utiliza\u00E7\u00E3o");
trace("deste componente para a confec\u00E7\u00E3o de");
trace("projetos que n\u00E3o sejam de autoria da YKM2000.");
trace("---------------------------------------------");
}
static function initializeEnvironment() {
_root.___targetsArray = new Array();
_root.___destroyedArray = new Array();
_root.___Sounds = new Array();
_root.___SoundOn = true;
_root.___Go = false;
_root.___GoHero = false;
_root.___Timer = false;
}
static function terminateEnvironment() {
_root.___targetsArray = undefined;
_root.___destroyedArray = undefined;
_root.___Sounds = undefined;
_root.___SoundOn = undefined;
_root.___Go = undefined;
_root.___GoHero = undefined;
_root.___Timer = undefined;
}
static function randomize(seed) {
return(Math.floor(Math.random() * seed) + 1);
}
static function timeToSeconds(formatedtime) {
var _local1 = new Array();
_local1 = formatedtime.split(":");
return((Number(_local1[0]) * 60) + Number(_local1[1]));
}
static function myTrace(argument) {
_root.txtOutput.text = _root.txtOutput.text + (argument + "\r");
}
static function isEven(argument) {
if (((argument / 2) - Math.floor(argument / 2)) == 0) {
return(true);
}
return(false);
}
static function decimalPlaces(argument, places) {
return(Math.floor(argument * Math.pow(10, places)) / Math.pow(10, places));
}
static function miniArray(argument) {
var _local1 = new Array();
_local1 = argument.split(",");
return(_local1);
}
static function cleanArray(inputarray, sortme) {
if (sortme) {
inputarray.sort();
while ((allTrim(inputarray[0]) == "") or (inputarray[0] == undefined)) {
inputarray.shift();
}
return(inputarray);
}
var _local4 = new Array();
var _local3 = 0;
var _local2 = 0;
while (_local2 <= (inputarray.length - 1)) {
if ((allTrim(inputarray[_local2]) != "") and (inputarray[_local2] != undefined)) {
_local4[_local3] = inputarray[_local2];
_local3++;
}
_local2++;
}
return(_local4);
}
static function createMatrix(matrixname, rows, cols) {
_root[matrixname] = new Array();
var _local2 = 0;
while (_local2 <= (rows - 1)) {
_root[matrixname].push(new Array());
_local2++;
}
}
static function fillMatrix(matrixname, rows, cols, myvalue) {
var _local3 = 0;
while (_local3 <= (rows - 1)) {
var _local2 = 0;
while (_local2 <= (cols - 1)) {
_root[matrixname][_local3][_local2] = myvalue;
_local2++;
}
_local3++;
}
}
static function traceMatrix(matrix, rows, cols) {
var _local3 = 0;
while (_local3 <= (rows - 1)) {
var _local4 = "";
var _local2 = 0;
while (_local2 <= (cols - 1)) {
_local4 = _local4 + (_root[matrix][_local3][_local2] + "/");
_local2++;
}
trace(_local4);
_local3++;
}
}
static function lTrim(matter) {
if ((matter.length > 1) || (((matter.length == 1) && (matter.charCodeAt(0) > 32)) && (matter.charCodeAt(0) < 255))) {
var _local1 = 0;
while ((_local1 < matter.length) && ((matter.charCodeAt(_local1) <= 32) || (matter.charCodeAt(_local1) >= 255))) {
_local1++;
}
matter = matter.substring(_local1);
} else {
matter = "";
}
return(matter);
}
static function rTrim(matter) {
if ((matter.length > 1) || (((matter.length == 1) && (matter.charCodeAt(0) > 32)) && (matter.charCodeAt(0) < 255))) {
var _local1 = matter.length - 1;
while ((_local1 >= 0) && ((matter.charCodeAt(_local1) <= 32) || (matter.charCodeAt(_local1) >= 255))) {
_local1--;
}
matter = matter.substring(0, _local1 + 1);
} else {
matter = "";
}
return(matter);
}
static function allTrim(matter) {
return(lTrim(rTrim(matter)));
}
static function getNextDepth(startlevel, endlevel) {
if ((startlevel != undefined) and (endlevel != undefined)) {
var _local4 = startlevel;
var _local2 = startlevel;
var _local3 = endlevel;
} else {
var _local4 = 1000000 /* 0x0F4240 */;
var _local2 = 1000000 /* 0x0F4240 */;
var _local3 = 1048576 /* 0x100000 */;
}
while (_root.getInstanceAtDepth(_local2) != undefined) {
_local2++;
if (_local2 == _local3) {
_local2 = _local4;
}
}
return(_local2);
}
static function newMC(mcname, pointer) {
if (_root[mcname] == undefined) {
var _local4 = getNextDepth(pointer, pointer + 999);
var _local3 = mcname + _local4;
_root.attachMovie(mcname, _local3, 19000);
CheckInstance(mcname, _local3);
return(_local3);
}
return(mcname);
}
static function CheckInstance(mcname, instname) {
if (_root[instname] == undefined) {
trace((((((("Instance of " + mcname) + " couldn't be created.") + "\r") + "Check if the refenciated library object is set for") + "\r") + "'Export for ActionScript' in the Linkage panel.") + "\r");
}
}
static function execEvent(myparam) {
if (myparam != "") {
var _local2 = new Array();
var _local3 = "";
_local2 = miniArray(myparam);
if (_local2.length > 1) {
_root[_local2[0]](_local2[1], _local2[2], _local2[3], _local2[4], _local2[5], _local2[6], _local2[7], _local2[8], _local2[9], _local2[10]);
} else {
_root[_local2[0]]();
}
}
}
static function pushIntoArray(array_name, thecontent) {
if (_root[array_name] != undefined) {
_root[array_name][_root[array_name].length] = thecontent;
} else {
trace(("Array " + array_name) + " not found.");
}
}
static function popFromArray(array_name, thecontent) {
if (_root[array_name] != undefined) {
var _local3 = 0;
while (_local3 <= (_root[array_name].length - 1)) {
if (_root[array_name][_local3] == thecontent) {
_root[array_name][_local3] = "";
_root[array_name] = cleanArray(_root[array_name]);
trace(_root[array_name]);
}
_local3++;
}
} else {
trace(("Array " + array_name) + " not found.");
}
}
static function pushTarget(target_name) {
if (_root.___targetsArray != undefined) {
_root.___targetsArray[_root.___targetsArray.length] = target_name;
} else {
trace("ERROR -- You must declare targets with initializeTargets() method.");
}
}
static function popTarget(enemy_name) {
if (_root.___targetsArray != undefined) {
var _local2 = 0;
while (_local2 <= (_root.___targetsArray.length - 1)) {
if (_root.___targetsArray[_local2] == enemy_name) {
_root.___targetsArray[_local2] = "";
_root.___targetsArray = cleanArray(_root.___targetsArray);
}
_local2++;
}
} else {
trace("ERROR -- You must declare targets with initializeTargets() method.");
}
}
static function pushDestroyed(target_name) {
if (_root.___destroyedArray != undefined) {
_root.___destroyedArray[_root.___destroyedArray.length] = target_name;
} else {
trace("ERROR -- You must declare targets with initializeTargets() method.");
}
}
static function popDestroyed(enemy_name) {
if (_root.___destroyedArray != undefined) {
var _local2 = 0;
while (_local2 <= (_root.___destroyedArray.length - 1)) {
if (_root.___destroyedArray[_local2] == enemy_name) {
_root.___destroyedArray[_local2] = "";
_root.___destroyedArray = cleanArray(_root.___destroyedArray);
}
_local2++;
}
} else {
trace("ERROR -- You must declare targets with initializeTargets() method.");
}
}
static function scanDestroyedList() {
var _local2 = 0;
while (_local2 <= (_root.___destroyedArray.length - 1)) {
_root[_root.___destroyedArray[_local2]].removeMovieClip();
popDestroyed(_root.___destroyedArray[_local2]);
_local2++;
}
}
static function getDestroyedListSize() {
return(_root.___destroyedArray.length);
}
static function scanEnemyForHit(baseclip) {
var _local2 = 0;
if (_local2 <= (_root.___targetsArray.length - 1)) {
if (_root[baseclip].hitTest(_root[_root.___targetsArray[_local2]])) {
return(_root.___targetsArray[_local2]);
}
return("");
}
}
static function getGameStatus() {
return(_root.___Go);
}
static function getTimersStatus() {
return(_root.___Timer);
}
static function pauseGame(status) {
if (status == true) {
_root.___GoHero = false;
_root.___Go = false;
_root.___Timer = false;
} else {
_root.___GoHero = true;
_root.___Go = true;
_root.___Timer = true;
}
}
static function setGameStatus(status) {
if (status == false) {
_root.___GoHero = false;
_root.___Go = false;
_root.___Timer = false;
} else {
_root.___GoHero = true;
_root.___Go = true;
_root.___Timer = true;
}
}
static function pauseTimers(status) {
if (status == true) {
_root.___Timer = false;
} else {
_root.___Timer = true;
}
}
static function attachSoundFX(identifier, soundatlib, style) {
var _local3 = getNextDepth(11000, 11999);
var _local4 = "mcSound" + _local3;
var _local5 = identifier;
_root.createEmptyMovieClip(_local4, _local3);
_root[identifier] = new Sound(_root[_local4]);
_root[identifier].attachSound(soundatlib);
_root[identifier].setVolume(100);
_root[identifier]._style = style;
_root.___Sounds[_root.___Sounds.length] = identifier;
}
static function playSound(identifier) {
if (_root.___SoundOn) {
_root[identifier].start();
if (_root[identifier]._style == "track") {
_root[identifier].onSoundComplete = function () {
_root[identifier].start(0, 999);
};
}
}
}
static function muteSounds() {
stopSounds();
_root.___SoundOn = false;
}
static function unmuteSounds() {
_root.___SoundOn = true;
var _local2 = 0;
while (_local2 <= (_root.___Sounds.length - 1)) {
if (_root[_root.___Sounds[_local2]]._style == "track") {
playSound(_root.___Sounds[_local2]);
}
_local2++;
}
}
static function stopSounds() {
var _local2 = 0;
while (_local2 <= (_root.___Sounds.length - 1)) {
_root[_root.___Sounds[_local2]].stop();
_local2++;
}
}
static function getSoundStatus() {
return(_root.___SoundOn);
}
static function getHeroStatus() {
return(_root.___GoHero);
}
}
Symbol 35 MovieClip [__Packages.packager] Frame 0
class packager extends MovieClip
{
var _mcBoundingBox;
function packager () {
super();
_mcBoundingBox._visible = false;
_mcBoundingBox._width = (_mcBoundingBox._height = 0);
}
}
Symbol 38 MovieClip [__Packages.Gun] Frame 0
class Gun
{
var shooter, nose, aimname, shot, libshot, ammoMC, eachBulletMC, reloadsTxt;
function Gun () {
}
function attachGun(mcname, nose) {
if (_root[mcname] != undefined) {
gunCreated = true;
shooter = mcname;
this.nose = nose;
_root[mcname].onMouseMove = function () {
if (_root.___Go and _root.___GoHero) {
if (this._movement == "rotation") {
YFW.execEvent(this.onRotate);
updateAfterEvent();
var _local5 = _xmouse - this._x;
var _local4 = _ymouse - this._y;
var _local3 = Math.atan2(_local4, _local5);
_local3 = ((_local3 * 180) / Math.PI) + 90;
this._rotation = _local3;
} else {
if (this._movement == "horizontal") {
this._x = _xmouse;
}
if (this._movement == "vertical") {
this._y = _ymouse;
}
}
}
};
} else {
trace("Hero not found. Cannot attach gun.");
}
}
function attachTrigger(mcname) {
gunCreated = true;
shooter = mcname;
attachAim(mcname);
_root[mcname].myTargets = "___targetsArray";
_root[mcname].onShot = "";
_root[mcname].onHit = "";
_root[mcname].onMouseDown = function () {
if (_root.___Go and _root.___GoHero) {
YFW.execEvent(this.onShot);
if (this.myTargets != undefined) {
var _local3 = 0;
while (_local3 <= (_root[this.myTargets].length - 1)) {
if (this.hitTest(_root[_root[this.myTargets][_local3]])) {
var _local4 = _root[this.myTargets][_local3];
_root[this.myTargets][_local3] = "";
_root[this.myTargets] = YFW.cleanArray(_root[this.myTargets]);
YFW.pushDestroyed(_local4);
YFW.execEvent(this.onHit);
}
_local3++;
}
}
}
};
}
function attachAim(mcname) {
aimname = mcname;
Mouse.hide();
var _local4 = YFW.getNextDepth();
_root.attachMovie(mcname, mcname, _local4);
_root[mcname].onMouseMove = function () {
this._x = _xmouse - (this._width / 2);
this._y = _ymouse - (this._height / 2);
updateAfterEvent();
};
}
function removeAim() {
Mouse.show();
_root[aimname].removeMovieClip();
}
function putShot(shotmc, speed, x_maxbound, y_maxbound) {
if ((gunCreated and _root.___Go) and _root.___GoHero) {
var _local8 = YFW.getNextDepth(3000);
if (((((_root[shooter]._movement == "horizontal") or (_root[shooter]._movement == "free")) or (_root[shooter]._movement == "rotation")) or (_root[shooter]._movement == "")) or (_root[shooter]._movement == undefined)) {
var _local7 = _root[shooter]._rotation - 90;
}
if (_root[shooter]._movement == "vertical") {
var _local7 = _root[shooter]._rotation;
}
var _local7 = (_local7 * Math.PI) / 180;
pntShot++;
var _local6 = shotmc + pntShot;
shot = _local6;
libshot = shotmc;
_root.attachMovie(shotmc, _local6, _local8);
_root[_local6]._x = _root[shooter]._x + (nose * Math.cos(_local7));
_root[_local6]._y = _root[shooter]._y + (nose * Math.sin(_local7));
_root[_local6].xmov = speed * Math.cos(_local7);
_root[_local6].ymov = speed * Math.sin(_local7);
_root[_local6].myTargets = "___targetsArray";
_root[_local6].onHit = "";
_root[_local6].onEnterFrame = function () {
if (this.myTargets != undefined) {
var _local3 = 0;
while (_local3 <= (_root[this.myTargets].length - 1)) {
if (this.hitTest(_root[_root[this.myTargets][_local3]])) {
this._visible = false;
var _local5 = true;
var _local4 = _root[this.myTargets][_local3];
_root[this.myTargets][_local3] = "";
_root[this.myTargets] = YFW.cleanArray(_root[this.myTargets]);
YFW.pushDestroyed(_local4);
YFW.execEvent(this.onHit);
}
_local3++;
}
}
this._x = this._x + this.xmov;
this._y = this._y + this.ymov;
if (((((this._x < 0) or (this._x > x_maxbound)) or (this._y < 0)) or (this._y > y_maxbound)) or _local5) {
this.removeMovieClip();
}
};
} else {
trace("no shooter found.");
}
}
function attachAmmo(ammoname, eachbulletmc, reloadstxt, totalbullets, totalreloads, auto_reload) {
var _local3 = 0;
while (_local3 <= totalbullets) {
_root[ammoname][eachbulletmc + _local3]._visible = true;
_local3++;
}
_root[ammoname].onEmpty = "";
_root[ammoname].onNoReloads = "";
_root[ammoname]._totalBullets = totalbullets;
_root[ammoname]._totalReloads = totalreloads;
_root[ammoname]._defaultTotalBullets = totalbullets;
_root[ammoname]._defaultTotalReloads = totalreloads;
_root[ammoname]._autoReload = auto_reload;
ammoMC = ammoname;
eachBulletMC = eachbulletmc;
reloadsTxt = reloadstxt;
}
function decAmmo() {
if (_root[ammoMC]._totalBullets > 0) {
_root[ammoMC][eachBulletMC + _root[ammoMC]._totalBullets]._visible = false;
_root[ammoMC]._totalBullets--;
if (_root[ammoMC]._totalBullets == 0) {
YFW.execEvent(_root[ammoMC].onEmpty);
if (_root[ammoMC]._autoReload) {
reload();
} else if (_root[ammoMC]._totalReloads == 0) {
YFW.execEvent(_root[ammoMC].onNoReloads);
}
}
}
}
function reload() {
if (_root[ammoMC]._totalReloads > 0) {
if (_root[ammoMC]._totalBullets == 0) {
_root[ammoMC]._totalBullets = _root[ammoMC]._defaultTotalBullets;
_root[ammoMC]._totalReloads--;
_root[ammoMC][reloadsTxt].text = _root[ammoMC]._totalReloads;
var _local3 = 1;
while (_local3 <= _root[ammoMC]._totalBullets) {
_root[ammoMC][eachBulletMC + _local3]._visible = true;
_local3++;
}
}
} else {
YFW.execEvent(_root[ammoMC].onNoReloads);
}
}
function getAmmo() {
return(_root[ammoMC]._totalBullets);
}
function getReloads() {
return(_root[ammoMC]._totalReloads);
}
function resetAmmo() {
_root[ammoMC]._totalBullets = _root[ammoMC]._defaultTotalBullets;
_root[ammoMC]._totalReloads = _root[ammoMC]._defaultTotalReloads;
var _local3 = 1;
while (_local3 <= _root[ammoMC]._defaultTotalBullets) {
_root[ammoMC][eachBulletMC + _local3]._visible = true;
_local3++;
}
}
function getShot() {
return(shot);
}
function getGun() {
return(shooter);
}
function removeAllShots() {
var _local3 = getShotPointer() - 20;
while (_local3 <= (getShotPointer() + 10)) {
_root[getShotLibName() + _local3].removeMovieClip();
_local3++;
}
}
function getShotPointer() {
return(pntShot);
}
function getShotLibName() {
return(libshot);
}
var pntShot = 3000;
var gunCreated = false;
}
Symbol 40 MovieClip [__Packages.Hero] Frame 0
class Hero
{
var movname, herox, heroy;
function Hero () {
}
function attachCannon(mcname, movement, xcoord, ycoord) {
mcname = YFW.newMC(mcname, pntHero);
movname = mcname;
_root[mcname]._x = xcoord;
_root[mcname]._y = ycoord;
_root[mcname]._movement = movement;
_root[mcname]._myTargets = "___targetsArray";
_root.___GoHero = true;
_root[mcname].onRotate = "";
_root[mcname].onMove = "";
_root[mcname].onTouchTarget = "";
_root[mcname].onMouseMove = function () {
if (_root.___Go and _root.___GoHero) {
if (this._movement == "rotation") {
YFW.execEvent(this.onRotate);
updateAfterEvent();
var _local5 = _xmouse - this._x;
var _local4 = _ymouse - this._y;
var _local3 = Math.atan2(_local4, _local5);
_local3 = ((_local3 * 180) / Math.PI) + 90;
this._rotation = _local3;
} else {
YFW.execEvent(this.onMove);
if (movement == "horizontal") {
this._x = _xmouse;
}
if (movement == "vertical") {
this._y = _ymouse;
}
}
}
};
_root[mcname].onEnterFrame = function () {
if (_root.___Go and _root.___GoHero) {
if (this._myTargets != undefined) {
var _local3 = 0;
while (_local3 <= (_root[this._myTargets].length - 1)) {
if (this.hitTest(_root[_root[this._myTargets][_local3]])) {
YFW.execEvent(this.onTouchTarget);
}
_local3++;
}
}
}
};
}
function attachShip(mcname, xini, yini, maxx, maxy, speed, brakes, extrapolate) {
mcname = YFW.newMC(mcname, pntHero);
movname = mcname;
herox = xini;
heroy = yini;
_root[mcname].onAccelerate = "";
_root[mcname].onBrakes = "";
_root[mcname].onTurnRight = "";
_root[mcname].onTurnLeft = "";
_root[mcname].onExtrapolate = "";
_root[mcname].onBounds = "";
_root[mcname].onTouchTarget = "";
_root[mcname]._x = xini;
_root[mcname]._y = yini;
_root[mcname].maxX = maxx;
_root[mcname].maxY = maxy;
_root[mcname].extrapolate = extrapolate;
_root[mcname].speed = speed;
_root[mcname].torque = 0;
_root[mcname].rtorque = 0;
_root[mcname].AngVelocity = 0;
_root[mcname].AngAcceleration = 0;
_root[mcname].angle = 0;
_root[mcname].force = 0;
_root[mcname].xv = 0;
_root[mcname].yv = 0;
_root[mcname].x = 0;
_root[mcname].y = 0;
_root[mcname].xa = 0;
_root[mcname].ya = 0;
_root[mcname].v = 0;
_root[mcname].momentum = 0.02;
_root[mcname].drag = 0;
_root[mcname]._myTargets = "___targetsArray";
_root.___GoHero = true;
var _local5 = new Keyboard();
Key.addListener(_local5);
_root[mcname].onEnterFrame = function () {
if (_root.___Go and _root.___GoHero) {
if (this._myTargets != undefined) {
var _local3 = 0;
while (_local3 <= (_root[this._myTargets].length - 1)) {
if (this.hitTest(_root[_root[this._myTargets][_local3]])) {
YFW.execEvent(this.onTouchTarget);
}
_local3++;
}
}
if (Key.isDown(39)) {
YFW.execEvent(this.onTurnRight);
this.torque = 5;
} else if (Key.isDown(37)) {
YFW.execEvent(this.onTurnLeft);
this.torque = -5;
} else {
this.torque = 0;
}
this.rtorque = 0.5 * this.AngVelocity;
this.AngAcceleration = this.torque - this.rtorque;
this.AngVelocity = this.AngVelocity + this.AngAcceleration;
this.angle = this.angle + this.AngVelocity;
if (this.angle < 0) {
this.angle = this.angle + 360;
}
if (this.angle > 360) {
this.angle = this.angle - 360;
}
this.v = Math.sqrt(Math.pow(this.xv, 2) + Math.pow(this.yv, 2));
this.drag = this.momentum * this.v;
if (Key.isDown(38)) {
YFW.execEvent(this.onAccelerate);
this.force = speed;
} else {
this.force = 0;
}
this.xa = ((this.drag * this.xv) * -1) + (this.force * Math.sin((Math.PI/180) * this.angle));
this.ya = ((this.drag * this.yv) * -1) - (this.force * Math.cos((Math.PI/180) * this.angle));
this.xv = this.xv + this.xa;
this.yv = this.yv + this.ya;
if (brakes) {
if (Key.isDown(40)) {
YFW.execEvent(this.onBrakes);
if (this.onBrakes != undefined) {
_root.onBrakes();
}
this.xv = 0;
this.yv = 0;
}
}
if (this.extrapolate) {
YFW.execEvent(this.onExtrapolate);
if (this._x <= 0) {
this._x = this.maxX - 1;
}
if (this._x >= this.maxX) {
this._x = 0;
}
if (this._y <= 0) {
this._y = this.maxY - 1;
}
if (this._y >= this.maxY) {
this._y = 0;
}
} else {
YFW.execEvent(this.onBounds);
if (this._x <= 0) {
this._x = 0;
}
if (this._x >= this.maxX) {
this._x = this.maxX;
}
if (this._y <= 0) {
this._y = 0;
}
if (this._y >= this.maxY) {
this._y = this.maxY;
}
}
this._y = this._y + this.yv;
this._x = this._x + this.xv;
this._rotation = this.angle;
}
};
}
function attachFish(mcname, xini, yini, speed, rotateme) {
mcname = YFW.newMC(mcname, pntHero);
movname = mcname;
herox = xini;
heroy = yini;
_root[mcname].onSwim = "";
_root[mcname].onReach = "";
_root[mcname].mySpeed = speed;
_root[mcname].endposx = 0;
_root[mcname].endposy = 0;
_root[mcname]._x = xini;
_root[mcname]._y = yini;
_root[mcname].Inverted = false;
_root.___GoHero = true;
if (rotateme) {
_root[mcname].onEnterFrame = function () {
if (_root.___Go and _root.___GoHero) {
var _local3 = _root._ymouse - this._y;
var _local4 = _root._xmouse - this._x;
this.mcFish._rotation = (Math.atan2(_local3, _local4) * 180) / Math.PI;
this.factor = Math.floor(this.mcFish._rotation);
_local3 = _ymouse - this._y;
_local4 = _xmouse - this._x;
this._rotation = (Math.atan2(_local3, _local4) * 180) / Math.PI;
this.factor = Math.floor(this._rotation);
if (((this.factor > 90) && (this.factor <= 179)) || ((this.factor > -180) && (this.factor < -90))) {
if (this.Inverted == false) {
this._yscale = this._yscale * -1;
this.Inverted = true;
}
}
if (((this.factor <= 90) && (this.factor >= -90)) && (this.Inverted == true)) {
this._yscale = this._yscale * -1;
this.Inverted = false;
}
}
};
}
_root[mcname].onMouseDown = function () {
if (_root.___Go and _root.___GoHero) {
YFW.execEvent(this.onSwin);
if (_xmouse > this._x) {
if ((_xmouse - this._x) > this.mySpeed) {
this.endposx = this._x + this.mySpeed;
} else {
this.endposx = _xmouse;
}
}
if (_xmouse < this._x) {
if ((this._x - _xmouse) > this.mySpeed) {
this.endposx = this._x - this.mySpeed;
} else {
this.endposx = _xmouse;
}
}
if (_ymouse > this._y) {
if ((_ymouse - this._y) > this.mySpeed) {
this.endposy = this._y + this.mySpeed;
} else {
this.endposy = _ymouse;
}
}
if (_ymouse < this._y) {
if ((this._y - _ymouse) > this.mySpeed) {
this.endposy = this._y - this.mySpeed;
} else {
this.endposy = _ymouse;
}
}
this.createEmptyMovieClip("mcMoveMe", 1);
this.mcMoveMe.endposx = this.endposx;
this.mcMoveMe.endposy = this.endposy;
this.mcMoveMe.myParent = this._name;
this.mcMoveMe.onEnterFrame = function () {
var _local4 = (this.endposx - _root[this.myParent]._x) / 8;
var _local3 = (this.endposy - _root[this.myParent]._y) / 8;
_root[this.myParent]._x = _root[this.myParent]._x + _local4;
_root[this.myParent]._y = _root[this.myParent]._y + _local3;
if ((Math.floor(_local4) == 0) && (Math.floor(_local3) == 0)) {
YFW.execEvent(this.onReach);
this.removeMovieClip();
}
};
}
};
}
function setFishSpeed(newspeed) {
_root[movname].mySpeed = newspeed;
}
function resetHero() {
_root[movname]._x = herox;
_root[movname]._x = heroy;
}
function getHeroName() {
return(movname);
}
function getHeroX() {
return(_root[movname]._x);
}
function getHeroY() {
return(_root[movname]._y);
}
function attachDiver(mcname, xini, yini, divespeed, raisespeed, diverot, raiserot, maxdive, maxraise) {
mcname = YFW.newMC(mcname, pntHero);
movname = mcname;
herox = xini;
heroy = yini;
_root[mcname].myDownSpeed = divespeed;
_root[mcname].myUpSpeed = raisespeed;
_root[mcname].myDiveRot = diverot;
_root[mcname].myRaiseRot = raiserot;
_root[mcname].myMaxDive = maxdive;
_root[mcname].myMaxRaise = maxraise;
_root[mcname].myTargets = "___targetsArray";
_root[mcname]._x = xini;
_root[mcname]._y = yini;
_root.___GoHero = true;
_root[mcname].onDive = "";
_root[mcname].onRaise = "";
_root[mcname].onMaxDive = "";
_root[mcname].onMaxRaise = "";
_root[mcname].onTouchTarget = "";
_root[mcname].onEnterFrame = function () {
if (_root.___Go and _root.___GoHero) {
if (this.myTargets != undefined) {
var _local3 = 0;
while (_local3 <= (_root[this.myTargets].length - 1)) {
if (this.hitTest(_root[_root[this.myTargets][_local3]])) {
YFW.execEvent(this.onTouchTarget);
}
_local3++;
}
}
}
};
_root[mcname].onMouseDown = function () {
if (_root.___Go and _root.___GoHero) {
YFW.execEvent(this.onDive);
this._rotation = this.myDiveRot;
this.onEnterFrame = function () {
if (this._y < this.myMaxDive) {
this._y = this._y + this.myDownSpeed;
}
if (this._y >= this.myMaxDive) {
YFW.execEvent(this.onMaxDive);
}
};
}
};
_root[mcname].onMouseUp = function () {
if (_root.___Go and _root.___GoHero) {
YFW.execEvent(this.onRaise);
this._rotation = this.myRaiseRot;
this.onEnterFrame = function () {
if (this._y > this.myMaxRaise) {
this._y = this._y - this.myUpSpeed;
}
if (this._y <= this.myMaxDive) {
YFW.execEvent(this.onMaxRaise);
}
};
}
};
}
function attachRaiser(mcname, xini, yini, raisespeed, divespeed, raiserot, diverot, maxraise, maxdive) {
mcname = YFW.newMC(mcname, pntHero);
movname = mcname;
herox = xini;
heroy = yini;
_root[mcname].myDownSpeed = divespeed;
_root[mcname].myUpSpeed = raisespeed;
_root[mcname].myDiveRot = diverot;
_root[mcname].myRaiseRot = raiserot;
_root[mcname].myMaxDive = maxdive;
_root[mcname].myMaxRaise = maxraise;
_root[mcname].myTargets = "___targetsArray";
_root[mcname]._x = xini;
_root[mcname]._y = yini;
_root.___GoHero = true;
_root[mcname].onDive = "";
_root[mcname].onRaise = "";
_root[mcname].onMaxDive = "";
_root[mcname].onMaxRaise = "";
_root[mcname].onTouchTarget = "";
_root[mcname].onEnterFrame = function () {
if (_root.___Go and _root.___GoHero) {
if (this.myTargets != undefined) {
var _local3 = 0;
while (_local3 <= (_root[this.myTargets].length - 1)) {
if (this.hitTest(_root[_root[this.myTargets][_local3]])) {
YFW.execEvent(this.onTouchTarget);
}
_local3++;
}
}
}
};
_root[mcname].onMouseDown = function () {
if (_root.___Go and _root.___GoHero) {
YFW.execEvent(this.onDive);
this._rotation = this.myDiveRot;
this.onEnterFrame = function () {
if (this._y > this.myMaxRaise) {
this._y = this._y - this.myUpSpeed;
}
if (this._y <= this.myMaxRaise) {
YFW.execEvent(this.onMaxRaise);
}
};
}
};
_root[mcname].onMouseUp = function () {
if (_root.___Go and _root.___GoHero) {
YFW.execEvent(this.onRaise);
this._rotation = this.myRaiseRot;
this.onEnterFrame = function () {
if (this._y < this.myMaxDive) {
this._y = this._y + this.myDownSpeed;
}
if (this._y >= this.myMaxDive) {
YFW.execEvent(this.onMaxDive);
}
};
}
};
}
function attachFollower(mcname, xini, yini, speed, axis, triggering) {
if (triggering == "Move") {
var functiontype = "onMouseMove";
} else {
var functiontype = "onMouseDown";
}
mcname = YFW.newMC(mcname, pntHero);
movname = mcname;
herox = xini;
heroy = yini;
_root.___GoHero = true;
_root[mcname]._x = xini;
_root[mcname]._y = yini;
_root[mcname].mySpeed = speed;
_root[mcname].myAxis = axis;
_root[mcname].myWait = 0;
_root[mcname].onReach = "";
_root[mcname][functiontype] = function () {
if (_root.___Go and _root.___GoHero) {
clearInterval(this.myWait);
var ResetInterval = function () {
clearInterval(_root[mcname].myWait);
YFW.execEvent(this.onReach);
delete _root[mcname][functiontype].onEnterFrame;
};
if (triggering == "Click") {
_root[mcname].onMouseUp = function () {
delete _root[mcname].onEnterFrame;
};
}
_root[mcname].onEnterFrame = function () {
if ((this.myAxis == "horizontal") or (this.myAxis == "both")) {
if (_xmouse > this._x) {
this._x = this._x + this.mySpeed;
}
if (_xmouse < this._x) {
this._x = this._x - this.mySpeed;
}
if (_xmouse == this._x) {
delete _root[mcname].onEnterFrame;
this.myWait = setInterval(ResetInterval, 200);
}
}
if ((this.myAxis == "vertical") or (this.myAxis == "both")) {
if (_ymouse > this._y) {
this._y = this._y + this.mySpeed;
}
if (_ymouse < this._y) {
this._y = this._y - this.mySpeed;
}
if (_ymouse == this._y) {
delete _root[mcname].onEnterFrame;
this.myWait = setInterval(ResetInterval, 200);
}
}
};
}
};
}
function setHeroStatus(mystatus) {
if (mystatus) {
_root.___GoHero = true;
} else {
_root.___GoHero = false;
}
}
function getHeroStatus() {
return(_root.___GoHero);
}
var pntHero = 7000;
}
Symbol 41 MovieClip [__Packages.Levels] Frame 0
class Levels
{
var levelMC, levelTxt, levelDefault, currentLevel;
function Levels () {
}
function attachLevel(mcname, txtname, initial, xcoord, ycoord) {
mcname = YFW.newMC(mcname, pntLevel);
levelMC = mcname;
levelTxt = txtname;
levelDefault = initial;
currentLevel = initial;
_root[levelMC]._x = xcoord;
_root[levelMC]._y = ycoord;
updateLevel();
}
function incLevel() {
currentLevel++;
updateLevel();
}
function updateLevel() {
_root[levelMC][levelTxt].text = currentLevel;
}
function getLevel() {
return(currentLevel);
}
function setLevel(level) {
currentLevel = level;
updateLevel();
}
function resetLevel() {
currentLevel = levelDefault;
updateLevel();
}
var pntLevel = 1000;
}
Symbol 44 MovieClip [__Packages.SpecialFX] Frame 0
class SpecialFX
{
function SpecialFX () {
}
function attachExplosions(mcname) {
var _local3 = 0;
while (_local3 <= (_root.___destroyedArray.length - 1)) {
mcname = YFW.newMC(mcname, pntExplosion);
_root[mcname]._x = _root[_root.___destroyedArray[_local3]]._x;
_root[mcname]._y = _root[_root.___destroyedArray[_local3]]._y;
_local3++;
}
}
var pntExplosion = 9000;
}
Symbol 45 MovieClip [__Packages.Timer] Frame 0
class Timer
{
var _created, movname, timertext, formated, timeToGo;
function Timer () {
_created = false;
}
function attachClock(mcname, timertext, timetogo, formated, up) {
mcname = YFW.newMC(mcname, pntTimer);
movname = mcname;
this.timertext = timertext;
this.formated = formated;
var _local6 = true;
this.up = up;
_root[mcname]._timeToGo = timetogo;
_root[mcname].onZero = "";
_created = true;
_root[mcname]._started = false;
_root[mcname]._timerMC = movname;
_root[mcname]._formated = formated;
_root[mcname]._paused = false;
_root[mcname]._up = up;
_root[mcname][timertext].text = timetogo;
_root[mcname].onEnterFrame = function () {
if ((this._started and (!this._paused)) and _root.___Timer) {
if (!this._up) {
if (this.countdown > 0.5) {
this.mynow = getTimer() / 1000;
this.countdown = (this.mycount - this.mynow) + this.mystart;
if (this._formated) {
var _local4 = Math.floor(parseInt(this.countdown) / 60);
var _local3 = Math.floor(this.countdown - (_local4 * 60));
if (_local3 < 10) {
_local3 = "0" + _local3;
}
_root[this._timerMC][timertext].text = (_local4 + ":") + _local3;
} else {
_root[this._timerMC][timertext].text = Math.floor(this.countdown);
}
} else if (this._started) {
this._started = false;
YFW.execEvent(this.onZero);
}
} else {
this.countup = Math.floor((getTimer() / 1000) - this.mystartu);
var _local3 = this.countup - (Math.floor(this.countup / 60) * 60);
var _local4 = Math.floor(this.countup / 60);
if (this._formated) {
if (_local3 < 10) {
_local3 = "0" + _local3;
}
_root[this._timerMC][timertext].text = (_local4 + ":") + _local3;
} else {
_root[this._timerMC][timertext].text = Math.floor(this.countup);
}
}
}
};
}
function attachTimebar(mcname, timerbar, initialpos, finalpos, decfactor, style) {
mcname = YFW.newMC(mcname, pntTimer);
movname = mcname;
_root[mcname]._timerMC = movname;
_root[mcname]._timerBar = timerbar;
_root[mcname]._initialPos = initialpos;
_root[mcname]._finalPos = finalpos;
_root[mcname]._decFactor = decfactor;
_root[mcname]._style = style;
_root[mcname]._paused = true;
_root[mcname].onZero = "";
_created = true;
_root[mcname].onEnterFrame = function () {
if ((!this._paused) and _root.___Timer) {
if (this._style == "horizontal") {
_root[this._timerMC][this._timerBar]._x = _root[this._timerMC][this._timerBar]._x - this._decFactor;
if (_root[this._timerMC][this._timerBar]._x <= this._finalPos) {
this._paused = true;
YFW.execEvent(this.onZero);
}
} else {
_root[this._timerMC][this._timerBar]._y = _root[this._timerMC][this._timerBar]._y + this._decFactor;
if (_root[this._timerMC][this._timerBar]._x >= this._finalPos) {
this._paused = true;
YFW.execEvent(this.onZero);
}
}
}
};
}
function getClock() {
return(movname);
}
function getTimebar() {
return(movname);
}
function initializeUpClock() {
if (up) {
if (formated) {
_root[movname][timertext].text = "0:00";
} else {
_root[movname][timertext].text = "0";
}
}
}
function startTimebar() {
_root[movname]._paused = false;
}
function pauseTimebar() {
if (_root[movname]._paused) {
_root[movname]._paused = false;
} else {
_root[movname]._paused = true;
}
}
function resetTimebar() {
if (_root[movname]._style == "horizontal") {
_root[_root[movname]._timerMC][_root[movname]._timerBar]._x = _root[movname]._initialPos;
} else {
_root[_root[movname]._timerMC][_root[movname]._timerBar]._y = _root[movname]._initialPos;
}
}
function remove() {
_root[movname].removeMovieClip();
delete _root[movname].onEnterFrame;
_created = false;
}
function startClock() {
if ((!_root[movname]._started) and _root.___Timer) {
_root[movname].mystart = getTimer() / 1000;
_root[movname].mystartu = (getTimer() / 1000) - _root[movname]._timeToGo;
_root[movname].mycount = _root[movname]._timeToGo;
_root[movname].countup = 0;
_root[movname].countdown = _root[movname]._timeToGo;
_root[movname]._started = true;
}
}
function pauseClock() {
if (_root[movname]._started) {
if (!_root[movname]._paused) {
_root[movname]._paused = true;
if (up) {
timeToGo = Math.floor(_root[movname].countup);
} else {
timeToGo = Math.floor(_root[movname].countdown);
}
} else {
_root[movname].mycount = timeToGo;
_root[movname].countdown = timeToGo;
_root[movname].countup = timeToGo;
_root[movname]._paused = false;
if (up) {
_root[movname].mystartu = ((getTimer() / 1000) - timeToGo) - 1;
} else {
_root[movname].mystart = getTimer() / 1000;
}
}
}
}
function stopClock() {
if (_root[movname]._started) {
_root[movname]._started = false;
}
}
var pntTimer = 6000;
var ticking = false;
var up = false;
}
Symbol 96 MovieClip Frame 1
stop();
Symbol 96 MovieClip Frame 2
play();
Symbol 96 MovieClip Frame 30
_root.mylives.decLives();
_root.resetMainChars();
Symbol 170 Button
on (release) {
getURL ("http://www.lostjungle.com/yankleber/");
}
Symbol 177 Button
on (release) {
_root.mcTitle._visible = false;
_root.startGame();
}
Symbol 186 Button
on (release) {
_root.mcGameOver._visible = false;
_root.mcTitle._visible = true;
}
Symbol 187 MovieClip Frame 1
stop();
Symbol 187 MovieClip Frame 2
play();
Symbol 187 MovieClip Frame 16
stop();