Frame 1
session_id = random(999999999);
bytesLoaded == 0;
fscommand ("allowscale", false);
Frame 2
bytesLoaded = getBytesLoaded();
bytesTotal = getBytesTotal();
percent = (bytesLoaded / bytesTotal) * 100;
percent = percent - (percent % 1);
if (percent >= 100) {
percent = 100;
gotoAndPlay ("play");
}
with (baby) {
gotoAndStop(percent);
}
Frame 3
gotoAndPlay ("loading");
Frame 7
stopAllSounds();
Frame 52
stop();
Frame 53
stopAllSounds();
Frame 56
stop();
Frame 57
stopAllSounds();
Frame 71
stop();
Symbol 21 Button
on (release) {
with (_root) {
gotoAndPlay("game");
}
}
Symbol 77 MovieClip Frame 1
stop();
Symbol 77 MovieClip Frame 33
gotoAndStop (1);
Symbol 78 MovieClip Frame 1
stop();
Symbol 78 MovieClip Frame 2
_root.score = _root.score + (_root.scoreconstant * 5);
_root.addtoscore = _root.scoreconstant * 5;
Symbol 78 MovieClip Frame 30
stop();
Symbol 80 MovieClip Frame 1
stop();
Symbol 80 MovieClip Frame 2
_root.score = _root.score + _root.scoreconstant;
_root.addtoscore = _root.scoreconstant;
Symbol 80 MovieClip Frame 30
stop();
Symbol 84 MovieClip Frame 35
stop();
Symbol 85 MovieClip Frame 1
_root.vindir = 1;
Symbol 85 MovieClip Frame 56
_root.vindir = -1;
Symbol 85 MovieClip Frame 115
_root.vindir = 1;
Symbol 85 MovieClip Frame 122
gotoAndPlay (1);
Symbol 131 MovieClip Frame 1
stop();
Symbol 131 MovieClip Frame 5
stop();
Symbol 131 MovieClip Frame 8
stop();
Symbol 131 MovieClip Frame 11
stop();
Symbol 131 MovieClip Frame 13
stop();
Symbol 131 MovieClip Frame 14
stop();
Symbol 131 MovieClip Frame 17
stop();
Symbol 131 MovieClip Frame 20
stop();
Symbol 131 MovieClip Frame 22
stop();
Symbol 131 MovieClip Frame 23
stop();
Symbol 131 MovieClip Frame 33
stop();
Symbol 131 MovieClip Frame 34
stop();
Symbol 131 MovieClip Frame 42
stop();
Symbol 131 MovieClip Frame 45
stop();
Symbol 131 MovieClip Frame 57
stop();
Symbol 131 MovieClip Frame 134
with (_root) {
gotoAndPlay("end");
}
Symbol 134 Button
on (release) {
gotoAndPlay ("endlevel1");
}
Symbol 135 Button
on (release) {
gotoAndPlay ("endlevel2");
}
Symbol 152 Button
on (release) {
with (_root) {
gotoAndPlay("play");
}
}
Symbol 163 MovieClip Frame 1
stop();
Symbol 163 MovieClip Frame 2
stop();
Symbol 163 MovieClip Frame 3
stop();
Symbol 163 MovieClip Frame 4
stop();
Symbol 163 MovieClip Frame 6
stop();
Symbol 163 MovieClip Frame 7
stop();
Symbol 163 MovieClip Frame 8
stop();
Symbol 163 MovieClip Frame 9
stop();
Symbol 163 MovieClip Frame 10
gotoAndStop (2);
Symbol 164 MovieClip Frame 1
if (_root.level.mario.hSetVelocity != 0) {
with (runner) {
play();
}
} else {
with (runner) {
gotoAndStop(1);
}
}
Symbol 172 MovieClip Frame 1
stop();
Symbol 172 MovieClip Frame 2
stop();
Symbol 172 MovieClip Frame 3
stop();
Symbol 172 MovieClip Frame 4
stop();
Symbol 172 MovieClip Frame 5
gotoAndStop (2);
Symbol 173 MovieClip Frame 1
if (Key.isDown(38)) {
with (climber) {
play();
}
}
if (Key.isDown(40)) {
with (climber) {
play();
}
}
Symbol 179 MovieClip Frame 1
stop();
Symbol 179 MovieClip Frame 16
stop();
Symbol 179 MovieClip Frame 25
gotoAndStop ("climbing");
Symbol 179 MovieClip Frame 44
stop();
Symbol 187 MovieClip Frame 1
_root.vindir2 = 1;
Symbol 187 MovieClip Frame 40
_root.vindir2 = -1;
Symbol 187 MovieClip Frame 93
_root.vindir2 = 1;
Symbol 187 MovieClip Frame 104
gotoAndPlay (1);
Symbol 188 MovieClip Frame 1
_root.vindir3 = 1;
Symbol 188 MovieClip Frame 60
_root.vindir3 = -1;
Symbol 188 MovieClip Frame 123
_root.vindir3 = 1;
Symbol 188 MovieClip Frame 136
gotoAndPlay (1);
Symbol 200 MovieClip Frame 1
stop();
Symbol 201 MovieClip Frame 1
stop();
Symbol 205 MovieClip Frame 1
stop();
Symbol 209 MovieClip Frame 1
stop();
Symbol 218 MovieClip Frame 30
gotoAndPlay (1);
Symbol 220 MovieClip Frame 1
_root.lives = 5;
_root.score = 0;
timesecs = 30;
_root.time = 60;
Symbol 220 MovieClip Frame 33
function initGame() {
var _local1 = _root;
_local1.objectList = new Array();
_local1.worldArray = new Array();
_local1.scrollZoneLeft = 150;
_local1.gravity = 0.1;
_local1.scrollBuffer = 288;
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 15, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 15, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 15, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 15, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 15, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 1, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 1, 0, 0, 2, 1, 0, 0, 0, 15, 0, 0, 0, 64));
_local1.worldArray.push(new Array(48, 16, 16, 1, 0, 0, 2, 1, 0, 0, 0, 15, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 1, 0, 0, 2, 1, 0, 0, 0, 15, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 1, 0, 0, 0, 17, 16, 16, 16, 15, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 1, 0, 0, 2, 1, 0, 0, 0, 15, 0, 0, 0, 64));
}
function queryLocation(x, y, p) {
xTile = (x - (x % 32)) / 32;
yTile = (y - (y % 32)) / 32;
switch (p) {
case "topSolid" :
b = 1;
break;
case "bottomSolid" :
b = 2;
break;
case "leftSolid" :
b = 4;
break;
case "rightSolid" :
b = 8;
break;
case "ladder" :
b = 16;
break;
case "endlevel" :
b = 32;
break;
case "die" :
b = 64;
}
if (_root.worldArray[xTile][yTile] & b) {
return(true);
}
return(false);
}
function Character(i, t) {
this.vineVvelocity = -6;
this.vineHvelocity = 7;
this.instanceName = i;
this.x = -100;
this.y = -100;
this.vAcceleration = 0;
this.hAcceleration = 0;
this.vVelocity = 0;
this.hVelocity = 0;
this.vSetVelocity = 0;
this.hSetVelocity = 0;
this.gravityEffect = 1;
this.smallJumpGravity = 4;
this.largeJumpGravity = 1;
this.jumpStrength = 6;
this.onGround = 0;
this.jumping = 0;
this.moveDirection = 0;
this.running = 0;
this.climbingUp = 0;
this.climbingDown = 0;
this.onLadder = 0;
this.climbSpeed = -4;
this.vTerminalVelocity = 20;
this.walkSpeed = 5;
this.runSpeed = 6;
this.moveSpeed = this.walkSpeed;
this.moveAcceleration = 1.2;
this.airMoveAcceleration = 0.2;
this.airControl = 0;
this.characterHeight = eval (t + "._height");
this.headZone = -1;
this.baseWidth = hero._width;
this.baseHeight = hero.collision._height;
this.jumpStart = function () {
var _local1 = this;
if (_local1.onGround) {
_local1.onGround = 0;
_local1.jumping = 1;
_local1.gravityEffect = _local1.largeJumpGravity;
_local1.vVelocity = -_local1.jumpStrength;
}
};
this.jumpStop = function () {
var _local1 = this;
if (_local1.jumping) {
_local1.onGround = 0;
_local1.jumping = 0;
_local1.gravityEffect = _local1.smallJumpGravity;
}
};
this.move = function (direction) {
var _local1 = this;
switch (direction) {
case "left" :
_local1.moveDirection = -1;
return;
case "right" :
_local1.moveDirection = 1;
return;
case "stop" :
_local1.moveDirection = 0;
}
};
this.updatePhysics = function () {
switch (this.moveDirection) {
case -1 :
this.hSetVelocity = -this.moveSpeed;
break;
case 1 :
this.hSetVelocity = this.moveSpeed;
break;
case 0 :
this.hSetVelocity = 0;
}
if (queryLocation(this.x, this.y - 1, "endlevel")) {
gotoAndPlay ("endlevel1");
}
if (queryLocation(this.x, this.y - 1, "die")) {
gotoAndPlay ("dielevel1");
with (prompt) {
gotoAndStop("careful");
}
}
if (queryLocation(this.x, this.y - 1, "ladder")) {
if ((this.climbingUp == 1) or (this.climbingDown == 1)) {
this.onLadder = 1;
this.onGround = 0;
}
} else {
this.onLadder = 0;
}
if (this.onLadder and this.climbingUp) {
this.vVelocity = this.climbSpeed;
} else if ((this.onLadder and (!this.climbingUp)) and (!this.climbingUp)) {
this.vAcceleration = 0;
this.vVelocity = 0;
}
if (this.onLadder and this.climbingDown) {
this.vVelocity = -this.climbSpeed;
} else if ((this.onLadder and (!this.climbingDown)) and (!this.climbingUp)) {
this.vAcceleration = 0;
this.vVelocity = 0;
}
this.vVelocity = this.vVelocity + this.vAcceleration;
this.hVelocity = this.hVelocity + this.hAcceleration;
if (this.hVelocity < this.hSetVelocity) {
if (this.onGround) {
this.hAcceleration = this.moveAcceleration;
} else {
this.hAcceleration = this.airMoveAcceleration;
}
} else if (this.hVelocity > this.hSetVelocity) {
if (this.onGround) {
this.hAcceleration = -this.moveAcceleration;
} else {
this.hAcceleration = -this.airMoveAcceleration;
}
} else if (this.hVelocity == this.hSetVelocity) {
this.hAcceleration = 0;
}
if ((Math.abs(this.hVelocity) < this.moveAcceleration) and this.onGround) {
this.hVelocity = 0;
}
if (this.vVelocity > this.vTerminalVelocity) {
this.vVelocity = this.vTerminalVelocity;
}
if ((!this.onGround) and (!this.onLadder)) {
this.vAcceleration = this.vAcceleration + (_root.gravity * this.gravityEffect);
}
oldX = this.x;
oldY = this.y;
this.x = this.x + this.hVelocity;
this.y = this.y + this.vVelocity;
if (this.vVelocity >= 0) {
if (queryLocation(this.x, this.y, "topSolid")) {
if (this.onLadder == 0) {
this.onGround = 1;
this.y = this.y - (this.y % 32);
this.vVelocity = 0;
this.vAcceleration = 0;
}
} else {
this.onGround = 0;
}
} else if (this.vVelocity < 0) {
if (queryLocation(this.x, this.y - this.baseHeight, "bottomSolid")) {
if (this.onLadder == 0) {
this.y = this.y + (this.y % 32);
this.vVelocity = 5;
this.vAcceleration = 0;
}
}
}
if (this.hVelocity > 0) {
if (queryLocation(this.x + (this.baseWidth / 2), this.y - 1, "leftSolid")) {
this.hVelocity = 0;
this.hAcceleration = 0;
this.x = oldX;
}
} else if (this.hVelocity < 0) {
if (queryLocation(this.x - (this.baseWidth / 2), this.y - 1, "rightSolid")) {
this.hVelocity = 0;
this.hAcceleration = 0;
this.x = oldX;
}
}
this.moveTo(this.x, this.y);
};
this.getInstanceName = function () {
return(this.instanceName);
};
this.moveTo = function (x, y) {
this.x = x;
this.y = y;
eval (this.instanceName)._x = x;
eval (this.instanceName)._y = y;
};
duplicateMovieClip (t, this.instanceName, random(255));
_root.objectList.push(this);
}
function setpositions() {
if (swinging == 0) {
if (!mario.onGround) {
if (jumping == 0) {
if (onplatform <= 1) {
with (hero) {
gotoAndPlay("jump");
}
jumping = 1;
}
if (onplatform >= 2) {
with (hero) {
gotoAndStop("run");
}
jumping = 1;
}
}
}
}
if (mario.onLadder) {
if (climbing == 0) {
with (hero) {
gotoAndStop("climbing");
climbing = 1;
}
}
}
if (mario.onGround) {
climbing = 0;
swinging = 0;
jumping = 0;
if (!mario.onLadder) {
with (hero) {
gotoAndStop("run");
}
}
}
if (!mario.onGround) {
if (ignorecode >= 2) {
if (swinging == 0) {
swinging = 1;
with (hero) {
gotoAndPlay("swinging");
}
}
}
}
}
ignorecode = 0;
letgo = 0;
vrelpower = 12;
onplatform = 0;
moneyNumber = 5;
baddyNumber = 2;
platformNumber = 10;
ladderNumber = 2;
level1StartX = 50;
level1StartY = 353;
_root.scoreconstant = 100;
keyListener = new Object();
keyListener.onKeyDown = function () {
switch (Key.getCode()) {
case 32 :
mario.jumpStart();
return;
case 37 :
mario.move("left");
return;
case 39 :
mario.move("right");
return;
case 38 :
mario.climbingUp = 1;
return;
case 40 :
mario.climbingDown = 1;
return;
case 90 :
mario.running = 1;
mario.moveSpeed = mario.runSpeed;
}
};
keyListener.onKeyUp = function () {
switch (Key.getCode()) {
case 32 :
mario.jumpStop();
return;
case 37 :
mario.move("stop");
return;
case 39 :
mario.move("stop");
return;
case 38 :
mario.climbingUp = 0;
return;
case 40 :
mario.climbingDown = 0;
return;
case 90 :
mario.running = 0;
mario.moveSpeed = mario.walkSpeed;
}
};
Key.addListener(keyListener);
initGame();
mario = new Character("hero", "mowgli");
mario.moveTo(level1StartX, level1StartY);
Symbol 220 MovieClip Frame 38
if (ignorecode == 0) {
checkKeys();
mario.updatePhysics();
}
if (mario.onGround) {
ignorecode = 0;
letgo = 0;
onplatform = 0;
}
setpositions();
if (Key.isDown(32)) {
if (jumpReset == 0) {
if (ignorecode == 1) {
onplatform = 1;
jumping = 0;
}
if (ignorecode >= 2) {
letgo = 1;
}
jumpReset = 1;
}
} else {
jumpReset = 0;
}
if (Key.isDown(39)) {
_root.facing = 1;
hero._xscale = 100;
}
if (Key.isDown(37)) {
_root.facing = 0;
hero._xscale = -100;
}
if (hero._x <= 20) {
mario.moveTo(20, hero._y);
}
if (hero._x >= 630) {
mario.moveTo(630, hero._y);
}
if (mario.onLadder) {
O = 1;
while (O <= ladderNumber) {
if (_root.level.hero.hitTest(eval ("_root.level.ladder" + O))) {
if (mario.moveDirection == 0) {
Xmove = eval (("_root.level.ladder" + O) + "._x");
Ymove = hero._y;
mario.moveTo(Xmove, Ymove);
}
}
O++;
}
}
P = 1;
while (P <= moneyNumber) {
if (_root.level.hero.collision.hitTest(eval ("_root.level.money" + P))) {
with (eval (("money" + P) + ".copy")) {
gotoAndPlay("points");
}
with (eval ("money" + P)) {
play();
}
}
P++;
}
if (_root.level.hero.collision.hitTest(_root.level.pineapple)) {
with (pineapple.copy) {
gotoAndPlay("points");
}
with (pineapple) {
play();
}
}
if (_root.level.hero.collision.hitTest(_root.level.baddy1)) {
gotoAndPlay ("dielevel1");
with (prompt) {
gotoAndStop("tigerbite1");
}
}
if (_root.level.hero.collision.hitTest(_root.level.baddy2)) {
gotoAndPlay ("dielevel1");
with (prompt) {
gotoAndStop("snakebite1");
}
}
if (_root.time <= 0) {
gotoAndPlay ("dielevel1");
with (prompt) {
gotoAndStop("timesup");
}
}
if (!mario.onGround) {
if (mario.vVelocity >= 0) {
if (_root.level.hero.collision.hitTest(_root.level.platform1.platpos)) {
if (ignorecode == 0) {
if (onplatform == 0) {
ignorecode = 1;
onplatform = 2;
hero._rotation = 0;
hero._y = platform1._y + platform1.platpos._y;
platformX = platform1.platpos._x;
HeroX = hero._x;
}
}
} else if (_root.level.hero.collision.hitTest(_root.level.platform2.platpos)) {
if (ignorecode == 0) {
if (onplatform == 0) {
ignorecode = 1;
onplatform = 3;
hero._rotation = 0;
HeroX = hero._x;
hero._y = platform2._y + platform2.platpos._y;
platformX = platform2.platpos._x;
}
}
} else if (_root.level.hero.collision.hitTest(_root.level.platform3.platpos)) {
if (ignorecode == 0) {
if (onplatform == 0) {
ignorecode = 1;
onplatform = 4;
hero._rotation = 0;
HeroX = hero._x;
hero._y = platform3._y + platform3.platpos._y;
platformX = platform3.platpos._x;
}
}
} else if (_root.level.hero.collision.hitTest(_root.level.platform4.platpos)) {
if (ignorecode == 0) {
if (onplatform == 0) {
ignorecode = 1;
onplatform = 5;
hero._rotation = 0;
HeroX = hero._x;
hero._y = platform4._y + platform4.platpos._y;
platformX = platform4.platpos._x;
}
}
}
}
}
if (onplatform == 2) {
if (_root.level.hero.hitTest(_root.level.platform1.platpos)) {
ignorecode = 1;
onplatform = 2;
jumping = 0;
} else {
ignorecode = 0;
onplatform = 0;
}
if (Key.isDown(37)) {
mario.hSetVelocity = -mario.walkSpeed;
} else if (Key.isDown(39)) {
mario.hSetVelocity = mario.walkSpeed;
} else {
mario.hSetVelocity = 0;
}
hero._x = HeroX - (platformX - platform1.platpos._x);
HeroX = HeroX + mario.hSetVelocity;
Xmove = hero._x;
Ymove = hero._y;
mario.moveTo(Xmove, Ymove);
marioSpeed = hero._x - oldHeroX;
}
if (onplatform == 3) {
if (_root.level.hero.hitTest(_root.level.platform2.platpos)) {
ignorecode = 1;
onplatform = 3;
jumping = 0;
} else {
ignorecode = 0;
onplatform = 0;
}
if (Key.isDown(37)) {
mario.hSetVelocity = -mario.walkSpeed;
} else if (Key.isDown(39)) {
mario.hSetVelocity = mario.walkSpeed;
} else {
mario.hSetVelocity = 0;
}
hero._x = HeroX - (platformX - platform2.platpos._x);
HeroX = HeroX + mario.hSetVelocity;
Xmove = hero._x;
Ymove = hero._y;
mario.moveTo(Xmove, Ymove);
marioSpeed = hero._x - oldHeroX;
}
if (onplatform == 4) {
if (_root.level.hero.hitTest(_root.level.platform3.platpos)) {
ignorecode = 1;
onplatform = 4;
jumping = 0;
} else {
ignorecode = 0;
onplatform = 0;
}
if (Key.isDown(37)) {
mario.hSetVelocity = -mario.walkSpeed;
} else if (Key.isDown(39)) {
mario.hSetVelocity = mario.walkSpeed;
} else {
mario.hSetVelocity = 0;
}
hero._x = HeroX - (platformX - platform3.platpos._x);
HeroX = HeroX + mario.hSetVelocity;
Xmove = hero._x;
Ymove = hero._y;
mario.moveTo(Xmove, Ymove);
marioSpeed = hero._x - oldHeroX;
}
if (onplatform == 5) {
if (_root.level.hero.hitTest(_root.level.platform4.platpos)) {
ignorecode = 1;
onplatform = 5;
jumping = 0;
} else {
ignorecode = 0;
onplatform = 0;
}
if (Key.isDown(37)) {
mario.hSetVelocity = -mario.walkSpeed;
} else if (Key.isDown(39)) {
mario.hSetVelocity = mario.walkSpeed;
} else {
mario.hSetVelocity = 0;
}
hero._x = HeroX - (platformX - platform4.platpos._x);
HeroX = HeroX + mario.hSetVelocity;
Xmove = hero._x;
Ymove = hero._y;
mario.moveTo(Xmove, Ymove);
marioSpeed = hero._x - oldHeroX;
}
if (ignorecode == 1) {
if (onplatform == 1) {
mario.gravityEffect = 1;
mario.vVelocity = -mario.jumpStrength;
mario.hVelocity = marioSpeed;
mario.vAcceleration = 0;
ignorecode = 0;
onplatform = 0;
}
}
if (!mario.onGround) {
if (letgo == 0) {
if (ignorecode == 0) {
if (_root.level.hero.collision.hitTest(_root.level.vine)) {
jumping = 0;
ignorecode = 2;
vine._visible = false;
Xmove = vine._x;
Ymove = vine._y;
mario.moveTo(Xmove, Ymove);
r = vine.vinemid._rotation;
hero._rotation = -r;
with (hero) {
gotoAndPlay("swinging");
}
}
}
}
}
if (ignorecode == 2) {
vine._visible = false;
Xmove = vine._x;
Ymove = vine._y;
mario.moveTo(Xmove, Ymove);
r = vine.vinemid._rotation;
hero._rotation = -r;
if (letgo == 1) {
with (hero) {
gotoAndPlay("jump");
}
vine._visible = true;
ignorecode = 0;
hero._rotation = 0;
mario.moveTo(Xmove - (vine.vinebot._x / 2), Ymove + hero._height);
if (_root.vindir == 1) {
mario.vVelocity = mario.vineVvelocity;
mario.hVelocity = mario.vineHvelocity;
}
if (_root.vindir == -1) {
mario.vVelocity = -mario.vineVvelocity;
mario.hVelocity = -mario.vineHvelocity;
}
}
}
if (_root.level.hero.collision.hitTest(_root.level.marker)) {
letgo = 0;
swinging = 0;
}
Symbol 220 MovieClip Frame 39
gotoAndPlay ("loopStart");
oldHeroX = hero._x;
oldHeroY = hero._y;
timesecs--;
if (timesecs <= 0) {
_root.time--;
timesecs = 30;
}
Symbol 220 MovieClip Frame 42
_root.lives--;
timesecs = 30;
_root.time = 60;
Symbol 220 MovieClip Frame 97
if (_root.lives <= 0) {
_root.lives = 0;
with (prompt) {
gotoAndPlay("gameover");
}
stop();
}
Symbol 220 MovieClip Frame 134
gotoAndPlay ("level1Start");
with (prompt) {
gotoAndStop(1);
}
stopAllSounds();
Symbol 220 MovieClip Frame 136
if (_root.time > 0) {
_root.time--;
_root.score = _root.score + (50 + ((timesecs * 5) / 3));
timesecs = 0;
_root.score = _root.score - (_root.score % 1);
} else {
gotoAndPlay ("finished1");
timesecs = 30;
_root.time = 60;
}
Symbol 220 MovieClip Frame 137
gotoAndPlay ("endlevel1");
Symbol 220 MovieClip Frame 230
function initGame() {
var _local1 = _root;
_local1.objectList = new Array();
_local1.worldArray = new Array();
_local1.scrollZoneLeft = 150;
_local1.gravity = 0.1;
_local1.scrollBuffer = 288;
_local1.worldArray.push(new Array(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 17, 16, 16, 16, 1, 0, 0, 0, 17, 16, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 0, 0, 17, 16, 16, 16, 1, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 16, 17, 16, 16, 1, 0, 0, 1, 16, 17, 48, 48, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 64));
}
function queryLocation(x, y, p) {
xTile = (x - (x % 32)) / 32;
yTile = (y - (y % 32)) / 32;
switch (p) {
case "topSolid" :
b = 1;
break;
case "bottomSolid" :
b = 2;
break;
case "leftSolid" :
b = 4;
break;
case "rightSolid" :
b = 8;
break;
case "ladder" :
b = 16;
break;
case "endlevel" :
b = 32;
break;
case "die" :
b = 64;
}
if (_root.worldArray[xTile][yTile] & b) {
return(true);
}
return(false);
}
function Character(i, t) {
this.vineVvelocity = -7;
this.vineHvelocity = 9;
this.instanceName = i;
this.x = -100;
this.y = -100;
this.vAcceleration = 0;
this.hAcceleration = 0;
this.vVelocity = 0;
this.hVelocity = 0;
this.vSetVelocity = 0;
this.hSetVelocity = 0;
this.gravityEffect = 1;
this.smallJumpGravity = 4;
this.largeJumpGravity = 1;
this.jumpStrength = 6;
this.onGround = 0;
this.jumping = 0;
this.moveDirection = 0;
this.running = 0;
this.climbingUp = 0;
this.climbingDown = 0;
this.onLadder = 0;
this.climbSpeed = -4;
this.vTerminalVelocity = 20;
this.walkSpeed = 5;
this.runSpeed = 6;
this.moveSpeed = this.walkSpeed;
this.moveAcceleration = 1.2;
this.airMoveAcceleration = 0.2;
this.airControl = 0;
this.characterHeight = eval (t + "._height");
this.headZone = -1;
this.baseWidth = hero._width;
this.baseHeight = hero.collision._height;
this.jumpStart = function () {
var _local1 = this;
if (_local1.onGround) {
_local1.onGround = 0;
_local1.jumping = 1;
_local1.gravityEffect = _local1.largeJumpGravity;
_local1.vVelocity = -_local1.jumpStrength;
}
};
this.jumpStop = function () {
var _local1 = this;
if (_local1.jumping) {
_local1.onGround = 0;
_local1.jumping = 0;
_local1.gravityEffect = _local1.smallJumpGravity;
}
};
this.move = function (direction) {
var _local1 = this;
switch (direction) {
case "left" :
_local1.moveDirection = -1;
return;
case "right" :
_local1.moveDirection = 1;
return;
case "stop" :
_local1.moveDirection = 0;
}
};
this.updatePhysics = function () {
switch (this.moveDirection) {
case -1 :
this.hSetVelocity = -this.moveSpeed;
break;
case 1 :
this.hSetVelocity = this.moveSpeed;
break;
case 0 :
this.hSetVelocity = 0;
}
if (queryLocation(this.x, this.y - 1, "endlevel")) {
gotoAndPlay ("endlevel2");
}
if (queryLocation(this.x, this.y - 1, "die")) {
gotoAndPlay ("dielevel2");
with (prompt) {
gotoAndStop("careful");
}
}
if (queryLocation(this.x, this.y - 1, "ladder")) {
if ((this.climbingUp == 1) or (this.climbingDown == 1)) {
this.onLadder = 1;
this.onGround = 0;
}
} else {
this.onLadder = 0;
}
if (this.onLadder and this.climbingUp) {
this.vVelocity = this.climbSpeed;
} else if ((this.onLadder and (!this.climbingUp)) and (!this.climbingUp)) {
this.vAcceleration = 0;
this.vVelocity = 0;
}
if (this.onLadder and this.climbingDown) {
this.vVelocity = -this.climbSpeed;
} else if ((this.onLadder and (!this.climbingDown)) and (!this.climbingUp)) {
this.vAcceleration = 0;
this.vVelocity = 0;
}
this.vVelocity = this.vVelocity + this.vAcceleration;
this.hVelocity = this.hVelocity + this.hAcceleration;
if (this.hVelocity < this.hSetVelocity) {
if (this.onGround) {
this.hAcceleration = this.moveAcceleration;
} else {
this.hAcceleration = this.airMoveAcceleration;
}
} else if (this.hVelocity > this.hSetVelocity) {
if (this.onGround) {
this.hAcceleration = -this.moveAcceleration;
} else {
this.hAcceleration = -this.airMoveAcceleration;
}
} else if (this.hVelocity == this.hSetVelocity) {
this.hAcceleration = 0;
}
if ((Math.abs(this.hVelocity) < this.moveAcceleration) and this.onGround) {
this.hVelocity = 0;
}
if (this.vVelocity > this.vTerminalVelocity) {
this.vVelocity = this.vTerminalVelocity;
}
if ((!this.onGround) and (!this.onLadder)) {
this.vAcceleration = this.vAcceleration + (_root.gravity * this.gravityEffect);
}
oldX = this.x;
oldY = this.y;
this.x = this.x + this.hVelocity;
this.y = this.y + this.vVelocity;
if (this.vVelocity >= 0) {
if (queryLocation(this.x, this.y, "topSolid")) {
if (this.onLadder == 0) {
this.onGround = 1;
this.y = this.y - (this.y % 32);
this.vVelocity = 0;
this.vAcceleration = 0;
}
} else {
this.onGround = 0;
}
} else if (this.vVelocity < 0) {
if (queryLocation(this.x, this.y - this.baseHeight, "bottomSolid")) {
if (this.onLadder == 0) {
this.y = this.y + (this.y % 32);
this.vVelocity = 5;
this.vAcceleration = 0;
}
}
}
if (this.hVelocity > 0) {
if (queryLocation(this.x + (this.baseWidth / 2), this.y - 1, "leftSolid")) {
this.hVelocity = 0;
this.hAcceleration = 0;
this.x = oldX;
}
} else if (this.hVelocity < 0) {
if (queryLocation(this.x - (this.baseWidth / 2), this.y - 1, "rightSolid")) {
this.hVelocity = 0;
this.hAcceleration = 0;
this.x = oldX;
}
}
this.moveTo(this.x, this.y);
};
this.getInstanceName = function () {
return(this.instanceName);
};
this.moveTo = function (x, y) {
this.x = x;
this.y = y;
eval (this.instanceName)._x = x;
eval (this.instanceName)._y = y;
};
duplicateMovieClip (t, this.instanceName, random(255));
_root.objectList.push(this);
}
function setpositions() {
if (swinging == 0) {
if (!mario.onGround) {
if (jumping == 0) {
if (onplatform <= 1) {
with (hero) {
gotoAndPlay("jump");
}
jumping = 1;
}
if (onplatform >= 2) {
with (hero) {
gotoAndStop("run");
}
jumping = 1;
}
}
}
}
if (mario.onLadder) {
if (climbing == 0) {
with (hero) {
gotoAndStop("climbing");
climbing = 1;
}
}
}
if (mario.onGround) {
climbing = 0;
swinging = 0;
jumping = 0;
if (!mario.onLadder) {
with (hero) {
gotoAndStop("run");
}
}
}
if (!mario.onGround) {
if (ignorecode >= 2) {
if (swinging == 0) {
swinging = 1;
with (hero) {
gotoAndPlay("swinging");
}
}
}
}
}
ignorecode = 0;
letgo = 0;
vrelpower = 12;
onplatform = 0;
moneyNumber = 5;
platformNumber = 10;
ladderNumber = 5;
level2StartX = 50;
level2StartY = 330;
_root.scoreconstant = 200;
keyListener = new Object();
keyListener.onKeyDown = function () {
switch (Key.getCode()) {
case 32 :
mario.jumpStart();
return;
case 37 :
mario.move("left");
return;
case 39 :
mario.move("right");
return;
case 38 :
mario.climbingUp = 1;
return;
case 40 :
mario.climbingDown = 1;
return;
case 90 :
mario.running = 1;
mario.moveSpeed = mario.runSpeed;
}
};
keyListener.onKeyUp = function () {
switch (Key.getCode()) {
case 32 :
mario.jumpStop();
return;
case 37 :
mario.move("stop");
return;
case 39 :
mario.move("stop");
return;
case 38 :
mario.climbingUp = 0;
return;
case 40 :
mario.climbingDown = 0;
return;
case 90 :
mario.running = 0;
mario.moveSpeed = mario.walkSpeed;
}
};
Key.addListener(keyListener);
initGame();
mario = new Character("hero", "mowgli");
mario.moveTo(level2StartX, level2StartY);
stopAllSounds();
Symbol 220 MovieClip Frame 235
if (Key.isDown(32)) {
if (jumpReset == 0) {
if (ignorecode == 1) {
onplatform = 1;
jumping = 0;
}
if (ignorecode >= 2) {
letgo = 1;
}
jumpReset = 1;
}
} else {
jumpReset = 0;
}
if (Key.isDown(39)) {
_root.facing = 1;
hero._xscale = 100;
}
if (Key.isDown(37)) {
_root.facing = 0;
hero._xscale = -100;
}
if (ignorecode == 0) {
checkKeys();
mario.updatePhysics();
}
if (mario.onGround) {
ignorecode = 0;
letgo = 0;
onplatform = 0;
}
if (hero._x <= 20) {
mario.moveTo(20, hero._y);
}
if (hero._x >= 630) {
mario.moveTo(630, hero._y);
}
setpositions();
if (mario.onLadder) {
O = 1;
while (O <= ladderNumber) {
if (_root.level.hero.hitTest(eval ("_root.level.ladder" + O))) {
if (mario.moveDirection == 0) {
Xmove = eval (("_root.level.ladder" + O) + "._x");
Ymove = hero._y;
mario.moveTo(Xmove, Ymove);
}
}
O++;
}
}
P = 1;
while (P <= moneyNumber) {
if (_root.level.hero.collision.hitTest(eval ("_root.level.money" + P))) {
with (eval (("money" + P) + ".copy")) {
gotoAndPlay("points");
}
with (eval ("money" + P)) {
play();
}
}
P++;
}
if (_root.level.hero.collision.hitTest(_root.level.pineapple)) {
with (pineapple.copy) {
gotoAndPlay("points");
}
with (pineapple) {
play();
}
}
if (_root.level.hero.collision.hitTest(_root.level.pineapple2)) {
with (pineapple2.copy) {
gotoAndPlay("points");
}
with (pineapple2) {
play();
}
}
if (_root.level.hero.collision.hitTest(_root.level.baddy1)) {
gotoAndPlay ("dielevel2");
with (prompt) {
gotoAndStop("tigerbite2");
}
}
if (_root.level.hero.collision.hitTest(_root.level.baddy2)) {
gotoAndPlay ("dielevel2");
with (prompt) {
gotoAndStop("snakebite2");
}
}
if (_root.time <= 0) {
gotoAndPlay ("dielevel2");
with (prompt) {
gotoAndStop("timesup");
}
}
if (!mario.onGround) {
if (mario.vVelocity > 0) {
if (_root.level.hero.collision.hitTest(_root.level.platform1.platpos)) {
if (ignorecode == 0) {
if (onplatform == 0) {
ignorecode = 1;
onplatform = 2;
hero._rotation = 0;
hero._y = platform1._y + platform1.platpos._y;
platformX = platform1.platpos._x;
HeroX = hero._x;
}
}
} else if (_root.level.hero.collision.hitTest(_root.level.platform2.platpos)) {
if (ignorecode == 0) {
if (onplatform == 0) {
ignorecode = 1;
onplatform = 3;
hero._rotation = 0;
HeroX = hero._x;
hero._y = platform2._y + platform2.platpos._y;
platformX = platform2.platpos._x;
}
}
} else if (_root.level.hero.collision.hitTest(_root.level.platform3.platpos)) {
if (ignorecode == 0) {
if (onplatform == 0) {
ignorecode = 1;
onplatform = 4;
hero._rotation = 0;
HeroX = hero._x;
hero._y = platform3._y + platform3.platpos._y;
platformX = platform3.platpos._x;
}
}
} else if (_root.level.hero.collision.hitTest(_root.level.platform4.platpos)) {
if (ignorecode == 0) {
if (onplatform == 0) {
ignorecode = 1;
onplatform = 5;
hero._rotation = 0;
HeroX = hero._x;
hero._y = platform4._y + platform4.platpos._y;
platformX = platform4.platpos._x;
}
}
}
}
}
if (onplatform == 2) {
if (_root.level.hero.hitTest(_root.level.platform1.platpos)) {
ignorecode = 1;
onplatform = 2;
jumping = 0;
} else {
ignorecode = 0;
onplatform = 0;
}
if (Key.isDown(37)) {
mario.hSetVelocity = -mario.walkSpeed;
} else if (Key.isDown(39)) {
mario.hSetVelocity = mario.walkSpeed;
} else {
mario.hSetVelocity = 0;
}
hero._x = HeroX - (platformX - platform1.platpos._x);
HeroX = HeroX + mario.hSetVelocity;
Xmove = hero._x;
Ymove = hero._y;
mario.moveTo(Xmove, Ymove);
marioSpeed = hero._x - oldHeroX;
}
if (onplatform == 3) {
if (_root.level.hero.hitTest(_root.level.platform2.platpos)) {
ignorecode = 1;
onplatform = 3;
jumping = 0;
} else {
ignorecode = 0;
onplatform = 0;
}
if (Key.isDown(37)) {
mario.hSetVelocity = -mario.walkSpeed;
} else if (Key.isDown(39)) {
mario.hSetVelocity = mario.walkSpeed;
} else {
mario.hSetVelocity = 0;
}
hero._x = HeroX - (platformX - platform2.platpos._x);
HeroX = HeroX + mario.hSetVelocity;
Xmove = hero._x;
Ymove = hero._y;
mario.moveTo(Xmove, Ymove);
marioSpeed = hero._x - oldHeroX;
}
if (onplatform == 4) {
if (_root.level.hero.hitTest(_root.level.platform3.platpos)) {
ignorecode = 1;
onplatform = 4;
jumping = 0;
} else {
ignorecode = 0;
onplatform = 0;
}
if (Key.isDown(37)) {
mario.hSetVelocity = -mario.walkSpeed;
} else if (Key.isDown(39)) {
mario.hSetVelocity = mario.walkSpeed;
} else {
mario.hSetVelocity = 0;
}
hero._x = HeroX - (platformX - platform3.platpos._x);
HeroX = HeroX + mario.hSetVelocity;
Xmove = hero._x;
Ymove = hero._y;
mario.moveTo(Xmove, Ymove);
marioSpeed = hero._x - oldHeroX;
}
if (onplatform == 5) {
if (_root.level.hero.hitTest(_root.level.platform4.platpos)) {
ignorecode = 1;
onplatform = 5;
jumping = 0;
} else {
ignorecode = 0;
onplatform = 0;
}
if (Key.isDown(37)) {
mario.hSetVelocity = -mario.walkSpeed;
} else if (Key.isDown(39)) {
mario.hSetVelocity = mario.walkSpeed;
} else {
mario.hSetVelocity = 0;
}
hero._x = HeroX - (platformX - platform4.platpos._x);
HeroX = HeroX + mario.hSetVelocity;
Xmove = hero._x;
Ymove = hero._y;
mario.moveTo(Xmove, Ymove);
marioSpeed = hero._x - oldHeroX;
}
if (ignorecode == 1) {
if (onplatform == 1) {
mario.gravityEffect = 1;
mario.vVelocity = -mario.jumpStrength;
mario.hVelocity = marioSpeed;
mario.vAcceleration = 0;
ignorecode = 0;
onplatform = 0;
}
}
if (!mario.onGround) {
if (letgo == 0) {
if (ignorecode == 0) {
if (_root.level.hero.collision.hitTest(_root.level.vine)) {
ignorecode = 2;
vine._visible = false;
Xmove = vine._x;
Ymove = vine._y;
mario.moveTo(Xmove, Ymove);
r = vine.vinemid._rotation;
hero._rotation = -r;
with (hero) {
gotoAndPlay("swinging");
}
}
}
if (ignorecode == 0) {
if (_root.level.hero.collision.hitTest(_root.level.vine2)) {
ignorecode = 3;
vine2._visible = false;
Xmove = vine2._x;
Ymove = vine2._y;
mario.moveTo(Xmove, Ymove);
r = vine2.vinemid._rotation;
hero._rotation = r;
with (hero) {
gotoAndPlay("swinging");
}
}
}
if (ignorecode == 0) {
if (_root.level.hero.collision.hitTest(_root.level.vine3)) {
ignorecode = 4;
vine3._visible = false;
Xmove = vine3._x;
Ymove = vine3._y;
mario.moveTo(Xmove, Ymove);
r = vine3.vinemid._rotation;
hero._rotation = -r;
with (hero) {
gotoAndPlay("swinging");
}
}
}
}
}
if (ignorecode == 2) {
vine._visible = false;
Xmove = vine._x;
Ymove = vine._y;
mario.moveTo(Xmove, Ymove);
r = vine.vinemid._rotation;
hero._rotation = -r;
if (letgo == 1) {
with (hero) {
gotoAndPlay("jump");
}
vine._visible = true;
ignorecode = 0;
hero._rotation = 0;
mario.moveTo(Xmove - (vine.vinebot._x / 2), Ymove + hero._height);
if (_root.vindir == 1) {
mario.vVelocity = mario.vineVvelocity;
mario.hVelocity = mario.vineHvelocity;
}
if (_root.vindir == -1) {
mario.vVelocity = mario.vineVvelocity;
mario.hVelocity = -mario.vineHvelocity;
}
}
}
if (ignorecode == 3) {
vine2._visible = false;
Xmove = vine2._x;
Ymove = vine2._y;
mario.moveTo(Xmove, Ymove);
r = vine2.vinemid._rotation;
hero._rotation = r;
if (letgo == 1) {
with (hero) {
gotoAndPlay("jump");
}
vine2._visible = true;
ignorecode = 0;
hero._rotation = 0;
mario.moveTo(Xmove + (vine2.vinebot._x / 2), Ymove + hero._height);
if (_root.vindir2 == -1) {
mario.vVelocity = mario.vineVvelocity;
mario.hVelocity = mario.vineHvelocity;
}
if (_root.vindir2 == 1) {
mario.vVelocity = mario.vineVvelocity;
mario.hVelocity = -mario.vineHvelocity;
}
}
}
if (ignorecode == 4) {
vine3._visible = false;
Xmove = vine3._x;
Ymove = vine3._y;
mario.moveTo(Xmove, Ymove);
r = vine3.vinemid._rotation;
hero._rotation = -r;
if (letgo == 1) {
with (hero) {
gotoAndPlay("jump");
}
vine3._visible = true;
ignorecode = 0;
hero._rotation = 0;
mario.moveTo(Xmove - (vine3.vinebot._x / 2), Ymove + hero._height);
if (_root.vindir3 == 1) {
mario.vVelocity = mario.vineVvelocity;
mario.hVelocity = mario.vineHvelocity;
}
if (_root.vindir3 == -1) {
mario.vVelocity = mario.vineVvelocity;
mario.hVelocity = -mario.vineHvelocity;
}
}
}
if (_root.level.hero.collision.hitTest(_root.level.marker)) {
letgo = 0;
swinging = 0;
}
if (_root.level.hero.collision.hitTest(_root.level.marker2)) {
letgo = 0;
swinging = 0;
}
if (_root.level.hero.collision.hitTest(_root.level.marker3)) {
letgo = 0;
swinging = 0;
}
Symbol 220 MovieClip Frame 236
gotoAndPlay ("loopStart2");
oldHeroX = hero._x;
oldHeroY = hero._y;
timesecs--;
if (timesecs <= 0) {
_root.time--;
timesecs = 30;
}
Symbol 220 MovieClip Frame 239
_root.lives--;
timesecs = 30;
_root.time = 60;
Symbol 220 MovieClip Frame 291
if (_root.lives <= 0) {
_root.lives = 0;
with (prompt) {
gotoAndPlay("gameover");
}
stop();
}
Symbol 220 MovieClip Frame 327
gotoAndPlay ("level2Start");
with (prompt) {
gotoAndStop(1);
}
Symbol 220 MovieClip Frame 331
if (_root.time > 0) {
_root.time--;
_root.score = _root.score + (100 + ((timesecs * 100) / 3));
timesecs = 0;
_root.score = _root.score - (_root.score % 1);
} else {
gotoAndPlay ("finished2");
timesecs = 30;
_root.time = 60;
}
Symbol 220 MovieClip Frame 332
gotoAndPlay ("endlevel2");
Symbol 220 MovieClip Frame 447
function initGame() {
var _local1 = _root;
_local1.objectList = new Array();
_local1.worldArray = new Array();
_local1.scrollZoneLeft = 150;
_local1.gravity = 0.1;
_local1.scrollBuffer = 288;
_local1.worldArray.push(new Array(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 64));
_local1.worldArray.push(new Array(16, 16, 16, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 2, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 2, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 2, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 2, 1, 0, 0, 1, 0, 0, 0, 32, 1, 0, 0, 0, 64));
_local1.worldArray.push(new Array(0, 0, 2, 1, 0, 0, 1, 0, 0, 0, 32, 1, 0, 0, 0, 64));
}
function queryLocation(x, y, p) {
xTile = (x - (x % 32)) / 32;
yTile = (y - (y % 32)) / 32;
switch (p) {
case "topSolid" :
b = 1;
break;
case "bottomSolid" :
b = 2;
break;
case "leftSolid" :
b = 4;
break;
case "rightSolid" :
b = 8;
break;
case "ladder" :
b = 16;
break;
case "endlevel" :
b = 32;
break;
case "die" :
b = 64;
}
if (_root.worldArray[xTile][yTile] & b) {
return(true);
}
return(false);
}
function Character(i, t) {
this.vineVvelocity = -6;
this.vineHvelocity = 7;
this.instanceName = i;
this.x = -100;
this.y = -100;
this.vAcceleration = 0;
this.hAcceleration = 0;
this.vVelocity = 0;
this.hVelocity = 0;
this.vSetVelocity = 0;
this.hSetVelocity = 0;
this.gravityEffect = 1;
this.smallJumpGravity = 4;
this.largeJumpGravity = 1;
this.jumpStrength = 8;
this.onGround = 0;
this.jumping = 0;
this.moveDirection = 0;
this.running = 0;
this.climbingUp = 0;
this.climbingDown = 0;
this.onLadder = 0;
this.climbSpeed = -4;
this.vTerminalVelocity = 20;
this.walkSpeed = 5;
this.runSpeed = 6;
this.moveSpeed = this.walkSpeed;
this.moveAcceleration = 1.2;
this.airMoveAcceleration = 0.2;
this.airControl = 0;
this.characterHeight = eval (t + "._height");
this.headZone = -1;
this.baseWidth = hero._width;
this.baseHeight = hero.collision._height;
this.jumpStart = function () {
var _local1 = this;
if (_local1.onGround) {
_local1.onGround = 0;
_local1.jumping = 1;
_local1.gravityEffect = _local1.largeJumpGravity;
_local1.vVelocity = -_local1.jumpStrength;
}
};
this.jumpStop = function () {
var _local1 = this;
if (_local1.jumping) {
_local1.onGround = 0;
_local1.jumping = 0;
_local1.gravityEffect = _local1.smallJumpGravity;
}
};
this.move = function (direction) {
var _local1 = this;
switch (direction) {
case "left" :
_local1.moveDirection = -1;
return;
case "right" :
_local1.moveDirection = 1;
return;
case "stop" :
_local1.moveDirection = 0;
}
};
this.updatePhysics = function () {
switch (this.moveDirection) {
case -1 :
this.hSetVelocity = -this.moveSpeed;
break;
case 1 :
this.hSetVelocity = this.moveSpeed;
break;
case 0 :
this.hSetVelocity = 0;
}
if (queryLocation(this.x, this.y - 1, "endlevel")) {
gotoAndPlay ("endlevel3");
with (prompt) {
gotoAndPlay("welldone");
}
}
if (queryLocation(this.x, this.y - 1, "die")) {
gotoAndPlay ("dielevel3");
with (prompt) {
gotoAndStop("careful");
}
}
if (queryLocation(this.x, this.y - 1, "ladder")) {
if ((this.climbingUp == 1) or (this.climbingDown == 1)) {
this.onLadder = 1;
this.onGround = 0;
}
} else {
this.onLadder = 0;
}
if (this.onLadder and this.climbingUp) {
this.vVelocity = this.climbSpeed;
} else if ((this.onLadder and (!this.climbingUp)) and (!this.climbingUp)) {
this.vAcceleration = 0;
this.vVelocity = 0;
}
if (this.onLadder and this.climbingDown) {
this.vVelocity = -this.climbSpeed;
} else if ((this.onLadder and (!this.climbingDown)) and (!this.climbingUp)) {
this.vAcceleration = 0;
this.vVelocity = 0;
}
this.vVelocity = this.vVelocity + this.vAcceleration;
this.hVelocity = this.hVelocity + this.hAcceleration;
if (this.hVelocity < this.hSetVelocity) {
if (this.onGround) {
this.hAcceleration = this.moveAcceleration;
} else {
this.hAcceleration = this.airMoveAcceleration;
}
} else if (this.hVelocity > this.hSetVelocity) {
if (this.onGround) {
this.hAcceleration = -this.moveAcceleration;
} else {
this.hAcceleration = -this.airMoveAcceleration;
}
} else if (this.hVelocity == this.hSetVelocity) {
this.hAcceleration = 0;
}
if ((Math.abs(this.hVelocity) < this.moveAcceleration) and this.onGround) {
this.hVelocity = 0;
}
if (this.vVelocity > this.vTerminalVelocity) {
this.vVelocity = this.vTerminalVelocity;
}
if ((!this.onGround) and (!this.onLadder)) {
this.vAcceleration = this.vAcceleration + (_root.gravity * this.gravityEffect);
}
oldX = this.x;
oldY = this.y;
this.x = this.x + this.hVelocity;
this.y = this.y + this.vVelocity;
if (this.vVelocity >= 0) {
if (queryLocation(this.x, this.y, "topSolid")) {
if (this.onLadder == 0) {
this.onGround = 1;
this.y = this.y - (this.y % 32);
this.vVelocity = 0;
this.vAcceleration = 0;
}
} else {
this.onGround = 0;
}
} else if (this.vVelocity < 0) {
if (queryLocation(this.x, this.y - this.baseHeight, "bottomSolid")) {
if (this.onLadder == 0) {
this.y = this.y + (this.y % 32);
this.vVelocity = 5;
this.vAcceleration = 0;
}
}
}
if (this.hVelocity > 0) {
if (queryLocation(this.x + (this.baseWidth / 2), this.y - 1, "leftSolid")) {
this.hVelocity = 0;
this.hAcceleration = 0;
this.x = oldX;
}
} else if (this.hVelocity < 0) {
if (queryLocation(this.x - (this.baseWidth / 2), this.y - 1, "rightSolid")) {
this.hVelocity = 0;
this.hAcceleration = 0;
this.x = oldX;
}
}
this.moveTo(this.x, this.y);
};
this.getInstanceName = function () {
return(this.instanceName);
};
this.moveTo = function (x, y) {
this.x = x;
this.y = y;
eval (this.instanceName)._x = x;
eval (this.instanceName)._y = y;
};
duplicateMovieClip (t, this.instanceName, random(255));
_root.objectList.push(this);
}
function setpositions() {
if (swinging == 0) {
if (!mario.onGround) {
if (jumping == 0) {
if (onplatform <= 1) {
with (hero) {
gotoAndPlay("jump");
}
jumping = 1;
}
if (onplatform >= 2) {
with (hero) {
gotoAndStop("run");
}
jumping = 1;
}
}
}
}
if (mario.onLadder) {
if (climbing == 0) {
with (hero) {
gotoAndStop("climbing");
climbing = 1;
}
}
}
if (mario.onGround) {
climbing = 0;
swinging = 0;
jumping = 0;
if (!mario.onLadder) {
with (hero) {
gotoAndStop("run");
}
}
}
if (!mario.onGround) {
if (ignorecode >= 2) {
if (swinging == 0) {
swinging = 1;
with (hero) {
gotoAndPlay("swinging");
}
}
}
}
}
ignorecode = 0;
letgo = 0;
vrelpower = 12;
onplatform = 0;
moneyNumber = 5;
platformNumber = 10;
ladderNumber = 5;
level3StartX = 50;
level3StartY = 100;
secsrocks = 0;
timerocks = 0;
_root.scoreconstant = 300;
keyListener = new Object();
keyListener.onKeyDown = function () {
switch (Key.getCode()) {
case 32 :
mario.jumpStart();
return;
case 37 :
mario.move("left");
return;
case 39 :
mario.move("right");
return;
case 38 :
mario.climbingUp = 1;
return;
case 40 :
mario.climbingDown = 1;
return;
case 90 :
mario.running = 1;
mario.moveSpeed = mario.runSpeed;
}
};
keyListener.onKeyUp = function () {
switch (Key.getCode()) {
case 32 :
mario.jumpStop();
return;
case 37 :
mario.move("stop");
return;
case 39 :
mario.move("stop");
return;
case 38 :
mario.climbingUp = 0;
return;
case 40 :
mario.climbingDown = 0;
return;
case 90 :
mario.running = 0;
mario.moveSpeed = mario.walkSpeed;
}
};
Key.addListener(keyListener);
initGame();
mario = new Character("hero", "mowgli");
mario.moveTo(level3StartX, level3StartY);
stopAllSounds();
Symbol 220 MovieClip Frame 452
if (Key.isDown(32)) {
if (jumpReset == 0) {
if (ignorecode == 1) {
onplatform = 1;
jumping = 0;
}
if (ignorecode >= 2) {
letgo = 1;
}
jumpReset = 1;
}
} else {
jumpReset = 0;
}
if (Key.isDown(39)) {
_root.facing = 1;
hero._xscale = 100;
}
if (Key.isDown(37)) {
_root.facing = 0;
hero._xscale = -100;
}
if (ignorecode == 0) {
checkKeys();
mario.updatePhysics();
}
if (mario.onGround) {
ignorecode = 0;
letgo = 0;
onplatform = 0;
}
if (hero._x <= 20) {
mario.moveTo(20, hero._y);
}
if (hero._x >= 630) {
mario.moveTo(630, hero._y);
}
setpositions();
if (mario.onLadder) {
O = 1;
while (O <= ladderNumber) {
if (_root.level.hero.hitTest(eval ("_root.level.ladder" + O))) {
if (mario.moveDirection == 0) {
Xmove = eval (("_root.level.ladder" + O) + "._x");
Ymove = hero._y;
mario.moveTo(Xmove, Ymove);
}
}
O++;
}
}
P = 1;
while (P <= moneyNumber) {
if (_root.level.hero.collision.hitTest(eval ("_root.level.money" + P))) {
with (eval (("money" + P) + ".copy")) {
gotoAndPlay("points");
}
with (eval ("money" + P)) {
play();
}
}
P++;
}
if (_root.level.hero.collision.hitTest(_root.level.pineapple)) {
with (pineapple.copy) {
gotoAndPlay("points");
}
with (pineapple) {
play();
}
}
if (_root.level.hero.collision.hitTest(_root.level.pineapple2)) {
with (pineapple2.copy) {
gotoAndPlay("points");
}
with (pineapple2) {
play();
}
}
if (_root.level.hero.collision.hitTest(_root.level.baddy1)) {
gotoAndPlay ("dielevel3");
with (prompt) {
gotoAndStop("tigerbite3");
}
}
if (_root.level.hero.collision.hitTest(_root.level.baddy2)) {
gotoAndPlay ("dielevel3");
with (prompt) {
gotoAndStop("snakebite3");
}
}
if (_root.time <= 0) {
gotoAndPlay ("dielevel3");
with (prompt) {
gotoAndStop("timesup");
}
}
if (!mario.onGround) {
if (mario.vVelocity >= 0) {
if (_root.level.hero.collision.hitTest(_root.level.platform1.platpos)) {
if (ignorecode == 0) {
if (onplatform == 0) {
ignorecode = 1;
onplatform = 2;
hero._rotation = 0;
hero._y = platform1._y + platform1.platpos._y;
platformX = platform1.platpos._x;
HeroX = hero._x;
}
}
} else if (_root.level.hero.collision.hitTest(_root.level.platform2.platpos)) {
if (ignorecode == 0) {
if (onplatform == 0) {
ignorecode = 1;
onplatform = 3;
hero._rotation = 0;
HeroX = hero._x;
hero._y = platform2._y + platform2.platpos._y;
platformX = platform2.platpos._x;
}
}
} else if (_root.level.hero.collision.hitTest(_root.level.platform3.platpos)) {
if (ignorecode == 0) {
if (onplatform == 0) {
ignorecode = 1;
onplatform = 4;
hero._rotation = 0;
HeroX = hero._x;
hero._y = platform3._y + platform3.platpos._y;
platformX = platform3.platpos._x;
}
}
} else if (_root.level.hero.collision.hitTest(_root.level.platform4.platpos)) {
if (ignorecode == 0) {
if (onplatform == 0) {
ignorecode = 1;
onplatform = 5;
hero._rotation = 0;
HeroX = hero._x;
hero._y = platform4._y + platform4.platpos._y;
platformX = platform4.platpos._x;
}
}
} else if (_root.level.hero.collision.hitTest(_root.level.platform5.platpos)) {
if (ignorecode == 0) {
if (onplatform == 0) {
ignorecode = 1;
onplatform = 6;
hero._rotation = 0;
HeroX = hero._x;
hero._y = platform5._y + platform5.platpos._y;
platformX = platform5.platpos._x;
}
}
} else if (_root.level.hero.collision.hitTest(_root.level.platform6.platpos)) {
if (ignorecode == 0) {
if (onplatform == 0) {
ignorecode = 1;
onplatform = 7;
hero._rotation = 0;
HeroX = hero._x;
hero._y = platform6._y + platform6.platpos._y;
platformX = platform6.platpos._x;
}
}
}
}
}
if (onplatform == 2) {
if (_root.level.hero.hitTest(_root.level.platform1.platpos)) {
ignorecode = 1;
onplatform = 2;
jumping = 0;
} else {
ignorecode = 0;
onplatform = 0;
}
if (Key.isDown(37)) {
mario.hSetVelocity = -mario.walkSpeed;
} else if (Key.isDown(39)) {
mario.hSetVelocity = mario.walkSpeed;
} else {
mario.hSetVelocity = 0;
}
hero._x = HeroX - (platformX - platform1.platpos._x);
HeroX = HeroX + mario.hSetVelocity;
Xmove = hero._x;
Ymove = hero._y;
mario.moveTo(Xmove, Ymove);
marioSpeed = hero._x - oldHeroX;
}
if (onplatform == 3) {
if (_root.level.hero.hitTest(_root.level.platform2.platpos)) {
ignorecode = 1;
onplatform = 3;
jumping = 0;
} else {
ignorecode = 0;
onplatform = 0;
}
if (Key.isDown(37)) {
mario.hSetVelocity = -mario.walkSpeed;
} else if (Key.isDown(39)) {
mario.hSetVelocity = mario.walkSpeed;
} else {
mario.hSetVelocity = 0;
}
hero._x = HeroX - (platformX - platform2.platpos._x);
HeroX = HeroX + mario.hSetVelocity;
Xmove = hero._x;
Ymove = hero._y;
mario.moveTo(Xmove, Ymove);
marioSpeed = hero._x - oldHeroX;
}
if (onplatform == 4) {
if (_root.level.hero.hitTest(_root.level.platform3.platpos)) {
ignorecode = 1;
onplatform = 4;
jumping = 0;
} else {
ignorecode = 0;
onplatform = 0;
}
if (Key.isDown(37)) {
mario.hSetVelocity = -mario.walkSpeed;
} else if (Key.isDown(39)) {
mario.hSetVelocity = mario.walkSpeed;
} else {
mario.hSetVelocity = 0;
}
hero._x = HeroX - (platformX - platform3.platpos._x);
HeroX = HeroX + mario.hSetVelocity;
Xmove = hero._x;
Ymove = hero._y;
mario.moveTo(Xmove, Ymove);
marioSpeed = hero._x - oldHeroX;
}
if (onplatform == 5) {
if (_root.level.hero.hitTest(_root.level.platform4.platpos)) {
ignorecode = 1;
onplatform = 5;
jumping = 0;
} else {
ignorecode = 0;
onplatform = 0;
}
if (Key.isDown(37)) {
mario.hSetVelocity = -mario.walkSpeed;
} else if (Key.isDown(39)) {
mario.hSetVelocity = mario.walkSpeed;
} else {
mario.hSetVelocity = 0;
}
hero._x = HeroX - (platformX - platform4.platpos._x);
HeroX = HeroX + mario.hSetVelocity;
Xmove = hero._x;
Ymove = hero._y;
mario.moveTo(Xmove, Ymove);
marioSpeed = hero._x - oldHeroX;
}
if (onplatform == 6) {
if (_root.level.hero.hitTest(_root.level.platform5.platpos)) {
ignorecode = 1;
onplatform = 6;
jumping = 0;
} else {
ignorecode = 0;
onplatform = 0;
}
if (Key.isDown(37)) {
mario.hSetVelocity = -mario.walkSpeed;
} else if (Key.isDown(39)) {
mario.hSetVelocity = mario.walkSpeed;
} else {
mario.hSetVelocity = 0;
}
hero._x = HeroX - (platformX - platform5.platpos._x);
HeroX = HeroX + mario.hSetVelocity;
Xmove = hero._x;
Ymove = hero._y;
mario.moveTo(Xmove, Ymove);
marioSpeed = hero._x - oldHeroX;
}
if (onplatform == 7) {
if (_root.level.hero.hitTest(_root.level.platform6.platpos)) {
ignorecode = 1;
onplatform = 7;
jumping = 0;
} else {
ignorecode = 0;
onplatform = 0;
}
if (Key.isDown(37)) {
mario.hSetVelocity = -mario.walkSpeed;
} else if (Key.isDown(39)) {
mario.hSetVelocity = mario.walkSpeed;
} else {
mario.hSetVelocity = 0;
}
hero._x = HeroX - (platformX - platform6.platpos._x);
HeroX = HeroX + mario.hSetVelocity;
Xmove = hero._x;
Ymove = hero._y;
mario.moveTo(Xmove, Ymove);
marioSpeed = hero._x - oldHeroX;
}
if (ignorecode == 1) {
if (onplatform == 1) {
mario.gravityEffect = 1;
mario.vVelocity = -mario.jumpStrength;
mario.hVelocity = marioSpeed;
mario.vAcceleration = 0;
ignorecode = 0;
onplatform = 0;
}
}
if (!mario.onGround) {
if (letgo == 0) {
if (ignorecode == 0) {
if (_root.level.hero.collision.hitTest(_root.level.vine)) {
ignorecode = 2;
vine._visible = false;
Xmove = vine._x;
Ymove = vine._y;
mario.moveTo(Xmove, Ymove);
r = vine.vinemid._rotation;
hero._rotation = -r;
with (hero) {
gotoAndPlay("swinging");
}
}
}
}
}
if (ignorecode == 2) {
vine._visible = false;
Xmove = vine._x;
Ymove = vine._y;
mario.moveTo(Xmove, Ymove);
r = vine.vinemid._rotation;
hero._rotation = -r;
if (letgo == 1) {
with (hero) {
gotoAndPlay("jump");
}
vine._visible = true;
ignorecode = 0;
hero._rotation = 0;
mario.moveTo(Xmove - (vine.vinebot._x / 2), Ymove + hero._height);
if (_root.vindir == 1) {
mario.vVelocity = mario.vineVvelocity;
mario.hVelocity = mario.vineHvelocity;
}
if (_root.vindir == -1) {
mario.vVelocity = mario.vineVvelocity;
mario.hVelocity = -mario.vineHvelocity;
}
}
}
if (_root.level.hero.collision.hitTest(_root.level.marker1)) {
letgo = 0;
swinging = 0;
}
Symbol 220 MovieClip Frame 453
gotoAndPlay ("loopStart3");
oldHeroX = hero._x;
oldHeroY = hero._y;
timesecs--;
if (timesecs <= 0) {
_root.time--;
timesecs = 30;
}
secsrocks++;
if (secsrocks >= 2) {
secsrocks = 0;
timerocks++;
}
if (timerocks == 70) {
with (platform6) {
play();
}
}
if (timerocks == 10) {
with (platform6) {
play();
}
}
if (timerocks == 90) {
with (platform3) {
play();
}
}
if (timerocks == 30) {
with (platform3) {
play();
}
}
if (timerocks == 55) {
with (platform4) {
play();
}
}
if (timerocks == 110) {
with (platform4) {
play();
}
}
if (timerocks == 20) {
with (platform5) {
play();
}
}
if (timerocks == 40) {
with (platform2) {
play();
}
}
if (timerocks >= 120) {
timerocks = 0;
}
Symbol 220 MovieClip Frame 457
_root.lives--;
timesecs = 30;
_root.time = 60;
Symbol 220 MovieClip Frame 525
if (_root.lives <= 0) {
_root.lives = 0;
with (prompt) {
gotoAndPlay("gameover");
}
stop();
}
Symbol 220 MovieClip Frame 553
gotoAndPlay ("level3Start");
with (prompt) {
gotoAndStop(1);
}
Symbol 220 MovieClip Frame 555
if (_root.time > 0) {
_root.time--;
_root.score = _root.score + (150 + ((timesecs * 15) / 3));
timesecs = 0;
_root.score = _root.score - (_root.score % 1);
} else {
gotoAndPlay ("finished3");
timesecs = 30;
_root.time = 60;
}
Symbol 220 MovieClip Frame 556
gotoAndPlay ("endlevel3");
Symbol 220 MovieClip Frame 568
if (_root.lives > 0) {
_root.score = _root.score + 500;
_root.lives--;
}
Symbol 220 MovieClip Frame 577
if (_root.lives > 0) {
_root.score = _root.score + 1000;
_root.lives--;
}
Symbol 220 MovieClip Frame 586
if (_root.lives > 0) {
_root.score = _root.score + 2000;
_root.lives--;
}
Symbol 220 MovieClip Frame 598
if (_root.lives > 0) {
_root.score = _root.score + 4000;
_root.lives--;
}
Symbol 220 MovieClip Frame 611
if (_root.lives > 0) {
_root.score = _root.score + 8000;
_root.lives--;
}
Symbol 220 MovieClip Frame 626
if (_root.lives > 0) {
_root.score = _root.score + 16000;
_root.lives--;
}
Symbol 220 MovieClip Frame 629
stop();
with (_root) {
gotoAndPlay("end");
}
Symbol 227 MovieClip Frame 15
stop();