Frame 1
function MainMenu() {
_root.varHighScore = _root.HighScore;
_root.varTime = _root.CurrentTimer;
_root.varCurrentScore = _root.CurrentScore;
m_VarTime._visible = true;
_root.MarioLife1._visible = true;
_root.MarioLife2._visible = true;
_root.MarioLife3._visible = true;
}
function GetXPosition(level, x) {
if (level == 1) {
if (x <= 73) {
return(73);
}
if (x > 433) {
return(433);
}
} else if (level == 2) {
if (x <= 14) {
return(14);
}
if (x > 401) {
return(401);
}
} else if (level == 3) {
if (x <= 47) {
return(47);
}
if (x > 433) {
return(433);
}
} else if (level == 4) {
if (x <= 14) {
return(14);
}
if (x > 401) {
return(401);
}
} else if (level == 5) {
if (x <= 47) {
return(47);
}
if (x > 433) {
return(433);
}
} else if (level == 6) {
if (x <= 160) {
return(160);
}
if (x > 401) {
return(401);
}
}
return(x);
}
function GetYPosition(level, x) {
if (level == 1) {
if (x <= 224) {
return(581);
}
if ((x > 224) && (x <= 255)) {
return(578);
}
if ((x > 255) && (x <= 288)) {
return(576);
}
if ((x > 288) && (x <= 319)) {
return(573);
}
if ((x > 319) && (x <= 351)) {
return(571);
}
if ((x > 351) && (x <= 383)) {
return(569);
}
if ((x > 383) && (x <= 415)) {
return(567);
}
if (x > 415) {
return(564);
}
} else if (level == 2) {
if (x <= 33) {
return(488);
}
if ((x > 33) && (x <= 65)) {
return(490);
}
if ((x > 65) && (x <= 97)) {
return(492);
}
if ((x > 97) && (x <= 129)) {
return(495);
}
if ((x > 129) && (x <= 160)) {
return(498);
}
if ((x > 160) && (x <= 192)) {
return(499);
}
if ((x > 192) && (x <= 224)) {
return(502);
}
if ((x > 224) && (x <= 255)) {
return(504);
}
if ((x > 255) && (x <= 288)) {
return(506);
}
if ((x > 288) && (x <= 319)) {
return(508);
}
if ((x > 319) && (x <= 351)) {
return(511);
}
if ((x > 351) && (x <= 383)) {
return(513);
}
if (x > 383) {
return(515);
}
} else if (level == 3) {
if (x <= 65) {
return(439);
}
if ((x > 65) && (x <= 97)) {
return(436);
}
if ((x > 97) && (x <= 129)) {
return(434);
}
if ((x > 129) && (x <= 160)) {
return(432);
}
if ((x > 160) && (x <= 192)) {
return(429);
}
if ((x > 192) && (x <= 224)) {
return(427);
}
if ((x > 224) && (x <= 255)) {
return(425);
}
if ((x > 255) && (x <= 288)) {
return(422);
}
if ((x > 288) && (x <= 319)) {
return(420);
}
if ((x > 319) && (x <= 351)) {
return(418);
}
if ((x > 351) && (x <= 383)) {
return(415);
}
if ((x > 383) && (x <= 415)) {
return(412);
}
if (x > 415) {
return(411);
}
} else if (level == 4) {
if (x <= 33) {
return(334);
}
if ((x > 33) && (x <= 65)) {
return(336);
}
if ((x > 65) && (x <= 97)) {
return(339);
}
if ((x > 97) && (x <= 129)) {
return(341);
}
if ((x > 129) && (x <= 160)) {
return(343);
}
if ((x > 160) && (x <= 192)) {
return(346);
}
if ((x > 192) && (x <= 224)) {
return(348);
}
if ((x > 224) && (x <= 255)) {
return(350);
}
if ((x > 255) && (x <= 288)) {
return(353);
}
if ((x > 288) && (x <= 319)) {
return(355);
}
if ((x > 319) && (x <= 351)) {
return(357);
}
if ((x > 351) && (x <= 383)) {
return(360);
}
if (x > 383) {
return(362);
}
} else if (level == 5) {
if (x <= 65) {
return(285);
}
if ((x > 65) && (x <= 97)) {
return(283);
}
if ((x > 97) && (x <= 129)) {
return(281);
}
if ((x > 129) && (x <= 160)) {
return(278);
}
if ((x > 160) && (x <= 192)) {
return(276);
}
if ((x > 192) && (x <= 224)) {
return(274);
}
if ((x > 224) && (x <= 255)) {
return(271);
}
if ((x > 255) && (x <= 288)) {
return(269);
}
if ((x > 288) && (x <= 319)) {
return(267);
}
if ((x > 319) && (x <= 351)) {
return(264);
}
if ((x > 351) && (x <= 383)) {
return(262);
}
if ((x > 383) && (x <= 415)) {
return(260);
}
if (x > 415) {
return(257);
}
} else if (level == 6) {
if (x <= 288) {
return(199);
}
if ((x > 288) && (x <= 319)) {
return(202);
}
if ((x > 319) && (x <= 351)) {
return(204);
}
if ((x > 351) && (x <= 383)) {
return(206);
}
if (x > 383) {
return(208);
}
} else if (level == 7) {
return(199);
}
}
HighScore = 7500;
CurrentScore = 0;
CurrentTimer = 4500;
MarioLives = 3;
IntroSound = new Sound();
IntroSound.attachSound("IntroSound_WAV");
IntroSoundPlaying = false;
StartSound = new Sound();
StartSound.attachSound("StartSound_WAV");
StartSoundPlaying = false;
GameBGSound = new Sound();
GameBGSound.attachSound("GameBGSound_WAV");
GameBGSoundPlaying = false;
_root.GameBGSound.onSoundComplete = function () {
_root.GameBGSound.start();
};
JumpSound = new Sound();
JumpSound.attachSound("JumpSound_WAV");
JumpSoundPlaying = false;
DeathSound = new Sound();
DeathSound.attachSound("DeathSound_WAV");
_root.DeathSound.onSoundComplete = function () {
_root.DeathSoundPlaying = false;
};
MainMenu.prototype = new MovieClip();
Object.registerClass("MainMenu", MainMenu);
attachMovie("MainMenu", "MainMenu0", 0);
function Princess() {
this.CurrentDelay = 0;
this.Action = 0;
this._x = 195;
this._y = 110;
}
Princess.prototype = new MovieClip();
Object.registerClass("Princess", Princess);
Princess.prototype.Destroy = function () {
this.removeMovieClip();
};
Princess.prototype.onEnterFrame = function () {
if (this.Action == 0) {
this.CurrentDelay = this.CurrentDelay + 1;
if (this.CurrentDelay > 50) {
this.CurrentDelay = 0;
_root.attachMovie("Help", "Help", 40);
}
}
};
function Help() {
this._x = 241;
this._y = 95;
}
Help.prototype = new MovieClip();
Object.registerClass("Help", Help);
Help.prototype.Destroy = function () {
this.removeMovieClip();
};
Help.prototype.onEnterFrame = function () {
this._alpha = this._alpha - 10;
if (this._alpha < 1) {
this.Destroy();
}
};
function IntroKong() {
this.CurrentFrame = 1;
this.DelayRate = 1;
this._x = 256;
this._y = 528;
this.gotoAndStop(this.CurrentFrame);
}
IntroKong.prototype = new MovieClip();
Object.registerClass("IntroKong", IntroKong);
IntroKong.prototype.Destroy = function () {
this.removeMovieClip();
};
IntroKong.prototype.onEnterFrame = function () {
this._y = this._y - 5;
this.CurrentDelay = this.CurrentDelay + 1;
if (this.CurrentDelay > this.DelayRate) {
this.CurrentDelay = 0;
this.CurrentFrame = this.CurrentFrame + 1;
}
if (this.CurrentFrame > 2) {
this.CurrentFrame = 1;
}
this.gotoAndStop(this.CurrentFrame);
};
function Kong() {
this.Action = 0;
this.CurrentFrame = 1;
this.DelayRate = 8;
this.CurrentDelay = 0;
this.AddBarrel = true;
this._x = 86;
this._y = 165;
this.BarrelNumber = 100;
this.DestroyBarrelStart = 100;
this.DestroyBarrelEnd = 100;
this.gotoAndStop(CurrentFrame);
}
Kong.prototype = new MovieClip();
Object.registerClass("Kong", Kong);
Kong.prototype.Destroy = function () {
if (_root.DeathSoundPlaying == true) {
_root.DeathSound.stop();
_root.DeathSoundPlaying = false;
}
this.removeMovieClip();
};
Kong.prototype.DestroyBarrels = function () {
var BarrelName;
var i;
i = this.DestroyBarrelStart;
while (i < this.DestroyBarrelEnd) {
BarrelName = "_root.NewBarrel" + i;
setProperty(BarrelName, _visible , false);
i = i + 1;
}
};
Kong.prototype.onEnterFrame = function () {
var BarrelName;
if (this.Action == 0) {
this.UpdateFrame();
this.gotoAndStop(this.CurrentFrame);
if ((this.CurrentFrame == 4) && (this.AddBarrel)) {
this.AddBarrel = false;
BarrelName = "NewBarrel" + this.BarrelNumber;
this.DestroyBarrelEnd = this.DestroyBarrelEnd + this.BarrelNumber;
_root.attachMovie("Barrel", BarrelName, this.BarrelNumber);
this.BarrelNumber = this.BarrelNumber + 1;
} else if (this.CurrentFrame != 4) {
this.AddBarrel = true;
}
} else if (this.Action == 1) {
this._y = this._y + 20;
this.gotoAndStop(1);
this._rotation = this._rotation + 50;
if (this._y > 565) {
Level10.Destroy();
}
} else {
this.gotoAndStop(5);
}
};
Kong.prototype.UpdateFrame = function () {
var Pause;
if (this.CurrentFrame == 6) {
this.CurrentDelay = this.CurrentDelay + 1;
if (this.CurrentDelay > this.DelayRate) {
this.CurrentDelay = 0;
this.CurrentFrame = 1;
}
} else if (this.CurrentFrame == 1) {
this.CurrentDelay = this.CurrentDelay + 1;
if (this.CurrentDelay > 10) {
this.CurrentDelay = 0;
this.CurrentFrame = this.CurrentFrame + 1;
}
} else {
this.CurrentDelay = this.CurrentDelay + 1;
if (this.CurrentDelay > this.DelayRate) {
this.CurrentDelay = 0;
this.CurrentFrame = this.CurrentFrame + 1;
}
if (this.CurrentFrame > 4) {
Pause = Math.random();
if (Pause > 0.5) {
this.CurrentFrame = 6;
} else {
this.CurrentFrame = 1;
}
}
}
};
function JumpPoints() {
this._x = Level1Mario._x;
this._y = Level1Mario._y;
}
JumpPoints.prototype = new MovieClip();
Object.registerClass("JumpPoints", JumpPoints);
JumpPoints.prototype.Destroy = function () {
this.removeMovieClip();
};
JumpPoints.prototype.onEnterFrame = function () {
this._alpha = this._alpha - 10;
if (this._alpha < 1) {
this.Destroy();
}
};
function Mario() {
this.CurrentFrame = 1;
this.Action = 0;
this.Direction = 0;
this.AcceptInput = true;
this.DelayRate = 0;
this.CurrentDelay = 0;
this.Height = 18;
this.Climbing = false;
this.XPosition = 1;
this.Level = 1;
this._x = 102;
this._y = 564;
this.xSpeed = 8;
this.ySpeed = 4;
this.Dead = false;
this.DeathSpinCount = 0;
this.Jumping = false;
this.JumpRaise = 0;
this.JumpMaxHeight = 30;
this.JumpDirection = 1;
this.JumpSpeedx = 0;
if (_root.MarioLives == 3) {
_root.MarioLife3._visible = false;
} else if (_root.MarioLives == 2) {
_root.MarioLife2._visible = false;
} else if (_root.MarioLives == 1) {
_root.MarioLife1._visible = false;
}
}
Mario.prototype = new MovieClip();
Object.registerClass("Mario", Mario);
Mario.prototype.Destroy = function () {
this.removeMovieClip();
};
Mario.prototype.onEnterFrame = function () {
var x = 0;
var y = 0;
if (this.Action == -11) {
if (this.DeathSpinCount < 3) {
this.UpdateFrame();
} else {
this.CurrentFrame = 19;
this.CurrentDelay = this.CurrentDelay + 1;
if (this.CurrentDelay > 20) {
Level1Kong.DestroyBarrels();
MarioLives = MarioLives - 1;
Level10.Destroy();
}
}
} else if (this.Action == -10) {
this.CurrentFrame = 3;
} else {
if (this.AcceptInput) {
if (Key.isDown(32)) {
if (this.Climbing == false) {
_root.JumpSound.start();
this.Jumping = true;
this.AcceptInput = false;
this.JumpDirection = 1;
if (Key.isDown(37)) {
this.JumpSpeedx = -4;
} else if (Key.isDown(39)) {
this.JumpSpeedx = 4;
} else {
this.JumpSpeedx = 0;
}
if (this.Direction == 0) {
this.Action = 2;
} else {
this.Action = 3;
}
}
} else if (Key.isDown(40)) {
y = y + this.ySpeed;
this.Action = 4;
} else if (Key.isDown(38)) {
y = y - this.ySpeed;
this.Action = 4;
} else if (Key.isDown(37)) {
x = x - this.xSpeed;
this.Action = 1;
this.Direction = 1;
} else if (Key.isDown(39)) {
x = x + this.xSpeed;
this.Action = 0;
this.Direction = 0;
} else if (this.Direction == 0) {
this.Action = -1;
} else {
this.Action = -2;
}
}
this.CheckPosition(x, y);
this.UpdateFrame();
}
this.gotoAndStop(this.CurrentFrame);
};
Mario.prototype.CheckPosition = function (x, y) {
this.IncreaseX = x;
this.IncreaseY = y;
this.NewX = 0;
this.NewY = 0;
if (this.Climbing == true) {
this.DoClimbingTest();
} else if (this.Action == 4) {
this.CheckIfLaderExists();
} else if ((this.Action == 2) || (this.Action == 3)) {
this.NewX = this._x + this.JumpSpeedx;
this.NewX = GetXPosition(this.Level, this.NewX);
if (this.JumpDirection == 1) {
this.JumpRaise = this.JumpRaise - 6;
if (this.JumpRaise < (-this.JumpMaxHeight)) {
this.JumpDirection = 0;
}
} else {
this.JumpRaise = this.JumpRaise + 6;
}
this.IncreaseY = GetYPosition(this.Level, this.NewX);
this.NewY = this.IncreaseY;
this.IncreaseY = this.IncreaseY - (this.Height - this.JumpRaise);
if ((this.NewY - this.Height) > this.IncreaseY) {
this.NewY = this.NewY - (this.Height - this.JumpRaise);
} else {
this.NewY = this.NewY - this.Height;
this.Jumping = false;
this.AcceptInput = true;
}
} else {
this.DoWalkingTest();
}
this._x = this.NewX;
this._y = this.NewY;
};
Mario.prototype.DoClimbingTest = function () {
if (this.IncreaseY != 0) {
this.CurrentDelay = this.CurrentDelay + 1;
if (this.CurrentDelay > this.DelayRate) {
this.CurrentDelay = 0;
this.CurrentFrame = this.CurrentFrame + 1;
}
if (this.CurrentFrame > 14) {
this.CurrentFrame = 13;
}
}
if ((this.Action != 4) || (this.Action != 5)) {
this.Action = 4;
}
if (this.Level == 1) {
this.Level1Laders();
} else if (this.Level == 2) {
this.Level2Laders();
} else if (this.Level == 3) {
this.Level3Laders();
} else if (this.Level == 4) {
this.Level4Laders();
} else if (this.Level == 5) {
this.Level5Laders();
} else if (this.Level == 6) {
this.Level6Laders();
}
};
Mario.prototype.Level1Laders = function () {
if (this._x == 375) {
this.NewX = 375;
if (this._y < 496) {
this.Level = 2;
this.Climbing = false;
this.NewY = 496;
} else if (this._y > 553) {
this.Level = 1;
this.Climbing = false;
this.NewY = 552;
} else {
this.NewY = this._y + this.IncreaseY;
}
} else if (this._x == 169) {
this.NewX = 169;
if (this._y < 552) {
this.NewY = 552;
} else if (this._y > 565) {
this.Level = 1;
this.Climbing = false;
this.NewY = 564;
} else {
this.NewY = this._y + this.IncreaseY;
}
}
};
Mario.prototype.Level2Laders = function () {
if (this._x == 200) {
this.NewX = 200;
if (this._y < 411) {
this.Level = 3;
this.Climbing = false;
this.NewY = 410;
} else if (this._y > 486) {
this.Level = 2;
this.Climbing = false;
this.NewY = 485;
} else {
this.NewY = this._y + this.IncreaseY;
}
} else if (this._x == 73) {
this.NewX = 73;
if (this._y < 421) {
this.Level = 3;
this.Climbing = false;
this.NewY = 420;
} else if (this._y > 476) {
this.Level = 2;
this.Climbing = false;
this.NewY = 475;
} else {
this.NewY = this._y + this.IncreaseY;
}
}
};
Mario.prototype.Level3Laders = function () {
if (this._x == 137) {
this.NewX = 137;
if (this._y < 399) {
this.NewY = 400;
} else if (this._y > 416) {
this.Level = 3;
this.Climbing = false;
this.NewY = 415;
} else {
this.NewY = this._y + this.IncreaseY;
}
} else if (this._x == 234) {
this.NewX = 234;
if (this._y < 333) {
this.Level = 4;
this.Climbing = false;
this.NewY = 332;
} else if (this._y > 409) {
this.Level = 3;
this.Climbing = false;
this.NewY = 408;
} else {
this.NewY = this._y + this.IncreaseY;
}
} else if (this._x == 376) {
this.NewX = 376;
if (this._y < 344) {
this.Level = 4;
this.Climbing = false;
this.NewY = 343;
} else if (this._y > 399) {
this.Level = 3;
this.Climbing = false;
this.NewY = 398;
} else {
this.NewY = this._y + this.IncreaseY;
}
}
};
Mario.prototype.Level4Laders = function () {
if (this._x == 344) {
this.NewX = 344;
if (this._y < 324) {
this.NewY = 325;
} else if (Level1Mario._y > 341) {
this.Level = 4;
this.Climbing = false;
this.NewY = 340;
} else {
this.NewY = this._y + this.IncreaseY;
}
} else if (this._x == 153) {
this.NewX = 153;
if (this._y < 261) {
this.Level = 5;
this.Climbing = false;
this.NewY = 260;
} else if (this._y > 327) {
this.Level = 4;
this.Climbing = false;
this.NewY = 326;
} else {
this.NewY = this._y + this.IncreaseY;
}
} else if (this._x == 75) {
this.NewX = 75;
if (this._y < 267) {
this.Level = 5;
this.Climbing = false;
this.NewY = 266;
} else if (this._y > 323) {
this.Level = 4;
this.Climbing = false;
this.NewY = 322;
} else {
this.NewY = this._y + this.IncreaseY;
}
}
};
Mario.prototype.Level5Laders = function () {
if (this._x == 186) {
this.NewX = 186;
if (this._y < 245) {
this.NewY = 246;
} else if (this._y > 260) {
this.Level = 5;
this.Climbing = false;
this.NewY = 259;
} else {
this.NewY = this._y + this.IncreaseY;
}
} else if (this._x == 376) {
this.NewX = 376;
if (this._y < 190) {
this.Level = 6;
this.Climbing = false;
this.NewY = 189;
} else if (this._y > 246) {
this.Level = 5;
this.Climbing = false;
this.NewY = 245;
} else {
this.NewY = this._y + this.IncreaseY;
}
}
};
Mario.prototype.Level6Laders = function () {
if (this._x == 265) {
this.NewX = 265;
if (this._y < 118) {
this.Level = 7;
this.Climbing = false;
this.NewY = 117;
this.Action = -10;
this.AcceptInput = false;
Level1Kong.Action = 1;
Level1Kong.DestroyBarrels();
Level1Princess.Action = 1;
_root.CurrentScore = _root.CurrentScore + _root.CurrentTimer;
_root.GameBGSound.stop();
_root.GameBGSoundPlaying = false;
_root.DeathSound.start();
_root.DeathSoundPlaying = true;
} else if (this._y > 183) {
this.Level = 6;
this.Climbing = false;
this.NewY = 182;
} else {
this.NewY = this._y + this.IncreaseY;
}
}
};
Mario.prototype.DoWalkingTest = function () {
this.NewX = this._x + this.IncreaseX;
this.NewX = GetXPosition(this.Level, this.NewX);
this.NewY = GetYPosition(this.Level, this.NewX);
this.NewY = this.NewY - this.Height;
};
Mario.prototype.CheckIfLaderExists = function () {
if (this.Level == 1) {
this.Level1LaderExists();
} else if (this.Level == 2) {
this.Level2LaderExists();
} else if (this.Level == 3) {
this.Level3LaderExists();
} else if (this.Level == 4) {
this.Level4LaderExists();
} else if (this.Level == 5) {
this.Level5LaderExists();
} else if (this.Level == 6) {
this.Level6LaderExists();
}
};
Mario.prototype.Level1LaderExists = function () {
if ((this._x > 369) && (this._x < 381)) {
this.CurrentFrame = 13;
this.Climbing = true;
this.NewX = 375;
this.NewY = this._y + this.IncreaseY;
} else if ((this._x > 163) && (this._x < 172)) {
this.CurrentFrame = 13;
this.Climbing = true;
this.NewX = 169;
this.NewY = this._y + this.IncreaseY;
} else {
this.NewX = this._x;
this.NewY = this._y;
}
};
Mario.prototype.Level2LaderExists = function () {
if ((this._x > 196) && (this._x < 205)) {
this.CurrentFrame = 13;
this.Climbing = true;
this.NewX = 200;
this.NewY = this._y + this.IncreaseY;
} else if ((this._x > 69) && (this._x < 79)) {
this.CurrentFrame = 13;
this.Climbing = true;
this.NewX = 73;
this.NewY = this._y + this.IncreaseY;
} else if (((this._x > 369) && (this._x < 381)) && (this.IncreaseY > 0)) {
this.CurrentFrame = 13;
this.Climbing = true;
this.NewX = 375;
this.NewY = this._y + this.IncreaseY;
this.Level = 1;
} else {
this.NewX = this._x;
this.NewY = this._y;
}
};
Mario.prototype.Level3LaderExists = function () {
if ((this._x > 132) && (this._x < 142)) {
this.CurrentFrame = 13;
this.Climbing = true;
this.NewX = 137;
this.NewY = this._y + Ithis.ncreaseY;
} else if ((this._x > 228) && (this._x < 238)) {
this.CurrentFrame = 13;
this.Climbing = true;
this.NewX = 234;
this.NewY = this._y + Ithis.ncreaseY;
} else if ((this._x > 371) && (this._x < 381)) {
this.CurrentFrame = 13;
this.Climbing = true;
this.NewX = 376;
this.NewY = this._y + this.IncreaseY;
} else if (((this._x > 196) && (this._x < 205)) && (this.IncreaseY > 0)) {
this.CurrentFrame = 13;
this.Climbing = true;
this.NewX = 200;
this.NewY = this._y + this.IncreaseY;
this.Level = 2;
} else if (((this._x > 69) && (this._x < 79)) && (this.IncreaseY > 0)) {
this.CurrentFrame = 13;
this.Climbing = true;
this.NewX = 73;
this.NewY = this._y + this.IncreaseY;
this.Level = 2;
} else {
this.NewX = this._x;
this.NewY = this._y;
}
};
Mario.prototype.Level4LaderExists = function () {
if ((this._x > 338) && (this._x < 348)) {
this.CurrentFrame = 13;
this.Climbing = true;
this.NewX = 344;
this.NewY = this._y + this.IncreaseY;
} else if ((this._x > 148) && (this._x < 158)) {
this.CurrentFrame = 13;
this.Climbing = true;
this.NewX = 153;
this.NewY = Level1Mario._y + this.IncreaseY;
} else if ((this._x > 68) && (this._x < 78)) {
this.CurrentFrame = 13;
this.Climbing = true;
this.NewX = 75;
this.NewY = this._y + this.IncreaseY;
} else if (((this._x > 228) && (this._x < 237)) && (this.IncreaseY > 0)) {
this.CurrentFrame = 13;
this.Climbing = true;
this.NewX = 234;
this.NewY = this._y + this.IncreaseY;
this.Level = 3;
} else if (((this._x > 371) && (this._x < 380)) && (this.IncreaseY > 0)) {
this.CurrentFrame = 13;
this.Climbing = true;
this.NewX = 376;
this.NewY = this._y + this.IncreaseY;
this.Level = 3;
} else {
this.NewX = this._x;
this.NewY = this._y;
}
};
Mario.prototype.Level5LaderExists = function () {
if ((this._x > 179) && (this._x < 189)) {
this.CurrentFrame = 13;
this.Climbing = true;
this.NewX = 186;
this.NewY = this._y + this.IncreaseY;
} else if ((this._x > 370) && (this._x < 380)) {
this.CurrentFrame = 13;
this.Climbing = true;
this.NewX = 376;
this.NewY = Level1Mario._y + this.IncreaseY;
} else if (((this._x > 148) && (this._x < 158)) && (this.IncreaseY > 0)) {
this.CurrentFrame = 13;
this.Climbing = true;
this.NewX = 153;
this.NewY = this._y + this.IncreaseY;
this.Level = 4;
} else if (((this._x > 68) && (this._x < 78)) && (this.IncreaseY > 0)) {
this.CurrentFrame = 13;
this.Climbing = true;
this.NewX = 75;
this.NewY = this._y + this.IncreaseY;
this.Level = 4;
} else {
this.NewX = this._x;
this.NewY = this._y;
}
};
Mario.prototype.Level6LaderExists = function () {
if ((this._x > 259) && (this._x < 269)) {
this.CurrentFrame = 13;
this.Climbing = true;
this.NewX = 265;
this.NewY = this._y + this.IncreaseY;
} else if (((this._x > 370) && (this._x < 380)) && (this.IncreaseY > 0)) {
this.CurrentFrame = 13;
this.Climbing = true;
this.NewX = 376;
this.NewY = this._y + this.IncreaseY;
this.Level = 5;
} else {
this.NewX = this._x;
this.NewY = this._y;
}
};
Mario.prototype.UpdateFrame = function () {
switch (this.Action) {
case -11 :
if ((this.CurrentFrame < 15) || (this.CurrentFrame > 19)) {
this.CurrentFrame = 15;
this.DelayRate = 1;
} else {
this.CurrentDelay = this.CurrentDelay + 1;
if (this.CurrentDelay > this.DelayRate) {
this.CurrentDelay = 0;
this.CurrentFrame = this.CurrentFrame + 1;
}
if (this.CurrentFrame > 18) {
this.DeathSpinCount = this.DeathSpinCount + 1;
this.CurrentFrame = 15;
}
}
return;
case -2 :
this.CurrentFrame = 3;
return;
case -1 :
this.CurrentFrame = 1;
return;
case 0 :
if ((this.CurrentFrame < 1) || (this.CurrentFrame > 2)) {
this.CurrentFrame = 1;
this.DelayRate = 1;
} else {
this.CurrentDelay = this.CurrentDelay + 1;
if (this.CurrentDelay > this.DelayRate) {
this.CurrentDelay = 0;
this.CurrentFrame = this.CurrentFrame + 1;
}
if (this.CurrentFrame > 2) {
this.CurrentFrame = 1;
}
}
return;
case 1 :
if ((this.CurrentFrame > 4) || (this.CurrentFrame < 3)) {
this.CurrentFrame = 3;
this.DelayRate = 1;
} else {
this.CurrentDelay = this.CurrentDelay + 1;
if (this.CurrentDelay > this.DelayRate) {
this.CurrentDelay = 0;
this.CurrentFrame = this.CurrentFrame + 1;
}
if (this.CurrentFrame > 4) {
this.CurrentFrame = 3;
}
}
return;
case 2 :
this.CurrentFrame = 5;
return;
case 3 :
this.CurrentFrame = 6;
}
};
function Barrel() {
this.gotoAndStop(3);
this._x = 140;
this._y = 188;
this.Level = 6;
this.Speedx = 8;
this.Speedy = 4;
this.Action = 0;
this.OverLadder = false;
this.CurrentDelay = 0;
this.DelayRate = 1;
this.CurrentFrame = 3;
this.CheckedLadder = false;
this.XDirection = 1;
this.Height = 12;
this.JumpedMe = false;
this.PointNumber = 50;
}
Barrel.prototype = new MovieClip();
Object.registerClass("Barrel", Barrel);
Barrel.prototype.Destroy = function () {
Level1Kong.DestroyBarrelStart = Level1Kong.DestroyBarrelStart + 1;
this.removeMovieClip();
};
Barrel.prototype.onEnterFrame = function () {
if (this._visible == false) {
this.Destroy();
}
if (Level1Mario.Dead == false) {
if (this.Action == 0) {
this.CheckOverLadder();
if (this.Action == 1) {
this.OverLadder = false;
} else {
this.OverLadder = false;
this.CheckDestroyBarrel();
this.UpdateFrame();
this._x = this._x + (this.Speedx * this.XDirection);
this._y = GetYPosition(this.Level, this._x);
this._y = this._y - this.Height;
}
} else if (this.Action == 1) {
this.GoDownLadder();
this.UpdateFrame();
}
this.CheckForMarioCollision();
this.CheckForMarioJumpingOverBarrel();
}
this.gotoAndStop(this.CurrentFrame);
};
Barrel.prototype.CheckForMarioCollision = function () {
var dis;
var x;
var y;
x = this._x - Level1Mario._x;
y = this._y - Level1Mario._y;
dis = (x * x) + (y * y);
dis = Math.sqrt(dis);
if (dis < 25) {
_root.GameBGSound.stop();
_root.GameBGSoundPlaying = false;
_root.DeathSound.start();
Level1Mario.Dead = true;
Level1Mario.Action = -11;
Level1Kong.Action = 2;
}
};
Barrel.prototype.CheckForMarioJumpingOverBarrel = function () {
var dis;
var x;
var y;
var PointName;
if (((this.Level == Level1Mario.Level) && (this.JumpedMe == false)) && (Level1Mario.Jumping == true)) {
x = this._x - Level1Mario._x;
x = Math.abs(x);
if ((x < 10) && (Level1Mario._y < this._y)) {
this.JumpedMe = true;
PointName = "NewPoints" + this.PointNumber;
_root.attachMovie("JumpPoints", PointName, this.PointNumber);
this.PointNumber = this.PointNumber + 1;
_root.CurrentScore = _root.CurrentScore + 100;
if (this.PointNumber > 59) {
this.PointNumber = 50;
}
}
}
};
Barrel.prototype.CheckOverLadder = function () {
var DownLadderorNot;
var LadderPercent;
if (this.Level == 6) {
if ((this._x > 179) && (this._x < 189)) {
LadderPercent = 0.8;
this.OverLadder = true;
this.NewX = 186;
} else if ((this._x > 370) && (this._x < 380)) {
LadderPercent = 0;
this.OverLadder = true;
this.NewX = 376;
}
} else if (this.Level == 5) {
if ((this._x > 338) && (this._x < 348)) {
LadderPercent = 0.9;
this.OverLadder = true;
this.NewX = 344;
} else if ((this._x > 148) && (this._x < 158)) {
LadderPercent = 0.5;
this.OverLadder = true;
this.NewX = 153;
} else if ((this._x > 68) && (this._x < 78)) {
LadderPercent = 0;
this.OverLadder = true;
this.NewX = 75;
}
} else if (this.Level == 4) {
if ((this._x > 132) && (this._x < 142)) {
LadderPercent = 0.9;
this.OverLadder = true;
this.NewX = 137;
} else if ((this._x > 228) && (this._x < 237)) {
LadderPercent = 0.6;
this.OverLadder = true;
this.NewX = 234;
} else if ((this._x > 371) && (this._x < 380)) {
LadderPercent = 0;
this.OverLadder = true;
this.NewX = 376;
}
} else if (this.Level == 3) {
if ((this._x > 196) && (this._x < 205)) {
LadderPercent = 0.6;
this.OverLadder = true;
this.NewX = 200;
} else if ((this._x > 69) && (this._x < 79)) {
LadderPercent = 0;
this.OverLadder = true;
this.NewX = 73;
}
} else if (this.Level == 2) {
if ((this._x > 163) && (this._x < 172)) {
LadderPercent = 0.8;
this.OverLadder = true;
this.NewX = 169;
} else if ((this._x > 369) && (this._x < 381)) {
LadderPercent = 0;
this.OverLadder = true;
this.NewX = 375;
}
}
if (this.OverLadder) {
DownLadderorNot = Math.random();
if ((this.CheckedLadder == false) && (DownLadderorNot > LadderPercent)) {
this.gotoAndStop(1);
this.Action = 1;
this._x = this.NewX;
} else {
this.CheckedLadder = true;
}
} else {
this.CheckedLadder = false;
}
};
Barrel.prototype.GoDownLadder = function () {
var EndDownLadder = false;
switch (this.Level) {
case 6 :
switch (this._x) {
case 186 :
this._y = this._y + this.Speedy;
if ((this._y + this.Height) > 276) {
EndDownLadder = true;
this.NewY = 276;
}
break;
case 376 :
this._y = this._y + this.Speedy;
if ((this._y + this.Height) <= 262) {
break;
}
EndDownLadder = true;
this.NewY = 262;
}
break;
case 5 :
switch (this._x) {
case 344 :
this._y = this._y + this.Speedy;
if ((this._y + this.Height) > 357) {
EndDownLadder = true;
this.NewY = 357;
}
break;
case 153 :
this._y = this._y + this.Speedy;
if ((this._y + this.Height) > 343) {
EndDownLadder = true;
this.NewY = 343;
}
break;
case 75 :
this._y = this._y + this.Speedy;
if ((this._y + this.Height) <= 339) {
break;
}
EndDownLadder = true;
this.NewY = 339;
}
break;
case 4 :
switch (this._x) {
case 137 :
this._y = this._y + this.Speedy;
if ((this._y + this.Height) > 432) {
EndDownLadder = true;
this.NewY = 432;
}
break;
case 234 :
this._y = this._y + this.Speedy;
if ((this._y + this.Height) > 425) {
EndDownLadder = true;
this.NewY = 425;
}
break;
case 376 :
this._y = this._y + this.Speedy;
if ((this._y + this.Height) <= 415) {
break;
}
EndDownLadder = true;
this.NewY = 415;
}
break;
case 3 :
switch (this._x) {
case 200 :
this._y = this._y + this.Speedy;
if ((this._y + this.Height) > 502) {
EndDownLadder = true;
this.NewY = 502;
}
break;
case 73 :
this._y = this._y + this.Speedy;
if ((this._y + this.Height) <= 492) {
break;
}
EndDownLadder = true;
this.NewY = 492;
}
break;
case 2 :
switch (this._x) {
case 375 :
this._y = this._y + this.Speedy;
if ((this._y + this.Height) > 569) {
EndDownLadder = true;
this.NewY = 569;
}
break;
case 169 :
this._y = this._y + this.Speedy;
if ((this._y + this.Height) <= 581) {
break;
}
EndDownLadder = true;
this.NewY = 581;
}
}
this.NewY = this.NewY - this.Height;
if (EndDownLadder == true) {
this.Action = 0;
this.gotoAndStop(3);
this._y = this.NewY;
this.Level = this.Level - 1;
this.XDirection = this.XDirection * -1;
}
};
Barrel.prototype.CheckDestroyBarrel = function () {
if (this.Level == 1) {
if (this._x < 12) {
this.Destroy();
}
}
};
Barrel.prototype.UpdateFrame = function () {
switch (this.Action) {
case 0 :
this.CurrentDelay = this.CurrentDelay + 1;
if (this.CurrentDelay > this.DelayRate) {
this.CurrentDelay = 0;
this.CurrentFrame = this.CurrentFrame + 1;
}
if (this.CurrentFrame > 6) {
this.CurrentFrame = 3;
}
return;
case 1 :
this.CurrentDelay = this.CurrentDelay + 1;
if (this.CurrentDelay > this.DelayRate) {
this.CurrentDelay = 0;
this.CurrentFrame = this.CurrentFrame + 1;
}
if (this.CurrentFrame <= 2) {
break;
}
this.CurrentFrame = 1;
}
};
function Level1() {
this.Setup = true;
this.stop();
this._x = 0;
this._y = 40.9;
_root.attachMovie("Kong", "Level1Kong", 10);
_root.attachMovie("Mario", "Level1Mario", 20);
_root.attachMovie("Princess", "Level1Princess", 30);
_root.GameBGSound.start();
_root.GameBGSoundPlaying = true;
this.TimerDecreaseDelay = 0;
this.TimerBlink = 0;
}
Level1.prototype = new MovieClip();
Object.registerClass("Level1", Level1);
Level1.prototype.Destroy = function () {
Level1Kong.Destroy();
Level1Mario.Destroy();
Level1Princess.Destroy();
if (MarioLives == 0) {
if (_root.CurrentScore > _root.HighScore) {
_root.HighScore = _root.CurrentScore;
}
_root.attachMovie("MainMenu", "MainMenu0", 0);
} else {
_root.attachMovie("StartScreen", "StartScreen0", 1);
}
if (_root.GameBGSoundPlaying == true) {
_root.GameBGSound.stop();
}
this.removeMovieClip();
};
Level1.prototype.onEnterFrame = function () {
_root.varCurrentScore = _root.CurrentScore;
if (Level1Mario.Dead == false) {
this.TimerDecreaseDelay = this.TimerDecreaseDelay + 1;
if (this.TimerDecreaseDelay > 20) {
_root.CurrentTimer = _root.CurrentTimer - 100;
_root.varTime = _root.CurrentTimer;
this.TimerDecreaseDelay = 0;
}
if (_root.CurrentTimer <= 1000) {
this.TimerBlink = this.TimerBlink + 1;
if (this.TimerBlink > 5) {
this.TimerBlink = 0;
if (m_VarTime._visible == true) {
m_VarTime._visible = false;
} else {
m_VarTime._visible = true;
}
}
}
if (_root.CurrentTimer <= 0) {
_root.GameBGSound.stop();
_root.GameBGSoundPlaying = false;
_root.DeathSound.start();
Level1Mario.Dead = true;
Level1Mario.Action = -11;
Level1Kong.Action = 2;
}
}
};
function StartScreen() {
this.DelayCount = 0;
_root.StartSound.start();
_root.CurrentTimer = 4500;
_root.varTime = _root.CurrentTimer;
_root.varCurrentScore = _root.CurrentScore;
m_VarTime._visible = true;
}
StartScreen.prototype = new MovieClip();
Object.registerClass("StartScreen", StartScreen);
StartScreen.prototype.Destroy = function () {
this.removeMovieClip();
};
StartScreen.prototype.onEnterFrame = function () {
this.DelayCount = this.DelayCount + 1;
if (this.DelayCount > 35) {
_root.attachMovie("Level1", "Level10", 1);
this.Destroy();
}
};
function IntroScreen() {
this.Done = false;
_root.attachMovie("IntroKong", "IntroKong0", 10);
_root.IntroSound.start();
_root.CurrentScore = 0;
_root.varCurrentScore = _root.CurrentScore;
_root.varTime = _root.CurrentTimer;
_root.MarioLives = 3;
}
IntroScreen.prototype = new MovieClip();
Object.registerClass("IntroScreen", IntroScreen);
IntroScreen.prototype.Destroy = function () {
this.removeMovieClip();
};
IntroScreen.prototype.onEnterFrame = function () {
if (IntroKong0._y < 168) {
IntroKong0.removeMovieClip();
_root.attachMovie("StartScreen", "StartScreen0", 1);
this.Destroy();
}
};
MainMenu.prototype.Destroy = function () {
_root.attachMovie("IntroScreen", "IntroScreen0", 1);
this.removeMovieClip();
};
MainMenu.prototype.onEnterFrame = function () {
if (Key.isDown(32)) {
this.Destroy();
}
};
Symbol 44 MovieClip [Mario] Frame 1
function SetFrame() {
switch (MarioAction) {
case -2 :
MarioCurrentFrame = 3;
return;
case -1 :
MarioCurrentFrame = 1;
return;
case 0 :
if ((MarioCurrentFrame < 1) || (MarioCurrentFrame > 2)) {
MarioCurrentFrame = 1;
DelayRate = 1;
} else {
CurrentDelay = CurrentDelay + 1;
if (CurrentDelay > DelayRate) {
CurrentDelay = 0;
MarioCurrentFrame = MarioCurrentFrame + 1;
}
if (MarioCurrentFrame > 2) {
MarioCurrentFrame = 1;
}
}
return;
case 1 :
if ((MarioCurrentFrame > 4) || (MarioCurrentFrame < 3)) {
MarioCurrentFrame = 3;
DelayRate = 1;
} else {
CurrentDelay = CurrentDelay + 1;
if (CurrentDelay > DelayRate) {
CurrentDelay = 0;
MarioCurrentFrame = MarioCurrentFrame + 1;
}
if (MarioCurrentFrame > 4) {
MarioCurrentFrame = 3;
}
}
return;
case 2 :
MarioCurrentFrame = 5;
return;
case 3 :
MarioCurrentFrame = 6;
}
}
stop();
Symbol 49 MovieClip [Princess] Frame 1
stop();
Symbol 75 Button
on (release) {
_root.MainMenu0.Destroy();
}