Frame 2
gotoAndPlay (1021);
Frame 37
function CSprite(SpriteMovieClip, ShurikenMovieClip, KeyUp, KeyDown, KeyLeft, KeyRight, KeyShuriken, KeySabre, LivesValue, PowerByLife) {
var CptArray;
this.NumOfLives = LivesValue;
this.MaxOfPower = PowerByLife;
this.NumOfPower = this.MaxOfPower;
this.XStep = 5;
this.YStep = 5;
this.SwimValue = 0;
this.ArrayCounter = 0;
this.JumpArray = new Array(20, 16, 8, 0, -8, -16, -20);
this.WallJumpArray = new Array(0, 15, 15, 15, 15, 15, 15, 15, 15);
this.StepArray = new Array(G_STEP_WHEN_JUMPING, G_STEP_WHEN_JUMPING, G_STEP_WHEN_JUMPING, G_STEP_WHEN_JUMPING, G_STEP_WHEN_JUMPING, G_STEP_WHEN_JUMPING, G_STEP_WHEN_JUMPING);
this.ShurikensArray = new Array();
this.NumOfShurikens = 5;
this.ShurikensSpeed = this.XStep * 3;
CptArray = 0;
while (CptArray < G_MAX_NUM_SHURIKENS) {
duplicateMovieClip (ShurikenMovieClip, "Shuriken" + (CptArray + 1), CptArray + 1);
this.ShurikensArray.push(eval ("Shuriken" + (CptArray + 1)));
this.ShurikensArray[CptArray]._visible = 0;
this.ShurikensArray[CptArray].XDirection = 0;
CptArray++;
}
this.HitPlatforms = 0;
this.HitWater = 0;
this.HitPlatformNum = 0;
this.HitWallNum = 0;
this.ThrowShuriken = 0;
this.SabreHit = 0;
this.Direction = G_RIGHT_DIRECTION;
this.Movement = 4;
this.BlinkValue = 0;
this.TouchByEnemyValue = 0;
this.PrevIsJumpingUp = 0;
this.IsJumpingUp = 0;
this.PrevIsJumpingDown = 0;
this.IsJumpingDown = 0;
this.PrevLeftMove = 0;
this.NextLeftMove = 0;
this.PrevRightMove = 0;
this.NextRightMove = 0;
this.UpKey = KeyUp;
this.DownKey = KeyDown;
this.LeftKey = KeyLeft;
this.RightKey = KeyRight;
this.ShurikenKey = KeyShuriken;
this.SabreKey = KeySabre;
this.SabreKeyRelease = 1;
this.Clip = SpriteMovieClip;
this.ClipRightStep = 1;
this.ClipLeftStep = 10;
this.ClipRightBreak = 20;
this.ClipLeftBreak = 30;
this.ClipRightStepJump = 40;
this.ClipRightJump = 50;
this.ClipLeftStepJump = 60;
this.ClipLeftJump = 70;
this.ClipFall = 80;
this.ClipRightStepFall = 90;
this.ClipLeftStepFall = 100;
this.ClipRightSwim = 110;
this.ClipLeftSwim = 120;
this.ClipUpRightSwim = 130;
this.ClipUpLeftSwim = 140;
this.ClipDownRightSwim = 150;
this.ClipDownLeftSwim = 160;
this.ClipRightSwimBreak = 170;
this.ClipLeftSwimBreak = 180;
this.ClipWallToRightJump = 190;
this.ClipWallToLeftJump = 200;
this.ClipWallToRightBreak = 210;
this.ClipWallToLeftBreak = 220;
this.ClipRightThrowShurikenBreak = 230;
this.ClipLeftThrowShurikenBreak = 240;
this.ClipRightSabreBreak = 250;
this.ClipLeftSabreBreak = 260;
}
var G_SCREEN_WIDTH = 400;
var G_SCREEN_HEIGHT = 600;
var G_ALT_KEY = 18;
var G_ENEMY_SCORE_VALUE = 150;
var G_BOSS_SCORE_VALUE = (G_ENEMY_SCORE_VALUE * 20);
var G_BOSS_BLINK_VALUE = 10;
var G_LEFT_DIRECTION = 0;
var G_RIGHT_DIRECTION = 1;
var G_MOVE_UP_LEFT = 0;
var G_MOVE_UP = 1;
var G_MOVE_UP_RIGHT = 2;
var G_MOVE_LEFT = 3;
var G_NO_MOVEMENT = 4;
var G_MOVE_RIGHT = 5;
var G_MOVE_DOWN_LEFT = 6;
var G_MOVE_DOWN = 7;
var G_MOVE_DOWN_RIGHT = 8;
var G_STEP_WHEN_JUMPING = 8;
var G_NUM_SHURIKENS_BONUS = 10;
var G_MAX_NUM_SHURIKENS = 15;
var G_RANDOM_BONUS_SHURIKENS = 15;
var G_POWER_BY_LIFE = 2;
var G_NUM_OF_BLINKS = 30;
var G_START_POSITION_X = 75;
var G_START_POSITION_Y = 300;
CSprite.prototype.IsHittingClip = function (MovieClip) {
var SpriteBounds = this.Clip.getBounds(_root);
return((((MovieClip.hitTest(SpriteBounds.xMin, SpriteBounds.yMin, true) || (MovieClip.hitTest(SpriteBounds.xMin, SpriteBounds.yMax, true))) || (MovieClip.hitTest(SpriteBounds.xMax, SpriteBounds.yMin, true))) || (MovieClip.hitTest(SpriteBounds.xMax, SpriteBounds.yMax, true))) || (MovieClip.hitTest(this.Clip._x, this.Clip._y, true)));
};
CSprite.prototype.IsHittingDeathPlatforms = function (DeathPlatformsClipArray) {
var HitValue;
var SpriteBounds = this.Clip.getBounds(_root);
var Cpt;
HitValue = 0;
Cpt = 0;
while ((!HitValue) && (Cpt < DeathPlatformsClipArray.length)) {
HitValue = DeathPlatformsClipArray[Cpt].hitTest(SpriteBounds.xMin, SpriteBounds.yMin, true) || (DeathPlatformsClipArray[Cpt].hitTest(SpriteBounds.xMax, SpriteBounds.yMin, true));
Cpt++;
}
return(HitValue);
};
CSprite.prototype.IsGettingShurikens = function (ShurikensMovieClip) {
var NumShurikensTmp;
var HitValue;
var ShurikensBounds = ShurikensMovieClip.getBounds(_root);
var ClipCurrentFrame = ShurikensMovieClip._currentFrame;
HitValue = ((this.Clip.hitTest(ShurikensBounds.xMin, ShurikensBounds.yMin, true) || (this.Clip.hitTest(ShurikensBounds.xMax, ShurikensBounds.yMin, true))) || (this.Clip.hitTest(ShurikensBounds.xMin, ShurikensBounds.yMax, true))) || (this.Clip.hitTest(ShurikensBounds.xMax, ShurikensBounds.yMax, true));
if (((ClipCurrentFrame >= 15) && (35 >= ClipCurrentFrame)) && (HitValue)) {
ShurikensMovieClip.gotoAndPlay("ShurikensClipEnd");
NumShurikensTmp = this.NumOfShurikens + G_NUM_SHURIKENS_BONUS;
if (G_MAX_NUM_SHURIKENS < NumShurikensTmp) {
this.NumOfShurikens = G_MAX_NUM_SHURIKENS;
} else {
this.NumOfShurikens = this.NumOfShurikens + G_NUM_SHURIKENS_BONUS;
}
return(1);
}
return(0);
};
CSprite.prototype.SpriteInit = function (XPos, YPos) {
this.Clip._x = XPos;
this.Clip._y = YPos;
this.Move(G_NO_MOVEMENT);
};
CSprite.prototype.IsJumping = function () {
var ClipFrame = this.Clip._currentFrame;
return(((((ClipFrame == this.ClipRightStepJump) || (ClipFrame == this.ClipRightJump)) || (ClipFrame == this.ClipLeftJump)) || (ClipFrame == this.ClipLeftStepJump)) && (!this.FallValue));
};
CSprite.prototype.IsJumpingDown = function () {
return(0 >= this.JumpArray[this.ArrayCounter]);
};
CSprite.prototype.IsEndOfJump = function () {
return(this.ArrayCounter == this.JumpArray.length);
};
CSprite.prototype.IsFalling = function () {
var ClipFrame = this.Clip._currentFrame;
return(((ClipFrame == this.ClipFall) || (ClipFrame == this.ClipRightStepFall)) || (ClipFrame == this.ClipLeftStepFall));
};
CSprite.prototype.IsHittingPlatformsArray = function (PlatformsMovieClipArray) {
var SpriteBounds = this.Clip.getBounds(_root);
var ClipFrame = this.Clip._currentFrame;
var HitTestValue;
var CptArray;
var CurrentPlatform;
var MiddleClip;
if ((ClipFrame == this.ClipLeftStepJump) || (ClipFrame == this.ClipLeftStepFall)) {
SpriteBounds.xMin = SpriteBounds.xMin + ((SpriteBounds.xMax - SpriteBounds.xMin) / 2);
}
if ((ClipFrame == this.ClipRightStepJump) || (ClipFrame == this.ClipRightStepFall)) {
SpriteBounds.xMax = SpriteBounds.xMax - ((SpriteBounds.xMax - SpriteBounds.xMin) / 2);
}
MiddleClip = SpriteBounds.xMin + ((SpriteBounds.xMax - SpriteBounds.xMin) / 2);
HitTestValue = 0;
CptArray = 0;
while ((CptArray < PlatformsMovieClipArray.length) && (!HitTestValue)) {
CurrentPlatform = PlatformsMovieClipArray[CptArray];
HitTestValue = (CurrentPlatform.hitTest(SpriteBounds.xMin, SpriteBounds.yMax, true) || (CurrentPlatform.hitTest(SpriteBounds.xMax, SpriteBounds.yMax, true))) || (CurrentPlatform.hitTest(MiddleClip, SpriteBounds.yMax, true));
CptArray++;
}
if (HitTestValue) {
CptArray--;
this.HitPlatformNum = CptArray;
}
return(HitTestValue);
};
CSprite.prototype.IsHittingMovingPlatform = function (MovingPlatformMovieClip) {
var SpriteBounds = this.Clip.getBounds(_root);
var ClipFrame = this.Clip._currentFrame;
var HitTestValue;
var CptArray;
var CurrentPlatform;
var MiddleClip;
if ((ClipFrame == this.ClipLeftStepJump) || (ClipFrame == this.ClipLeftStepFall)) {
SpriteBounds.xMin = SpriteBounds.xMin + ((SpriteBounds.xMax - SpriteBounds.xMin) / 2);
}
if ((ClipFrame == this.ClipRightStepJump) || (ClipFrame == this.ClipRightStepFall)) {
SpriteBounds.xMax = SpriteBounds.xMax - ((SpriteBounds.xMax - SpriteBounds.xMin) / 2);
}
MiddleClip = SpriteBounds.xMin + ((SpriteBounds.xMax - SpriteBounds.xMin) / 2);
return((MovingPlatformMovieClip.hitTest(SpriteBounds.xMin, SpriteBounds.yMax, true) || (MovingPlatformMovieClip.hitTest(SpriteBounds.xMax, SpriteBounds.yMax, true))) || (MovingPlatformMovieClip.hitTest(MiddleClip, SpriteBounds.yMax, true)));
};
CSprite.prototype.AdjustClipOnPlatform = function (PlatformsMovieClipArray) {
var CurrentPlatform;
var SpriteBounds = this.Clip.getBounds(_root);
CurrentPlatform = PlatformsMovieClipArray[this.HitPlatformNum];
this.Clip._y = this.Clip._y + (CurrentPlatform._y - SpriteBounds.yMax);
};
CSprite.prototype.IsHittingPlatformsJumpingDown = function (PlatformsMovieClip) {
var SpriteBounds = this.Clip.getBounds(_root);
var ClipFrame = this.Clip._currentFrame;
var JumpDown;
var Val;
if (ClipFrame == this.ClipLeftStepJump) {
SpriteBounds.xMin = SpriteBounds.xMin + ((SpriteBounds.xMax - SpriteBounds.xMin) / 2);
}
if (ClipFrame == this.ClipRightStepJump) {
SpriteBounds.xMax = SpriteBounds.xMax - ((SpriteBounds.xMax - SpriteBounds.xMin) / 2);
}
return(PlatformsMovieClip.hitTest(SpriteBounds.xMin, Cpt, true) || (PlatformsMovieClip.hitTest(SpriteBounds.xMax, Cpt, true)));
};
CSprite.prototype.IsHittingWater = function (WaterMovieClip) {
var SpriteBounds = this.Clip.getBounds(_root);
return(WaterMovieClip.hitTest(SpriteBounds.xMin, SpriteBounds.yMin, true) || (WaterMovieClip.hitTest(SpriteBounds.xMax, SpriteBounds.yMin, true)));
};
CSprite.prototype.StartJump = function (JumpMvtKey) {
this.ArrayCounter = 0;
if (JumpMvtKey == G_MOVE_UP_LEFT) {
this.Direction = G_LEFT_DIRECTION;
this.Clip.gotoAndStop(this.ClipLeftStepJump);
this.Clip._x = this.Clip._x - this.StepArray[this.ArrayCounter];
} else if (JumpMvtKey == G_MOVE_UP_RIGHT) {
this.Direction = G_RIGHT_DIRECTION;
this.Clip.gotoAndStop(this.ClipRightStepJump);
this.Clip._x = this.Clip._x + this.StepArray[this.ArrayCounter];
} else if (this.Direction == G_LEFT_DIRECTION) {
this.Clip.gotoAndStop(this.ClipLeftJump);
} else {
this.Clip.gotoAndStop(this.ClipRightJump);
}
this.Clip._y = this.Clip._y - this.JumpArray[this.ArrayCounter];
this.ArrayCounter++;
};
CSprite.prototype.Jump = function () {
var ClipFrame = this.Clip._currentFrame;
if (ClipFrame == this.ClipLeftStepJump) {
this.Clip._x = this.Clip._x - this.StepArray[this.ArrayCounter];
}
if (ClipFrame == this.ClipRightStepJump) {
this.Clip._x = this.Clip._x + this.StepArray[this.ArrayCounter];
}
this.Clip._y = this.Clip._y - this.JumpArray[this.ArrayCounter];
this.ArrayCounter++;
};
CSprite.prototype.StartFall = function () {
var ClipFrame = this.Clip._currentFrame;
if ((ClipFrame == this.ClipLeftStepJump) || (ClipFrame == this.ClipWallToLeftJump)) {
this.Clip.gotoAndStop(this.ClipLeftStepFall);
this.Clip._x = this.Clip._x - G_STEP_WHEN_JUMPING;
} else if ((ClipFrame == this.ClipRightStepJump) || (ClipFrame == this.ClipWallToRightJump)) {
this.Clip.gotoAndStop(this.ClipRightStepFall);
this.Clip._x = this.Clip._x + G_STEP_WHEN_JUMPING;
} else {
this.Clip.gotoAndStop(this.ClipFall);
}
this.Clip._y = this.Clip._y + (this.YStep * 3);
};
CSprite.prototype.Fall = function () {
var ClipFrame = this.Clip._currentFrame;
if (ClipFrame == this.ClipLeftStepFall) {
this.Clip._x = this.Clip._x - G_STEP_WHEN_JUMPING;
this.Clip._y = this.Clip._y + (this.YStep * 3);
} else if (ClipFrame == this.ClipRightStepFall) {
this.Clip._x = this.Clip._x + G_STEP_WHEN_JUMPING;
this.Clip._y = this.Clip._y + (this.YStep * 3);
} else {
this.Clip._y = this.Clip._y + (this.YStep * 3);
}
};
CSprite.prototype.IsSwimming = function () {
return(this.SwimValue);
};
CSprite.prototype.ApplyPlouf = function (WaterMovieClip, PloufMovieClip) {
var WaterBounds = WaterMovieClip.getBounds(_root);
PloufMovieClip._x = this.Clip._x;
PloufMovieClip._y = this.Clip._y - 42;
PloufMovieClip.play();
};
CSprite.prototype.EndSwim = function () {
this.SwimValue = 0;
};
CSprite.prototype.Swim = function (SwimValue) {
var ClipFrame = this.Clip._currentFrame;
if (SwimValue == G_MOVE_LEFT) {
this.Direction = G_LEFT_DIRECTION;
if (ClipFrame != this.ClipLeftSwim) {
this.Clip.gotoAndStop(this.ClipLeftSwim);
}
this.Clip._x = this.Clip._x - (this.XStep / 2);
} else if (SwimValue == G_MOVE_RIGHT) {
this.Direction = G_RIGHT_DIRECTION;
if (ClipFrame != this.ClipRightSwim) {
this.Clip.gotoAndStop(this.ClipRightSwim);
}
this.Clip._x = this.Clip._x + (this.XStep / 2);
} else if (SwimValue == G_MOVE_UP_LEFT) {
this.Direction = G_LEFT_DIRECTION;
if (ClipFrame != this.ClipUpLeftSwim) {
this.Clip.gotoAndStop(this.ClipUpLeftSwim);
}
this.Clip._x = this.Clip._x - (this.XStep / 2);
this.Clip._y = this.Clip._y - (this.YStep / 2);
} else if (SwimValue == G_MOVE_UP_RIGHT) {
this.Direction = G_RIGHT_DIRECTION;
if (ClipFrame != this.ClipUpRightSwim) {
this.Clip.gotoAndStop(this.ClipUpRightSwim);
}
this.Clip._x = this.Clip._x + (this.XStep / 2);
this.Clip._y = this.Clip._y - (this.YStep / 2);
} else if (SwimValue == G_MOVE_DOWN_LEFT) {
this.Direction = G_LEFT_DIRECTION;
if (ClipFrame != this.ClipDownLeftSwim) {
this.Clip.gotoAndStop(this.ClipDownLeftSwim);
}
this.Clip._x = this.Clip._x - (this.XStep / 2);
this.Clip._y = this.Clip._y + (this.YStep / 2);
} else if (SwimValue == G_MOVE_DOWN_RIGHT) {
this.Direction = G_RIGHT_DIRECTION;
if (ClipFrame != this.ClipDownRightSwim) {
this.Clip.gotoAndStop(this.ClipDownRightSwim);
}
this.Clip._x = this.Clip._x + (this.XStep / 2);
this.Clip._y = this.Clip._y + (this.YStep / 2);
} else if (SwimValue == G_MOVE_UP) {
if (this.Direction == G_LEFT_DIRECTION) {
if (ClipFrame != this.ClipUpLeftSwim) {
this.Clip.gotoAndStop(this.ClipUpLeftSwim);
}
} else if (ClipFrame != this.ClipUpRightSwim) {
this.Clip.gotoAndStop(this.ClipUpRightSwim);
}
this.Clip._y = this.Clip._y - (this.YStep / 2);
} else if (SwimValue == G_MOVE_DOWN) {
if (this.Direction == G_LEFT_DIRECTION) {
if (ClipFrame != this.ClipDownLeftSwim) {
this.Clip.gotoAndStop(this.ClipDownLeftSwim);
}
} else if (ClipFrame != this.ClipDownRightSwim) {
this.Clip.gotoAndStop(this.ClipDownRightSwim);
}
this.Clip._y = this.Clip._y + (this.YStep / 2);
} else {
if (this.Direction == G_LEFT_DIRECTION) {
if (ClipFrame != this.ClipLeftSwimBreak) {
this.Clip.gotoAndStop(this.ClipLeftSwimBreak);
}
} else if (ClipFrame != this.ClipRightSwimBreak) {
this.Clip.gotoAndStop(this.ClipRightSwimBreak);
}
this.Clip._y = this.Clip._y + (this.YStep / 4);
}
this.SwimValue = 1;
};
CSprite.prototype.IsJumpingFromWall = function () {
var ClipFrame = this.Clip._currentFrame;
return((ClipFrame == this.ClipWallToRightJump) || (ClipFrame == this.ClipWallToLeftJump));
};
CSprite.prototype.IsWaitingOnWall = function () {
var ClipFrame = this.Clip._currentFrame;
return((ClipFrame == this.ClipWallToRightBreak) || (ClipFrame == this.ClipWallToLeftBreak));
};
CSprite.prototype.IsEndWallJump = function () {
return(this.ArrayCounter == this.WallJumpArray.length);
};
CSprite.prototype.IsHittingWallsArray = function (WallsMovieClipArray) {
var SpriteBounds = this.Clip.getBounds(_root);
var ValX;
var CptArray;
var HitTestValue;
var CurrentWall;
if (this.Direction == G_LEFT_DIRECTION) {
ValX = SpriteBounds.xMin + ((SpriteBounds.xMax - SpriteBounds.xMin) / 2);
} else {
ValX = SpriteBounds.xMax - ((SpriteBounds.xMax - SpriteBounds.xMin) / 2);
}
HitTestValue = 0;
CptArray = 0;
while ((CptArray < WallsMovieClipArray.length) && (!HitTestValue)) {
CurrentWall = WallsMovieClipArray[CptArray];
HitTestValue = CurrentWall.hitTest(ValX, SpriteBounds.yMin, true) && (CurrentWall.hitTest(ValX, SpriteBounds.yMax, true));
CptArray++;
}
if (HitTestValue) {
CptArray--;
this.HitWallNum = CptArray;
}
return(HitTestValue);
};
CSprite.prototype.AdjustClipOnWall = function (WallsMovieClipArray) {
var CurrentWall;
var SpriteBounds = this.Clip.getBounds(_root);
CurrentWall = WallsMovieClipArray[this.HitWallNum];
if (this.Direction == G_LEFT_DIRECTION) {
this.Clip._x = this.Clip._x + (CurrentWall._x - SpriteBounds.xMax);
} else {
this.Clip._x = this.Clip._x + (CurrentWall._x - SpriteBounds.xMin);
}
};
CSprite.prototype.IsHittingWallJumping = function (WallMovieClip) {
var SpriteBounds = this.Clip.getBounds(_root);
var ValX;
var IncVal;
var HitVal;
var Cpt;
if (this.Direction == G_LEFT_DIRECTION) {
ValX = SpriteBounds.xMin + ((SpriteBounds.xMax - SpriteBounds.xMin) / 2);
} else {
ValX = SpriteBounds.xMax - ((SpriteBounds.xMax - SpriteBounds.xMin) / 2);
}
return((WallMovieClip.hitTest(ValX, SpriteBounds.yMin, true) && (WallMovieClip.hitTest(ValX, SpriteBounds.yMax, true))) && (1 < this.ArrayCounter));
};
CSprite.prototype.StartWaitOnWall = function () {
this.ArrayCounter = 0;
if (this.Direction == G_LEFT_DIRECTION) {
this.Clip.gotoAndStop(this.ClipWallToRightBreak);
this.Direction = G_RIGHT_DIRECTION;
} else {
this.Clip.gotoAndStop(this.ClipWallToLeftBreak);
this.Direction = G_LEFT_DIRECTION;
}
};
CSprite.prototype.StartWallJump = function (WallMoveValue) {
this.ArrayCounter = 0;
if ((this.Direction == G_LEFT_DIRECTION) && (WallMoveValue == G_MOVE_LEFT)) {
this.Clip.gotoAndStop(this.ClipWallToLeftJump);
this.Clip._y = this.Clip._y - this.WallJumpArray[this.ArrayCounter];
this.ArrayCounter++;
} else if ((this.Direction == G_RIGHT_DIRECTION) && (WallMoveValue == G_MOVE_RIGHT)) {
this.Clip.gotoAndStop(this.ClipWallToRightJump);
this.Clip._y = this.Clip._y - this.WallJumpArray[this.ArrayCounter];
this.ArrayCounter++;
} else if (WallMoveValue == G_MOVE_DOWN) {
this.Clip.gotoAndStop(this.ClipFall);
if (this.Direction == G_LEFT_DIRECTION) {
this.Clip._x = this.Clip._x - 15;
} else {
this.Clip._x = this.Clip._x + 15;
}
}
};
CSprite.prototype.WallJump = function () {
if (this.Direction == G_LEFT_DIRECTION) {
this.Clip._x = this.Clip._x - (G_STEP_WHEN_JUMPING + 4);
} else {
this.Clip._x = this.Clip._x + (G_STEP_WHEN_JUMPING + 4);
}
this.Clip._y = this.Clip._y - this.WallJumpArray[this.ArrayCounter];
this.ArrayCounter++;
};
CSprite.prototype.EndWallJump = function () {
if (this.Direction == G_LEFT_DIRECTION) {
this.Clip.gotoAndStop(this.ClipLeftStepFall);
} else {
this.Clip.gotoAndStop(this.ClipRightStepFall);
}
};
CSprite.prototype.GetMovementKey = function () {
if (Key.isDown(this.UpKey) && (Key.isDown(this.LeftKey))) {
return(G_MOVE_UP_LEFT);
}
if (Key.isDown(this.UpKey) && (Key.isDown(this.RightKey))) {
return(G_MOVE_UP_RIGHT);
}
if (Key.isDown(this.DownKey) && (Key.isDown(this.LeftKey))) {
return(G_MOVE_DOWN_LEFT);
}
if (Key.isDown(this.DownKey) && (Key.isDown(this.RightKey))) {
return(G_MOVE_DOWN_RIGHT);
}
if (Key.isDown(this.RightKey)) {
return(G_MOVE_RIGHT);
}
if (Key.isDown(this.LeftKey)) {
return(G_MOVE_LEFT);
}
if (Key.isDown(this.UpKey)) {
return(G_MOVE_UP);
}
if (Key.isDown(this.DownKey)) {
return(G_MOVE_DOWN);
}
return(G_NO_MOVEMENT);
};
CSprite.prototype.Move = function (MoveValue) {
var ClipFrame = this.Clip._currentFrame;
if (MoveValue == G_MOVE_RIGHT) {
this.Direction = G_RIGHT_DIRECTION;
if (ClipFrame != this.ClipRightStep) {
this.Clip.gotoAndStop(this.ClipRightStep);
}
this.Clip._x = this.Clip._x + this.XStep;
} else if (MoveValue == G_MOVE_LEFT) {
this.Direction = G_LEFT_DIRECTION;
if (ClipFrame != this.ClipLeftStep) {
this.Clip.gotoAndStop(this.ClipLeftStep);
}
this.Clip._x = this.Clip._x - this.XStep;
} else if (this.Direction == G_LEFT_DIRECTION) {
if (ClipFrame != this.ClipLeftBreak) {
this.Clip.gotoAndStop(this.ClipLeftBreak);
}
} else if (ClipFrame != this.ClipRightBreak) {
this.Clip.gotoAndStop(this.ClipRightBreak);
}
};
CSprite.prototype.IsJumpingMove = function (MoveValue) {
return(((MoveValue == G_MOVE_UP_LEFT) || (MoveValue == G_MOVE_UP)) || (MoveValue == G_MOVE_UP_RIGHT));
};
CSprite.prototype.IsThrowingShuriken = function () {
if (0 < this.ThrowShuriken) {
return(1);
}
return(0);
};
CSprite.prototype.IsShurikenKeyPressed = function () {
return(Key.isDown(this.ShurikenKey));
};
CSprite.prototype.InitThrowShuriken = function () {
this.ThrowShuriken = 4;
};
CSprite.prototype.HasShurikens = function () {
return(this.NumOfShurikens);
};
CSprite.prototype.ContinueThrowShuriken = function () {
this.ThrowShuriken--;
};
CSprite.prototype.IsEndThrowShuriken = function () {
return(!this.ThrowShuriken);
};
CSprite.prototype.CreateShuriken = function () {
var CptArray;
CptArray = 0;
while (this.ShurikensArray[CptArray]._visible) {
CptArray++;
}
if (this.Direction == G_RIGHT_DIRECTION) {
this.ShurikensArray[CptArray].XDirection = 1;
} else {
this.ShurikensArray[CptArray].XDirection = -1;
}
this.ShurikensArray[CptArray]._x = this.Clip._x;
this.ShurikensArray[CptArray]._y = this.Clip._y;
this.ShurikensArray[CptArray]._visible = 1;
this.NumOfShurikens--;
};
CSprite.prototype.ClearShurikens = function () {
var CptArray;
CptArray = 0;
while (CptArray < this.ShurikensArray.length) {
this.ShurikensArray[CptArray]._visible = 0;
CptArray++;
}
};
CSprite.prototype.MoveShurikens = function () {
var CptArray;
var InScreen;
CptArray = 0;
while (CptArray < this.ShurikensArray.length) {
InScreen = (this.ShurikensArray[CptArray]._x >= 0) && (this.ShurikensArray[CptArray]._x < G_SCREEN_WIDTH);
if (this.ShurikensArray[CptArray]._visible && (InScreen)) {
this.ShurikensArray[CptArray]._x = this.ShurikensArray[CptArray]._x + (this.ShurikensArray[CptArray].XDirection * this.ShurikensSpeed);
} else {
this.ShurikensArray[CptArray]._visible = 0;
}
CptArray++;
}
};
CSprite.prototype.StartThrowShurikenOnPlatforms = function () {
var CurrentFrame = this.Clip._currentFrame;
if (CurrentFrame == this.ClipRightStep) {
this.Clip.gotoAndStop(this.ClipRightThrowShurikenBreak);
} else if (CurrentFrame == this.ClipLeftStep) {
this.Clip.gotoAndStop(this.ClipLeftThrowShurikenBreak);
} else if (this.Direction == G_RIGHT_DIRECTION) {
this.Clip.gotoAndStop(this.ClipRightThrowShurikenBreak);
} else {
this.Clip.gotoAndStop(this.ClipLeftThrowShurikenBreak);
}
};
CSprite.prototype.IsSabreKeyPressedAfterRelease = function () {
if (Key.isDown(this.SabreKey) && (this.SabreKeyRelease)) {
this.SabreKeyRelease = 0;
return(1);
}
return(0);
};
CSprite.prototype.TestSabreKeyRelease = function () {
if (!Key.isDown(this.SabreKey)) {
this.SabreKeyRelease = 1;
}
};
CSprite.prototype.InitSabreHit = function () {
this.SabreHit = 2;
};
CSprite.prototype.StartSabreHitOnPlatforms = function () {
var CurrentFrame = this.Clip._currentFrame;
if (CurrentFrame == this.ClipRightStep) {
this.Clip.gotoAndStop(this.ClipRightSabreBreak);
} else if (CurrentFrame == this.ClipLeftStep) {
this.Clip.gotoAndStop(this.ClipLeftSabreBreak);
} else if (this.Direction == G_RIGHT_DIRECTION) {
this.Clip.gotoAndStop(this.ClipRightSabreBreak);
} else {
this.Clip.gotoAndStop(this.ClipLeftSabreBreak);
}
};
CSprite.prototype.IsHittingWithSabre = function () {
if (0 < this.SabreHit) {
return(1);
}
return(0);
};
CSprite.prototype.SabreHit = function (EnemiesObjArray) {
var HitValue;
var CptArray;
var SpriteBounds;
var CurrentEnemy;
var XValue;
SpriteBounds = this.Clip.getBounds(_root);
if (this.Direction == G_RIGHT_DIRECTION) {
XValue = SpriteBounds.xMax;
} else {
XValue = SpriteBounds.xMin;
}
HitValue = 0;
CptArray = 0;
while ((!HitValue) && (CptArray < EnemiesObjArray.length)) {
CurrentEnemy = EnemiesObjArray[CptArray];
HitValue = (CurrentEnemy.Clip.hitTest(XValue, SpriteBounds.yMin, true) || (CurrentEnemy.Clip.hitTest(XValue, SpriteBounds.yMax, true))) || (CurrentEnemy.Clip.hitTest(XValue, SpriteBounds.yMin + ((SpriteBounds.yMax - SpriteBounds.yMin) / 2), true));
CptArray++;
}
CptArray--;
if (HitValue) {
return(CptArray);
}
return(0);
};
CSprite.prototype.ContinueSabreHit = function () {
this.SabreHit = this.SabreHit - 1;
};
CSprite.prototype.IsEndSabreHit = function () {
return(!this.SabreHit);
};
CSprite.prototype.IsBlinking = function () {
return(this.BlinkValue);
};
CSprite.prototype.IsTouchedByEnemy = function (ArrayOfEnemiesObj) {
var HitValue;
var CptArray;
var SpriteBounds;
var CurrentEnemy;
var XValue1;
var XValue2;
var YValue;
var YInc;
SpriteBounds = this.Clip.getBounds(_root);
if (this.Direction == G_RIGHT_DIRECTION) {
XValue1 = SpriteBounds.xMin;
} else {
XValue1 = SpriteBounds.xMax;
}
XValue2 = SpriteBounds.xMin + ((SpriteBounds.xMax - SpriteBounds.xMin) / 2);
YInc = (SpriteBounds.yMax - SpriteBounds.yMin) / 3;
HitValue = 0;
CptArray = 0;
while ((!HitValue) && (CptArray < ArrayOfEnemiesObj.length)) {
YValue = SpriteBounds.yMin;
while ((!HitValue) && (YValue < SpriteBounds.yMax)) {
HitValue = ArrayOfEnemiesObj[CptArray].Clip.hitTest(XValue1, YValue, true) || (ArrayOfEnemiesObj[CptArray].Clip.hitTest(XValue2, YValue, true));
YValue = YValue + YInc;
}
CptArray++;
}
return(HitValue);
};
CSprite.prototype.TouchedByEnemyControl = function () {
this.BlinkValue = G_NUM_OF_BLINKS;
this.NumOfPower--;
};
CSprite.prototype.ContinueBlink = function () {
if (this.BlinkValue & 1) {
this.Clip._visible = 1;
} else {
this.Clip._visible = 0;
}
this.BlinkValue--;
};
Frame 38
function CEnemy(MaxResurrecTime, MaxPowerVal, ClipEnemy) {
this.MaxBlink = 10;
this.BlinkValue = this.MaxBlink;
this.CurrentResurrectionTime = 0;
this.MaxResurrectionTime = MaxResurrecTime;
this.MaxPower = MaxPowerVal;
this.CurrentPower = this.MaxPower;
this.Clip = ClipEnemy;
this.ClipSaveX = this.Clip._x;
this.ClipSaveY = this.Clip._y;
}
function EnemyHitBySprite(EnemiesObjArray, SpriteObj) {
var HitValue;
var CptArray;
var SpriteBounds;
var CurrentEnemy;
var XValue;
SpriteBounds = SpriteObj.Clip.getBounds(_root);
if (SpriteObj.Direction == G_RIGHT_DIRECTION) {
XValue = SpriteBounds.xMax;
} else {
XValue = SpriteBounds.xMin;
}
HitValue = 0;
CptArray = 0;
while ((!HitValue) && (CptArray < EnemiesObjArray.length)) {
CurrentEnemy = EnemiesObjArray[CptArray];
HitValue = (CurrentEnemy.Clip.hitTest(XValue, SpriteBounds.yMin, true) || (CurrentEnemy.Clip.hitTest(XValue, SpriteBounds.yMax, true))) || (CurrentEnemy.Clip.hitTest(XValue, SpriteBounds.yMin + ((SpriteBounds.yMax - SpriteBounds.yMin) / 2), true));
CptArray++;
}
if ((HitValue && (!CurrentEnemy.IsBlinking())) && (!CurrentEnemy.IsDead())) {
if (CurrentEnemy.ApplyTouched()) {
CptArray--;
return(CptArray);
}
return(-1);
}
return(-1);
}
function EnemyHitByShurikensOfSprite(EnemiesObjArray, SpriteObj, ShurikensBonusMovieClip) {
var HitValue;
var CptShuriken;
var CptArray;
var SpriteBounds;
var CurrentEnemy;
var XValue;
var AddScore = 0;
CptShuriken = 0;
while (CptShuriken < SpriteObj.ShurikensArray.length) {
if (SpriteObj.ShurikensArray[CptShuriken]._visible) {
HitValue = 0;
CptArray = 0;
while ((!HitValue) && (CptArray < EnemiesObjArray.length)) {
CurrentEnemy = EnemiesObjArray[CptArray];
HitValue = CurrentEnemy.Clip.hitTest(SpriteObj.ShurikensArray[CptShuriken]._x, SpriteObj.ShurikensArray[CptShuriken]._y, true);
CptArray++;
}
if ((HitValue && (!CurrentEnemy.IsBlinking())) && (!CurrentEnemy.IsDead())) {
if (CurrentEnemy.ApplyTouched()) {
CptArray--;
ShurikensBonusControl(EnemiesObjArray[CptArray], ShurikensBonusMovieClip);
}
SpriteObj.ShurikensArray[CptShuriken]._visible = 0;
AddScore = AddScore + G_ENEMY_SCORE_VALUE;
}
}
CptShuriken++;
}
return(AddScore);
}
function EnemiesControl(EnemiesObjArray) {
var Cpt;
var CurrentEnemy;
Cpt = 0;
while (Cpt < EnemiesObjArray.length) {
CurrentEnemy = EnemiesObjArray[Cpt];
if (CurrentEnemy.IsBlinking()) {
CurrentEnemy.DoBlink();
CurrentEnemy.ContinueMoveIfBlinkFinished();
} else if (CurrentEnemy.IsDead()) {
CurrentEnemy.DoResurrectionIfTimeElapsed();
}
Cpt++;
}
}
function ShurikensBonusControl(EnemyObj, ShurikensBonusMovieClip) {
if ((ShurikensBonusMovieClip._currentFrame == 1) && (!Math.floor(Math.random() * G_RANDOM_BONUS_SHURIKENS))) {
ShurikensBonusMovieClip._x = EnemyObj.Clip._x + EnemyObj.Clip.Enemy._x;
ShurikensBonusMovieClip._y = EnemyObj.Clip._y;
ShurikensBonusMovieClip.play();
}
}
function ContinueBossBlink(BossMovieClip, BlinkValue) {
if (BlinkValue & 1) {
BossMovieClip._visible = 1;
} else {
BossMovieClip._visible = 0;
}
BlinkValue--;
return(BlinkValue);
}
function BossHitsBySprite(BossHitMovieClip, SpriteObject) {
var SBounds = SpriteObject.Clip.getBounds(_root);
var XValue;
if (SpriteObject.Direction == G_RIGHT_DIRECTION) {
XValue = SBounds.xMax;
} else {
XValue = SBounds.xMin;
}
return((BossHitMovieClip.hitTest(XValue, SBounds.yMin, true) || (BossHitMovieClip.hitTest(XValue, SpriteObject.Clip._y, true))) || (BossHitMovieClip.hitTest(XValue, SBounds.yMax, true)));
}
function BossHitsByShurikens(BossHitMovieClip, ShurikensArray) {
var HitValue;
var CptShuriken;
HitValue = 0;
CptShuriken = 0;
while ((!HitValue) && (CptShuriken < ShurikensArray.length)) {
if (ShurikensArray[CptShuriken]._visible) {
HitValue = BossHitMovieClip.hitTest(ShurikensArray[CptShuriken]._x, ShurikensArray[CptShuriken]._y, true);
}
CptShuriken++;
}
return(HitValue);
}
function SpriteHitsByBoss(BossHitMovieClip, SpriteObject) {
var SpriteBounds = SpriteObject.Clip.getBounds(_root);
var Average;
var XCenter;
var YCenter;
Average = (SpriteBounds.xMax - SpriteBounds.xMin) / 2;
YCenter = SpriteObject.Clip._y;
if (((SpriteObject.IsJumping() || (SpriteObject.IsFalling())) || (SpriteObject.IsJumpingFromWall())) || (SpriteObject.IsWaitingOnWall())) {
XCenter = SpriteObject.Clip._x;
} else if (SpriteObject.Direction == G_RIGHT_DIRECTION) {
SpriteBounds.xMax = SpriteBounds.xMax - Average;
XCenter = (SpriteBounds.xMin + SpriteBounds.xMax) / 2;
} else {
SpriteBounds.xMin = SpriteBounds.xMin + Average;
XCenter = (SpriteBounds.xMin + SpriteBounds.xMax) / 2;
}
return((((BossHitMovieClip.hitTest(SpriteBounds.xMin, SpriteBounds.yMin, true) || (BossHitMovieClip.hitTest(SpriteBounds.xMin, SpriteBounds.yMax, true))) || (BossHitMovieClip.hitTest(SpriteBounds.xMax, SpriteBounds.yMin, true))) || (BossHitMovieClip.hitTest(SpriteBounds.xMax, SpriteBounds.yMax, true))) || (BossHitMovieClip.hitTest(XCenter, YCenter, true)));
}
CEnemy.prototype.IsBlinking = function () {
return(this.BlinkValue);
};
CEnemy.prototype.DoBlink = function () {
if (this.BlinkValue & 1) {
this.Clip._visible = 1;
} else {
this.Clip._visible = 0;
}
this.BlinkValue--;
};
CEnemy.prototype.ContinueMoveIfBlinkFinished = function () {
if (!this.BlinkValue) {
this.Clip.play();
}
};
CEnemy.prototype.ApplyTouched = function () {
var CurrentX;
var CurrentY;
var NewTime;
var Point;
this.CurrentPower--;
if (this.CurrentPower) {
this.Clip.stop();
this.BlinkValue = this.MaxBlink;
return(0);
}
this.Clip.stop();
this.Clip.Enemy.play();
NewTime = new Date();
this.CurrentResurrectionTime = NewTime.getTime() / 1000;
delete NewTime;
return(1);
};
CEnemy.prototype.IsDead = function () {
return(!this.CurrentPower);
};
CEnemy.prototype.DoResurrectionIfTimeElapsed = function () {
var NewTime = new Date();
if (((NewTime.getTime() / 1000) - this.CurrentResurrectionTime) >= this.MaxResurrectionTime) {
this.CurrentPower = this.MaxPower;
this.Clip.gotoAndPlay(1);
this.CurrentResurrectionTime = 0;
this.BlinkValue = 10;
}
delete NewTime;
};
Frame 39
Ninja = new CSprite(ClipNinja, ClipShuriken, Key.UP, Key.DOWN, Key.LEFT, Key.RIGHT, Key.CONTROL, Key.SPACE, 3, 3);
ClipPlatformsArray = new Array(Platform1, Platform2, Platform3, Platform4, Platform5, Platform6, Platform7, Platform8, Platform9, Platform10, Platform11);
ClipWallsArray = new Array(ClipWall1, ClipWall2, ClipWall3, ClipWall4, ClipWall5);
Enemy1 = new CEnemy(5, 2, ClipEnemy1);
Enemy2 = new CEnemy(5, 2, ClipEnemy2);
Enemy3 = new CEnemy(5, 2, ClipEnemy3);
Enemy4 = new CEnemy(5, 2, ClipEnemy4);
Enemy5 = new CEnemy(5, 2, ClipEnemy5);
EnemiesArray = new Array(Enemy1, Enemy2, Enemy3, Enemy4, Enemy5);
DeathPlatformsArray = new Array(DeathPlatform1, DeathPlatform2, DeathPlatform3, DeathPlatform4);
_root.ClefPorte1 = 0;
_root.Porte1 = 0;
_root.Pont = 0;
_root.ClefPorte2 = 0;
_root.Porte2 = 0;
_root.BonusShurikens = 0;
ScoreNinja = 0;
Frame 40
if (Ninja.Clip._y >= 0) {
gotoAndPlay (56);
}
ClipShurikensBonus.gotoAndStop(1);
Frame 41
if (NinjaFromDown._currentframe == NinjaFromDown._totalframes) {
Ninja.Direction = G_LEFT_DIRECTION;
Ninja.Move(G_NO_MOVEMENT);
gotoAndPlay (56);
}
Frame 42
gotoAndPlay(_currentframe - 1);
Frame 56
if (Ninja.Clip._y < 0) {
Ninja.SpriteInit(195, 414);
} else if (Ninja.Direction == G_RIGHT_DIRECTION) {
Ninja.SpriteInit(G_START_POSITION_X, G_START_POSITION_Y);
} else {
Ninja.SpriteInit(G_SCREEN_WIDTH - 20, 30);
}
Ninja.ClearShurikens();
Frame 57
if (Ninja.IsJumping()) {
if (Ninja.IsEndOfJump()) {
if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else {
Ninja.StartFall();
}
} else if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray) && (0 >= Ninja.JumpArray[Ninja.ArrayCounter])) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else {
Ninja.Jump();
}
} else if (Ninja.IsFalling()) {
if (Ninja.IsHittingDeathPlatforms(DeathPlatformsArray)) {
gotoAndPlay (240);
} else if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else {
Ninja.Fall();
}
} else if (Ninja.IsWaitingOnWall()) {
var ValMove = Ninja.GetMovementKey();
Ninja.StartWallJump(ValMove);
} else if (Ninja.IsJumpingFromWall()) {
if (Ninja.IsHittingClip(ClipCeiling1)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.StartFall();
} else if (Ninja.IsHittingWallsArray(ClipWallsArray) && (1 < Ninja.ArrayCounter)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else if (Ninja.IsEndWallJump()) {
Ninja.StartFall();
} else {
Ninja.WallJump();
}
} else if (Ninja.IsThrowingShuriken()) {
Ninja.ContinueThrowShuriken();
if (Ninja.IsEndThrowShuriken()) {
Ninja.CreateShuriken();
}
} else if (Ninja.IsHittingWithSabre()) {
var NumEnemy;
NumEnemy = EnemyHitBySprite(EnemiesArray, Ninja);
if (-1 < NumEnemy) {
ScoreNinja = ScoreNinja + G_ENEMY_SCORE_VALUE;
ShurikensBonusControl(EnemiesArray[NumEnemy], ClipShurikensBonus);
Text = (EnemiesArray[NumEnemy].Clip._x + " ") + EnemiesArray[NumEnemy].Clip.Enemy._x;
}
Ninja.ContinueSabreHit();
} else {
var ValMove = Ninja.GetMovementKey();
if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
if (Ninja.IsJumpingMove(ValMove)) {
Ninja.StartJump(ValMove);
} else if (Ninja.IsShurikenKeyPressed() && (Ninja.HasShurikens())) {
Ninja.InitThrowShuriken();
Ninja.StartThrowShurikenOnPlatforms();
} else if (Ninja.IsSabreKeyPressedAfterRelease()) {
Ninja.InitSabreHit();
Ninja.StartSabreHitOnPlatforms();
} else {
Ninja.Move(ValMove);
}
} else {
Ninja.StartFall();
}
}
if (Ninja.IsBlinking()) {
Ninja.ContinueBlink();
} else if (Ninja.IsTouchedByEnemy(EnemiesArray)) {
Ninja.TouchedByEnemyControl();
ClipNinjaTouchedSound.play();
}
Ninja.TestSabreKeyRelease();
EnemiesControl(EnemiesArray);
Ninja.IsGettingShurikens(ClipShurikensBonus);
TextShurikens = "X " + Ninja.NumOfShurikens;
TextLives = "X " + Ninja.NumOfLives;
ScoreNinja = ScoreNinja + EnemyHitByShurikensOfSprite(EnemiesArray, Ninja, ClipShurikensBonus);
TextScore = ScoreNinja;
Ninja.MoveShurikens();
if (!Ninja.NumOfPower) {
gotoAndPlay (240);
}
Text = Ninja.NumOfPower;
if (Ninja.IsHittingClip(ClipScreen3)) {
gotoAndPlay (80);
}
if (Ninja.IsHittingClip(ClipScreen2)) {
gotoAndPlay (60);
}
play();
Frame 58
prevFrame();
Frame 60
Ninja.SpriteInit(265, 30);
if (_root.ClefPorte1) {
ClipClef.gotoAndPlay(ClipClef._totalframes);
}
ClipShurikensBonus.gotoAndStop(1);
Ninja.ClearShurikens();
Frame 61
if (Ninja.IsJumping()) {
if (Ninja.IsEndOfJump()) {
if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else {
Ninja.StartFall();
}
} else if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray) && (0 >= Ninja.JumpArray[Ninja.ArrayCounter])) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else {
Ninja.Jump();
}
} else if (Ninja.IsFalling()) {
if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else {
Ninja.Fall();
}
} else if (Ninja.IsWaitingOnWall()) {
var ValMove = Ninja.GetMovementKey();
Ninja.StartWallJump(ValMove);
} else if (Ninja.IsJumpingFromWall()) {
if (Ninja.IsHittingClip(ClipCeiling1)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.StartFall();
} else if (Ninja.IsHittingWallsArray(ClipWallsArray) && (1 < Ninja.ArrayCounter)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else if (Ninja.IsEndWallJump()) {
Ninja.StartFall();
} else {
Ninja.WallJump();
}
} else if (Ninja.IsThrowingShuriken()) {
Text = Ninja.ThrowShuriken;
Ninja.ContinueThrowShuriken();
if (Ninja.IsEndThrowShuriken()) {
Ninja.CreateShuriken();
}
} else if (Ninja.IsHittingWithSabre()) {
var NumEnemy;
NumEnemy = EnemyHitBySprite(EnemiesArray, Ninja);
if (-1 < NumEnemy) {
ShurikensBonusControl(EnemiesArray[NumEnemy], ClipShurikensBonus);
}
Ninja.ContinueSabreHit();
} else {
var ValMove = Ninja.GetMovementKey();
if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
if (Ninja.IsJumpingMove(ValMove)) {
Ninja.StartJump(ValMove);
} else if (Ninja.IsShurikenKeyPressed() && (Ninja.HasShurikens())) {
Ninja.InitThrowShuriken();
Ninja.StartThrowShurikenOnPlatforms();
} else if (Ninja.IsSabreKeyPressedAfterRelease()) {
Ninja.InitSabreHit();
Ninja.StartSabreHitOnPlatforms();
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
var PasX = Ninja.XStep;
Ninja.XStep = 0;
Ninja.Move(ValMove);
Ninja.XStep = PasX;
} else {
Ninja.Move(ValMove);
}
} else {
Ninja.StartFall();
}
}
if (Ninja.IsBlinking()) {
Ninja.ContinueBlink();
} else if (Ninja.IsTouchedByEnemy(EnemiesArray)) {
Ninja.TouchedByEnemyControl();
ClipNinjaTouchedSound.play();
}
Ninja.TestSabreKeyRelease();
EnemiesControl(EnemiesArray);
Ninja.IsGettingShurikens(ClipShurikensBonus);
TextShurikens = Ninja.NumOfShurikens;
EnemyHitByShurikensOfSprite(EnemiesArray, Ninja, ClipShurikensBonus);
Ninja.MoveShurikens();
if (!Ninja.NumOfPower) {
gotoAndPlay (240);
}
if ((!_root.ClefPorte1) && (Ninja.Clip.hitTest(ClipClef._x, ClipClef._y, true))) {
_root.ClefPorte1 = 1;
ClipClef.gotoAndPlay("FinClef");
}
if (Ninja.IsHittingClip(ClipScreen1)) {
Ninja.Clip._y = -10;
gotoAndPlay (40);
}
play();
Frame 62
prevFrame();
Frame 75
if (Key.isDown(Key.SHIFT)) {
Ninja.TouchByEnemy();
}
Ninja.ShowTouchByEnemy();
if (Ninja.IsJumping()) {
if (Ninja.IsEndOfJump()) {
if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else {
Ninja.StartFall();
}
} else if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray) && (0 >= Ninja.JumpArray[Ninja.ArrayCounter])) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else {
Ninja.Jump();
}
} else if (Ninja.IsSwimming()) {
var ValMove = Ninja.GetMovementKey();
if (Ninja.IsHittingWater(ClipWater)) {
Ninja.Swim(ValMove);
} else if (Ninja.IsJumpingMove(ValMove)) {
Ninja.EndSwim();
Ninja.StartJump(ValMove);
} else {
Ninja.StartFall();
}
} else if (Ninja.IsFalling()) {
if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else if (Ninja.IsHittingWater(ClipWater)) {
Ninja.ApplyPlouf(ClipWater, ClipPlouf);
Ninja.Swim(G_NO_MOVEMENT);
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else {
Ninja.Fall();
}
} else if (Ninja.IsWaitingOnWall()) {
var ValMove = Ninja.GetMovementKey();
Ninja.StartWallJump(ValMove);
} else if (Ninja.IsJumpingFromWall()) {
if (Ninja.IsHittingWallsArray(ClipWallsArray) && (1 < Ninja.ArrayCounter)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else if (Ninja.IsEndWallJump()) {
Ninja.StartFall();
} else {
Ninja.WallJump();
}
} else if (Ninja.IsThrowingShuriken()) {
Text = Ninja.ThrowShuriken;
Ninja.ContinueThrowShuriken();
if (Ninja.IsEndThrowShuriken()) {
Ninja.CreateShuriken();
}
} else if (Ninja.IsHittingWithSabre()) {
var NumEnemy;
NumEnemy = EnemyHitBySprite(EnemiesArray, Ninja);
if (-1 < NumEnemy) {
ShurikensBonusControl(EnemiesArray[NumEnemy], ClipShurikensBonus);
}
Ninja.ContinueSabreHit();
} else {
var ValMove = Ninja.GetMovementKey();
if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
if (Ninja.IsJumpingMove(ValMove)) {
Ninja.StartJump(ValMove);
} else if (Ninja.IsShurikenKeyPressed() && Ninja.HasShurikens()) {
Ninja.InitThrowShuriken();
Ninja.StartThrowShurikenOnPlatforms();
} else if (Ninja.IsSabreKeyPressedAfterRelease()) {
Ninja.InitSabreHit();
Ninja.StartSabreHitOnPlatforms();
} else {
Ninja.Move(ValMove);
}
} else if (Ninja.IsHittingWater(ClipWater)) {
Ninja.Swim(G_NO_MOVEMENT);
} else {
Ninja.StartFall();
}
}
Ninja.TestSabreKeyRelease();
EnemiesControl(EnemiesArray);
Ninja.IsGettingShurikens(ClipShurikensBonus);
TextShurikens = Ninja.NumOfShurikens;
EnemyHitByShurikensOfSprite(EnemiesArray, Ninja, ClipShurikensBonus);
Ninja.MoveShurikens();
play();
Frame 76
prevFrame();
Frame 80
if (_root.Porte1) {
ClipPorte1.gotoAndPlay(ClipPorte1._totalframes);
}
if (_root.Pont) {
gotoAndPlay (90);
}
if (Ninja.Direction == G_RIGHT_DIRECTION) {
Ninja.SpriteInit(20, 30);
} else {
Ninja.SpriteInit(380, 435);
}
ClipShurikensBonus.gotoAndStop(1);
Ninja.ClearShurikens();
Frame 81
if (Ninja.IsJumping()) {
if (Ninja.IsEndOfJump()) {
if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else {
Ninja.StartFall();
}
} else if (Ninja.IsHittingClip(ClipPorte1)) {
Ninja.Clip._x = Ninja.Clip._x + 20;
Ninja.Clip._y = Ninja.Clip._y - 10;
Ninja.Move(G_NO_MOVEMENT);
Ninja.StartFall();
} else if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray) && (0 >= Ninja.JumpArray[Ninja.ArrayCounter])) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else {
Ninja.Jump();
}
} else if (Ninja.IsFalling()) {
if (Ninja.IsHittingDeathPlatforms(DeathPlatformsArray)) {
gotoAndPlay (240);
} else if (Ninja.IsHittingClip(ClipPorte1)) {
Ninja.Clip._x = Ninja.Clip._x + 20;
Ninja.Move(G_NO_MOVEMENT);
Ninja.StartFall();
} else if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else {
Ninja.Fall();
}
} else if (Ninja.IsWaitingOnWall()) {
var ValMove = Ninja.GetMovementKey();
Ninja.StartWallJump(ValMove);
} else if (Ninja.IsJumpingFromWall()) {
if (Ninja.IsHittingClip(ClipCeiling1)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.StartFall();
} else if (Ninja.IsHittingWallsArray(ClipWallsArray) && (1 < Ninja.ArrayCounter)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else if (Ninja.IsEndWallJump()) {
Ninja.StartFall();
} else {
Ninja.WallJump();
}
} else if (Ninja.IsThrowingShuriken()) {
Ninja.ContinueThrowShuriken();
if (Ninja.IsEndThrowShuriken()) {
Ninja.CreateShuriken();
}
} else if (Ninja.IsHittingWithSabre()) {
var NumEnemy;
NumEnemy = EnemyHitBySprite(EnemiesArray, Ninja);
if (-1 < NumEnemy) {
ShurikensBonusControl(EnemiesArray[NumEnemy], ClipShurikensBonus);
Text = (EnemiesArray[NumEnemy].Clip._x + " ") + EnemiesArray[NumEnemy].Clip.Enemy._x;
}
Ninja.ContinueSabreHit();
} else {
var ValMove = Ninja.GetMovementKey();
if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
if (Ninja.IsJumpingMove(ValMove)) {
Ninja.StartJump(ValMove);
} else if (Ninja.IsShurikenKeyPressed() && (Ninja.HasShurikens())) {
Ninja.InitThrowShuriken();
Ninja.StartThrowShurikenOnPlatforms();
} else if (Ninja.IsSabreKeyPressedAfterRelease()) {
Ninja.InitSabreHit();
Ninja.StartSabreHitOnPlatforms();
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
var PasX = Ninja.XStep;
Ninja.XStep = 0;
Ninja.Move(ValMove);
Ninja.XStep = PasX;
} else if (Ninja.IsHittingClip(ClipPorte1)) {
if (!_root.ClefPorte1) {
var PasX = Ninja.XStep;
Ninja.XStep = 0;
Ninja.Move(ValMove);
Ninja.XStep = PasX;
} else if (ClipPorte1._currentframe != ClipPorte1._totalframes) {
_root.Porte1 = 1;
ClipPorte1.play();
} else {
Ninja.Move(ValMove);
}
} else {
Ninja.Move(ValMove);
}
} else {
Ninja.StartFall();
}
}
if (Ninja.IsBlinking()) {
Ninja.ContinueBlink();
} else if (Ninja.IsTouchedByEnemy(EnemiesArray)) {
Ninja.TouchedByEnemyControl();
ClipNinjaTouchedSound.play();
}
Ninja.TestSabreKeyRelease();
EnemiesControl(EnemiesArray);
Ninja.IsGettingShurikens(ClipShurikensBonus);
TextShurikens = "X " + Ninja.NumOfShurikens;
EnemyHitByShurikensOfSprite(EnemiesArray, Ninja, ClipShurikensBonus);
Ninja.MoveShurikens();
if (!Ninja.NumOfPower) {
gotoAndPlay (240);
}
if (Ninja.Clip.hitTest(ClipLevier._x, ClipLevier._y, true)) {
ClipLevier.play();
_root.Pont = 1;
Ninja.Move(G_NO_MOVEMENT);
gotoAndPlay(_currentframe + 2);
}
if (Ninja.IsHittingClip(ClipScreen1)) {
gotoAndPlay (40);
}
play();
Frame 82
prevFrame();
Frame 89
gotoAndPlay(_currentframe + 2);
Frame 90
if (Ninja.Direction == G_RIGHT_DIRECTION) {
Ninja.SpriteInit(20, 30);
} else {
Ninja.SpriteInit(370, 435);
}
ClipShurikensBonus.gotoAndStop(1);
Ninja.ClearShurikens();
Frame 91
if (Ninja.IsJumping()) {
if (Ninja.IsEndOfJump()) {
if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else {
Ninja.StartFall();
}
} else if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray) && (0 >= Ninja.JumpArray[Ninja.ArrayCounter])) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else {
Ninja.Jump();
}
} else if (Ninja.IsFalling()) {
if (Ninja.IsHittingDeathPlatforms(DeathPlatformsArray)) {
gotoAndPlay (240);
} else if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else {
Ninja.Fall();
}
} else if (Ninja.IsWaitingOnWall()) {
var ValMove = Ninja.GetMovementKey();
Ninja.StartWallJump(ValMove);
} else if (Ninja.IsJumpingFromWall()) {
if (Ninja.IsHittingClip(ClipCeiling1)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.StartFall();
} else if (Ninja.IsHittingWallsArray(ClipWallsArray) && (1 < Ninja.ArrayCounter)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else if (Ninja.IsEndWallJump()) {
Ninja.StartFall();
} else {
Ninja.WallJump();
}
} else if (Ninja.IsThrowingShuriken()) {
Ninja.ContinueThrowShuriken();
if (Ninja.IsEndThrowShuriken()) {
Ninja.CreateShuriken();
}
} else if (Ninja.IsHittingWithSabre()) {
var NumEnemy;
NumEnemy = EnemyHitBySprite(EnemiesArray, Ninja);
if (-1 < NumEnemy) {
ShurikensBonusControl(EnemiesArray[NumEnemy], ClipShurikensBonus);
Text = (EnemiesArray[NumEnemy].Clip._x + " ") + EnemiesArray[NumEnemy].Clip.Enemy._x;
}
Ninja.ContinueSabreHit();
} else {
var ValMove = Ninja.GetMovementKey();
if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
if (Ninja.IsJumpingMove(ValMove)) {
Ninja.StartJump(ValMove);
} else if (Ninja.IsShurikenKeyPressed() && (Ninja.HasShurikens())) {
Ninja.InitThrowShuriken();
Ninja.StartThrowShurikenOnPlatforms();
} else if (Ninja.IsSabreKeyPressedAfterRelease()) {
Ninja.InitSabreHit();
Ninja.StartSabreHitOnPlatforms();
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
var PasX = Ninja.XStep;
Ninja.XStep = 0;
Ninja.Move(ValMove);
Ninja.XStep = PasX;
} else {
Ninja.Move(ValMove);
}
} else {
Ninja.StartFall();
}
}
if (Ninja.IsBlinking()) {
Ninja.ContinueBlink();
} else if (Ninja.IsTouchedByEnemy(EnemiesArray)) {
Ninja.TouchedByEnemyControl();
ClipNinjaTouchedSound.play();
}
Ninja.TestSabreKeyRelease();
EnemiesControl(EnemiesArray);
Ninja.IsGettingShurikens(ClipShurikensBonus);
TextShurikens = "X " + Ninja.NumOfShurikens;
EnemyHitByShurikensOfSprite(EnemiesArray, Ninja, ClipShurikensBonus);
Ninja.MoveShurikens();
if (!Ninja.NumOfPower) {
gotoAndPlay (240);
}
if (Ninja.IsHittingClip(ClipScreen1)) {
gotoAndPlay (40);
}
if (Ninja.IsHittingClip(ClipScreen4)) {
gotoAndPlay (100);
}
play();
Frame 92
prevFrame();
Frame 100
if (Ninja.Direction == G_RIGHT_DIRECTION) {
Ninja.SpriteInit(15, 380);
} else {
Ninja.SpriteInit(375, 380);
}
ClipShurikensBonus.gotoAndStop(1);
if (!_root.BonusShurikens) {
ClipShurikensBonus._x = 207;
ClipShurikensBonus._y = 160;
ClipShurikensBonus._visible = 1;
ClipShurikensBonus.gotoAndPlay(1);
ClipShurikensBonus.play();
}
Ninja.ClearShurikens();
Frame 101
if (Ninja.IsJumping()) {
if (Ninja.IsEndOfJump()) {
if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else {
Ninja.StartFall();
}
} else if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray) && (0 >= Ninja.JumpArray[Ninja.ArrayCounter])) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else {
Ninja.Jump();
}
} else if (Ninja.IsFalling()) {
if (Ninja.IsHittingDeathPlatforms(DeathPlatformsArray)) {
gotoAndPlay (240);
} else if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else {
Ninja.Fall();
}
} else if (Ninja.IsThrowingShuriken()) {
Ninja.ContinueThrowShuriken();
if (Ninja.IsEndThrowShuriken()) {
Ninja.CreateShuriken();
}
} else if (Ninja.IsHittingWithSabre()) {
var NumEnemy;
NumEnemy = EnemyHitBySprite(EnemiesArray, Ninja);
if (-1 < NumEnemy) {
ShurikensBonusControl(EnemiesArray[NumEnemy], ClipShurikensBonus);
Text = (EnemiesArray[NumEnemy].Clip._x + " ") + EnemiesArray[NumEnemy].Clip.Enemy._x;
}
Ninja.ContinueSabreHit();
} else {
var ValMove = Ninja.GetMovementKey();
if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
if (Ninja.IsJumpingMove(ValMove)) {
Ninja.StartJump(ValMove);
} else if (Ninja.IsShurikenKeyPressed() && (Ninja.HasShurikens())) {
Ninja.InitThrowShuriken();
Ninja.StartThrowShurikenOnPlatforms();
} else if (Ninja.IsSabreKeyPressedAfterRelease()) {
Ninja.InitSabreHit();
Ninja.StartSabreHitOnPlatforms();
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
var PasX = Ninja.XStep;
Ninja.XStep = 0;
Ninja.Move(ValMove);
Ninja.XStep = PasX;
} else {
Ninja.Move(ValMove);
}
} else {
Ninja.StartFall();
}
}
if (Ninja.IsBlinking()) {
Ninja.ContinueBlink();
} else if (Ninja.IsTouchedByEnemy(EnemiesArray)) {
Ninja.TouchedByEnemyControl();
ClipNinjaTouchedSound.play();
}
Ninja.TestSabreKeyRelease();
EnemiesControl(EnemiesArray);
if (Ninja.IsGettingShurikens(ClipShurikensBonus)) {
_root.BonusShurikens = 1;
}
TextShurikens = "X " + Ninja.NumOfShurikens;
EnemyHitByShurikensOfSprite(EnemiesArray, Ninja, ClipShurikensBonus);
Ninja.MoveShurikens();
if (!Ninja.NumOfPower) {
gotoAndPlay (240);
}
if (Ninja.IsHittingClip(ClipScreen1)) {
gotoAndPlay (90);
}
if (Ninja.IsHittingClip(ClipScreen4)) {
gotoAndPlay (120);
}
play();
Frame 102
prevFrame();
Frame 120
if (Ninja.Direction == G_RIGHT_DIRECTION) {
Ninja.SpriteInit(25, 440);
} else {
Ninja.SpriteInit(370, 475);
}
ClipShurikensBonus.gotoAndStop(1);
Ninja.ClearShurikens();
Frame 121
if (Ninja.IsJumping()) {
if (Ninja.IsEndOfJump()) {
if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else {
Ninja.StartFall();
}
} else if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray) && (0 >= Ninja.JumpArray[Ninja.ArrayCounter])) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else {
Ninja.Jump();
}
} else if (Ninja.IsFalling()) {
if (Ninja.IsHittingDeathPlatforms(DeathPlatformsArray)) {
gotoAndPlay (240);
} else if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else {
Ninja.Fall();
}
} else if (Ninja.IsWaitingOnWall()) {
var ValMove = Ninja.GetMovementKey();
Ninja.StartWallJump(ValMove);
} else if (Ninja.IsJumpingFromWall()) {
if (Ninja.IsHittingClip(ClipCeiling1)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.StartFall();
} else if (Ninja.IsHittingWallsArray(ClipWallsArray) && (1 < Ninja.ArrayCounter)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else if (Ninja.IsEndWallJump()) {
Ninja.StartFall();
} else {
Ninja.WallJump();
}
} else if (Ninja.IsThrowingShuriken()) {
Ninja.ContinueThrowShuriken();
if (Ninja.IsEndThrowShuriken()) {
Ninja.CreateShuriken();
}
} else if (Ninja.IsHittingWithSabre()) {
var NumEnemy;
NumEnemy = EnemyHitBySprite(EnemiesArray, Ninja);
if (-1 < NumEnemy) {
ShurikensBonusControl(EnemiesArray[NumEnemy], ClipShurikensBonus);
Text = (EnemiesArray[NumEnemy].Clip._x + " ") + EnemiesArray[NumEnemy].Clip.Enemy._x;
}
Ninja.ContinueSabreHit();
} else {
var ValMove = Ninja.GetMovementKey();
if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
if (Ninja.IsJumpingMove(ValMove)) {
Ninja.StartJump(ValMove);
} else if (Ninja.IsShurikenKeyPressed() && (Ninja.HasShurikens())) {
Ninja.InitThrowShuriken();
Ninja.StartThrowShurikenOnPlatforms();
} else if (Ninja.IsSabreKeyPressedAfterRelease()) {
Ninja.InitSabreHit();
Ninja.StartSabreHitOnPlatforms();
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
var PasX = Ninja.XStep;
Ninja.XStep = 0;
Ninja.Move(ValMove);
Ninja.XStep = PasX;
} else {
Ninja.Move(ValMove);
}
} else {
Ninja.StartFall();
}
}
if (Ninja.IsBlinking()) {
Ninja.ContinueBlink();
} else if (Ninja.IsTouchedByEnemy(EnemiesArray)) {
Ninja.TouchedByEnemyControl();
ClipNinjaTouchedSound.play();
}
Ninja.TestSabreKeyRelease();
EnemiesControl(EnemiesArray);
Ninja.IsGettingShurikens(ClipShurikensBonus);
TextShurikens = "X " + Ninja.NumOfShurikens;
EnemyHitByShurikensOfSprite(EnemiesArray, Ninja, ClipShurikensBonus);
Ninja.MoveShurikens();
if (!Ninja.NumOfPower) {
gotoAndPlay (240);
}
if (Ninja.IsHittingClip(ClipScreen1)) {
gotoAndPlay (100);
}
if (Ninja.IsHittingClip(ClipScreen4)) {
gotoAndPlay (140);
}
play();
Frame 122
prevFrame();
Frame 140
if (Ninja.Direction == G_RIGHT_DIRECTION) {
Ninja.SpriteInit(25, 470);
} else {
Ninja.SpriteInit(G_SCREEN_WIDTH - 20, 30);
}
ClipShurikensBonus.gotoAndStop(1);
Ninja.ClearShurikens();
Frame 141
if (Ninja.IsJumping()) {
if (Ninja.IsEndOfJump()) {
if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else {
Ninja.StartFall();
}
} else if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray) && (0 >= Ninja.JumpArray[Ninja.ArrayCounter])) {
Ninja.Move(Ninja.GetMovementKey());
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else {
Ninja.Jump();
}
} else if (Ninja.IsFalling()) {
if (Ninja.IsHittingDeathPlatforms(DeathPlatformsArray)) {
gotoAndPlay (240);
} else if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else {
Ninja.Fall();
}
} else if (Ninja.IsWaitingOnWall()) {
var ValMove = Ninja.GetMovementKey();
Ninja.StartWallJump(ValMove);
} else if (Ninja.IsJumpingFromWall()) {
if (Ninja.IsHittingClip(ClipCeiling1)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.StartFall();
} else if (Ninja.IsHittingWallsArray(ClipWallsArray) && (1 < Ninja.ArrayCounter)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else if (Ninja.IsEndWallJump()) {
Ninja.StartFall();
} else {
Ninja.WallJump();
}
} else if (Ninja.IsThrowingShuriken()) {
Ninja.ContinueThrowShuriken();
if (Ninja.IsEndThrowShuriken()) {
Ninja.CreateShuriken();
}
} else if (Ninja.IsHittingWithSabre()) {
var NumEnemy;
NumEnemy = EnemyHitBySprite(EnemiesArray, Ninja);
if (-1 < NumEnemy) {
ShurikensBonusControl(EnemiesArray[NumEnemy], ClipShurikensBonus);
Text = (EnemiesArray[NumEnemy].Clip._x + " ") + EnemiesArray[NumEnemy].Clip.Enemy._x;
}
Ninja.ContinueSabreHit();
} else {
var ValMove = Ninja.GetMovementKey();
if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
if (Ninja.IsJumpingMove(ValMove)) {
Ninja.StartJump(ValMove);
} else if (Ninja.IsShurikenKeyPressed() && (Ninja.HasShurikens())) {
Ninja.InitThrowShuriken();
Ninja.StartThrowShurikenOnPlatforms();
} else if (Ninja.IsSabreKeyPressedAfterRelease()) {
Ninja.InitSabreHit();
Ninja.StartSabreHitOnPlatforms();
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
var PasX = Ninja.XStep;
Ninja.XStep = 0;
Ninja.Move(ValMove);
Ninja.XStep = PasX;
} else {
Ninja.Move(ValMove);
}
} else {
Ninja.StartFall();
}
}
if (Ninja.IsBlinking()) {
Ninja.ContinueBlink();
} else if ((Ninja.IsTouchedByEnemy(EnemiesArray) || (Ninja.IsHittingClip(ClipBat))) || (ClipBat.hitTest(Ninja.Clip._x, Ninja.Clip._y, true))) {
Ninja.TouchedByEnemyControl();
ClipNinjaTouchedSound.play();
}
Ninja.TestSabreKeyRelease();
EnemiesControl(EnemiesArray);
Ninja.IsGettingShurikens(ClipShurikensBonus);
TextShurikens = "X " + Ninja.NumOfShurikens;
EnemyHitByShurikensOfSprite(EnemiesArray, Ninja, ClipShurikensBonus);
Ninja.MoveShurikens();
if (!Ninja.NumOfPower) {
gotoAndPlay (240);
}
if (Ninja.IsHittingClip(ClipScreen1)) {
gotoAndPlay (120);
}
if (Ninja.IsHittingClip(ClipScreen4)) {
gotoAndPlay (160);
}
play();
Frame 142
prevFrame();
Frame 160
if (_root.ClefPorte2) {
ClipClef.gotoAndPlay(ClipClef._totalframes);
}
if (Ninja.Direction == G_RIGHT_DIRECTION) {
Ninja.SpriteInit(20, 120);
} else if ((G_SCREEN_HEIGHT / 2) < Ninja.Clip._y) {
Ninja.SpriteInit(370, 470);
} else {
Ninja.SpriteInit(370, 120);
}
ClipShurikensBonus.gotoAndStop(1);
Ninja.ClearShurikens();
Frame 161
if (Ninja.IsJumping()) {
if (Ninja.IsEndOfJump()) {
if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else {
Ninja.StartFall();
}
} else if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray) && (0 >= Ninja.JumpArray[Ninja.ArrayCounter])) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else {
Ninja.Jump();
}
} else if (Ninja.IsFalling()) {
if (Ninja.IsHittingDeathPlatforms(DeathPlatformsArray)) {
gotoAndPlay (240);
} else if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else {
Ninja.Fall();
}
} else if (Ninja.IsWaitingOnWall()) {
var ValMove = Ninja.GetMovementKey();
Ninja.StartWallJump(ValMove);
} else if (Ninja.IsJumpingFromWall()) {
if (Ninja.IsHittingClip(ClipCeiling1)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.StartFall();
} else if (Ninja.IsHittingWallsArray(ClipWallsArray) && (1 < Ninja.ArrayCounter)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else if (Ninja.IsEndWallJump()) {
Ninja.StartFall();
} else {
Ninja.WallJump();
}
} else if (Ninja.IsThrowingShuriken()) {
Ninja.ContinueThrowShuriken();
if (Ninja.IsEndThrowShuriken()) {
Ninja.CreateShuriken();
}
} else if (Ninja.IsHittingWithSabre()) {
var NumEnemy;
NumEnemy = EnemyHitBySprite(EnemiesArray, Ninja);
if (-1 < NumEnemy) {
ShurikensBonusControl(EnemiesArray[NumEnemy], ClipShurikensBonus);
Text = (EnemiesArray[NumEnemy].Clip._x + " ") + EnemiesArray[NumEnemy].Clip.Enemy._x;
}
Ninja.ContinueSabreHit();
} else {
var ValMove = Ninja.GetMovementKey();
if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
if (Ninja.IsJumpingMove(ValMove)) {
Ninja.StartJump(ValMove);
} else if (Ninja.IsShurikenKeyPressed() && (Ninja.HasShurikens())) {
Ninja.InitThrowShuriken();
Ninja.StartThrowShurikenOnPlatforms();
} else if (Ninja.IsSabreKeyPressedAfterRelease()) {
Ninja.InitSabreHit();
Ninja.StartSabreHitOnPlatforms();
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
var PasX = Ninja.XStep;
Ninja.XStep = 0;
Ninja.Move(ValMove);
Ninja.XStep = PasX;
} else {
Ninja.Move(ValMove);
}
} else {
Ninja.StartFall();
}
}
if (Ninja.IsBlinking()) {
Ninja.ContinueBlink();
} else if (Ninja.IsTouchedByEnemy(EnemiesArray)) {
Ninja.TouchedByEnemyControl();
ClipNinjaTouchedSound.play();
}
Ninja.TestSabreKeyRelease();
EnemiesControl(EnemiesArray);
Ninja.IsGettingShurikens(ClipShurikensBonus);
TextShurikens = "X " + Ninja.NumOfShurikens;
if ((!_root.ClefPorte2) && (Ninja.Clip.hitTest(ClipClef._x, ClipClef._y, true))) {
_root.ClefPorte2 = 1;
ClipClef.gotoAndPlay("FinClef");
}
EnemyHitByShurikensOfSprite(EnemiesArray, Ninja, ClipShurikensBonus);
Ninja.MoveShurikens();
if (!Ninja.NumOfPower) {
gotoAndPlay (240);
}
if (Ninja.IsHittingClip(ClipScreen1)) {
gotoAndPlay (140);
}
if (Ninja.IsHittingClip(ClipScreen2)) {
gotoAndPlay (180);
}
if (Ninja.IsHittingClip(ClipScreen3)) {
gotoAndPlay (180);
}
play();
Frame 162
prevFrame();
Frame 180
if (_root.Porte2) {
ClipPorte2.gotoAndPlay(ClipPorte2._totalframes);
}
if (Ninja.Direction == G_LEFT_DIRECTION) {
Ninja.SpriteInit(375, 470);
} else if ((G_SCREEN_HEIGHT / 2) < Ninja.Clip._y) {
Ninja.SpriteInit(20, 470);
} else {
Ninja.SpriteInit(20, 110);
}
ClipShurikensBonus.gotoAndStop(1);
Ninja.ClearShurikens();
Frame 181
if (Ninja.IsJumping()) {
if (Ninja.IsEndOfJump()) {
if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else {
Ninja.StartFall();
}
} else if (Ninja.IsHittingClip(ClipPorte2)) {
Ninja.Clip._x = Ninja.Clip._x - 20;
Ninja.Move(G_NO_MOVEMENT);
Ninja.StartFall();
} else if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray) && (0 >= Ninja.JumpArray[Ninja.ArrayCounter])) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else {
Ninja.Jump();
}
} else if (Ninja.IsFalling()) {
if (Ninja.IsHittingDeathPlatforms(DeathPlatformsArray)) {
gotoAndPlay (240);
} else if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else {
Ninja.Fall();
}
} else if (Ninja.IsWaitingOnWall()) {
var ValMove = Ninja.GetMovementKey();
Ninja.StartWallJump(ValMove);
} else if (Ninja.IsJumpingFromWall()) {
if (Ninja.IsHittingClip(ClipCeiling1)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.StartFall();
} else if (Ninja.IsHittingWallsArray(ClipWallsArray) && (1 < Ninja.ArrayCounter)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else if (Ninja.IsEndWallJump()) {
Ninja.StartFall();
} else {
Ninja.WallJump();
}
} else if (Ninja.IsThrowingShuriken()) {
Ninja.ContinueThrowShuriken();
if (Ninja.IsEndThrowShuriken()) {
Ninja.CreateShuriken();
}
} else if (Ninja.IsHittingWithSabre()) {
var NumEnemy;
NumEnemy = EnemyHitBySprite(EnemiesArray, Ninja);
if (-1 < NumEnemy) {
ShurikensBonusControl(EnemiesArray[NumEnemy], ClipShurikensBonus);
Text = (EnemiesArray[NumEnemy].Clip._x + " ") + EnemiesArray[NumEnemy].Clip.Enemy._x;
}
Ninja.ContinueSabreHit();
} else {
var ValMove = Ninja.GetMovementKey();
if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
if (Ninja.IsJumpingMove(ValMove)) {
Ninja.StartJump(ValMove);
} else if (Ninja.IsShurikenKeyPressed() && (Ninja.HasShurikens())) {
Ninja.InitThrowShuriken();
Ninja.StartThrowShurikenOnPlatforms();
} else if (Ninja.IsSabreKeyPressedAfterRelease()) {
Ninja.InitSabreHit();
Ninja.StartSabreHitOnPlatforms();
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
var PasX = Ninja.XStep;
Ninja.XStep = 0;
Ninja.Move(ValMove);
Ninja.XStep = PasX;
} else if (Ninja.IsHittingClip(ClipPorte2)) {
if (!_root.ClefPorte2) {
var PasX = Ninja.XStep;
Ninja.XStep = 0;
Ninja.Move(ValMove);
Ninja.XStep = PasX;
} else if (ClipPorte2._currentframe != ClipPorte2._totalframes) {
_root.Porte2 = 1;
ClipPorte2.play();
} else {
Ninja.Move(ValMove);
}
} else {
Ninja.Move(ValMove);
}
} else {
Ninja.StartFall();
}
}
if (Ninja.IsBlinking()) {
Ninja.ContinueBlink();
} else if ((Ninja.IsTouchedByEnemy(EnemiesArray) || (Ninja.IsHittingClip(ClipBat))) || (ClipBat.hitTest(Ninja.Clip._x, Ninja.Clip._y, true))) {
Ninja.TouchedByEnemyControl();
ClipNinjaTouchedSound.play();
}
Ninja.TestSabreKeyRelease();
EnemiesControl(EnemiesArray);
Ninja.IsGettingShurikens(ClipShurikensBonus);
TextShurikens = "X " + Ninja.NumOfShurikens;
if ((!_root.ClefPorte2) && (Ninja.Clip.hitTest(ClipClef._x, ClipClef._y, true))) {
_root.ClefPorte2 = 1;
ClipClef.gotoAndPlay("FinClef");
}
EnemyHitByShurikensOfSprite(EnemiesArray, Ninja, ClipShurikensBonus);
Ninja.MoveShurikens();
if (!Ninja.NumOfPower) {
gotoAndPlay (240);
}
if (Ninja.IsHittingClip(ClipScreen1)) {
gotoAndPlay (160);
}
if (Ninja.IsHittingClip(ClipScreen2)) {
gotoAndPlay (160);
}
if (Ninja.IsHittingClip(ClipScreen3)) {
gotoAndPlay (220);
}
play();
Frame 182
prevFrame();
Frame 200
if (Ninja.Direction == G_RIGHT_DIRECTION) {
Ninja.SpriteInit(20, 460);
} else {
Ninja.SpriteInit(20, 120);
}
ClipShurikensBonus.gotoAndStop(1);
Ninja.ClearShurikens();
Frame 201
if (Ninja.IsJumping()) {
if (Ninja.IsEndOfJump()) {
if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else {
Ninja.StartFall();
}
} else if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray) && (0 >= Ninja.JumpArray[Ninja.ArrayCounter])) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else {
Ninja.Jump();
}
} else if (Ninja.IsSwimming()) {
var ValMove = Ninja.GetMovementKey();
if ((Ninja.IsHittingWallsArray(ClipWallsArray) && (Ninja.IsHittingPlatformsArray(ClipPlatformsArray) && ((ValMove >= G_MOVE_DOWN_LEFT) || (ValMove == G_NO_MOVEMENT)))) || (Ninja.IsHittingClip(ClipCeiling1) && (ValMove < G_NO_MOVEMENT))) {
if (Ninja.IsHittingWater(ClipWater)) {
var PasX = Ninja.XStep;
var PasY = Ninja.YStep;
Ninja.XStep = 0;
Ninja.YStep = 0;
Ninja.Swim(ValMove);
Ninja.YStep = PasY;
Ninja.XStep = PasX;
} else {
Ninja.StartFall();
}
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
if (Ninja.IsHittingWater(ClipWater)) {
var PasX = Ninja.XStep;
Ninja.XStep = 0;
Ninja.Swim(ValMove);
Ninja.XStep = PasX;
} else {
Ninja.StartFall();
}
} else if ((Ninja.IsHittingPlatformsArray(ClipPlatformsArray) && ((ValMove >= G_MOVE_DOWN_LEFT) || (ValMove == G_NO_MOVEMENT))) || (Ninja.IsHittingClip(ClipCeiling1) && (ValMove < G_NO_MOVEMENT))) {
var PasY = Ninja.YStep;
Ninja.YStep = 0;
Ninja.Swim(ValMove);
Ninja.YStep = PasY;
} else if (Ninja.IsHittingWater(ClipWater)) {
Ninja.Swim(ValMove);
} else if (Ninja.IsJumpingMove(ValMove)) {
Ninja.EndSwim();
Ninja.StartJump(ValMove);
} else {
Ninja.StartFall();
}
} else if (Ninja.IsFalling()) {
if (Ninja.IsHittingDeathPlatforms(DeathPlatformsArray)) {
gotoAndPlay (240);
} else if (Ninja.IsHittingWater(ClipWater)) {
Ninja.ApplyPlouf(ClipWater, ClipPlouf);
Ninja.Swim(G_NO_MOVEMENT);
} else if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else {
Ninja.Fall();
}
} else if (Ninja.IsWaitingOnWall()) {
var ValMove = Ninja.GetMovementKey();
Ninja.StartWallJump(ValMove);
} else if (Ninja.IsJumpingFromWall()) {
if (Ninja.IsHittingClip(ClipCeiling2)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.StartFall();
} else if (Ninja.IsHittingWallsArray(ClipWallsArray) && (1 < Ninja.ArrayCounter)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else if (Ninja.IsEndWallJump()) {
Ninja.StartFall();
} else {
Ninja.WallJump();
}
} else if (Ninja.IsThrowingShuriken()) {
Ninja.ContinueThrowShuriken();
if (Ninja.IsEndThrowShuriken()) {
Ninja.CreateShuriken();
}
} else if (Ninja.IsHittingWithSabre()) {
var NumEnemy;
NumEnemy = EnemyHitBySprite(EnemiesArray, Ninja);
if (-1 < NumEnemy) {
ShurikensBonusControl(EnemiesArray[NumEnemy], ClipShurikensBonus);
Text = (EnemiesArray[NumEnemy].Clip._x + " ") + EnemiesArray[NumEnemy].Clip.Enemy._x;
}
Ninja.ContinueSabreHit();
} else {
var ValMove = Ninja.GetMovementKey();
if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
if (Ninja.IsJumpingMove(ValMove)) {
Ninja.StartJump(ValMove);
} else if (Ninja.IsShurikenKeyPressed() && Ninja.HasShurikens()) {
Ninja.InitThrowShuriken();
Ninja.StartThrowShurikenOnPlatforms();
} else if (Ninja.IsSabreKeyPressedAfterRelease()) {
Ninja.InitSabreHit();
Ninja.StartSabreHitOnPlatforms();
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
var PasX = Ninja.XStep;
Ninja.XStep = 0;
Ninja.Move(ValMove);
Ninja.XStep = PasX;
} else if (Ninja.IsHittingClip(ClipPorte2)) {
if (!_root.ClefPorte2) {
var PasX = Ninja.XStep;
Ninja.XStep = 0;
Ninja.Move(ValMove);
Ninja.XStep = PasX;
} else if (ClipPorte2._currentframe != ClipPorte2._totalframes) {
_root.Porte2 = 1;
ClipPorte2.play();
} else {
Ninja.Move(ValMove);
}
} else {
Ninja.Move(ValMove);
}
} else if (Ninja.IsHittingWater(ClipWater)) {
Ninja.Swim(G_NO_MOVEMENT);
} else {
Ninja.StartFall();
}
}
if (Ninja.IsBlinking()) {
Ninja.ContinueBlink();
} else if (Ninja.IsTouchedByEnemy(EnemiesArray)) {
Ninja.TouchedByEnemyControl();
ClipNinjaTouchedSound.play();
}
Ninja.TestSabreKeyRelease();
EnemiesControl(EnemiesArray);
Ninja.IsGettingShurikens(ClipShurikensBonus);
TextShurikens = "X " + Ninja.NumOfShurikens;
if ((!_root.ClefPorte2) && (Ninja.Clip.hitTest(ClipClef._x, ClipClef._y, true))) {
_root.ClefPorte2 = 1;
ClipClef.gotoAndPlay("FinClef");
}
EnemyHitByShurikensOfSprite(EnemiesArray, Ninja, ClipShurikensBonus);
Ninja.MoveShurikens();
if (!Ninja.NumOfPower) {
gotoAndPlay (240);
}
if (Ninja.IsHittingClip(ClipScreen1)) {
gotoAndPlay (180);
}
if (Ninja.IsHittingClip(ClipScreen3)) {
gotoAndPlay (220);
}
play();
Frame 202
prevFrame();
Frame 220
Ninja.SpriteInit(50, 480);
ClipShurikensBonus.gotoAndStop(1);
Ninja.ClearShurikens();
BossPower = 5;
BossBlinkValue = 0;
Frame 221
if (Ninja.IsJumping()) {
if (Ninja.IsEndOfJump()) {
if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else {
Ninja.StartFall();
}
} else if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray) && (0 >= Ninja.JumpArray[Ninja.ArrayCounter])) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else {
Ninja.Jump();
}
} else if (Ninja.IsFalling()) {
if (Ninja.IsHittingDeathPlatforms(DeathPlatformsArray)) {
Ninja.Direction = G_RIGHT_DIRECTION;
Ninja.SpriteInit(G_START_POSITION_X, G_START_POSITION_Y);
gotoAndPlay (40);
} else if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.AdjustClipOnPlatform(ClipPlatformsArray);
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else {
Ninja.Fall();
}
} else if (Ninja.IsWaitingOnWall()) {
var ValMove = Ninja.GetMovementKey();
Ninja.StartWallJump(ValMove);
} else if (Ninja.IsJumpingFromWall()) {
if (Ninja.IsHittingClip(ClipCeiling1)) {
Ninja.Move(G_NO_MOVEMENT);
Ninja.StartFall();
} else if (Ninja.IsHittingWallsArray(ClipWallsArray) && (1 < Ninja.ArrayCounter)) {
Ninja.StartWaitOnWall();
Ninja.AdjustClipOnWall(ClipWallsArray);
} else if (Ninja.IsEndWallJump()) {
Ninja.StartFall();
} else {
Ninja.WallJump();
}
} else if (Ninja.IsThrowingShuriken()) {
Ninja.ContinueThrowShuriken();
if (Ninja.IsEndThrowShuriken()) {
Ninja.CreateShuriken();
}
} else if (Ninja.IsHittingWithSabre()) {
if ((!BossBlinkValue) && (BossHitsBySprite(ClipBossHit, Ninja))) {
BossBlinkValue = G_BOSS_BLINK_VALUE;
BossPower--;
}
Ninja.ContinueSabreHit();
} else {
var ValMove = Ninja.GetMovementKey();
if (Ninja.IsHittingPlatformsArray(ClipPlatformsArray)) {
if (Ninja.IsJumpingMove(ValMove)) {
Ninja.StartJump(ValMove);
} else if (Ninja.IsShurikenKeyPressed() && (Ninja.HasShurikens())) {
Ninja.InitThrowShuriken();
Ninja.StartThrowShurikenOnPlatforms();
} else if (Ninja.IsSabreKeyPressedAfterRelease()) {
Ninja.InitSabreHit();
Ninja.StartSabreHitOnPlatforms();
} else if (Ninja.IsHittingWallsArray(ClipWallsArray)) {
var PasX = Ninja.XStep;
Ninja.XStep = 0;
Ninja.Move(ValMove);
Ninja.XStep = PasX;
} else if (Ninja.IsHittingClip(ClipPorte2)) {
if (!_root.ClefPorte2) {
var PasX = Ninja.XStep;
Ninja.XStep = 0;
Ninja.Move(ValMove);
Ninja.XStep = PasX;
} else if (ClipPorte2._currentframe != ClipPorte2._totalframes) {
_root.Porte2 = 1;
ClipPorte2.play();
} else {
Ninja.Move(ValMove);
}
} else {
Ninja.Move(ValMove);
}
} else {
Ninja.StartFall();
}
}
if (Ninja.IsBlinking()) {
Ninja.ContinueBlink();
} else if (SpriteHitsByBoss(ClipBossHit, Ninja)) {
Ninja.TouchedByEnemyControl();
ClipNinjaTouchedSound.play();
}
Ninja.TestSabreKeyRelease();
TextShurikens = "X " + Ninja.NumOfShurikens;
TextScore = ScoreNinja;
if ((!_root.ClefPorte2) && (Ninja.Clip.hitTest(ClipClef._x, ClipClef._y, true))) {
_root.ClefPorte2 = 1;
ClipClef.gotoAndPlay("FinClef");
}
if (0 >= BossPower) {
gotoAndPlay (280);
}
if ((!BossBlinkValue) && (BossHitsByShurikens(BossHitMovieClip, Ninja.ShurikensArray))) {
BossBlinkValue = G_BOSS_BLINK_VALUE;
BossPower--;
}
if (BossBlinkValue) {
BossBlinkValue = ContinueBossBlink(ClipBoss, BossBlinkValue);
}
ClipBossHit.gotoAndStop(ClipBoss._currentframe);
if (!Ninja.NumOfPower) {
gotoAndPlay (240);
}
Ninja.MoveShurikens();
play();
Frame 222
prevFrame();
Frame 240
Ninja.NumOfLives--;
if (!Ninja.NumOfLives) {
gotoAndPlay (280);
} else {
Ninja.NumOfPower = Ninja.MaxOfPOwer;
gotoAndPlay (40);
}
Frame 241
_root.TextLives = "X " + (Ninja.NumOfLives + 1);
Frame 265
_root.TextLives = "X " + Ninja.NumOfLives;
Frame 279
Ninja.Direction = G_RIGHT_DIRECTION;
Ninja.SpriteInit(G_START_POSITION_X, G_START_POSITION_Y);
gotoAndPlay (40);
Frame 280
Ninja.NumOfLives--;
Ninja.NumOfPower = Ninja.MaxOfPOwer;
delete Ninja;
delete ClipPlatformsArray;
delete ClipWallsArray;
delete Enemy1;
delete Enemy2;
delete Enemy3;
delete Enemy4;
delete Enemy5;
delete EnemiesArray;
delete DeathPlatformsArray;
stop();
Frame 319
Frame 320
delete Ninja;
delete ClipPlatformsArray;
delete ClipWallsArray;
delete Enemy1;
delete Enemy2;
delete Enemy3;
delete Enemy4;
delete Enemy5;
delete EnemiesArray;
delete DeathPlatformsArray;
TextScore = ScoreNinja;
stop();
Frame 359
gotoAndPlay (320);
Frame 361
ifFrameLoaded (1110) {
gotoAndPlay (1110);
}
play();
Frame 362
prevFrame();
Frame 637
stopAllSounds();
Frame 1020
stopAllSounds();
gotoAndPlay (1021);
Frame 1031
stopAllSounds();
stop();
Frame 1038
stop();
Frame 1044
gotoAndStop (1031);
Frame 1051
stop();
Frame 1057
gotoAndStop (1031);
Frame 1080
gotoAndPlay (363);
Frame 1100
gotoAndPlay (7);
Frame 1109
stop();
Frame 1111
_root.p1 = 0;
Frame 1112
if (Number(p1) == 0) {
RandP1 = random(50) + 1;
if (Number(RandP1) == 1) {
setProperty("/bebete", _x , 148);
setProperty("/bebete", _y , 400);
tellTarget ("/bebete") {
play();
};
}
if (Number(RandP1) == 2) {
setProperty("/bebete", _x , 207);
setProperty("/bebete", _y , 400);
tellTarget ("/bebete") {
play();
};
}
if (Number(RandP1) == 3) {
setProperty("/bebete", _x , 247);
setProperty("/bebete", _y , 400);
tellTarget ("/bebete") {
play();
};
}
if (Number(RandP1) == 4) {
setProperty("/bebete", _x , 312);
setProperty("/bebete", _y , 400);
tellTarget ("/bebete") {
play();
};
}
if (Number(RandP1) == 5) {
setProperty("/bebete", _x , 60);
setProperty("/bebete", _y , 360);
tellTarget ("/bebete") {
play();
};
}
}
ifFrameLoaded (1020) {
gotoAndPlay (363);
}
play();
Frame 1113
prevFrame();
Symbol 27 MovieClip Frame 177
stop();
Symbol 52 MovieClip Frame 1
var Boucle = 12;
Symbol 52 MovieClip Frame 61
Boucle--;
Symbol 52 MovieClip Frame 73
if (Boucle) {
gotoAndPlay (61);
} else {
gotoAndPlay (1);
}
Symbol 103 MovieClip Frame 23
gotoAndPlay (3);
Symbol 114 MovieClip Frame 1
stop();
Symbol 123 MovieClip Frame 1
stop();
Symbol 123 MovieClip Frame 9
stop();
Symbol 124 MovieClip Frame 50
gotoAndPlay (10);
Symbol 125 MovieClip Frame 50
gotoAndPlay (10);
Symbol 126 MovieClip Frame 69
gotoAndPlay (10);
Symbol 131 MovieClip Frame 70
gotoAndPlay (1);
Symbol 132 MovieClip Frame 70
gotoAndPlay (1);
Symbol 135 MovieClip Frame 1
stop();
Symbol 135 MovieClip Frame 35
gotoAndPlay (15);
Symbol 135 MovieClip Frame 47
stop();
Symbol 154 MovieClip Frame 23
stop();
Symbol 160 MovieClip Frame 21
gotoAndPlay (1);
Symbol 160 MovieClip Frame 31
stop();
Symbol 169 MovieClip Frame 1
stop();
Symbol 169 MovieClip Frame 3
stop();
Symbol 171 MovieClip Frame 1
stop();
Symbol 171 MovieClip Frame 11
stop();
Symbol 225 MovieClip Frame 11
stop();
Symbol 236 MovieClip Frame 23
stop();
Symbol 245 MovieClip Frame 1
var RAND_SHOOT = 5;
var RAND_MEGA_SHOOT = 10;
var NbRand = 0;
Symbol 245 MovieClip Frame 26
NbRand = Math.floor(Math.random() * RAND_SHOOT);
if (!NbRand) {
gotoAndPlay (46);
}
Symbol 245 MovieClip Frame 36
NbRand = Math.floor(Math.random() * RAND_SHOOT);
if (!NbRand) {
gotoAndPlay (76);
}
Symbol 245 MovieClip Frame 45
NbRand = Math.floor(Math.random() * RAND_MEGA_SHOOT);
if (!NbRand) {
gotoAndPlay (107);
} else {
gotoAndPlay (26);
}
Symbol 245 MovieClip Frame 75
gotoAndPlay (26);
Symbol 245 MovieClip Frame 106
gotoAndPlay (36);
Symbol 245 MovieClip Frame 149
gotoAndPlay (20);
Symbol 279 Button
on (release) {
gotoAndPlay (1021);
}
Symbol 294 MovieClip Frame 1
stop();
Symbol 294 MovieClip Frame 2
stop();
Symbol 297 Button
on (release) {
RadioMF.play();
}
Symbol 302 Button
on (release) {
gotoAndPlay (1021);
}
Symbol 319 MovieClip Frame 70
stop();
Symbol 494 MovieClip Frame 13
stop();
Symbol 506 MovieClip Frame 24
stop();
Symbol 513 MovieClip Frame 15
stop();
Symbol 522 Button
on (release) {
gotoAndPlay (1045);
}
Symbol 524 Button
on (release) {
gotoAndPlay (363);
}
Symbol 526 Button
on (release) {
gotoAndPlay (1032);
}
Symbol 529 Button
on (release) {
gotoAndPlay (1081);
}
Symbol 530 Button
on (release) {
gotoAndPlay (1058);
}
Symbol 536 Button
on (release) {
play();
}
Symbol 576 MovieClip Frame 4
stop();
Symbol 578 MovieClip Frame 5
stop();
Symbol 582 Button
on (release) {
gotoAndPlay (1);
}
Symbol 596 Button
on (press) {
_root.scoreLoading++;
gotoAndPlay (25);
}
Symbol 600 MovieClip Frame 1
_root.p1 = 0;
stop();
Symbol 600 MovieClip Frame 2
_root.p1 = 1;
play();
Symbol 600 MovieClip Frame 24
if (_root.scoreLoading != 0) {
_root.scoreLoading--;
}
gotoAndStop (1);
Symbol 600 MovieClip Frame 25
play();
Symbol 600 MovieClip Frame 29
gotoAndStop (1);