Section 1
//blacktigerattack_191 (jungle_ver85_fla.blacktigerattack_191)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class blacktigerattack_191 extends MovieClip {
public function blacktigerattack_191(){
addFrameScript(25, frame26);
}
function frame26(){
stop();
}
}
}//package jungle_ver85_fla
Section 2
//blacktigerhit_189 (jungle_ver85_fla.blacktigerhit_189)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class blacktigerhit_189 extends MovieClip {
public function blacktigerhit_189(){
addFrameScript(2, frame3);
}
function frame3(){
stop();
}
}
}//package jungle_ver85_fla
Section 3
//blacktigerhit20_195 (jungle_ver85_fla.blacktigerhit20_195)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class blacktigerhit20_195 extends MovieClip {
public function blacktigerhit20_195(){
addFrameScript(12, frame13, 19, frame20);
}
function frame20(){
stop();
}
function frame13(){
stop();
}
}
}//package jungle_ver85_fla
Section 4
//borehead_367 (jungle_ver85_fla.borehead_367)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class borehead_367 extends MovieClip {
public function borehead_367(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package jungle_ver85_fla
Section 5
//bug_stand_37 (jungle_ver85_fla.bug_stand_37)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class bug_stand_37 extends MovieClip {
public function bug_stand_37(){
addFrameScript(12, frame13);
}
function frame13(){
stop();
}
}
}//package jungle_ver85_fla
Section 6
//cagelittlemankey2_278 (jungle_ver85_fla.cagelittlemankey2_278)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class cagelittlemankey2_278 extends MovieClip {
public function cagelittlemankey2_278(){
addFrameScript(50, frame51);
}
function frame51(){
stop();
}
}
}//package jungle_ver85_fla
Section 7
//coconutroll_new_134 (jungle_ver85_fla.coconutroll_new_134)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class coconutroll_new_134 extends MovieClip {
public function coconutroll_new_134(){
addFrameScript(4, frame5);
}
function frame5(){
gotoAndPlay(1);
}
}
}//package jungle_ver85_fla
Section 8
//effecthitbore_376 (jungle_ver85_fla.effecthitbore_376)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class effecthitbore_376 extends MovieClip {
public function effecthitbore_376(){
addFrameScript(5, frame6);
}
function frame6(){
stop();
}
}
}//package jungle_ver85_fla
Section 9
//EgalDie_87 (jungle_ver85_fla.EgalDie_87)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class EgalDie_87 extends MovieClip {
public function EgalDie_87(){
addFrameScript(6, frame7);
}
function frame7(){
stop();
}
}
}//package jungle_ver85_fla
Section 10
//EgalHit_81 (jungle_ver85_fla.EgalHit_81)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class EgalHit_81 extends MovieClip {
public function EgalHit_81(){
addFrameScript(12, frame13);
}
function frame13(){
stop();
}
}
}//package jungle_ver85_fla
Section 11
//flashanimation_5 (jungle_ver85_fla.flashanimation_5)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class flashanimation_5 extends MovieClip {
public function flashanimation_5(){
addFrameScript(94, frame95);
}
function frame95(){
stop();
}
}
}//package jungle_ver85_fla
Section 12
//highscore_mc_347 (jungle_ver85_fla.highscore_mc_347)
package jungle_ver85_fla {
import flash.display.*;
import flash.text.*;
public dynamic class highscore_mc_347 extends MovieClip {
public var score1:TextField;
public var score5:TextField;
public var score10:TextField;
public var backhs:SimpleButton;
public var score6:TextField;
public var date1:TextField;
public var date2:TextField;
public var date3:TextField;
public var date6:TextField;
public var date7:TextField;
public var playmorehs:SimpleButton;
public var date5:TextField;
public var date9:TextField;
public var player1:TextField;
public var player2:TextField;
public var player6:TextField;
public var player7:TextField;
public var player8:TextField;
public var player5:TextField;
public var date4:TextField;
public var date8:TextField;
public var player3:TextField;
public var player9:TextField;
public var player4:TextField;
public var date10:TextField;
public var player10:TextField;
public var score2:TextField;
public var score3:TextField;
public var score7:TextField;
public var score8:TextField;
public var score9:TextField;
public var score4:TextField;
}
}//package jungle_ver85_fla
Section 13
//hunte_dead_184 (jungle_ver85_fla.hunte_dead_184)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class hunte_dead_184 extends MovieClip {
public function hunte_dead_184(){
addFrameScript(30, frame31);
}
function frame31(){
stop();
}
}
}//package jungle_ver85_fla
Section 14
//hunte_shoot_182 (jungle_ver85_fla.hunte_shoot_182)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class hunte_shoot_182 extends MovieClip {
public function hunte_shoot_182(){
addFrameScript(12, frame13);
}
function frame13(){
stop();
}
}
}//package jungle_ver85_fla
Section 15
//hunter_176 (jungle_ver85_fla.hunter_176)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class hunter_176 extends MovieClip {
public function hunter_176(){
addFrameScript(30, frame31);
}
function frame31(){
stop();
}
}
}//package jungle_ver85_fla
Section 16
//Hunter02Die_171 (jungle_ver85_fla.Hunter02Die_171)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class Hunter02Die_171 extends MovieClip {
public function Hunter02Die_171(){
addFrameScript(40, frame41);
}
function frame41(){
stop();
}
}
}//package jungle_ver85_fla
Section 17
//Hunter02Hit_170 (jungle_ver85_fla.Hunter02Hit_170)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class Hunter02Hit_170 extends MovieClip {
public function Hunter02Hit_170(){
addFrameScript(11, frame12);
}
function frame12(){
stop();
}
}
}//package jungle_ver85_fla
Section 18
//instruc_351 (jungle_ver85_fla.instruc_351)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class instruc_351 extends MovieClip {
public var playmore:SimpleButton;
public var backintro:SimpleButton;
}
}//package jungle_ver85_fla
Section 19
//killing_129 (jungle_ver85_fla.killing_129)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class killing_129 extends MovieClip {
public function killing_129(){
addFrameScript(14, frame15);
}
function frame15(){
stop();
}
}
}//package jungle_ver85_fla
Section 20
//LogoAniFlashA_105 (jungle_ver85_fla.LogoAniFlashA_105)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class LogoAniFlashA_105 extends MovieClip {
public function LogoAniFlashA_105(){
addFrameScript(5, frame6);
}
function frame6(){
stop();
}
}
}//package jungle_ver85_fla
Section 21
//mangoose_die_201 (jungle_ver85_fla.mangoose_die_201)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class mangoose_die_201 extends MovieClip {
public function mangoose_die_201(){
addFrameScript(21, frame22);
}
function frame22(){
stop();
}
}
}//package jungle_ver85_fla
Section 22
//mc_hitArea3_304 (jungle_ver85_fla.mc_hitArea3_304)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class mc_hitArea3_304 extends MovieClip {
public var slider1:MovieClip;
public var base:MovieClip;
}
}//package jungle_ver85_fla
Section 23
//mc_hitArea4_323 (jungle_ver85_fla.mc_hitArea4_323)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class mc_hitArea4_323 extends MovieClip {
public var base:MovieClip;
}
}//package jungle_ver85_fla
Section 24
//mc_hitArea6_329 (jungle_ver85_fla.mc_hitArea6_329)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class mc_hitArea6_329 extends MovieClip {
public var slider1:MovieClip;
public var slider2:MovieClip;
public var slider6:MovieClip;
public var slider7:MovieClip;
public var slider8:MovieClip;
public var slider5:MovieClip;
public var slider9:MovieClip;
public var slider3:MovieClip;
public var slider4:MovieClip;
public var slider10:MovieClip;
public var base:MovieClip;
}
}//package jungle_ver85_fla
Section 25
//mc_rope_animation_297 (jungle_ver85_fla.mc_rope_animation_297)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class mc_rope_animation_297 extends MovieClip {
public function mc_rope_animation_297(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package jungle_ver85_fla
Section 26
//MONKEYattack_216 (jungle_ver85_fla.MONKEYattack_216)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class MONKEYattack_216 extends MovieClip {
public function MONKEYattack_216(){
addFrameScript(12, frame13);
}
function frame13(){
stop();
}
}
}//package jungle_ver85_fla
Section 27
//MONKEYdead_231 (jungle_ver85_fla.MONKEYdead_231)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class MONKEYdead_231 extends MovieClip {
public function MONKEYdead_231(){
addFrameScript(71, frame72);
}
function frame72(){
stop();
}
}
}//package jungle_ver85_fla
Section 28
//MONKEYduck_232 (jungle_ver85_fla.MONKEYduck_232)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class MONKEYduck_232 extends MovieClip {
public function MONKEYduck_232(){
addFrameScript(1, frame2);
}
function frame2(){
stop();
}
}
}//package jungle_ver85_fla
Section 29
//MONKEYhitdown_230 (jungle_ver85_fla.MONKEYhitdown_230)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class MONKEYhitdown_230 extends MovieClip {
public function MONKEYhitdown_230(){
addFrameScript(2, frame3);
}
function frame3(){
}
}
}//package jungle_ver85_fla
Section 30
//MONKEYjumponeplace_217 (jungle_ver85_fla.MONKEYjumponeplace_217)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class MONKEYjumponeplace_217 extends MovieClip {
public function MONKEYjumponeplace_217(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package jungle_ver85_fla
Section 31
//MONKEYSTANDlittle_270 (jungle_ver85_fla.MONKEYSTANDlittle_270)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class MONKEYSTANDlittle_270 extends MovieClip {
public function MONKEYSTANDlittle_270(){
addFrameScript(44, frame45);
}
function frame45(){
stop();
}
}
}//package jungle_ver85_fla
Section 32
//preload_container_26 (jungle_ver85_fla.preload_container_26)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class preload_container_26 extends MovieClip {
public function preload_container_26(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package jungle_ver85_fla
Section 33
//r1_320 (jungle_ver85_fla.r1_320)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class r1_320 extends MovieClip {
public function r1_320(){
addFrameScript(6, frame7);
}
function frame7(){
stop();
}
}
}//package jungle_ver85_fla
Section 34
//RHINODIEALFA_251 (jungle_ver85_fla.RHINODIEALFA_251)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class RHINODIEALFA_251 extends MovieClip {
public function RHINODIEALFA_251(){
addFrameScript(18, frame19);
}
function frame19(){
stop();
}
}
}//package jungle_ver85_fla
Section 35
//rhinostuck_254 (jungle_ver85_fla.rhinostuck_254)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class rhinostuck_254 extends MovieClip {
public function rhinostuck_254(){
addFrameScript(14, frame15);
}
function frame15(){
stop();
}
}
}//package jungle_ver85_fla
Section 36
//rope_319 (jungle_ver85_fla.rope_319)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class rope_319 extends MovieClip {
public function rope_319(){
addFrameScript(23, frame24);
}
function frame24(){
stop();
}
}
}//package jungle_ver85_fla
Section 37
//rope_full_mc_318 (jungle_ver85_fla.rope_full_mc_318)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class rope_full_mc_318 extends MovieClip {
public function rope_full_mc_318(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package jungle_ver85_fla
Section 38
//rope12_299 (jungle_ver85_fla.rope12_299)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class rope12_299 extends MovieClip {
public function rope12_299(){
addFrameScript(1, frame2);
}
function frame2(){
stop();
}
}
}//package jungle_ver85_fla
Section 39
//ropefall_300 (jungle_ver85_fla.ropefall_300)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class ropefall_300 extends MovieClip {
public function ropefall_300(){
addFrameScript(30, frame31);
}
function frame31(){
stop();
}
}
}//package jungle_ver85_fla
Section 40
//snakeHIT_263 (jungle_ver85_fla.snakeHIT_263)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class snakeHIT_263 extends MovieClip {
public function snakeHIT_263(){
addFrameScript(44, frame45);
}
function frame45(){
stop();
}
}
}//package jungle_ver85_fla
Section 41
//snakeswallowmonkey_266 (jungle_ver85_fla.snakeswallowmonkey_266)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class snakeswallowmonkey_266 extends MovieClip {
public function snakeswallowmonkey_266(){
addFrameScript(45, frame46);
}
function frame46(){
stop();
}
}
}//package jungle_ver85_fla
Section 42
//stagestoneanimation_306 (jungle_ver85_fla.stagestoneanimation_306)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class stagestoneanimation_306 extends MovieClip {
public var breakMc:MovieClip;
public var makeMc:MovieClip;
public var stillMc:MovieClip;
public function stagestoneanimation_306(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame2(){
stop();
}
}
}//package jungle_ver85_fla
Section 43
//total_mc_2 (jungle_ver85_fla.total_mc_2)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class total_mc_2 extends MovieClip {
public function total_mc_2(){
addFrameScript(179, frame180);
}
function frame180(){
stop();
}
}
}//package jungle_ver85_fla
Section 44
//VALTUREdie_344 (jungle_ver85_fla.VALTUREdie_344)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class VALTUREdie_344 extends MovieClip {
public function VALTUREdie_344(){
addFrameScript(11, frame12);
}
function frame12(){
stop();
}
}
}//package jungle_ver85_fla
Section 45
//welcomescreen_mc_354 (jungle_ver85_fla.welcomescreen_mc_354)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class welcomescreen_mc_354 extends MovieClip {
public var highscore:SimpleButton;
public var intro:SimpleButton;
public var playGame:SimpleButton;
public var playmore:SimpleButton;
public var addMore:SimpleButton;
}
}//package jungle_ver85_fla
Section 46
//wildboredie_377 (jungle_ver85_fla.wildboredie_377)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class wildboredie_377 extends MovieClip {
public function wildboredie_377(){
addFrameScript(27, frame28);
}
function frame28(){
stop();
}
}
}//package jungle_ver85_fla
Section 47
//wildboreinthetree_379 (jungle_ver85_fla.wildboreinthetree_379)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class wildboreinthetree_379 extends MovieClip {
public function wildboreinthetree_379(){
addFrameScript(14, frame15);
}
function frame15(){
stop();
}
}
}//package jungle_ver85_fla
Section 48
//yeti_attac_new_135 (jungle_ver85_fla.yeti_attac_new_135)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class yeti_attac_new_135 extends MovieClip {
public function yeti_attac_new_135(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package jungle_ver85_fla
Section 49
//yeti_attack2_140 (jungle_ver85_fla.yeti_attack2_140)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class yeti_attack2_140 extends MovieClip {
public function yeti_attack2_140(){
addFrameScript(14, frame15);
}
function frame15(){
stop();
}
}
}//package jungle_ver85_fla
Section 50
//yeti_dead01_137 (jungle_ver85_fla.yeti_dead01_137)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class yeti_dead01_137 extends MovieClip {
public function yeti_dead01_137(){
addFrameScript(22, frame23);
}
function frame23(){
stop();
}
}
}//package jungle_ver85_fla
Section 51
//yeti_hit_136 (jungle_ver85_fla.yeti_hit_136)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class yeti_hit_136 extends MovieClip {
public function yeti_hit_136(){
addFrameScript(11, frame12);
}
function frame12(){
stop();
}
}
}//package jungle_ver85_fla
Section 52
//yeti_hit_die_138 (jungle_ver85_fla.yeti_hit_die_138)
package jungle_ver85_fla {
import flash.display.*;
public dynamic class yeti_hit_die_138 extends MovieClip {
public function yeti_hit_die_138(){
addFrameScript(14, frame15);
}
function frame15(){
stop();
}
}
}//package jungle_ver85_fla
Section 53
//you_lose_textField_117 (jungle_ver85_fla.you_lose_textField_117)
package jungle_ver85_fla {
import flash.display.*;
import flash.text.*;
public dynamic class you_lose_textField_117 extends MovieClip {
public var errormesg:TextField;
public var totalScore:TextField;
public var player:TextField;
}
}//package jungle_ver85_fla
Section 54
//AnimalAverage (AnimalAverage)
package {
import flash.events.*;
public class AnimalAverage extends AnimalBase {
public function init(_arg1:Number, _arg2:Number, _arg3:Number){
}
override public function escapeHit(){
if (xMoveType == 1){
xMoveType = -1;
action = 1;
scaleX = 1;
checkNextLine();
return;
};
xMoveType = 1;
action = 1;
scaleX = -1;
checkNextLine();
}
override public function hit_Banana(){
}
public function onEnterFrame(_arg1:Event){
}
public function checkNextLine(){
var _local1:Number;
if (!dieStatus){
if (xMoveType == 1){
_local1 = -1;
_local1 = getNextLine();
if (_local1 != -1){
currentLine = _local1;
targetEndx = (lineDimension[currentLine][0] + lineDimension[currentLine][2]);
jumpx = (lineDimension[currentLine][0] + halfWidth);
action = 2;
jumpUpStatus = true;
} else {
targetEndx = lineDimension[currentLine][0];
x = ((lineDimension[currentLine][0] + lineDimension[currentLine][2]) - halfWidth);
xMoveType = -1;
action = 1;
gotoAndStop(2);
};
return;
};
if (xMoveType == -1){
_local1 = getNextLine();
if (_local1 != -1){
currentLine = _local1;
targetEndx = lineDimension[currentLine][0];
jumpx = ((lineDimension[currentLine][0] + lineDimension[currentLine][2]) - halfWidth);
action = 2;
jumpUpStatus = true;
} else {
targetEndx = (lineDimension[currentLine][0] + lineDimension[currentLine][2]);
x = (lineDimension[currentLine][0] + halfWidth);
xMoveType = 1;
action = 1;
};
return;
};
};
}
override public function removeClip(){
x = 1500;
y = 1500;
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
if (Bg1.bg1.contains(this)){
trace("removed");
Bg1.bg1.removeChild(this);
};
}
public function getNextLine(){
if (xMoveType == 1){
return (lineDimension[currentLine][4]);
};
return (lineDimension[currentLine][3]);
}
}
}//package
Section 55
//AnimalBase (AnimalBase)
package {
import flash.utils.*;
public class AnimalBase extends Enemy {
protected var jumpHeight:Number;
protected var jumpDownStatus:Boolean;// = false
protected var counter:Number;
protected var currentLine:Number;
protected var speedx:Number;
protected var jumpx:Number;
protected var targetEndx:Number;
protected var maxCounter:Number;
protected var action:Number;// = 0
protected var xMoveType:Number;
protected var starty:Number;
protected var vultureType:Number;
protected var startx:Number;
public var attackStatus:Boolean;
public var halfWidth:Number;
protected var maxSpeed:Number;
public var attack2Status:Boolean;
public var hitStatus:Boolean;
public var dieStatus:Boolean;
public var halfHeight:Number;
protected var actionTimer:Timer;
protected var health:Number;// = 100
protected var chaseMonkeyStatus:Boolean;// = false
protected var stone:Stone;// = null
protected var jumpUpStatus:Boolean;// = false
public var turnStatus:Boolean;
protected var lineDimension:Array;
protected var hitBananaStatus:Boolean;// = false
public function AnimalBase(){
action = 0;
health = 100;
jumpUpStatus = false;
jumpDownStatus = false;
hitBananaStatus = false;
chaseMonkeyStatus = false;
stone = null;
super();
}
public function removeClip(){
}
public function escapeHit(){
}
public function initsuper(){
jumpUpStatus = false;
jumpDownStatus = false;
hitBananaStatus = false;
chaseMonkeyStatus = false;
hitStatus = false;
dieStatus = false;
turnStatus = false;
attackStatus = false;
}
public function hit_Banana(){
}
public function changeDirection(){
}
}
}//package
Section 56
//AnimalDumb (AnimalDumb)
package {
import flash.events.*;
public class AnimalDumb extends AnimalBase {
protected var standCountCurrent:uint;// = 0
protected var standCountMax:uint;// = 12
public function AnimalDumb(){
standCountCurrent = 0;
standCountMax = 12;
super();
}
public function init(_arg1:Number, _arg2:Number, _arg3:Number){
halfWidth = 22;
halfHeight = 28;
hitStatus = false;
dieStatus = false;
turnStatus = false;
chaseMonkeyStatus = false;
currentLine = _arg1;
health = _arg2;
lineDimension = GParams.game_Path_Dimension[(GParams.currentLevel - 1)];
if (_arg3 == 1){
startx = lineDimension[_arg1][0];
starty = (lineDimension[_arg1][1] - halfHeight);
targetEndx = (startx + lineDimension[_arg1][2]);
xMoveType = 1;
scaleX = 1;
x = startx;
y = starty;
} else {
if (_arg3 == -1){
targetEndx = lineDimension[_arg1][0];
startx = (targetEndx + lineDimension[_arg1][2]);
starty = (lineDimension[_arg1][1] - halfHeight);
xMoveType = -1;
scaleX = -1;
x = (startx - halfWidth);
y = starty;
};
};
gotoAndStop(2);
speedx = 2;
action = 1;
}
public function checkMonkeyPosition(){
var _local1:Number;
_local1 = Monkey.monkey.currentLineIndex;
if ((((((((_local1 == currentLine)) && (!(chaseMonkeyStatus)))) && (!(dieStatus)))) && (!(turnStatus)))){
action = 0;
if (speedx < maxSpeed){
speedx = (speedx + 0.25);
};
if (Monkey.monkey.x < x){
targetEndx = lineDimension[currentLine][0];
xMoveType = -1;
action = 1;
hitStatus = false;
gotoAndStop(2);
chaseMonkeyStatus = true;
return;
};
if (Monkey.monkey.x > x){
targetEndx = (lineDimension[currentLine][0] + lineDimension[currentLine][2]);
xMoveType = 1;
action = 1;
hitStatus = false;
gotoAndStop(2);
chaseMonkeyStatus = true;
return;
};
};
}
override public function escapeHit(){
if (((!(dieStatus)) && (!(Monkey.monkey.hitStatus)))){
if (Monkey.monkey.x > x){
targetEndx = lineDimension[currentLine][0];
xMoveType = -1;
action = 1;
hitStatus = false;
gotoAndStop(2);
return;
};
if (Monkey.monkey.x < x){
targetEndx = (lineDimension[currentLine][0] + lineDimension[currentLine][2]);
xMoveType = 1;
action = 1;
hitStatus = false;
gotoAndStop(2);
return;
};
};
}
protected function standAnimal(){
standCountCurrent = 0;
action = 0;
gotoAndStop(1);
}
override public function hit_Banana(){
}
override public function changeDirection(){
if (((((((hitStatus) && ((action == 0)))) && (!(dieStatus)))) && (!(turnStatus)))){
if (xMoveType == 1){
targetEndx = lineDimension[currentLine][0];
xMoveType = -1;
action = 1;
speedx = 2;
hitStatus = false;
gotoAndStop(2);
return;
};
if (xMoveType == -1){
targetEndx = (lineDimension[currentLine][0] + lineDimension[currentLine][2]);
xMoveType = 1;
action = 1;
speedx = 2;
hitStatus = false;
gotoAndStop(2);
return;
};
};
}
public function onEnterFrame(_arg1:Event){
}
public function checkNextLine(){
if (((((!(dieStatus)) && (!(turnStatus)))) && (!((currentFrame == 3))))){
if (xMoveType == 1){
targetEndx = lineDimension[currentLine][0];
xMoveType = -1;
action = 1;
hitStatus = false;
gotoAndStop(2);
turnStatus = true;
return;
};
if (xMoveType == -1){
targetEndx = (lineDimension[currentLine][0] + lineDimension[currentLine][2]);
xMoveType = 1;
action = 1;
hitStatus = false;
gotoAndStop(2);
turnStatus = true;
return;
};
};
}
override public function removeClip(){
x = 1500;
y = 1500;
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
if (Bg1.bg1.contains(this)){
Bg1.bg1.removeChild(this);
};
}
}
}//package
Section 57
//ArrowWeapon (ArrowWeapon)
package {
import flash.events.*;
import flash.display.*;
public class ArrowWeapon extends MovieClip {
var throwProgressStatus:Boolean;// = false
var throwX:Number;// = 0
var throwY:Number;// = 0
var startX:Number;
var startY:Number;
var throwDirection:Number;
var gravity:Number;// = 0.1
var speed:Number;
var halfWidth:int;// = 10
public var hitClip:MovieClip;
var prevY:Number;
var halfHeight:int;// = 5
var prevX:Number;
var throwUpStatus:Boolean;// = false
var throwDownStatus:Boolean;// = false
var endX:Number;
var endY:Number;
public static var arrowWeapon:ArrowWeapon = null;
public function ArrowWeapon(){
halfWidth = 10;
halfHeight = 5;
throwY = 0;
throwX = 0;
gravity = 0.1;
throwUpStatus = false;
throwProgressStatus = false;
throwDownStatus = false;
super();
addFrameScript(9, frame10);
}
function init(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
startX = Hunter2.hunter2.x;
startY = Hunter2.hunter2.y;
endX = Monkey.monkey.stagePosition.x;
endY = (Monkey.monkey.stagePosition.y + 25);
speed = 18;
throwProgressStatus = true;
throwUpStatus = true;
throwDownStatus = false;
x = startX;
y = startY;
_local1 = (endX - x);
_local2 = (endY - y);
_local3 = Math.atan2(_local2, _local1);
_local4 = (Math.ceil(((_local3 / Math.PI) * 180)) - 180);
throwX = (Math.cos(_local3) * speed);
throwY = (Math.sin(_local3) * speed);
rotation = _local4;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
function frame10(){
stop();
}
public function removeArrowWeapon(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
if (this.parent.contains(this)){
this.parent.removeChild(this);
};
}
private function checkMonkeyCollision(){
var _local1:Monkey;
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local1 = Monkey.monkey;
if (_local1 != null){
_local2 = (_local1.x - x);
_local3 = (_local1.y - y);
_local4 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
if (this.hitClip.hitTestObject(_local1.body)){
_local1.hit_Bhala();
if (_local1.x > 100){
_local1.x = (_local1.x - 50);
};
removeArrowWeapon();
return;
};
};
}
private function onEnterFrame(_arg1:Event){
Move();
checkMonkeyCollision();
}
private function Move(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
if (throwUpStatus){
prevX = x;
prevY = y;
x = (x + throwX);
y = (y + throwY);
_local1 = (prevX - x);
_local2 = (prevY - y);
_local3 = Math.atan2(_local2, _local1);
_local4 = Math.ceil(((_local3 / Math.PI) * 180));
rotation = _local4;
if (x < 0){
removeArrowWeapon();
} else {
if (x > 600){
removeArrowWeapon();
};
};
};
}
public static function getInstance():ArrowWeapon{
if (arrowWeapon == null){
arrowWeapon = new (ArrowWeapon);
};
return (arrowWeapon);
}
}
}//package
Section 58
//Banana (Banana)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class Banana extends MovieClip {
var throwProgressStatus:Boolean;// = false
var targetEndX:uint;
var throwDistY:Number;// = -2.5
var throwX:int;
var throwY:int;// = 0
var startX:uint;
var startY:uint;
var throwDirection:int;
var stageBananaPosition:Point;
var sameSlideTargetX:int;
var nextSlideTargetX:int;
var throwUpStatus:Boolean;// = false
var halfWidth:int;// = 10
var halfHeight:int;// = 5
var vanishStatus:Boolean;// = false
var fallRightStatus:Boolean;// = false
var throwDownStatus:Boolean;// = false
var fallLeftStatus:Boolean;// = false
var bottomSlideTargetY:int;
var endY:int;
public function Banana(){
halfWidth = 10;
halfHeight = 5;
throwDistY = -2.5;
throwY = 0;
stageBananaPosition = new Point();
throwUpStatus = false;
throwProgressStatus = false;
throwDownStatus = false;
fallLeftStatus = false;
fallRightStatus = false;
vanishStatus = false;
super();
addFrameScript(0, frame1, 3, frame4);
}
private function checkWildBoreCollision(){
var _local1:Number;
var _local2:AnimalBase;
var _local3:Number;
var _local4:Number;
_local1 = 0;
while (_local1 < Bg1.stageWildBoreArray.length) {
_local2 = Bg1.stageWildBoreArray[_local1];
if (((!((_local2 == null))) && (!(vanishStatus)))){
_local3 = Math.abs((x - _local2.x));
_local4 = Math.abs((y - _local2.y));
if (_local2.hitTestObject(this)){
_local2.hit_Banana();
removeBanana();
return;
};
};
_local1++;
};
}
private function checkSnakeCollision(){
var _local1:Snake;
var _local2:Number;
var _local3:Number;
_local1 = Bg1.snake;
if (((!((_local1 == null))) && (!(vanishStatus)))){
_local2 = Math.abs((x - _local1.x));
_local3 = Math.abs((y - _local1.y));
if (_local1.hitTestObject(this)){
_local1.hit_Banana();
removeBanana();
return;
};
};
}
private function removeBanana(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
if (Bg1.bg1.contains(this)){
Bg1.bg1.removeChild(this);
};
}
private function checkEagle2Collision(){
var _local1:Eagle2;
var _local2:Number;
var _local3:Number;
_local1 = Bg1.eagle2;
if (((!((_local1 == null))) && (!(vanishStatus)))){
_local2 = Math.abs((x - _local1.x));
_local3 = Math.abs((y - _local1.y));
if (_local1.hitTestObject(this)){
_local1.hit_Banana();
removeBanana();
return;
};
};
}
function init(_arg1:Object){
startX = _arg1.startX;
startY = (_arg1.startY + 20);
endY = _arg1.endY;
throwX = _arg1.throwX;
throwDirection = _arg1.dir;
sameSlideTargetX = _arg1.sameSlideTargetX;
nextSlideTargetX = _arg1.nextSlideTargetX;
bottomSlideTargetY = _arg1.bottomSlideTargetY;
throwY = throwDistY;
throwProgressStatus = true;
throwUpStatus = true;
throwDownStatus = false;
vanishStatus = false;
x = startX;
y = startY;
gotoAndStop(1);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function checkMongoesCollision(){
var _local1:Number;
var _local2:AnimalBase;
var _local3:Number;
var _local4:Number;
_local1 = 0;
while (_local1 < Bg1.stageMongoesArray.length) {
_local2 = Bg1.stageMongoesArray[_local1];
if (((!((_local2 == null))) && (!(vanishStatus)))){
_local3 = Math.abs((x - _local2.x));
_local4 = Math.abs((y - _local2.y));
if (_local2.hitTestObject(this)){
_local2.hit_Banana();
removeBanana();
return;
};
};
_local1++;
};
}
private function checkGorillaCollision(){
var _local1:Number;
var _local2:AnimalBase;
var _local3:Number;
var _local4:Number;
_local1 = 0;
while (_local1 < Bg1.stageGorillaArray.length) {
_local2 = Bg1.stageGorillaArray[_local1];
if (((!((_local2 == null))) && (!(vanishStatus)))){
_local3 = Math.abs((x - _local2.x));
_local4 = Math.abs((y - _local2.y));
if ((((_local3 < 50)) && ((_local4 < 60)))){
_local2.hit_Banana();
removeBanana();
return;
};
};
_local1++;
};
}
private function checkLeopardCollision(){
var _local1:Number;
var _local2:AnimalBase;
var _local3:Number;
var _local4:Number;
_local1 = 0;
while (_local1 < Bg1.stageLeopardArray.length) {
_local2 = Bg1.stageLeopardArray[_local1];
if (((!((_local2 == null))) && (!(vanishStatus)))){
_local3 = Math.abs((x - _local2.x));
_local4 = Math.abs((y - _local2.y));
if (_local2.hitTestObject(this)){
_local2.hit_Banana();
removeBanana();
return;
};
};
_local1++;
};
}
function frame4(){
stop();
}
function frame1(){
stop();
}
private function checkEagleCollision(){
var _local1:Eagle;
var _local2:Number;
var _local3:Number;
_local1 = Bg1.eagle;
if (((!((_local1 == null))) && (!(vanishStatus)))){
_local2 = Math.abs((x - _local1.x));
_local3 = Math.abs((y - _local1.y));
if (_local1.hitTestObject(this)){
_local1.hit_Banana();
removeBanana();
return;
};
};
}
private function checkFall(){
var _local1:MovieClip;
_local1 = null;
_local1 = Monkey.monkey.getBaseAreaClip();
if (_local1.hitTestPoint(stageBananaPosition.x, stageBananaPosition.y, true)){
gotoAndPlay(2);
vanishStatus = true;
return;
};
}
private function updateStageBananaPosition(){
stageBananaPosition.x = (x - Bg1.bg1.scrollRect.x);
stageBananaPosition.y = (y - Bg1.bg1.scrollRect.y);
}
private function onEnterFrame(_arg1:Event){
if (vanishStatus){
if (currentFrame >= 4){
removeBanana();
return;
};
};
if (!vanishStatus){
updateStageBananaPosition();
Move();
checkFall();
checkSnakeCollision();
checkEagleCollision();
checkEagle2Collision();
checkGorillaCollision();
checkRhinoCollision();
checkLeopardCollision();
checkVultureCollision();
checkMongoesCollision();
checkWildBoreCollision();
};
}
private function checkRhinoCollision(){
var _local1:Number;
var _local2:AnimalBase;
var _local3:Number;
var _local4:Number;
_local1 = 0;
while (_local1 < Bg1.stageRhinoArray.length) {
_local2 = Bg1.stageRhinoArray[_local1];
if (((!((_local2 == null))) && (!(vanishStatus)))){
_local3 = Math.abs((x - _local2.x));
_local4 = Math.abs((y - _local2.y));
if (_local2.hitTestObject(this)){
_local2.hit_Banana();
removeBanana();
return;
};
};
_local1++;
};
}
private function checkVultureCollision(){
var _local1:Number;
var _local2:AnimalBase;
var _local3:Number;
var _local4:Number;
_local1 = 0;
while (_local1 < Bg1.stageVultureArray.length) {
_local2 = Bg1.stageVultureArray[_local1];
if (((!((_local2 == null))) && (!(vanishStatus)))){
_local3 = Math.abs((x - _local2.x));
_local4 = Math.abs((y - _local2.y));
if (_local2.hitTestObject(this)){
_local2.hit_Banana();
removeBanana();
return;
};
};
_local1++;
};
}
private function Move(){
if (throwUpStatus){
y = (y + throwY);
x = (x + throwX);
rotation = (rotation + 25);
throwY = (throwY + 1);
if (throwY > 0){
throwY = 0;
throwDownStatus = true;
throwUpStatus = false;
};
};
if (throwDownStatus){
if (throwY < 4){
throwY = (throwY + 1);
};
y = (y + throwY);
x = (x + throwX);
rotation = (rotation + 25);
};
}
}
}//package
Section 59
//Bg1 (Bg1)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Bg1 extends MovieClip {
public var surfaceBg:Surface;// = null
public static var bug:Bug = null;
public static var eagle:Eagle = null;
public static var bg1:Bg1 = null;
private static var stageBananaIndex:Number = -1;
private static var stageMongoesIndex:Number = -1;
public static var stageBananaArray:Array = new Array(arraySize);
public static var eagle2:Eagle2 = null;
private static var stageCoconutIndex:Number = -1;
public static var stageGorillaArray:Array = new Array();
private static var stageGorillaIndex:Number = -1;
public static var snake:Snake = null;
public static var stageCoconutArray:Array = new Array(4);
private static var stageSnakeTimeIndex:Number = -1;
public static var stageSnakeTimeArray:Array = new Array();
public static var stagePowerUpIndex:int;
public static var stagePowerUpArray:Array = new Array();
private static var stageWildBoreIndex:Number = -1;
private static var stageVultureIndex:Number = -1;
public static var stageRhinoArray:Array = new Array();
private static var stageRhinoIndex:Number = -1;
public static var stageMongoesArray:Array = new Array();
public static var stageVultureArray:Array = new Array();
private static var stageLeopardIndex:Number = -1;
public static var stageWildBoreArray:Array = new Array();
private static var arraySize:Number = 4;
public static var stageLeopardArray:Array = new Array();
public function Bg1(){
surfaceBg = null;
super();
}
public function getVultureInstance(){
var _local1:int;
var _local2:int;
_local1 = GParams.stage_Vulture_Count[(GParams.currentLevel - 1)][0];
if (_local1 > 0){
createDumbVulture(_local1);
};
_local2 = GParams.stage_Vulture_Count[(GParams.currentLevel - 1)][1];
if (_local2 > 0){
createAverageVulture(_local2);
};
}
public function checkEnemies(){
var _local1:int;
_local1 = (stageMongoesArray.length - 1);
while (_local1 >= 0) {
if (stageMongoesArray[_local1] != null){
trace((((" this is : " + stageMongoesArray[_local1]) + " has event listener : ") + stageMongoesArray[_local1].hasEventListener(Event.ENTER_FRAME)));
trace((((" this is : " + stageMongoesArray[_local1]) + " has event listener : ") + stageMongoesArray[_local1].willTrigger(Event.ENTER_FRAME)));
};
_local1--;
};
_local1 = (stageVultureArray.length - 1);
while (_local1 >= 0) {
if (stageVultureArray[_local1] != null){
trace((((" this is : " + stageVultureArray[_local1]) + " has event listener : ") + stageVultureArray[_local1].hasEventListener(Event.ENTER_FRAME)));
trace((((" this is : " + stageVultureArray[_local1]) + " has event listener : ") + stageVultureArray[_local1].willTrigger(Event.ENTER_FRAME)));
};
_local1--;
};
}
private function createPowerUp(){
var _local1:int;
_local1 = 0;
while (_local1 < 2) {
stagePowerUpArray[_local1] = PowerUpFactory.getPowerUpInstance((_local1 + 1));
addChild(stagePowerUpArray[_local1]);
stagePowerUpArray[_local1].x = 1200;
stagePowerUpArray[_local1].y = 1200;
_local1++;
};
stagePowerUpIndex = -1;
}
public function getRhinoInstance(){
var _local1:int;
_local1 = GParams.stage_Rhino_Count[(GParams.currentLevel - 1)][0];
if (_local1 > 0){
createDumbRhino(_local1);
};
}
private function createMongoes(){
removeOldMongoes();
stageMongoesIndex = -1;
if (stageMongoesArray == null){
stageMongoesArray = new Array();
};
getMongoesInstance();
}
public function removeLeopardReference(){
var _local1:uint;
var _local2:AnimalBase;
_local1 = 0;
while (_local1 < stageLeopardArray.length) {
_local2 = stageLeopardArray[_local1];
if (_local2.dieStatus){
stageLeopardArray.splice(_local1, 1);
};
_local1++;
};
}
public function init(){
clearGraphics();
createSurfaceBg();
createPowerUp();
if (((((!((GParams.currentLevel == 3))) && (!((GParams.currentLevel == 6))))) && (!((GParams.currentLevel == 9))))){
createLevelEnemies();
} else {
createBossLevelEnemies();
};
}
public function createDumbRhino(_arg1:int){
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = 0;
while (_local2 < _arg1) {
stageRhinoIndex = (stageRhinoIndex + 1);
stageRhinoArray[stageRhinoIndex] = EnemyFactory.getEnemyInstance(6, 1);
bg1.addChild(stageRhinoArray[stageRhinoIndex]);
_local3 = GParams.stage_Rhino_Position[(GParams.currentLevel - 1)][0][_local2];
_local4 = GParams.stage_Rhino_Life[(GParams.currentLevel - 1)][0];
_local5 = GParams.stage_Rhino_Direction[(GParams.currentLevel - 1)][0][_local2];
stageRhinoArray[stageRhinoIndex].init(_local3, _local4, _local5);
_local2++;
};
}
private function createBossLevel2(){
var _local1:Array;
GParams.gamePause = true;
_local1 = GParams.stage_Enemy_Avail[(GParams.currentLevel - 1)];
if (_local1[10] == 1){
createWildBore();
};
}
private function createLevelEnemies(){
var _local1:Array;
_local1 = GParams.stage_Enemy_Avail[(GParams.currentLevel - 1)];
if (_local1[0] == 1){
};
if ((((_local1[1] == 1)) || ((_local1[2] == 1)))){
createVultures();
};
if ((((_local1[3] == 1)) || ((_local1[4] == 1)))){
createMongoes();
};
if (_local1[5] == 1){
createEagle();
};
if (_local1[6] == 1){
createEagle2();
};
if (_local1[9] == 1){
createSnake();
};
if (_local1[10] == 1){
createWildBore();
};
if ((((((_local1[11] == 1)) || ((_local1[12] == 1)))) || ((_local1[15] == 1)))){
createGorilla();
};
if ((_local1[13] == 1)){
createRhino();
};
if ((_local1[14] == 1)){
createLeopard();
};
if ((_local1[17] == 1)){
initPowerUpHealth();
};
if ((_local1[18] == 1)){
initPowerUpLife();
};
}
public function createDumbGorilla(_arg1:int){
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = 0;
while (_local2 < _arg1) {
stageGorillaIndex = (stageGorillaIndex + 1);
stageGorillaArray[stageGorillaIndex] = EnemyFactory.getEnemyInstance(5, 1);
_local3 = GParams.stage_Gorilla_Position[(GParams.currentLevel - 1)][0][_local2];
_local4 = GParams.stage_Gorilla_Life[(GParams.currentLevel - 1)][0];
_local5 = GParams.stage_Gorilla_Direction[(GParams.currentLevel - 1)][0][_local2];
stageGorillaArray[stageGorillaIndex].init(_local3, _local4, _local5);
bg1.addChild(stageGorillaArray[stageGorillaIndex]);
_local2++;
};
}
private function createBossLevel1(){
GParams.gamePause = true;
}
private function createBossLevelEnemies(){
if (GParams.currentLevel == 3){
createBossLevel1();
} else {
if (GParams.currentLevel == 6){
createBossLevel2();
} else {
if (GParams.currentLevel == 9){
createBossLevel3();
};
};
};
}
private function createBug(){
if (bug != null){
if (bg1.contains(bug)){
bug.removeAllListener();
bg1.removeChild(bug);
};
};
bug = Bug.getInstance();
bg1.addChild(bug);
bug.init();
}
private function removeOldMongoes(){
var _local1:int;
_local1 = (stageMongoesArray.length - 1);
while (_local1 >= 0) {
if (stageMongoesArray[_local1] != null){
stageMongoesArray[_local1].removeEventListener(Event.ENTER_FRAME, stageMongoesArray[_local1].onEnterFrame);
if (Bg1.bg1.contains(stageMongoesArray[_local1])){
Bg1.bg1.removeChild(stageMongoesArray[_local1]);
};
stageMongoesArray.splice(_local1, 1);
};
_local1--;
};
}
private function createBossLevel3(){
var _local1:Array;
GParams.gamePause = true;
_local1 = GParams.stage_Enemy_Avail[(GParams.currentLevel - 1)];
if ((_local1[16] == 1)){
createSnakeTime();
};
}
public function getBananaInstance(){
stageBananaIndex = (stageBananaIndex + 1);
if (stageBananaIndex == arraySize){
stageBananaIndex = 0;
};
if (stageBananaArray[stageBananaIndex] == null){
stageBananaArray[stageBananaIndex] = new Banana();
};
}
private function removeOldVultures(){
var _local1:int;
_local1 = (stageVultureArray.length - 1);
while (_local1 >= 0) {
if (stageVultureArray[_local1] != null){
stageVultureArray[_local1].removeEventListener(Event.ENTER_FRAME, stageVultureArray[_local1].onEnterFrame);
if (Bg1.bg1.contains(stageVultureArray[_local1])){
Bg1.bg1.removeChild(stageVultureArray[_local1]);
};
stageVultureArray.splice(_local1, 1);
};
_local1--;
};
}
private function removeOldPowerups(){
var _local1:int;
_local1 = (stagePowerUpArray.length - 1);
while (_local1 >= 0) {
if (stagePowerUpArray[_local1] != null){
if (Bg1.bg1.contains(stagePowerUpArray[_local1])){
Bg1.bg1.removeChild(stagePowerUpArray[_local1]);
};
stagePowerUpArray.splice(_local1, 1);
};
_local1--;
};
}
public function getCoconutInstance(){
stageCoconutIndex = (stageCoconutIndex + 1);
if (stageCoconutIndex == 4){
stageCoconutIndex = 0;
};
if (stageCoconutArray[stageCoconutIndex] == null){
stageCoconutArray[stageCoconutIndex] = EnemyFactory.getEnemyInstance(1);
bg1.addChild(stageCoconutArray[stageCoconutIndex]);
stageCoconutArray[stageCoconutIndex].init();
};
}
public function removeWildBoreReference(){
var _local1:uint;
var _local2:AnimalBase;
_local1 = 0;
while (_local1 < stageWildBoreArray.length) {
_local2 = stageWildBoreArray[_local1];
if (_local2.dieStatus){
stageWildBoreArray.splice(_local1, 1);
};
_local1++;
};
}
public function getMongoesInstance(){
var _local1:int;
var _local2:int;
_local1 = GParams.stage_Mongoes_Count[(GParams.currentLevel - 1)][0];
if (_local1 > 0){
createDumbMongoes(_local1);
};
_local2 = GParams.stage_Mongoes_Count[(GParams.currentLevel - 1)][1];
if (_local2 > 0){
createAverageMongoes(_local2);
};
}
public function getSnakeTimeInstance(){
var _local1:int;
_local1 = GParams.stage_SnakeTime_Count[(GParams.currentLevel - 1)][0];
if (_local1 > 0){
createDumbSnakeTime(_local1);
};
}
private function createSurfaceBg(){
if (surfaceBg != null){
surfaceBg.removeClip();
if (bg1.contains(surfaceBg)){
bg1.removeChild(surfaceBg);
};
};
surfaceBg = SurfaceFactory.createInstance();
bg1.addChild(surfaceBg);
surfaceBg.init();
surfaceBg.x = 0;
}
public function removeOldBanana(){
var _local1:*;
_local1 = 0;
while (_local1 < 4) {
if (stageBananaArray[_local1] != null){
if (contains(stageBananaArray[_local1])){
removeChild(stageBananaArray[_local1]);
};
};
_local1++;
};
}
public function createDumbVulture(_arg1:int){
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = 0;
while (_local2 < _arg1) {
stageVultureIndex = (stageVultureIndex + 1);
stageVultureArray[stageVultureIndex] = EnemyFactory.getEnemyInstance(2, 1);
_local3 = GParams.stage_Vulture_Position[(GParams.currentLevel - 1)][0][_local2];
_local4 = GParams.stage_Vulture_Life[(GParams.currentLevel - 1)][0];
_local5 = GParams.stage_Vulture_Direction[(GParams.currentLevel - 1)][0][_local2];
stageVultureArray[stageVultureIndex].init(_local3, _local4, _local5);
bg1.addChild(stageVultureArray[stageVultureIndex]);
_local2++;
};
}
private function createVultures(){
removeOldVultures();
stageVultureIndex = -1;
if (stageVultureArray == null){
stageVultureArray = new Array();
};
getVultureInstance();
}
public function createDumbWildBore(_arg1:int){
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = 0;
while (_local2 < _arg1) {
stageWildBoreIndex = (stageWildBoreIndex + 1);
stageWildBoreArray[stageWildBoreIndex] = EnemyFactory.getEnemyInstance(4, 1);
_local3 = GParams.stage_WildBore_Position[(GParams.currentLevel - 1)][0][_local2];
_local4 = GParams.stage_WildBore_Life[(GParams.currentLevel - 1)][0];
_local5 = GParams.stage_WildBore_Direction[(GParams.currentLevel - 1)][0][_local2];
stageWildBoreArray[stageWildBoreIndex].init(_local3, _local4, _local5);
bg1.addChild(stageWildBoreArray[stageWildBoreIndex]);
_local2++;
};
}
private function createLeopard(){
removeOldLeopard();
stageLeopardIndex = -1;
if (stageLeopardArray == null){
stageLeopardArray = new Array();
};
getLeopardInstance();
}
private function createRhino(){
removeOldRhino();
stageRhinoIndex = -1;
if (stageRhinoArray == null){
stageRhinoArray = new Array();
};
getRhinoInstance();
}
public function createDumbSnakeTime(_arg1:int){
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
_local2 = 0;
while (_local2 < _arg1) {
stageSnakeTimeIndex = (stageSnakeTimeIndex + 1);
stageSnakeTimeArray[stageSnakeTimeIndex] = EnemyFactory.getEnemyInstance(8);
bg1.addChild(stageSnakeTimeArray[stageSnakeTimeIndex]);
stageSnakeTimeArray[stageSnakeTimeIndex].gotoAndStop(1);
_local3 = GParams.stage_SnakeTime_xPosition[(GParams.currentLevel - 1)][0][_local2];
_local4 = GParams.stage_SnakeTime_yPosition[(GParams.currentLevel - 1)][0][_local2];
_local5 = GParams.stage_SnakeTime_Direction[(GParams.currentLevel - 1)][0][_local2];
_local6 = GParams.stage_SnakeTime_Timer[(GParams.currentLevel - 1)][0][_local2];
stageSnakeTimeArray[stageSnakeTimeIndex].init(_local3, _local4, _local5, _local6);
_local2++;
};
}
public function addBanana(_arg1:Object){
getBananaInstance();
bg1.addChild(stageBananaArray[stageBananaIndex]);
stageBananaArray[stageBananaIndex].init(_arg1);
}
public function removeOldSnakeTime(){
var _local1:int;
_local1 = (stageSnakeTimeArray.length - 1);
while (_local1 >= 0) {
if (stageSnakeTimeArray[_local1] != null){
stageSnakeTimeArray[_local1].removeEventListener(Event.ENTER_FRAME, stageSnakeTimeArray[_local1].onEnterFrame);
stageSnakeTimeArray[_local1].gotoAndStop(1);
if (Bg1.bg1.contains(stageSnakeTimeArray[_local1])){
Bg1.bg1.removeChild(stageSnakeTimeArray[_local1]);
};
stageSnakeTimeArray.splice(_local1, 1);
};
_local1--;
};
}
public function getWildBoreInstance(){
var _local1:int;
_local1 = GParams.stage_WildBore_Count[(GParams.currentLevel - 1)][0];
if (_local1 > 0){
createDumbWildBore(_local1);
};
}
public function afterSecond(_arg1:TimerEvent){
getCoconutInstance();
}
public function createSmartGorilla(_arg1:int){
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = 0;
while (_local2 < _arg1) {
stageGorillaIndex = (stageGorillaIndex + 1);
stageGorillaArray[stageGorillaIndex] = EnemyFactory.getEnemyInstance(5, 3);
_local3 = GParams.stage_Gorilla_Position[(GParams.currentLevel - 1)][2][_local2];
_local4 = GParams.stage_Gorilla_Life[(GParams.currentLevel - 1)][0];
_local5 = GParams.stage_Gorilla_Direction[(GParams.currentLevel - 1)][2][_local2];
stageGorillaArray[stageGorillaIndex].init(_local3, _local4, _local5);
bg1.addChild(stageGorillaArray[stageGorillaIndex]);
_local2++;
};
}
private function removeOldLeopard(){
var _local1:int;
_local1 = (stageLeopardArray.length - 1);
while (_local1 >= 0) {
if (stageLeopardArray[_local1] != null){
stageLeopardArray[_local1].removeEventListener(Event.ENTER_FRAME, stageLeopardArray[_local1].onEnterFrame);
if (Bg1.bg1.contains(stageLeopardArray[_local1])){
Bg1.bg1.removeChild(stageLeopardArray[_local1]);
};
stageLeopardArray.splice(_local1, 1);
};
_local1--;
};
}
private function createEagle(){
removeOldEagle();
eagle = Eagle.getInstance();
bg1.addChild(eagle);
eagle.init();
}
private function initPowerUpLife(){
var _local1:PowerUp;
_local1 = stagePowerUpArray[1];
_local1.init(2);
_local1.x = GParams.stage_Powerup_Position[(GParams.currentLevel - 1)][1];
_local1.y = GParams.stage_Powerup_Position[(GParams.currentLevel - 1)][2];
}
public function removeMongoesReference(){
var _local1:uint;
var _local2:AnimalBase;
_local1 = 0;
while (_local1 < stageMongoesArray.length) {
_local2 = stageMongoesArray[_local1];
if (_local2.dieStatus){
stageMongoesArray.splice(_local1, 1);
};
_local1++;
};
}
private function createWildBore(){
removeOldWildBore();
stageWildBoreIndex = -1;
if (stageWildBoreArray == null){
stageWildBoreArray = new Array();
};
getWildBoreInstance();
}
public function timeout(_arg1:TimerEvent){
removeEventListener(TimerEvent.TIMER, afterSecond);
removeEventListener(TimerEvent.TIMER_COMPLETE, timeout);
}
public function getLeopardInstance(){
var _local1:int;
_local1 = GParams.stage_Leopard_Count[(GParams.currentLevel - 1)][0];
if (_local1 > 0){
createDumbLeopard(_local1);
};
}
private function removeOldCoconuts(){
var _local1:Number;
_local1 = 0;
while (_local1 < stageCoconutArray.length) {
if (stageCoconutArray[_local1] != null){
if (bg1.contains(stageCoconutArray[_local1])){
stageCoconutArray[_local1].resetListener();
bg1.removeChild(stageCoconutArray[_local1]);
stageCoconutArray[_local1] = null;
};
};
_local1++;
};
}
private function createSnakeTime(){
removeOldSnakeTime();
stageSnakeTimeIndex = -1;
if (stageSnakeTimeArray == null){
stageSnakeTimeArray = new Array();
};
getSnakeTimeInstance();
}
public function createDumbLeopard(_arg1:int){
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = 0;
while (_local2 < _arg1) {
stageLeopardIndex = (stageLeopardIndex + 1);
stageLeopardArray[stageLeopardIndex] = EnemyFactory.getEnemyInstance(7, 1);
bg1.addChild(stageLeopardArray[stageLeopardIndex]);
_local3 = GParams.stage_Leopard_Position[(GParams.currentLevel - 1)][0][_local2];
_local4 = GParams.stage_Leopard_Life[(GParams.currentLevel - 1)][0];
_local5 = GParams.stage_Leopard_Direction[(GParams.currentLevel - 1)][0][_local2];
stageLeopardArray[stageLeopardIndex].init(_local3, _local4, _local5);
_local2++;
};
}
private function removeOldEagle2(){
if (eagle2 != null){
if (bg1.contains(eagle2)){
eagle2.removeAllListener();
bg1.removeChild(eagle2);
eagle2 = null;
};
};
}
private function removeOldWildBore(){
var _local1:int;
_local1 = (stageWildBoreArray.length - 1);
while (_local1 >= 0) {
if (stageWildBoreArray[_local1] != null){
stageWildBoreArray[_local1].removeEventListener(Event.ENTER_FRAME, stageWildBoreArray[_local1].onEnterFrame);
if (Bg1.bg1.contains(stageWildBoreArray[_local1])){
Bg1.bg1.removeChild(stageWildBoreArray[_local1]);
};
stageWildBoreArray.splice(_local1, 1);
};
_local1--;
};
}
private function createCoconuts(){
var _local1:Number;
var _local2:Timer;
removeOldCoconuts();
stageCoconutArray = new Array(4);
stageCoconutIndex = -1;
_local1 = 0;
while (_local1 < stageCoconutArray.length) {
stageCoconutArray[_local1] = null;
_local1++;
};
_local2 = new Timer(3000, 4);
_local2.addEventListener(TimerEvent.TIMER, afterSecond);
_local2.addEventListener(TimerEvent.TIMER_COMPLETE, timeout);
_local2.reset();
_local2.stop();
_local2.start();
}
public function createAverageGorilla(_arg1:int){
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = 0;
while (_local2 < _arg1) {
stageGorillaIndex = (stageGorillaIndex + 1);
stageGorillaArray[stageGorillaIndex] = EnemyFactory.getEnemyInstance(5, 2);
_local3 = GParams.stage_Gorilla_Position[(GParams.currentLevel - 1)][1][_local2];
_local4 = GParams.stage_Gorilla_Life[(GParams.currentLevel - 1)][0];
_local5 = GParams.stage_Gorilla_Direction[(GParams.currentLevel - 1)][1][_local2];
stageGorillaArray[stageGorillaIndex].init(_local3, _local4, _local5);
bg1.addChild(stageGorillaArray[stageGorillaIndex]);
_local2++;
};
}
public function removeGorillaReference(){
var _local1:uint;
var _local2:AnimalBase;
_local1 = 0;
while (_local1 < stageGorillaArray.length) {
_local2 = stageGorillaArray[_local1];
if (_local2.dieStatus){
stageGorillaArray.splice(_local1, 1);
};
_local1++;
};
}
public function removeRhinoReference(){
var _local1:uint;
var _local2:AnimalBase;
_local1 = 0;
while (_local1 < stageRhinoArray.length) {
_local2 = stageRhinoArray[_local1];
if (_local2.dieStatus){
stageRhinoArray.splice(_local1, 1);
};
_local1++;
};
}
private function removeOldRhino(){
var _local1:int;
_local1 = (stageRhinoArray.length - 1);
while (_local1 >= 0) {
if (stageRhinoArray[_local1] != null){
stageRhinoArray[_local1].removeEventListener(Event.ENTER_FRAME, stageRhinoArray[_local1].onEnterFrame);
if (Bg1.bg1.contains(stageRhinoArray[_local1])){
Bg1.bg1.removeChild(stageRhinoArray[_local1]);
};
stageRhinoArray.splice(_local1, 1);
};
_local1--;
};
}
public function removeSnakeTimeReference(){
var _local1:uint;
var _local2:SnakeTime;
_local1 = 0;
while (_local1 < stageSnakeTimeArray.length) {
_local2 = stageSnakeTimeArray[_local1];
if (_local2.dieStatus){
stageSnakeTimeArray.splice(_local1, 1);
};
_local1++;
};
}
private function removeOldEagle(){
if (eagle != null){
if (bg1.contains(eagle)){
eagle.removeAllListener();
bg1.removeChild(eagle);
eagle = null;
};
};
}
public function removeVultureReference(){
var _local1:uint;
var _local2:AnimalBase;
_local1 = 0;
while (_local1 < stageVultureArray.length) {
_local2 = stageVultureArray[_local1];
if (_local2.dieStatus){
stageVultureArray.splice(_local1, 1);
};
_local1++;
};
}
private function createEagle2(){
removeOldEagle2();
eagle2 = Eagle2.getInstance();
bg1.addChild(eagle2);
eagle2.init();
}
private function initPowerUpHealth(){
var _local1:PowerUp;
_local1 = stagePowerUpArray[0];
_local1.init(1);
_local1.x = GParams.stage_Powerup_Position[(GParams.currentLevel - 1)][1];
_local1.y = GParams.stage_Powerup_Position[(GParams.currentLevel - 1)][2];
}
private function createGorilla(){
removeOldGorilla();
stageGorillaIndex = -1;
if (stageGorillaArray == null){
stageGorillaArray = new Array();
};
getGorillaInstance();
}
public function createAverageVulture(_arg1:int){
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = 0;
while (_local2 < _arg1) {
stageVultureIndex = (stageVultureIndex + 1);
stageVultureArray[stageVultureIndex] = EnemyFactory.getEnemyInstance(2, 2);
bg1.addChild(stageVultureArray[stageVultureIndex]);
_local3 = GParams.stage_Vulture_Position[(GParams.currentLevel - 1)][1][_local2];
_local4 = GParams.stage_Vulture_Life[(GParams.currentLevel - 1)][0];
_local5 = GParams.stage_Vulture_Direction[(GParams.currentLevel - 1)][1][_local2];
stageVultureArray[stageVultureIndex].init(_local3, _local4, _local5);
_local2++;
};
}
private function createSnake(){
snake = Snake.getInstance();
bg1.addChild(snake);
snake.init();
}
public function createDumbMongoes(_arg1:int){
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = 0;
while (_local2 < _arg1) {
stageMongoesIndex = (stageMongoesIndex + 1);
stageMongoesArray[stageMongoesIndex] = EnemyFactory.getEnemyInstance(3, 1);
_local3 = GParams.stage_Mongoes_Position[(GParams.currentLevel - 1)][0][_local2];
_local4 = GParams.stage_Mongoes_Life[(GParams.currentLevel - 1)][0];
_local5 = GParams.stage_Mongoes_Direction[(GParams.currentLevel - 1)][0][_local2];
stageMongoesArray[stageMongoesIndex].init(_local3, _local4, _local5);
bg1.addChild(stageMongoesArray[stageMongoesIndex]);
_local2++;
};
}
public function getGorillaInstance(){
var _local1:int;
var _local2:int;
var _local3:int;
_local1 = GParams.stage_Gorilla_Count[(GParams.currentLevel - 1)][0];
if (_local1 > 0){
createDumbGorilla(_local1);
};
_local2 = GParams.stage_Gorilla_Count[(GParams.currentLevel - 1)][1];
if (_local2 > 0){
createAverageGorilla(_local2);
};
_local3 = GParams.stage_Gorilla_Count[(GParams.currentLevel - 1)][2];
if (_local3 > 0){
createSmartGorilla(_local3);
};
}
private function removeOldGorilla(){
var _local1:int;
_local1 = (stageGorillaArray.length - 1);
while (_local1 >= 0) {
if (stageGorillaArray[_local1] != null){
stageGorillaArray[_local1].removeEventListener(Event.ENTER_FRAME, stageGorillaArray[_local1].onEnterFrame);
if (Bg1.bg1.contains(stageGorillaArray[_local1])){
Bg1.bg1.removeChild(stageGorillaArray[_local1]);
};
stageGorillaArray.splice(_local1, 1);
};
_local1--;
};
}
public function createAverageMongoes(_arg1:int){
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = 0;
while (_local2 < _arg1) {
stageMongoesIndex = (stageMongoesIndex + 1);
stageMongoesArray[stageMongoesIndex] = EnemyFactory.getEnemyInstance(3, 2);
_local3 = GParams.stage_Mongoes_Position[(GParams.currentLevel - 1)][1][_local2];
_local4 = GParams.stage_Mongoes_Life[(GParams.currentLevel - 1)][0];
_local5 = GParams.stage_Mongoes_Direction[(GParams.currentLevel - 1)][1][_local2];
stageMongoesArray[stageMongoesIndex].init(_local3, _local4, _local5);
bg1.addChild(stageMongoesArray[stageMongoesIndex]);
_local2++;
};
}
private function removeOldSnake(){
if (snake != null){
if (bg1.contains(snake)){
snake.removeAllListener();
bg1.removeChild(snake);
snake = null;
};
};
}
public function clearGraphics(){
removeOldSnake();
removeOldEagle();
removeOldEagle2();
removeOldVultures();
removeOldMongoes();
removeOldWildBore();
removeOldGorilla();
removeOldLeopard();
removeOldRhino();
removeOldBanana();
removeOldSnakeTime();
removeOldCoconuts();
removeOldPowerups();
}
public static function getInstance():Bg1{
if (bg1 == null){
bg1 = new (Bg1);
};
return (bg1);
}
}
}//package
Section 60
//BGSound (BGSound)
package {
import flash.media.*;
public class BGSound extends Sound {
}
}//package
Section 61
//Bhala (Bhala)
package {
import flash.events.*;
import flash.display.*;
public class Bhala extends MovieClip {
var throwProgressStatus:Boolean;// = false
var throwX:Number;// = 0
var throwY:Number;// = 0
var startX:Number;
var startY:Number;
var throwDirection:Number;
var gravity:Number;// = 0.1
var speed:Number;
var halfWidth:int;// = 10
public var hitClip:MovieClip;
var prevY:Number;
var halfHeight:int;// = 5
var prevX:Number;
var throwUpStatus:Boolean;// = false
var throwDownStatus:Boolean;// = false
var endX:Number;
var endY:Number;
public static var bhala:Bhala = null;
public function Bhala(){
halfWidth = 10;
halfHeight = 5;
throwY = 0;
throwX = 0;
gravity = 0.1;
throwUpStatus = false;
throwProgressStatus = false;
throwDownStatus = false;
super();
}
function init(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
startX = Hunter1.hunter1.x;
startY = (Hunter1.hunter1.y - Hunter1.hunter1.halfHeight);
endX = Monkey.monkey.stagePosition.x;
endY = (Monkey.monkey.stagePosition.y + 25);
speed = 13;
throwProgressStatus = true;
throwUpStatus = true;
throwDownStatus = false;
x = startX;
y = startY;
_local1 = (endX - x);
_local2 = (endY - y);
_local3 = Math.atan2(_local2, _local1);
_local4 = Math.ceil(((_local3 / Math.PI) * 180));
throwX = (Math.cos(_local3) * speed);
throwY = (Math.sin(_local3) * speed);
rotation = _local4;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function checkMonkeyCollision(){
var _local1:Monkey;
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local1 = Monkey.monkey;
if (_local1 != null){
_local2 = (_local1.x - x);
_local3 = (_local1.y - y);
_local4 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
if (this.hitClip.hitTestObject(_local1.body)){
_local1.hit_Bhala();
removeBhala();
return;
};
};
}
public function removeBhala(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
if (this.parent.contains(this)){
this.parent.removeChild(this);
};
}
private function onEnterFrame(_arg1:Event){
Move();
checkMonkeyCollision();
}
private function Move(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
if (throwUpStatus){
prevX = x;
prevY = y;
x = (x + throwX);
y = (y + throwY);
_local1 = (prevX - x);
_local2 = (prevY - y);
_local3 = Math.atan2(_local2, _local1);
_local4 = Math.ceil(((_local3 / Math.PI) * 180));
rotation = (_local4 + 180);
};
}
public static function getInstance():Bhala{
if (bhala == null){
bhala = new (Bhala);
};
return (bhala);
}
}
}//package
Section 62
//BreakingSlider (BreakingSlider)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class BreakingSlider extends Sprite {
var typeNum:Number;
var halfHeight:Number;
var timer:Timer;
var speed:Number;
var inity:Number;
var refClip:MovieClip;
var endPos:Number;
var animationStatus:Boolean;// = true
var startPos:Number;
var inActive:Boolean;// = true
var dist:Number;
var dir:Number;
var timeNum:Number;
public function BreakingSlider(){
inActive = true;
animationStatus = true;
super();
}
public function init(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number){
refClip = _arg1;
dir = _arg2;
inity = refClip.y;
timeNum = _arg6;
animationStatus = true;
typeNum = 2;
refClip.gotoAndStop("make");
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function moveSlider(){
if (animationStatus){
checkAnimation();
return;
};
}
public function checkSliderCollision():Boolean{
if (refClip.hitTestPoint(Monkey.monkey.stagePosition.x, ((Monkey.monkey.stagePosition.y + Monkey.monkey.halfHeight) + 2), true)){
return (true);
};
return (false);
}
public function removeClip(){
timer.stop();
timer.removeEventListener(TimerEvent.TIMER_COMPLETE, changeDirection);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function checkAnimation(){
if (dir == 0){
if (refClip.currentLabel == "break"){
if (refClip.breakMc != null){
if (refClip.breakMc.currentFrame > 20){
refClip.breakMc.gotoAndStop(1);
animationStatus = false;
refClip.gotoAndStop("blank");
timer = new Timer(timeNum, 1);
timer.addEventListener(TimerEvent.TIMER_COMPLETE, changeDirection);
timer.reset();
timer.start();
return;
};
};
};
};
if (dir == 1){
if (refClip.currentLabel == "make"){
if (refClip.makeMc != null){
if (refClip.makeMc.currentFrame >= 50){
refClip.makeMc.gotoAndStop(1);
animationStatus = false;
refClip.gotoAndStop("still");
timer = new Timer(timeNum, 1);
timer.addEventListener(TimerEvent.TIMER_COMPLETE, changeDirection);
timer.reset();
timer.start();
return;
};
};
};
};
}
public function onEnterFrame(_arg1:Event){
moveSlider();
}
private function changeDirection(_arg1:TimerEvent){
timer.removeEventListener(TimerEvent.TIMER_COMPLETE, changeDirection);
if (dir == 1){
animationStatus = true;
dir = 0;
refClip.gotoAndStop("break");
} else {
if (dir == 0){
animationStatus = true;
dir = 1;
refClip.gotoAndStop("make");
};
};
}
}
}//package
Section 63
//Bug (Bug)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Bug extends MovieClip {
public var timer:Timer;
private var speed:Number;// = 2
public var halfWidth:Number;// = 10
private var dy:Number;// = 100
public var halfHeight:Number;// = 15
private var positionArray:Array;
private var moveDirection:Number;// = -1
private var isActive:Boolean;// = false
private var targetY:Number;// = 500
public static var bug:Bug = null;
public function Bug(){
positionArray = new Array(4);
halfWidth = 10;
halfHeight = 15;
dy = 100;
targetY = 500;
speed = 2;
moveDirection = -1;
isActive = false;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function init(){
positionBug();
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function setTimer(){
timer = new Timer(2000);
timer.addEventListener(TimerEvent.TIMER, afterSecond);
timer.reset();
timer.stop();
timer.start();
}
function frame3(){
stop();
}
public function removeAllListener(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
timer.removeEventListener(TimerEvent.TIMER, afterSecond);
}
private function afterSecond(_arg1:TimerEvent){
changeMoveDirection();
timer.removeEventListener(TimerEvent.TIMER, afterSecond);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
private function positionBug(){
if (!isActive){
y = 700;
x = 170;
scaleY = 1;
gotoAndStop("walk");
isActive = true;
};
}
private function setYPos(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local1 = (Monkey.monkey.actualPosition.y - 40);
_local2 = 0;
while (_local2 < 4) {
positionArray[_local2] = Math.floor((_local1 - ((_local2 - 1) * dy)));
trace(("positionArray :" + positionArray[_local2]));
_local2++;
};
_local3 = Math.floor((Math.random() * 10));
if (_local3 < 5){
y = positionArray[1];
} else {
_local4 = Math.floor((Math.random() * 3));
y = positionArray[_local4];
};
}
private function onEnterFrame(_arg1:Event){
if (isActive){
if (moveDirection == 1){
scaleY = -1;
if (y < targetY){
y = (y + speed);
} else {
setTimer();
gotoAndStop("stand");
isActive = false;
};
} else {
if (moveDirection == -1){
scaleY = 1;
if (y > targetY){
y = (y - speed);
} else {
setTimer();
gotoAndStop("stand");
isActive = false;
};
};
};
};
}
public function changeMoveDirection(){
if (moveDirection == 1){
targetY = 500;
moveDirection = -1;
rotation = 0;
gotoAndStop("walk");
isActive = true;
} else {
rotation = 0;
targetY = 700;
moveDirection = 1;
gotoAndStop("walk");
isActive = true;
};
}
public static function getInstance():Bug{
if (bug == null){
bug = new (Bug);
};
return (bug);
}
}
}//package
Section 64
//Coconut (Coconut)
package {
import flash.events.*;
import flash.display.*;
public class Coconut extends Enemy {
public var typeNum:Number;// = 1
public var counter:Number;
public var maxCounter:Number;
private var speedx:Number;
private var path:Array;
private var line:Number;
private var speedy:Number;
public var blastStatus:Boolean;// = false
public var halfWidth:Number;
private var maxLine:Number;
public var hitStatus:Boolean;// = false
private var movementType:Number;// = 1
public var halfHeight:Number;
private var nextTargetPosition:Number;
public var isActive:Boolean;// = false
public var breakStatus:Boolean;// = false
public var break_mc:MovieClip;
private var randomPathNum:Number;
private var xDirection:Number;// = -1
public static var powerUpClip:Boolean = false;
private static var coconut:Coconut = null;
public function Coconut(){
movementType = 1;
xDirection = -1;
typeNum = 1;
isActive = false;
hitStatus = false;
blastStatus = false;
breakStatus = false;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6);
}
public function init(){
var _local1:Number;
typeNum = 1;
gotoAndStop(1);
blastStatus = false;
breakStatus = false;
path = GParams.game_Coconut_Path[(GParams.currentLevel - 1)];
maxCounter = GParams.stage_Coconut_Count[(GParams.currentLevel - 1)];
_local1 = Math.floor((maxCounter / 2));
counter = Math.floor((Math.random() * _local1));
randomPathNum = Math.floor((Math.random() * path.length));
x = path[randomPathNum][0];
y = -250;
halfWidth = 10;
halfHeight = 10;
line = 1;
isActive = false;
maxLine = path[randomPathNum].length;
movementType = 1;
speedy = 5;
speedx = (1 + Math.floor((Math.random() * 3)));
nextTargetPosition = path[randomPathNum][line];
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function resetListener(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
function frame3(){
stop();
}
function frame6(){
stop();
}
private function moveVertical(){
if ((y + halfHeight) < nextTargetPosition){
y = (y + speedy);
rotation = (rotation + 15);
} else {
y = (nextTargetPosition - halfHeight);
movementType = 0;
line++;
nextTargetPosition = path[randomPathNum][line];
if (nextTargetPosition > x){
xDirection = 1;
} else {
xDirection = -1;
};
};
}
function frame1(){
stop();
}
function frame5(){
stop();
}
private function moveCoconut(){
if (!breakStatus){
if (movementType == 1){
moveVertical();
};
if (movementType == 0){
moveHorizontal();
};
};
}
function frame2(){
stop();
}
private function onEnterFrame(_arg1:Event){
breakCoconut();
if (MainClass.powerUpStatus){
MainClass.powerUpStatus = false;
};
if (blastStatus){
resetListener();
counter = 0;
init();
return;
};
if (breakStatus){
if (currentLabel == "break"){
rotation = 0;
if (this.break_mc != null){
if (this.break_mc.currentFrame >= 19){
breakStatus = false;
};
};
};
};
if (!hitStatus){
speedx = (1 + Math.floor((Math.random() * 3)));
} else {
speedx = (speedx + 1);
hitStatus = false;
};
if (!isActive){
if (counter < maxCounter){
counter++;
return;
};
counter = maxCounter;
isActive = true;
};
if (isActive){
if (line < maxLine){
moveCoconut();
} else {
resetListener();
counter = 0;
init();
};
};
}
private function breakCoconut(){
var _local1:Number;
if (!breakStatus){
if (typeNum == 3){
_local1 = Math.abs((y - Monkey.monkey.actualPosition.y));
if (movementType == 0){
if (_local1 < 100){
isActive = false;
breakStatus = true;
gotoAndStop("break");
};
};
};
};
}
private function moveHorizontal(){
if (xDirection == 1){
if (x < nextTargetPosition){
x = (x + speedx);
rotation = (rotation + (speedx * 5));
} else {
x = nextTargetPosition;
movementType = 1;
line++;
nextTargetPosition = path[randomPathNum][line];
};
};
if (xDirection == -1){
if (x > nextTargetPosition){
x = (x - speedx);
rotation = (rotation - (speedx * 5));
} else {
x = nextTargetPosition;
movementType = 1;
line++;
nextTargetPosition = path[randomPathNum][line];
};
};
}
function frame4(){
stop();
}
public static function getInstance():Coconut{
return (new (Coconut));
}
}
}//package
Section 65
//Eagle (Eagle)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Eagle extends MovieClip {
public var timer:Timer;
private var speed:Number;// = 8
public var health:Number;// = 30
public var halfWidth:Number;// = 10
public var hitClip:MovieClip;
private var dy:Number;// = 100
public var halfHeight:Number;// = 15
private var dieStatus:Boolean;
private var positionArray:Array;
private var moveDirection:Number;
private var isActive:Boolean;// = false
private var targetX:Number;
private var hitBananaStatus:Boolean;
public var dieClip:MovieClip;
public static var eagle:Eagle = null;
public function Eagle(){
positionArray = new Array(4);
halfWidth = 10;
halfHeight = 15;
health = 30;
dy = 100;
speed = 8;
isActive = false;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
}
public function init(){
var _local1:Number;
dieStatus = false;
hitBananaStatus = false;
_local1 = GParams.stage_Eagle_Timer[(GParams.currentLevel - 1)];
x = -500;
y = -500;
timer = new Timer(_local1);
timer.addEventListener(TimerEvent.TIMER, afterSecond);
timer.reset();
timer.stop();
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function positionEagle(){
if (!isActive){
setMoveDirection();
setYPos();
isActive = true;
};
}
function frame3(){
stop();
}
public function removeAllListener(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
timer.removeEventListener(TimerEvent.TIMER, afterSecond);
}
private function afterSecond(_arg1:TimerEvent){
positionEagle();
timer.removeEventListener(TimerEvent.TIMER, afterSecond);
}
function frame4(){
stop();
}
function frame1(){
stop();
}
private function setMoveDirection(){
var _local1:Number;
_local1 = Math.floor((Math.random() * 2));
if (_local1 == 0){
x = 650;
targetX = -50;
moveDirection = -1;
} else {
x = -50;
targetX = 650;
moveDirection = 1;
};
}
function frame2(){
stop();
}
private function setYPos(){
var _local1:Number;
_local1 = (Monkey.monkey.actualPosition.y - 40);
y = _local1;
}
private function changeDirection(){
if (moveDirection == 1){
targetX = -50;
moveDirection = -1;
} else {
targetX = 650;
moveDirection = 1;
};
}
public function hit_Banana(){
if (health > 0){
hitBananaStatus = true;
gotoAndStop(3);
} else {
dieStatus = true;
gotoAndStop(4);
};
}
private function onEnterFrame(_arg1:Event){
if (!isActive){
if (Monkey.monkey.currentLineIndex == 12){
timer.start();
return;
};
};
if (hitBananaStatus){
if (currentFrame == 3){
if (this.hitClip != null){
if (this.hitClip.currentFrame >= 6){
this.hitClip.gotoAndStop(1);
gotoAndStop(2);
hitBananaStatus = false;
changeDirection();
};
};
};
return;
};
if (dieStatus){
if (currentFrame == 4){
if (this.dieClip != null){
if (this.dieClip.currentFrame >= 7){
this.dieClip.gotoAndStop(1);
gotoAndStop(2);
hitBananaStatus = false;
};
};
};
return;
};
if (isActive){
if (moveDirection == 1){
scaleX = -1;
if (x < targetX){
x = (x + speed);
} else {
isActive = false;
};
} else {
if (moveDirection == -1){
scaleX = 1;
if (x > targetX){
x = (x - speed);
} else {
isActive = false;
};
};
};
};
}
public static function getInstance():Eagle{
if (eagle == null){
eagle = new (Eagle);
};
return (eagle);
}
}
}//package
Section 66
//Eagle2 (Eagle2)
package {
import flash.events.*;
import flash.display.*;
public class Eagle2 extends MovieClip {
private var timerCounter:Number;// = 0
private var resetInterval:Number;
private var speed:Number;// = 8
public var health:Number;// = 70
public var halfWidth:Number;// = 10
public var hitClip:MovieClip;
public var stone:Stone;// = null
private var dy:Number;// = 100
public var halfHeight:Number;// = 20
private var dieStatus:Boolean;// = false
private var positionArray:Array;
private var moveDirection:Number;
private var lineArray:Array;
private var targetY:Number;
private var timerCounterMax:Number;// = 0
private var targetX:Number;
private var hitBananaStatus:Boolean;// = false
public var lineNum:Number;
private var isActive:Boolean;// = false
public var dieClip:MovieClip;
public static var eagle2:Eagle2 = null;
public function Eagle2(){
positionArray = new Array(4);
halfWidth = 10;
halfHeight = 20;
health = 70;
dy = 100;
speed = 8;
hitBananaStatus = false;
dieStatus = false;
isActive = false;
timerCounter = 0;
timerCounterMax = 0;
stone = null;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
}
public function init(){
x = 700;
y = 1200;
targetX = 500;
targetY = 640;
health = 40;
resetInterval = 7000;
timerCounter = 0;
timerCounterMax = 120;
hitBananaStatus = false;
dieStatus = false;
isActive = true;
gotoAndStop("fly");
scaleX = -1;
lineArray = GParams.game_Path_Dimension[(GParams.currentLevel - 1)];
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function removeClip(){
x = 700;
y = 1200;
removeAllListener();
Bg1.bg1.removeChild(this);
}
private function positionEagle2(){
var _local1:int;
var _local2:uint;
var _local3:int;
var _local4:int;
_local1 = 0;
_local2 = Math.floor((Math.random() * 10));
if ((((_local2 < 5)) && ((((((Monkey.monkey.action == 0)) || ((Monkey.monkey.action == 1)))) || ((Monkey.monkey.action == 2)))))){
targetX = Monkey.monkey.x;
targetY = lineArray[lineNum][1];
} else {
_local3 = (lineNum - 4);
if (_local3 < 0){
_local3 = 0;
};
_local4 = (lineNum + 4);
if (_local4 >= lineArray.length){
_local4 = (lineArray.length - 1);
_local1 = _local4;
} else {
_local1 = (Math.floor((Math.random() * _local4)) + _local3);
if (_local1 >= lineArray.length){
_local1 = (lineArray.length - 1);
};
};
targetY = lineArray[_local1][1];
targetX = (lineArray[_local1][0] + Math.floor((lineArray[_local1][2] / 2)));
};
if (x > targetX){
scaleX = -1;
} else {
scaleX = 1;
};
gotoAndStop("fly");
trace(("monkey line =" + lineNum));
isActive = true;
}
function frame3(){
stop();
}
public function removeAllListener(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
function frame4(){
stop();
}
function frame1(){
stop();
}
public function changeDirection(){
if (timerCounter >= timerCounterMax){
timerCounter = 0;
positionEagle2();
};
}
public function hit_Banana(){
health = (health - 8);
if (health > 0){
hitBananaStatus = true;
gotoAndStop(3);
} else {
if (!dieStatus){
hitBananaStatus = false;
MainClass.gameScore = (MainClass.gameScore + GParams.EAGLEDUMBSCORE);
ScoreClip.scoreClip.updateScore();
dieStatus = true;
gotoAndStop(4);
};
};
}
function frame2(){
stop();
}
private function onEnterFrame(_arg1:Event){
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
lineNum = Monkey.monkey.currentLineIndex;
if (((!(isActive)) && (!(dieStatus)))){
timerCounter++;
if (timerCounter > timerCounterMax){
trace("positioning eagle");
positionEagle2();
return;
};
};
if (hitBananaStatus){
if (currentFrame == 3){
if (this.hitClip != null){
if (this.hitClip.currentFrame >= 13){
this.hitClip.gotoAndStop(1);
gotoAndStop(2);
hitBananaStatus = false;
changeDirection();
};
};
};
return;
};
if (dieStatus){
if (currentFrame == 4){
if (this.dieClip != null){
if (this.dieClip.currentFrame >= 6){
this.dieClip.gotoAndStop(1);
hitBananaStatus = false;
removeClip();
dieStatus = false;
};
};
};
return;
};
if ((((lineNum <= 8)) || ((Monkey.monkey.action == 6)))){
if ((((x < 700)) && ((y < 1200)))){
x = (x + 7);
y = (y + 7);
scaleX = 1;
} else {
if (x >= 700){
scaleX = -1;
};
};
return;
};
if (lineNum > 8){
if (!dieStatus){
if (isActive){
_local2 = (targetX - x);
_local3 = (targetY - y);
_local4 = Math.atan2(_local3, _local2);
_local5 = Math.ceil(((_local4 / Math.PI) * 180));
_local6 = Math.cos(((_local5 / 180) * Math.PI));
_local7 = Math.sin(((_local5 / 180) * Math.PI));
_local8 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
if (_local8 > 10){
x = (x + ((speed - 1) * _local6));
y = (y + (12 * _local7));
} else {
y = (targetY - halfHeight);
gotoAndStop("fly");
isActive = false;
};
} else {
if (x > Monkey.monkey.actualPosition.x){
scaleX = -1;
} else {
scaleX = 1;
};
_local9 = (Monkey.monkey.x - x);
if (Math.abs(_local9) < 10){
changeDirection();
};
};
};
};
}
private function createStone(){
if (stone != null){
if (this.parent.contains(stone)){
Stone.stone.removeStone();
};
};
stone = Stone.getInstance();
this.parent.addChild(stone);
stone.init();
}
public static function getInstance():Eagle2{
if (eagle2 == null){
eagle2 = new (Eagle2);
};
return (eagle2);
}
}
}//package
Section 67
//Enemy (Enemy)
package {
import flash.display.*;
public class Enemy extends MovieClip {
}
}//package
Section 68
//EnemyFactory (EnemyFactory)
package {
public class EnemyFactory {
private static var wildBoreDumbIndex:Number = -1;
private static var mongoesAverageArray:Array = new Array(4);
private static var enemy:Enemy;
private static var wildBoreDumbArray:Array = new Array(4);
private static var mongoesDumbIndex:Number = -1;
private static var vultureDumbIndex:Number = -1;
private static var mongoesDumbArray:Array = new Array(4);
private static var vultureDumbArray:Array = new Array(arraySize);
private static var leopardDumbIndex:Number = -1;
private static var leopardDumbArray:Array = new Array(4);
private static var coconutIndex:Number = -1;
private static var gorillaSmartArray:Array = new Array(4);
private static var gorillaSmartIndex:Number = -1;
private static var coconutArray:Array = new Array(4);
private static var snakeTimeIndex:Number = -1;
private static var snakeTimeArray:Array = new Array(arraySize);
private static var gorillaAverageIndex:Number = -1;
private static var gorillaAverageArray:Array = new Array(4);
private static var gorillaDumbIndex:Number = -1;
private static var gorillaDumbArray:Array = new Array(4);
private static var vultureAverageIndex:Number = -1;
private static var vultureAverageArray:Array = new Array(arraySize);
private static var mongoesAverageIndex:Number = -1;
private static var rhinoDumbIndex:Number = -1;
private static var arraySize:Number = 6;
private static var rhinoDumbArray:Array = new Array(4);
public static function getVultureInstance(_arg1:uint):Enemy{
switch (_arg1){
case 1:
return (getDumbVultureInstance());
case 2:
return (getAverageVultureInstance());
default:
return (null);
};
}
public static function getEnemyInstance(_arg1:Number, _arg2:Number=0):Enemy{
switch (_arg1){
case 1:
enemy = getCoconutInstance();
return (enemy);
case 2:
enemy = getVultureInstance(_arg2);
return (enemy);
case 3:
enemy = getMongoesInstance(_arg2);
return (enemy);
case 4:
enemy = getWildBoreInstance(_arg2);
return (enemy);
case 5:
enemy = getGorillaInstance(_arg2);
return (enemy);
case 6:
enemy = getRhinoInstance(_arg2);
return (enemy);
case 7:
enemy = getLeopardInstance(_arg2);
return (enemy);
case 8:
enemy = getSnakeTimeInstance();
return (enemy);
};
return (null);
}
public static function getSmartGorillaInstance():GorillaSmart{
gorillaSmartIndex = (gorillaSmartIndex + 1);
if (gorillaSmartIndex == 4){
gorillaSmartIndex = 0;
};
if (gorillaSmartArray[gorillaSmartIndex] == null){
gorillaSmartArray[gorillaSmartIndex] = new GorillaSmart();
};
return (gorillaSmartArray[gorillaSmartIndex]);
}
public static function getMongoesInstance(_arg1:uint):Enemy{
switch (_arg1){
case 1:
return (getDumbMongoesInstance());
case 2:
return (getAverageMongoesInstance());
default:
return (null);
};
}
public static function getDumbGorillaInstance():GorillaDumb{
gorillaDumbIndex = (gorillaDumbIndex + 1);
if (gorillaDumbIndex == 4){
gorillaDumbIndex = 0;
};
if (gorillaDumbArray[gorillaDumbIndex] == null){
gorillaDumbArray[gorillaDumbIndex] = new GorillaDumb();
};
return (gorillaDumbArray[gorillaDumbIndex]);
}
public static function getDumbRhinoInstance():RhinoDumb{
rhinoDumbIndex = (rhinoDumbIndex + 1);
if (rhinoDumbIndex == 4){
rhinoDumbIndex = 0;
};
if (rhinoDumbArray[rhinoDumbIndex] == null){
rhinoDumbArray[rhinoDumbIndex] = new RhinoDumb();
};
return (rhinoDumbArray[rhinoDumbIndex]);
}
public static function getAverageGorillaInstance():GorillaAverage{
gorillaAverageIndex = (gorillaAverageIndex + 1);
if (gorillaAverageIndex == 4){
gorillaAverageIndex = 0;
};
if (gorillaAverageArray[gorillaAverageIndex] == null){
gorillaAverageArray[gorillaAverageIndex] = new GorillaAverage();
};
return (gorillaAverageArray[gorillaAverageIndex]);
}
public static function getDumbLeopardInstance():LeopardDumb{
leopardDumbIndex = (leopardDumbIndex + 1);
if (leopardDumbIndex == 4){
leopardDumbIndex = 0;
};
if (leopardDumbArray[leopardDumbIndex] == null){
leopardDumbArray[leopardDumbIndex] = new LeopardDumb();
};
return (leopardDumbArray[leopardDumbIndex]);
}
public static function getAverageMongoesInstance():MongoesAverage{
mongoesAverageIndex = (mongoesAverageIndex + 1);
if (mongoesAverageIndex == mongoesAverageArray.length){
mongoesAverageIndex = 0;
};
if (mongoesAverageArray[mongoesAverageIndex] == null){
mongoesAverageArray[mongoesAverageIndex] = new MongoesAverage();
};
return (mongoesAverageArray[mongoesAverageIndex]);
}
public static function getCoconutInstance():Enemy{
coconutIndex = (coconutIndex + 1);
if (coconutIndex == 4){
coconutIndex = 0;
};
if (coconutArray[coconutIndex] == null){
coconutArray[coconutIndex] = Coconut.getInstance();
};
return (coconutArray[coconutIndex]);
}
public static function getSnakeTimeInstance():Enemy{
snakeTimeIndex = (snakeTimeIndex + 1);
if (snakeTimeIndex == arraySize){
snakeTimeIndex = 0;
};
if (snakeTimeArray[snakeTimeIndex] == null){
snakeTimeArray[snakeTimeIndex] = new SnakeTime();
};
return (snakeTimeArray[snakeTimeIndex]);
}
private static function getDumbVultureInstance():VultureDumb{
vultureDumbIndex = (vultureDumbIndex + 1);
if (vultureDumbIndex == arraySize){
vultureDumbIndex = 0;
};
if (vultureDumbArray[vultureDumbIndex] == null){
vultureDumbArray[vultureDumbIndex] = new VultureDumb();
};
return (vultureDumbArray[vultureDumbIndex]);
}
public static function getLeopardInstance(_arg1:uint):Enemy{
switch (_arg1){
case 1:
return (getDumbLeopardInstance());
default:
return (null);
};
}
private static function getAverageVultureInstance():VultureAverage{
vultureAverageIndex = (vultureAverageIndex + 1);
if (vultureAverageIndex == arraySize){
vultureAverageIndex = 0;
};
if (vultureAverageArray[vultureAverageIndex] == null){
vultureAverageArray[vultureAverageIndex] = new VultureAverage();
};
return (vultureAverageArray[vultureAverageIndex]);
}
public static function getWildBoreInstance(_arg1:uint):Enemy{
switch (_arg1){
case 1:
return (getDumbWildBoreInstance());
default:
return (null);
};
}
public static function getDumbMongoesInstance():MongoesDumb{
mongoesDumbIndex = (mongoesDumbIndex + 1);
if (mongoesDumbIndex == 4){
mongoesDumbIndex = 0;
};
if (mongoesDumbArray[mongoesDumbIndex] == null){
mongoesDumbArray[mongoesDumbIndex] = new MongoesDumb();
};
return (mongoesDumbArray[mongoesDumbIndex]);
}
public static function getGorillaInstance(_arg1:uint):Enemy{
switch (_arg1){
case 1:
return (getDumbGorillaInstance());
case 2:
return (getAverageGorillaInstance());
case 3:
return (getSmartGorillaInstance());
default:
return (null);
};
}
public static function getDumbWildBoreInstance():WildBoreDumb{
wildBoreDumbIndex = (wildBoreDumbIndex + 1);
if (wildBoreDumbIndex == 4){
wildBoreDumbIndex = 0;
};
if (wildBoreDumbArray[wildBoreDumbIndex] == null){
wildBoreDumbArray[wildBoreDumbIndex] = new WildBoreDumb();
};
return (wildBoreDumbArray[wildBoreDumbIndex]);
}
public static function getRhinoInstance(_arg1:uint):Enemy{
switch (_arg1){
case 1:
return (getDumbRhinoInstance());
default:
return (null);
};
}
}
}//package
Section 69
//EnemyHealthClip (EnemyHealthClip)
package {
import flash.display.*;
public class EnemyHealthClip extends MovieClip {
public static var enemyHealthClip:EnemyHealthClip = null;
public function init(){
var _local1:uint;
_local1 = 1;
gotoAndStop(_local1);
x = 320;
y = 5;
}
public static function getInstance():EnemyHealthClip{
enemyHealthClip = new (EnemyHealthClip);
return (enemyHealthClip);
}
}
}//package
Section 70
//GameOver (GameOver)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class GameOver extends MovieClip {
public var playAgain1:SimpleButton;
var urlPlayMore:String;// = "http://www.flasharcade.com"
var requestPlayMore:URLRequest;// = null
public var submitScore:SimpleButton;
public var mc_textScreen:MovieClip;
public var endFrame:Boolean;// = false
public var playMore:SimpleButton;
private static var gameOver:GameOver = null;
public function GameOver(){
urlPlayMore = "http://www.flasharcade.com";
requestPlayMore = null;
endFrame = false;
super();
addFrameScript(174, frame175);
}
public function getPlayerName():String{
var _local1:String;
_local1 = mc_textScreen.player.text;
if (_local1 == null){
return (null);
};
mc_textScreen.errormesg.text = "";
return (_local1);
}
public function init(){
gotoAndPlay(1);
requestPlayMore = new URLRequest(urlPlayMore);
playMore.addEventListener(MouseEvent.CLICK, handleClick);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function handleClick(_arg1:MouseEvent){
var event = _arg1;
try {
navigateToURL(requestPlayMore, "_blank");
} catch(e:Error) {
};
}
public function updateScores(){
mc_textScreen.totalScore.text = MainClass.gameScore.toString();
}
public function removeAllListener(){
playMore.removeEventListener(MouseEvent.CLICK, handleClick);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function resetData(){
if (mc_textScreen != null){
mc_textScreen.totalScore.text = " ";
mc_textScreen.player.text = "";
mc_textScreen.errormesg.text = " ";
};
}
function frame175(){
stop();
}
public function onEnterFrame(_arg1:Event){
if (currentFrame >= 175){
mc_textScreen.totalScore.text = MainClass.gameScore.toString();
};
}
public function setErrorMesg(_arg1:String){
mc_textScreen.errormesg.text = _arg1;
}
public static function getInstance():GameOver{
if (gameOver == null){
gameOver = new (GameOver);
};
gameOver.resetData();
return (gameOver);
}
}
}//package
Section 71
//GorillaAverage (GorillaAverage)
package {
import flash.events.*;
import flash.display.*;
public class GorillaAverage extends AnimalAverage {
public var hitClip:MovieClip;
public var attackClip:MovieClip;
public var dieClip:MovieClip;
public function GorillaAverage(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5);
}
function frame3(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
override public function onEnterFrame(_arg1:Event){
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local2 = Math.abs((Monkey.monkey.x - x));
_local3 = Math.abs((Monkey.monkey.y - y));
_local4 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
if (hitBananaStatus){
if (currentFrame == 3){
if (this.hitClip != null){
if (this.hitClip.currentFrame >= 6){
this.hitClip.gotoAndStop(1);
if (speedx < 6){
speedx = (speedx + 1.5);
};
gotoAndStop(2);
hitBananaStatus = false;
};
};
};
return;
};
if (dieStatus){
if (currentFrame == 4){
if (this.dieClip != null){
if (this.dieClip.currentFrame >= 15){
removeClip();
return;
};
};
};
return;
};
if (!dieStatus){
if (((((!(attackStatus)) && ((_local4 < 20)))) && ((_local3 < 10)))){
attackStatus = true;
gotoAndStop(5);
};
if (((((attackStatus) && (!(jumpUpStatus)))) && (!(jumpDownStatus)))){
if (currentFrame == 5){
if (this.attackClip != null){
if (this.attackClip.currentFrame >= 6){
this.attackClip.gotoAndStop(1);
attackStatus = false;
gotoAndStop(2);
};
};
};
};
if (action == 2){
if (jumpUpStatus){
y = (y + jumpHeight);
jumpHeight = (jumpHeight + 1);
if (jumpHeight >= 0){
jumpHeight = 0;
jumpUpStatus = false;
jumpDownStatus = true;
};
x = (x + ((jumpx - x) / 12));
return;
};
if (jumpDownStatus){
if (jumpHeight <= 5){
jumpHeight = (jumpHeight + 1);
};
y = (y + jumpHeight);
x = (x + ((jumpx - x) / 12));
if (y > starty){
y = starty;
jumpHeight = -10;
jumpDownStatus = false;
action = 1;
};
return;
};
};
if (action == 1){
if (xMoveType == 1){
scaleX = -1;
if ((x + halfWidth) < targetEndx){
x = (x + speedx);
} else {
x = (targetEndx - halfWidth);
action = 0;
speedx = 4;
checkNextLine();
};
return;
};
if (xMoveType == -1){
scaleX = 1;
if ((x - halfWidth) > targetEndx){
x = (x - speedx);
} else {
x = (targetEndx + halfWidth);
action = 0;
speedx = 4;
checkNextLine();
};
return;
};
};
};
}
override public function init(_arg1:Number, _arg2:Number, _arg3:Number){
halfWidth = 22;
halfHeight = 28;
jumpHeight = -10;
hitStatus = false;
dieStatus = false;
currentLine = _arg1;
health = _arg2;
lineDimension = GParams.game_Path_Dimension[(GParams.currentLevel - 1)];
if (_arg3 == 1){
startx = lineDimension[_arg1][0];
starty = (lineDimension[_arg1][1] - halfHeight);
targetEndx = (startx + lineDimension[_arg1][2]);
xMoveType = 1;
scaleX = 1;
x = startx;
y = starty;
} else {
if (_arg3 == -1){
targetEndx = lineDimension[_arg1][0];
startx = (targetEndx + lineDimension[_arg1][2]);
starty = (lineDimension[_arg1][1] - halfHeight);
xMoveType = -1;
scaleX = -1;
x = (startx - halfWidth);
y = starty;
};
};
gotoAndStop(2);
speedx = 4;
action = 1;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
override public function hit_Banana(){
if (!dieStatus){
health = (health - 10);
if (health > 0){
hitBananaStatus = true;
gotoAndStop(3);
} else {
MainClass.gameScore = (MainClass.gameScore + GParams.GORILLAAVGSCORE);
ScoreClip.scoreClip.updateScore();
dieStatus = true;
Bg1.bg1.removeGorillaReference();
gotoAndStop(4);
};
};
}
}
}//package
Section 72
//GorillaDumb (GorillaDumb)
package {
import flash.events.*;
import flash.display.*;
public class GorillaDumb extends AnimalDumb {
public var hitClip:MovieClip;
public var attackClip:MovieClip;
public var dieClip:MovieClip;
public function GorillaDumb(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5);
standCountMax = 60;
}
function frame3(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
override public function onEnterFrame(_arg1:Event){
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local2 = Math.abs((Monkey.monkey.x - x));
_local3 = Math.abs((Monkey.monkey.y - y));
_local4 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
if ((((currentFrame == 1)) || ((action == 0)))){
standCountCurrent = (standCountCurrent + 1);
if (standCountCurrent >= standCountMax){
checkNextLine();
};
};
if (dieStatus){
if (currentFrame == 4){
if (this.dieClip != null){
if (this.dieClip.currentFrame >= 15){
removeClip();
return;
};
};
};
return;
};
if (!dieStatus){
if (hitBananaStatus){
if (currentFrame == 3){
if (this.hitClip != null){
if (this.hitClip.currentFrame >= 6){
this.hitClip.gotoAndStop(1);
if (speedx < maxSpeed){
speedx = (speedx + 0.25);
};
gotoAndStop(2);
if (currentLine != Monkey.monkey.currentLineIndex){
escapeHit();
};
hitBananaStatus = false;
};
};
};
return;
};
if (((((!(attackStatus)) && ((_local4 < 20)))) && ((_local3 < 10)))){
attackStatus = true;
gotoAndStop(5);
};
if (attackStatus){
if (currentFrame == 5){
if (this.attackClip != null){
if (this.attackClip.currentFrame >= 6){
this.attackClip.gotoAndStop(1);
attackStatus = false;
gotoAndStop(2);
};
};
};
};
checkMonkeyPosition();
if (action == 1){
turnStatus = false;
if (xMoveType == 1){
scaleX = -1;
if ((x + halfWidth) < targetEndx){
if (speedx < maxSpeed){
speedx = (speedx + 0.25);
};
x = (x + speedx);
} else {
x = ((targetEndx - halfWidth) - 10);
speedx = 0.25;
standAnimal();
chaseMonkeyStatus = false;
};
return;
};
if (xMoveType == -1){
scaleX = 1;
if ((x - halfWidth) > targetEndx){
if (speedx < maxSpeed){
speedx = (speedx + 0.25);
};
x = (x - speedx);
} else {
x = ((targetEndx + halfWidth) + 10);
speedx = 0.25;
standAnimal();
chaseMonkeyStatus = false;
};
return;
};
};
};
}
override public function init(_arg1:Number, _arg2:Number, _arg3:Number){
halfWidth = 37;
halfHeight = 34;
hitStatus = false;
dieStatus = false;
chaseMonkeyStatus = false;
currentLine = _arg1;
health = _arg2;
lineDimension = GParams.game_Path_Dimension[(GParams.currentLevel - 1)];
if (_arg3 == 1){
startx = lineDimension[_arg1][0];
starty = (lineDimension[_arg1][1] - halfHeight);
targetEndx = (startx + lineDimension[_arg1][2]);
xMoveType = 1;
scaleX = 1;
x = startx;
y = starty;
} else {
if (_arg3 == -1){
targetEndx = lineDimension[_arg1][0];
startx = (targetEndx + lineDimension[_arg1][2]);
starty = (lineDimension[_arg1][1] - halfHeight);
xMoveType = -1;
scaleX = -1;
x = (startx - halfWidth);
y = starty;
};
};
gotoAndStop(2);
maxSpeed = (Math.ceil(lineDimension[_arg1][2]) / 100);
speedx = 0.25;
action = 1;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
override public function hit_Banana(){
if (!dieStatus){
health = (health - 10);
if (health > 0){
hitBananaStatus = true;
escapeHit();
gotoAndStop(3);
} else {
if (((!(jumpUpStatus)) && (!(jumpDownStatus)))){
MainClass.gameScore = (MainClass.gameScore + GParams.GORILLADUMBSCORE);
ScoreClip.scoreClip.updateScore();
dieStatus = true;
Bg1.bg1.removeGorillaReference();
gotoAndStop(4);
};
};
};
}
}
}//package
Section 73
//GorillaSmart (GorillaSmart)
package {
import flash.events.*;
import flash.display.*;
public class GorillaSmart extends AnimalDumb {
public var attack2Clip:MovieClip;
public var hitClip:MovieClip;
public var attackClip:MovieClip;
public var dieClip:MovieClip;
public static var gorillaSmart:GorillaSmart = null;
public function GorillaSmart(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6);
}
function frame3(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame6(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
override public function onEnterFrame(_arg1:Event){
checkMonkeyPosition();
if (hitBananaStatus){
if (currentFrame == 3){
if (this.hitClip != null){
if (this.hitClip.currentFrame >= 6){
this.hitClip.gotoAndStop(1);
gotoAndStop(2);
hitBananaStatus = false;
attack2Status = false;
attackStatus = false;
};
};
};
};
if (dieStatus){
if (currentFrame == 5){
if (this.dieClip != null){
if (this.dieClip.currentFrame >= 30){
removeClip();
return;
};
};
};
return;
};
if (attackStatus){
if (currentLabel == "attack"){
if (this.attackClip != null){
if (this.attackClip.currentFrame == 15){
createStone();
};
if (this.attackClip.currentFrame >= 22){
this.attackClip.gotoAndStop(1);
gotoAndStop("stand");
counter = 0;
attackStatus = false;
attack2Status = false;
};
};
};
};
if (attack2Status){
if (currentLabel == "attack2"){
if (this.attack2Clip != null){
if (this.attack2Clip.currentFrame >= 15){
this.attack2Clip.gotoAndStop(1);
gotoAndStop("stand");
counter = 0;
attack2Status = false;
attackStatus = false;
};
};
};
};
if (!dieStatus){
counter++;
if (((((((!(attackStatus)) && (!(attack2Status)))) && (!(Monkey.monkey.hangStatus)))) && (!(Monkey.monkey.fallStatus)))){
if ((((Monkey.monkey.currentLineIndex > 3)) && ((counter > maxCounter)))){
attackStatus = true;
gotoAndStop("attack");
};
};
if (((((((!(attack2Status)) && (!(attackStatus)))) && (!(Monkey.monkey.hangStatus)))) && (!(Monkey.monkey.fallStatus)))){
if (Monkey.monkey.currentLineIndex == currentLine){
attack2Status = true;
escapeHit();
gotoAndStop("attack2");
Monkey.monkey.currentLineIndex = 2;
};
};
};
}
public function createStone(){
if (stone != null){
if (this.parent.contains(stone)){
Stone.stone.removeStone();
};
};
stone = Stone.getInstance();
this.parent.addChild(stone);
stone.init();
}
override public function init(_arg1:Number, _arg2:Number, _arg3:Number){
halfWidth = 40;
halfHeight = 45;
hitStatus = false;
dieStatus = false;
attackStatus = false;
attack2Status = false;
chaseMonkeyStatus = false;
currentLine = _arg1;
health = _arg2;
counter = 0;
maxCounter = 50;
gorillaSmart = this;
lineDimension = GParams.game_Path_Dimension[(GParams.currentLevel - 1)];
if (_arg3 == 1){
startx = lineDimension[_arg1][0];
starty = (lineDimension[_arg1][1] - halfHeight);
targetEndx = (startx + lineDimension[_arg1][2]);
xMoveType = 1;
scaleX = 1;
x = (startx - 100);
y = starty;
} else {
if (_arg3 == -1){
targetEndx = lineDimension[_arg1][0];
startx = (targetEndx + lineDimension[_arg1][2]);
starty = (lineDimension[_arg1][1] - halfHeight);
xMoveType = -1;
scaleX = -1;
x = (startx - 100);
y = starty;
};
};
gotoAndStop(2);
action = 1;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
override public function escapeHit(){
Monkey.monkey.x = (Monkey.monkey.x + 80);
}
override public function hit_Banana(){
if (((((!(dieStatus)) && (!(attackStatus)))) && (!(attack2Status)))){
health = (health - 8);
if (health > 0){
hitBananaStatus = true;
gotoAndStop(3);
} else {
MainClass.gameScore = (MainClass.gameScore + GParams.GORILLASMARTSCORE);
ScoreClip.scoreClip.updateScore();
dieStatus = true;
Bg1.bg1.removeGorillaReference();
gotoAndStop(5);
};
};
}
}
}//package
Section 74
//GParams (GParams)
package {
import flash.geom.*;
public class GParams {
public static var stage_Rhino_Count:Array = [[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [1, 0, 0], [0, 0, 0], [0, 0, 0]];
public static var VULTURE_DUMB = 1;
public static var stage_Vulture_Direction:Array = [[[1, -1, 1], [-1, -1]], [[-1, 1, -1], [-1]], [[0, 0], [0, 0]], [[-1], [1]], [[0, 0], [-1, -1]], [[0, 0], [0, 0]], [[-1, 1], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]]];
public static var MONGOESDUMBSCORE:Number = 50;
public static var stage_SnakeTime_Count:Array = [[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [6, 0, 0]];
public static var stage_Vulture_Count:Array = [[2, 1, 0], [3, 1, 0], [0, 0, 0], [1, 1, 0], [0, 2, 0], [0, 0, 0], [2, 0, 0], [0, 0, 0], [0, 0, 0]];
public static var stage_Eagle2_Timer:Array = [0, 0, 0, 3000, 5000, 0, 5000, 4000, 0];
public static var VULTUREDUMBSCORE:Number = 50;
public static var stage_WildBore_Count:Array = [[0, 0, 0], [0, 0, 0], [0, 0, 0], [1, 0, 0], [0, 0, 0], [1, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]];
public static var EAGLEDUMBSCORE:Number = 200;
public static var BHALA_HIT_COUNT = 5;
public static var gamePause:Boolean = false;
public static var VULTURE_AVERAGE = 2;
public static var level1_Coconutpath:Array = [[100, 73, 185, 178, 81, 284, 185, 391, 264, 496, 192, 605, -50], [320, 73, 245, 178, 280, 284, 242, 391, 264, 496, 410, 605, 605], [320, 73, 360, 178, 340, 284, 242, 391, 264, 496, 192, 605, -50], [500, 73, 430, 178, 340, 284, 360, 391, 520, 605, 605], [320, 73, 360, 178, 524, 284, 417, 391, 340, 496, 410, 605, 605]];
public static var level3_Coconutpath:Array = [[0, 0], [0, 0]];
public static var GORILLASMARTSCORE:Number = 200;
public static var level5_Coconutpath:Array = [[100, 284, 0, 391, 114, 496, 176, 605, -50], [300, 73, 240, 179, 192, 284, 188, 391, 272, 496, 250, 605, -50], [200, 179, 165, 284, 188, 391, 290, 496, 250, 605, -50], [380, 179, 418, 284, 417, 391, 324, 496, 380, 605, 650], [300, 73, 375, 179, 430, 284, 605, 391, 480, 496, 650], [100, 73, 0, 179, 118, 284, 190, 391, 140, 496, 180, 605, -50], [300, 73, 365, 179, 425, 284, 605, 391, 480, 496, 423, 605, 650], [300, 73, 365, 179, 425, 284, 410, 391, 320, 496, 230, 605, -50]];
public static var level7_Coconutpath:Array = [[100, 73, 210, 285, 200, 490, 230, 705, -50], [100, 73, 210, 285, 355, 386, 380, 705, -50], [450, 73, 600, 178, 480, 285, 430, 705, 650], [500, 73, 600, 178, 480, 285, 600, 386, 450, 705, 650]];
public static var level9_Coconutpath:Array = [[0, 0], [0, 0]];
public static var stage_Gorilla_Count:Array = [[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [1, 2, 0], [0, 0, 0], [0, 0, 1], [0, 0, 0], [0, 0, 0]];
public static var level3_Dimension:Array = [[0, 580, 650, -1, -1, 0, 0, 0, 1], [192, 496, 120, -1, 2, 0, 0, 0, 0], [290, 496, 120, 1, -1, 0, 0, 1, 1], [417, 73, 185, 11, -1, 8, -1, -1, -1]];
public static var WRONGROPE_HIT_COUNT = 35;
public static var level7_Dimension:Array = [[0, 839, 600, -1, 1, 0, 0, 0, 0], [0, 839, 600, 0, -1, 0, 0, 0, 0], [0, 628, 270, -1, 3, 0, 0, 0, 0], [500, 628, 100, 3, -1, 0, 0, 0, 0], [500, 499, 100, 5, -1, 3, 0, 0, 0], [253, 499, 164, 6, -1, 0, 0, 0, 0], [0, 499, 164, -1, -1, 0, 0, 0, 0], [0, 370, 164, -1, 8, 0, 3, 0, 0], [247, 370, 174, 7, 9, 3, 0, 0, 0], [500, 370, 120, 8, -1, 0, 0, 0, 0], [0, 241, 90, -1, -1, 6, -1, 0, 0], [390, 241, 70, -1, -1, 6, -1, 0, 0], [503, 241, 100, 12, -1, 10, -1, 0, 0], [0, 113, 270, 13, 11, 9, 10, 0, 0], [350, 113, 250, -1, 12, -1, 3, 0, 0]];
public static var stage_Coconut_Count:Array = [90, 90, 80, 80, 80, 80, 80, 100, 70];
public static var WILDBORE_HIT_COUNT = 7;
public static var stage_Eagle_Timer:Array = [14000, 12000, 0, 4000, 12000, 0, 12000, 12000, 0];
public static var stage_SnakeTime_Timer:Array = [[[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]], [[30, 28, 25, 22, 24, 20], [0, 0]]];
public static var VULTURE_SMART = 3;
public static var LEOPARD_HIT_COUNT = 6;
public static var stage_SnakeTime_xPosition:Array = [[[-1, -1], [-1, -1]], [[-1, -1], [-1, -1]], [[-1, -1], [-1, -1]], [[-1, -1], [-1, -1]], [[-1, -1], [-1, -1]], [[-1, -1], [-1, -1]], [[-1, -1], [-1, -1]], [[-1, -1], [-1, -1]], [[500, 100, 500, 100, 100, 500], [-1, -1]]];
public static var stage_SnakeTime_yPosition:Array = [[[-1, -1], [-1, -1]], [[-1, -1], [-1, -1]], [[-1, -1], [-1, -1]], [[-1, -1], [-1, -1]], [[-1, -1], [-1, -1]], [[-1, -1], [-1, -1]], [[-1, -1], [-1, -1]], [[-1, -1], [-1, -1]], [[508, 378, 248, 248, 120, 120], [-1, -1]]];
public static var bgViewHeight:Number = 440;
public static var MONKEY_HEALTH = 100;
public static var GORILLADUMBSCORE:Number = 50;
public static var stage_Mongoes_Life:Array = [[30, 40, 0], [40, 60, 0], [0, 0, 0], [40, 60, 0], [40, 60, 0], [0, 0, 0], [30, 40, 0], [30, 40, 0], [0, 0, 0]];
public static var surfaceBg_Height:Array = [1050, 1038, 625, 940, 793, 620, 884, 1067, 540];
public static var bgViewWidth:Number = 600;
public static var stage_Leopard_Life:Array = [[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [60, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]];
public static var stage_Leopard_Position:Array = [[[-1, -1], [-1, -1]], [[-1, -1], [-1, -1]], [[-1, -1], [-1, -1]], [[-1, -1], [-1, -1]], [[1, -1], [-1, -1]], [[-1, -1], [-1, -1]], [[-1, -1], [-1, -1]], [[-1, -1], [-1, -1]], [[-1, -1], [-1, -1]]];
public static var powerUpInterval:Number = 2000;
public static var GORILLA_HIT_COUNT = 8;
public static var stageWidth:Number = 600;
public static var monkeyMoveMin:Number = 20;
public static var stage_WildBore_Life:Array = [[60, 60, 0], [60, 60, 0], [0, 0, 0], [60, 60, 0], [80, 60, 0], [100, 0, 0], [60, 60, 0], [60, 0, 0], [0, 0, 0]];
public static var stage_Mongoes_Count:Array = [[2, 1, 0], [1, 4, 0], [0, 0, 0], [3, 1, 0], [0, 1, 0], [0, 0, 0], [2, 1, 0], [0, 0, 0], [0, 0, 0]];
public static var stage_Rhino_Direction:Array = [[[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]], [[-1, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]]];
public static var level2_Dimension:Array = [[0, 992, 600, -1, 1, 0, 0, 0, 1], [200, 992, 400, 0, -1, 0, 0, 0, 1], [423, 865, 176, 3, -1, 1, -1, 0, 0], [250, 865, 114, 4, 2, 0, 0, -1, -1], [5, 865, 176, -1, 3, -1, 0, 1, 1], [3, 732, 114, -1, 6, -1, 4, 1, 0], [158, 732, 114, 5, 7, 4, 3, -1, -1], [324, 732, 114, 6, 8, 3, 2, -1, -1], [480, 732, 114, 7, -1, 1, -1, 2, 1], [417, 605, 185, 10, -1, 7, -1, 2, 0], [242, 605, 118, 11, 9, 6, 7, -1, -1], [0, 605, 185, -1, 10, -1, 6, 3, 1], [0, 475, 118, -1, 13, -1, 11, 3, 0], [189, 475, 225, 12, 14, 11, 9, 4, 1], [483, 475, 118, 13, -1, 9, -1, -1, -1], [0, 345, 185, 16, -1, 13, -1, -1, -1], [242, 345, 118, 17, 15, 13, 13, 4, 0], [417, 345, 185, -1, 16, -1, 13, -1, -1], [0, 215, 243, -1, -1, -1, 16, -1, -1], [75, 88, 162, -1, -1, 18, 16, -1, -1], [361, 128, 150, -1, -1, 16, 15, -1, -1], [511, 72, 80, -1, -1, 19, -1, -1, -1]];
public static var stage_Enemy_Avail = [[0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0], [0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0]];
public static var level6_Dimension:Array = [[0, 595, 600, -1, -1, 0, 0, 0, 1], [192, 496, 120, -1, 2, 0, 0, 0, 0], [290, 496, 120, 1, -1, 0, 0, 1, 1], [417, 73, 185, 11, -1, 8, -1, -1, -1]];
public static var GORILLAAVGSCORE:Number = 100;
public static var stage_hunter2Attack_Timer:Array = [50, 100, 0, 100, 100, 0, 100, 70, 0];
public static var monkeyMoveMax:Number = 580;
public static var MONGOESAVGSCORE:Number = 100;
public static var VULTUREAVGSCORE:Number = 100;
public static var stage_Mongoes_Position:Array = [[[1, 3], [12, -1]], [[13], [4, 5, 8, 9]], [[-1, -1, -1], [-1]], [[3, 6, 15], [3]], [[-1, -1], [5, 14]], [[-1, -1, -1], [-1]], [[2, 13], [7, -1]], [[-1, -1], [-1, -1]], [[-1, -1, -1], [-1]]];
public static var stage_Leopard_Count:Array = [[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [1, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]];
public static var stage_Powerup_Position:Array = [[1, 600, 502], [1, 450, 540], [1, 850, 1400], [1, 470, 340], [2, 240, 200], [1, 850, 1400], [1, 850, 1400], [1, 550, 745]];
public static var currentLevel:Number = 1;
public static var stage_Rhino_Life:Array = [[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [80, 0, 0], [0, 0, 0], [0, 0, 0]];
public static var stage_Leopard_Direction:Array = [[[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]], [[-1, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]]];
public static var WILDBOREDUMBSCORE:Number = 200;
public static var LEOPARDDUMBSCORE:Number = 200;
public static var stage_Gorilla_Life:Array = [[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [50, 60, 0], [0, 0, 0], [50, 0, 50], [0, 0, 0], [0, 0, 0]];
public static var stage_Vulture_Position:Array = [[[4, 9], [7, -1]], [[1, 20, 13], [9]], [[-1, -1, -1], [-1]], [[7], [9]], [[-1, -1], [8, 17]], [[-1, -1, -1], [-1]], [[5, 14], [-1, -1]], [[-1, -1], [-1, -1]], [[-1, -1, -1], [-1]]];
public static var stage_Gorilla_Direction:Array = [[[0, 0], [0, 0], [0]], [[0, 0], [0, 0], [0]], [[0, 0], [0, 0], [0]], [[0, 0], [0, 0], [0]], [[1, 0], [1, 1, 0], [0]], [[0, 0], [0, 0], [0]], [[1, -1], [0, 0], [-1]], [[0, 0], [0, 0], [0]], [[0, 0], [0, 0], [0]]];
public static var stage_WildBore_Direction:Array = [[[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]], [[-1, 0], [0, 0]], [[0, 0], [0, 0]], [[-1, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]]];
public static var stage_WildBore_Position:Array = [[[-1, -1], [-1, -1]], [[-1, -1], [-1, -1]], [[-1, -1], [-1, -1]], [[1, -1], [-1, -1]], [[-1, -1], [-1, -1]], [[0, -1], [-1, -1]], [[-1, -1], [-1, -1]], [[-1, -1], [-1, -1]], [[-1, -1], [-1, -1]]];
public static var RHINO_HIT_COUNT = 6;
public static var MONGOES_HIT_COUNT = 4;
public static var level2_Coconutpath:Array = [[100, 284, 0, 391, 114, 496, 176, 605, -50], [300, 73, 240, 179, 192, 284, 188, 391, 272, 496, 250, 605, -50], [200, 179, 165, 284, 188, 391, 290, 496, 250, 605, -50], [380, 179, 418, 284, 417, 391, 324, 496, 380, 605, 650], [300, 73, 375, 179, 430, 284, 605, 391, 480, 496, 650], [100, 73, 0, 179, 118, 284, 190, 391, 140, 496, 180, 605, -50], [300, 73, 365, 179, 425, 284, 605, 391, 480, 496, 423, 605, 650], [300, 73, 365, 179, 425, 284, 410, 391, 320, 496, 230, 605, -50]];
public static var EAGLE_HIT_COUNT = 1;
public static var level4_Coconutpath:Array = [[100, 73, 210, 178, 291, 285, 242, 386, 70, 490, 185, 596, -50], [100, 73, 210, 178, 291, 285, 242, 386, 260, 490, 242, 596, 325, 705, 650], [450, 73, 600, 285, 417, 386, 330, 490, 360, 705, 650], [300, 73, 270, 178, 291, 285, 360, 386, 510, 490, 417, 596, 423, 705, 650]];
public static var level6_Coconutpath:Array = [[0, 0], [0, 0]];
public static var level8_Coconutpath:Array = [[100, 628, 310, 839, -50], [120, 628, 310, 839, 605], [140, 628, 310, 839, -50]];
public static var RESCUEDTOTAL = 6;
public static var level1_Dimension:Array = [[0, 1005, 650, -1, -1, 0, 0, 0, 1], [192, 877, 240, -1, 2, 0, 0, 0, 0], [290, 877, 120, 1, -1, 0, 0, 1, 1], [339, 746, 183, 4, -1, 2, 0, 1, 0], [81, 746, 183, -1, 3, 0, 2, 2, 1], [0, 616, 190, -1, 6, 0, 4, 2, 0], [242, 616, 118, 5, 7, 4, 3, -1, -1], [415, 616, 180, 6, -1, 3, 0, 3, 1], [339, 486, 185, 9, -1, 6, 7, 3, 0], [81, 486, 185, -1, 8, 5, 6, 4, 1], [0, 355, 235, -1, 11, -1, 9, 4, 4], [242, 355, 118, 10, 12, 9, 8, -1, -1], [417, 355, 185, 11, -1, 8, -1, -1, -1], [242, 226, 185, 14, -1, 8, -1, -1, -1], [0, 226, 235, -1, 13, 8, -1, -1, -1]];
public static var stage_Rhino_Position:Array = [[[-1, -1], [-1, -1]], [[-1, -1], [-1, -1]], [[-1, -1], [-1, -1]], [[-1, -1], [-1, -1]], [[-1, -1], [-1, -1]], [[-1, -1], [-1, -1]], [[1, -1], [-1, -1]], [[-1, -1], [-1, -1]], [[-1, -1], [-1, -1]]];
public static var game_Path_Dimension:Array = [level1_Dimension, level2_Dimension, level3_Dimension, level4_Dimension, level5_Dimension, level6_Dimension, level7_Dimension, level8_Dimension, level9_Dimension];
public static var level9_Dimension:Array = [[0, 520, 650, -1, -1, 0, 0, 0, 1], [192, 496, 120, -1, 2, 0, 0, 0, 0], [290, 496, 120, 1, -1, 0, 0, 1, 1], [417, 73, 185, 11, -1, 8, -1, -1, -1]];
public static var level5_Dimension:Array = [[0, 748, 600, -1, 1, 0, 0, 0, 1], [0, 748, 600, 0, -1, 0, 0, 0, 1], [423, 620, 176, 3, -1, 1, -1, 0, 0], [250, 620, 114, 4, 2, 0, 0, -1, -1], [5, 620, 176, -1, 3, -1, 0, 1, 1], [3, 488, 114, -1, 6, -1, 4, 1, 0], [158, 488, 114, 5, 7, 4, 3, -1, -1], [324, 488, 114, 6, 8, 3, 2, -1, -1], [480, 488, 114, 7, -1, 1, -1, 2, 1], [417, 360, 185, 10, -1, 7, -1, 2, 0], [242, 360, 118, 11, 9, 6, 7, -1, -1], [0, 360, 185, -1, 10, -1, 6, 3, 1], [0, 230, 118, -1, 13, -1, 11, 3, 0], [189, 230, 225, 12, 14, 11, 9, 4, 1], [483, 230, 118, 13, -1, 9, -1, -1, -1], [0, 102, 185, -1, 16, -1, 13, -1, -1], [242, 102, 118, 15, 17, 13, 13, 4, 0], [417, 102, 185, 16, -1, 13, -1, -1, -1]];
public static var RESCUEDNUM = 0;
public static var stageHeight:Number = 440;
public static var stage_Gorilla_Position:Array = [[[-1, -1], [-1, -1], [-1]], [[-1, -1], [-1, -1], [-1]], [[-1, -1], [-1, -1], [-1]], [[-1, -1], [-1, -1], [-1]], [[13, -1], [4, 11, -1], [-1]], [[-1, -1], [-1, -1], [-1]], [[-1, -1], [-1, -1], [6]], [[-1, -1], [-1, -1], [-1]], [[-1, -1], [-1, -1], [-1]]];
public static var VULTURE_HIT_COUNT = 3;
public static var stage_Vulture_Life:Array = [[30, 40, 0], [40, 60, 0], [0, 0, 0], [40, 60, 0], [40, 60, 0], [0, 0, 0], [20, 40, 0], [20, 40, 0], [0, 0, 0]];
public static var restartStatus:Boolean = false;
public static var game_Coconut_Path:Array = [level1_Coconutpath, level2_Coconutpath, level3_Coconutpath, level4_Coconutpath, level5_Coconutpath, level6_Coconutpath, level7_Coconutpath, level8_Coconutpath, level9_Coconutpath];
public static var stage_Mongoes_Direction:Array = [[[1, -1], [-1, 0]], [[-1], [1, 1, -1, -1]], [[0, 0], [0, 0]], [[-1, 1, -1], [1]], [[0, 0], [1, 0]], [[0, 0], [0, 0]], [[1, 1], [1, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]]];
public static var stage_Snake_Position:Array = [[372, 520, -1], [391, 502, 1], [-1, -1, -1], [370, 798, -1], [450, 650, -1], [-1, -1, -1], [-1, -1, -1], [214, 204, -1], [-1, -1, -1]];
public static var stage_SnakeTime_Direction:Array = [[[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]]];
public static var frameRate:uint = 60;
public static var MONKEY_LIFE = 4;
public static var stageCenter:Point = new Point((stageWidth / 2), (stageHeight / 2));
public static var level4_Dimension:Array = [[0, 894, 350, -1, 1, 0, 0, 0, 1], [0, 894, 600, 0, -1, 0, 0, 0, 1], [350, 765, 250, 3, -1, 1, -1, 0, 0], [0, 765, 260, -1, 2, 0, 0, 1, 1], [0, 636, 185, -1, 5, 0, 3, 1, 0], [242, 636, 118, 4, 6, 3, 1, -1, -1], [410, 636, 190, 5, -1, 0, -1, 2, 1], [330, 507, 185, 8, -1, 5, -1, 2, 0], [77, 507, 185, -1, 7, 4, 5, 3, 1], [0, 379, 185, -1, 10, -1, 8, 3, 0], [242, 379, 118, 9, 11, 8, 7, -1, -1], [417, 379, 185, 10, -1, 7, -1, 4, 1], [360, 250, 185, 13, -1, 10, 11, 4, 0], [106, 250, 185, -1, 12, 9, 10, 5, 1], [0, 121, 210, -1, 15, -1, 13, 5, 0], [280, 121, 320, 14, -1, 13, -1, -1, -1]];
public static var COCONUT_HIT_COUNT = 1;
public static var level8_Dimension:Array = [[0, 1005, 650, -1, -1, 0, 0, 0, 1], [192, 496, 120, -1, 2, 0, 0, 0, 0], [290, 496, 120, 1, -1, 0, 0, 1, 1], [339, 391, 183, 4, -1, 2, 0, 1, 0], [81, 391, 183, -1, 3, 0, 2, 2, 1], [0, 284, 235, -1, 6, 0, 4, 2, 0], [242, 284, 118, 5, 7, 4, 3, -1, -1], [417, 284, 200, 6, -1, 3, 0, 3, 1], [339, 178, 185, 9, -1, 6, 7, 3, 0], [81, 178, 185, -1, 8, 5, 6, 4, 1], [0, 73, 235, -1, 11, -1, 9, 4, 4], [242, 73, 118, 10, 12, 9, 8, -1, -1], [417, 73, 185, 11, -1, 8, -1, -1, -1]];
public static var stage_hunter1Attack_Timer:Array = [100, 200, 0, 200, 500, 0, 400, 200, 0];
public static var RHINODUMBSCORE:Number = 200;
}
}//package
Section 75
//HealthClip (HealthClip)
package {
import flash.display.*;
public class HealthClip extends MovieClip {
public static var healthClip:HealthClip = null;
public function init(){
var _local1:uint;
_local1 = (100 - Monkey.monkey.health);
gotoAndStop(_local1);
x = 0;
y = 5;
}
public static function getInstance():HealthClip{
if (healthClip == null){
healthClip = new (HealthClip);
};
return (healthClip);
}
}
}//package
Section 76
//HelpPage (HelpPage)
package {
import flash.events.*;
import flash.display.*;
public class HelpPage extends MovieClip {
public function init(){
}
public function removeClip(){
}
public function goBack(_arg1:MouseEvent){
}
public static function getInstance(){
}
}
}//package
Section 77
//HelpPage1 (HelpPage1)
package {
import flash.events.*;
import flash.display.*;
public class HelpPage1 extends HelpPage {
public var backBtn:SimpleButton;
public static var helpPage1:HelpPage1 = null;
public function HelpPage1(){
addFrameScript(0, frame1);
}
override public function removeClip(){
parent.removeChild(this);
}
override public function init(){
x = 0;
y = 0;
backBtn.addEventListener(MouseEvent.CLICK, goBack);
}
function frame1(){
stop();
}
override public function goBack(_arg1:MouseEvent){
backBtn.removeEventListener(MouseEvent.CLICK, goBack);
GParams.gamePause = false;
removeClip();
}
public static function getInstance():HelpPage1{
if (helpPage1 == null){
helpPage1 = new (HelpPage1);
};
return (helpPage1);
}
}
}//package
Section 78
//HelpPage2 (HelpPage2)
package {
import flash.events.*;
import flash.display.*;
public class HelpPage2 extends HelpPage {
public var backBtn:SimpleButton;
public static var helpPage2:HelpPage2 = null;
public function HelpPage2(){
addFrameScript(0, frame1);
}
override public function removeClip(){
parent.removeChild(this);
}
override public function init(){
x = 0;
y = 0;
backBtn.addEventListener(MouseEvent.CLICK, goBack);
}
function frame1(){
stop();
}
override public function goBack(_arg1:MouseEvent){
backBtn.removeEventListener(MouseEvent.CLICK, goBack);
GParams.gamePause = false;
removeClip();
}
public static function getInstance():HelpPage2{
if (helpPage2 == null){
helpPage2 = new (HelpPage2);
};
return (helpPage2);
}
}
}//package
Section 79
//HelpPage3 (HelpPage3)
package {
import flash.events.*;
import flash.display.*;
public class HelpPage3 extends HelpPage {
public var backBtn:SimpleButton;
public static var helpPage3:HelpPage3 = null;
public function HelpPage3(){
addFrameScript(0, frame1);
}
override public function removeClip(){
parent.removeChild(this);
}
override public function init(){
x = 0;
y = 0;
backBtn.addEventListener(MouseEvent.CLICK, goBack);
}
function frame1(){
stop();
}
override public function goBack(_arg1:MouseEvent){
backBtn.removeEventListener(MouseEvent.CLICK, goBack);
GParams.gamePause = false;
removeClip();
}
public static function getInstance():HelpPage3{
if (helpPage3 == null){
helpPage3 = new (HelpPage3);
};
return (helpPage3);
}
}
}//package
Section 80
//HelpPageFactory (HelpPageFactory)
package {
public class HelpPageFactory {
private static var helpPage:HelpPage;
private static var helpPageIndex:Number = -1;
private static var helpPageArray:Array = new Array(arraySize);
private static var arraySize:Number = 3;
public static function getHelpPageInstance(_arg1:Number):HelpPage{
switch (_arg1){
case 3:
helpPage = new HelpPage1();
return (helpPage);
case 6:
helpPage = new HelpPage2();
return (helpPage);
case 9:
helpPage = new HelpPage3();
return (helpPage);
};
return (null);
}
}
}//package
Section 81
//Hunter1 (Hunter1)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Hunter1 extends MovieClip {
private var distance:Number;
private var counter:Number;// = 0
private var maxCounter:Number;// = 0
private var walkStatus:Boolean;
private var xdist:Number;
public var timer:Timer;// = null
private var speed:Number;// = 8
public var health:Number;// = 30
private var attackStatus:Boolean;
public var halfWidth:Number;
private var standStatus:Boolean;
public var hitClip:MovieClip;
public var bhala:Bhala;// = null
private var dieStatus:Boolean;
public var halfHeight:Number;// = 72
private var ydist:Number;
private var moveDirection:Number;
public var attackClip:MovieClip;
private var isActive:Boolean;// = false
private var targetX:Number;// = 0
private var hitBananaStatus:Boolean;
public var dieClip:MovieClip;
public static var hunter1:Hunter1 = null;
public function Hunter1(){
halfWidth = Math.floor((width / 2));
halfHeight = 72;
timer = null;
health = 30;
speed = 8;
targetX = 0;
counter = 0;
maxCounter = 0;
isActive = false;
bhala = null;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5);
}
public function init(){
x = 700;
y = (GParams.stageHeight - halfHeight);
dieStatus = false;
hitBananaStatus = false;
maxCounter = GParams.stage_hunter1Attack_Timer[(GParams.currentLevel - 1)];
timer = new Timer(2000);
timer.addEventListener(TimerEvent.TIMER, afterSecond);
timer.reset();
timer.stop();
timer.start();
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function checkDistance(){
xdist = (Monkey.monkey.x - x);
ydist = (Monkey.monkey.y - y);
distance = Math.sqrt(((xdist * xdist) + (ydist * ydist)));
}
private function createBhala(){
if (bhala != null){
if (this.parent.contains(bhala)){
Bhala.bhala.removeBhala();
};
};
bhala = Bhala.getInstance();
this.parent.addChild(bhala);
bhala.init();
}
private function positionHunter1(){
if (!isActive){
setMoveDirection();
isActive = true;
gotoAndStop("walk");
walkStatus = true;
};
}
function frame3(){
stop();
}
function frame4(){
stop();
}
function frame1(){
stop();
}
private function afterSecond(_arg1:TimerEvent){
timer.removeEventListener(TimerEvent.TIMER, afterSecond);
positionHunter1();
}
private function setMoveDirection(){
var _local1:Number;
_local1 = 0;
if (_local1 == 0){
x = 550;
targetX = 50;
moveDirection = -1;
} else {
x = 50;
targetX = 550;
moveDirection = 1;
};
}
private function runHitClip(){
if (currentFrame == 3){
if (this.hitClip != null){
if (this.hitClip.currentFrame >= 6){
this.hitClip.gotoAndStop(1);
gotoAndStop(2);
hitBananaStatus = false;
changeDirection();
};
};
};
}
public function removeAllListener(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
if (timer != null){
timer.removeEventListener(TimerEvent.TIMER, afterSecond);
};
}
function frame5(){
stop();
}
private function changeDirection(){
if (moveDirection == 1){
targetX = 50;
moveDirection = -1;
} else {
targetX = 550;
moveDirection = 1;
};
}
public function hit_Banana(){
health = (health - 5);
if (health > 0){
hitBananaStatus = true;
gotoAndStop(3);
} else {
dieStatus = true;
gotoAndStop(4);
};
}
function frame2(){
stop();
}
private function moveHunter1(){
if (moveDirection == 1){
scaleX = -1;
if (x < targetX){
x = (x + speed);
} else {
isActive = false;
scaleX = 1;
gotoAndStop("stand");
standStatus = true;
attackStatus = false;
};
} else {
if (moveDirection == -1){
scaleX = 1;
if (x > targetX){
x = (x - speed);
} else {
isActive = false;
scaleX = -1;
gotoAndStop("stand");
standStatus = true;
attackStatus = false;
};
};
};
}
private function onEnterFrame(_arg1:Event){
if (hitBananaStatus){
runHitClip();
return;
};
if (dieStatus){
runDieClip();
return;
};
if (attackStatus){
runAttackClip();
};
checkDistance();
counter++;
if (((!(attackStatus)) && ((counter > maxCounter)))){
attackStatus = true;
gotoAndStop("attack");
};
}
private function runAttackClip(){
if (currentLabel == "attack"){
if (this.attackClip != null){
if (this.attackClip.currentFrame == 12){
createBhala();
};
if (this.attackClip.currentFrame >= 22){
this.attackClip.gotoAndStop(1);
gotoAndStop("stand");
counter = 0;
standStatus = true;
attackStatus = false;
};
};
};
}
private function runDieClip(){
if (currentFrame == 4){
if (this.dieClip != null){
if (this.dieClip.currentFrame >= 7){
this.dieClip.gotoAndStop(1);
gotoAndStop(2);
hitBananaStatus = false;
dieStatus = false;
};
};
};
}
public static function getInstance():Hunter1{
if (hunter1 == null){
hunter1 = new (Hunter1);
};
return (hunter1);
}
}
}//package
Section 82
//Hunter2 (Hunter2)
package {
import flash.events.*;
import flash.display.*;
public class Hunter2 extends MovieClip {
private var counter:Number;// = 0
private var maxCounter:Number;// = 0
public var aimClip:MovieClip;
public var health:Number;// = 30
private var attackStatus:Boolean;
public var halfWidth:Number;
public var stillMc:MovieClip;
private var standStatus:Boolean;
private var xdistance:Number;
public var standClip:MovieClip;
private var aimStatus:Boolean;
private var dieStatus:Boolean;
public var halfHeight:Number;// = 72
public var arrowWeapon:ArrowWeapon;// = null
public var attackClip:MovieClip;
public var angle:Number;
private var isActive:Boolean;// = false
private var hitBananaStatus:Boolean;
public var dieClip:MovieClip;
public static var hunter2:Hunter2 = null;
public function Hunter2(){
halfWidth = Math.floor((width / 2));
halfHeight = 72;
health = 30;
counter = 0;
maxCounter = 0;
isActive = false;
arrowWeapon = null;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5);
}
function frame1(){
stop();
}
public function init(){
x = 550;
y = (GParams.stageHeight - 100);
angle = -180;
dieStatus = false;
standStatus = false;
maxCounter = GParams.stage_hunter2Attack_Timer[(GParams.currentLevel - 1)];
positionHunter2();
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function positionHunter2(){
if (!isActive){
gotoAndStop("stand");
standStatus = true;
};
}
function frame3(){
stop();
}
function frame4(){
stop();
}
private function setAim(){
aimStatus = true;
isActive = true;
counter = 0;
}
function frame2(){
stop();
}
public function removeAllListener(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function runStandClip(){
if (currentLabel == "stand"){
if (this.standClip != null){
if (this.standClip.currentFrame >= 31){
this.standClip.gotoAndStop(1);
standStatus = false;
gotoAndStop("aim");
setAim();
};
};
};
}
function frame5(){
stop();
}
public function hit_Banana(){
health = (health - 5);
if (health > 0){
hitBananaStatus = true;
gotoAndStop(3);
} else {
dieStatus = true;
gotoAndStop(4);
};
}
private function runAttackClip(){
if (currentLabel == "attack"){
if (this.attackClip != null){
this.attackClip.rotation = angle;
if (this.attackClip.currentFrame == 4){
createArrowWeapon();
};
if (this.attackClip.currentFrame >= 13){
this.attackClip.gotoAndStop(1);
standStatus = true;
gotoAndStop("stand");
counter = 0;
attackStatus = false;
};
};
};
}
private function onEnterFrame(_arg1:Event){
var _local2:Number;
var _local3:Number;
var _local4:Number;
if (Monkey.monkey != null){
if (standStatus){
runStandClip();
};
if (attackStatus){
runAttackClip();
};
counter++;
xdistance = Math.abs((Monkey.monkey.stagePosition.x - x));
if (((((!(attackStatus)) && ((counter > maxCounter)))) && ((xdistance > 80)))){
attackStatus = true;
aimStatus = false;
gotoAndStop("attack");
isActive = false;
return;
};
if (isActive){
if (((aimStatus) && ((xdistance > 80)))){
_local2 = (Monkey.monkey.stagePosition.x - x);
_local3 = ((Monkey.monkey.stagePosition.y + 20) - y);
_local4 = Math.atan2(_local3, _local2);
angle = (Math.ceil(((_local4 / Math.PI) * 180)) - 180);
if (this.aimClip != null){
this.aimClip.rotation = angle;
};
} else {
if (this.aimClip != null){
this.aimClip.rotation = 0;
};
};
};
};
}
private function runDieClip(){
if (currentLabel == "die"){
if (this.dieClip != null){
if (this.dieClip.currentFrame >= 7){
this.dieClip.gotoAndStop(1);
gotoAndStop(2);
hitBananaStatus = false;
dieStatus = false;
};
};
};
}
private function createArrowWeapon(){
if (arrowWeapon != null){
if (this.parent.contains(arrowWeapon)){
ArrowWeapon.arrowWeapon.removeArrowWeapon();
};
};
arrowWeapon = ArrowWeapon.getInstance();
this.parent.addChildAt(arrowWeapon, 3);
arrowWeapon.init();
}
public static function getInstance():Hunter2{
if (hunter2 == null){
hunter2 = new (Hunter2);
};
return (hunter2);
}
}
}//package
Section 83
//LeopardDumb (LeopardDumb)
package {
import flash.events.*;
import flash.display.*;
public class LeopardDumb extends AnimalDumb {
public var hitClip:MovieClip;
public var attackClip:MovieClip;
public var dieClip:MovieClip;
public function LeopardDumb(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5);
standCountMax = 6;
}
function frame3(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
override public function onEnterFrame(_arg1:Event){
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:*;
_local2 = Math.abs((Monkey.monkey.x - x));
_local3 = Math.abs((Monkey.monkey.y - y));
_local4 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
if ((((currentFrame == 1)) || ((action == 0)))){
standCountCurrent = (standCountCurrent + 1);
if (standCountCurrent >= standCountMax){
jumpUpStatus = false;
jumpDownStatus = false;
attackStatus = false;
checkNextLine();
};
};
if (((((hitStatus) && (!(attackStatus)))) && (!(jumpDownStatus)))){
escapeHit();
hitStatus = false;
};
if (dieStatus){
if (currentFrame == 4){
if (this.dieClip != null){
if (this.dieClip.currentFrame >= 20){
removeClip();
dieStatus = false;
};
};
};
return;
};
if (!dieStatus){
if (((((((!(attackStatus)) && (!(jumpUpStatus)))) && (!(jumpDownStatus)))) && (!((action == 0))))){
if (_local4 < 100){
attackStatus = true;
jumpUpStatus = true;
jumpx = -10;
action = 2;
gotoAndStop(5);
};
};
if (attackStatus){
if (currentFrame == 5){
if (this.attackClip != null){
if (jumpUpStatus){
this.attackClip.gotoAndPlay(1);
};
if (jumpDownStatus){
this.attackClip.gotoAndPlay(14);
};
};
};
};
if (hitBananaStatus){
if (currentFrame == 3){
if (this.hitClip != null){
if (this.hitClip.currentFrame >= 3){
this.hitClip.gotoAndStop(1);
if (speedx < 20){
speedx = (speedx + 5);
};
gotoAndStop(2);
hitBananaStatus = false;
};
};
};
};
if (action == 1){
turnStatus = false;
if (xMoveType == 1){
attackStatus = false;
scaleX = -1;
if ((x + halfWidth) < targetEndx){
if (speedx > 4){
speedx = (speedx - 0.5);
};
x = (x + speedx);
y = starty;
} else {
x = (targetEndx - halfWidth);
y = starty;
speedx = 4;
chaseMonkeyStatus = false;
standAnimal();
attackStatus = false;
jumpUpStatus = false;
jumpDownStatus = false;
};
return;
};
if (xMoveType == -1){
attackStatus = false;
scaleX = 1;
if ((x - halfWidth) > targetEndx){
if (speedx > 4){
speedx = (speedx - 0.5);
};
x = (x - speedx);
y = starty;
} else {
x = (targetEndx + halfWidth);
y = starty;
speedx = 4;
chaseMonkeyStatus = false;
standAnimal();
attackStatus = false;
jumpUpStatus = false;
jumpDownStatus = false;
};
return;
};
};
if (action == 2){
if (xMoveType == 1){
scaleX = -1;
if (speedx < 14){
speedx = (speedx + 2);
};
x = (x + speedx);
};
if (xMoveType == -1){
scaleX = 1;
if (speedx < 14){
speedx = (speedx + 2);
};
x = (x - speedx);
};
if (jumpUpStatus){
y = (y + jumpx);
jumpx = (jumpx + 1);
if (jumpx >= 0){
jumpUpStatus = false;
jumpDownStatus = true;
jumpx = 0;
};
};
if (jumpDownStatus){
if (jumpx < 10){
jumpx = (jumpx + 1);
};
if (y < starty){
y = (y + jumpx);
} else {
_local5 = 1;
while (_local5 < 50) {
if ((y - _local5) > starty){
y = (y - _local5);
};
_local5++;
};
jumpUpStatus = false;
jumpDownStatus = false;
jumpx = 0;
gotoAndStop(2);
action = 1;
};
};
};
};
}
override public function init(_arg1:Number, _arg2:Number, _arg3:Number){
super.initsuper();
halfWidth = 48;
halfHeight = 22;
hitStatus = false;
dieStatus = false;
chaseMonkeyStatus = false;
currentLine = _arg1;
health = _arg2;
lineDimension = GParams.game_Path_Dimension[(GParams.currentLevel - 1)];
if (_arg3 == 1){
startx = lineDimension[_arg1][0];
starty = (lineDimension[_arg1][1] - halfHeight);
targetEndx = (startx + lineDimension[_arg1][2]);
xMoveType = 1;
scaleX = 1;
x = startx;
y = starty;
} else {
if (_arg3 == -1){
targetEndx = lineDimension[_arg1][0];
startx = (targetEndx + lineDimension[_arg1][2]);
starty = (lineDimension[_arg1][1] - halfHeight);
xMoveType = -1;
scaleX = -1;
x = (startx - halfWidth);
y = starty;
};
};
gotoAndStop(2);
trace(("dumbMongoes - x =" + x));
trace(("dumbMongoes - y =" + y));
speedx = 4;
action = 1;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
override public function hit_Banana(){
health = (health - 8);
if (health > 0){
hitBananaStatus = true;
gotoAndStop(3);
} else {
MainClass.gameScore = (MainClass.gameScore + GParams.WILDBOREDUMBSCORE);
ScoreClip.scoreClip.updateScore();
dieStatus = true;
Bg1.bg1.removeLeopardReference();
gotoAndStop(4);
};
}
}
}//package
Section 84
//LifeClip (LifeClip)
package {
import flash.display.*;
import flash.text.*;
public class LifeClip extends MovieClip {
public var lifeNum:TextField;
public static var lifeClip:LifeClip = null;
public function init(){
gotoAndStop(1);
x = 270;
y = 5;
}
public function updateLife(){
if (Monkey.monkey.life > 0){
lifeNum.text = (Monkey.monkey.life - 1).toString();
};
}
public static function getInstance():LifeClip{
if (lifeClip == null){
lifeClip = new (LifeClip);
};
return (lifeClip);
}
}
}//package
Section 85
//MainClass (MainClass)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.net.*;
import flash.ui.*;
public class MainClass extends Sprite {
private var scoreClip:ScoreClip;// = null
private var welcomePage:Welcome;// = null
private var stageRect_Bottom:Number;
private var youWin:YouWin;// = null
var welcome:Welcome;
public var helpPage:HelpPage;// = null
private var enemyHealthClip:EnemyHealthClip;// = null
private var lifeClip:LifeClip;// = null
private var scrollDownSpeed:Number;// = 2
public var bg1:Bg1;// = null
private var powerUpTimer:Timer;// = null
public var hunter1:Hunter1;// = null
private var coconut:Coconut;// = null
public var hunter2:Hunter2;// = null
public var welcomeSound:WelcomeSound;// = null
public var bgs:BGSound;// = null
public var youWinSound:YouWinSound;// = null
public var monkey:Monkey;// = null
private var healthClip:HealthClip;// = null
private var scrollUpSpeed:Number;// = 2
private var gameOver:GameOver;// = null
var _channel:SoundChannel;
public static var gameScore:Number = 0;
public static var initScrollRect:Boolean = false;
public static var upKeyDown:Boolean = false;
public static var levelEndStatus:Boolean = false;
public static var rescueKeyDown:Boolean = false;
public static var powerUpStatus:Boolean = false;
public static var leftKeyDown:Boolean = false;
public static var gameEndStatus:Boolean = false;
public static var downKeyDown:Boolean = false;
public static var rightKeyDown:Boolean = false;
public static var scrollRectangle:Rectangle = null;
public static var rhinoHornStatus:Boolean = false;
public static var attackKeyDown:Boolean = false;
public static var spaceKeyDown:Boolean = false;
public function MainClass(){
bg1 = null;
helpPage = null;
bgs = null;
welcomeSound = null;
youWinSound = null;
monkey = null;
hunter1 = null;
hunter2 = null;
coconut = null;
powerUpTimer = null;
scrollUpSpeed = 2;
scrollDownSpeed = 2;
welcomePage = null;
scoreClip = null;
gameOver = null;
youWin = null;
healthClip = null;
lifeClip = null;
enemyHealthClip = null;
super();
bgs = new BGSound();
welcomeSound = new WelcomeSound();
createWelcome();
}
public function createHealthClip(){
healthClip = HealthClip.getInstance();
healthClip.init();
addChild(healthClip);
if (GParams.currentLevel == 9){
healthClip.x = 750;
};
}
public function createEnemyHealthClip(){
removeEnemyHealthClip();
if (GParams.currentLevel == 6){
enemyHealthClip = EnemyHealthClip.getInstance();
enemyHealthClip.init();
addChild(enemyHealthClip);
};
}
public function clickPlayAgain(_arg1:MouseEvent){
clearGraphics();
createWelcome();
}
function checkMouseClick(_arg1:MouseEvent){
stage.focus = this;
stage.stageFocusRect = false;
}
public function checkEnemies(){
Bg1.bg1.checkEnemies();
}
public function nextLevel(){
clearGraphics();
GParams.currentLevel++;
createBGS();
createHero();
createHunters();
createHealthClip();
createEnemyHealthClip();
createLifeClip();
createScoreClip();
createHelpPage();
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownEvent);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpEvent);
addEventListener(MouseEvent.CLICK, checkMouseClick);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
levelEndStatus = false;
initScrollRect = false;
gameEndStatus = false;
}
public function init(){
stage.scaleMode = StageScaleMode.NO_SCALE;
clearGraphics();
Monkey.monkey = null;
MainClass.gameScore = 0;
createBGS();
createHero();
monkey.life = GParams.MONKEY_LIFE;
monkey.health = GParams.MONKEY_HEALTH;
createHunters();
createHealthClip();
createLifeClip();
createEnemyHealthClip();
createScoreClip();
createHelpPage();
startLevel();
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownEvent);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpEvent);
addEventListener(MouseEvent.CLICK, checkMouseClick);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
levelEndStatus = false;
initScrollRect = false;
rhinoHornStatus = false;
gameEndStatus = false;
GParams.restartStatus = false;
_channel = bgs.play();
_channel.addEventListener(Event.SOUND_COMPLETE, completeBGSHandler);
}
public function removeLifeClip(){
if (lifeClip != null){
if (this.contains(lifeClip)){
this.removeChild(lifeClip);
};
lifeClip = null;
};
}
public function createGameOver(){
Mouse.show();
clearGraphics();
_channel.stop();
_channel.removeEventListener(Event.SOUND_COMPLETE, completeBGSHandler);
gameOver = GameOver.getInstance();
addChild(gameOver);
gameOver.init();
gameOver.playAgain1.addEventListener(MouseEvent.CLICK, clickPlayAgain);
gameOver.submitScore.addEventListener(MouseEvent.CLICK, submitScoreGameOver);
}
public function createHunter1(){
hunter1 = Hunter1.getInstance();
addChild(hunter1);
hunter1.init();
}
public function createHero(){
monkey = Monkey.getInstance();
Bg1.bg1.addChild(monkey);
monkey.init();
}
public function createHunter2(){
hunter2 = Hunter2.getInstance();
addChild(hunter2);
hunter2.init();
}
public function createBGS(){
bg1 = Bg1.getInstance();
bg1.init();
stageRect_Bottom = (GParams.surfaceBg_Height[(GParams.currentLevel - 1)] - GParams.stageHeight);
scrollRectangle = new Rectangle(0, stageRect_Bottom, GParams.bgViewWidth, GParams.bgViewHeight);
bg1.scrollRect = scrollRectangle;
addChild(bg1);
}
public function removeWelcome(){
if (welcomePage != null){
if (this.contains(welcomePage)){
welcomePage.ipwelcome.playGame.removeEventListener(MouseEvent.CLICK, gotoLEVEL1);
welcomePage.ipwelcome.intro.removeEventListener(MouseEvent.CLICK, instruction);
welcomePage.ipwelcome.highscore.removeEventListener(MouseEvent.CLICK, fetchHighScore);
_channel.stop();
_channel.removeEventListener(Event.SOUND_COMPLETE, welcomeHandler);
removeChild(welcomePage);
};
};
}
public function startLevel(){
switch (GParams.currentLevel){
case 1:
break;
case 2:
break;
};
}
public function sendData(_arg1:String, _arg2:Number):Boolean{
var request:URLRequest;
var variables:URLVariables;
var playerName = _arg1;
var score = _arg2;
try {
request = new URLRequest("http://www.flasharcade.com/setscores.php");
request.method = URLRequestMethod.POST;
variables = new URLVariables();
variables.scoreName = playerName;
variables.scoreText = score;
variables.gameId = "ace022";
variables.gameName = "Jungle";
request.data = variables;
sendToURL(request);
} catch(e:Error) {
youWin.setErrorMesg("Could not submit the score");
return (false);
} catch(e:SecurityError) {
youWin.setErrorMesg("Security Error ");
return (false);
};
return (true);
}
public function createHunters(){
var _local1:Array;
_local1 = GParams.stage_Enemy_Avail[(GParams.currentLevel - 1)];
if (_local1[7] == 1){
createHunter1();
} else {
removeHunter1();
};
if (_local1[8] == 1){
createHunter2();
} else {
removeHunter2();
};
}
public function removeEnemyHealthClip(){
if (enemyHealthClip != null){
if (this.contains(enemyHealthClip)){
this.removeChild(enemyHealthClip);
};
enemyHealthClip = null;
};
}
public function createScoreClip(){
scoreClip = ScoreClip.getInstance();
addChild(scoreClip);
scoreClip.init();
if ((((GParams.currentLevel == 6)) || ((GParams.currentLevel == 9)))){
scoreClip.x = 750;
};
}
public function keyUpEvent(_arg1:KeyboardEvent){
var _local2:Number;
_local2 = _arg1.keyCode;
switch (_local2){
case 37:
leftKeyDown = false;
break;
case 32:
spaceKeyDown = false;
break;
case 38:
upKeyDown = false;
break;
case 40:
downKeyDown = false;
break;
case 39:
rightKeyDown = false;
break;
case 65:
attackKeyDown = false;
break;
case 83:
rescueKeyDown = false;
break;
};
}
public function youWinHandler(_arg1:Event){
_channel.removeEventListener(Event.SOUND_COMPLETE, youWinHandler);
}
public function createYouWin(){
Mouse.show();
clearGraphics();
youWin = YouWin.getInstance();
youWinSound = new YouWinSound();
youWin.updateScores();
addChild(youWin);
youWin.playAgain.addEventListener(MouseEvent.CLICK, clickPlayAgain);
youWin.submitScore.addEventListener(MouseEvent.CLICK, submitScore);
_channel.stop();
_channel = youWinSound.play();
_channel.addEventListener(Event.SOUND_COMPLETE, youWinHandler);
}
public function fetchHighScore(_arg1:MouseEvent){
var _local2:URLRequest;
var _local3:URLLoader;
var _local4:URLVariables;
welcomePage.setChildIndex(welcomePage.hs, 2);
welcomePage.emptyScores();
_local2 = new URLRequest("http://www.flasharcade.com/getscoresas3.php");
_local2.method = URLRequestMethod.POST;
_local3 = new URLLoader();
_local3.dataFormat = URLLoaderDataFormat.VARIABLES;
_local4 = new URLVariables();
_local4.gameId = "ace022";
_local2.data = _local4;
_local3.load(_local2);
_local3.addEventListener(Event.COMPLETE, completeHandler);
welcomePage.hs.backhs.addEventListener(MouseEvent.CLICK, playWelcome);
}
public function submitScore(_arg1:MouseEvent){
var _local2:String;
var _local3:Number;
youWin.setErrorMesg("");
_local2 = null;
_local2 = youWin.getPlayerName();
_local3 = gameScore;
if ((((_local2 == null)) || ((_local2 == "")))){
youWin.setErrorMesg("Please enter your name");
} else {
if (sendData(_local2, _local3) == false){
return;
};
displayHighScoreScreen();
};
}
public function submitScoreGameOver(_arg1:MouseEvent){
var _local2:String;
var _local3:Number;
gameOver.setErrorMesg("");
_local2 = null;
_local2 = gameOver.getPlayerName();
_local3 = gameScore;
if ((((_local2 == null)) || ((_local2 == "")))){
gameOver.setErrorMesg("Please enter your name");
} else {
if (sendData(_local2, _local3) == false){
return;
};
displayHighScoreScreen();
};
}
private function checkGameEnd(){
if (gameEndStatus){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
createGameOver();
gameEndStatus = false;
return;
};
}
public function removeGameOver(){
if (gameOver != null){
if (this.contains(gameOver)){
gameOver.removeAllListener();
gameOver.playAgain1.removeEventListener(MouseEvent.CLICK, clickPlayAgain);
gameOver.submitScore.removeEventListener(MouseEvent.CLICK, submitScoreGameOver);
removeChild(gameOver);
};
gameOver = null;
};
}
public function keyDownEvent(_arg1:KeyboardEvent){
var _local2:Number;
_local2 = _arg1.keyCode;
switch (_local2){
case 37:
leftKeyDown = true;
break;
case 32:
spaceKeyDown = true;
break;
case 38:
upKeyDown = true;
break;
case 40:
downKeyDown = true;
break;
case 39:
rightKeyDown = true;
break;
case 65:
attackKeyDown = true;
break;
case 83:
rescueKeyDown = true;
break;
};
}
public function instruction(_arg1:MouseEvent){
welcomePage.setChildIndex(welcomePage.introframe, 2);
welcomePage.introframe.backintro.addEventListener(MouseEvent.CLICK, playWelcome);
}
public function gotoLEVEL1(_arg1:MouseEvent){
GParams.currentLevel = 1;
init();
}
public function removeHealthClip(){
if (healthClip != null){
if (this.contains(healthClip)){
this.removeChild(healthClip);
};
healthClip = null;
};
}
public function removeHero(){
if (monkey != null){
if (Bg1.bg1.contains(monkey)){
monkey.clearAllListeners();
Bg1.bg1.removeChild(monkey);
monkey = null;
};
};
}
public function removeHunter1(){
if (hunter1 != null){
if (this.contains(hunter1)){
hunter1.removeAllListener();
this.removeChild(hunter1);
hunter1 = null;
};
};
}
public function playWelcome(_arg1:MouseEvent){
welcomePage.setChildIndex(welcomePage.ipwelcome, 2);
}
public function removeHunter2(){
if (hunter2 != null){
if (this.contains(hunter2)){
hunter2.removeAllListener();
this.removeChild(hunter2);
};
hunter2 = null;
};
}
public function welcomeHandler(_arg1:Event){
_channel.removeEventListener(Event.SOUND_COMPLETE, welcomeHandler);
_channel = welcomeSound.play();
_channel.addEventListener(Event.SOUND_COMPLETE, welcomeHandler);
}
public function removeBGS(){
if (bg1 != null){
if (this.contains(bg1)){
bg1.clearGraphics();
this.removeChild(bg1);
};
bg1 = null;
};
}
public function onEnterFrame(_arg1:Event){
var _local2:Rectangle;
var _local3:Number;
checkLevelEnd();
if (!levelEndStatus){
checkGameEnd();
_local2 = null;
_local2 = Bg1.bg1.scrollRect;
if (((upKeyDown) && (Monkey.monkey.climbStatus))){
_local2 = Bg1.bg1.scrollRect;
_local2.y = (_local2.y - 2);
Bg1.bg1.scrollRect = _local2;
};
if (((downKeyDown) && (Monkey.monkey.climbStatus))){
_local2 = Bg1.bg1.scrollRect;
_local2.y = (_local2.y + 2);
Bg1.bg1.scrollRect = _local2;
};
_local3 = Math.ceil((GParams.stageHeight / 2));
if (Monkey.monkey.slideDownStatus){
_local2 = Bg1.bg1.scrollRect;
_local2.y = (_local2.y + 1);
Bg1.bg1.scrollRect = _local2;
};
if (GParams.currentLevel == 8){
if (Monkey.monkey.sliderCollisionStatus){
if (Monkey.monkey.stagePosition.y < 100){
_local2 = Bg1.bg1.scrollRect;
_local2.y = (_local2.y - 50);
Bg1.bg1.scrollRect = _local2;
};
};
};
if (Monkey.monkey.slideUpStatus){
_local2 = Bg1.bg1.scrollRect;
_local2.y = (_local2.y - 1);
Bg1.bg1.scrollRect = _local2;
};
if ((((((Monkey.monkey.action == 1)) && ((Monkey.monkey.stagePosition.y < _local3)))) && ((_local2.y > -50)))){
if (((!(Monkey.monkey.slideUpStatus)) || (!(Monkey.monkey.slideDownStatus)))){
_local2 = Bg1.bg1.scrollRect;
_local2.y = (_local2.y - 1);
Bg1.bg1.scrollRect = _local2;
};
};
if (((((((Monkey.monkey.fallStatus) || (Monkey.monkey.climbHitStatus))) && ((Monkey.monkey.stagePosition.y > _local3)))) && ((_local2.y < stageRect_Bottom)))){
_local2 = bg1.scrollRect;
_local2.y = (_local2.y + 8);
Bg1.bg1.scrollRect = _local2;
};
if (_local2.y < -50){
_local2.y = -50;
Bg1.bg1.scrollRect = _local2;
};
if (_local2.y > stageRect_Bottom){
_local2.y = stageRect_Bottom;
Bg1.bg1.scrollRect = _local2;
};
if (MainClass.initScrollRect){
_local2.y = stageRect_Bottom;
Bg1.bg1.scrollRect = _local2;
MainClass.initScrollRect = false;
};
};
}
private function completeHandler(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
var _local4:URLLoader;
var _local5:String;
var _local6:Array;
_local3 = 0;
_local4 = URLLoader(_arg1.target);
_local5 = "";
_local6 = null;
if (_local4.data.data0 != undefined){
_local6 = _local4.data.data0.split("|", 3);
welcomePage.hs.player1.text = _local6[0];
welcomePage.hs.score1.text = _local6[1];
welcomePage.hs.date1.text = _local6[2];
};
if (_local4.data.data1 != undefined){
_local6 = _local4.data.data1.split("|", 3);
welcomePage.hs.player2.text = _local6[0];
welcomePage.hs.score2.text = _local6[1];
welcomePage.hs.date2.text = _local6[2];
};
if (_local4.data.data2 != undefined){
_local6 = _local4.data.data2.split("|", 3);
welcomePage.hs.player3.text = _local6[0];
welcomePage.hs.score3.text = _local6[1];
welcomePage.hs.date3.text = _local6[2];
};
if (_local4.data.data3 != undefined){
_local6 = _local4.data.data3.split("|", 3);
welcomePage.hs.player4.text = _local6[0];
welcomePage.hs.score4.text = _local6[1];
welcomePage.hs.date4.text = _local6[2];
};
if (_local4.data.data4 != undefined){
_local6 = _local4.data.data4.split("|", 3);
welcomePage.hs.player5.text = _local6[0];
welcomePage.hs.score5.text = _local6[1];
welcomePage.hs.date5.text = _local6[2];
};
if (_local4.data.data5 != undefined){
_local6 = _local4.data.data5.split("|", 3);
welcomePage.hs.player6.text = _local6[0];
welcomePage.hs.score6.text = _local6[1];
welcomePage.hs.date6.text = _local6[2];
};
if (_local4.data.data6 != undefined){
_local6 = _local4.data.data6.split("|", 3);
welcomePage.hs.player7.text = _local6[0];
welcomePage.hs.score7.text = _local6[1];
welcomePage.hs.date7.text = _local6[2];
};
if (_local4.data.data7 != undefined){
_local6 = _local4.data.data7.split("|", 3);
welcomePage.hs.player8.text = _local6[0];
welcomePage.hs.score8.text = _local6[1];
welcomePage.hs.date8.text = _local6[2];
};
if (_local4.data.data8 != undefined){
_local6 = _local4.data.data8.split("|", 3);
welcomePage.hs.player9.text = _local6[0];
welcomePage.hs.score9.text = _local6[1];
welcomePage.hs.date9.text = _local6[2];
};
if (_local4.data.data9 != undefined){
_local6 = _local4.data.data9.split("|", 3);
welcomePage.hs.player10.text = _local6[0];
welcomePage.hs.score10.text = _local6[1];
welcomePage.hs.date10.text = _local6[2];
};
}
public function createWelcome(){
welcomePage = Welcome.getInstance();
welcomePage.setChildIndex(welcomePage.ipwelcome, 2);
addChild(welcomePage);
welcomePage.x = GParams.stageCenter.x;
welcomePage.y = GParams.stageCenter.y;
welcomePage.ipwelcome.playGame.addEventListener(MouseEvent.CLICK, gotoLEVEL1);
welcomePage.ipwelcome.intro.addEventListener(MouseEvent.CLICK, instruction);
welcomePage.ipwelcome.highscore.addEventListener(MouseEvent.CLICK, fetchHighScore);
_channel = welcomeSound.play();
_channel.addEventListener(Event.SOUND_COMPLETE, welcomeHandler);
}
public function completeBGSHandler(_arg1:Event){
_channel.removeEventListener(Event.SOUND_COMPLETE, completeBGSHandler);
_channel = bgs.play();
_channel.addEventListener(Event.SOUND_COMPLETE, completeBGSHandler);
}
public function displayHighScoreScreen(){
createWelcome();
fetchHighScore(null);
welcomePage.setChildIndex(welcomePage.hs, 2);
}
public function removeScoreClip(){
if (scoreClip != null){
if (this.contains(scoreClip)){
this.removeChild(scoreClip);
};
scoreClip = null;
};
}
public function removeYouWin(){
if (youWin != null){
if (this.contains(youWin)){
youWin.playAgain.removeEventListener(MouseEvent.CLICK, clickPlayAgain);
youWin.submitScore.removeEventListener(MouseEvent.CLICK, submitScore);
_channel.stop();
_channel.removeEventListener(Event.SOUND_COMPLETE, youWinHandler);
removeChild(youWin);
};
};
}
public function createLifeClip(){
lifeClip = LifeClip.getInstance();
addChild(lifeClip);
lifeClip.init();
lifeClip.updateLife();
if (GParams.currentLevel == 9){
lifeClip.x = 750;
};
}
private function checkLevelEnd(){
if (MainClass.levelEndStatus){
if (GParams.currentLevel < 9){
nextLevel();
} else {
if (GParams.currentLevel == 9){
createYouWin();
};
};
};
}
public function createHelpPage(){
if ((((((GParams.currentLevel == 3)) || ((GParams.currentLevel == 6)))) || ((GParams.currentLevel == 9)))){
if (GParams.restartStatus != true){
helpPage = HelpPageFactory.getHelpPageInstance(GParams.currentLevel);
addChild(helpPage);
helpPage.init();
} else {
GParams.gamePause = false;
GParams.restartStatus = false;
};
};
}
public function clearGraphics(){
leftKeyDown = false;
spaceKeyDown = false;
upKeyDown = false;
downKeyDown = false;
rightKeyDown = false;
attackKeyDown = false;
removeGameOver();
removeYouWin();
removeWelcome();
removeHunter2();
removeHunter1();
removeHealthClip();
removeLifeClip();
removeScoreClip();
removeHero();
removeBGS();
stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownEvent);
stage.removeEventListener(KeyboardEvent.KEY_UP, keyUpEvent);
removeEventListener(MouseEvent.CLICK, checkMouseClick);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
}
}//package
Section 86
//MongoesAverage (MongoesAverage)
package {
import flash.events.*;
import flash.display.*;
public class MongoesAverage extends AnimalAverage {
public var hitClip:MovieClip;
public var mongooserun:MovieClip;
public var dieClip:MovieClip;
public function MongoesAverage(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
}
function frame2(){
stop();
}
function frame3(){
stop();
}
function frame4(){
stop();
}
function frame1(){
stop();
}
override public function onEnterFrame(_arg1:Event){
if (hitBananaStatus){
if (currentFrame == 3){
if (this.hitClip != null){
if (this.hitClip.currentFrame >= 6){
this.hitClip.gotoAndStop(1);
if (speedx < 6){
speedx = (speedx + 1.5);
};
gotoAndStop(2);
hitBananaStatus = false;
};
};
};
return;
};
if (dieStatus){
if (currentFrame == 4){
if (this.dieClip != null){
if (this.dieClip.currentFrame >= 21){
removeClip();
return;
};
};
};
return;
} else {
if (action == 2){
if (jumpUpStatus){
y = (y + jumpHeight);
jumpHeight = (jumpHeight + 1);
if (jumpHeight >= 0){
jumpHeight = 0;
jumpUpStatus = false;
jumpDownStatus = true;
};
x = (x + ((jumpx - x) / 12));
return;
};
if (jumpDownStatus){
if (jumpHeight <= 5){
jumpHeight = (jumpHeight + 1);
};
y = (y + jumpHeight);
x = (x + ((jumpx - x) / 12));
if (y > starty){
y = starty;
jumpHeight = -10;
jumpDownStatus = false;
action = 1;
};
return;
};
};
if (action == 1){
if (xMoveType == 1){
scaleX = -1;
if ((x + halfWidth) < targetEndx){
x = (x + speedx);
} else {
x = (((targetEndx - halfWidth) - speedx) - 5);
action = 0;
speedx = 4;
checkNextLine();
};
return;
} else {
if (xMoveType == -1){
scaleX = 1;
if ((x - halfWidth) > targetEndx){
x = (x - speedx);
} else {
x = (((targetEndx + halfWidth) + speedx) + 5);
action = 0;
speedx = 4;
checkNextLine();
};
return;
} else {
trace(" Error!! Move type is wrong");
};
};
};
};
}
override public function init(_arg1:Number, _arg2:Number, _arg3:Number){
halfWidth = 36;
halfHeight = 16;
jumpHeight = -10;
hitStatus = false;
dieStatus = false;
currentLine = _arg1;
health = _arg2;
attackStatus = false;
hitBananaStatus = false;
lineDimension = GParams.game_Path_Dimension[(GParams.currentLevel - 1)];
if (_arg3 == 1){
startx = (lineDimension[_arg1][0] + (lineDimension[_arg1][2] / 2));
starty = (lineDimension[_arg1][1] - halfHeight);
targetEndx = (startx + lineDimension[_arg1][2]);
xMoveType = 1;
scaleX = 1;
x = startx;
y = starty;
} else {
targetEndx = lineDimension[_arg1][0];
startx = (targetEndx + (lineDimension[_arg1][2] / 2));
starty = (lineDimension[_arg1][1] - halfHeight);
xMoveType = -1;
scaleX = -1;
x = (startx - halfWidth);
y = starty;
};
gotoAndStop(2);
speedx = 4;
action = 1;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
trace((" has listener : " + this.hasEventListener(Event.ENTER_FRAME)));
trace((" will trigger : " + this.willTrigger(Event.ENTER_FRAME)));
}
override public function hit_Banana(){
if (!dieStatus){
health = (health - 10);
if (health > 0){
hitBananaStatus = true;
gotoAndStop(3);
} else {
MainClass.gameScore = (MainClass.gameScore + GParams.MONGOESAVGSCORE);
ScoreClip.scoreClip.updateScore();
dieStatus = true;
Bg1.bg1.removeMongoesReference();
gotoAndStop(4);
};
};
}
override public function removeClip(){
x = 1500;
y = 1500;
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
if (Bg1.bg1.contains(this)){
Bg1.bg1.removeChild(this);
};
}
}
}//package
Section 87
//MongoesDumb (MongoesDumb)
package {
import flash.events.*;
import flash.display.*;
public class MongoesDumb extends AnimalDumb {
public var hitClip:MovieClip;
public var mongooserun:MovieClip;
public var dieClip:MovieClip;
public function MongoesDumb(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
}
function frame3(){
stop();
}
function frame4(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
override public function onEnterFrame(_arg1:Event){
if ((((currentFrame == 1)) && ((action == 0)))){
standCountCurrent = (standCountCurrent + 1);
if (standCountCurrent >= standCountMax){
checkNextLine();
};
};
if (dieStatus){
if (currentFrame == 4){
if (this.dieClip != null){
trace("inside dieclip");
if (this.dieClip.currentFrame >= 21){
trace(("dieclip frame = " + this.dieClip.currentFrame));
removeClip();
return;
};
};
};
return;
};
if (!dieStatus){
if (hitBananaStatus){
if (currentFrame == 3){
if (this.hitClip != null){
trace("inside hitclip");
if (this.hitClip.currentFrame >= 6){
trace(("hitclip frame = " + this.hitClip.currentFrame));
this.hitClip.gotoAndStop(1);
if (speedx < maxSpeed){
speedx = (speedx + 0.25);
};
gotoAndStop(2);
if (currentLine != Monkey.monkey.currentLineIndex){
escapeHit();
};
hitBananaStatus = false;
};
};
};
return;
};
checkMonkeyPosition();
if (action == 1){
turnStatus = false;
if (xMoveType == 1){
scaleX = -1;
if ((x + halfWidth) < targetEndx){
if (speedx < maxSpeed){
speedx = (speedx + 0.25);
};
x = (x + speedx);
} else {
x = ((targetEndx - halfWidth) - speedx);
speedx = 0.25;
standAnimal();
chaseMonkeyStatus = false;
};
return;
};
if (xMoveType == -1){
scaleX = 1;
if ((x - halfWidth) > targetEndx){
if (speedx < maxSpeed){
speedx = (speedx + 0.25);
};
x = (x - speedx);
} else {
x = ((targetEndx + halfWidth) + speedx);
speedx = 0.25;
chaseMonkeyStatus = false;
standAnimal();
};
return;
};
};
};
}
override public function init(_arg1:Number, _arg2:Number, _arg3:Number){
super.initsuper();
halfWidth = 36;
halfHeight = 16;
hitStatus = false;
dieStatus = false;
counter = 0;
maxCounter = 100;
chaseMonkeyStatus = false;
currentLine = _arg1;
health = _arg2;
lineDimension = GParams.game_Path_Dimension[(GParams.currentLevel - 1)];
if (_arg3 == 1){
startx = lineDimension[_arg1][0];
starty = (lineDimension[_arg1][1] - halfHeight);
targetEndx = (startx + lineDimension[_arg1][2]);
xMoveType = 1;
scaleX = -1;
x = (startx + 30);
y = starty;
} else {
if (_arg3 == -1){
targetEndx = lineDimension[_arg1][0];
startx = (targetEndx + lineDimension[_arg1][2]);
starty = (lineDimension[_arg1][1] - halfHeight);
xMoveType = -1;
scaleX = 1;
x = ((startx - halfWidth) - 30);
y = starty;
};
};
gotoAndStop(2);
trace(("dumbMongoes - x =" + x));
trace(("dumbMongoes - y =" + y));
maxSpeed = (Math.ceil(lineDimension[_arg1][2]) / 150);
speedx = 0.25;
action = 1;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
standCountCurrent = 0;
}
override public function hit_Banana(){
if (!dieStatus){
health = (health - 10);
if (health > 0){
hitBananaStatus = true;
gotoAndStop(3);
} else {
MainClass.gameScore = (MainClass.gameScore + GParams.MONGOESDUMBSCORE);
ScoreClip.scoreClip.updateScore();
dieStatus = true;
Bg1.bg1.removeMongoesReference();
gotoAndStop(4);
};
};
}
}
}//package
Section 88
//Monkey (Monkey)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
public class Monkey extends MovieClip {
public var current_Climber_Dimension:Array;
private var jumpDownStatus:Boolean;// = false
public var duckStatus:Boolean;// = false
private var nextSlideJumpX:Number;
public var stand3Clip:MovieClip;
private var nextSlideJumpY:Number;
public var jumpRightStatus:Boolean;// = false
public var climbHitStatus:Boolean;// = false
public var action:Number;// = 0
private var minX:Number;// = 0
private var speed:Number;// = 5
public var attackStatus:Boolean;// = false
public var health:Number;
private var jumpProgressStatus:Boolean;// = false
public var stagePosition:Point;
private var climberPositionx:Number;// = -1
public var current_LevelEnd_Position:Point;
public var stand2Clip:MovieClip;
public var attackCounter:uint;// = 0
public var powerUpStatus:Boolean;// = false
public var sliderCollisionStatus:Boolean;// = false
private var endBananaLineX:Number;
public var fallRightStatus:Boolean;// = false
public var jumpFlag:Boolean;// = true
private var jumpUpStatus:Boolean;// = false
private var climberHA:MovieClip;// = null
public var dieStatus:Boolean;// = false
private var climberClip:MovieClip;
public var fallLeftStatus:Boolean;// = false
private var time:Timer;
public var actualPosition:Point;
public var hangClip:MovieClip;
private var jumpHeight:Number;// = -16
public var climbStatusNum:Number;// = 0
public var hangStatus:Boolean;// = false
public var stand1Clip:MovieClip;
public var climbStatus:Boolean;// = false
public var life:Number;
public var walkStatus:Boolean;// = false
private var jumpxCount:Number;// = 8
private var bossClimberRight:Array;
private var standMaximumCounter:Number;// = 200
public var slideUpStatus:Boolean;// = false
private var currentBananaLineY:Number;
public var halfHeight:Number;
private var currentBananaLineX:Number;
public var halfWidth:Number;
public var ropeYpos:Number;// = 0
private var bottomBananaLineY:Number;
private var bossClimberArray:Array;
public var hitStatus:Boolean;// = false
private var inity:Number;// = 0
public var current_Path_Dimension:Array;
private var climberTopyPos:Number;// = 0
public var fallStatus:Boolean;// = true
public var scrollSpeed:Number;// = 0
private var maxX:Number;// = 0
public var rescueStatus:Boolean;// = false
public var hitClip:MovieClip;
public var fallSpeed:Number;// = 16
public var stand4Clip:MovieClip;
public var fallHitClip:MovieClip;
public var actualBodyPosition:Point;
private var climberBottomyPos:Number;// = 0
public var body:MovieClip;
private var nextBananaLineX:Number;
public var jumpLeftStatus:Boolean;// = false
public var duckClip:MovieClip;
public var fallRectSpeed:Number;// = 0
public var climbClip:MovieClip;
public var currentLineIndex:Number;// = 0
public var slideDownStatus:Boolean;// = false
private var standAnimationCounter:Number;// = 0
public var attackClip:MovieClip;
private var sameSlideJumpX:Number;
public var actualHeadPosition:Point;
private var jumpyCount:Number;// = 0
public var head:MovieClip;
private var currentClimberIndex:Number;// = 0
public var standAnimationStatus:Boolean;// = false
public var dieClip:MovieClip;
public var powerClip:MovieClip;
public static var leftMoveStatus = false;
public static var halfWidth:Number;
public static var monkey:Monkey = null;
public static var walkDirection:Number = 1;
public static var halfHeight:Number;
public static var rightMoveStatus = false;
public function Monkey(){
speed = 5;
standAnimationCounter = 0;
standMaximumCounter = 200;
minX = 0;
maxX = 0;
inity = 0;
action = 0;
currentLineIndex = 0;
currentClimberIndex = 0;
climberPositionx = -1;
jumpHeight = -16;
fallSpeed = 16;
scrollSpeed = 0;
jumpyCount = 0;
jumpxCount = 8;
jumpProgressStatus = false;
climberTopyPos = 0;
climberBottomyPos = 0;
jumpFlag = true;
jumpUpStatus = false;
jumpDownStatus = false;
fallRectSpeed = 0;
climbStatus = false;
climbStatusNum = 0;
walkStatus = false;
standAnimationStatus = false;
hitStatus = false;
duckStatus = false;
hangStatus = false;
ropeYpos = 0;
rescueStatus = false;
attackStatus = false;
sliderCollisionStatus = false;
climbHitStatus = false;
fallStatus = true;
fallLeftStatus = false;
fallRightStatus = false;
jumpLeftStatus = false;
jumpRightStatus = false;
powerUpStatus = false;
slideUpStatus = false;
slideDownStatus = false;
dieStatus = false;
actualPosition = new Point();
actualBodyPosition = new Point();
actualHeadPosition = new Point();
stagePosition = new Point();
current_LevelEnd_Position = new Point();
bossClimberArray = [1, 2, 3, 4, 5];
bossClimberRight = new Array(1);
time = new Timer(400, 1);
attackCounter = 0;
climberHA = null;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11, 11, frame12, 12, frame13, 13, frame14, 14, frame15, 15, frame16, 16, frame17, 17, frame18);
halfWidth = 20;
halfHeight = 30;
minX = (GParams.monkeyMoveMin - halfWidth);
maxX = (GParams.monkeyMoveMax + halfWidth);
life = GParams.MONKEY_LIFE;
health = GParams.MONKEY_HEALTH;
}
public function updateActualPosition():Point{
actualPosition.x = x;
actualPosition.y = y;
actualBodyPosition.x = (x + body.x);
actualBodyPosition.y = (y + body.y);
actualHeadPosition.x = (x + head.x);
actualHeadPosition.y = (y + head.y);
return (actualPosition);
}
private function setMonkeyStand(){
action = 0;
walkStatus = false;
climbStatus = false;
climbHitStatus = false;
duckStatus = false;
fallStatus = false;
jumpProgressStatus = false;
powerUpStatus = false;
jumpUpStatus = false;
jumpDownStatus = false;
hitStatus = false;
jumpFlag = true;
checkFall();
if (!standAnimationStatus){
playRandomStandClip();
};
}
private function checkWildBoreCollision(){
var _local1:Number;
var _local2:AnimalBase;
var _local3:Number;
var _local4:Number;
_local1 = 0;
while (_local1 < Bg1.stageWildBoreArray.length) {
_local2 = Bg1.stageWildBoreArray[_local1];
if (((((!((_local2 == null))) && (!((hitStatus == true))))) && (!(_local2.attackStatus)))){
_local3 = Math.abs((actualBodyPosition.x - _local2.x));
_local4 = Math.abs((actualBodyPosition.y - _local2.y));
if (_local3 < (halfWidth + _local2.halfWidth)){
if (_local4 < 50){
if ((((((action == 1)) || ((action == 0)))) || ((action == 6)))){
action = 5;
hitStatus = true;
_local2.attackStatus = true;
health = (health - GParams.WILDBORE_HIT_COUNT);
updateHealth();
_local2.gotoAndStop(5);
gotoAndPlay("hit");
if (_local2.scaleX == -1){
if (x < 550){
};
} else {
if (_local2.scaleX == 1){
if (x > 50){
};
};
};
return;
} else {
if (action == 2){
climbHitStatus = true;
action = 7;
health = (health - GParams.WILDBORE_HIT_COUNT);
updateHealth();
return;
};
if (action == 3){
action = 5;
hitStatus = true;
health = (health - GParams.WILDBORE_HIT_COUNT);
updateHealth();
_local2.attackStatus = true;
_local2.gotoAndStop(5);
gotoAndPlay("hit");
if (_local2.scaleX == -1){
if (x < 550){
};
} else {
if (_local2.scaleX == 1){
if (x > 50){
};
};
};
return;
};
};
};
};
};
_local1++;
};
}
private function playAttackClip(){
if (currentLabel == "attack"){
if (this.attackClip != null){
if (this.attackClip.currentFrame >= 13){
this.attackClip.gotoAndStop(1);
gotoAndStop("stand1");
action = 0;
walkStatus = false;
climbStatus = false;
attackStatus = false;
hitStatus = false;
powerUpStatus = false;
standAnimationStatus = false;
standAnimationCounter = 0;
};
};
};
}
private function checkEagle2Collision(){
var _local1:Eagle2;
var _local2:Number;
var _local3:Number;
_local1 = Bg1.eagle2;
if (((!((_local1 == null))) && (!((hitStatus == true))))){
_local2 = Math.abs((actualPosition.x - _local1.x));
_local3 = Math.abs((actualPosition.y - _local1.y));
if (_local2 < (halfWidth + _local1.halfWidth)){
if (_local3 < 50){
if ((((((action == 1)) || ((action == 0)))) || ((action == 6)))){
action = 5;
health = (health - GParams.EAGLE_HIT_COUNT);
updateHealth();
hitStatus = true;
gotoAndPlay("hit");
if (_local1.scaleX == -1){
if (x < 550){
x = (x + 30);
};
} else {
if (_local1.scaleX == 1){
if (x > 50){
x = (x - 30);
};
};
};
return;
} else {
if (action == 2){
climbHitStatus = true;
action = 7;
health = (health - GParams.EAGLE_HIT_COUNT);
updateHealth();
return;
};
if (action == 3){
action = 5;
health = (health - GParams.EAGLE_HIT_COUNT);
updateHealth();
hitStatus = true;
gotoAndPlay("hit");
if (_local1.scaleX == -1){
if (x < 550){
x = (x + 30);
};
} else {
if (_local1.scaleX == 1){
if (x > 50){
x = (x - 30);
};
};
};
return;
};
};
};
};
};
}
private function checkRopeRight():Boolean{
var _local1:MovieClip;
_local1 = null;
_local1 = getRopeAreaClip();
if (_local1 != null){
if (_local1.hitTestPoint(((stagePosition.x + halfWidth) + 4), ((stagePosition.y + halfHeight) + 10), true)){
hangStatus = true;
ropeYpos = _local1.y;
return (true);
};
};
hangStatus = false;
return (false);
}
private function playDieClip(){
if (currentLabel == "die"){
if (this.dieClip != null){
if (this.dieClip.currentFrame >= 72){
this.dieClip.gotoAndStop(1);
gotoAndStop(1);
dieStatus = false;
checkGameEndStatus();
};
};
};
}
private function getClimberDownCollision():Boolean{
var _local1:MovieClip;
_local1 = null;
_local1 = climberHA;
if (_local1 != null){
if (_local1.hitTestPoint(stagePosition.x, ((stagePosition.y + halfHeight) + 4), true)){
return (true);
};
};
return (false);
}
private function attackKeyAction(){
attackStatus = true;
createBanana();
gotoAndStop("attack");
}
private function checkHangStatus(){
var _local1:Boolean;
if (walkDirection == 1){
if (((((!(hangStatus)) && (MainClass.rhinoHornStatus))) && ((((currentLineIndex == 2)) || ((currentLineIndex == 10)))))){
_local1 = checkRopeRight();
if (_local1){
y = (y + height);
x = (x + 10);
action = 6;
hangStatus = true;
fallStatus = false;
walkStatus = false;
gotoAndStop("hang");
return;
};
};
} else {
if (((((!(hangStatus)) && (MainClass.rhinoHornStatus))) && ((((currentLineIndex == 3)) || ((currentLineIndex == 11)))))){
_local1 = checkRopeLeft();
if (_local1){
y = (y + height);
x = (x - 10);
gotoAndStop("hang");
action = 6;
hangStatus = true;
fallStatus = false;
walkStatus = false;
return;
};
};
};
}
private function jump(){
if (jumpUpStatus){
jumpUp();
};
if (jumpDownStatus){
jumpDown();
};
}
private function climbUp(){
var _local1:Number;
var _local2:Boolean;
if (GParams.currentLevel != 3){
climbStatus = getClimberUpCollision();
if (climbStatus){
if (climbStatusNum == 1){
y = (y - 4);
action = 2;
} else {
if (((climbStatus) && ((climbStatusNum == 2)))){
y = (y - 20);
action = 0;
gotoAndStop("stand1");
climbStatus = false;
fallStatus = true;
fallSpeed = 6;
scrollSpeed = (fallSpeed / 0.75);
};
};
} else {
if (((climbStatus) || (walkStatus))){
action = 0;
gotoAndStop("stand1");
climbStatus = false;
};
};
} else {
climbStatus = getClimberUpCollision();
_local1 = Math.ceil((x / 120));
if (((climbStatus) && (!((bossClimberArray[_local1] == 0))))){
y = (y - 4);
action = 2;
if (y < 400){
_local2 = checkRopeStatus(_local1);
if (_local2 != true){
wrongClimbAction(_local1);
bossClimberArray[_local1] = 0;
return;
};
};
} else {
action = 0;
if (currentLabel != "fallHit"){
gotoAndStop("stand1");
if (y < 300){
removeAllWrong();
};
};
climbStatus = false;
};
};
}
function frame10(){
stop();
}
function frame14(){
stop();
}
function frame16(){
stop();
}
function frame18(){
stop();
}
function frame17(){
stop();
}
function frame3(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
private function checkDieStatus(){
if (((!(dieStatus)) && (!(climbHitStatus)))){
if (health <= 0){
life = (life - 1);
LifeClip.lifeClip.updateLife();
if (life > 0){
health = 100;
};
dieStatus = true;
return;
};
};
}
function frame11(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
private function getMonkeyLine(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:uint;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local1 = actualPosition.x;
_local2 = (actualPosition.y + halfHeight);
_local4 = 0;
while (_local4 < current_Path_Dimension.length) {
_local5 = current_Path_Dimension[_local4][1];
_local6 = Math.abs((_local2 - _local5));
if (_local6 < 10){
_local3 = _local5;
break;
};
_local4++;
};
_local4 = 0;
while (_local4 < current_Path_Dimension.length) {
_local5 = current_Path_Dimension[_local4][1];
if (_local5 == _local3){
_local7 = current_Path_Dimension[_local4][0];
_local8 = (current_Path_Dimension[_local4][0] + current_Path_Dimension[_local4][2]);
if ((((_local1 > _local7)) && ((_local1 < _local8)))){
currentLineIndex = _local4;
};
};
_local4++;
};
}
private function jumpInit(){
inity = y;
jumpyCount = jumpHeight;
jumpProgressStatus = true;
jumpUpStatus = true;
jumpFlag = false;
}
function frame9(){
stop();
}
function frame15(){
stop();
}
function frame1(){
stop();
}
private function gotoStand(_arg1:TimerEvent){
if (!dieStatus){
time.stop();
time.removeEventListener(TimerEvent.TIMER_COMPLETE, gotoStand);
gotoAndStop("stand1");
};
}
public function nextLife(){
init();
health = 100;
updateHealth();
MainClass.initScrollRect = true;
gotoAndStop("stand1");
x = 100;
if (GParams.currentLevel == 9){
GParams.currentLevel = 8;
Bg1.bg1.removeOldSnakeTime();
MainClass.levelEndStatus = true;
GParams.restartStatus = true;
};
}
private function walkRopeRight(){
var _local1:MovieClip;
_local1 = null;
_local1 = getRopeAreaClip();
if (_local1 != null){
if (_local1.hitTestPoint(((stagePosition.x + 2) + halfWidth), ((stagePosition.y - halfHeight) - 1), true)){
x = (x + 2);
} else {
y = ((y - height) - 20);
x = (x + 20);
gotoAndStop("stand1");
hangStatus = false;
fallStatus = true;
fallSpeed = 6;
scrollSpeed = (fallSpeed / 0.75);
};
};
}
function frame8(){
stop();
}
private function climbHit(){
if (GParams.currentLevel == 3){
gotoAndStop("fallHit");
};
fallStatus = true;
fallSpeed = 8;
scrollSpeed = (fallSpeed * 0.75);
}
private function updateHealth(){
var _local1:Number;
_local1 = (100 - health);
HealthClip.healthClip.gotoAndStop(_local1);
checkDieStatus();
}
private function checkRopeStatus(_arg1:Number):Boolean{
var _local2:uint;
_local2 = 0;
while (_local2 < 2) {
if (_arg1 == bossClimberRight[_local2]){
return (true);
};
_local2++;
};
return (false);
}
public function clearAllListeners(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function checkRescueCollision(){
var _local1:Number;
var _local2:SnakeTime;
var _local3:Number;
var _local4:Number;
_local1 = 0;
while (_local1 < Bg1.stageSnakeTimeArray.length) {
_local2 = Bg1.stageSnakeTimeArray[_local1];
if (((!((_local2 == null))) && (MainClass.rescueKeyDown))){
_local3 = Math.abs((actualPosition.x - _local2.x));
_local4 = Math.abs((actualPosition.y - _local2.y));
if (_local3 < (halfWidth + _local2.halfWidth)){
if (_local4 < 20){
_local2.hit_Sword();
return;
};
};
};
_local1++;
};
}
private function rightKeyAction(){
action = 1;
walkDirection = 1;
scaleX = 1;
walkStatus = true;
walkRight(speed);
}
function frame12(){
stop();
}
public function checkGameEndStatus(){
x = -500;
if (life <= 0){
MainClass.gameEndStatus = true;
} else {
nextLife();
};
}
private function fallDown(){
var _local1:MovieClip;
var _local2:uint;
if (fallStatus){
_local1 = null;
_local1 = getBaseAreaClip();
if (_local1 != null){
if (!_local1.hitTestPoint(stagePosition.x, (((stagePosition.y + halfHeight) + fallSpeed) - 1), true)){
y = (y + fallSpeed);
if (((!((jumpUpStatus == true))) && (!((jumpDownStatus == true))))){
scrollSpeed = (fallSpeed / 0.75);
};
} else {
scrollSpeed = 0;
_local2 = 1;
while (_local2 <= 50) {
if (!_local1.hitTestPoint(stagePosition.x, (((stagePosition.y + halfHeight) - (_local2 - fallSpeed)) - 1), true)){
y = (y - (_local2 - fallSpeed));
break;
};
_local2++;
};
if (climbHitStatus){
climbStatus = false;
climbHitStatus = false;
};
fallStatus = false;
walkStatus = false;
sliderCollisionStatus = false;
standAnimationStatus = false;
jumpUpStatus = false;
jumpDownStatus = false;
jumpFlag = true;
jumpyCount = 0;
scrollSpeed = 0;
};
};
} else {
scrollSpeed = 0;
};
}
private function checkFall(){
var _local1:MovieClip;
_local1 = null;
_local1 = getBaseAreaClip();
if (_local1 != null){
if (!_local1.hitTestPoint(stagePosition.x, (stagePosition.y + halfHeight), true)){
if (((((((!((jumpUpStatus == true))) && (!((jumpDownStatus == true))))) && (!((slideDownStatus == true))))) && (!((slideUpStatus == true))))){
sliderCollisionStatus = false;
fallStatus = true;
fallSpeed = 6;
scrollSpeed = (fallSpeed / 0.75);
};
return;
} else {
scrollSpeed = 0;
};
};
}
private function checkEagleCollision(){
var _local1:Eagle;
var _local2:Number;
var _local3:Number;
_local1 = Bg1.eagle;
if (((((!((_local1 == null))) && (!((hitStatus == true))))) && (!((duckStatus == true))))){
_local2 = Math.abs((actualPosition.x - _local1.x));
_local3 = Math.abs((actualPosition.y - _local1.y));
if (_local2 < (halfWidth + _local1.halfWidth)){
if (_local3 < 50){
if ((((action == 1)) || ((action == 0)))){
action = 5;
health = (health - GParams.EAGLE_HIT_COUNT);
updateHealth();
hitStatus = true;
gotoAndPlay("hit");
} else {
if (action == 3){
action = 5;
health = (health - GParams.EAGLE_HIT_COUNT);
updateHealth();
hitStatus = true;
gotoAndPlay("hit");
return;
};
};
};
};
};
}
function frame13(){
stop();
}
private function checkRhinoCollision(){
var _local1:Number;
var _local2:AnimalBase;
var _local3:Number;
var _local4:Number;
_local1 = 0;
while (_local1 < Bg1.stageRhinoArray.length) {
_local2 = Bg1.stageRhinoArray[_local1];
if (((!((_local2 == null))) && (!((hitStatus == true))))){
_local3 = Math.abs((actualBodyPosition.x - _local2.x));
_local4 = Math.abs((actualBodyPosition.y - _local2.y));
if (_local3 < 40){
if (_local4 < 50){
if ((((((action == 1)) || ((action == 0)))) || ((action == 6)))){
action = 5;
hitStatus = true;
_local2.attackStatus = false;
health = (health - GParams.RHINO_HIT_COUNT);
updateHealth();
gotoAndPlay("hit");
} else {
if (action == 2){
climbHitStatus = true;
action = 7;
health = (health - GParams.RHINO_HIT_COUNT);
updateHealth();
return;
};
if (action == 3){
action = 5;
hitStatus = true;
health = (health - GParams.RHINO_HIT_COUNT);
updateHealth();
_local2.attackStatus = false;
gotoAndPlay("hit");
return;
};
};
};
};
};
_local1++;
};
}
private function onEnterFrame(_arg1:Event){
if (!GParams.gamePause){
if (dieStatus){
if (currentLabel != "die"){
gotoAndStop("die");
};
playDieClip();
return;
};
if (!dieStatus){
checkDieStatus();
getMonkeyLine();
getLevelEndCollision();
updateVirtualMonkeyIndex();
updateActualPosition();
checkSliderCollision();
checkVultureCollision();
checkMongoesCollision();
checkGorillaCollision();
if (jumpFlag){
checkWildBoreCollision();
checkRhinoCollision();
};
checkLeopardCollision();
checkCoconutCollision();
checkPowerupCollision();
checkEagleCollision();
checkEagle2Collision();
checkRescueCollision();
checkStandAnimation();
if (powerUpStatus){
playGlowClip();
};
if (((!(hangStatus)) && (!(climbStatus)))){
fallDown();
};
if (((!(climbStatus)) && (!(hitStatus)))){
jump();
};
if (climbHitStatus){
climbHit();
fallDown();
};
if (climbStatus){
if (((MainClass.upKeyDown) || (MainClass.downKeyDown))){
if (currentLabel != "climb"){
gotoAndStop("climb");
};
} else {
if (currentLabel != "climbStill"){
gotoAndStop("climbStill");
};
};
};
if (hangStatus){
if (((MainClass.leftKeyDown) || (MainClass.rightKeyDown))){
if (currentLabel != "hang"){
gotoAndStop("hang");
};
} else {
if (currentLabel != "hangStill"){
gotoAndStop("hangStill");
};
};
};
if (duckStatus){
playDuckClip();
};
if (hitStatus){
playHitClip();
return;
};
if (attackStatus){
playAttackClip();
return;
};
if (((jumpFlag) && (!(hangStatus)))){
if (((MainClass.upKeyDown) && (!(sliderCollisionStatus)))){
climbUp();
checkFall();
return;
};
if (MainClass.downKeyDown){
downKeyAction();
return;
};
};
if (((!(climbStatus)) && (!(hitStatus)))){
if (!hangStatus){
checkFall();
if (((((MainClass.spaceKeyDown) && (jumpFlag))) && (!(fallStatus)))){
jumpInit();
return;
};
if (((MainClass.attackKeyDown) && (!(attackStatus)))){
attackKeyAction();
return;
};
};
if (MainClass.leftKeyDown){
standAnimationStatus = false;
leftKeyAction();
} else {
if (MainClass.rightKeyDown){
standAnimationStatus = false;
rightKeyAction();
};
};
};
if (((((((((((((((((((((((!(MainClass.leftKeyDown)) && (!(MainClass.rightKeyDown)))) && (!(MainClass.downKeyDown)))) && (!(MainClass.spaceKeyDown)))) && (!(MainClass.attackKeyDown)))) && (!(MainClass.rescueKeyDown)))) && (!(climbStatus)))) && (!(hangStatus)))) && (!(hitStatus)))) && (!(fallStatus)))) && (!(climbHitStatus)))) && (!(attackStatus)))){
if (standAnimationStatus){
standAnimationCounter++;
if (standAnimationCounter > standMaximumCounter){
standAnimationStatus = false;
setMonkeyStand();
standAnimationCounter = 0;
};
};
if (((!(standAnimationStatus)) && (!(dieStatus)))){
if (currentLabel != "fallHit"){
gotoAndStop("stand1");
} else {
time.start();
time.addEventListener(TimerEvent.TIMER_COMPLETE, gotoStand);
};
standAnimationStatus = true;
};
};
};
};
}
private function playRandomStandClip(){
var _local1:int;
var _local2:String;
_local1 = (Math.floor((Math.random() * 4)) + 1);
_local2 = ("stand" + _local1.toString());
this.gotoAndStop(_local2);
standAnimationStatus = true;
}
private function downKeyAction(){
climbStatus = getClimberDownCollision();
if (!climbStatus){
duckDown();
checkFall();
return;
};
climbDown();
}
private function initialiseLevelChanges(){
if (GParams.currentLevel == 3){
initialiseBossLevel1();
return;
};
if (GParams.currentLevel == 6){
initialiseBossLevel2();
return;
};
if (GParams.currentLevel == 9){
initialiseBossLevel3();
return;
};
}
private function climbDown(){
var _local1:Number;
if (GParams.currentLevel != 3){
climbStatus = getClimberDownCollision();
if (climbStatus){
y = (y + 4);
action = 2;
} else {
if (((climbStatus) || (walkStatus))){
action = 0;
gotoAndStop("stand1");
climbStatus = false;
};
};
} else {
climbStatus = getClimberDownCollision();
_local1 = Math.ceil((x / 120));
if (((climbStatus) && (!((bossClimberArray[_local1] == 0))))){
y = (y + 4);
action = 2;
} else {
action = 0;
gotoAndStop("stand1");
climbStatus = false;
};
};
}
private function getClimberTopYPosition(_arg1:Number):Number{
currentClimberIndex = current_Path_Dimension[_arg1][7];
if (currentClimberIndex != -1){
return (current_Climber_Dimension[currentClimberIndex][2]);
};
return (-1);
}
public function setClimberAreaClip(){
}
private function getRopeAreaClip():MovieClip{
var _local1:MovieClip;
_local1 = null;
switch (GParams.currentLevel){
case 1:
return (null);
case 2:
return (null);
case 3:
return (null);
case 4:
return (null);
case 5:
return (null);
case 6:
return (null);
case 7:
_local1 = (Bg1.bg1.surfaceBg as SurfaceL7).ropeHitAreaClip;
return (_local1);
case 8:
return (null);
case 9:
return (null);
default:
return (null);
};
}
private function walkRopeLeft(){
var _local1:MovieClip;
_local1 = null;
_local1 = getRopeAreaClip();
if (_local1 != null){
if (_local1.hitTestPoint(((stagePosition.x - 2) - halfWidth), ((stagePosition.y - halfHeight) - 1), true)){
x = (x - 2);
} else {
y = ((y - height) - 20);
x = (x - 20);
hangStatus = false;
gotoAndStop("stand1");
hangStatus = false;
fallStatus = true;
fallSpeed = 6;
scrollSpeed = (fallSpeed / 0.75);
};
};
}
private function initialiseBossLevel2(){
y = 650;
gotoAndStop("stand1");
jumpHeight = -18;
}
private function playDuckClip(){
if (currentLabel == "duck"){
if (this.duckClip != null){
if (this.duckClip.currentFrame >= 2){
this.duckClip.gotoAndStop(1);
gotoAndStop("stand1");
standAnimationStatus = false;
standAnimationCounter = 0;
action = 0;
walkStatus = false;
attackStatus = false;
duckStatus = false;
climbStatus = false;
hitStatus = false;
powerUpStatus = false;
};
};
};
}
private function initialiseBossLevel3(){
gotoAndStop("stand1");
}
private function initialiseBossLevel1(){
var _local1:Array;
var _local2:uint;
var _local3:*;
var _local4:uint;
var _local5:Number;
gotoAndStop("stand1");
initAllClimberClip();
bossClimberArray = [1, 2, 3, 4, 5];
_local1 = bossClimberArray.concat();
_local2 = 0;
while (_local2 < 1) {
_local3 = _local1.length;
_local4 = Math.floor((Math.random() * _local3));
_local5 = _local1[_local4];
bossClimberRight[_local2] = _local5;
_local1.splice(_local4, 1);
_local2++;
};
}
private function rescueKeyAction(){
rescueStatus = true;
}
private function checkSliderCollision(){
var _local1:Array;
var _local2:int;
var _local3:Boolean;
slideUpStatus = false;
slideDownStatus = false;
_local1 = Surface.stageSliderArray;
if (_local1 != null){
_local2 = 0;
while (_local2 < _local1.length) {
_local3 = _local1[_local2].checkSliderCollision();
if (_local3){
if (_local1[_local2].typeNum != 1){
sliderCollisionStatus = true;
};
break;
};
_local2++;
};
};
}
private function reinitialise(){
currentLineIndex = 0;
inity = 0;
action = 0;
currentClimberIndex = 0;
climberPositionx = -1;
current_Path_Dimension = GParams.game_Path_Dimension[(GParams.currentLevel - 1)];
jumpyCount = 0;
jumpFlag = true;
walkStatus = false;
attackStatus = false;
fallStatus = true;
duckStatus = false;
dieStatus = false;
sliderCollisionStatus = false;
climbStatus = false;
powerUpStatus = false;
hitStatus = false;
jumpHeight = -16;
initialiseLevelChanges();
getClimberAreaClip();
}
private function getLevelEndClip():MovieClip{
var _local1:MovieClip;
_local1 = null;
switch (GParams.currentLevel){
case 1:
_local1 = (Bg1.bg1.surfaceBg as SurfaceL1).levelEndAreaClip;
return (_local1);
case 2:
_local1 = (Bg1.bg1.surfaceBg as SurfaceL2).levelEndAreaClip;
return (_local1);
case 3:
_local1 = (Bg1.bg1.surfaceBg as SurfaceL3).levelEndAreaClip;
return (_local1);
case 4:
_local1 = (Bg1.bg1.surfaceBg as SurfaceL4).levelEndAreaClip;
return (_local1);
case 5:
_local1 = (Bg1.bg1.surfaceBg as SurfaceL5).levelEndAreaClip;
return (_local1);
case 6:
_local1 = (Bg1.bg1.surfaceBg as SurfaceL6).levelEndAreaClip;
return (_local1);
case 7:
_local1 = (Bg1.bg1.surfaceBg as SurfaceL7).levelEndAreaClip;
return (_local1);
case 8:
_local1 = (Bg1.bg1.surfaceBg as SurfaceL8).levelEndAreaClip;
return (_local1);
case 9:
_local1 = (Bg1.bg1.surfaceBg as SurfaceL9).levelEndAreaClip;
return (_local1);
default:
return (null);
};
}
private function getClimberXPosition(_arg1:Number):Number{
currentClimberIndex = current_Path_Dimension[_arg1][7];
if (currentClimberIndex != -1){
return (current_Climber_Dimension[currentClimberIndex][0]);
};
return (-1);
}
private function removeAllWrong(){
var _local1:*;
var _local2:MovieClip;
_local1 = 1;
while (_local1 < 6) {
_local2 = null;
_local2 = (Bg1.bg1.surfaceBg as SurfaceL3);
climberClip = (_local2.getChildByName(("climber" + _local1)) as MovieClip);
climberClip.gotoAndStop(2);
bossClimberArray[_local1] = 0;
_local1++;
};
}
private function duckDown(){
action = 6;
duckStatus = true;
gotoAndStop("duck");
}
private function checkRopeLeft():Boolean{
var _local1:MovieClip;
_local1 = null;
_local1 = getRopeAreaClip();
if (_local1 != null){
if (_local1.hitTestPoint(((stagePosition.x - halfWidth) - 4), ((stagePosition.y + halfHeight) + 10), true)){
hangStatus = true;
ropeYpos = _local1.y;
return (true);
};
};
hangStatus = false;
return (false);
}
public function init(){
var _local1:Number;
var _local2:Number;
reinitialise();
_local1 = current_Path_Dimension[currentLineIndex][0];
_local2 = current_Path_Dimension[currentLineIndex][1];
x = (_local1 + 100);
y = ((_local2 - halfHeight) - 5);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function rescueFail(){
if (life > 0){
life = (life - 1);
} else {
health = 0;
};
dieStatus = true;
}
private function getClimberBottomYPosition(_arg1:Number):Number{
currentClimberIndex = current_Path_Dimension[_arg1][7];
if (currentClimberIndex != -1){
return (current_Climber_Dimension[currentClimberIndex][1]);
};
return (-1);
}
private function leftKeyAction(){
action = 1;
walkDirection = -1;
scaleX = -1;
walkStatus = true;
walkLeft(speed);
}
private function updateVirtualMonkeyIndex(){
stagePosition.x = (x - Bg1.bg1.scrollRect.x);
stagePosition.y = (y - Bg1.bg1.scrollRect.y);
}
private function getClimberUpCollision():Boolean{
var _local1:MovieClip;
_local1 = null;
_local1 = climberHA;
if (_local1 != null){
if (_local1.hitTestPoint(stagePosition.x, ((stagePosition.y + halfHeight) - 4), true)){
if (_local1.hitTestPoint(stagePosition.x, ((stagePosition.y + halfHeight) - 15), true)){
climbStatusNum = 1;
return (true);
};
climbStatusNum = 2;
return (true);
};
};
climbStatusNum = 0;
return (false);
}
private function checkCoconutCollision(){
var _local1:Number;
var _local2:Coconut;
_local1 = 0;
while (_local1 < Bg1.stageCoconutArray.length) {
_local2 = Bg1.stageCoconutArray[_local1];
if (_local2 != null){
if (_local2.hitTestObject(monkey.body)){
if (_local2.typeNum == 1){
_local2.hitStatus = true;
if ((((action == 1)) || ((action == 0)))){
action = 5;
life = (life - GParams.COCONUT_HIT_COUNT);
hitStatus = true;
gotoAndPlay("hit");
} else {
if (action == 2){
climbHitStatus = true;
life = (life - GParams.COCONUT_HIT_COUNT);
return;
};
if (action == 3){
action = 5;
life = (life - GParams.COCONUT_HIT_COUNT);
hitStatus = true;
gotoAndPlay("hit");
return;
};
if (action == 6){
hangStatus = false;
life = (life - GParams.COCONUT_HIT_COUNT);
fallStatus = true;
fallSpeed = 2;
scrollSpeed = (fallSpeed / 0.75);
gotoAndStop("stand1");
return;
};
};
} else {
_local2.blastStatus = true;
MainClass.gameScore = (MainClass.gameScore + 20);
ScoreClip.scoreClip.updateScore();
powerUpStatus = true;
gotoAndStop("power");
return;
};
};
};
_local1++;
};
}
private function wrongClimbAction(_arg1:Number){
var _local2:MovieClip;
climbHitStatus = true;
action = 7;
_local2 = null;
_local2 = (Bg1.bg1.surfaceBg as SurfaceL3);
climberClip = (_local2.getChildByName(("climber" + _arg1)) as MovieClip);
health = (health - GParams.WRONGROPE_HIT_COUNT);
updateHealth();
climberClip.gotoAndStop(2);
}
private function jumpUp(){
if (jumpUpStatus){
action = 3;
y = (y + jumpyCount);
jumpyCount = (jumpyCount + 2);
if (jumpyCount >= 0){
jumpyCount = 0;
jumpDownStatus = true;
jumpUpStatus = false;
};
if (MainClass.leftKeyDown){
leftKeyAction();
return;
};
if (MainClass.rightKeyDown){
rightKeyAction();
return;
};
};
}
private function initAllClimberClip(){
var _local1:*;
var _local2:MovieClip;
_local1 = 1;
while (_local1 < 6) {
_local2 = null;
_local2 = (Bg1.bg1.surfaceBg as SurfaceL3);
climberClip = (_local2.getChildByName(("climber" + _local1)) as MovieClip);
climberClip.gotoAndStop(1);
_local1++;
};
}
function frame2(){
stop();
}
private function walkLeft(_arg1:Number){
var _local2:MovieClip;
if (!hangStatus){
checkHangStatus();
} else {
action = 6;
if (currentLabel != "hang"){
gotoAndStop("hang");
};
walkRopeLeft();
return;
};
if (((walkStatus) && (!(hangStatus)))){
action = 1;
_local2 = null;
_local2 = getBaseAreaClip();
if (_local2 != null){
if (!_local2.hitTestPoint(((stagePosition.x - _arg1) - halfWidth), ((stagePosition.y + halfHeight) - 1), true)){
if (((!((currentLabel == "walk"))) && (!((currentLabel == "attack"))))){
gotoAndStop("walk");
};
x = (x - _arg1);
};
};
};
checkFall();
}
private function createBanana(){
var _local1:Object;
var _local2:int;
var _local3:int;
_local1 = new Object();
if (_local1 != null){
if (walkDirection == 1){
_local1.startX = (actualPosition.x + halfWidth);
_local1.sameSlideTargetX = (current_Path_Dimension[currentLineIndex][0] + current_Path_Dimension[currentLineIndex][2]);
_local1.throwX = 8;
_local2 = current_Path_Dimension[currentLineIndex][4];
_local3 = current_Path_Dimension[currentLineIndex][6];
if (_local2 != -1){
_local1.nextSlideTargetX = current_Path_Dimension[_local2][0];
} else {
_local1.nextSlideTargetX = 650;
};
if (_local3 != -1){
_local1.bottomSlideTargetY = current_Path_Dimension[_local3][1];
} else {
_local1.bottomSlideTargetY = (actualPosition.y - halfHeight);
};
_local1.dir = 1;
} else {
_local1.startX = (actualPosition.x - halfWidth);
_local1.sameSlideTargetX = current_Path_Dimension[currentLineIndex][0];
_local1.throwX = -8;
_local2 = current_Path_Dimension[currentLineIndex][3];
_local3 = current_Path_Dimension[currentLineIndex][5];
if (_local2 != -1){
_local1.nextSlideTargetX = (current_Path_Dimension[_local2][0] + current_Path_Dimension[_local2][2]);
} else {
_local1.nextSlideTargetX = 0;
};
if (_local3 != -1){
_local1.bottomSlideTargetY = current_Path_Dimension[_local3][1];
} else {
_local1.bottomSlideTargetY = (actualPosition.y - halfHeight);
};
_local1.dir = -1;
};
_local1.startY = (actualPosition.y - halfHeight);
_local1.endY = (actualPosition.y + halfHeight);
Bg1.bg1.addBanana(_local1);
};
}
private function getClimberAreaClip(){
switch (GParams.currentLevel){
case 1:
climberHA = (Bg1.bg1.surfaceBg as SurfaceL1).climberHitAreaClip;
break;
case 2:
climberHA = (Bg1.bg1.surfaceBg as SurfaceL2).climberHitAreaClip;
break;
case 3:
climberHA = (Bg1.bg1.surfaceBg as SurfaceL3).climberHitAreaClip;
break;
case 4:
climberHA = (Bg1.bg1.surfaceBg as SurfaceL4).climberHitAreaClip;
break;
case 5:
climberHA = (Bg1.bg1.surfaceBg as SurfaceL5).climberHitAreaClip;
break;
case 6:
break;
case 7:
climberHA = (Bg1.bg1.surfaceBg as SurfaceL7).climberHitAreaClip;
break;
case 8:
climberHA = (Bg1.bg1.surfaceBg as SurfaceL8).climberHitAreaClip;
break;
case 9:
climberHA = (Bg1.bg1.surfaceBg as SurfaceL9).climberHitAreaClip;
break;
default:
break;
};
}
private function checkGorillaCollision(){
var _local1:Number;
var _local2:AnimalBase;
var _local3:Number;
var _local4:Number;
_local1 = 0;
while (_local1 < Bg1.stageGorillaArray.length) {
_local2 = Bg1.stageGorillaArray[_local1];
if (((!((_local2 == null))) && (!((hitStatus == true))))){
_local3 = Math.abs((actualBodyPosition.x - _local2.x));
_local4 = Math.abs((actualBodyPosition.y - _local2.y));
if (_local3 < (halfWidth + _local2.halfWidth)){
if (_local4 < 50){
if ((((((action == 1)) || ((action == 0)))) || ((action == 6)))){
action = 5;
hitStatus = true;
_local2.hitStatus = true;
health = (health - GParams.GORILLA_HIT_COUNT);
updateHealth();
gotoAndPlay("hit");
if (_local2.scaleX == -1){
if (x < 550){
x = (x + 30);
};
} else {
if (_local2.scaleX == 1){
if (x > 50){
x = (x - 30);
};
};
};
_local2.escapeHit();
return;
} else {
if (action == 2){
climbHitStatus = true;
action = 7;
health = (health - GParams.GORILLA_HIT_COUNT);
updateHealth();
return;
};
if (action == 3){
action = 5;
hitStatus = true;
health = (health - GParams.GORILLA_HIT_COUNT);
updateHealth();
_local2.hitStatus = true;
gotoAndPlay("hit");
if (_local2.scaleX == -1){
if (x < 550){
x = (x + 30);
};
} else {
if (_local2.scaleX == 1){
if (x > 50){
x = (x - 30);
};
};
};
_local2.escapeHit();
return;
};
};
};
};
};
_local1++;
};
}
private function checkStandAnimation(){
if (currentLabel == "stand1"){
if (this.stand1Clip != null){
if (this.stand1Clip.currentFrame >= 30){
this.stand1Clip.gotoAndStop(1);
};
};
} else {
if (currentLabel == "stand2"){
if (this.stand2Clip != null){
if (this.stand2Clip.currentFrame >= 30){
this.stand2Clip.gotoAndStop(1);
};
};
} else {
if (currentLabel == "stand3"){
if (this.stand3Clip != null){
if (this.stand3Clip.currentFrame >= 35){
this.stand3Clip.gotoAndStop(1);
};
};
} else {
if (currentLabel == "stand4"){
if (this.stand4Clip != null){
if (this.stand4Clip.currentFrame >= 45){
this.stand4Clip.gotoAndStop(1);
};
};
};
};
};
};
}
public function getLevelEndCollision(){
var _local1:MovieClip;
_local1 = null;
_local1 = getLevelEndClip();
if (_local1 != null){
if (((_local1.hitTestObject(this)) && (!((GParams.currentLevel == 9))))){
MainClass.levelEndStatus = true;
};
};
}
private function playHitClip(){
if (currentLabel == "hit"){
if (this.hitClip != null){
if (this.hitClip.currentFrame >= 3){
this.hitClip.gotoAndStop(1);
updateHealth();
standAnimationStatus = false;
gotoAndStop("stand1");
standAnimationCounter = 0;
action = 0;
walkStatus = false;
attackStatus = false;
duckStatus = false;
climbStatus = false;
hitStatus = false;
powerUpStatus = false;
};
};
};
}
private function playGlowClip(){
if (currentLabel == "power"){
if (this.powerClip != null){
if (this.powerClip.currentFrame >= 8){
this.powerClip.gotoAndStop(1);
gotoAndStop("stand1");
action = 0;
standAnimationStatus = false;
standAnimationCounter = 0;
walkStatus = false;
attackStatus = false;
duckStatus = false;
climbStatus = false;
powerUpStatus = false;
hitStatus = false;
};
};
};
}
private function checkLeopardCollision(){
var _local1:Number;
var _local2:AnimalBase;
var _local3:Number;
var _local4:Number;
_local1 = 0;
while (_local1 < Bg1.stageLeopardArray.length) {
_local2 = Bg1.stageLeopardArray[_local1];
if (((((!((_local2 == null))) && (!((hitStatus == true))))) && (!((climbHitStatus == true))))){
_local3 = Math.abs((actualPosition.x - _local2.x));
_local4 = Math.abs((actualPosition.y - _local2.y));
if (_local2.hitTestObject(this)){
if ((((action == 1)) || ((action == 0)))){
action = 5;
hitStatus = true;
_local2.hitStatus = true;
health = (health - GParams.LEOPARD_HIT_COUNT);
updateHealth();
gotoAndPlay("hit");
return;
};
if ((((action == 6)) && (!(_local2.attackStatus)))){
action = 5;
hitStatus = true;
_local2.hitStatus = true;
health = (health - GParams.LEOPARD_HIT_COUNT);
updateHealth();
gotoAndPlay("hit");
return;
};
if (action == 2){
climbHitStatus = true;
action = 7;
health = (health - GParams.LEOPARD_HIT_COUNT);
updateHealth();
return;
};
if (action == 3){
action = 5;
hitStatus = true;
health = (health - GParams.LEOPARD_HIT_COUNT);
updateHealth();
_local2.hitStatus = true;
gotoAndPlay("hit");
return;
};
};
};
_local1++;
};
}
private function checkVultureCollision(){
var _local1:Number;
var _local2:AnimalBase;
var _local3:Number;
var _local4:Number;
_local1 = 0;
while (_local1 < Bg1.stageVultureArray.length) {
_local2 = Bg1.stageVultureArray[_local1];
if (((!((_local2 == null))) && (!((hitStatus == true))))){
_local3 = Math.abs((actualBodyPosition.x - _local2.x));
_local4 = Math.abs((actualBodyPosition.y - _local2.y));
if (_local3 < (halfWidth + _local2.halfWidth)){
if (_local4 < 50){
if ((((((action == 1)) || ((action == 0)))) || ((action == 6)))){
action = 5;
hitStatus = true;
_local2.hitStatus = true;
health = (health - GParams.VULTURE_HIT_COUNT);
updateHealth();
gotoAndPlay("hit");
if (_local2.scaleX == -1){
if (x < 550){
x = (x + 30);
};
} else {
if (_local2.scaleX == 1){
if (x > 50){
x = (x - 30);
};
};
};
_local2.escapeHit();
} else {
if (action == 2){
climbHitStatus = true;
action = 7;
health = (health - GParams.VULTURE_HIT_COUNT);
updateHealth();
return;
};
if (action == 3){
action = 5;
hitStatus = true;
health = (health - GParams.VULTURE_HIT_COUNT);
updateHealth();
_local2.hitStatus = true;
gotoAndPlay("hit");
if (_local2.scaleX == -1){
if (x < 550){
x = (x + 30);
};
} else {
if (_local2.scaleX == 1){
if (x > 50){
x = (x - 30);
};
};
};
_local2.escapeHit();
};
};
};
};
};
_local1++;
};
}
private function walkRight(_arg1:Number){
var _local2:MovieClip;
if (!hangStatus){
checkHangStatus();
} else {
action = 6;
if (currentLabel != "hang"){
gotoAndStop("hang");
};
walkRopeRight();
return;
};
if (((walkStatus) && (!(hangStatus)))){
action = 1;
_local2 = null;
_local2 = getBaseAreaClip();
if (_local2 != null){
if (!_local2.hitTestPoint(((stagePosition.x + _arg1) + halfWidth), ((stagePosition.y + halfHeight) - 1), true)){
if (((!((currentLabel == "walk"))) && (!((currentLabel == "attack"))))){
gotoAndStop("walk");
};
x = (x + _arg1);
};
};
};
checkFall();
}
private function checkPowerupCollision(){
var _local1:Number;
var _local2:PowerUp;
_local1 = 0;
while (_local1 < Bg1.stagePowerUpArray.length) {
_local2 = Bg1.stagePowerUpArray[_local1];
if (_local2 != null){
if (_local2.hitTestObject(monkey.body)){
_local2.rewardEffect();
updateHealth();
return;
};
};
_local1++;
};
}
public function getBaseAreaClip():MovieClip{
var _local1:MovieClip;
_local1 = null;
switch (GParams.currentLevel){
case 1:
_local1 = (Bg1.bg1.surfaceBg as SurfaceL1).hitAreaClip;
return (_local1);
case 2:
_local1 = (Bg1.bg1.surfaceBg as SurfaceL2).hitAreaClip;
return (_local1);
case 3:
_local1 = (Bg1.bg1.surfaceBg as SurfaceL3).hitAreaClip;
return (_local1);
case 4:
_local1 = (Bg1.bg1.surfaceBg as SurfaceL4).hitAreaClip;
return (_local1);
case 5:
_local1 = (Bg1.bg1.surfaceBg as SurfaceL5).hitAreaClip;
return (_local1);
case 6:
_local1 = (Bg1.bg1.surfaceBg as SurfaceL6).hitAreaClip;
return (_local1);
case 7:
_local1 = (Bg1.bg1.surfaceBg as SurfaceL7).hitAreaClip;
return (_local1);
case 8:
_local1 = (Bg1.bg1.surfaceBg as SurfaceL8).hitAreaClip;
return (_local1);
case 9:
_local1 = (Bg1.bg1.surfaceBg as SurfaceL9).hitAreaClip;
return (_local1);
default:
return (null);
};
}
private function jumpDown(){
if (jumpDownStatus){
if (jumpyCount < Math.abs(jumpHeight)){
jumpyCount = (jumpyCount + 1);
};
if (jumpyCount <= Math.abs(jumpHeight)){
scrollSpeed = 0;
};
if (this.y >= inity){
jumpDownStatus = false;
};
fallSpeed = jumpyCount;
fallStatus = true;
};
}
private function checkMongoesCollision(){
var _local1:Number;
var _local2:AnimalBase;
var _local3:Number;
var _local4:Number;
_local1 = 0;
while (_local1 < Bg1.stageMongoesArray.length) {
_local2 = Bg1.stageMongoesArray[_local1];
if (((!((_local2 == null))) && (!((hitStatus == true))))){
_local3 = Math.abs((actualBodyPosition.x - _local2.x));
_local4 = Math.abs((actualBodyPosition.y - _local2.y));
if (_local3 < (halfWidth + _local2.halfWidth)){
if (_local4 < 30){
if ((((((action == 1)) || ((action == 0)))) || ((action == 6)))){
action = 5;
hitStatus = true;
_local2.hitStatus = true;
health = (health - GParams.MONGOES_HIT_COUNT);
updateHealth();
gotoAndPlay("hit");
if (_local2.scaleX == -1){
if (x < 550){
x = (x + 30);
};
} else {
if (_local2.scaleX == 1){
if (x > 50){
x = (x - 30);
};
};
};
_local2.escapeHit();
return;
} else {
if (action == 2){
climbHitStatus = true;
action = 7;
health = (health - GParams.MONGOES_HIT_COUNT);
updateHealth();
return;
};
if (action == 3){
action = 5;
hitStatus = true;
health = (health - GParams.MONGOES_HIT_COUNT);
updateHealth();
_local2.hitStatus = true;
gotoAndPlay("hit");
if (_local2.scaleX == -1){
if (x < 550){
x = (x + 30);
};
} else {
if (_local2.scaleX == 1){
if (x > 50){
x = (x - 30);
};
};
};
_local2.escapeHit();
return;
};
};
};
};
};
_local1++;
};
}
public function hit_Bhala(){
if ((((((action == 1)) || ((action == 0)))) || ((action == 6)))){
action = 5;
health = (health - GParams.BHALA_HIT_COUNT);
updateHealth();
hitStatus = true;
gotoAndPlay("hit");
} else {
if (action == 2){
climbHitStatus = true;
action = 7;
health = (health - GParams.BHALA_HIT_COUNT);
updateHealth();
return;
};
if (action == 3){
action = 5;
health = (health - GParams.BHALA_HIT_COUNT);
updateHealth();
hitStatus = true;
gotoAndPlay("hit");
return;
};
};
}
public static function getInstance():Monkey{
if (monkey == null){
monkey = new (Monkey);
};
return (monkey);
}
}
}//package
Section 89
//MovingSlider (MovingSlider)
package {
import flash.events.*;
import flash.display.*;
public class MovingSlider extends Sprite {
var typeNum:Number;
var halfHeight:Number;
var speed:Number;
var refClip:MovieClip;
var endPos:Number;
var startPos:Number;
var inActive:Boolean;// = true
var dist:Number;
var dir:Number;
public function MovingSlider(){
inActive = true;
super();
}
public function init(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number){
refClip = _arg1;
dir = _arg2;
dist = _arg3;
speed = _arg4;
typeNum = 3;
refClip.y = _arg5;
startPos = refClip.y;
halfHeight = (refClip.height / 2);
if (dir == -1){
endPos = (startPos - dist);
} else {
endPos = (startPos + dist);
};
inActive = false;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function moveSlider(){
if (!inActive){
if (dir == -1){
refClip.y = (refClip.y - speed);
if (refClip.y < endPos){
refClip.y = endPos;
inActive = true;
changeDirection();
};
return;
};
if (dir == 1){
refClip.y = (refClip.y + speed);
if (refClip.y > endPos){
refClip.y = endPos;
inActive = true;
changeDirection();
};
return;
};
};
}
public function checkSliderCollision(){
if (dir == -1){
if (refClip.hitTestPoint(Monkey.monkey.stagePosition.x, ((Monkey.monkey.stagePosition.y + Monkey.monkey.halfHeight) + 2), true)){
if (Monkey.monkey.jumpFlag){
Monkey.monkey.y = (((refClip.y - halfHeight) - Monkey.monkey.halfHeight) - 1);
};
Monkey.monkey.slideUpStatus = true;
return (true);
};
};
if (dir == 1){
if (!refClip.hitTestPoint(Monkey.monkey.stagePosition.x, ((Monkey.monkey.stagePosition.y + Monkey.monkey.halfHeight) - 1), true)){
if (refClip.hitTestPoint(Monkey.monkey.stagePosition.x, ((Monkey.monkey.stagePosition.y + Monkey.monkey.halfHeight) + 10), true)){
if (Monkey.monkey.jumpFlag){
Monkey.monkey.y = (((refClip.y - halfHeight) - Monkey.monkey.halfHeight) - 1);
};
Monkey.monkey.slideDownStatus = true;
return (true);
};
};
};
}
public function removeClip(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function onEnterFrame(_arg1:Event){
moveSlider();
}
private function changeDirection(){
if (inActive){
if (dir == -1){
endPos = (refClip.y + dist);
dir = 1;
inActive = false;
} else {
if (dir == 1){
endPos = (refClip.y - dist);
dir = -1;
inActive = false;
};
};
};
}
}
}//package
Section 90
//PowerUp (PowerUp)
package {
import flash.display.*;
public class PowerUp extends MovieClip {
public var dieStatus:Boolean;
public var type:uint;
public static var powerup:PowerUp = null;
public function init(_arg1:Number){
dieStatus = false;
type = _arg1;
gotoAndStop(2);
}
public function remove(){
dieStatus = false;
gotoAndStop(1);
x = 1200;
y = 1200;
}
public function rewardEffect(){
}
public function moveEffect(){
}
}
}//package
Section 91
//PowerUpFactory (PowerUpFactory)
package {
public class PowerUpFactory {
private static var powerup:PowerUp;
public static function getPowerUpInstance(_arg1:Number):PowerUp{
switch (_arg1){
case 1:
powerup = new PowerUpHealth();
return (powerup);
case 2:
powerup = new PowerUpLife();
return (powerup);
};
return (null);
}
}
}//package
Section 92
//PowerUpHealth (PowerUpHealth)
package {
public class PowerUpHealth extends PowerUp {
public function PowerUpHealth(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
override public function rewardEffect(){
Monkey.monkey.health = (Monkey.monkey.health + 50);
if (Monkey.monkey.health > 100){
Monkey.monkey.health = 100;
};
remove();
}
}
}//package
Section 93
//PowerUpLife (PowerUpLife)
package {
public class PowerUpLife extends PowerUp {
public function PowerUpLife(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
override public function rewardEffect(){
Monkey.monkey.life = (Monkey.monkey.life + 1);
LifeClip.lifeClip.updateLife();
remove();
}
}
}//package
Section 94
//Preloader (Preloader)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.text.*;
public class Preloader extends MovieClip {
private var percentText:TextField;
var urlPlayMore:String;// = "http://www.flasharcade.com"
public var percent:TextField;
var requestPlayMore:URLRequest;// = null
var timer:Timer;
private var progressBar:Sprite;
public var percentbar:MovieClip;
public var logo:MovieClip;
public static const startFrame:Number = 3;
public static const mainClass:String = "MainClass";
public function Preloader(){
requestPlayMore = null;
urlPlayMore = "http://www.flasharcade.com";
addFrameScript(2, frame3);
stop();
super();
requestPlayMore = new URLRequest(urlPlayMore);
progressBar = (getChildByName("percentbar") as Sprite);
progressBar.scaleX = 0;
percentText = (getChildByName("percent") as TextField);
percentText.text = "0";
timer = new Timer(100, 0);
timer.addEventListener(TimerEvent.TIMER, afterSecond);
timer.start();
logo.buttonMode = true;
logo.useHandCursor = true;
logo.addEventListener(MouseEvent.CLICK, handleClick);
}
private function enterFrameHandler(_arg1:Event):void{
trace(" loading complete");
if (currentFrame == 1){
if (logo.currentFrame == logo.totalFrames){
play();
};
};
if (currentFrame >= _slot1.startFrame){
removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
stop();
initApp();
};
}
private function onComplete(_arg1:Event):void{
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
function frame3(){
stop();
}
public function handleClick(_arg1:MouseEvent){
var event = _arg1;
try {
navigateToURL(requestPlayMore, "_blank");
} catch(e:Error) {
};
}
public function afterSecond(_arg1:TimerEvent){
var _local2:uint;
var _local3:uint;
var _local4:Number;
_local2 = loaderInfo.bytesLoaded;
_local3 = loaderInfo.bytesTotal;
_local4 = (_local2 / _local3);
progressBar.scaleX = ((_local2 / _local3) * 4);
percentText.text = (Math.round((_local4 * 100)).toString() + "%");
if (_local2 >= _local3){
timer.stop();
play();
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
};
}
private function showProgress(_arg1:ProgressEvent):void{
var _local2:uint;
var _local3:uint;
var _local4:Number;
_local2 = _arg1.bytesLoaded;
_local3 = _arg1.bytesTotal;
_local4 = (_local2 / _local3);
progressBar.scaleX = ((_local2 / _local3) * 4);
percentText.text = (Math.round((_local4 * 100)).toString() + "%");
}
private function initApp():void{
var _local1:Boolean;
var _local2:Class;
var _local3:Sprite;
_local1 = loaderInfo.applicationDomain.hasDefinition(_slot1.mainClass);
trace((" definition : " + _local1));
_local2 = (loaderInfo.applicationDomain.getDefinition(_slot1.mainClass) as Class);
_local3 = (new (_local2) as Sprite);
addChild(_local3);
}
}
}//package
Section 95
//RhinoDumb (RhinoDumb)
package {
import flash.events.*;
import flash.display.*;
public class RhinoDumb extends AnimalDumb {
public var stuckClip:MovieClip;
public var hitClip:MovieClip;
public var attackClip:MovieClip;
public var dieClip:MovieClip;
public function RhinoDumb(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6);
standCountMax = 12;
}
function frame3(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame6(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
override public function onEnterFrame(_arg1:Event){
if ((((currentFrame == 1)) || ((action == 0)))){
standCountCurrent = (standCountCurrent + 1);
if (standCountCurrent >= standCountMax){
checkNextLine();
};
};
if (dieStatus){
if (currentFrame == 4){
if (this.dieClip != null){
if (this.dieClip.currentFrame >= 19){
removeClip();
return;
};
};
};
return;
};
if (!dieStatus){
if (hitBananaStatus){
if (currentFrame == 3){
if (this.hitClip != null){
if (this.hitClip.currentFrame >= 6){
this.hitClip.gotoAndStop(1);
if (speedx > 2){
speedx = (speedx - 7);
};
gotoAndStop(2);
hitBananaStatus = false;
};
};
};
};
if (attackStatus){
if (currentFrame == 5){
if (this.attackClip != null){
if (this.attackClip.currentFrame >= 3){
this.attackClip.gotoAndStop(1);
attackStatus = false;
gotoAndStop(2);
};
};
};
};
if (action == 1){
turnStatus = false;
if (xMoveType == 1){
scaleX = -1;
if ((x + halfWidth) < targetEndx){
if (speedx < 8){
speedx = (speedx + 1);
};
x = (x + speedx);
} else {
x = (targetEndx - halfWidth);
speedx = 2;
attackStatus = false;
chaseMonkeyStatus = false;
standAnimal();
};
return;
};
if (xMoveType == -1){
scaleX = 1;
if ((x - halfWidth) > targetEndx){
if (speedx < 8){
speedx = (speedx + 1);
};
x = (x - speedx);
} else {
x = (targetEndx + halfWidth);
speedx = 2;
chaseMonkeyStatus = false;
standAnimal();
attackStatus = false;
};
return;
};
};
};
}
override public function init(_arg1:Number, _arg2:Number, _arg3:Number){
halfWidth = 50;
halfHeight = 25;
hitStatus = false;
dieStatus = false;
attackStatus = false;
chaseMonkeyStatus = false;
currentLine = _arg1;
health = _arg2;
lineDimension = GParams.game_Path_Dimension[(GParams.currentLevel - 1)];
if (_arg3 == 1){
startx = lineDimension[_arg1][0];
starty = (lineDimension[_arg1][1] - halfHeight);
targetEndx = (startx + lineDimension[_arg1][2]);
xMoveType = 1;
scaleX = 1;
x = startx;
y = starty;
} else {
if (_arg3 == -1){
targetEndx = lineDimension[_arg1][0];
startx = (targetEndx + lineDimension[_arg1][2]);
starty = (lineDimension[_arg1][1] - halfHeight);
xMoveType = -1;
scaleX = -1;
x = (startx - halfWidth);
y = starty;
};
};
gotoAndStop(2);
speedx = 2;
action = 1;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
override public function hit_Banana(){
if (!dieStatus){
health = (health - 10);
if (health > 0){
hitBananaStatus = true;
gotoAndStop(3);
} else {
dieStatus = true;
MainClass.gameScore = (MainClass.gameScore + GParams.RHINODUMBSCORE);
ScoreClip.scoreClip.updateScore();
MainClass.rhinoHornStatus = true;
Bg1.bg1.removeRhinoReference();
gotoAndStop(4);
};
};
}
override public function removeClip(){
var _local1:MovieClip;
x = 1500;
y = 1500;
_local1 = (Bg1.bg1.surfaceBg as SurfaceL7);
_local1.rope_animation.gotoAndStop(2);
removeEventListener(TimerEvent.TIMER_COMPLETE, checkNextLine);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
if (Bg1.bg1.contains(this)){
trace("removed");
if (GParams.currentLevel == 6){
MainClass.levelEndStatus = true;
};
Bg1.bg1.removeChild(this);
};
}
}
}//package
Section 96
//ScoreClip (ScoreClip)
package {
import flash.display.*;
import flash.text.*;
public class ScoreClip extends MovieClip {
public var sText5:TextField;
public var sText3:TextField;
public var sText4:TextField;
private var denominatorArray:Array;
private var scoreTextArray:Array;
public var sText1:TextField;
public var sText2:TextField;
public var sText6:TextField;
public static var scoreClip:ScoreClip = null;
public function init(){
var _local1:TextFormat;
x = 320;
y = 5;
_local1 = new TextFormat();
_local1.font = "Verdana";
_local1.color = 0xFFFFFF;
_local1.size = 14;
_local1.bold = true;
scoreTextArray = ["sText1", "sText2", "sText3", "sText4", "sText5", "sText6"];
denominatorArray = [1, 10, 100, 1000, 10000, 100000];
resetTextField();
updateScore();
}
public function resetTextField(){
var _local1:int;
var _local2:TextField;
_local1 = 0;
while (_local1 < scoreTextArray.length) {
_local2 = this[scoreTextArray[_local1]];
_local2.text = "";
_local1++;
};
}
public function updateScore(){
var _local1:int;
var _local2:Number;
var _local3:TextField;
_local1 = 0;
while (_local1 < scoreTextArray.length) {
_local2 = (Math.floor((MainClass.gameScore / denominatorArray[_local1])) % 10);
_local3 = this[scoreTextArray[_local1]];
_local3.text = _local2.toString();
_local1++;
};
}
public static function getInstance():ScoreClip{
if (scoreClip == null){
scoreClip = new (ScoreClip);
};
return (scoreClip);
}
}
}//package
Section 97
//Snake (Snake)
package {
import flash.events.*;
import flash.display.*;
public class Snake extends MovieClip {
private var attackStatus:Boolean;// = false
public var swallowClip:MovieClip;
private var alertStatus:Boolean;// = false
public var hitClip:MovieClip;
public var body:MovieClip;
private var swallowStatus:Boolean;// = false
public var alertClip:MovieClip;
public var attackClip:MovieClip;
private var isActive:Boolean;// = true
private var hitBananaStatus:Boolean;// = false
private var lineNum:Number;
public static var snake:Snake = null;
public function Snake(){
hitBananaStatus = false;
alertStatus = false;
attackStatus = false;
swallowStatus = false;
isActive = true;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5);
}
public function init(){
swallowStatus = false;
attackStatus = false;
alertStatus = false;
x = GParams.stage_Snake_Position[(GParams.currentLevel - 1)][0];
y = GParams.stage_Snake_Position[(GParams.currentLevel - 1)][1];
scaleX = GParams.stage_Snake_Position[(GParams.currentLevel - 1)][2];
gotoAndStop("still");
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame2(){
stop();
}
public function removeAllListener(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function onEnterFrame(_arg1:Event){
var _local2:Number;
var _local3:Number;
var _local4:Number;
lineNum = Monkey.monkey.currentLineIndex;
if (swallowStatus){
if (currentLabel == "swallow"){
if (this.swallowClip != null){
if (this.swallowClip.currentFrame >= 45){
swallowStatus = false;
this.swallowClip.gotoAndStop(1);
gotoAndStop("still");
Monkey.monkey.health = 0;
Monkey.monkey.life = (Monkey.monkey.life - 1);
LifeClip.lifeClip.updateLife();
Monkey.monkey.checkGameEndStatus();
};
};
};
return;
};
if (hitBananaStatus){
if (currentLabel == "hit"){
if (this.hitClip != null){
if (this.hitClip.currentFrame >= 45){
this.hitClip.gotoAndStop(1);
gotoAndStop("still");
hitBananaStatus = false;
alertStatus = false;
};
};
};
return;
};
if (alertStatus){
if (currentLabel == "alert"){
if (this.alertClip != null){
if (this.alertClip.currentFrame >= 65){
this.alertClip.gotoAndStop(1);
gotoAndStop("still");
attackStatus = false;
alertStatus = false;
};
};
};
};
if (isActive){
_local2 = (Monkey.monkey.actualPosition.x - x);
_local3 = (Monkey.monkey.actualPosition.y - y);
_local4 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
if ((((_local4 < 300)) && ((_local4 > 200)))){
if (((!(swallowStatus)) && (!(alertStatus)))){
gotoAndStop("still");
return;
};
};
if (_local4 < 200){
if (((!(swallowStatus)) && (!(alertStatus)))){
alertStatus = true;
gotoAndStop("alert");
return;
};
};
if (((((!(hitBananaStatus)) && (!(swallowStatus)))) && (!(Monkey.monkey.dieStatus)))){
if (this.body.hitTestObject(Monkey.monkey)){
swallowStatus = true;
attackStatus = false;
alertStatus = false;
Monkey.monkey.dieStatus = true;
Monkey.monkey.x = -500;
gotoAndStop("swallow");
};
};
};
}
public function hit_Banana(){
if (!swallowStatus){
hitBananaStatus = true;
gotoAndStop("hit");
};
}
public static function getInstance():Snake{
if (snake == null){
snake = new (Snake);
};
return (snake);
}
}
}//package
Section 98
//SnakeTime (SnakeTime)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
public class SnakeTime extends Enemy {
public var counter:Number;
public var maxCounter:Number;
public var timerStart:Boolean;// = false
private var currentCount:uint;// = 0
public var timer:Timer;
public var health:Number;// = 5
public var halfWidth:Number;
public var dieStatus:Boolean;
public var halfHeight:Number;
private var startCounter:Number;
public var secondText:TextField;
public var hitSwordStatus:Boolean;
public var dieClip:MovieClip;
private static var snakeTime:SnakeTime = null;
public function SnakeTime(){
health = 5;
timerStart = false;
currentCount = 0;
super();
addFrameScript(0, frame1, 1, frame2);
}
public function init(_arg1, _arg2, _arg3, _arg4){
x = _arg1;
y = _arg2;
dieStatus = false;
timerStart = false;
halfWidth = 27;
halfHeight = 12;
maxCounter = _arg4;
startCounter = maxCounter;
GParams.RESCUEDNUM = 0;
createTimer();
currentCount = 0;
gotoAndStop(1);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function resetListener(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function removeClip(){
x = 1500;
y = 1500;
gotoAndStop(1);
secondText.text = "00";
removeAllListeners();
if (Bg1.bg1.contains(this)){
Bg1.bg1.removeChild(this);
};
}
public function hit_Sword(){
if (!dieStatus){
health = (health - 10);
if (health > 0){
} else {
timerStart = false;
dieStatus = true;
Bg1.bg1.removeSnakeTimeReference();
gotoAndStop(2);
};
};
}
private function onComplete(){
if (currentFrame == 1){
secondText.text = "00";
};
removeAllListeners();
Monkey.monkey.rescueFail();
}
function frame1(){
stop();
}
private function createTimer(){
maxCounter = (maxCounter * GParams.frameRate);
}
private function rescueClip(){
var _local1:int;
removeAllListeners();
GParams.RESCUEDNUM = (GParams.RESCUEDNUM + 1);
MainClass.gameScore = (MainClass.gameScore + 50);
ScoreClip.scoreClip.updateScore();
if (GParams.RESCUEDNUM == GParams.RESCUEDTOTAL){
_local1 = (maxCounter - currentCount);
if (_local1 > 0){
MainClass.gameScore = (MainClass.gameScore + (_local1 * 2));
ScoreClip.scoreClip.updateScore();
};
MainClass.levelEndStatus = true;
};
}
private function removeAllListeners(){
timerStart = false;
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function onSecond(){
if (((timerStart) && (!(dieStatus)))){
startCounter--;
secondText.text = startCounter.toString();
};
}
function frame2(){
stop();
}
private function onEnterFrame(_arg1:Event){
if (GParams.gamePause){
if (currentFrame != 1){
gotoAndStop(1);
};
initialiseTextField();
};
if (!GParams.gamePause){
if (!timerStart){
timerStart = true;
};
if (((timerStart) && ((dieStatus == false)))){
currentCount = (currentCount + 1);
if ((currentCount % GParams.frameRate) == 0){
onSecond();
};
if (currentCount >= maxCounter){
onComplete();
timerStart = false;
return;
};
};
if (dieStatus){
if (currentFrame == 2){
if (this.dieClip != null){
if (this.dieClip.currentFrame >= 51){
rescueClip();
return;
};
};
};
};
};
}
private function initialiseTextField(){
var _local1:TextFormat;
_local1 = new TextFormat();
_local1.font = "Verdana";
_local1.size = 14;
_local1.bold = true;
if (secondText != null){
secondText.text = startCounter.toString();
secondText.setTextFormat(_local1);
};
}
public static function getInstance():SnakeTime{
return (new (SnakeTime));
}
}
}//package
Section 99
//StaticSlider (StaticSlider)
package {
import flash.display.*;
public class StaticSlider extends Sprite {
var typeNum:Number;
var speed:Number;
var refClip:MovieClip;
var endPos:Number;
var startPos:Number;
var inActive:Boolean;// = true
var dist:Number;
var dir:Number;
public function StaticSlider(){
inActive = true;
super();
}
public function init(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number){
refClip = _arg1;
dir = _arg2;
dist = _arg3;
speed = _arg4;
typeNum = 1;
startPos = refClip.y;
if (dir == -1){
endPos = (startPos - dist);
} else {
endPos = (startPos + dist);
};
}
public function checkSliderCollision(){
if (refClip.hitTestPoint(Monkey.monkey.stagePosition.x, ((Monkey.monkey.stagePosition.y + Monkey.monkey.halfHeight) - 10), true)){
if (refClip.hitTestPoint(Monkey.monkey.stagePosition.x, ((Monkey.monkey.stagePosition.y + Monkey.monkey.halfHeight) + 5), true)){
Monkey.monkey.slideUpStatus = false;
Monkey.monkey.slideDownStatus = false;
Monkey.monkey.sliderCollisionStatus = false;
return (false);
};
};
}
public function removeClip(){
}
}
}//package
Section 100
//Stone (Stone)
package {
import flash.events.*;
import flash.display.*;
public class Stone extends MovieClip {
var throwProgressStatus:Boolean;// = false
var throwX:Number;// = 0
var throwY:Number;// = 0
var startX:Number;
var startY:Number;
var throwDirection:Number;
var gravity:Number;// = 0.1
var speed:Number;
var halfWidth:int;// = 10
public var hitClip:MovieClip;
var prevY:Number;
var halfHeight:int;// = 5
var prevX:Number;
var throwUpStatus:Boolean;// = false
var throwDownStatus:Boolean;// = false
var endX:Number;
var endY:Number;
public static var stone:Stone = null;
public function Stone(){
halfWidth = 10;
halfHeight = 5;
throwY = 0;
throwX = 0;
gravity = 0.1;
throwUpStatus = false;
throwProgressStatus = false;
throwDownStatus = false;
super();
}
function init(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
startX = (GorillaSmart.gorillaSmart.x - 20);
startY = (GorillaSmart.gorillaSmart.y - 20);
endX = Monkey.monkey.x;
endY = (Monkey.monkey.y + 25);
speed = 13;
throwProgressStatus = true;
throwUpStatus = true;
throwDownStatus = false;
x = startX;
y = startY;
_local1 = (endX - x);
_local2 = (endY - y);
_local3 = Math.atan2(_local2, _local1);
_local4 = Math.ceil(((_local3 / Math.PI) * 180));
throwX = (Math.cos(_local3) * speed);
throwY = (Math.sin(_local3) * speed);
rotation = _local4;
gotoAndStop("stand");
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function removeStone(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
if (this.parent.contains(this)){
this.parent.removeChild(this);
};
}
private function checkMonkeyCollision(){
var _local1:Monkey;
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local1 = Monkey.monkey;
if (((!((_local1 == null))) && (!(_local1.hangStatus)))){
_local2 = (_local1.x - x);
_local3 = (_local1.y - y);
_local4 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
if (this.hitClip.hitTestObject(_local1.body)){
_local1.hit_Bhala();
removeStone();
return;
};
};
}
private function onEnterFrame(_arg1:Event){
Move();
checkMonkeyCollision();
}
private function Move(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
if (throwUpStatus){
prevX = x;
prevY = y;
x = (x + throwX);
y = (y + throwY);
_local1 = (prevX - x);
_local2 = (prevY - y);
_local3 = Math.atan2(_local2, _local1);
_local4 = Math.ceil(((_local3 / Math.PI) * 180));
rotation = (_local4 + 180);
if (y > 800){
removeStone();
};
};
}
public static function getInstance():Stone{
if (stone == null){
stone = new (Stone);
};
return (stone);
}
}
}//package
Section 101
//Surface (Surface)
package {
import flash.display.*;
public class Surface extends MovieClip {
var bgNumber:Number;
var sliderArray:Array;
public static var stageSliderArray:Array = null;
public function init(){
}
public function removeClip(){
}
}
}//package
Section 102
//SurfaceFactory (SurfaceFactory)
package {
public class SurfaceFactory {
private static var surfaceL1:SurfaceL1 = null;
private static var surfaceL2:SurfaceL2 = null;
private static var surfaceL3:SurfaceL3 = null;
private static var surfaceL4:SurfaceL4 = null;
private static var surfaceL5:SurfaceL5 = null;
private static var surfaceL6:SurfaceL6 = null;
private static var surfaceL7:SurfaceL7 = null;
private static var surfaceL8:SurfaceL8 = null;
private static var surfaceL9:SurfaceL9 = null;
public static function createInstance():Surface{
switch (GParams.currentLevel){
case 1:
if (surfaceL1 == null){
surfaceL1 = new SurfaceL1();
};
return (surfaceL1);
case 2:
if (surfaceL2 == null){
surfaceL2 = new SurfaceL2();
};
return (surfaceL2);
case 3:
if (surfaceL3 == null){
surfaceL3 = new SurfaceL3();
};
return (surfaceL3);
case 4:
if (surfaceL4 == null){
surfaceL4 = new SurfaceL4();
};
return (surfaceL4);
case 5:
if (surfaceL5 == null){
surfaceL5 = new SurfaceL5();
};
return (surfaceL5);
case 6:
if (surfaceL6 == null){
surfaceL6 = new SurfaceL6();
};
return (surfaceL6);
case 7:
if (surfaceL7 == null){
surfaceL7 = new SurfaceL7();
};
return (surfaceL7);
case 8:
if (surfaceL8 == null){
surfaceL8 = new SurfaceL8();
};
return (surfaceL8);
case 9:
if (surfaceL9 == null){
surfaceL9 = new SurfaceL9();
};
return (surfaceL9);
default:
return (null);
};
}
}
}//package
Section 103
//SurfaceL1 (SurfaceL1)
package {
import flash.display.*;
public class SurfaceL1 extends Surface {
public var hitAreaClip:MovieClip;
public var levelEndAreaClip:MovieClip;
public var climberHitAreaClip:MovieClip;
public function SurfaceL1(){
addFrameScript(0, frame1);
bgNumber = 1;
}
function frame1(){
stop();
}
}
}//package
Section 104
//SurfaceL2 (SurfaceL2)
package {
import flash.display.*;
public class SurfaceL2 extends Surface {
public var hitAreaClip:MovieClip;
public var levelEndAreaClip:MovieClip;
public var climberHitAreaClip:MovieClip;
public function SurfaceL2(){
bgNumber = 2;
}
}
}//package
Section 105
//SurfaceL3 (SurfaceL3)
package {
import flash.display.*;
public class SurfaceL3 extends Surface {
public var hitAreaClip:MovieClip;
public var climber2:MovieClip;
public var levelEndAreaClip:MovieClip;
public var climber3:MovieClip;
public var climber4:MovieClip;
public var climber5:MovieClip;
public var climber1:MovieClip;
public var climberHitAreaClip:MovieClip;
public function SurfaceL3(){
addFrameScript(1, frame2);
bgNumber = 3;
gotoAndStop(1);
}
function frame2(){
stop();
}
}
}//package
Section 106
//SurfaceL4 (SurfaceL4)
package {
import flash.display.*;
public class SurfaceL4 extends Surface {
public var hitAreaClip:MovieClip;
public var levelEndAreaClip:MovieClip;
public var climberHitAreaClip:MovieClip;
public function SurfaceL4(){
bgNumber = 4;
}
override public function init(){
var _local1:Number;
var _local2:MovieClip;
sliderArray = [["slider1", 1, 0, 0, 0, 2000], ["base", 1, 0, 0, 0, 0]];
stageSliderArray = new Array(sliderArray.length);
_local1 = 0;
while (_local1 < sliderArray.length) {
_local2 = (this.hitAreaClip.getChildByName(sliderArray[_local1][0]) as MovieClip);
if (_local1 < (sliderArray.length - 1)){
stageSliderArray[_local1] = new BreakingSlider();
} else {
stageSliderArray[_local1] = new StaticSlider();
};
stageSliderArray[_local1].init(_local2, sliderArray[_local1][1], sliderArray[_local1][2], sliderArray[_local1][3], sliderArray[_local1][4], sliderArray[_local1][5]);
_local1++;
};
}
override public function removeClip(){
var _local1:Number;
_local1 = 0;
while (_local1 < stageSliderArray.length) {
if (stageSliderArray[_local1] != null){
stageSliderArray[_local1].removeClip();
};
_local1++;
};
stageSliderArray = null;
}
}
}//package
Section 107
//SurfaceL5 (SurfaceL5)
package {
import flash.display.*;
public class SurfaceL5 extends Surface {
public var hitAreaClip:MovieClip;
public var levelEndAreaClip:MovieClip;
public var climberHitAreaClip:MovieClip;
public function SurfaceL5(){
bgNumber = 5;
}
}
}//package
Section 108
//SurfaceL6 (SurfaceL6)
package {
import flash.display.*;
public class SurfaceL6 extends Surface {
public var hitAreaClip:MovieClip;
public var levelEndAreaClip:MovieClip;
public function SurfaceL6(){
addFrameScript(0, frame1);
bgNumber = 6;
}
function frame1(){
stop();
}
}
}//package
Section 109
//SurfaceL7 (SurfaceL7)
package {
import flash.display.*;
public class SurfaceL7 extends Surface {
public var hitAreaClip:MovieClip;
public var levelEndAreaClip:MovieClip;
public var rope_animation:MovieClip;
public var climberHitAreaClip:MovieClip;
public var ropeHitAreaClip:MovieClip;
public function SurfaceL7(){
addFrameScript(0, frame1);
bgNumber = 7;
}
override public function init(){
rope_animation.gotoAndStop(1);
}
function frame1(){
stop();
}
}
}//package
Section 110
//SurfaceL8 (SurfaceL8)
package {
import flash.display.*;
public class SurfaceL8 extends Surface {
public var hitAreaClip:MovieClip;
public var levelEndAreaClip:MovieClip;
public var climberHitAreaClip:MovieClip;
public function SurfaceL8(){
addFrameScript(0, frame1);
bgNumber = 8;
}
override public function init(){
var _local1:Number;
var _local2:MovieClip;
sliderArray = [["slider1", -1, 70, 1, 1005, 0], ["slider2", 1, 90, 1, 827, 0], ["slider3", -1, 60, 1, 947, 0], ["slider4", -1, 180, 1, 806, 0], ["slider5", 1, 60, 1, 640, 0], ["slider6", -1, 90, 1, 297, 0], ["slider7", 1, 190, 1, 310, 0], ["slider8", 1, 0, 0, 0, 1500], ["slider9", 1, 0, 0, 0, 3000], ["slider10", 1, 0, 0, 0, 2500], ["base", 0, 0, 0, 0, 0]];
stageSliderArray = new Array(sliderArray.length);
_local1 = 0;
while (_local1 < sliderArray.length) {
_local2 = (this.hitAreaClip.getChildByName(sliderArray[_local1][0]) as MovieClip);
if (_local1 < (sliderArray.length - 4)){
stageSliderArray[_local1] = new MovingSlider();
} else {
if (_local1 < (sliderArray.length - 1)){
stageSliderArray[_local1] = new BreakingSlider();
} else {
stageSliderArray[_local1] = new StaticSlider();
};
};
stageSliderArray[_local1].init(_local2, sliderArray[_local1][1], sliderArray[_local1][2], sliderArray[_local1][3], sliderArray[_local1][4], sliderArray[_local1][5]);
_local1++;
};
}
function frame1(){
stop();
}
override public function removeClip(){
var _local1:Number;
_local1 = 0;
while (_local1 < stageSliderArray.length) {
if (stageSliderArray[_local1] != null){
stageSliderArray[_local1].removeClip();
};
_local1++;
};
stageSliderArray = null;
}
}
}//package
Section 111
//SurfaceL9 (SurfaceL9)
package {
import flash.display.*;
public class SurfaceL9 extends Surface {
public var hitAreaClip:MovieClip;
public var levelEndAreaClip:MovieClip;
public var climberHitAreaClip:MovieClip;
public function SurfaceL9(){
bgNumber = 9;
gotoAndStop(1);
}
}
}//package
Section 112
//Welcome (Welcome)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class Welcome extends MovieClip {
public var hs:MovieClip;
var requestAddMore:URLRequest;// = null
var urlPlayMore:String;// = "http://www.flasharcade.com"
public var ipwelcome:MovieClip;
var requestPlayMore:URLRequest;// = null
public var introframe:MovieClip;
var urlAddMoreGames:String;// = "http://www.flasharcade.com/flash-games/"
private static var welcome:Welcome = null;
public function Welcome(){
urlPlayMore = "http://www.flasharcade.com";
requestPlayMore = null;
urlAddMoreGames = "http://www.flasharcade.com/flash-games/";
requestAddMore = null;
super();
requestPlayMore = new URLRequest(urlPlayMore);
requestAddMore = new URLRequest(urlAddMoreGames);
ipwelcome.playmore.addEventListener(MouseEvent.CLICK, handleClick);
ipwelcome.addMore.addEventListener(MouseEvent.CLICK, handleClickAddMore);
introframe.playmore.addEventListener(MouseEvent.CLICK, handleClick);
hs.playmorehs.addEventListener(MouseEvent.CLICK, handleClick);
}
public function handleClickAddMore(_arg1:MouseEvent){
var event = _arg1;
try {
navigateToURL(requestAddMore, "_blank");
} catch(e:Error) {
};
}
public function handleClick(_arg1:MouseEvent){
var event = _arg1;
try {
navigateToURL(requestPlayMore, "_blank");
} catch(e:Error) {
};
}
public function emptyScores(){
var _local1:String;
_local1 = "";
hs.player1.text = _local1;
hs.score1.text = _local1;
hs.date1.text = _local1;
hs.player2.text = _local1;
hs.score2.text = _local1;
hs.date2.text = _local1;
hs.player3.text = _local1;
hs.score3.text = _local1;
hs.date3.text = _local1;
hs.player4.text = _local1;
hs.score4.text = _local1;
hs.date4.text = _local1;
hs.player5.text = _local1;
hs.score5.text = _local1;
hs.date5.text = _local1;
hs.player6.text = _local1;
hs.score6.text = _local1;
hs.date6.text = _local1;
hs.player7.text = _local1;
hs.score7.text = _local1;
hs.date7.text = _local1;
hs.player8.text = _local1;
hs.score8.text = _local1;
hs.date8.text = _local1;
hs.player9.text = _local1;
hs.score9.text = _local1;
hs.date9.text = _local1;
hs.player10.text = _local1;
hs.score10.text = _local1;
hs.date10.text = _local1;
}
public static function getInstance():Welcome{
if (welcome == null){
welcome = new (Welcome);
};
return (welcome);
}
}
}//package
Section 113
//WelcomeSound (WelcomeSound)
package {
import flash.media.*;
public class WelcomeSound extends Sound {
}
}//package
Section 114
//WildBoreDumb (WildBoreDumb)
package {
import flash.events.*;
import flash.display.*;
public class WildBoreDumb extends AnimalDumb {
public var stuckClip:MovieClip;
public var hitClip:MovieClip;
public var attackClip:MovieClip;
public var dieClip:MovieClip;
public function WildBoreDumb(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6);
}
function frame3(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame6(){
stop();
}
function frame1(){
stop();
}
private function updateHealth(){
var _local1:Number;
if (EnemyHealthClip.enemyHealthClip != null){
trace(("health =" + health));
_local1 = (100 - health);
EnemyHealthClip.enemyHealthClip.gotoAndStop(_local1);
return;
};
}
function frame2(){
stop();
}
override public function onEnterFrame(_arg1:Event){
if (!GParams.gamePause){
if (dieStatus){
if (currentFrame == 4){
if (this.dieClip != null){
if (this.dieClip.currentFrame >= 28){
removeClip();
return;
};
};
};
return;
};
if ((((currentFrame == 1)) || ((action == 0)))){
standCountCurrent = (standCountCurrent + 1);
if (standCountCurrent >= standCountMax){
checkNextLine();
};
};
if (!dieStatus){
if (hitBananaStatus){
if (currentFrame == 3){
if (this.hitClip != null){
if (this.hitClip.currentFrame >= 6){
this.hitClip.gotoAndStop(1);
if (speedx > 2){
speedx = (speedx - 7);
};
gotoAndStop(2);
hitBananaStatus = false;
};
};
};
};
if (attackStatus){
if (currentFrame == 5){
if (this.attackClip != null){
if (this.attackClip.currentFrame >= 3){
this.attackClip.gotoAndStop(1);
attackStatus = false;
gotoAndStop(2);
};
};
};
};
if (action == 1){
turnStatus = false;
if (xMoveType == 1){
scaleX = -1;
if ((x + halfWidth) < targetEndx){
if (speedx < maxSpeed){
speedx = (speedx + 1);
};
x = (x + speedx);
} else {
x = (targetEndx - halfWidth);
speedx = 2;
standAnimal();
};
return;
};
if (xMoveType == -1){
scaleX = 1;
if ((x - halfWidth) > targetEndx){
if (speedx < maxSpeed){
speedx = (speedx + 1);
};
x = (x - speedx);
} else {
x = (targetEndx + halfWidth);
speedx = 2;
chaseMonkeyStatus = false;
standAnimal();
};
return;
};
};
};
};
}
override public function init(_arg1:Number, _arg2:Number, _arg3:Number){
halfWidth = 36;
halfHeight = 26;
hitStatus = false;
dieStatus = false;
attackStatus = false;
chaseMonkeyStatus = false;
currentLine = _arg1;
health = _arg2;
lineDimension = GParams.game_Path_Dimension[(GParams.currentLevel - 1)];
if (_arg3 == 1){
startx = lineDimension[_arg1][0];
starty = (lineDimension[_arg1][1] - halfHeight);
targetEndx = (startx + lineDimension[_arg1][2]);
xMoveType = 1;
scaleX = 1;
x = startx;
y = starty;
} else {
if (_arg3 == -1){
targetEndx = lineDimension[_arg1][0];
startx = (targetEndx + lineDimension[_arg1][2]);
starty = (lineDimension[_arg1][1] - halfHeight);
xMoveType = -1;
scaleX = -1;
x = (startx - halfWidth);
y = starty;
};
};
if (GParams.currentLevel != 6){
maxSpeed = 8;
} else {
maxSpeed = 10;
};
gotoAndStop(2);
speedx = 2;
action = 1;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
override protected function standAnimal(){
if (GParams.currentLevel == 6){
if (currentFrame != 6){
gotoAndStop(6);
};
standCountMax = 36;
standCountCurrent = 0;
} else {
standCountMax = 6;
standCountCurrent = 0;
if (currentFrame != 1){
gotoAndStop(1);
};
};
attackStatus = false;
action = 0;
}
override public function hit_Banana(){
if (!dieStatus){
health = (health - 10);
updateHealth();
if (health > 0){
hitBananaStatus = true;
if (currentFrame != 6){
gotoAndStop(3);
};
} else {
MainClass.gameScore = (MainClass.gameScore + GParams.WILDBOREDUMBSCORE);
ScoreClip.scoreClip.updateScore();
dieStatus = true;
Bg1.bg1.removeWildBoreReference();
gotoAndStop(4);
};
};
}
override public function removeClip(){
x = 1500;
y = 1500;
removeEventListener(TimerEvent.TIMER_COMPLETE, checkNextLine);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
if (Bg1.bg1.contains(this)){
trace("removed");
if (GParams.currentLevel == 6){
MainClass.levelEndStatus = true;
};
Bg1.bg1.removeChild(this);
};
}
}
}//package
Section 115
//VultureAverage (VultureAverage)
package {
import flash.events.*;
import flash.display.*;
public class VultureAverage extends AnimalAverage {
public var dieClip:MovieClip;
public var hitClip:MovieClip;
public function VultureAverage(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
vultureType = GParams.VULTURE_AVERAGE;
}
override public function init(_arg1:Number, _arg2:Number, _arg3:Number){
halfWidth = 22;
halfHeight = 28;
jumpHeight = -10;
hitStatus = false;
dieStatus = false;
currentLine = _arg1;
health = _arg2;
attackStatus = false;
hitBananaStatus = false;
lineDimension = GParams.game_Path_Dimension[(GParams.currentLevel - 1)];
if (_arg3 == 1){
startx = lineDimension[_arg1][0];
starty = (lineDimension[_arg1][1] - halfHeight);
targetEndx = (startx + lineDimension[_arg1][2]);
xMoveType = 1;
scaleX = 1;
x = (startx + 30);
y = starty;
} else {
if (_arg3 == -1){
targetEndx = lineDimension[_arg1][0];
startx = (targetEndx + lineDimension[_arg1][2]);
starty = (lineDimension[_arg1][1] - halfHeight);
xMoveType = -1;
scaleX = -1;
x = ((startx - halfWidth) - 30);
y = starty;
};
};
gotoAndStop(2);
speedx = 4;
action = 1;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
override public function removeClip(){
x = 1500;
y = 1500;
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
if (Bg1.bg1.contains(this)){
Bg1.bg1.removeChild(this);
};
}
function frame3(){
stop();
}
function frame4(){
stop();
}
function frame1(){
stop();
}
override public function hit_Banana(){
if (!dieStatus){
health = (health - 5);
if (health > 0){
hitBananaStatus = true;
gotoAndStop(3);
} else {
MainClass.gameScore = (MainClass.gameScore + GParams.VULTUREAVGSCORE);
ScoreClip.scoreClip.updateScore();
dieStatus = true;
Bg1.bg1.removeVultureReference();
gotoAndStop(4);
};
};
}
override public function onEnterFrame(_arg1:Event){
if (hitBananaStatus){
if (currentFrame == 3){
if (this.hitClip != null){
if (this.hitClip.currentFrame >= 6){
this.hitClip.gotoAndStop(1);
if (speedx < 6){
speedx = (speedx + 2);
};
gotoAndStop(2);
hitBananaStatus = false;
};
};
};
return;
};
if (dieStatus){
if (currentFrame == 4){
if (this.dieClip != null){
if (this.dieClip.currentFrame >= 12){
removeClip();
return;
};
};
};
return;
};
if (!dieStatus){
if (action == 2){
if (jumpUpStatus){
y = (y + jumpHeight);
jumpHeight = (jumpHeight + 1);
if (jumpHeight >= 0){
jumpHeight = 0;
jumpUpStatus = false;
jumpDownStatus = true;
};
x = (x + ((jumpx - x) / 12));
return;
};
if (jumpDownStatus){
if (jumpHeight <= 5){
jumpHeight = (jumpHeight + 1);
};
y = (y + jumpHeight);
x = (x + ((jumpx - x) / 12));
if (y > starty){
y = starty;
jumpHeight = -10;
jumpDownStatus = false;
action = 1;
};
return;
};
};
if (action == 1){
if (xMoveType == 1){
scaleX = -1;
if ((x + halfWidth) < targetEndx){
x = (x + speedx);
} else {
x = ((targetEndx - halfWidth) - speedx);
action = 0;
speedx = 4;
checkNextLine();
};
return;
};
if (xMoveType == -1){
scaleX = 1;
if ((x - halfWidth) > targetEndx){
x = (x - speedx);
} else {
x = ((targetEndx + halfWidth) + speedx);
action = 0;
speedx = 4;
checkNextLine();
};
return;
};
};
};
}
function frame2(){
stop();
}
}
}//package
Section 116
//VultureDumb (VultureDumb)
package {
import flash.events.*;
import flash.display.*;
public class VultureDumb extends AnimalDumb {
public var hitClip:MovieClip;
public var dieClip:MovieClip;
public function VultureDumb(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
vultureType = GParams.VULTURE_DUMB;
}
function frame3(){
stop();
}
function frame4(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
override public function onEnterFrame(_arg1:Event){
if ((((currentFrame == 1)) || ((action == 0)))){
standCountCurrent = (standCountCurrent + 1);
if (standCountCurrent >= standCountMax){
checkNextLine();
};
};
if (dieStatus){
if (currentFrame == 4){
if (this.dieClip != null){
if (this.dieClip.currentFrame >= 12){
removeClip();
return;
};
};
};
return;
};
if (!dieStatus){
if (hitBananaStatus){
if (currentFrame == 3){
if (this.hitClip != null){
if (this.hitClip.currentFrame >= 6){
this.hitClip.gotoAndStop(1);
if (speedx < maxSpeed){
speedx = (speedx + 0.25);
};
gotoAndStop(2);
action = 1;
if (currentLine != Monkey.monkey.currentLineIndex){
escapeHit();
};
hitBananaStatus = false;
};
};
};
return;
};
checkMonkeyPosition();
if (action == 1){
turnStatus = false;
if (xMoveType == 1){
scaleX = -1;
if ((x + halfWidth) < targetEndx){
if (speedx < maxSpeed){
speedx = (speedx + 0.25);
};
x = (x + speedx);
} else {
x = ((targetEndx - halfWidth) - speedx);
speedx = 0.25;
standAnimal();
chaseMonkeyStatus = false;
};
return;
};
if (xMoveType == -1){
scaleX = 1;
if ((x - halfWidth) > targetEndx){
if (speedx < maxSpeed){
speedx = (speedx + 0.25);
};
x = (x - speedx);
} else {
x = ((targetEndx + halfWidth) + speedx);
speedx = 0.5;
chaseMonkeyStatus = false;
standAnimal();
};
return;
};
};
};
}
override public function init(_arg1:Number, _arg2:Number, _arg3:Number){
super.initsuper();
halfWidth = 22;
halfHeight = 28;
hitStatus = false;
dieStatus = false;
chaseMonkeyStatus = false;
currentLine = _arg1;
health = _arg2;
lineDimension = GParams.game_Path_Dimension[(GParams.currentLevel - 1)];
if (_arg3 == 1){
startx = lineDimension[_arg1][0];
starty = (lineDimension[_arg1][1] - halfHeight);
targetEndx = (startx + lineDimension[_arg1][2]);
xMoveType = 1;
scaleX = 1;
x = (startx + 30);
y = starty;
} else {
if (_arg3 == -1){
targetEndx = lineDimension[_arg1][0];
startx = (targetEndx + lineDimension[_arg1][2]);
starty = (lineDimension[_arg1][1] - halfHeight);
xMoveType = -1;
scaleX = -1;
x = ((startx - halfWidth) - 30);
y = starty;
};
};
gotoAndStop(2);
maxSpeed = (Math.ceil(lineDimension[_arg1][2]) / 100);
speedx = 0.25;
action = 1;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
override public function hit_Banana(){
if (!dieStatus){
health = (health - 10);
if (health > 0){
hitBananaStatus = true;
gotoAndStop(3);
} else {
MainClass.gameScore = (MainClass.gameScore + GParams.VULTUREDUMBSCORE);
ScoreClip.scoreClip.updateScore();
dieStatus = true;
Bg1.bg1.removeVultureReference();
gotoAndStop(4);
};
};
}
}
}//package
Section 117
//YouWin (YouWin)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.text.*;
public class YouWin extends MovieClip {
public var errormesg:TextField;
var urlPlayMore:String;// = "http://www.flasharcade.com"
var requestPlayMore:URLRequest;// = null
public var submitScore:SimpleButton;
public var playmore:SimpleButton;
public var totalScore:TextField;
public var playAgain:SimpleButton;
public var player:TextField;
private static var youWin:YouWin = null;
public function YouWin(){
urlPlayMore = "http://www.flasharcade.com";
requestPlayMore = null;
super();
requestPlayMore = new URLRequest(urlPlayMore);
}
public function getPlayerName():String{
var _local1:String;
_local1 = this.player.text;
if (_local1 == null){
return (null);
};
this.errormesg.text = "";
return (_local1);
}
public function handleClick(_arg1:MouseEvent){
var event = _arg1;
try {
navigateToURL(requestPlayMore, "_blank");
} catch(e:Error) {
};
}
public function updateScores(){
this.totalScore.text = MainClass.gameScore.toString();
}
public function resetData(){
this.totalScore.text = " ";
this.player.text = "";
this.errormesg.text = " ";
}
public function setErrorMesg(_arg1:String){
this.errormesg.text = _arg1;
}
public static function getInstance():YouWin{
if (youWin == null){
youWin = new (YouWin);
};
youWin.resetData();
return (youWin);
}
}
}//package
Section 118
//YouWinSound (YouWinSound)
package {
import flash.media.*;
public class YouWinSound extends Sound {
}
}//package