Frame 1
Stage.scaleMode = "showAll";
Mouse.show();
Stage.showMenu = false;
Mouse.show();
Instance of Symbol 72 MovieClip [duel] "duel" in Frame 2
on (press) {
}
Instance of Symbol 63 MovieClip [solo] "solo" in Frame 2
on (press) {
}
Instance of Symbol 191 MovieClip "TypeLight" in Frame 2
on (press) {
this.gotoAndStop("ON");
_root.TypeNormal.gotoAndStop("OFF");
_root.TypeHeavy.gotoAndStop("OFF");
_root.BallType = 3;
}
Instance of Symbol 194 MovieClip "TypeNormal" in Frame 2
on (press) {
this.gotoAndStop("ON");
_root.TypeLight.gotoAndStop("OFF");
_root.TypeHeavy.gotoAndStop("OFF");
_root.BallType = 2;
}
Instance of Symbol 197 MovieClip "TypeHeavy" in Frame 2
on (press) {
this.gotoAndStop("ON");
_root.TypeNormal.gotoAndStop("OFF");
_root.TypeLight.gotoAndStop("OFF");
_root.BallType = 1;
}
Instance of Symbol 200 MovieClip "practice" in Frame 2
on (press) {
this.gotoAndStop("ON");
_root.duel.gotoAndStop("OFF");
_root.solo.gotoAndStop("OFF");
_root.GameMode = 3;
}
Frame 20
Mouse.show();
MenuMusic = new Sound();
MenuMusic.attachSound("MenuBGM");
MenuMusic.start(0, 999);
if (_root.GameMode == 2) {
duel.gotoAndStop("ON");
practice.gotoAndStop("OFF");
} else if (_root.GameMode == 3) {
practice.gotoAndStop("ON");
duel.gotoAndStop("OFF");
}
if (_root.BallType == 3) {
TypeLight.gotoAndStop("ON");
TypeNormal.gotoAndStop("OFF");
TypeHeavy.gotoAndStop("OFF");
} else if (_root.BallType == 2) {
TypeLight.gotoAndStop("OFF");
TypeNormal.gotoAndStop("ON");
TypeHeavy.gotoAndStop("OFF");
} else if (_root.BallType == 1) {
TypeLight.gotoAndStop("OFF");
TypeNormal.gotoAndStop("OFF");
TypeHeavy.gotoAndStop("ON");
}
Frame 80
PracticeMusic = new Sound();
PracticeMusic.attachSound("PracticeBGM");
PracticeMusic.start(0, 999);
PracticeMusic2 = new Sound();
PracticeMusic2.attachSound("BentoBGM");
PracticeMusic3 = new Sound();
PracticeMusic3.attachSound("Bento2BGM");
stop();
Frame 81
function init() {
Stage.showMenu = false;
Stage.scaleMode = "showAll";
Mouse.hide();
frictionAirX = 0.99;
frictionAirY = 0.8;
gravity = 1;
sine_lookup_table = "0.000/.0175/.0349/.0523/.0698/.0872/.1045/.1219/.1392/.1564/.1736/.1908/.2079/.2250/.2419/.2588/.2756/.2924/.3090/.3256/.3420/.3584/.3746/.3907/.4067/.4226/.4384/.4540/.4695/.4848/.5000/.5150/.5299/.5446/.5592/.5736/.5878/.6018/.6157/.6428/.6561/.6691/.6820/.6947/.7071/.7193/.7314/.7431/.7547/.7660/.7771/.7880/.7986/.8090/.8192/.8290/.8387/.8480/.8572/.8660/.8746/.8829/.8910/.8988/.9063/.9135/.9205/.9272/.9336/.9397/.9455/.9511/.9563/.9613/.9659/.9703/.9744/.9781/.9816/.9848/.9877/.9903/.9925/.9945/.9962/.9976/.9986/.9994/.9998/1.000";
PlayerMass = 1;
Ball._xscale = 50;
Ball._yscale = 50;
if (BallType == 3) {
BallMass = 0.5;
} else if (BallType == 2) {
BallMass = 1;
} else if (BallType == 1) {
BallMass = 1.5;
}
BallSize = Ball._xscale;
ServeDistX = target._x - Ball._x;
ServeMovX = ServeDistX / 7;
ServeDistY = target._y - Ball._y;
ServeMovY = ServeDistY / 7;
BallVelX = 0;
BallVelY = -15;
BallWeight = BallMass * gravity;
BallAccel = BallForce / BallMass;
BallRestX = false;
BallRestY = false;
BallRest = false;
BallEnergy = 30;
BallTag = 1;
meleeflash._visible = false;
PlayerVelX = 0;
PlayerVelY = 0;
PlayerForce = 0;
PlayerWeight = PlayerMass * gravity;
PlayerRestX = true;
PlayerRestY = true;
PlayerRest = true;
PlayerHealth = 100;
PlayerStamina = 1;
PlayerPower = 100;
PlayerCombo = 0;
PlayerMaxCombo = 0;
ATTACK = false;
HURT = false;
HURTfront = false;
HURTback = false;
DEAD = false;
NEUTRAL = true;
CHARGE = false;
TELEPORT = false;
INVINCIBLE = false;
PlayerFacingL = false;
PlayerFacingR = true;
aura._alpha = 0;
spriteINVINC._visible = false;
EnemyHURT = false;
EnemyATTACK = false;
EnemyDEAD = false;
EnemyNEUTRAL = true;
EnemyHealth = 100;
TrainerATTACK = false;
TrainerNEUTRAL = true;
TrainerATTACK2 = false;
TrainerNEUTRAL2 = true;
StaminaHUD._height = 1;
PlayerHealthHUD._visible = true;
BallEnergyHUD._visible = true;
combodisplay._alpha = 0;
combodisplay2._visible = false;
GAMEOVER._visible = false;
GAMEOVER2._visible = false;
BallEnergyHUD.onEnterFrame = engineENERGY();
Ball.onEnterFrame = engineBALL;
Trainer.onEnterFrame = engineTRAINER;
Player.onEnterFrame = enginePLAYER;
Player.onMouseDown = enginePOWER;
Player.onMouseUp = engineATTACK;
DefendListener = new Object();
DefendListener.onKeyUp = engineDEFEND;
Key.addListener(DefendListener);
}
function engineBALL() {
BallWeight = BallMass * gravity;
BallEnergy2 = Math.round(BallEnergy);
BallSize = Ball._xscale;
if ((BallVelX >= 1) or (BallVelX <= -1)) {
BallRestX = false;
} else {
BallRestX = true;
}
if ((BallVelY >= 1) or (BallVelY <= -1)) {
BallRestY = false;
} else {
BallRestY = true;
}
if ((BallRestX == true) && (BallRestY == true)) {
BallRest = true;
} else {
BallRest = false;
}
if (BallEnergy > 0) {
BallEnergy = BallEnergy - 0.05;
}
if (BallEnergy > 100) {
BallEnergy = 100;
}
if (BallEnergy < 0) {
BallEnergy = 0;
}
if (Ball._xscale > BallSize) {
Ball._xscale = Ball._xscale - 0.1;
Ball._yscale = Ball._yscale - 0.1;
}
if (!this.hitTest(ground)) {
if ((BallVelY < 20) && (!this.hitTest(ground))) {
BallVelY = BallVelY + BallWeight;
}
}
if (BallRestX == false) {
if (BallVelX != 0) {
BallVelX = BallVelX * frictionAirX;
}
if ((BallVelX < 1) && (BallVelX > -1)) {
BallVelX = 0;
BallRestX = true;
}
}
this._rotation = this._rotation + (BallVelX * 4);
if (this.hitTest(ground)) {
BallEnergy = BallEnergy * 0.95;
}
if (this.hitTest(ground) && (BallVelY > 0)) {
PlayerCombo = 0;
if (BallVelY >= 5) {
BallVelY = BallVelY * -0.75;
} else if (BallVelY < 5) {
BallVelY = -(Math.round(BallVelY) * 0.3);
}
if ((BallVelY < 1) && (BallVelY >= 0)) {
BallVelY = 0;
BallRestY = true;
}
}
if ((this.hitTest(ground) && (BallVelY > -1)) && (BallVelY < 0)) {
BallVelY = 0;
BallRestY = true;
}
if (this.hitTest(wallRIGHT) && (BallVelX > 0)) {
this._x = this._x - 1;
BallVelX = -BallVelX;
}
if (this.hitTest(wallLEFT) && (BallVelX < 0)) {
this._x = this._x + 1;
BallVelX = BallVelX * -1;
}
if (this.hitTest(wallTOP) && (BallVelY < 0)) {
this._y = this._y + 1;
BallVelY = BallVelY * -1;
}
if (BallVelX > 50) {
BallVelX = 49;
}
if (BallVelX < -50) {
BallVelX = -49;
}
if (BallVelY > 50) {
BallVelY = 49;
}
if (BallVelY < -50) {
BallVelY = -49;
}
this._x = this._x + BallVelX;
this._y = this._y + BallVelY;
BallShadow._x = this._x;
BallShadow._xscale = this._y / 3;
if (BallEnergy < 2) {
this.GotoAndStop("NORMAL");
}
if (BallTag == 1) {
if ((BallEnergy < 30) && (BallEnergy >= 2)) {
this.GotoAndStop("WARM1");
}
if ((BallEnergy < 90) && (BallEnergy >= 30)) {
this.GotoAndStop("HOT1");
}
if (BallEnergy >= 90) {
this.GotoAndStop("CHARGED1");
}
} else if (BallTag == 2) {
if ((BallEnergy < 30) && (BallEnergy >= 2)) {
this.GotoAndStop("WARM2");
}
if ((BallEnergy < 90) && (BallEnergy >= 30)) {
this.GotoAndStop("HOT2");
}
if (BallEnergy >= 90) {
this.GotoAndStop("CHARGED2");
}
}
}
function enginePLAYER() {
Xdist = Math.round(target._x - Player._x);
Ydist = Math.round(target._y - Player._y);
PlayerWeight = PlayerMass * gravity;
hyp = Math.sqrt((Xdist * Xdist) + (Ydist * Ydist));
PlayerHealth = Math.round(PlayerHealth);
aura._x = this._x;
aura._y = this._y;
TeleportSprite._x = this._x;
TeleportSprite._y = this._y;
if ((PlayerVelY != 0) && (PlayerVelX == 0)) {
TeleportSprite._rotation = 90;
} else if (PlayerVelY == 0) {
TeleportSprite._rotation = 0;
} else if ((PlayerVelY > 0) && (PlayerVelX != 0)) {
TeleportSprite._rotation = PlayerVelY + PlayerVelX;
} else if ((PlayerVelY < 0) && (PlayerVelX != 0)) {
TeleportSprite._rotation = PlayerVelY - PlayerVelX;
}
PowerBAR._height = PlayerForce;
if (PlayerForce >= 100) {
PowerBAR._height = 100;
}
if (ATTACK == true) {
TELEPORT = false;
PowerBAR._alpha = PowerBAR._alpha * 0.8;
}
if (CHARGE == true) {
ATTACK = false;
aura._rotation = AR;
if (PlayerVelY >= 0) {
AR = -(PlayerVelX * 4);
}
if ((PlayerVelY < 0) && (PlayerVelX != 0)) {
AR = -(PlayerVelX * 7);
}
if ((PlayerVelY < 0) && (PlayerVelX == 0)) {
AR = 180;
}
if (PlayerForce < PlayerStamina) {
if (INVINCIBLE == false) {
aura._alpha = aura._alpha + 3;
PlayerForce = PlayerForce + 3;
PlayerPower = PlayerPower - 1;
} else if (INVINCIBLE == true) {
aura._alpha = aura._alpha + 10;
PlayerForce = PlayerForce + 10;
PlayerPower = PlayerPower - 1;
}
}
} else {
aura._alpha = aura._alpha * 0.95;
}
if ((ATTACK == false) && (CHARGE == false)) {
PlayerForce = 0;
PlayerPower = 101;
}
if (((PlayerStamina < 100) && (DEAD == false)) && (INVINCIBLE == false)) {
PlayerStamina = PlayerStamina + 1;
} else if (((PlayerStamina < 100) && (DEAD == false)) && (INVINCIBLE == true)) {
PlayerStamina = PlayerStamina + 10;
}
StaminaBar._height = PlayerStamina;
if (PlayerStamina < 0) {
PlayerStamina = 0;
}
if (BallTag == 1) {
BallEnergyHUD.EnergyHUD._x = (-BallEnergy) / 2;
}
if (BallTag == 2) {
BallEnergyHUD.EnergyHUD._x = BallEnergy / 2;
}
if (BallTag == 0) {
BallEnergyHUD.EnergyHUD._x = 0;
}
if (PlayerMaxCombo < PlayerCombo) {
PlayerMaxCombo = PlayerCombo;
}
if (PlayerCombo >= 2) {
n = 0;
PlayerComboHUD = PlayerCombo;
combodisplay._alpha = 100;
combodisplay.gotoAndStop(1);
combodisplay2.textColor = 16777215 /* 0xFFFFFF */;
combodisplay2._visible = true;
} else {
n = n + 1;
combodisplay.gotoAndStop(2);
combodisplay2.textColor = 16711680 /* 0xFF0000 */;
if (n > 50) {
combodisplay2._visible = false;
combodisplay._alpha = combodisplay._alpha * 0.9;
}
}
if (PlayerHealthHUD._xscale > 0) {
PlayerHealthHUD._xscale = PlayerHealth / 2;
PlayerHealthHUD._yscale = PlayerHealthHUD._xscale;
}
if (PlayerHealth > 90) {
PlayerHealthHUD.gotoAndStop(1);
} else if ((PlayerHealth > 80) && (PlayerHealth <= 90)) {
PlayerHealthHUD.gotoAndStop(2);
} else if ((PlayerHealth > 70) && (PlayerHealth <= 80)) {
PlayerHealthHUD.gotoAndStop(3);
} else if ((PlayerHealth > 60) && (PlayerHealth <= 70)) {
PlayerHealthHUD.gotoAndStop(4);
} else if ((PlayerHealth > 50) && (PlayerHealth <= 60)) {
PlayerHealthHUD.gotoAndStop(5);
} else if ((PlayerHealth > 40) && (PlayerHealth <= 50)) {
PlayerHealthHUD.gotoAndStop(6);
} else if ((PlayerHealth > 30) && (PlayerHealth <= 40)) {
PlayerHealthHUD.gotoAndStop(7);
} else if ((PlayerHealth > 20) && (PlayerHealth <= 30)) {
PlayerHealthHUD.gotoAndStop(8);
} else if ((PlayerHealth > 10) && (PlayerHealth <= 20)) {
PlayerHealthHUD.gotoAndStop(9);
}
if ((PlayerVelX >= 1) || (PlayerVelX <= -1)) {
PlayerRestX = false;
}
if ((PlayerVelY >= 1) || (PlayerVelY <= -1)) {
PlayerRestY = false;
}
if ((PlayerRestX == true) && (PlayerRestY == true)) {
PlayerRest = true;
} else {
PlayerRest = false;
}
if ((PlayerRestY == false) && (EnemyDEAD == false)) {
if ((PlayerVelY < 30) && (!Player.hitTest(ground))) {
PlayerVelY = PlayerVelY + PlayerWeight;
}
}
if ((PlayerRestX == false) && (EnemyDEAD == false)) {
if (PlayerVelX != 0) {
PlayerVelX = PlayerVelX * 0.9;
}
if ((PlayerVelX < 1) && (PlayerVelX > -1)) {
PlayerVelX = 0;
PlayerRestX = true;
}
}
if (Player.hitTest(ground)) {
if (PlayerVelY > 0) {
PlayerVelY = 0;
this._y = 310;
PlayerRestY = true;
}
if (HURTback == true) {
this.gotoAndPlay("HITground");
} else if (HURTfront == true) {
this.gotoAndPlay("HITground2");
}
if (ATTACK == true) {
PlayerVelX = 0;
TELEPORT = false;
PowerBAR._alpha = PowerBAR._alpha * 0.8;
}
}
if (Player.hitTest(wallRIGHT) && (PlayerVelX > 1)) {
Player._x = Player._x - 1;
PlayerVelX = PlayerVelX * -0.5;
if (HURTfront == true) {
this.gotoAndPlay("HURTback");
HURTback = true;
HURTfront = false;
} else if (HURTback == true) {
this.gotoAndPlay("HURTfront");
HURTback = false;
HURTfront = true;
}
}
if (Player.hitTest(wallMIDDLE) && (PlayerVelX > 1)) {
Player._x = Player._x - 1;
PlayerVelX = PlayerVelX * -0.5;
}
if (Player.hitTest(wallLEFT) && (PlayerVelX < 0)) {
Player._x = Player._x + 1;
PlayerVelX = PlayerVelX * -0.5;
if (HURTfront == true) {
this.gotoAndPlay(206);
HURTback = true;
HURTfront = false;
WallImpactSound = new Sound();
WallImpactSound.attachSound("wallIMPACT");
WallImpactSound.start();
} else if (HURTback == true) {
this.gotoAndPlay(239);
HURTback = false;
HURTfront = true;
}
}
if (Player.hitTest(wallTOP) && (PlayerVelY < 1)) {
Player._y = Player._y + 1;
PlayerVelY = PlayerVelY * -0.5;
}
if ((((((HURT == false) && (DEAD == false)) && (EnemyDEAD == false)) && (Key.isDown(87))) && (!Key.isDown(65))) && (!Key.isDown(68))) {
if ((ATTACK == false) && (TELEPORT == false)) {
this.gotoAndPlay("FLYup");
}
if (this.hitTest(ground)) {
PlayerVelY = -5;
}
if ((this._y > wallTOP._y) && (PlayerVelY > -3)) {
PlayerVelY = PlayerVelY - 1.1;
}
}
if (((((!this.hitTest(ground)) && (HURT == false)) && (DEAD == false)) && (Key.isDown(83))) && (EnemyDEAD == false)) {
PlayerVelY = PlayerVelY + 1.5;
}
if (((((((((!this.hitTest(ground)) && (HURT == false)) && (DEAD == false)) && (ATTACK == false)) && (TELEPORT == false)) && (Key.isDown(83))) && (!Key.isDown(65))) && (!Key.isDown(68))) && (EnemyDEAD == false)) {
this.gotoAndPlay("FLYdown");
}
if ((((HURT == false) && (DEAD == false)) && (this._x < target._x)) && (EnemyDEAD == false)) {
if (Key.isDown(87)) {
PlayerVelY = PlayerVelY - 2;
}
if ((Key.isDown(65) && (this._x > wallLEFT._x)) && (PlayerVelX > -20)) {
PlayerVelX = PlayerVelX - 5;
}
if ((Key.isDown(65) && (ATTACK == false)) && (TELEPORT == false)) {
this.gotoAndPlay("FLYbackward");
}
if ((Key.isDown(68) && (this._x < 800)) && (PlayerVelX < 20)) {
PlayerVelX = PlayerVelX + 5;
}
if ((Key.isDown(68) && (ATTACK == false)) && (TELEPORT == false)) {
this.gotoAndPlay("FLYforward");
}
} else if ((((HURT == false) && (DEAD == false)) && (EnemyDEAD == false)) && (this._x != target._x)) {
if (Key.isDown(87)) {
PlayerVelY = PlayerVelY - 2;
}
if ((Key.isDown(65) && (this._x > wallLEFT._x)) && (PlayerVelX > -20)) {
PlayerVelX = PlayerVelX - 5;
}
if ((Key.isDown(65) && (ATTACK == false)) && (TELEPORT == false)) {
this.gotoAndPlay("FLYforward");
}
if ((Key.isDown(68) && (this._x < 800)) && (PlayerVelX < 20)) {
PlayerVelX = PlayerVelX + 5;
}
if ((Key.isDown(68) && (ATTACK == false)) && (TELEPORT == false)) {
this.gotoAndPlay("FLYbackward");
}
}
if ((((((((HURT == false) && (DEAD == false)) && (EnemyDEAD == false)) && (!Key.isDown(68))) && (!Key.isDown(65))) && (!Key.isDown(87))) && (ATTACK == false)) && (TELEPORT == false)) {
NEUTRAL = true;
if ((!this.hitTest(ground)) && (!Key.isDown(83))) {
this.gotoAndPlay("FALL");
Player.onEnterFrame = enginePLAYER;
} else if (this.hitTest(ground)) {
this.gotoAndPlay("IDLE");
PlayerVelX = PlayerVelX * 0.7;
}
} else {
NEUTRAL = false;
}
if (((((this.HITBOX.hitTest(Ball) && (BallTag > 10)) && (ATTACK == false)) && (HURT == false)) && (BallEnergy >= 30)) && (INVINCIBLE == false)) {
HURT = true;
CHARGE = false;
aura._alpha = 0;
PlayerForce = 0;
target._visible = false;
PlayerCombo = 0;
PlayerHealth = PlayerHealth - BallEnergy;
PlayerVelX = PlayerVelX + (BallVelX / 2);
PlayerVelY = -5;
Ball._xscale = BallSize;
Ball._yscale = BallSize;
ChargeSound.stop("ChargePush");
ImpactSound = new Sound();
ImpactSound.attachSound("impactHURT");
PainSound = new Sound();
PainSound.attachSound("painHURT");
if (((PlayerFacingR == true) && (BallVelX > 0)) && (BallEnergy < 90)) {
this.gotoAndPlay("HURTback");
HURTback = true;
BallEnergy = BallEnergy / 3;
ImpactSound.start();
PainSound.start();
}
if (((PlayerFacingL == true) && (BallVelX < 0)) && (BallEnergy < 90)) {
this.gotoAndPlay("HURTback");
HURTback = true;
BallEnergy = BallEnergy / 3;
ImpactSound.start();
PainSound.start();
}
if (((PlayerFacingR == true) && (BallVelX < 0)) && (BallEnergy < 90)) {
this.gotoAndPlay("HURTfront");
HURTfront = true;
BallEnergy = BallEnergy / 3;
ImpactSound.start();
PainSound.start();
}
if (((PlayerFacingL == true) && (BallVelX > 0)) && (BallEnergy < 90)) {
this.gotoAndPlay("HURTfront");
HURTfront = true;
BallEnergy = BallEnergy / 3;
ImpactSound.start();
PainSound.start();
}
if (BallEnergy >= 90) {
GAMEOVER.gotoAndPlay(1);
this.gotoAndPlay("DIE");
Enemy.gotoAndPlay("I WIN");
bg.bg.gotoAndPlay(85);
Mouse.show();
Ball._visible = false;
BallShadow._visible = false;
PlayerShadow._visible = false;
BallEnergy = 0;
PlayerHealth = 0;
PlayerVelX = 0;
PlayerVelY = 0;
PlayerMass = 0;
}
if (((BallVelX == 0) && (BallVelY < 0)) && (BallEnergy < 90)) {
this.gotoAndPlay("HURTfront");
HURTfront = true;
BallEnergy = BallEnergy / 3;
ImpactSound.start();
PainSound.start();
} else if (((BallVelX == 0) && (BallVelY > 0)) && (BallEnergy < 90)) {
this.gotoAndPlay("HURTback");
HURTback = true;
BallEnergy = BallEnergy / 3;
ImpactSound.start();
PainSound.start();
}
}
if ((PlayerHealth < 1) && (DEAD == false)) {
GAMEOVER._visible = true;
GAMEOVER.play();
PlayerHealthHUD._visible = false;
DEAD = true;
bg.bg.play();
Bar._visible = false;
BallEnergyHUD._visible = false;
Mouse.show();
}
if (this.AttackBox.hitTest(Ball)) {
BallTag = 1;
if (HIT == false) {
PlayerCombo = PlayerCombo + 1;
meleeflash._visible = true;
meleeflash._x = Ball._x;
meleeflash._y = Ball._y;
if (PlayerForce <= 25) {
meleeflash.gotoAndPlay("STALL");
} else if ((PlayerForce <= 50) && (PlayerForce > 25)) {
meleeflash.gotoAndPlay("KICK");
} else if ((PlayerForce < 100) && (PlayerForce > 50)) {
meleeflash.gotoAndPlay("PUNCH");
} else if (PlayerForce >= 100) {
meleeflash.gotoAndPlay("POWER");
}
if ((PlayerCombo > 1) && (PlayerHealth < 100)) {
PlayerHealth = PlayerHealth + 1;
}
HIT = true;
}
if ((ATTACK == true) && (PlayerForce >= 25)) {
z = PlayerForce / 300;
xmov = Xdist * z;
ymov = Ydist * z;
BallVelX = BallVelX + xmov;
BallVelY = BallVelY + ymov;
ChargeRate = 3 * Difficulty;
BallEnergy = BallEnergy + ((PlayerForce / ChargeRate) * (PlayerCombo + 1));
}
if ((ATTACK == true) && (PlayerForce < 25)) {
z = PlayerForce / 100;
xmov = Xdist * z;
ymov = Ydist * z;
BallVelX = xmov;
BallVelY = ymov;
BallEnergy = BallEnergy + (PlayerForce / 5);
}
}
if (this.SHIELD.hitTest(Ball)) {
PlayerCombo = 0;
meleeflash._visible = true;
meleeflash._x = Ball._x;
meleeflash._y = Ball._y;
if (hyp <= 70) {
meleeflash.gotoAndPlay("STALL");
} else if ((hyp <= 140) && (hyp > 70)) {
meleeflash.gotoAndPlay("KICK");
} else if ((hyp <= 210) && (hyp > 140)) {
meleeflash.gotoAndPlay("PUNCH");
} else if (hyp > 210) {
meleeflash.gotoAndPlay("POWER");
}
if ((ATTACK == true) && (hyp >= 70)) {
xmov = Xdist / 7;
ymov = Ydist / 7;
BallVelX = xmov;
BallVelY = ymov;
BallEnergy = BallEnergy - PlayerForce;
}
}
if (this.SHIELD.hitTest(Trainer)) {
TrainerATTACK = true;
}
if ((((HURT == false) && (DEAD == false)) && (ATTACK == false)) && (EnemyDEAD == false)) {
startDrag ("/target", true);
Mouse.hide();
target._visible = true;
target._alpha = 100;
} else {
stopDrag();
Mouse.show();
target._alpha = 10;
}
if (PlayerForce <= 25) {
target.GotoAndStop("SOFT");
}
if ((PlayerForce <= 50) && (PlayerForce > 25)) {
target.GotoAndStop("MEDIUM");
}
if ((PlayerForce < 100) && (PlayerForce > 50)) {
target.GotoAndStop("HARD");
}
if (PlayerForce >= 100) {
target.GotoAndStop("POWER");
}
Player._x = Player._x + PlayerVelX;
Player._y = Player._y + PlayerVelY;
if ((((this._x > target._x) && (HURT == false)) && (ATTACK == false)) && (DEAD == false)) {
this._xscale = -100;
PlayerFacingL = true;
PlayerFacingR = false;
} else if ((((this._x < target._x) && (HURT == false)) && (ATTACK == false)) && (DEAD == false)) {
this._xscale = 100;
PlayerFacingR = true;
PlayerFacingL = false;
}
PlayerShadow._x = Player._x;
PlayerShadow._xscale = Player._y / 2;
}
function enginePOWER() {
if ((((HURT == false) && (DEAD == false)) && (EnemyDEAD == false)) && (PlayerForce <= PlayerEnergy)) {
CHARGE = true;
PowerBAR._alpha = 100;
PlayerForce = 0;
ChargeSound = new Sound();
ChargeSound.attachSound("ChargePush");
ChargeSound.start(1);
}
}
function engineATTACK() {
if (((HURT == false) && (DEAD == false)) && (ATTACK == false)) {
ATTACK = true;
CHARGE = false;
PlayerStamina = PlayerStamina - PlayerForce;
aura._alpha = aura._alpha * 0.5;
ChargeSound.stop("ChargePush");
if (target._y <= Player._y) {
if (PlayerForce <= 25) {
Player.GotoAndPlay("hitUP1");
}
if ((PlayerForce <= 50) && (PlayerForce > 25)) {
Player.GotoAndPlay("hitUP2");
}
if ((PlayerForce < 100) && (PlayerForce > 50)) {
Player.GotoAndPlay("hitUP3");
}
if (PlayerForce >= 100) {
Player.GotoAndPlay("hitUP4");
}
}
if (target._y > Player._y) {
if (PlayerForce <= 25) {
Player.GotoAndPlay("hitDOWN1");
}
if ((PlayerForce <= 50) && (PlayerForce > 25)) {
Player.GotoAndPlay("hitDOWN2");
}
if ((PlayerForce < 100) && (PlayerForce > 50)) {
Player.GotoAndPlay("hitDOWN3");
}
if (PlayerForce >= 100) {
Player.GotoAndPlay("hitDOWN4");
}
}
}
}
function engineDEFEND() {
if (((ATTACK == false) && (HURT == false)) && (DEAD == false)) {
if (Key.getCode() == 32) {
Player.gotoAndPlay("SHIELD");
ATTACK = true;
}
if (Key.getCode() == 16) {
Player.gotoAndPlay("TELEPORT");
TeleportSprite.gotoAndPlay("2");
TELEPORT = true;
TeleportSound = new Sound();
TeleportSound.attachSound("SuperSpeed");
TeleportSound.start();
}
}
}
function engineTRAINER() {
TrainerAccel = random(5) + 20;
TrainerBallDistX = (Player._x - this._x) - 20;
TrainerBallDistY = (Player._y - this._y) - 20;
TrainerMovX = TrainerBallDistX / TrainerAccel;
TrainerMovY = TrainerBallDistY / TrainerAccel;
if ((TrainerATTACK == false) && (TrainerORBIT == false)) {
TrainerVelX = TrainerMovX;
TrainerVelY = TrainerMovY;
this._rotation = 0;
R = 0;
}
if ((TrainerATTACK == false) && (DEAD == false)) {
this._x = this._x + TrainerVelX;
this._y = this._y + TrainerVelY;
TrainerNEUTRAL = true;
this._rotation = this._rotation + R;
} else {
TrainerNEUTRAL == false;
}
if (TrainerATTACK == false) {
if (this._x > Player._x) {
this._xscale = 40;
} else if (this._x < Player._x) {
this._xscale = -40;
}
}
if (this.hitTest(ground) && (TrainerVelY > 0)) {
TrainerVelY = TrainerVelY * -1;
R = R * -1;
}
if (this.hitTest(wallRIGHT) && (TrainerVelX > 0)) {
this._x = this._x - 1;
R = R * -1;
TrainerVelX = -TrainerVelX;
}
if (this.hitTest(wallLEFT) && (TrainerVelX < 0)) {
this._x = this._x + 1;
TrainerVelX = TrainerVelX * -1;
R = R * -1;
}
if (this.hitTest(wallTOP) && (TrainerVelY < 0)) {
this._y = this._y + 1;
TrainerVelY = TrainerVelY * -1;
R = R * -1;
}
if (this.hitTest(Player.AttackBox) && (ATTACK == true)) {
TrainerORBIT = true;
R = R + PlayerForce;
Xdist = target._x - Player._x;
Ydist = target._y - Player._y;
xmov = Xdist / 7;
ymov = Ydist / 7;
TrainerVelX = TrainerVelX + xmov;
TrainerVelY = TrainerVelY + ymov;
}
if (TrainerORBIT == true) {
TrainerVelX = TrainerVelX * 0.95;
TrainerVelY = TrainerVelY * 0.95;
if ((((TrainerVelX < 1) && (TrainerVelX > -1)) && (TrainerVelY < 1)) && (TrainerVelY > -1)) {
TrainerORBIT = false;
}
}
if ((this.hitTest(Ball) && (DEAD == false)) && (EnemyDEAD == false)) {
ReflectSound = new Sound();
ReflectSound.attachSound("reflect");
ReflectSound.start();
TrainerChoice = random(101);
TrainerORBIT = false;
BallTag = 1;
PlayerCombo = PlayerCombo + 1;
meleeflash._visible = true;
meleeflash._x = Ball._x;
meleeflash._y = Ball._y;
meleeflash.gotoAndPlay("POWER");
TrainerPower = random(5) + 10;
this.gotoAndPlay("ATTACK2");
TrainerATTACK = true;
TrainerPlayerDistX = Player._x - this._x;
TrainerForceX = TrainerPlayerDistX / TrainerPower;
TrainerForceY = -TrainerPower;
BallVelX = TrainerForceX;
BallVelY = BallVelY + TrainerForceY;
}
}
function engineENEMY() {
EnemyAccel = random(5) + 20;
EnemyBallDistX = Ball._x - this._x;
EnemyBallDistY = Ball._y - this._y;
EnemyMovX = EnemyBallDistX / EnemyAccel;
EnemyMovY = EnemyBallDistY / EnemyAccel;
EnemyBallDistX2 = random(5) + 1;
EnemyBallDistY2 = random(5) + 1;
EnemyMovX2 = EnemyBallDistX2 - random(7);
EnemyMovY2 = EnemyBallDistY2 - random(7);
if (BallTag < 1) {
EnemyVelX = EnemyMovX;
EnemyVelY = EnemyMovY;
} else if (BallTag == 1) {
EnemyVelX = (EnemyMovX + EnemyMovX2) / 2;
EnemyVelY = (EnemyMovY + EnemyMovY2) / 2;
} else if ((BallTag > 1) && (EnemyAccel > 23)) {
EnemyVelX = EnemyMovX + EnemyMovX2;
EnemyVelY = EnemyMovY + EnemyMovY2;
}
if (((EnemyHURT == false) && (EnemyATTACK == false)) && (DEAD == false)) {
this._x = this._x + EnemyVelX;
this._y = this._y + EnemyVelY;
EnemyNEUTRAL = true;
} else {
EnemyNEUTRAL == false;
}
EnemyShadow._x = Enemy._x;
EnemyShadow._xscale = Enemy._y / 2;
if ((EnemyATTACK == false) && (EnemyHURT == false)) {
if (this._x > Player._x) {
this._xscale = 90;
} else if (this._x < Player._x) {
this._xscale = -90;
}
}
if (DEAD == false) {
if (this.hitTest(ground) && (EnemyVelY > 0)) {
EnemyVelY = EnemyVelY * -1;
this._y = this._y - 5;
}
if (this.hitTest(wallRIGHT) && (EnemyVelX > 0)) {
this._x = this._x - 5;
EnemyVelX = -EnemyVelX;
}
if (this.hitTest(wallLEFT) && (EnemyVelX < 0)) {
this._x = this._x + 5;
EnemyVelX = EnemyVelX * -1;
}
if (this.hitTest(wallTOP) && (EnemyVelY < 0)) {
this._y = this._y + 5;
EnemyVelY = EnemyVelY * -1;
}
}
EnemyHealthHUD._alpha = EnemyHealth;
if (((this.HITBOX.hitTest(Ball) && (EnemyHURT == false)) && (EnemyATTACK == false)) && (EnemyDEAD == false)) {
EnemyChoice = random(101);
if (EnemyChoice >= 30) {
if (HIT == false) {
PlayerCombo = PlayerCombo + 1;
meleeflash._visible = true;
meleeflash._x = Ball._x;
meleeflash._y = Ball._y;
meleeflash.gotoAndPlay("POWER");
HIT = true;
}
DoICombo = random(101);
if (DoICombo <= 50) {
BallTag = 2;
EnemyPower = random(5) + 20;
this.gotoAndPlay("ATTACK1");
EnemyATTACK = true;
PlayerCombo = 0;
BallEnergy = BallEnergy + EnemyPower;
EnemyPlayerDistX = Player._x - this._x;
EnemyPlayerDistY = Player._y - this._y;
EnemyForceX = EnemyPlayerDistX / (Difficulty * 5);
EnemyForceY = EnemyPlayerDistY / (Difficulty * 5);
BallVelX = EnemyForceX;
BallVelY = EnemyForceY;
Ball._xscale = Ball._xscale + (EnemyPower / 3);
Ball._yscale = Ball._yscale + (EnemyPower / 3);
} else if (BallEnergy >= 90) {
BallTag = 2;
EnemyPower = random(5) + 20;
this.gotoAndPlay("ATTACK1");
EnemyATTACK = true;
PlayerCombo = 0;
BallEnergy = BallEnergy + EnemyPower;
EnemyPlayerDistX = Player._x - Ball._x;
EnemyPlayerDistY = Player._y - Ball._y;
EnemyForceX = EnemyPlayerDistX / (Difficulty * 5);
EnemyForceY = EnemyPlayerDistY / (Difficulty * 5);
BallVelX = EnemyForceX;
BallVelY = EnemyForceY;
Ball._xscale = Ball._xscale + (EnemyPower / 3);
Ball._yscale = Ball._yscale + (EnemyPower / 3);
} else if ((DoICombo > 50) && (BallEnergy < 90)) {
BallTag = 2;
EnemyPower = random(10) + 10;
this.gotoAndPlay("ATTACK2");
EnemyATTACK = true;
PlayerCombo = 0;
BallEnergy = BallEnergy + EnemyPower;
EnemyPlayerDistX = Trainer2._x - Ball._x;
EnemyForceX = EnemyPlayerDistX / EnemyPower;
EnemyForceY = -EnemyPower;
BallVelX = EnemyForceX;
BallVelY = EnemyForceY;
}
} else if (((EnemyChoice < 30) && (BallEnergy > 90)) && (BallTag == 1)) {
this.gotoAndPlay("DIE");
Player.gotoAndPlay("I WIN");
EnemyHURT = true;
bg.bg.gotoAndPlay(85);
EnemyHealth = EnemyHealth - 100;
BallEnergy = 0;
EnemyDEAD = true;
BallEnergyHUD._visible = false;
GAMEOVER2.gotoAndPlay(1);
GAMEOVER2._visible = true;
Ball._visible = false;
BallShadow._visible = false;
Mouse.show();
} else if ((((BallEnergy >= 30) && (BallEnergy < 90)) && (BallTag == 1)) && (EnemyChoice < 30)) {
this.gotoAndPlay("HURT");
EnemyHURT = true;
EnemyHealth = EnemyHealth - (BallEnergy * (PlayerCombo + 1));
PlayerCombo = PlayerCombo + 1;
BallEnergy = BallEnergy / 5;
Ball._xscale = BallSize;
Ball._yscale = BallSize;
if (EnemyHealth < 1) {
EnemyDEAD = true;
Mouse.show();
Player.gotoAndPlay("I WIN");
bg.bg.play();
Bar._visible = false;
BallEnergyHUD._visible = false;
GAMEOVER2._visible = true;
}
}
}
if (((this.HITBOX2.hitTest(Ball) && (EnemyHURT == false)) && (EnemyATTACK == false)) && (EnemyDEAD == false)) {
EnemyChoice = random(101);
if (EnemyChoice >= 0) {
if (HIT == false) {
PlayerCombo = PlayerCombo + 1;
meleeflash._visible = true;
meleeflash._x = Ball._x;
meleeflash._y = Ball._y;
meleeflash.gotoAndPlay("POWER");
HIT = true;
}
DoICombo = random(101);
if (DoICombo <= 101) {
BallTag = 2;
EnemyPower = random(10) + 20;
this.gotoAndPlay("ATTACK3");
EnemyATTACK = true;
PlayerCombo = 0;
BallEnergy = BallEnergy + EnemyPower;
EnemyPlayerDistX = Player._x - Ball._x;
EnemyPlayerDistY = Player._y - Ball._y;
EnemyForceX = EnemyPlayerDistX / (Difficulty * 5);
EnemyForceY = EnemyPlayerDistY / (Difficulty * 3);
BallVelX = EnemyForceX;
BallVelY = EnemyForceY;
Ball._xscale = Ball._xscale + (EnemyPower / 3);
Ball._yscale = Ball._yscale + (EnemyPower / 3);
}
}
}
}
init();
stop();
Instance of Symbol 552 MovieClip "Ball" in Frame 81
onClipEvent (enterFrame) {
}
Instance of Symbol 1193 MovieClip "Player" in Frame 81
/* no clip actions */
Frame 114
Stage.scaleMode = "showAll";
Mouse.show();
bg.bg.gotoAndPlay(2);
Instance of Symbol 1593 MovieClip in Frame 115
/* no clip actions */
Frame 206
function init() {
Stage.showMenu = false;
Stage.scaleMode = "showAll";
Mouse.hide();
frictionAirX = 0.99;
frictionAirY = 0.8;
gravity = 1;
sine_lookup_table = "0.000/.0175/.0349/.0523/.0698/.0872/.1045/.1219/.1392/.1564/.1736/.1908/.2079/.2250/.2419/.2588/.2756/.2924/.3090/.3256/.3420/.3584/.3746/.3907/.4067/.4226/.4384/.4540/.4695/.4848/.5000/.5150/.5299/.5446/.5592/.5736/.5878/.6018/.6157/.6428/.6561/.6691/.6820/.6947/.7071/.7193/.7314/.7431/.7547/.7660/.7771/.7880/.7986/.8090/.8192/.8290/.8387/.8480/.8572/.8660/.8746/.8829/.8910/.8988/.9063/.9135/.9205/.9272/.9336/.9397/.9455/.9511/.9563/.9613/.9659/.9703/.9744/.9781/.9816/.9848/.9877/.9903/.9925/.9945/.9962/.9976/.9986/.9994/.9998/1.000";
if (StageLevel > 1) {
EnemyDEAD = false;
FightSound = new Sound();
FightSound.attachSound("FIGHT!");
FightSound.start();
BallVelX = BallVelX / 10;
BallVelY = -30;
}
ServeDistX = target._x - Ball._x;
ServeMovX = ServeDistX / 7;
ServeDistY = target._y - Ball._y;
ServeMovY = ServeDistY / 7;
BallWeight = BallMass * gravity;
BallAccel = BallForce / BallMass;
BallRestX = false;
BallRestY = false;
BallRest = false;
BallEnergy = 30;
BallTag = 1;
meleeflash._visible = false;
WINCOUNT = 0;
LOSECOUNT = 0;
PlayerMass = PlayerMass * 0.9;
PlayerVelX = 0;
PlayerVelY = 0;
PlayerForce = 0;
PlayerWeight = PlayerMass * gravity;
PlayerRestX = true;
PlayerRestY = true;
PlayerRest = true;
PlayerHealth = 100;
PlayerStamina = 100;
PlayerPower = 100;
ATTACK = false;
HURT = false;
HURTfront = false;
HURTback = false;
DEAD = false;
NEUTRAL = true;
CHARGE = false;
TELEPORT = false;
INVINCIBLE = false;
PlayerFacingL = false;
PlayerFacingR = true;
aura._alpha = 0;
spriteINVINC._visible = false;
EnemyVelX = 0;
EnemyVelY = 0;
EnemyPower = 0;
EnemyMass = 1;
EnemyWeight = EnemyMass * gravity;
EnemyHealth = 100;
EnemyRestX = true;
EnemyRestY = true;
EnemyATTACK = false;
EnemyDEAD = false;
EnemyNEUTRAL = true;
EnemyCHARGE = false;
EnemyTELEPORT = false;
EnemyFacingL = true;
EnemyFacingR = false;
TrainerATTACK = false;
TrainerNEUTRAL = true;
TrainerATTACK2 = false;
TrainerNEUTRAL2 = true;
PlayerHealthHUD._visible = true;
BallEnergyHUD._visible = true;
EnemyHealthBall._alpha = 100;
combodisplay._alpha = 0;
combodisplay2._visible = false;
GAMEOVER._visible = false;
GAMEOVER2._visible = false;
pickupHEALTH._visible = false;
pickupINVINCIBILITY._visible = false;
INV = 0;
HPT = 0;
MusicSound = new Sound();
MusicSound.attachSound("bgmusic");
MusicSound.start(0, 9999);
BallEnergyHUD.onEnterFrame = engineENERGY();
Ball.onEnterFrame = engineBALL;
Trainer.onEnterFrame = engineTRAINER;
Player.onEnterFrame = enginePLAYER;
Player.onMouseDown = enginePOWER;
Player.onMouseUp = engineATTACK;
DefendListener = new Object();
DefendListener.onKeyUp = engineDEFEND;
Key.addListener(DefendListener);
Enemy.onEnterFrame = engineENEMY;
}
function engineBALL() {
BallWeight = BallMass * gravity;
BallEnergy2 = Math.round(BallEnergy);
if ((BallVelX >= 1) or (BallVelX <= -1)) {
BallRestX = false;
} else {
BallRestX = true;
}
if ((BallVelY >= 1) or (BallVelY <= -1)) {
BallRestY = false;
} else {
BallRestY = true;
}
if ((BallRestX == true) && (BallRestY == true)) {
BallRest = true;
} else {
BallRest = false;
}
if (BallEnergy > 0) {
BallEnergy = BallEnergy - 0.1;
}
if (BallEnergy > 100) {
BallEnergy = 100;
}
if (BallEnergy < 0) {
BallEnergy = 0;
}
if (Ball._xscale > BallSize) {
Ball._xscale = Ball._xscale - 0.1;
Ball._yscale = Ball._yscale - 0.1;
}
if (!this.hitTest(ground)) {
if ((BallVelY < 20) && (!this.hitTest(ground))) {
BallVelY = BallVelY + BallWeight;
}
}
if (BallRestX == false) {
if (BallVelX != 0) {
BallVelX = BallVelX * frictionAirX;
}
if ((BallVelX < 1) && (BallVelX > -1)) {
BallVelX = 0;
BallRestX = true;
}
}
this._rotation = this._rotation + (BallVelX * 4);
if (this.hitTest(ground)) {
BallEnergy = BallEnergy * 0.95;
}
if (this.hitTest(ground) && (BallVelY > 0)) {
if (EnemyHURT == false) {
PlayerCombo = 0;
}
if (EnemyHURT == true) {
PlayerCombo = PlayerCombo - 1;
}
if (BallVelY >= 5) {
BallVelY = BallVelY * -0.75;
} else if (BallVelY < 5) {
BallVelY = -(Math.round(BallVelY) * 0.3);
}
if ((BallVelY < 1) && (BallVelY >= 0)) {
BallVelY = 0;
BallRestY = true;
}
}
if ((this.hitTest(ground) && (BallVelY > -1)) && (BallVelY < 0)) {
BallVelY = 0;
BallRestY = true;
}
if (this.hitTest(wallRIGHT) && (BallVelX > 0)) {
this._x = this._x - 1;
BallVelX = -BallVelX;
}
if (this.hitTest(wallLEFT) && (BallVelX < 0)) {
this._x = this._x + 1;
BallVelX = BallVelX * -1;
}
if (this.hitTest(wallTOP) && (BallVelY < 0)) {
this._y = this._y + 1;
BallVelY = BallVelY * -1;
}
if (BallVelX > 50) {
BallVelX = 49;
}
if (BallVelX < -50) {
BallVelX = -49;
}
if (BallVelY > 50) {
BallVelY = 49;
}
if (BallVelY < -50) {
BallVelY = -49;
}
this._x = this._x + BallVelX;
this._y = this._y + BallVelY;
BallShadow._x = this._x;
BallShadow._xscale = this._width + (this._y / 3);
if (BallEnergy < 2) {
this.GotoAndStop("NORMAL");
}
if (BallTag == 1) {
if ((BallEnergy < 30) && (BallEnergy >= 2)) {
this.GotoAndStop("WARM1");
}
if ((BallEnergy < 90) && (BallEnergy >= 30)) {
this.GotoAndStop("HOT1");
}
if (BallEnergy >= 90) {
this.GotoAndStop("CHARGED1");
}
} else if (BallTag == 2) {
if ((BallEnergy < 30) && (BallEnergy >= 2)) {
this.GotoAndStop("WARM2");
}
if ((BallEnergy < 90) && (BallEnergy >= 30)) {
this.GotoAndStop("HOT2");
}
if (BallEnergy >= 90) {
this.GotoAndStop("CHARGED2");
}
}
}
function enginePLAYER() {
Xdist = Math.round(target._x - Player._x);
Ydist = Math.round(target._y - Player._y);
PlayerWeight = PlayerMass * gravity;
hyp = Math.sqrt((Xdist * Xdist) + (Ydist * Ydist));
PlayerScore = Math.round(PlayerScore);
PlayerHealth = Math.round(PlayerHealth);
aura._x = this._x;
aura._y = this._y;
TeleportSprite._x = this._x;
TeleportSprite._y = this._y;
if ((PlayerVelY != 0) && (PlayerVelX == 0)) {
TeleportSprite._rotation = 90;
} else if (PlayerVelY == 0) {
TeleportSprite._rotation = 0;
} else if ((PlayerVelY > 0) && (PlayerVelX != 0)) {
TeleportSprite._rotation = PlayerVelY + PlayerVelX;
} else if ((PlayerVelY < 0) && (PlayerVelX != 0)) {
TeleportSprite._rotation = PlayerVelY - PlayerVelX;
}
PowerBAR._height = PlayerForce;
if (PlayerForce >= 100) {
PowerBAR._height = 100;
}
if (ATTACK == true) {
TELEPORT = false;
PowerBAR._alpha = PowerBAR._alpha * 0.8;
}
if (CHARGE == true) {
ATTACK = false;
aura._rotation = AR;
if (PlayerVelY >= 0) {
AR = -(PlayerVelX * 4);
}
if ((PlayerVelY < 0) && (PlayerVelX != 0)) {
AR = -(PlayerVelX * 7);
}
if ((PlayerVelY < 0) && (PlayerVelX == 0)) {
AR = 180;
}
if (PlayerForce < PlayerStamina) {
if (INVINCIBLE == false) {
aura._alpha = aura._alpha + 5;
PlayerForce = PlayerForce + 5;
PlayerPower = PlayerPower - 1;
} else if (INVINCIBLE == true) {
aura._alpha = aura._alpha + 10;
PlayerForce = PlayerForce + 10;
PlayerPower = PlayerPower - 1;
}
}
} else {
aura._alpha = aura._alpha * 0.95;
}
if ((ATTACK == false) && (CHARGE == false)) {
PlayerForce = 0;
PlayerPower = 101;
}
if (((PlayerStamina < 100) && (DEAD == false)) && (INVINCIBLE == false)) {
PlayerStamina = PlayerStamina + StageLevel;
} else if (((PlayerStamina < 100) && (DEAD == false)) && (INVINCIBLE == true)) {
PlayerStamina = PlayerStamina + 10;
}
StaminaBar._height = PlayerStamina;
if (PlayerStamina < 0) {
PlayerStamina = 0;
}
if (BallTag == 1) {
BallEnergyHUD.EnergyHUD._x = (-BallEnergy) / 2;
}
if (BallTag == 2) {
BallEnergyHUD.EnergyHUD._x = BallEnergy / 2;
}
if (BallTag == 0) {
BallEnergyHUD.EnergyHUD._x = 0;
}
if (PlayerMaxCombo < PlayerCombo) {
PlayerMaxCombo = PlayerCombo;
}
if (PlayerMaxCombo >= 2) {
MAXcomboDisplay._visible = true;
} else {
MAXcomboDisplay._visible = false;
}
if (PlayerCombo >= 2) {
n = 0;
PlayerComboHUD = PlayerCombo;
combodisplay._alpha = 100;
combodisplay.gotoAndStop(1);
combodisplay2.textColor = 16777215 /* 0xFFFFFF */;
combodisplay2._visible = true;
} else {
n = n + 1;
combodisplay.gotoAndStop(2);
combodisplay2.textColor = 16711680 /* 0xFF0000 */;
if (n > 50) {
combodisplay2._visible = false;
combodisplay._alpha = combodisplay._alpha * 0.9;
}
}
if (PlayerHealthHUD._xscale > 0) {
PlayerHealthHUD._xscale = PlayerHealth / 2;
PlayerHealthHUD._yscale = PlayerHealthHUD._xscale;
}
if (PlayerHealth > 90) {
PlayerHealthHUD.gotoAndStop(1);
} else if ((PlayerHealth > 80) && (PlayerHealth <= 90)) {
PlayerHealthHUD.gotoAndStop(2);
} else if ((PlayerHealth > 70) && (PlayerHealth <= 80)) {
PlayerHealthHUD.gotoAndStop(3);
} else if ((PlayerHealth > 60) && (PlayerHealth <= 70)) {
PlayerHealthHUD.gotoAndStop(4);
} else if ((PlayerHealth > 50) && (PlayerHealth <= 60)) {
PlayerHealthHUD.gotoAndStop(5);
} else if ((PlayerHealth > 40) && (PlayerHealth <= 50)) {
PlayerHealthHUD.gotoAndStop(6);
} else if ((PlayerHealth > 30) && (PlayerHealth <= 40)) {
PlayerHealthHUD.gotoAndStop(7);
} else if ((PlayerHealth > 20) && (PlayerHealth <= 30)) {
PlayerHealthHUD.gotoAndStop(8);
} else if ((PlayerHealth > 10) && (PlayerHealth <= 20)) {
PlayerHealthHUD.gotoAndStop(9);
}
ItemTime = random(1000);
spriteINVINC._x = Player._x + 10;
spriteINVINC._y = Player._y - 10;
if (((ItemTime >= 998) && (pickupINVINCIBILITY._visible == false)) && (INVINCIBLE == false)) {
pickupINVINCIBILITY._visible = true;
pickupINVINCIBILITY._x = random(700) + 100;
pickupINVINCIBILITY._y = random(200) + 100;
}
if (INVINCIBLE == true) {
invincTime = invincTime + 1;
}
if (pickupINVINCIBILITY._visible == true) {
INV = INV + 1;
if (INV > 100) {
pickupINVINCIBILITY._visible = false;
INV = 0;
}
}
if (invincTime > 150) {
INVINCIBLE = false;
invincTime = 0;
spriteINVINC._visible = false;
}
if ((this.hitTest(pickupINVINCIBILITY) && (pickupINVINCIBILITY._visible == true)) && (HURT == false)) {
INVINCIBLE = true;
invincTime = 0;
INV = 0;
spriteINVINC._visible = true;
pickupINVINCIBILITY._visible = false;
InvincSound = new Sound();
InvincSound.attachSound("speedup");
InvincSound.start(1);
}
if ((Trainer.hitTest(pickupINVINCIBILITY) && (pickupINVINCIBILITY._visible == true)) && (HURT == false)) {
INVINCIBLE = true;
invincTime = 0;
INV = 0;
spriteINVINC._visible = true;
pickupINVINCIBILITY._visible = false;
InvincSound = new Sound();
InvincSound.attachSound("speedup");
InvincSound.start(1);
}
Item2Time = random(1000);
if ((Item2Time >= 998) && (pickupHEALTH._visible == false)) {
pickupHEALTH._visible = true;
pickupHEALTH._x = random(700) + 100;
pickupHEALTH._y = random(200) + 100;
}
if (pickupHEALTH._visible == true) {
HPT = HPT + 1;
if (HPT > 150) {
pickupHEALTH._visible = false;
HPT = 0;
}
}
if (((this.hitTest(pickupHEALTH) && (pickupHEALTH._visible == true)) && (HURT == false)) && (PlayerHealth < 100)) {
PlayerHealth = 100;
HPT = 0;
pickupHEALTH._visible = false;
ReplenishSound = new Sound();
ReplenishSound.attachSound("HealthSound");
ReplenishSound.start();
}
if (((Trainer.hitTest(pickupHEALTH) && (pickupHEALTH._visible == true)) && (HURT == false)) && (PlayerHealth < 100)) {
PlayerHealth = 100;
HPT = 0;
pickupHEALTH._visible = false;
ReplenishSound = new Sound();
ReplenishSound.attachSound("HealthSound");
ReplenishSound.start();
}
if ((PlayerVelX >= 1) || (PlayerVelX <= -1)) {
PlayerRestX = false;
}
if ((PlayerVelY >= 1) || (PlayerVelY <= -1)) {
PlayerRestY = false;
}
if ((PlayerRestX == true) && (PlayerRestY == true)) {
PlayerRest = true;
} else {
PlayerRest = false;
}
if ((PlayerRestY == false) && (EnemyDEAD == false)) {
if ((PlayerVelY < 80) && (!Player.hitTest(ground))) {
PlayerVelY = PlayerVelY + PlayerWeight;
}
}
if ((PlayerRestX == false) && (EnemyDEAD == false)) {
if (PlayerVelX != 0) {
PlayerVelX = PlayerVelX * 0.9;
}
if ((PlayerVelX < 1) && (PlayerVelX > -1)) {
PlayerVelX = 0;
PlayerRestX = true;
}
}
if (Player.hitTest(ground)) {
if (PlayerVelY > 0) {
PlayerVelY = 0;
this._y = 310;
PlayerRestY = true;
}
if (HURTback == true) {
this.gotoAndPlay("HITground");
} else if (HURTfront == true) {
this.gotoAndPlay("HITground2");
}
if (ATTACK == true) {
PlayerVelX = 0;
TELEPORT = false;
PowerBAR._alpha = PowerBAR._alpha * 0.8;
}
}
if (Player.hitTest(wallRIGHT) && (PlayerVelX > 1)) {
Player._x = Player._x - 1;
PlayerVelX = PlayerVelX * -0.5;
if (HURTfront == true) {
this.gotoAndPlay("HURTback");
HURTback = true;
HURTfront = false;
} else if (HURTback == true) {
this.gotoAndPlay("HURTfront");
HURTback = false;
HURTfront = true;
}
}
if (Player.hitTest(wallMIDDLE) && (PlayerVelX > 1)) {
Player._x = Player._x - 1;
PlayerVelX = PlayerVelX * -0.5;
}
if (Player.hitTest(wallLEFT) && (PlayerVelX < 0)) {
Player._x = Player._x + 1;
PlayerVelX = PlayerVelX * -0.5;
if (HURTfront == true) {
this.gotoAndPlay(206);
HURTback = true;
HURTfront = false;
WallImpactSound = new Sound();
WallImpactSound.attachSound("wallIMPACT");
WallImpactSound.start();
} else if (HURTback == true) {
this.gotoAndPlay(239);
HURTback = false;
HURTfront = true;
}
}
if (Player.hitTest(wallTOP) && (PlayerVelY < 1)) {
Player._y = Player._y + 1;
PlayerVelY = PlayerVelY * -0.5;
}
if ((((((HURT == false) && (DEAD == false)) && (EnemyDEAD == false)) && (Key.isDown(87))) && (!Key.isDown(65))) && (!Key.isDown(68))) {
if ((ATTACK == false) && (TELEPORT == false)) {
this.gotoAndPlay("FLYup");
}
if (this.hitTest(ground)) {
PlayerVelY = -5;
}
if ((this._y > wallTOP._y) && (PlayerVelY > -3)) {
PlayerVelY = PlayerVelY - 1.1;
}
}
if (((((!this.hitTest(ground)) && (HURT == false)) && (DEAD == false)) && (Key.isDown(83))) && (EnemyDEAD == false)) {
PlayerVelY = PlayerVelY + 1.5;
}
if (((((((((!this.hitTest(ground)) && (HURT == false)) && (DEAD == false)) && (ATTACK == false)) && (TELEPORT == false)) && (Key.isDown(83))) && (!Key.isDown(65))) && (!Key.isDown(68))) && (EnemyDEAD == false)) {
this.gotoAndPlay("FLYdown");
}
if ((((HURT == false) && (DEAD == false)) && (this._x < target._x)) && (EnemyDEAD == false)) {
if (Key.isDown(87)) {
PlayerVelY = PlayerVelY - 2;
}
if ((Key.isDown(65) && (this._x > wallLEFT._x)) && (PlayerVelX > -20)) {
PlayerVelX = PlayerVelX - 5;
}
if ((Key.isDown(65) && (ATTACK == false)) && (TELEPORT == false)) {
this.gotoAndPlay("FLYbackward");
}
if ((Key.isDown(68) && (this._x < 800)) && (PlayerVelX < 20)) {
PlayerVelX = PlayerVelX + 5;
}
if ((Key.isDown(68) && (ATTACK == false)) && (TELEPORT == false)) {
this.gotoAndPlay("FLYforward");
}
} else if ((((HURT == false) && (DEAD == false)) && (EnemyDEAD == false)) && (this._x != target._x)) {
if (Key.isDown(87)) {
PlayerVelY = PlayerVelY - 2;
}
if ((Key.isDown(65) && (this._x > wallLEFT._x)) && (PlayerVelX > -20)) {
PlayerVelX = PlayerVelX - 5;
}
if ((Key.isDown(65) && (ATTACK == false)) && (TELEPORT == false)) {
this.gotoAndPlay("FLYforward");
}
if ((Key.isDown(68) && (this._x < 800)) && (PlayerVelX < 20)) {
PlayerVelX = PlayerVelX + 5;
}
if ((Key.isDown(68) && (ATTACK == false)) && (TELEPORT == false)) {
this.gotoAndPlay("FLYbackward");
}
}
if ((((((((HURT == false) && (DEAD == false)) && (EnemyDEAD == false)) && (!Key.isDown(68))) && (!Key.isDown(65))) && (!Key.isDown(87))) && (ATTACK == false)) && (TELEPORT == false)) {
NEUTRAL = true;
if ((!this.hitTest(ground)) && (!Key.isDown(83))) {
this.gotoAndPlay("FALL");
Player.onEnterFrame = enginePLAYER;
} else if (this.hitTest(ground)) {
this.gotoAndPlay("IDLE");
PlayerVelX = PlayerVelX * 0.7;
}
} else {
NEUTRAL = false;
}
if (((((this.HITBOX.hitTest(Ball) && (BallTag > 1)) && (ATTACK == false)) && (HURT == false)) && (BallEnergy >= 30)) && (INVINCIBLE == false)) {
HURT = true;
CHARGE = false;
aura._alpha = 0;
PlayerForce = 0;
target._visible = false;
PlayerCombo = 0;
PlayerHealth = PlayerHealth - (BallEnergy / BallType);
PlayerVelX = PlayerVelX + (BallVelX / 2);
PlayerVelY = -5;
Ball._xscale = BallSize;
Ball._yscale = BallSize;
ChargeSound.stop("ChargePush");
ImpactSound = new Sound();
ImpactSound.attachSound("impactHURT");
PainSound = new Sound();
PainSound.attachSound("painHURT");
if ((PlayerFacingR == true) && (BallVelX > 0)) {
this.gotoAndPlay("HURTback");
HURTback = true;
BallEnergy = BallEnergy / 3;
ImpactSound.start();
PainSound.start();
}
if ((PlayerFacingL == true) && (BallVelX < 0)) {
this.gotoAndPlay("HURTback");
HURTback = true;
BallEnergy = BallEnergy / 3;
ImpactSound.start();
PainSound.start();
}
if ((PlayerFacingR == true) && (BallVelX < 0)) {
this.gotoAndPlay("HURTfront");
HURTfront = true;
BallEnergy = BallEnergy / 3;
ImpactSound.start();
PainSound.start();
}
if ((PlayerFacingL == true) && (BallVelX > 0)) {
this.gotoAndPlay("HURTfront");
HURTfront = true;
BallEnergy = BallEnergy / 3;
ImpactSound.start();
PainSound.start();
}
if ((BallVelX == 0) && (BallVelY < 0)) {
this.gotoAndPlay("HURTfront");
HURTfront = true;
BallEnergy = BallEnergy / 3;
ImpactSound.start();
PainSound.start();
} else if ((BallVelX == 0) && (BallVelY > 0)) {
this.gotoAndPlay("HURTback");
HURTback = true;
BallEnergy = BallEnergy / 3;
ImpactSound.start();
PainSound.start();
}
}
if ((PlayerHealth < 1) && (DEAD == false)) {
GAMEOVER._visible = true;
GAMEOVER.play();
PlayerHealthHUD._visible = false;
DEAD = true;
Bar._visible = false;
BallEnergyHUD._visible = false;
Mouse.show();
}
if (this.AttackBox.hitTest(Ball)) {
BallTag = 1;
if (HIT == false) {
PlayerCombo = PlayerCombo + 1;
PlayerScore = PlayerScore + (PlayerForce * PlayerCombo);
meleeflash._visible = true;
meleeflash._x = Ball._x;
meleeflash._y = Ball._y;
if (PlayerForce <= 25) {
meleeflash.gotoAndPlay("STALL");
} else if ((PlayerForce <= 50) && (PlayerForce > 25)) {
meleeflash.gotoAndPlay("KICK");
} else if ((PlayerForce < 100) && (PlayerForce > 50)) {
meleeflash.gotoAndPlay("PUNCH");
} else if (PlayerForce >= 100) {
meleeflash.gotoAndPlay("POWER");
}
if ((PlayerCombo > 1) && (PlayerHealth < 100)) {
PlayerHealth = PlayerHealth + 5;
}
HIT = true;
}
if ((ATTACK == true) && (PlayerForce >= 25)) {
z = PlayerForce / 300;
xmov = Xdist * z;
ymov = Ydist * z;
BallVelX = BallVelX + xmov;
BallVelY = BallVelY + ymov;
ChargeRate = 3 * Difficulty;
BallEnergy = BallEnergy + ((PlayerForce / ChargeRate) * (PlayerCombo + 1));
Ball._xscale = Ball._xscale + (PlayerForce / 10);
Ball._yscale = Ball._yscale + (PlayerForce / 10);
}
if ((ATTACK == true) && (PlayerForce < 25)) {
z = PlayerForce / 100;
xmov = Xdist * z;
ymov = Ydist * z;
BallVelX = xmov;
BallVelY = ymov;
BallEnergy = BallEnergy + (PlayerForce / 5);
Ball._xscale = Ball._xscale + (PlayerForce / 10);
Ball._yscale = Ball._yscale + (PlayerForce / 10);
}
}
if (this.SHIELD.hitTest(Ball)) {
PlayerCombo = 0;
PlayerScore = PlayerScore + (PlayerStamina / StageLevel);
meleeflash._visible = true;
meleeflash._x = Ball._x;
meleeflash._y = Ball._y;
if (hyp <= 70) {
meleeflash.gotoAndPlay("STALL");
} else if ((hyp <= 140) && (hyp > 70)) {
meleeflash.gotoAndPlay("KICK");
} else if ((hyp <= 210) && (hyp > 140)) {
meleeflash.gotoAndPlay("PUNCH");
} else if (hyp > 210) {
meleeflash.gotoAndPlay("POWER");
}
if ((ATTACK == true) && (hyp >= 70)) {
xmov = Xdist / 7;
ymov = Ydist / 7;
BallVelX = xmov;
BallVelY = ymov;
BallEnergy = BallEnergy - (hyp / 7);
if (Ball._xscale > BallSize) {
Ball._xscale = Ball._xscale - (hyp / 30);
Ball._yscale = Ball._yscale - (hyp / 30);
}
}
}
if (this.SHIELD.hitTest(Trainer)) {
TrainerATTACK = true;
}
if ((this.AttackBox.hitTest(Enemy) && (PlayerForce > 25)) && (EnemyHURT == true)) {
if (HIT == false) {
PlayerCombo = PlayerCombo + 1;
PlayerScore = PlayerScore + (PlayerForce * PlayerCombo);
meleeflash._visible = true;
meleeflash._x = AttackBox._x;
meleeflash._y = AttackBox._y;
if (PlayerForce <= 25) {
meleeflash.gotoAndPlay("STALL");
} else if ((PlayerForce <= 50) && (PlayerForce > 25)) {
meleeflash.gotoAndPlay("KICK");
} else if ((PlayerForce < 100) && (PlayerForce > 50)) {
meleeflash.gotoAndPlay("PUNCH");
} else if (PlayerForce >= 100) {
meleeflash.gotoAndPlay("POWER");
}
if ((PlayerCombo > 1) && (PlayerHealth < 100)) {
PlayerHealth = PlayerHealth + 10;
}
HIT = true;
}
EnemyHURT = true;
EnemyHealth = EnemyHealth - (PlayerForce / 10);
xmov = Xdist / 7;
ymov = Ydist / 7;
EnemyVelX = xmov;
EnemyVelY = ymov;
ImpactSound2 = new Sound();
ImpactSound2.attachSound("impactHURT");
PainSound2 = new Sound();
PainSound2.attachSound("painHURT");
if ((EnemyFacingR == true) && (Player._x < Enemy._x)) {
Enemy.gotoAndPlay("HURTback");
EnemyHURTback = true;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingL == true) && (Player._x > Enemy._x)) {
Enemy.gotoAndPlay("HURTback");
EnemyHURTback = true;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingR == true) && (Player._x > Enemy._x)) {
Enemy.gotoAndPlay("HURTfront");
EnemyHURTfront = true;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingL == true) && (Player._x < Enemy._x)) {
Enemy.gotoAndPlay("HURTfront");
EnemyHURTfront = true;
ImpactSound2.start();
PainSound2.start();
}
}
if ((((HURT == false) && (DEAD == false)) && (ATTACK == false)) && (EnemyDEAD == false)) {
startDrag ("/target", true);
Mouse.hide();
target._visible = true;
target._alpha = 100;
} else {
stopDrag();
Mouse.show();
target._alpha = 10;
}
if (PlayerForce <= 25) {
target.GotoAndStop("SOFT");
}
if ((PlayerForce <= 50) && (PlayerForce > 25)) {
target.GotoAndStop("MEDIUM");
}
if ((PlayerForce < 100) && (PlayerForce > 50)) {
target.GotoAndStop("HARD");
}
if (PlayerForce >= 100) {
target.GotoAndStop("POWER");
}
Player._x = Player._x + PlayerVelX;
Player._y = Player._y + PlayerVelY;
if ((((this._x > target._x) && (HURT == false)) && (ATTACK == false)) && (DEAD == false)) {
this._xscale = -100;
PlayerFacingL = true;
PlayerFacingR = false;
} else if ((((this._x < target._x) && (HURT == false)) && (ATTACK == false)) && (DEAD == false)) {
this._xscale = 100;
PlayerFacingR = true;
PlayerFacingL = false;
}
PlayerShadow._x = Player._x;
PlayerShadow._xscale = Player._y / 2;
if (StageLevel == 1) {
Rank = "Noob";
} else if (StageLevel == 2) {
Rank = "Initiate";
} else if (StageLevel == 3) {
Rank = "Goon";
} else if (StageLevel == 4) {
Rank = "Thug";
} else if (StageLevel == 5) {
Rank = "Novice";
} else if (StageLevel == 6) {
Rank = "Average";
} else if (StageLevel == 7) {
Rank = "Adept";
} else if (StageLevel == 8) {
Rank = "Warrior";
} else if (StageLevel == 9) {
Rank = "Solid";
} else if (StageLevel == 10) {
Rank = "Liquid";
} else if (StageLevel == 11) {
Rank = "Professional";
} else if (StageLevel == 12) {
Rank = "Prodigy";
} else if (StageLevel == 13) {
Rank = "Monk";
} else if (StageLevel == 14) {
Rank = "Tengu";
} else if (StageLevel == 15) {
Rank = "Jedi";
} else if (StageLevel == 16) {
Rank = "Neo";
} else if (StageLevel == 17) {
Rank = "Dragon";
} else if (StageLevel == 18) {
Rank = "Master";
} else if (StageLevel == 19) {
Rank = "Saiyan";
} else if (StageLevel == 20) {
Rank = "Grand Master";
} else if (StageLevel == 21) {
Rank = "Super Saiyan";
} else if (StageLevel == 22) {
Rank = "Majin";
} else if (StageLevel == 23) {
Rank = "Otaku";
} else if (StageLevel == 24) {
Rank = "Akira";
} else if (StageLevel == 25) {
Rank = "Deity";
} else if (StageLevel == 26) {
Rank = "KYnetiK";
} else if (StageLevel >= 27) {
Rank = "Wastoid";
}
}
function enginePOWER() {
if ((((HURT == false) && (DEAD == false)) && (EnemyDEAD == false)) && (PlayerForce <= PlayerEnergy)) {
CHARGE = true;
PowerBAR._alpha = 100;
PlayerForce = 0;
ChargeSound = new Sound();
ChargeSound.attachSound("ChargePush");
ChargeSound.start(1);
}
}
function engineATTACK() {
if ((((HURT == false) && (DEAD == false)) && (ATTACK == false)) && (EnemyDEAD == false)) {
ATTACK = true;
CHARGE = false;
PlayerStamina = PlayerStamina - PlayerForce;
aura._alpha = aura._alpha * 0.4;
ChargeSound.stop("ChargePush");
if (target._y <= Player._y) {
if (PlayerForce <= 25) {
Player.GotoAndPlay("hitUP1");
}
if ((PlayerForce <= 50) && (PlayerForce > 25)) {
Player.GotoAndPlay("hitUP2");
}
if ((PlayerForce < 100) && (PlayerForce > 50)) {
Player.GotoAndPlay("hitUP3");
}
if (PlayerForce >= 100) {
Player.GotoAndPlay("hitUP4");
}
}
if (target._y > Player._y) {
if (PlayerForce <= 25) {
Player.GotoAndPlay("hitDOWN1");
}
if ((PlayerForce <= 50) && (PlayerForce > 25)) {
Player.GotoAndPlay("hitDOWN2");
}
if ((PlayerForce < 100) && (PlayerForce > 50)) {
Player.GotoAndPlay("hitDOWN3");
}
if (PlayerForce >= 100) {
Player.GotoAndPlay("hitDOWN4");
}
}
}
}
function engineDEFEND() {
if ((((ATTACK == false) && (HURT == false)) && (DEAD == false)) && (EnemyDEAD == false)) {
if (Key.getCode() == 32) {
Player.gotoAndPlay("SHIELD");
ATTACK = true;
PlayerStamina = PlayerStamina / (StageLevel + 27);
}
if (Key.getCode() == 16) {
Player.gotoAndPlay("TELEPORT");
TeleportSprite.gotoAndPlay("2");
TELEPORT = true;
PlayerStamina = PlayerStamina / (StageLevel + 27);
PlayerScore = PlayerScore + (PlayerStamina * StageLevel);
TeleportSound = new Sound();
TeleportSound.attachSound("SuperSpeed");
TeleportSound.start();
}
}
}
function engineTRAINER() {
TrainerAccel = random(5) + 20;
TrainerBallDistX = (Player._x - this._x) - 20;
TrainerBallDistY = (Player._y - this._y) - 20;
TrainerMovX = TrainerBallDistX / TrainerAccel;
TrainerMovY = TrainerBallDistY / TrainerAccel;
if ((ATTACK == false) && (TrainerORBIT == false)) {
TrainerVelX = TrainerMovX;
TrainerVelY = TrainerMovY;
this._rotation = 0;
R = 0;
}
if ((TrainerATTACK == false) && (DEAD == false)) {
this._x = this._x + TrainerVelX;
this._y = this._y + TrainerVelY;
TrainerNEUTRAL = true;
this._rotation = this._rotation + R;
} else {
TrainerNEUTRAL == false;
}
if (TrainerATTACK == false) {
if (this._x > Player._x) {
this._xscale = 40;
} else if (this._x < Player._x) {
this._xscale = -40;
}
}
if (this.hitTest(ground) && (TrainerVelY > 0)) {
TrainerVelY = TrainerVelY * -1;
R = R * -1;
}
if (this.hitTest(wallRIGHT) && (TrainerVelX > 0)) {
this._x = this._x - 1;
R = R * -1;
TrainerVelX = -TrainerVelX;
}
if (this.hitTest(wallLEFT) && (TrainerVelX < 0)) {
this._x = this._x + 1;
TrainerVelX = TrainerVelX * -1;
R = R * -1;
}
if (this.hitTest(wallTOP) && (TrainerVelY < 0)) {
this._y = this._y + 1;
TrainerVelY = TrainerVelY * -1;
R = R * -1;
}
if (this.hitTest(Player.AttackBox) && (ATTACK == true)) {
TrainerORBIT = true;
R = R + PlayerForce;
Xdist = target._x - Player._x;
Ydist = target._y - Player._y;
xmov = Xdist / 7;
ymov = Ydist / 7;
TrainerVelX = TrainerVelX + xmov;
TrainerVelY = TrainerVelY + ymov;
}
if (TrainerORBIT == true) {
TrainerVelX = TrainerVelX * 0.95;
TrainerVelY = TrainerVelY * 0.95;
if ((((TrainerVelX < 1) && (TrainerVelX > -1)) && (TrainerVelY < 1)) && (TrainerVelY > -1)) {
TrainerORBIT = false;
}
}
if (((this.hitTest(Ball) && (DEAD == false)) && (EnemyDEAD == false)) && (TrainerATTACK == false)) {
ReflectSound = new Sound();
ReflectSound.attachSound("reflect");
ReflectSound.start();
TrainerChoice = random(101);
TrainerORBIT = false;
BallTag = 1;
PlayerCombo = PlayerCombo + 1;
meleeflash._visible = true;
meleeflash._x = Ball._x;
meleeflash._y = Ball._y;
meleeflash.gotoAndPlay("POWER");
TrainerPower = random(5) + 10;
this.gotoAndPlay("ATTACK2");
TrainerATTACK = true;
TrainerPlayerDistX = Player._x - this._x;
TrainerForceX = TrainerPlayerDistX / TrainerPower;
TrainerForceY = -TrainerPower;
BallVelX = TrainerForceX;
BallVelY = BallVelY + TrainerForceY;
}
}
function engineENEMY() {
EnemyAccel = (random(7) + 20) / StageLevel;
EnemyBallDistX = Ball._x - this._x;
EnemyBallDistY = Ball._y - this._y;
EnemyMovX = EnemyBallDistX / EnemyAccel;
EnemyMovY = EnemyBallDistY / EnemyAccel;
EnemyBallDistX2 = random(5) + 1;
EnemyBallDistY2 = random(5) + 1;
EnemyMovX2 = EnemyBallDistX2 - random(7);
EnemyMovY2 = EnemyBallDistY2 - random(7);
if (((EnemyHURT == false) && (EnemyATTACK == false)) && (DEAD == false)) {
this._x = this._x + EnemyMovX;
this._y = this._y + EnemyMovY;
}
if (EnemyHURT == true) {
this._x = this._x + EnemyVelX;
this._y = this._y + EnemyVelY;
}
if (EnemyHURT == true) {
if (!this.hitTest(ground)) {
EnemyVelY = EnemyVelY + 1;
EnemyVelX = EnemyVelX * 0.95;
EnemyMovY = EnemyMovY + PlayerMass;
EnemyMovX = EnemyMovX * 0.95;
}
}
if (EnemyHURT == true) {
EnemyATTACK == false;
}
if (((Enemy.hitTest(Ball) && (BallEnergy >= 30)) && (BallTag == 1)) && (EnemyHURT == true)) {
EnemyHURT = true;
PlayerCombo = PlayerCombo + 1;
EnemyHealth = EnemyHealth - (BallEnergy / 3);
EnemyVelX = BallVelX / 2;
EnemyVelY = -5;
Ball._xscale = BallSize;
Ball._yscale = BallSize;
ImpactSound2 = new Sound();
ImpactSound2.attachSound("impactHURT");
PainSound2 = new Sound();
PainSound2.attachSound("painHURT");
if ((EnemyFacingR == true) && (BallVelX > 0)) {
this.gotoAndPlay("HURTback");
EnemyHURTback = true;
BallEnergy = BallEnergy / 3;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingL == true) && (BallVelX < 0)) {
this.gotoAndPlay("HURTback");
EnemyHURTback = true;
BallEnergy = BallEnergy / 3;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingR == true) && (BallVelX < 0)) {
this.gotoAndPlay("HURTfront");
EnemyHURTfront = true;
BallEnergy = BallEnergy / 3;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingL == true) && (BallVelX > 0)) {
this.gotoAndPlay("HURTfront");
EnemyHURTfront = true;
BallEnergy = BallEnergy / 3;
ImpactSound2.start();
PainSound2.start();
}
}
if (((EnemyHURT == false) && (DEAD == false)) && (EnemyDEAD == false)) {
if (((((EnemyMovY < 0) && (EnemyMovX >= -1)) && (EnemyMovX <= 1)) && (EnemyATTACK == false)) && (EnemyTELEPORT == false)) {
this.gotoAndPlay("FLYup");
}
}
if (((((((((!this.hitTest(ground)) && (EnemyMovX >= -1)) && (EnemyMovX <= 1)) && (EnemyMovY > 0)) && (EnemyHURT == false)) && (DEAD == false)) && (EnemyATTACK == false)) && (EnemyTELEPORT == false)) && (EnemyDEAD == false)) {
this.gotoAndPlay("FALL");
}
if ((((EnemyHURT == false) && (DEAD == false)) && (this._x < Player._x)) && (EnemyDEAD == false)) {
if (((EnemyMovX < -1) && (EnemyATTACK == false)) && (EnemyTELEPORT == false)) {
this.gotoAndPlay("FLYbackward");
}
if (((EnemyMovX > 1) && (EnemyATTACK == false)) && (EnemyTELEPORT == false)) {
this.gotoAndPlay("FLYforward");
}
} else if ((((EnemyHURT == false) && (DEAD == false)) && (EnemyDEAD == false)) && (this._x > Player._x)) {
if (((EnemyMovX > 1) && (EnemyATTACK == false)) && (EnemyTELEPORT == false)) {
this.gotoAndPlay("FLYbackward");
}
if (((EnemyMovX < -1) && (EnemyATTACK == false)) && (EnemyTELEPORT == false)) {
this.gotoAndPlay("FLYforward");
}
}
EnemyShadow._x = Enemy._x;
EnemyShadow._xscale = Enemy._y / 2;
if ((EnemyATTACK == false) && (EnemyHURT == false)) {
if (this._x > Player._x) {
this._xscale = 90;
EnemyFacingL = true;
EnemyFacingR = false;
} else if (this._x < Player._x) {
this._xscale = -90;
EnemyFacingR = true;
EnemyFacingL = false;
}
}
if (DEAD == false) {
if (this.hitTest(ground)) {
if ((EnemyHURT == false) && (EnemyMovY > 0)) {
this._y = 310;
}
if ((EnemyHURT == true) && (EnemyVelY > 0)) {
this._y = 310;
}
if (EnemyHURTback == true) {
this.gotoAndPlay("HITground");
EnemyVelX = 0;
} else if (EnemyHURTfront == true) {
this.gotoAndPlay("HITground2");
EnemyVelX = 0;
}
}
if (this.hitTest(wallRIGHT)) {
Enemy._x = Enemy._x - 1;
EnemyVelX = EnemyVelX * -0.5;
if (EnemyHURTfront == true) {
this.gotoAndPlay("HURTback");
EnemyHURTback = true;
EnemyHURTfront = false;
} else if (EnemyHURTback == true) {
this.gotoAndPlay("HURTfront");
EnemyHURTback = false;
EnemyHURTfront = true;
}
}
if (this.hitTest(wallLEFT)) {
Enemy._x = Enemy._x + 1;
EnemyVelX = EnemyVelX * -0.5;
if (EnemyHURTfront == true) {
this.gotoAndPlay(206);
EnemyHURTback = true;
EnemyHURTfront = false;
WallImpactSound = new Sound();
WallImpactSound.attachSound("wallIMPACT");
WallImpactSound.start();
} else if (EnemyHURTback == true) {
this.gotoAndPlay(239);
EnemyHURTback = false;
EnemyHURTfront = true;
}
}
if (this.hitTest(wallTOP) && (EnemyVelY < 1)) {
Enemy._y = Enemy._y + 1;
EnemyVelY = EnemyVelY * -0.5;
}
}
EnemyHealthBall._xscale = EnemyHealth / 2;
EnemyHealthBall._yscale = EnemyHealthBall._xscale;
if (((this.HITBOX.hitTest(Ball) && (EnemyHURT == false)) && (EnemyATTACK == false)) && (EnemyDEAD == false)) {
EnemyChoice = random(101);
if (EnemyChoice >= 30) {
PlayerCombo = 0;
meleeflash._visible = true;
meleeflash._x = Ball._x;
meleeflash._y = Ball._y;
meleeflash.gotoAndPlay("POWER");
DoICombo = random(101);
if (DoICombo <= 30) {
if (Player._y <= Enemy._y) {
if (EnemyPower <= 5) {
this.GotoAndPlay("hitUP1");
}
if ((EnemyPower <= 10) && (EnemyPower > 5)) {
this.GotoAndPlay("hitUP2");
}
if ((EnemyPower < 15) && (EnemyPower > 10)) {
this.GotoAndPlay("hitUP3");
}
if (EnemyPower >= 15) {
this.GotoAndPlay("hitUP4");
}
}
if (Player._y > Enemy._y) {
if (EnemyPower <= 5) {
this.GotoAndPlay("hitDOWN1");
}
if ((EnemyPower <= 10) && (EnemyPower > 5)) {
this.GotoAndPlay("hitDOWN2");
}
if ((EnemyPower < 15) && (EnemyPower > 10)) {
this.GotoAndPlay("hitDOWN3");
}
if (EnemyPower >= 15) {
this.GotoAndPlay("hitDOWN4");
}
}
BallTag = 2;
EnemyPower = random(5) + 20;
EnemyATTACK = true;
PlayerCombo = 0;
BallEnergy = BallEnergy + EnemyPower;
EnemyPlayerDistX = Player._x - this._x;
EnemyPlayerDistY = Player._y - this._y;
EnemyForceX = EnemyPlayerDistX / (Difficulty * 5);
EnemyForceY = EnemyPlayerDistY / (Difficulty * 5);
BallVelX = EnemyForceX;
BallVelY = EnemyForceY;
Ball._xscale = Ball._xscale + (EnemyPower / 3);
Ball._yscale = Ball._yscale + (EnemyPower / 3);
} else if (DoICombo > 30) {
BallTag = 2;
if (EnemyPower <= 5) {
this.GotoAndPlay("hitUP4");
}
if ((EnemyPower <= 10) && (EnemyPower > 5)) {
this.GotoAndPlay("hitUP3");
}
if ((EnemyPower < 15) && (EnemyPower > 10)) {
this.GotoAndPlay("hitUP2");
}
if (EnemyPower >= 15) {
this.GotoAndPlay("hitUP1");
}
EnemyPower = random(10) + 10;
EnemyATTACK = true;
PlayerCombo = 0;
BallEnergy = BallEnergy + EnemyPower;
EnemyPlayerDistX = Enemy._x - Ball._x;
EnemyForceX = EnemyPlayerDistX / EnemyPower;
EnemyForceY = -EnemyPower;
BallVelX = EnemyForceX;
BallVelY = EnemyForceY;
}
} else if (((BallEnergy >= 30) && (BallTag == 1)) && (EnemyChoice < 30)) {
EnemyHURT = true;
PlayerCombo = PlayerCombo + 1;
EnemyHealth = EnemyHealth - (BallEnergy / 3);
EnemyVelX = BallVelX / 2;
EnemyVelY = -5;
Ball._xscale = BallSize;
Ball._yscale = BallSize;
ImpactSound2 = new Sound();
ImpactSound2.attachSound("impactHURT");
PainSound2 = new Sound();
PainSound2.attachSound("painHURT");
if ((EnemyFacingR == true) && (BallVelX > 0)) {
this.gotoAndPlay("HURTback");
EnemyHURTback = true;
BallEnergy = BallEnergy / 3;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingL == true) && (BallVelX < 0)) {
this.gotoAndPlay("HURTback");
EnemyHURTback = true;
BallEnergy = BallEnergy / 3;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingR == true) && (BallVelX < 0)) {
this.gotoAndPlay("HURTfront");
EnemyHURTfront = true;
BallEnergy = BallEnergy / 3;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingL == true) && (BallVelX > 0)) {
this.gotoAndPlay("HURTfront");
EnemyHURTfront = true;
BallEnergy = BallEnergy / 3;
ImpactSound2.start();
PainSound2.start();
}
}
}
if ((EnemyHealth < 1) && (EnemyDEAD == false)) {
EnemyDEAD = true;
EnemyHealthBall._alpha = 0;
Mouse.show();
PlayerScore = PlayerScore + (1000 * StageLevel);
Player.gotoAndPlay("I WIN");
GAMEOVER2._visible = true;
}
if (((this.HITBOX2.hitTest(Ball) && (EnemyHURT == false)) && (EnemyATTACK == false)) && (EnemyDEAD == false)) {
EnemyChoice = random(101);
if (EnemyChoice >= 0) {
if (HIT == false) {
PlayerCombo = PlayerCombo + 1;
meleeflash._visible = true;
meleeflash._x = Ball._x;
meleeflash._y = Ball._y;
meleeflash.gotoAndPlay("POWER");
HIT = true;
}
DoICombo = random(101);
if (DoICombo < 50) {
BallTag = 2;
EnemyPower = random(10) + 20;
this.gotoAndPlay("ATTACK3");
EnemyATTACK = true;
PlayerCombo = 0;
BallEnergy = BallEnergy + EnemyPower;
EnemyPlayerDistX = Player._x - Ball._x;
EnemyPlayerDistY = Player._y - Ball._y;
EnemyForceX = EnemyPlayerDistX / (Difficulty * 5);
EnemyForceY = EnemyPlayerDistY / (Difficulty * 3);
BallVelX = EnemyForceX;
BallVelY = EnemyForceY;
Ball._xscale = Ball._xscale + (EnemyPower / 3);
Ball._yscale = Ball._yscale + (EnemyPower / 3);
} else if (DoICombo >= 50) {
BallTag = 2;
EnemyPower = random(10) + 20;
this.gotoAndPlay("ATTACK3");
EnemyATTACK = true;
PlayerCombo = 0;
BallEnergy = BallEnergy + EnemyPower;
EnemyPlayerDistX = Enemy._x - Ball._x;
EnemyForceX = EnemyPlayerDistX / EnemyPower;
EnemyForceY = -EnemyPower;
BallVelX = EnemyForceX;
BallVelY = EnemyForceY;
Ball._xscale = Ball._xscale + (EnemyPower / 3);
Ball._yscale = Ball._yscale + (EnemyPower / 3);
}
}
}
}
PlayerScore = 0;
StageLevel = 1;
PlayerMass = 5;
Ball._xscale = 30;
Ball._yscale = 30;
BallVelX = 50;
BallVelY = -10;
PlayerCombo = 0;
PlayerMaxCombo = 0;
if (BallType == 3) {
BallMass = 0.5;
} else if (BallType == 2) {
BallMass = 1;
} else if (BallType == 1) {
BallMass = 1.5;
}
BallSize = Ball._xscale;
init();
stop();
Instance of Symbol 552 MovieClip "Ball" in Frame 206
onClipEvent (enterFrame) {
}
Instance of Symbol 1193 MovieClip "Player" in Frame 206
/* no clip actions */
Instance of Symbol 1888 MovieClip "Enemy" in Frame 206
/* no clip actions */
Frame 244
PracticeMusic = new Sound();
PracticeMusic.attachSound("PracticeBGM");
PracticeMusic.start(0, 999);
Frame 245
function init() {
Stage.showMenu = false;
Stage.scaleMode = "showAll";
Mouse.hide();
frictionAirX = 0.99;
frictionAirY = 0.8;
gravity = 1;
sine_lookup_table = "0.000/.0175/.0349/.0523/.0698/.0872/.1045/.1219/.1392/.1564/.1736/.1908/.2079/.2250/.2419/.2588/.2756/.2924/.3090/.3256/.3420/.3584/.3746/.3907/.4067/.4226/.4384/.4540/.4695/.4848/.5000/.5150/.5299/.5446/.5592/.5736/.5878/.6018/.6157/.6428/.6561/.6691/.6820/.6947/.7071/.7193/.7314/.7431/.7547/.7660/.7771/.7880/.7986/.8090/.8192/.8290/.8387/.8480/.8572/.8660/.8746/.8829/.8910/.8988/.9063/.9135/.9205/.9272/.9336/.9397/.9455/.9511/.9563/.9613/.9659/.9703/.9744/.9781/.9816/.9848/.9877/.9903/.9925/.9945/.9962/.9976/.9986/.9994/.9998/1.000";
ServeDistX = target._x - Ball._x;
ServeMovX = ServeDistX / 7;
ServeDistY = target._y - Ball._y;
ServeMovY = ServeDistY / 7;
BallWeight = BallMass * gravity;
BallAccel = BallForce / BallMass;
BallRestX = false;
BallRestY = false;
BallRest = false;
BallEnergy = 30;
BallTag = 1;
meleeflash._visible = false;
WINCOUNT = 0;
LOSECOUNT = 0;
PlayerMass = 1;
PlayerVelX = 0;
PlayerVelY = 0;
PlayerForce = 0;
PlayerWeight = PlayerMass * gravity;
PlayerRestX = true;
PlayerRestY = true;
PlayerRest = true;
PlayerHealth = 100;
PlayerStamina = 100;
PlayerPower = 100;
TechMode = 0;
ATTACK = false;
HURT = false;
HURTfront = false;
HURTback = false;
DEAD = false;
NEUTRAL = true;
CHARGE = false;
TELEPORT = false;
INVINCIBLE = false;
Kame = false;
KameHame = false;
Spiritball = false;
PlayerFacingL = false;
PlayerFacingR = true;
aura._alpha = 0;
spriteINVINC._visible = false;
EnemyVelX = 0;
EnemyVelY = 0;
EnemyPower = 0;
EnemyMass = 1;
EnemyWeight = EnemyMass * gravity;
EnemyHealth = 100;
EnemyRestX = true;
EnemyRestY = true;
EnemyATTACK = false;
EnemyDEAD = false;
EnemyNEUTRAL = true;
EnemyCHARGE = false;
EnemyTELEPORT = false;
EnemyFacingL = true;
EnemyFacingR = false;
TrainerATTACK = false;
TrainerNEUTRAL = true;
TrainerATTACK2 = false;
TrainerNEUTRAL2 = true;
TrainerORBIT = false;
PlayerHealthHUD._visible = true;
BallEnergyHUD._visible = true;
EnemyHealthBall._alpha = 100;
combodisplay._alpha = 0;
combodisplay2._visible = false;
GAMEOVER._visible = false;
GAMEOVER2._visible = false;
pickupHEALTH._visible = false;
pickupINVINCIBILITY._visible = false;
INV = 0;
HPT = 0;
MusicSound = new Sound();
MusicSound.attachSound("bgmusic");
MusicSound.start(0, 9999);
BallEnergyHUD.onEnterFrame = engineENERGY();
Ball.onEnterFrame = engineBALL;
Trainer.onEnterFrame = engineTRAINER;
Player.onEnterFrame = enginePLAYER;
Player.onMouseDown = enginePOWER;
Player.onMouseUp = engineATTACK;
DefendListener.onKeyUp = engineDEFEND;
Enemy.onEnterFrame = engineENEMY;
}
function engineBALL() {
BallWeight = BallMass * gravity;
BallEnergy2 = Math.round(BallEnergy);
if (Spiritball == false) {
if ((BallVelX >= 1) or (BallVelX <= -1)) {
BallRestX = false;
} else {
BallRestX = true;
}
if ((BallVelY >= 1) or (BallVelY <= -1)) {
BallRestY = false;
} else {
BallRestY = true;
}
if ((BallRestX == true) && (BallRestY == true)) {
BallRest = true;
} else {
BallRest = false;
}
}
if (BallEnergy > 0) {
BallEnergy = BallEnergy - 0.1;
}
if (BallEnergy > 100) {
BallEnergy = 100;
}
if (BallEnergy < 0) {
BallEnergy = 0;
}
if (Ball._xscale > BallSize) {
Ball._xscale = Ball._xscale - 0.1;
Ball._yscale = Ball._yscale - 0.1;
}
if (!this.hitTest(ground)) {
if (((BallVelY < 20) && (Spiritball == false)) && (!this.hitTest(ground))) {
BallVelY = BallVelY + BallWeight;
}
}
if ((BallRestX == false) && (Spiritball == false)) {
if (BallVelX != 0) {
BallVelX = BallVelX * frictionAirX;
}
if ((BallVelX < 1) && (BallVelX > -1)) {
BallVelX = 0;
BallRestX = true;
}
}
this._rotation = this._rotation + (BallVelX * 4);
if (this.hitTest(ground)) {
BallEnergy = BallEnergy * 0.95;
}
if (this.hitTest(ground) && (BallVelY > 0)) {
if (EnemyHURT == false) {
PlayerCombo = 0;
}
if (EnemyHURT == true) {
PlayerCombo = PlayerCombo - 1;
}
if (BallVelY >= 5) {
BallVelY = BallVelY * -0.75;
} else if (BallVelY < 5) {
BallVelY = -(Math.round(BallVelY) * 0.3);
}
if ((BallVelY < 1) && (BallVelY >= 0)) {
BallVelY = 0;
BallRestY = true;
}
}
if ((this.hitTest(ground) && (BallVelY > -1)) && (BallVelY < 0)) {
BallVelY = 0;
BallRestY = true;
}
if (this.hitTest(wallRIGHT) && (BallVelX > 0)) {
this._x = this._x - 1;
BallVelX = -BallVelX;
}
if (this.hitTest(wallLEFT) && (BallVelX < 0)) {
this._x = this._x + 1;
BallVelX = BallVelX * -1;
}
if (this.hitTest(wallTOP) && (BallVelY < 0)) {
this._y = this._y + 1;
BallVelY = BallVelY * -1;
}
if (BallVelX > 50) {
BallVelX = 49;
}
if (BallVelX < -50) {
BallVelX = -49;
}
if (BallVelY > 50) {
BallVelY = 49;
}
if (BallVelY < -50) {
BallVelY = -49;
}
this._x = this._x + BallVelX;
this._y = this._y + BallVelY;
BallShadow._x = this._x;
BallShadow._xscale = this._width + (this._y / 3);
if (Spiritball == true) {
SballDistX = target._x - this._x;
SballDistY = target._y - this._y;
BallVelX = BallVelX + (SballDistX / 30);
BallVelY = BallVelY + (SballDistY / 30);
}
if ((Spiritball == true) && (this.hitTest(target))) {
SballDistX = target._x - this._x;
SballDistY = target._y - this._y;
BallVelX = BallVelX * -0.5;
BallVelY = BallVelY * -0.5;
BallTag = 1;
BallEnergy = BallEnergy + 20;
}
if (this.hitTest(Player.BEAhitbox)) {
BallEnergy = BallEnergy + 50;
BallTag = 1;
BallVelX = BallVelX + (Xdist / 10);
BallVelY = BallVelY + (Ydist / 10);
}
if (BallEnergy < 2) {
this.GotoAndStop("NORMAL");
}
if (BallTag == 1) {
if ((BallEnergy < 30) && (BallEnergy >= 2)) {
this.GotoAndStop("WARM1");
}
if ((BallEnergy < 90) && (BallEnergy >= 30)) {
this.GotoAndStop("HOT1");
}
if (BallEnergy >= 90) {
this.GotoAndStop("CHARGED1");
}
} else if (BallTag == 2) {
if ((BallEnergy < 30) && (BallEnergy >= 2)) {
this.GotoAndStop("WARM2");
}
if ((BallEnergy < 90) && (BallEnergy >= 30)) {
this.GotoAndStop("HOT2");
}
if (BallEnergy >= 90) {
this.GotoAndStop("CHARGED2");
}
}
}
function enginePLAYER() {
PlayerWeight = PlayerMass * gravity;
Xdist = _xmouse - Player._x;
Ydist = _ymouse - Player._y;
pi = 57.2957795130823;
angle = Math.atan2(Ydist, Xdist);
hyp = Math.sqrt((Xdist * Xdist) + (Ydist * Ydist));
Sniperline._x = this._x;
Sniperline._y = this._y;
Sniperline._xscale = hyp;
Sniperline._alpha = (hyp / 700) * 100;
Sniperline._rotation = angle * pi;
if ((this.HITBOX.hitTest(Trainer) && (TechMode == 1)) && (TrainerORBIT == false)) {
}
if ((this.HITBOX.hitTest(Trainer) && (Trainer._visible == true)) && (TrainerORBIT == false)) {
this.gotoAndPlay("Catch");
ATTACK = true;
Trainer._visible = false;
}
if (Trainer._visible == false) {
Trainer._x = this._x;
Trainer._y = this._y;
}
if (TechMode == 0) {
TechLogo.gotoAndStop("Shield");
TechLogo._alpha = 100;
CurrentTech = "Shield";
}
if (TechMode == 1) {
TechLogo.gotoAndStop("ForceBlade");
TechLogo._alpha = 100;
CurrentTech = "Force Blade";
} else {
Trainer._visible = false;
}
if (TechMode == 2) {
if (PlayerCombo >= 5) {
TechLogo.gotoAndStop("Spiritball");
CurrentTech = "Spiritball";
TechLogo._alpha = 100;
} else {
TechLogo.gotoAndStop("Spiritball");
TechLogo._alpha = 50;
CurrentTech = "Spiritball (Combo 5)";
}
}
if (TechMode == 3) {
if (PlayerCombo >= 10) {
TechLogo.gotoAndStop("Superbeam");
TechLogo._alpha = 100;
CurrentTech = "Super Beam";
} else {
TechLogo.gotoAndStop("Superbeam");
TechLogo._alpha = 50;
CurrentTech = "Super Beam (Combo 10)";
}
}
if (((Kame == true) && (KameHame == false)) && (PlayerFacingL == true)) {
this._rotation = (angle * pi) + 180;
} else if (((Kame == true) && (KameHame == false)) && (PlayerFacingR == true)) {
this._rotation = angle * pi;
} else if (Kame == false) {
this._rotation = DefaultPlayerRot;
}
if ((Spiritball == true) && (PlayerFacingL == true)) {
this.arm._rotation = ((-angle) * pi) + 180;
} else if ((Spiritball == true) && (PlayerFacingR == true)) {
this.arm._rotation = angle * pi;
}
PlayerScore = Math.round(PlayerScore);
PlayerHealth = Math.round(PlayerHealth);
aura._x = this._x;
aura._y = this._y;
aura._alpha = aura._alpha * 0.99;
TeleportSprite._x = this._x;
TeleportSprite._y = this._y;
if ((PlayerVelY != 0) && (PlayerVelX == 0)) {
TeleportSprite._rotation = 90;
} else if (PlayerVelY == 0) {
TeleportSprite._rotation = 0;
} else if ((PlayerVelY > 0) && (PlayerVelX != 0)) {
TeleportSprite._rotation = PlayerVelY + PlayerVelX;
} else if ((PlayerVelY < 0) && (PlayerVelX != 0)) {
TeleportSprite._rotation = PlayerVelY - PlayerVelX;
}
PowerBAR._height = PlayerForce;
if (PlayerForce >= 100) {
PowerBAR._height = 100;
}
if (ATTACK == true) {
TELEPORT = false;
PowerBAR._alpha = PowerBAR._alpha * 0.8;
}
if (CHARGE == true) {
ATTACK = false;
aura._rotation = AR;
if (PlayerVelY >= 0) {
AR = -(PlayerVelX * 4);
}
if ((PlayerVelY < 0) && (PlayerVelX != 0)) {
AR = -(PlayerVelX * 7);
}
if ((PlayerVelY < 0) && (PlayerVelX == 0)) {
AR = 180;
}
if (PlayerForce < PlayerStamina) {
if (INVINCIBLE == false) {
aura._alpha = aura._alpha + 5;
PlayerForce = PlayerForce + 5;
PlayerPower = PlayerPower - 1;
} else if (INVINCIBLE == true) {
aura._alpha = aura._alpha + 10;
PlayerForce = PlayerForce + 10;
PlayerPower = PlayerPower - 1;
}
}
} else {
aura._alpha = aura._alpha * 0.95;
}
if ((ATTACK == false) && (CHARGE == false)) {
PlayerForce = 0;
PlayerPower = 101;
}
if (((PlayerStamina < 100) && (DEAD == false)) && (INVINCIBLE == false)) {
PlayerStamina = PlayerStamina + StageLevel;
} else if (((PlayerStamina < 100) && (DEAD == false)) && (INVINCIBLE == true)) {
PlayerStamina = PlayerStamina + 10;
}
StaminaBar._height = PlayerStamina;
if (PlayerStamina < 0) {
PlayerStamina = 0;
}
if (PlayerStamina > 100) {
PlayerStamina = 100;
}
if (BallTag == 1) {
BallEnergyHUD.EnergyHUD._x = (-BallEnergy) / 2;
}
if (BallTag == 2) {
BallEnergyHUD.EnergyHUD._x = BallEnergy / 2;
}
if (BallTag == 0) {
BallEnergyHUD.EnergyHUD._x = 0;
}
if (PlayerMaxCombo < PlayerCombo) {
PlayerMaxCombo = PlayerCombo;
}
if (PlayerMaxCombo >= 2) {
MAXcomboDisplay._visible = true;
} else {
MAXcomboDisplay._visible = false;
}
if (PlayerCombo >= 2) {
n = 0;
PlayerComboHUD = PlayerCombo;
combodisplay._alpha = 100;
combodisplay.gotoAndStop(1);
combodisplay2.textColor = 16777215 /* 0xFFFFFF */;
combodisplay2._visible = true;
} else {
n = n + 1;
combodisplay.gotoAndStop(2);
combodisplay2.textColor = 16711680 /* 0xFF0000 */;
if (n > 50) {
combodisplay2._visible = false;
combodisplay._alpha = combodisplay._alpha * 0.9;
}
}
if (PlayerHealthHUD._xscale > 0) {
PlayerHealthHUD._xscale = PlayerHealth / 2;
PlayerHealthHUD._yscale = PlayerHealthHUD._xscale;
}
if (PlayerHealth > 90) {
PlayerHealthHUD.gotoAndStop(1);
} else if ((PlayerHealth > 80) && (PlayerHealth <= 90)) {
PlayerHealthHUD.gotoAndStop(2);
} else if ((PlayerHealth > 70) && (PlayerHealth <= 80)) {
PlayerHealthHUD.gotoAndStop(3);
} else if ((PlayerHealth > 60) && (PlayerHealth <= 70)) {
PlayerHealthHUD.gotoAndStop(4);
} else if ((PlayerHealth > 50) && (PlayerHealth <= 60)) {
PlayerHealthHUD.gotoAndStop(5);
} else if ((PlayerHealth > 40) && (PlayerHealth <= 50)) {
PlayerHealthHUD.gotoAndStop(6);
} else if ((PlayerHealth > 30) && (PlayerHealth <= 40)) {
PlayerHealthHUD.gotoAndStop(7);
} else if ((PlayerHealth > 20) && (PlayerHealth <= 30)) {
PlayerHealthHUD.gotoAndStop(8);
} else if ((PlayerHealth > 10) && (PlayerHealth <= 20)) {
PlayerHealthHUD.gotoAndStop(9);
}
ItemTime = random(1000);
spriteINVINC._x = Player._x + 10;
spriteINVINC._y = Player._y - 10;
if (((ItemTime >= 998) && (pickupINVINCIBILITY._visible == false)) && (INVINCIBLE == false)) {
pickupINVINCIBILITY._visible = true;
pickupINVINCIBILITY._x = random(700) + 100;
pickupINVINCIBILITY._y = random(200) + 100;
}
if (INVINCIBLE == true) {
invincTime = invincTime + 1;
aura._visible = true;
} else {
aura._visible = false;
}
if (pickupINVINCIBILITY._visible == true) {
INV = INV + 1;
if (INV > 100) {
pickupINVINCIBILITY._visible = false;
INV = 0;
}
}
if (invincTime > 150) {
INVINCIBLE = false;
invincTime = 0;
spriteINVINC._visible = false;
}
if ((this.hitTest(pickupINVINCIBILITY) && (pickupINVINCIBILITY._visible == true)) && (HURT == false)) {
INVINCIBLE = true;
invincTime = 0;
INV = 0;
spriteINVINC._visible = true;
pickupINVINCIBILITY._visible = false;
InvincSound = new Sound();
InvincSound.attachSound("speedup");
InvincSound.start(1);
}
if ((Trainer.hitTest(pickupINVINCIBILITY) && (pickupINVINCIBILITY._visible == true)) && (HURT == false)) {
INVINCIBLE = true;
invincTime = 0;
INV = 0;
spriteINVINC._visible = true;
pickupINVINCIBILITY._visible = false;
InvincSound = new Sound();
InvincSound.attachSound("speedup");
InvincSound.start(1);
}
Item2Time = random(1000);
if ((Item2Time >= 998) && (pickupHEALTH._visible == false)) {
pickupHEALTH._visible = true;
pickupHEALTH._x = random(700) + 100;
pickupHEALTH._y = random(200) + 100;
}
if (pickupHEALTH._visible == true) {
HPT = HPT + 1;
if (HPT > 150) {
pickupHEALTH._visible = false;
HPT = 0;
}
}
if (((this.hitTest(pickupHEALTH) && (pickupHEALTH._visible == true)) && (HURT == false)) && (PlayerHealth < 100)) {
PlayerHealth = 100;
HPT = 0;
pickupHEALTH._visible = false;
ReplenishSound = new Sound();
ReplenishSound.attachSound("HealthSound");
ReplenishSound.start();
}
if (((Trainer.hitTest(pickupHEALTH) && (pickupHEALTH._visible == true)) && (HURT == false)) && (PlayerHealth < 100)) {
PlayerHealth = 100;
HPT = 0;
pickupHEALTH._visible = false;
ReplenishSound = new Sound();
ReplenishSound.attachSound("HealthSound");
ReplenishSound.start();
}
if ((PlayerVelX >= 1) || (PlayerVelX <= -1)) {
PlayerRestX = false;
}
if ((PlayerVelY >= 1) || (PlayerVelY <= -1)) {
PlayerRestY = false;
}
if ((PlayerRestX == true) && (PlayerRestY == true)) {
PlayerRest = true;
} else {
PlayerRest = false;
}
if ((((Kame == false) && (Spiritball == false)) && (PlayerRestY == false)) && (EnemyDEAD == false)) {
if ((PlayerVelY < 80) && (!Player.hitTest(ground))) {
PlayerVelY = PlayerVelY + PlayerWeight;
}
}
if ((PlayerRestX == false) && (EnemyDEAD == false)) {
if (PlayerVelX != 0) {
PlayerVelX = PlayerVelX * 0.9;
}
if ((PlayerVelX < 1) && (PlayerVelX > -1)) {
PlayerVelX = 0;
PlayerRestX = true;
}
}
if (Player.hitTest(ground)) {
if (PlayerVelY > 0) {
PlayerVelY = 0;
this._y = 310;
PlayerRestY = true;
}
if (HURTback == true) {
this.gotoAndPlay("HITground");
PlayerVelY = 0;
} else if (HURTfront == true) {
this.gotoAndPlay("HITground2");
PlayerVelY = 0;
}
if (ATTACK == true) {
PlayerVelX = 0;
TELEPORT = false;
PowerBAR._alpha = PowerBAR._alpha * 0.8;
}
}
if (Player.hitTest(wallRIGHT) && (PlayerVelX > 1)) {
Player._x = Player._x - 1;
PlayerVelX = PlayerVelX * -0.5;
if (HURTfront == true) {
this.gotoAndPlay("HURTback");
HURTback = true;
HURTfront = false;
} else if (HURTback == true) {
this.gotoAndPlay("HURTfront");
HURTback = false;
HURTfront = true;
}
}
if (Player.hitTest(wallMIDDLE) && (PlayerVelX > 1)) {
Player._x = Player._x - 1;
PlayerVelX = PlayerVelX * -0.5;
}
if (Player.hitTest(wallLEFT) && (PlayerVelX < 0)) {
Player._x = Player._x + 1;
PlayerVelX = PlayerVelX * -0.5;
if (HURTfront == true) {
this.gotoAndPlay(206);
HURTback = true;
HURTfront = false;
WallImpactSound = new Sound();
WallImpactSound.attachSound("wallIMPACT");
WallImpactSound.start();
} else if (HURTback == true) {
this.gotoAndPlay(239);
HURTback = false;
HURTfront = true;
}
}
if (Player.hitTest(wallTOP) && (PlayerVelY < 1)) {
if (!this.BEAM.HitTest(wallTOP)) {
Player._y = Player._y + 1;
}
PlayerVelY = PlayerVelY * -0.5;
}
if ((((((((HURT == false) && (Spiritball == false)) && (Kame == false)) && (DEAD == false)) && (EnemyDEAD == false)) && (Key.isDown(87))) && (!Key.isDown(65))) && (!Key.isDown(68))) {
if ((ATTACK == false) && (TELEPORT == false)) {
this.gotoAndPlay("FLYup");
}
if (this.hitTest(ground)) {
PlayerVelY = -5;
}
if ((this._y > wallTOP._y) && (PlayerVelY > -3)) {
PlayerVelY = PlayerVelY - 1.1;
}
}
if (((((((!this.hitTest(ground)) && (HURT == false)) && (DEAD == false)) && (Key.isDown(83))) && (EnemyDEAD == false)) && (Kame == false)) && (Spiritball == false)) {
PlayerVelY = PlayerVelY + 1.5;
}
if (((((((((((!this.hitTest(ground)) && (Spiritball == false)) && (Kame == false)) && (HURT == false)) && (DEAD == false)) && (ATTACK == false)) && (TELEPORT == false)) && (Key.isDown(83))) && (!Key.isDown(65))) && (!Key.isDown(68))) && (EnemyDEAD == false)) {
this.gotoAndPlay("FLYdown");
}
if ((((((HURT == false) && (Spiritball == false)) && (Kame == false)) && (DEAD == false)) && (this._x < target._x)) && (EnemyDEAD == false)) {
if (Key.isDown(87)) {
PlayerVelY = PlayerVelY - 2;
}
if ((Key.isDown(65) && (this._x > wallLEFT._x)) && (PlayerVelX > -20)) {
PlayerVelX = PlayerVelX - 5;
}
if ((Key.isDown(65) && (ATTACK == false)) && (TELEPORT == false)) {
this.gotoAndPlay("FLYbackward");
}
if ((Key.isDown(68) && (this._x < 800)) && (PlayerVelX < 20)) {
PlayerVelX = PlayerVelX + 5;
}
if ((Key.isDown(68) && (ATTACK == false)) && (TELEPORT == false)) {
this.gotoAndPlay("FLYforward");
}
} else if ((((((HURT == false) && (Spiritball == false)) && (Kame == false)) && (DEAD == false)) && (EnemyDEAD == false)) && (this._x != target._x)) {
if (Key.isDown(87)) {
PlayerVelY = PlayerVelY - 2;
}
if ((Key.isDown(65) && (this._x > wallLEFT._x)) && (PlayerVelX > -20)) {
PlayerVelX = PlayerVelX - 5;
}
if ((Key.isDown(65) && (ATTACK == false)) && (TELEPORT == false)) {
this.gotoAndPlay("FLYforward");
}
if ((Key.isDown(68) && (this._x < 800)) && (PlayerVelX < 20)) {
PlayerVelX = PlayerVelX + 5;
}
if ((Key.isDown(68) && (ATTACK == false)) && (TELEPORT == false)) {
this.gotoAndPlay("FLYbackward");
}
}
if ((((((((HURT == false) && (DEAD == false)) && (EnemyDEAD == false)) && (!Key.isDown(68))) && (!Key.isDown(65))) && (!Key.isDown(87))) && (ATTACK == false)) && (TELEPORT == false)) {
NEUTRAL = true;
if ((!this.hitTest(ground)) && (!Key.isDown(83))) {
this.gotoAndPlay("FALL");
Player.onEnterFrame = enginePLAYER;
} else if (this.hitTest(ground)) {
this.gotoAndPlay("IDLE");
PlayerVelX = PlayerVelX * 0.7;
}
} else {
NEUTRAL = false;
}
if (((this.HITBOX.hitTest(Ball) && (BallTag > 1)) && (BallEnergy >= 30)) && (INVINCIBLE == false)) {
HURT = true;
ATTACK = false;
Kame = false;
KameHame = false;
Spiritball = false;
CHARGE = false;
aura._alpha = 0;
PlayerForce = 0;
target._visible = false;
PlayerCombo = 0;
PlayerHealth = PlayerHealth - (BallEnergy / BallType);
PlayerVelX = PlayerVelX + (BallVelX / 2);
PlayerVelY = -5;
Ball._xscale = BallSize;
Ball._yscale = BallSize;
ChargeSound.stop("ChargePush");
ImpactSound = new Sound();
ImpactSound.attachSound("impactHURT");
PainSound = new Sound();
PainSound.attachSound("painHURT");
if ((PlayerFacingR == true) && (BallVelX > 0)) {
this.gotoAndPlay("HURTback");
HURTback = true;
BallEnergy = BallEnergy / 3;
ImpactSound.start();
PainSound.start();
}
if ((PlayerFacingL == true) && (BallVelX < 0)) {
this.gotoAndPlay("HURTback");
HURTback = true;
BallEnergy = BallEnergy / 3;
ImpactSound.start();
PainSound.start();
}
if ((PlayerFacingR == true) && (BallVelX < 0)) {
this.gotoAndPlay("HURTfront");
HURTfront = true;
BallEnergy = BallEnergy / 3;
ImpactSound.start();
PainSound.start();
}
if ((PlayerFacingL == true) && (BallVelX > 0)) {
this.gotoAndPlay("HURTfront");
HURTfront = true;
BallEnergy = BallEnergy / 3;
ImpactSound.start();
PainSound.start();
}
if ((BallVelX == 0) && (BallVelY < 0)) {
this.gotoAndPlay("HURTfront");
HURTfront = true;
BallEnergy = BallEnergy / 3;
ImpactSound.start();
PainSound.start();
} else if ((BallVelX == 0) && (BallVelY > 0)) {
this.gotoAndPlay("HURTback");
HURTback = true;
BallEnergy = BallEnergy / 3;
ImpactSound.start();
PainSound.start();
}
}
if ((PlayerHealth < 1) && (DEAD == false)) {
GAMEOVER._visible = true;
GAMEOVER.play();
PlayerHealthHUD._visible = false;
DEAD = true;
Key.removeListener(DefendListener);
Bar._visible = false;
BallEnergyHUD._visible = false;
Mouse.show();
}
if (this.AttackBox.hitTest(Ball)) {
BallTag = 1;
if (HIT == false) {
PlayerCombo = PlayerCombo + 1;
PlayerScore = PlayerScore + (PlayerForce * PlayerCombo);
meleeflash._visible = true;
meleeflash._x = Ball._x;
meleeflash._y = Ball._y;
if (PlayerForce <= 25) {
meleeflash.gotoAndPlay("STALL");
} else if ((PlayerForce <= 50) && (PlayerForce > 25)) {
meleeflash.gotoAndPlay("KICK");
} else if ((PlayerForce < 100) && (PlayerForce > 50)) {
meleeflash.gotoAndPlay("PUNCH");
} else if (PlayerForce >= 100) {
meleeflash.gotoAndPlay("POWER");
}
if ((PlayerCombo > 1) && (PlayerHealth < 100)) {
PlayerHealth = PlayerHealth + 5;
}
HIT = true;
}
if ((ATTACK == true) && (PlayerForce >= 25)) {
z = PlayerForce / 300;
xmov = Xdist * z;
ymov = Ydist * z;
BallVelX = BallVelX + xmov;
BallVelY = BallVelY + ymov;
ChargeRate = 3 * Difficulty;
BallEnergy = BallEnergy + ((PlayerForce / ChargeRate) * (PlayerCombo + 1));
Ball._xscale = Ball._xscale + (PlayerForce / 10);
Ball._yscale = Ball._yscale + (PlayerForce / 10);
}
if ((ATTACK == true) && (PlayerForce < 25)) {
z = PlayerForce / 100;
xmov = Xdist * z;
ymov = Ydist * z;
BallVelX = xmov;
BallVelY = ymov;
BallEnergy = BallEnergy + (PlayerForce / 5);
Ball._xscale = Ball._xscale + (PlayerForce / 10);
Ball._yscale = Ball._yscale + (PlayerForce / 10);
}
}
if (this.SHIELD.hitTest(Ball)) {
PlayerCombo = 0;
PlayerScore = PlayerScore + (PlayerStamina / StageLevel);
meleeflash._visible = true;
meleeflash._x = Ball._x;
meleeflash._y = Ball._y;
if (hyp <= 70) {
meleeflash.gotoAndPlay("STALL");
} else if ((hyp <= 140) && (hyp > 70)) {
meleeflash.gotoAndPlay("KICK");
} else if ((hyp <= 210) && (hyp > 140)) {
meleeflash.gotoAndPlay("PUNCH");
} else if (hyp > 210) {
meleeflash.gotoAndPlay("POWER");
}
if ((ATTACK == true) && (hyp >= 70)) {
xmov = Xdist / 7;
ymov = Ydist / 7;
BallVelX = xmov;
BallVelY = ymov;
BallEnergy = BallEnergy - (hyp / 7);
if (Ball._xscale > BallSize) {
Ball._xscale = Ball._xscale - (hyp / 30);
Ball._yscale = Ball._yscale - (hyp / 30);
}
}
}
if ((this.AttackBox.hitTest(Enemy) && (PlayerForce > 25)) && (EnemyHURT == true)) {
if (HIT == false) {
PlayerCombo = PlayerCombo + 1;
PlayerScore = PlayerScore + (PlayerForce * PlayerCombo);
meleeflash._visible = true;
meleeflash._x = AttackBox._x;
meleeflash._y = AttackBox._y;
if (PlayerForce <= 25) {
meleeflash.gotoAndPlay("STALL");
} else if ((PlayerForce <= 50) && (PlayerForce > 25)) {
meleeflash.gotoAndPlay("KICK");
} else if ((PlayerForce < 100) && (PlayerForce > 50)) {
meleeflash.gotoAndPlay("PUNCH");
} else if (PlayerForce >= 100) {
meleeflash.gotoAndPlay("POWER");
}
if ((PlayerCombo > 1) && (PlayerHealth < 100)) {
PlayerHealth = PlayerHealth + 10;
}
HIT = true;
}
EnemyHURT = true;
EnemyHealth = EnemyHealth - (PlayerForce / 10);
xmov = Xdist / 7;
ymov = Ydist / 7;
EnemyVelX = xmov;
EnemyVelY = ymov;
ImpactSound2 = new Sound();
ImpactSound2.attachSound("impactHURT");
PainSound2 = new Sound();
PainSound2.attachSound("painHURT");
if ((EnemyFacingR == true) && (Player._x < Enemy._x)) {
Enemy.gotoAndPlay("HURTback");
EnemyHURTback = true;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingL == true) && (Player._x > Enemy._x)) {
Enemy.gotoAndPlay("HURTback");
EnemyHURTback = true;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingR == true) && (Player._x > Enemy._x)) {
Enemy.gotoAndPlay("HURTfront");
EnemyHURTfront = true;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingL == true) && (Player._x < Enemy._x)) {
Enemy.gotoAndPlay("HURTfront");
EnemyHURTfront = true;
ImpactSound2.start();
PainSound2.start();
}
}
if (this.AttackBox.hitTest(Enemy) && (INVINCIBLE == true)) {
if (HIT == false) {
PlayerCombo = PlayerCombo + 1;
PlayerScore = PlayerScore + (PlayerForce * PlayerCombo);
meleeflash._visible = true;
meleeflash._x = AttackBox._x;
meleeflash._y = AttackBox._y;
if (PlayerForce <= 25) {
meleeflash.gotoAndPlay("STALL");
} else if ((PlayerForce <= 50) && (PlayerForce > 25)) {
meleeflash.gotoAndPlay("KICK");
} else if ((PlayerForce < 100) && (PlayerForce > 50)) {
meleeflash.gotoAndPlay("PUNCH");
} else if (PlayerForce >= 100) {
meleeflash.gotoAndPlay("POWER");
}
if ((PlayerCombo > 1) && (PlayerHealth < 100)) {
PlayerHealth = PlayerHealth + 10;
}
HIT = true;
}
EnemyHURT = true;
EnemyHealth = EnemyHealth - (PlayerForce / 10);
xmov = Xdist / 7;
ymov = Ydist / 7;
EnemyVelX = xmov;
EnemyVelY = ymov;
ImpactSound2 = new Sound();
ImpactSound2.attachSound("impactHURT");
PainSound2 = new Sound();
PainSound2.attachSound("painHURT");
if ((EnemyFacingR == true) && (Player._x < Enemy._x)) {
Enemy.gotoAndPlay("HURTback");
EnemyHURTback = true;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingL == true) && (Player._x > Enemy._x)) {
Enemy.gotoAndPlay("HURTback");
EnemyHURTback = true;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingR == true) && (Player._x > Enemy._x)) {
Enemy.gotoAndPlay("HURTfront");
EnemyHURTfront = true;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingL == true) && (Player._x < Enemy._x)) {
Enemy.gotoAndPlay("HURTfront");
EnemyHURTfront = true;
ImpactSound2.start();
PainSound2.start();
}
}
if ((((((HURT == false) && (DEAD == false)) && (ATTACK == false)) && (EnemyDEAD == false)) || (Kame == true)) || (Spiritball == true)) {
startDrag ("/target", true);
Mouse.hide();
target._visible = true;
target._alpha = 100;
} else {
stopDrag();
Mouse.show();
target._alpha = 10;
}
if ((Spiritball == false) && (KameHame == false)) {
if (PlayerForce <= 25) {
target.GotoAndStop("SOFT");
}
if ((PlayerForce <= 50) && (PlayerForce > 25)) {
target.GotoAndStop("MEDIUM");
}
if ((PlayerForce < 100) && (PlayerForce > 50)) {
target.GotoAndStop("HARD");
}
if (PlayerForce >= 100) {
target.GotoAndStop("POWER");
}
} else if ((Spiritball == true) || (KameHame == true)) {
target.GotoAndStop("POWER");
}
Player._x = Player._x + PlayerVelX;
Player._y = Player._y + PlayerVelY;
if ((((this._x > target._x) && (HURT == false)) && (ATTACK == false)) && (DEAD == false)) {
this._xscale = -100;
PlayerFacingL = true;
PlayerFacingR = false;
} else if ((((this._x < target._x) && (HURT == false)) && (ATTACK == false)) && (DEAD == false)) {
this._xscale = 100;
PlayerFacingR = true;
PlayerFacingL = false;
}
PlayerShadow._x = Player._x;
if (KameHame == false) {
PlayerShadow._xscale = Player._width + (Player._y / 2);
}
if (StageLevel == 1) {
Rank = "Noob";
} else if (StageLevel == 2) {
Rank = "Initiate";
} else if (StageLevel == 3) {
Rank = "Goon";
} else if (StageLevel == 4) {
Rank = "Thug";
} else if (StageLevel == 5) {
Rank = "Novice";
} else if (StageLevel == 6) {
Rank = "Average";
} else if (StageLevel == 7) {
Rank = "Adept";
} else if (StageLevel == 8) {
Rank = "Warrior";
} else if (StageLevel == 9) {
Rank = "Solid";
} else if (StageLevel == 10) {
Rank = "Liquid";
} else if (StageLevel == 11) {
Rank = "Professional";
} else if (StageLevel == 12) {
Rank = "Prodigy";
} else if (StageLevel == 13) {
Rank = "Monk";
} else if (StageLevel == 14) {
Rank = "Tengu";
} else if (StageLevel == 15) {
Rank = "Jedi";
} else if (StageLevel == 16) {
Rank = "Neo";
} else if (StageLevel == 17) {
Rank = "Dragon";
} else if (StageLevel == 18) {
Rank = "Master";
} else if (StageLevel == 19) {
Rank = "Saiyan";
} else if (StageLevel == 20) {
Rank = "Grand Master";
} else if (StageLevel == 21) {
Rank = "Super Saiyan";
} else if (StageLevel == 22) {
Rank = "Majin";
} else if (StageLevel == 23) {
Rank = "Otaku";
} else if (StageLevel == 24) {
Rank = "Akira";
} else if (StageLevel == 25) {
Rank = "Deity";
} else if (StageLevel == 26) {
Rank = "KYnetiK";
} else if (StageLevel >= 27) {
Rank = "Wastoid";
}
}
function enginePOWER() {
if ((((((HURT == false) && (Spiritball == false)) && (KameHame == false)) && (DEAD == false)) && (EnemyDEAD == false)) && (PlayerForce <= PlayerEnergy)) {
CHARGE = true;
Kame = false;
PowerBAR._alpha = 100;
PlayerForce = 0;
ChargeSound = new Sound();
ChargeSound.attachSound("ChargePush");
ChargeSound.start(1);
}
}
function engineATTACK() {
if (((((((HURT == false) && (Spiritball == false)) && (Kame == false)) && (KameHame == false)) && (DEAD == false)) && (ATTACK == false)) && (EnemyDEAD == false)) {
ATTACK = true;
CHARGE = false;
PlayerStamina = PlayerStamina - PlayerForce;
aura._alpha = aura._alpha * 0.4;
ChargeSound.stop("ChargePush");
if (target._y <= Player._y) {
if (PlayerForce <= 25) {
Player.GotoAndPlay("hitUP1");
}
if ((PlayerForce <= 50) && (PlayerForce > 25)) {
Player.GotoAndPlay("hitUP2");
}
if ((PlayerForce < 100) && (PlayerForce > 50)) {
Player.GotoAndPlay("hitUP3");
}
if (PlayerForce >= 100) {
Player.GotoAndPlay("hitUP4");
}
}
if (target._y > Player._y) {
if (PlayerForce <= 25) {
Player.GotoAndPlay("hitDOWN1");
}
if ((PlayerForce <= 50) && (PlayerForce > 25)) {
Player.GotoAndPlay("hitDOWN2");
}
if ((PlayerForce < 100) && (PlayerForce > 50)) {
Player.GotoAndPlay("hitDOWN3");
}
if (PlayerForce >= 100) {
Player.GotoAndPlay("hitDOWN4");
}
}
}
}
function engineDEFEND() {
if (((Key.getCode() == 81) && (DEAD == false)) && (EnemyDEAD == false)) {
TechMode = TechMode - 1;
if (TechMode < 0) {
TechMode = 3;
}
}
if (((Key.getCode() == 69) && (DEAD == false)) && (EnemyDEAD == false)) {
TechMode = TechMode + 1;
if (TechMode > 3) {
TechMode = 0;
}
}
if ((((ATTACK == false) && (HURT == false)) && (DEAD == false)) && (EnemyDEAD == false)) {
if ((((Key.getCode() == 32) && (TechMode == 3)) && (CHARGE == false)) && (PlayerCombo >= 10)) {
ATTACK = true;
Player.gotoAndPlay("Kamehameha");
Kame = true;
PlayerVelY = 0;
PlayerVelX = 0;
}
if ((((Key.getCode() == 32) && (TechMode == 2)) && (CHARGE == false)) && (PlayerCombo >= 5)) {
ATTACK = true;
Player.gotoAndPlay("Spiritball");
Spiritball = true;
PlayerVelY = 0;
PlayerVelX = 0;
}
if (((Key.getCode() == 32) && (TechMode == 1)) && (Trainer._visible == false)) {
TrainerORBIT = true;
ATTACK = true;
Player.gotoAndPlay("ForceBlade");
Trainer._visible = true;
TO = 0;
}
if ((Key.getCode() == 32) && (TechMode == 0)) {
Player.gotoAndPlay("SHIELD");
ATTACK = true;
PlayerStamina = PlayerStamina / 5;
}
if (Key.getCode() == 16) {
Player.gotoAndPlay("TELEPORT");
TeleportSprite.gotoAndPlay("2");
TELEPORT = true;
PlayerStamina = PlayerStamina / 3;
PlayerScore = PlayerScore + (PlayerStamina * StageLevel);
TeleportSound = new Sound();
TeleportSound.attachSound("SuperSpeed");
TeleportSound.start();
}
}
}
function engineTRAINER() {
if (DEAD == false) {
this._x = this._x + TrainerVelX;
this._y = this._y + TrainerVelY;
TrainerNEUTRAL = true;
MydistX = _xmouse - this._x;
MydistY = _ymouse - this._y;
Mydir = Math.atan2(MydistY, MydistX);
this._rotation = Mydir * pi;
} else {
TrainerNEUTRAL == false;
}
if (this.hitTest(ground) && (TrainerVelY > 0)) {
TrainerVelY = TrainerVelY * -0.5;
}
if (this.hitTest(wallRIGHT) && (TrainerVelX > 0)) {
this._x = this._x - 1;
TrainerVelX = TrainerVelX * -0.5;
}
if (this.hitTest(wallLEFT) && (TrainerVelX < 0)) {
this._x = this._x + 1;
TrainerVelX = TrainerVelX * -0.5;
}
if (this.hitTest(wallTOP) && (TrainerVelY < 0)) {
this._y = this._y + 1;
TrainerVelY = TrainerVelY * -0.5;
}
if (TrainerORBIT == true) {
TO = TO + 1;
if (TO >= 15) {
TO = 0;
TrainerORBIT = false;
}
Txdist = target._x - this._x;
Tydist = target._y - this._y;
TrainerVelX = TrainerVelX + (Txdist / 50);
TrainerVelY = TrainerVelY + (Tydist / 50);
} else {
Txdist = Player._x - this._x;
Tydist = Player._y - this._y;
TrainerVelX = TrainerVelX + (Txdist / 50);
TrainerVelY = TrainerVelY + (Tydist / 50);
}
TrainerVelX = TrainerVelX * 0.9;
if ((((this.hitTest(Ball) && (this._visible == true)) && (DEAD == false)) && (EnemyDEAD == false)) && (TrainerATTACK == false)) {
ReflectSound = new Sound();
ReflectSound.attachSound("reflect");
ReflectSound.start();
TrainerORBIT = false;
TrainerVelX = 0;
TrainerVelY = 0;
BallTag = 1;
PlayerCombo = PlayerCombo + 1;
this.gotoAndPlay("ATTACK2");
TrainerATTACK = true;
TrainerPlayerDistX = Player._x - this._x;
TrainerForceX = TrainerPlayerDistX / 15;
TrainerForceY = -20;
BallVelX = TrainerForceX;
BallVelY = BallVelY + TrainerForceY;
}
}
function engineENEMY() {
EnemyBallDistX2 = random(5) + 1;
EnemyBallDistY2 = random(5) + 1;
EnemyMovX2 = EnemyBallDistX2 - random(7);
EnemyMovY2 = EnemyBallDistY2 - random(7);
EnemyAccel = (random(7) + 20) / StageLevel;
if ((BallTag == 2) || (BallTag == 0)) {
EnemyBallDistX = Ball._x - this._x;
EnemyBallDistY = Ball._y - this._y;
EnemyMovX = (EnemyBallDistX / EnemyAccel) * 2;
EnemyMovY = (EnemyBallDistY / EnemyAccel) * 2;
}
if (BallTag == 1) {
EnemyBallDistX = Ball._x - this._x;
EnemyBallDistY = Ball._y - this._y;
EnemyMovX = (EnemyBallDistX / EnemyAccel) / 2;
EnemyMovY = (EnemyBallDistY / EnemyAccel) / 2;
}
if (((EnemyHURT == false) && (EnemyATTACK == false)) && (DEAD == false)) {
this._x = this._x + EnemyMovX;
this._y = this._y + EnemyMovY;
}
if (EnemyHURT == true) {
this._x = this._x + EnemyVelX;
this._y = this._y + EnemyVelY;
}
if (EnemyHURT == true) {
if (!this.hitTest(ground)) {
EnemyVelY = EnemyVelY + 1;
EnemyVelX = EnemyVelX * 0.95;
EnemyMovY = EnemyMovY + PlayerMass;
EnemyMovX = EnemyMovX * 0.95;
}
}
EnemyTeleportNOW = random(101);
if ((((((EnemyTeleport == false) && (EnemyTeleportNOW > 99)) && (EnemyHURT == false)) && (EnemyATTACK == false)) && (DEAD == false)) && (EnemyDEAD == false)) {
Enemy.gotoAndPlay("TELEPORT");
EnemyTeleport = true;
}
if (EnemyHURT == true) {
EnemyATTACK == false;
}
if (Enemy.hitTest(Player.BEAhitbox)) {
EnemyHURT = true;
PlayerCombo = PlayerCombo + 1;
EnemyHealth = EnemyHealth - 1;
EnemyVelX = Xdist / 30;
EnemyVelY = Ydist / 30;
ImpactSound2 = new Sound();
ImpactSound2.attachSound("impactHURT");
PainSound2 = new Sound();
PainSound2.attachSound("painHURT");
if ((EnemyFacingR == true) && (Player._x < this._x)) {
this.gotoAndPlay("HURTback");
EnemyHURTback = true;
BallEnergy = BallEnergy / 3;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingL == true) && (Player._x > this._x)) {
this.gotoAndPlay("HURTback");
EnemyHURTback = true;
BallEnergy = BallEnergy / 3;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingR == true) && (Player._x > this._x)) {
this.gotoAndPlay("HURTfront");
EnemyHURTfront = true;
BallEnergy = BallEnergy / 3;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingL == true) && (Player._x < this._x)) {
this.gotoAndPlay("HURTfront");
EnemyHURTfront = true;
BallEnergy = BallEnergy / 3;
ImpactSound2.start();
PainSound2.start();
}
}
if (((Enemy.hitTest(Ball) && (BallEnergy >= 30)) && (BallTag == 1)) && (EnemyHURT == true)) {
EnemyHURT = true;
PlayerCombo = PlayerCombo + 1;
EnemyHealth = EnemyHealth - (BallEnergy / 3);
EnemyVelX = BallVelX / 2;
EnemyVelY = -5;
Ball._xscale = BallSize;
Ball._yscale = BallSize;
ImpactSound2 = new Sound();
ImpactSound2.attachSound("impactHURT");
PainSound2 = new Sound();
PainSound2.attachSound("painHURT");
if ((EnemyFacingR == true) && (BallVelX > 0)) {
this.gotoAndPlay("HURTback");
EnemyHURTback = true;
BallEnergy = BallEnergy / 3;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingL == true) && (BallVelX < 0)) {
this.gotoAndPlay("HURTback");
EnemyHURTback = true;
BallEnergy = BallEnergy / 3;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingR == true) && (BallVelX < 0)) {
this.gotoAndPlay("HURTfront");
EnemyHURTfront = true;
BallEnergy = BallEnergy / 3;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingL == true) && (BallVelX > 0)) {
this.gotoAndPlay("HURTfront");
EnemyHURTfront = true;
BallEnergy = BallEnergy / 3;
ImpactSound2.start();
PainSound2.start();
}
}
if (((EnemyHURT == false) && (DEAD == false)) && (EnemyDEAD == false)) {
if (((((EnemyMovY < 0) && (EnemyMovX >= -1)) && (EnemyMovX <= 1)) && (EnemyATTACK == false)) && (EnemyTELEPORT == false)) {
this.gotoAndPlay("FLYup");
}
}
if (((((((((!this.hitTest(ground)) && (EnemyMovX >= -1)) && (EnemyMovX <= 1)) && (EnemyMovY > 0)) && (EnemyHURT == false)) && (DEAD == false)) && (EnemyATTACK == false)) && (EnemyTELEPORT == false)) && (EnemyDEAD == false)) {
this.gotoAndPlay("FLYdown");
}
if ((((EnemyHURT == false) && (DEAD == false)) && (this._x < Player._x)) && (EnemyDEAD == false)) {
if (((EnemyMovX < -1) && (EnemyATTACK == false)) && (EnemyTELEPORT == false)) {
this.gotoAndPlay("FLYbackward");
}
if (((EnemyMovX > 1) && (EnemyATTACK == false)) && (EnemyTELEPORT == false)) {
this.gotoAndPlay("FLYforward");
}
} else if ((((EnemyHURT == false) && (DEAD == false)) && (EnemyDEAD == false)) && (this._x > Player._x)) {
if (((EnemyMovX > 1) && (EnemyATTACK == false)) && (EnemyTELEPORT == false)) {
this.gotoAndPlay("FLYbackward");
}
if (((EnemyMovX < -1) && (EnemyATTACK == false)) && (EnemyTELEPORT == false)) {
this.gotoAndPlay("FLYforward");
}
}
EnemyShadow._x = Enemy._x;
EnemyShadow._xscale = Enemy._width + (Enemy._y / 2);
if ((EnemyATTACK == false) && (EnemyHURT == false)) {
if (this._x > Player._x) {
this._xscale = 90;
EnemyFacingL = true;
EnemyFacingR = false;
} else if (this._x < Player._x) {
this._xscale = -90;
EnemyFacingR = true;
EnemyFacingL = false;
}
}
if (DEAD == false) {
if (this.hitTest(ground)) {
if ((EnemyHURT == false) && (EnemyMovY > 0)) {
this._y = 310;
}
if ((EnemyHURT == true) && (EnemyVelY > 0)) {
this._y = 310;
}
if (EnemyHURTback == true) {
this.gotoAndPlay("HITground");
EnemyVelX = 0;
} else if (EnemyHURTfront == true) {
this.gotoAndPlay("HITground2");
EnemyVelX = 0;
}
}
if (this.hitTest(wallRIGHT)) {
Enemy._x = Enemy._x - 1;
EnemyVelX = EnemyVelX * -0.5;
EnemyMovX = EnemyMovX * -1.1;
if ((EnemyHURTfront == true) && (EnemyVelX < -1)) {
this.gotoAndPlay("HURTback");
EnemyHURTback = true;
EnemyHURTfront = false;
} else if ((EnemyHURTback == true) && (EnemyVelX < -1)) {
this.gotoAndPlay("HURTfront");
EnemyHURTback = false;
EnemyHURTfront = true;
}
}
if (this.hitTest(wallLEFT)) {
Enemy._x = Enemy._x + 1;
EnemyVelX = EnemyVelX * -0.5;
EnemyMovX = EnemyMovX * -1.1;
if ((EnemyHURTfront == true) && (EnemyVelX > 1)) {
this.gotoAndPlay(206);
EnemyHURTback = true;
EnemyHURTfront = false;
WallImpactSound = new Sound();
WallImpactSound.attachSound("wallIMPACT");
WallImpactSound.start();
} else if ((EnemyHURTback == true) && (EnemyVelX > 1)) {
this.gotoAndPlay(239);
EnemyHURTback = false;
EnemyHURTfront = true;
}
}
if (this.hitTest(wallTOP) && (EnemyVelY < 1)) {
Enemy._y = Enemy._y + 1;
EnemyVelY = EnemyVelY * -0.5;
}
}
EnemyHealthBall._xscale = EnemyHealth / 2;
EnemyHealthBall._yscale = EnemyHealthBall._xscale;
if (((this.HITBOX.hitTest(Ball) && (EnemyHURT == false)) && (EnemyATTACK == false)) && (EnemyDEAD == false)) {
EnemyChoice = random(101);
if (EnemyChoice >= 30) {
PlayerCombo = 0;
EnemyPower = random(24) + 1;
meleeflash._visible = true;
meleeflash._x = Ball._x;
meleeflash._y = Ball._y;
meleeflash.gotoAndPlay("POWER");
DoICombo = random(101);
if (DoICombo <= 50) {
if (Player._y <= Enemy._y) {
if (EnemyPower <= 5) {
this.GotoAndPlay("hitUP4");
} else if ((EnemyPower <= 10) && (EnemyPower > 5)) {
this.GotoAndPlay("hitUP3");
} else if ((EnemyPower < 15) && (EnemyPower > 10)) {
this.GotoAndPlay("hitUP2");
} else if (EnemyPower >= 15) {
this.GotoAndPlay("hitUP1");
}
}
if (Player._y > Enemy._y) {
if (EnemyPower <= 5) {
this.GotoAndPlay("hitDOWN4");
} else if ((EnemyPower <= 10) && (EnemyPower > 5)) {
this.GotoAndPlay("hitDOWN3");
} else if ((EnemyPower < 15) && (EnemyPower > 10)) {
this.GotoAndPlay("hitDOWN2");
} else if (EnemyPower >= 15) {
this.GotoAndPlay("hitDOWN1");
}
}
BallTag = 2;
EnemyATTACK = true;
PlayerCombo = 0;
BallEnergy = BallEnergy + EnemyPower;
EnemyPlayerDistX = Player._x - this._x;
EnemyPlayerDistY = Player._y - this._y;
EnemyForceX = EnemyPlayerDistX / EnemyPower;
EnemyForceY = EnemyPlayerDistY / EnemyPower;
BallVelX = EnemyForceX;
BallVelY = EnemyForceY;
Ball._xscale = Ball._xscale + (EnemyPower / 3);
Ball._yscale = Ball._yscale + (EnemyPower / 3);
} else if (DoICombo > 50) {
BallTag = 2;
if (EnemyPower <= 5) {
this.GotoAndPlay("hitUP1");
} else if ((EnemyPower <= 10) && (EnemyPower > 5)) {
this.GotoAndPlay("hitUP2");
} else if ((EnemyPower < 15) && (EnemyPower > 10)) {
this.GotoAndPlay("hitUP3");
} else if (EnemyPower >= 15) {
this.GotoAndPlay("hitUP4");
}
EnemyATTACK = true;
PlayerCombo = 0;
BallEnergy = BallEnergy + EnemyPower;
EnemyPlayerDistX = Enemy._x - Ball._x;
EnemyForceX = EnemyPlayerDistX / EnemyPower;
EnemyForceY = -EnemyPower;
BallVelX = EnemyForceX;
BallVelY = EnemyForceY;
}
} else if (((BallEnergy >= 30) && (BallTag == 1)) && (EnemyChoice < 30)) {
EnemyHURT = true;
PlayerCombo = PlayerCombo + 1;
EnemyHealth = EnemyHealth - (((PlayerCombo + 1) * BallEnergy) / 10);
EnemyVelX = BallVelX / 2;
EnemyVelY = -5;
Ball._xscale = BallSize;
Ball._yscale = BallSize;
ImpactSound2 = new Sound();
ImpactSound2.attachSound("impactHURT");
PainSound2 = new Sound();
PainSound2.attachSound("painHURT");
if ((EnemyFacingR == true) && (BallVelX > 0)) {
this.gotoAndPlay("HURTback");
EnemyHURTback = true;
BallEnergy = BallEnergy / 3;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingL == true) && (BallVelX < 0)) {
this.gotoAndPlay("HURTback");
EnemyHURTback = true;
BallEnergy = BallEnergy / 3;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingR == true) && (BallVelX < 0)) {
this.gotoAndPlay("HURTfront");
EnemyHURTfront = true;
BallEnergy = BallEnergy / 3;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingL == true) && (BallVelX > 0)) {
this.gotoAndPlay("HURTfront");
EnemyHURTfront = true;
BallEnergy = BallEnergy / 3;
ImpactSound2.start();
PainSound2.start();
}
}
}
if ((EnemyHealth < 1) && (EnemyDEAD == false)) {
EnemyDEAD = true;
EnemyHealthBall._alpha = 0;
Mouse.show();
Kame = false;
KameHame = false;
Spiritball = false;
PlayerScore = PlayerScore + (1000 * StageLevel);
Player.gotoAndPlay("I WIN");
GAMEOVER2._visible = true;
}
}
PlayerScore = 0;
StageLevel = 1;
StageLevelE = 0;
PlayerMass = 1.7;
Ball._xscale = 50;
Ball._yscale = 50;
BallVelX = 0;
BallVelY = -25;
PlayerCombo = 0;
PlayerMaxCombo = 0;
DefendListener = new Object();
Key.addListener(DefendListener);
DefaultPlayerRot = Player._rotation;
DefaultBeamRot = Player._rotation;
Trainer._visible = false;
aura._visible = false;
if (BallType == 3) {
BallMass = 0.5;
} else if (BallType == 2) {
BallMass = 1;
} else if (BallType == 1) {
BallMass = 1.5;
}
BallSize = Ball._xscale;
init();
stop();
Instance of Symbol 552 MovieClip "Ball" in Frame 245
onClipEvent (enterFrame) {
}
Instance of Symbol 1193 MovieClip "Player" in Frame 245
/* no clip actions */
Instance of Symbol 1888 MovieClip "Enemy" in Frame 245
/* no clip actions */
Instance of Symbol 1193 MovieClip "Player" in Frame 267
/* no clip actions */
Instance of Symbol 1888 MovieClip "Enemy" in Frame 267
/* no clip actions */
Instance of Symbol 552 MovieClip "Ball" in Frame 267
onClipEvent (enterFrame) {
}
Frame 268
function init() {
Stage.showMenu = false;
Stage.scaleMode = "showAll";
Mouse.hide();
frictionAirX = 0.99;
frictionAirY = 0.8;
gravity = 1;
sine_lookup_table = "0.000/.0175/.0349/.0523/.0698/.0872/.1045/.1219/.1392/.1564/.1736/.1908/.2079/.2250/.2419/.2588/.2756/.2924/.3090/.3256/.3420/.3584/.3746/.3907/.4067/.4226/.4384/.4540/.4695/.4848/.5000/.5150/.5299/.5446/.5592/.5736/.5878/.6018/.6157/.6428/.6561/.6691/.6820/.6947/.7071/.7193/.7314/.7431/.7547/.7660/.7771/.7880/.7986/.8090/.8192/.8290/.8387/.8480/.8572/.8660/.8746/.8829/.8910/.8988/.9063/.9135/.9205/.9272/.9336/.9397/.9455/.9511/.9563/.9613/.9659/.9703/.9744/.9781/.9816/.9848/.9877/.9903/.9925/.9945/.9962/.9976/.9986/.9994/.9998/1.000";
Cliff.gotoAndStop(1);
WALLDIE = false;
Cliff2.gotoAndStop(1);
WALLDIE2 = false;
tree.gotoAndStop(1);
TREEDIE = false;
ServeDistX = TargetReticle._x - Ball._x;
ServeMovX = ServeDistX / 7;
ServeDistY = TargetReticle._y - Ball._y;
ServeMovY = ServeDistY / 7;
Ball._x = 442;
Ball._y = 305;
BallVelX = 0;
BallVelY = -15;
BallWeight = BallMass * gravity;
BallAccel = BallForce / BallMass;
BallRestX = true;
BallRestY = false;
BallRest = false;
BallEnergy = 0;
BallTag = 1;
meleeflash._visible = false;
WINCOUNT = 0;
LOSECOUNT = 0;
PlayerMass = 1;
PlayerForce = 0;
PlayerWeight = PlayerMass * gravity;
PlayerRestX = true;
PlayerRestY = false;
PlayerRest = false;
PlayerHealth = 100;
PlayerStamina = 100;
PlayerPower = 100;
ATTACK = false;
HURT = false;
HURTfront = false;
HURTback = false;
RECOVER = false;
DEAD = false;
NEUTRAL = true;
CHARGE = false;
TELEPORT = false;
INVINCIBLE = false;
Kame = false;
KameHame = false;
Spiritball = false;
PlayerFacingL = false;
PlayerFacingR = true;
aura._alpha = 0;
spriteINVINC._visible = false;
EnemyVelX = 0;
EnemyVelY = 0;
EnemyPower = 0;
EnemyMass = 1;
EnemyWeight = EnemyMass * gravity;
EnemyHealth = 100;
EnemyRestX = true;
EnemyRestY = true;
EnemyATTACK = false;
EnemyDEAD = false;
EnemyNEUTRAL = true;
EnemyCHARGE = false;
EnemyTELEPORT = false;
EnemyFacingL = true;
EnemyFacingR = false;
TrainerATTACK = false;
TrainerNEUTRAL = true;
TrainerATTACK2 = false;
TrainerNEUTRAL2 = true;
TrainerORBIT = false;
ORB2VelX = 5;
ORB2VelY = 2;
PlayerHealthHUD._visible = true;
BallEnergyHUD._visible = true;
EnemyHealthBall._alpha = 100;
combodisplay._alpha = 0;
combodisplay2._visible = false;
GAMEOVER._visible = false;
GAMEOVER2._visible = false;
pickupHEALTH._visible = false;
pickupINVINCIBILITY._visible = false;
INV = 0;
HPT = 0;
LandSound = new Sound();
LandSound.attachSound("LandWav");
MusicSound = new Sound();
MusicSound.attachSound("bgmusic");
BallEnergyHUD.onEnterFrame = engineENERGY();
Ball.onEnterFrame = engineBALL;
Trainer.onEnterFrame = engineTRAINER;
Player.onEnterFrame = enginePLAYER;
Player.onMouseDown = enginePOWER;
Player.onMouseUp = engineATTACK;
if (TrainingMode == 0) {
ORB._visible = false;
Enemy._visible = false;
EnemyShadow._visible = false;
}
if (TrainingMode == 1) {
ORB.onEnterFrame = engineORB;
ORB._visible = true;
Enemy._visible = false;
EnemyShadow._visible = false;
}
DefendListener.onKeyUp = engineDEFEND;
if (TrainingMode == 2) {
Enemy.onEnterFrame = engineENEMY;
ORB._visible = false;
Enemy._visible = true;
EnemyShadow._visible = true;
}
}
function engineBALL() {
BallWeight = BallMass * gravity;
BallEnergy2 = Math.round(BallEnergy);
if (Spiritball == false) {
if ((BallVelX >= 1) or (BallVelX <= -1)) {
BallRestX = false;
} else {
BallRestX = true;
}
if ((BallVelY >= 1) or (BallVelY <= -1)) {
BallRestY = false;
} else {
BallRestY = true;
}
if ((BallRestX == true) && (BallRestY == true)) {
BallRest = true;
} else {
BallRest = false;
}
}
BallEnergyBar._yscale = BallEnergy;
if (BallEnergy > 0) {
BallEnergy = BallEnergy - 0.1;
}
if (BallEnergy > 100) {
BallEnergy = 100;
BallEnergyBar._yscale = 100;
}
if (BallEnergy < 0) {
BallEnergy = 0;
}
if (!this.hitTest(ground)) {
if (((BallVelY < 20) && (Spiritball == false)) && (!this.hitTest(ground))) {
BallVelY = BallVelY + BallWeight;
}
}
if ((BallRestX == false) && (Spiritball == false)) {
if (BallVelX != 0) {
BallVelX = BallVelX * frictionAirX;
}
if ((BallVelX < 1) && (BallVelX > -1)) {
BallVelX = 0;
BallRestX = true;
}
}
this._rotation = this._rotation + (BallVelX * 4);
if (this.hitTest(ground)) {
BallEnergy = BallEnergy * 0.95;
}
if (this.hitTest(ground) && (BallVelY > 0)) {
if ((BallEnergy < 80) && (EnemyHURT == false)) {
PlayerCombo = 0;
}
if (BallVelY >= 5) {
BallVelY = BallVelY * -0.75;
} else if (BallVelY < 5) {
BallVelY = -(Math.round(BallVelY) * 0.3);
}
if ((BallVelY < 1) && (BallVelY >= 0)) {
BallVelY = 0;
BallRestY = true;
}
}
if ((this.hitTest(ground) && (BallVelY > -1)) && (BallVelY < 0)) {
BallVelY = 0;
BallRestY = true;
}
if (this.hitTest(wallRIGHT) && (BallVelX > 0)) {
this._x = this._x - 1;
BallVelX = -BallVelX;
BARRIER.gotoAndPlay("HITRIGHT");
}
if (this.hitTest(wallLEFT) && (BallVelX < 0)) {
this._x = this._x + 1;
BallVelX = BallVelX * -1;
BARRIER.gotoAndPlay("HITLEFT");
}
if (this.hitTest(wallTOP) && (BallVelY < 0)) {
this._y = this._y + 1;
BallVelY = BallVelY * -1;
BARRIER.gotoAndPlay("HITTOP");
}
if (BallVelX > 50) {
BallVelX = 49;
}
if (BallVelX < -50) {
BallVelX = -49;
}
if (BallVelY > 50) {
BallVelY = 49;
}
if (BallVelY < -50) {
BallVelY = -49;
}
this._x = this._x + BallVelX;
this._y = this._y + BallVelY;
BallShadow._x = this._x;
BallShadow._x = BallShadow._x + (-PlayerVelX);
BallShadow._y = ground._y;
BallHeight = wallTOP._y - ground._y;
BallShadow._xscale = (this._y - wallTOP._y) / 4;
if (Spiritball == true) {
if (!this.hitTest(TargetReticle)) {
SballDistX = TargetReticle._x - this._x;
SballDistY = TargetReticle._y - this._y;
}
BallVelX = BallVelX + (SballDistX / 50);
BallVelY = BallVelY + (SballDistY / 50);
bluey._visible = true;
bluey._x = this._x;
bluey._y = this._y;
bluey._rotation = bluey._rotation + random(360);
}
if (Spiritball == false) {
bluey._visible = false;
}
if ((Spiritball == true) && (this.hitTest(TargetReticle))) {
SballDistX = -(TargetReticle._x - this._x);
SballDistY = -(TargetReticle._y - this._y);
BallVelX = BallVelX / 1.1;
BallVelY = BallVelY / 1.1;
BallTag = 1;
BallEnergy = BallEnergy + 20;
}
if (this.hitTest(Player.BEAhitbox)) {
BallEnergy = BallEnergy + 50;
BallTag = 1;
meleeflash._visible = true;
meleeflash._x = Ball._x;
meleeflash._y = Ball._y;
meleeflash.gotoAndPlay("blue");
BallVelX = BallVelX + (Xdist / 10);
BallVelY = BallVelY + (Ydist / 10);
}
if (this.hitTest(Player.hurricane.ring)) {
PlayerCombo = PlayerCombo + 1;
meleeflash._visible = true;
meleeflash._x = Ball._x;
meleeflash._y = Ball._y;
meleeflash.gotoAndPlay("blue");
BallEnergy = BallEnergy + 10;
BallTag = 1;
BallVelX = BallVelX + (random(20) - random(20));
BallVelY = BallVelY + (-random(20));
}
if (BallEnergy < 2) {
this.GotoAndStop("NORMAL");
BallEnergyBar.gotoAndStop("Ball0");
}
if (BallTag == 1) {
BallEnergyBar.gotoAndStop("Ball1");
if ((BallEnergy < 30) && (BallEnergy >= 2)) {
this.GotoAndStop("WARM1");
}
if ((BallEnergy < 90) && (BallEnergy >= 30)) {
this.GotoAndStop("HOT1");
}
if (BallEnergy >= 90) {
this.GotoAndStop("CHARGED1");
}
} else if (BallTag == 2) {
BallEnergyBar.gotoAndStop("Ball2");
if ((BallEnergy < 30) && (BallEnergy >= 2)) {
this.GotoAndStop("WARM2");
}
if ((BallEnergy < 90) && (BallEnergy >= 30)) {
this.GotoAndStop("HOT2");
}
if (BallEnergy >= 90) {
this.GotoAndStop("CHARGED2");
}
}
}
function enginePLAYER() {
PlayerWeight = PlayerMass * gravity;
meleeflash._rotation = meleeflash._rotation + random(360);
this.ShieldSparks._rotation = this.ShieldSparks._rotation + random(360);
if (ATTACK == false) {
Xdist = _xmouse - Player._x;
Ydist = _ymouse - Player._y;
}
if ((ATTACK == true) && (Kame == true)) {
Xdist = _xmouse - Player._x;
Ydist = _ymouse - Player._y;
}
if ((ATTACK == true) && (Spiritball == true)) {
Xdist = _xmouse - Player._x;
Ydist = _ymouse - Player._y;
}
if ((ATTACK == true) && (HADOUKEN == true)) {
Xdist = _xmouse - Player._x;
Ydist = _ymouse - Player._y;
}
pi = 57.2957795130823;
angle = Math.atan2(Ydist, Xdist);
hyp = Math.sqrt((Xdist * Xdist) + (Ydist * Ydist));
Sniperline._x = this._x;
Sniperline._y = this._y;
Sniperline._xscale = hyp;
Sniperline._alpha = (hyp / 200) * 100;
Sniperline._rotation = angle * pi;
MYANGLE = angle * pi;
EtoPdistX = Enemy._x - Player._x;
EtoPdistY = Enemy._y - Player._y;
EnemyAngle = Math.atan2(EtoPdistY, EtoPdistX);
EnemyHyp = Math.sqrt((EtoPdistX * EtoPdistX) + (EtoPdistY * EtoPdistY));
if (Enemy._visible == true) {
Sniperline2._visible = true;
} else {
Sniperline2._visible = false;
}
Sniperline2._x = this._x;
Sniperline2._y = this._y;
Sniperline2._xscale = EnemyHyp;
Sniperline2._alpha = (EnemyHyp / 200) * 100;
Sniperline2._rotation = EnemyAngle * pi;
EnemyAngle2 = (EnemyAngle * pi) + 180;
BtoPdistX = Ball._x - Player._x;
BtoPdistY = Ball._y - Player._y;
BallAngle = Math.atan2(BtoPdistY, BtoPdistX);
BallHyp = Math.sqrt((BtoPdistX * BtoPdistX) + (BtoPdistY * BtoPdistY));
if (Ball._visible == true) {
Sniperline3._visible = true;
} else {
Sniperline3._visible = false;
}
Sniperline3._x = this._x;
Sniperline3._y = this._y;
Sniperline3._xscale = BallHyp;
Sniperline3._alpha = (BallHyp / 200) * 100;
Sniperline3._rotation = BallAngle * pi;
if ((this.HITBOX.hitTest(Trainer) && (Trainer._visible == true)) && (TrainerORBIT == false)) {
this.gotoAndPlay("Catch");
Trainer.gotoAndPlay("ATTACK2");
ATTACK = true;
TrainerVelX = 0;
TrainerVelY = 0;
}
if (Trainer._visible == false) {
Trainer._x = this._x;
Trainer._y = this._y;
Trainer.gotoAndStop(1);
}
if (GodMode == false) {
if (TechMode == 0) {
TechLogo.gotoAndStop("Shield");
TechLogo._alpha = 100;
CurrentTech = "Negative Barrier";
DOSHIELD = false;
}
if (TechMode == 1) {
TechLogo.gotoAndStop("ForceBlade");
TechLogo._alpha = 100;
CurrentTech = "Force Blade";
DOSHIELD = false;
} else {
Trainer._visible = false;
}
if (TechMode == 4) {
if (MySuper >= 20) {
TechLogo.gotoAndStop("Spiritball");
CurrentTech = "Spiritball";
TechLogo._alpha = 100;
DOSHIELD = false;
} else if (MySuper < 20) {
TechLogo.gotoAndStop("NA");
CurrentTech = "(Super Cost 20)";
DOSHIELD = true;
}
}
if (TechMode == 5) {
if (MySuper >= 30) {
TechLogo.gotoAndStop("Superbeam");
TechLogo._alpha = 100;
CurrentTech = "Super Beam";
DOSHIELD = false;
} else if (MySuper < 30) {
TechLogo.gotoAndStop("NA");
CurrentTech = "(Super Cost 30)";
DOSHIELD = true;
}
}
if (TechMode == 3) {
if (MySuper >= 10) {
TechLogo.gotoAndStop("Cyclone");
TechLogo._alpha = 100;
CurrentTech = "Cyclone";
DOSHIELD = false;
} else if (MySuper < 10) {
TechLogo.gotoAndStop("NA");
CurrentTech = "(Super Cost 10)";
DOSHIELD = true;
}
}
if (TechMode == 2) {
if (MySuper >= 5) {
TechLogo.gotoAndStop("SpiritSword");
TechLogo._alpha = 100;
CurrentTech = "Spirit Sword";
DOSHIELD = false;
} else if (MySuper < 5) {
TechLogo.gotoAndStop("NA");
CurrentTech = "(Super Cost 5)";
DOSHIELD = true;
}
}
}
if (GodMode == true) {
if (TechMode == 0) {
TechLogo.gotoAndStop("Shield");
TechLogo._alpha = 100;
CurrentTech = "Negative Barrier";
DOSHIELD = false;
}
if (TechMode == 1) {
TechLogo.gotoAndStop("ForceBlade");
TechLogo._alpha = 100;
CurrentTech = "Force Blade";
DOSHIELD = false;
} else {
Trainer._visible = false;
}
if (TechMode == 4) {
TechLogo.gotoAndStop("Spiritball");
CurrentTech = "Spiritball";
TechLogo._alpha = 100;
DOSHIELD = false;
}
if (TechMode == 5) {
TechLogo.gotoAndStop("Superbeam");
TechLogo._alpha = 100;
CurrentTech = "Super Beam";
DOSHIELD = false;
}
if (TechMode == 3) {
TechLogo.gotoAndStop("Cyclone");
TechLogo._alpha = 100;
CurrentTech = "Cyclone";
DOSHIELD = false;
}
if (TechMode == 2) {
TechLogo.gotoAndStop("SpiritSword");
TechLogo._alpha = 100;
CurrentTech = "Spirit Sword";
DOSHIELD = false;
}
if (TechMode == 60) {
TechLogo.gotoAndStop("Hadouken");
TechLogo._alpha = 100;
CurrentTech = "Hadouken";
DOSHIELD = false;
}
}
if (((Kame == true) && (KameHame == false)) && (PlayerFacingL == true)) {
this._rotation = (angle * pi) + 180;
} else if (((Kame == true) && (KameHame == false)) && (PlayerFacingR == true)) {
this._rotation = angle * pi;
} else if ((Kame == false) && (SWORD == false)) {
this._rotation = DefaultPlayerRot;
}
if ((SWORD == true) && (PlayerFacingL == true)) {
this._rotation = (angle * pi) + 180;
} else if ((SWORD == true) && (PlayerFacingR == true)) {
this._rotation = angle * pi;
}
if ((Spiritball == true) && (PlayerFacingL == true)) {
this.arm._rotation = ((-angle) * pi) + 180;
} else if ((Spiritball == true) && (PlayerFacingR == true)) {
this.arm._rotation = angle * pi;
}
PlayerScore = Math.round(PlayerScore);
PlayerHealth = Math.round(PlayerHealth);
aura._x = this._x;
aura._y = this._y;
aura._alpha = aura._alpha * 0.99;
TeleportSprite._x = this._x;
TeleportSprite._y = this._y;
if ((PlayerVelY != 0) && (PlayerVelX == 0)) {
TeleportSprite._rotation = 90;
} else if (PlayerVelY == 0) {
TeleportSprite._rotation = 0;
} else if ((PlayerVelY > 0) && (PlayerVelX != 0)) {
TeleportSprite._rotation = PlayerVelY + PlayerVelX;
} else if ((PlayerVelY < 0) && (PlayerVelX != 0)) {
TeleportSprite._rotation = PlayerVelY - PlayerVelX;
}
PowerBAR._height = PlayerForce;
if (PlayerForce >= 100) {
PowerBAR._height = 100;
}
if (ATTACK == true) {
TELEPORT = false;
PowerBAR._alpha = PowerBAR._alpha * 0.8;
}
if (CHARGE == true) {
ATTACK = false;
if ((PlayerVelX < 25) && (PlayerVelX > -25)) {
aura._rotation = AR;
}
if (PlayerVelY >= 0) {
AR = -(PlayerVelX * 4);
}
if ((PlayerVelY < 0) && (PlayerVelX != 0)) {
AR = -(PlayerVelX * 7);
}
if ((PlayerVelY < 0) && (PlayerVelX == 0)) {
AR = 180;
}
if (PlayerForce < PlayerStamina) {
if (INVINCIBLE == false) {
PlayerForce = PlayerForce + 5;
PlayerPower = PlayerPower - 1;
} else if (INVINCIBLE == true) {
aura._alpha = aura._alpha + PlayerForce;
PlayerForce = PlayerForce + 10;
PlayerPower = PlayerPower - 1;
}
}
} else {
aura._alpha = aura._alpha * 0.95;
}
if ((ATTACK == false) && (CHARGE == false)) {
PlayerForce = 0;
PlayerPower = 101;
}
if ((((PlayerStamina < 100) && (HURT == false)) && (DEAD == false)) && (INVINCIBLE == false)) {
PlayerStamina = PlayerStamina + 2;
} else if ((((PlayerStamina < 100) && (HURT == true)) && (DEAD == false)) && (INVINCIBLE == false)) {
PlayerStamina = PlayerStamina + 1;
} else if (((PlayerStamina < 100) && (DEAD == false)) && (INVINCIBLE == true)) {
PlayerStamina = PlayerStamina + 10;
}
StaminaBar._height = PlayerStamina;
if (PlayerStamina < 0) {
PlayerStamina = 0;
}
if (PlayerStamina > 100) {
PlayerStamina = 100;
}
if (BallTag == 1) {
BallEnergyHUD.EnergyHUD._x = (-BallEnergy) / 2;
}
if (BallTag == 2) {
BallEnergyHUD.EnergyHUD._x = BallEnergy / 2;
}
if (BallTag == 0) {
BallEnergyHUD.EnergyHUD._x = 0;
}
if (PlayerMaxCombo < PlayerCombo) {
PlayerMaxCombo = PlayerCombo;
}
if (PlayerMaxCombo >= 2) {
MAXcomboDisplay._visible = true;
} else {
MAXcomboDisplay._visible = false;
}
if (PlayerCombo >= 2) {
n = 0;
PlayerComboHUD = PlayerCombo;
combodisplay._alpha = 100;
combodisplay.gotoAndStop(1);
combodisplay2.textColor = 65280;
combodisplay2._visible = true;
DispCoFe._visible = true;
if (PlayerCombo < 3) {
ComboFeedback = "";
} else if ((PlayerCombo >= 3) && (PlayerCombo < 5)) {
ComboFeedback = "GOOD!";
} else if ((PlayerCombo >= 5) && (PlayerCombo < 7)) {
ComboFeedback = "WELL DONE!";
} else if ((PlayerCombo >= 7) && (PlayerCombo < 10)) {
ComboFeedback = "GREAT!";
} else if ((PlayerCombo >= 10) && (PlayerCombo < 15)) {
ComboFeedback = "EXCELLENT!";
} else if ((PlayerCombo >= 15) && (PlayerCombo < 20)) {
ComboFeedback = "BRILLIANT!";
} else if ((PlayerCombo >= 20) && (PlayerCombo < 30)) {
ComboFeedback = "AWESOME!";
} else if ((PlayerCombo >= 30) && (PlayerCombo < 40)) {
ComboFeedback = "SUPERB!";
} else if ((PlayerCombo >= 40) && (PlayerCombo < 50)) {
ComboFeedback = "OUTSTANDING!";
} else if ((PlayerCombo >= 50) && (PlayerCombo < 60)) {
ComboFeedback = "SENSATIONAL!";
} else if ((PlayerCombo >= 60) && (PlayerCombo < 70)) {
ComboFeedback = "MANIACAL!";
} else if ((PlayerCombo >= 70) && (PlayerCombo < 80)) {
ComboFeedback = "INSANE!";
} else if ((PlayerCombo >= 80) && (PlayerCombo < 90)) {
ComboFeedback = "PHENOMENAL!";
} else if ((PlayerCombo >= 90) && (PlayerCombo < 100)) {
ComboFeedback = "HARDCORE!";
} else if (PlayerCombo >= 100) {
ComboFeedback = "GAMING GOD!";
}
} else {
n = n + 1;
ComboFeedback = "";
combodisplay.gotoAndStop(2);
combodisplay2.textColor = 16711680 /* 0xFF0000 */;
if (n > 50) {
combodisplay2._visible = false;
combodisplay._alpha = combodisplay._alpha * 0.9;
DispCoFe._visible = false;
}
}
if (SuperBar._yscale > 100) {
SuperBar._yscale = 100;
GodMode = true;
}
if (SuperBar._yscale < 100) {
GodMode = false;
}
if (SuperBar._yscale < 0) {
SuperBar._yscale = 0;
}
if (PlayerHealthHUD._xscale > 0) {
PlayerHealthHUD._xscale = PlayerHealth / 2;
PlayerHealthHUD._yscale = PlayerHealthHUD._xscale;
}
if ((PlayerHealth < 0) && (HURT == true)) {
PlayerHealth = 0;
}
ItemTime = random(1000);
spriteINVINC._x = Player._x;
spriteINVINC._y = Player._y;
if (((ItemTime >= 998) && (pickupINVINCIBILITY._visible == false)) && (INVINCIBLE == false)) {
pickupINVINCIBILITY._visible = true;
pickupINVINCIBILITY._x = random(300) + 300;
pickupINVINCIBILITY._y = random(100) + 100;
if (pickupINVINCIBILITY._x < wallLEFT._x) {
pickupINVINCIBILITY._x = wallLEFT._x + 100;
}
if (pickupINVINCIBILITY._x > wallRIGHT._x) {
pickupINVINCIBILITY._x = wallRIGHT._x - 100;
}
if (pickupINVINCIBILITY._y < wallTOP._y) {
pickupINVINCIBILITY._y = wallTOP._y + 100;
}
if (pickupINVINCIBILITY._y > ground._y) {
pickupINVINCIBILITY._y = ground._y - 100;
}
}
if (INVINCIBLE == true) {
invincTime = invincTime + 1;
spriteINVINC._rotation = spriteINVINC._rotation + PlayerVelX;
}
if (pickupINVINCIBILITY._visible == true) {
INV = INV + 1;
if (INV > 100) {
pickupINVINCIBILITY._visible = false;
INV = 0;
}
}
if (invincTime > 150) {
INVINCIBLE = false;
invincTime = 0;
aura._alpha = 0;
spriteINVINC._visible = false;
}
if ((this.hitTest(pickupINVINCIBILITY) && (pickupINVINCIBILITY._visible == true)) && (HURT == false)) {
INVINCIBLE = true;
this.gotoAndPlay("CONE");
ATTACK = true;
CHARGE = false;
invincTime = 0;
INV = 0;
spriteINVINC._visible = true;
pickupINVINCIBILITY._visible = false;
InvincSound = new Sound();
InvincSound.attachSound("speedup");
InvincSound.start(1);
}
if ((Trainer.hitTest(pickupINVINCIBILITY) && (pickupINVINCIBILITY._visible == true)) && (HURT == false)) {
INVINCIBLE = true;
invincTime = 0;
INV = 0;
this.gotoAndPlay("CONE");
ATTACK = true;
spriteINVINC._visible = true;
pickupINVINCIBILITY._visible = false;
InvincSound = new Sound();
InvincSound.attachSound("speedup");
InvincSound.start(1);
}
Item2Time = random(1000);
if ((Item2Time >= 998) && (pickupHEALTH._visible == false)) {
pickupHEALTH._visible = true;
pickupHEALTH._x = random(300) + 300;
pickupHEALTH._y = random(100) + 100;
if (pickupHEALTH._x < wallLEFT._x) {
pickupHEALTH._x = wallLEFT._x + 100;
}
if (pickupHEALTH._x > wallRIGHT._x) {
pickupHEALTH._x = wallRIGHT._x - 100;
}
if (pickupHEALTH._y < wallTOP._y) {
pickupHEALTH._y = wallTOP._y + 100;
}
if (pickupHEALTH._y > ground._y) {
pickupHEALTH._y = ground._y - 100;
}
}
if (pickupHEALTH._visible == true) {
HPT = HPT + 1;
if (HPT > 150) {
pickupHEALTH._visible = false;
HPT = 0;
}
}
if (((this.hitTest(pickupHEALTH) && (pickupHEALTH._visible == true)) && (HURT == false)) && (PlayerHealth < 100)) {
PlayerHealth = 100;
HPT = 0;
pickupHEALTH._visible = false;
ReplenishSound = new Sound();
ReplenishSound.attachSound("HealthSound");
ReplenishSound.start();
}
if ((((Trainer.hitTest(pickupHEALTH) && (Trainer._visible == true)) && (pickupHEALTH._visible == true)) && (HURT == false)) && (PlayerHealth < 100)) {
PlayerHealth = 100;
HPT = 0;
pickupHEALTH._visible = false;
ReplenishSound = new Sound();
ReplenishSound.attachSound("HealthSound");
ReplenishSound.start();
}
if ((PlayerVelX >= 1) || (PlayerVelX <= -1)) {
PlayerRestX = false;
}
if ((PlayerVelY >= 1) || (PlayerVelY <= -1)) {
PlayerRestY = false;
}
if ((PlayerRestX == true) && (PlayerRestY == true)) {
PlayerRest = true;
} else {
PlayerRest = false;
}
if ((((Kame == false) && (Spiritball == false)) && (PlayerRestY == false)) && (EnemyDEAD == false)) {
if (PlayerVelY < 20) {
if ((!Player.hitTest(ROOFtier)) && (!Player.hitTest(ground))) {
PlayerVelY = PlayerVelY + PlayerWeight;
}
}
}
if ((PlayerRestX == false) && (EnemyDEAD == false)) {
if ((PlayerVelX != 0) && (PlayerVelY != 0)) {
PlayerVelX = PlayerVelX * 0.9;
}
if ((PlayerVelX != 0) && (PlayerVelY == 0)) {
PlayerVelX = PlayerVelX * 0.85;
}
if ((PlayerVelX < 1) && (PlayerVelX > -1)) {
PlayerVelX = 0;
PlayerRestX = true;
}
}
if (Player.hitTest(ground)) {
if (PlayerVelY > 0) {
PlayerVelY = 0;
PlayerRestY = true;
if (((ATTACK == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
LandSound.start();
}
}
if ((RECOVER == true) && (Rx == 0)) {
ATTACK = false;
RECOVER = false;
}
if (HURTback == true) {
this.gotoAndPlay("HITground");
PlayerVelY = 0;
} else if (HURTfront == true) {
this.gotoAndPlay("HITground2");
PlayerVelY = 0;
}
if (ATTACK == true) {
PlayerVelX = 0;
TELEPORT = false;
PowerBAR._alpha = PowerBAR._alpha * 0.8;
}
}
if (Player.hitTest(wallRIGHT) && (PlayerVelX > 1)) {
PlayerVelX = PlayerVelX - 1;
PlayerVelX = PlayerVelX * -0.5;
BARRIER.gotoAndPlay("HITRIGHT");
if (HURTfront == true) {
this.gotoAndPlay("HURTback");
HURTback = true;
HURTfront = false;
} else if (HURTback == true) {
this.gotoAndPlay("HURTfront");
HURTback = false;
HURTfront = true;
}
}
if (Player.hitTest(wallMIDDLE) && (PlayerVelX > 1)) {
PlayerVelY = PlayerVelY - 1;
PlayerVelX = PlayerVelX * -0.5;
}
if (Player.hitTest(wallLEFT) && (PlayerVelX < 0)) {
PlayerVelX = PlayerVelX + 1;
PlayerVelX = PlayerVelX * -0.5;
BARRIER.gotoAndPlay("HITLEFT");
if (HURTfront == true) {
this.gotoAndPlay(206);
HURTback = true;
HURTfront = false;
WallImpactSound = new Sound();
WallImpactSound.attachSound("wallIMPACT");
WallImpactSound.start();
} else if (HURTback == true) {
this.gotoAndPlay(239);
HURTback = false;
HURTfront = true;
}
}
if (Player.hitTest(wallTOP) && (PlayerVelY < 1)) {
if (!this.BEAM.HitTest(wallTOP)) {
PlayerVelY = PlayerVelY + 1;
}
PlayerVelY = 1;
BARRIER.gotoAndPlay("HITTOP");
}
FixTopDist = -(this._y - wallTOP._y);
if (this._y < wallTOP._y) {
BG._y = BG._y - FixTopDist;
Ball._y = Ball._y - FixTopDist;
Enemy._y = Enemy._y - FixTopDist;
ground._y = ground._y - FixTopDist;
wallTOP._y = wallTOP._y - FixTopDist;
wallLEFT._y = wallLEFT._y - FixTopDist;
wallRIGHT._y = wallRIGHT._y - FixTopDist;
pickupINVINCIBILITY._y = pickupINVINCIBILITY._y - FixTopDist;
pickupHEALTH._y = pickupHEALTH._y - FixTopDist;
meleeflash._y = meleeflash._y - FixTopDist;
Cliff._y = Cliff._y - FixTopDist;
Cliff2._y = Cliff2._y - FixTopDist;
Cliff3._y = Cliff3._y - FixTopDist;
tree._y = tree._y - FixTopDist;
ORB._y = ORB._y - FixTopDist;
stoner._y = stoner._y - FixTopDist;
cloud._y = cloud._y - FixTopDist;
bluey._y = bluey._y - FixTopDist;
BARRIER._y = BARRIER._y - FixTopDist;
}
FixGroundDist = this._y - ground._y;
if (this._y > ground._y) {
BG._y = BG._y + FixGroundDist;
Ball._y = Ball._y + FixGroundDist;
Enemy._y = Enemy._y + FixGroundDist;
ground._y = ground._y + FixGroundDist;
wallTOP._y = wallTOP._y + FixGroundDist;
wallLEFT._y = wallLEFT._y + FixGroundDist;
wallRIGHT._y = wallRIGHT._y + FixGroundDist;
pickupINVINCIBILITY._y = pickupINVINCIBILITY._y + FixGroundDist;
pickupHEALTH._y = pickupHEALTH._y + FixGroundDist;
meleeflash._y = meleeflash._y + FixGroundDist;
Cliff._y = Cliff._y + FixGroundDist;
Cliff2._y = Cliff2._y + FixGroundDist;
Cliff3._y = Cliff3._y + FixGroundDist;
tree._y = tree._y + FixGroundDist;
ORB._y = ORB._y + FixGroundDist;
stoner._y = stoner._y + FixGroundDist;
cloud._y = cloud._y + FixGroundDist;
bluey._y = bluey._y + FixGroundDist;
BARRIER._y = BARRIER._y + FixGroundDist;
}
FixGroundDist2 = -(ground._y - (Player._y + 20));
if (this.hitTest(ground) && (PlayerVelY >= 0)) {
BG._y = BG._y + FixGroundDist2;
Ball._y = Ball._y + FixGroundDist2;
Enemy._y = Enemy._y + FixGroundDist2;
ground._y = ground._y + FixGroundDist2;
wallTOP._y = wallTOP._y + FixGroundDist2;
wallLEFT._y = wallLEFT._y + FixGroundDist2;
wallRIGHT._y = wallRIGHT._y + FixGroundDist2;
pickupINVINCIBILITY._y = pickupINVINCIBILITY._y + FixGroundDist2;
pickupHEALTH._y = pickupHEALTH._y + FixGroundDist2;
meleeflash._y = meleeflash._y + FixGroundDist2;
Cliff._y = Cliff._y + FixGroundDist2;
Cliff2._y = Cliff2._y + FixGroundDist2;
Cliff3._y = Cliff3._y + FixGroundDist2;
tree._y = tree._y + FixGroundDist2;
ORB._y = ORB._y + FixGroundDist2;
stoner._y = stoner._y + FixGroundDist2;
cloud._y = cloud._y + FixGroundDist2;
bluey._y = bluey._y + FixGroundDist2;
BARRIER._y = BARRIER._y + FixGroundDist2;
}
FixLeftDist = -(this._x - wallLEFT._x);
if (this._x < wallLEFT._x) {
BG._x = BG._x - FixLeftDist;
Ball._x = Ball._x - FixLeftDist;
Enemy._x = Enemy._x - FixLeftDist;
ground._x = ground._x - FixLeftDist;
wallTOP._x = wallTOP._x - FixLeftDist;
wallLEFT._x = wallLEFT._x - FixLeftDist;
wallRIGHT._x = wallRIGHT._x - FixLeftDist;
pickupINVINCIBILITY._x = pickupINVINCIBILITY._x - FixLeftDist;
pickupHEALTH._x = pickupHEALTH._x - FixLeftDist;
meleeflash._x = meleeflash._x - FixLeftDist;
Cliff._x = Cliff._x - FixLeftDist;
Cliff2._x = Cliff2._x - FixLeftDist;
Cliff3._x = Cliff3._x - FixLeftDist;
tree._x = tree._x - FixLeftDist;
ORB._x = ORB._x - FixLeftDist;
stoner._x = stoner._x - FixLeftDist;
cloud._x = cloud._x - FixLeftDist;
bluey._x = bluey._x - FixLeftDist;
BARRIER._x = BARRIER._x - FixLeftDist;
}
FixRightDist = this._x - wallRIGHT._x;
if (this._x > wallRIGHT._x) {
BG._x = BG._x + FixRightDist;
Ball._x = Ball._x + FixRightDist;
Enemy._x = Enemy._x + FixRightDist;
ground._x = ground._x + FixRightDist;
wallTOP._x = wallTOP._x + FixRightDist;
wallLEFT._x = wallLEFT._x + FixRightDist;
wallRIGHT._x = wallRIGHT._x + FixRightDist;
pickupINVINCIBILITY._x = pickupINVINCIBILITY._x + FixRightDist;
pickupHEALTH._x = pickupHEALTH._x + FixRightDist;
meleeflash._x = meleeflash._x + FixRightDist;
Cliff._x = Cliff._x + FixRightDist;
Cliff2._x = Cliff2._x + FixRightDist;
Cliff3._x = Cliff3._x + FixRightDist;
tree._x = tree._x + FixRightDist;
ORB._x = ORB._x + FixRightDist;
stoner._x = stoner._x + FixRightDist;
cloud._x = cloud._x + FixRightDist;
bluey._x = bluey._x + FixRightDist;
BARRIER._x = BARRIER._x + FixRightDist;
}
if ((((((((HURT == false) && (Spiritball == false)) && (Kame == false)) && (DEAD == false)) && (EnemyDEAD == false)) && (Key.isDown(87))) && (!Key.isDown(65))) && (!Key.isDown(68))) {
if (((INVINCIBLE == false) && (ATTACK == false)) && (TELEPORT == false)) {
this.gotoAndPlay("FLYup");
}
if (((INVINCIBLE == true) && (ATTACK == false)) && (TELEPORT == false)) {
this.gotoAndPlay("SWOOPup");
}
if (this.hitTest(ground)) {
if (INVINCIBLE == false) {
PlayerVelY = -10;
}
if ((INVINCIBLE == true) && (CONE == false)) {
PlayerVelY = -20;
}
}
if ((INVINCIBLE == false) && (this._y > wallTOP._y)) {
PlayerVelY = PlayerVelY - 1.1;
}
if ((((INVINCIBLE == true) && (CONE == false)) && (this._y > wallTOP._y)) && (PlayerVelY > -50)) {
PlayerVelY = -50;
PlayerStamina = PlayerStamina - 1;
}
}
if ((((((((!this.hitTest(ground)) && (INVINCIBLE == false)) && (HURT == false)) && (DEAD == false)) && (Key.isDown(83))) && (EnemyDEAD == false)) && (Kame == false)) && (Spiritball == false)) {
PlayerVelY = PlayerVelY + 1.5;
}
if (((((((((!this.hitTest(ground)) && (CONE == false)) && (INVINCIBLE == true)) && (HURT == false)) && (DEAD == false)) && (Key.isDown(83))) && (EnemyDEAD == false)) && (Kame == false)) && (Spiritball == false)) {
PlayerVelY = 50;
PlayerStamina = PlayerStamina - 1;
}
if ((((((((((((!this.hitTest(ground)) && (INVINCIBLE == false)) && (Spiritball == false)) && (Kame == false)) && (HURT == false)) && (DEAD == false)) && (ATTACK == false)) && (TELEPORT == false)) && (Key.isDown(83))) && (!Key.isDown(65))) && (!Key.isDown(68))) && (EnemyDEAD == false)) {
this.gotoAndPlay("FLYdown");
}
if ((((((((((((!this.hitTest(ground)) && (INVINCIBLE == true)) && (Spiritball == false)) && (Kame == false)) && (HURT == false)) && (DEAD == false)) && (ATTACK == false)) && (TELEPORT == false)) && (Key.isDown(83))) && (!Key.isDown(65))) && (!Key.isDown(68))) && (EnemyDEAD == false)) {
this.gotoAndPlay("SWOOPdown");
}
if ((((((HURT == false) && (Spiritball == false)) && (Kame == false)) && (DEAD == false)) && (this._x < TargetReticle._x)) && (EnemyDEAD == false)) {
if (Key.isDown(87)) {
PlayerVelY = PlayerVelY - 2;
}
if (((Key.isDown(65) && (INVINCIBLE == false)) && (this._x > wallLEFT._x)) && (PlayerVelX > -25)) {
PlayerVelX = PlayerVelX - 5;
}
if ((((Key.isDown(65) && (CONE == false)) && (INVINCIBLE == true)) && (this._x > wallLEFT._x)) && (PlayerVelX > -50)) {
PlayerVelX = -50;
PlayerStamina = PlayerStamina - 1;
if (!Key.isDown(87)) {
PlayerVelY = 0;
}
}
if (((((Key.isDown(65) && (INVINCIBLE == false)) && (!Key.isDown(87))) && (!Key.isDown(83))) && (ATTACK == false)) && (TELEPORT == false)) {
this.gotoAndPlay("FLYbackward");
}
if (((((Key.isDown(65) && (INVINCIBLE == true)) && (!Key.isDown(87))) && (!Key.isDown(83))) && (ATTACK == false)) && (TELEPORT == false)) {
this.gotoAndPlay("SWOOPbackward");
}
if (((Key.isDown(65) && (Key.isDown(87))) && (ATTACK == false)) && (TELEPORT == false)) {
this.gotoAndPlay("Somersault2");
}
if (((Key.isDown(65) && (Key.isDown(83))) && (ATTACK == false)) && (TELEPORT == false)) {
this.gotoAndPlay("Somersault2");
}
if (((Key.isDown(68) && (INVINCIBLE == false)) && (this._x < wallRIGHT._x)) && (PlayerVelX < 25)) {
PlayerVelX = PlayerVelX + 5;
}
if ((((Key.isDown(68) && (CONE == false)) && (INVINCIBLE == true)) && (this._x < wallRIGHT._x)) && (PlayerVelX < 50)) {
PlayerVelX = 50;
PlayerStamina = PlayerStamina - 1;
if (!Key.isDown(87)) {
PlayerVelY = 0;
}
}
if (((((Key.isDown(68) && (INVINCIBLE == false)) && (!Key.isDown(87))) && (!Key.isDown(83))) && (ATTACK == false)) && (TELEPORT == false)) {
this.gotoAndPlay("FLYforward");
}
if (((((Key.isDown(68) && (INVINCIBLE == true)) && (!Key.isDown(87))) && (!Key.isDown(83))) && (ATTACK == false)) && (TELEPORT == false)) {
this.gotoAndPlay("SWOOPforward");
}
if (((Key.isDown(68) && (Key.isDown(87))) && (ATTACK == false)) && (TELEPORT == false)) {
this.gotoAndPlay("Somersault");
}
if (((Key.isDown(68) && (Key.isDown(83))) && (ATTACK == false)) && (TELEPORT == false)) {
this.gotoAndPlay("Somersault");
}
} else if ((((((HURT == false) && (Spiritball == false)) && (Kame == false)) && (DEAD == false)) && (EnemyDEAD == false)) && (this._x > TargetReticle._x)) {
if (Key.isDown(87)) {
PlayerVelY = PlayerVelY - 2;
}
if (((Key.isDown(65) && (INVINCIBLE == false)) && (this._x > wallLEFT._x)) && (PlayerVelX > -25)) {
PlayerVelX = PlayerVelX - 5;
}
if ((((Key.isDown(65) && (CONE == false)) && (INVINCIBLE == true)) && (this._x > wallLEFT._x)) && (PlayerVelX > -50)) {
PlayerVelX = -50;
PlayerStamina = PlayerStamina - 1;
if (!Key.isDown(87)) {
PlayerVelY = 0;
}
}
if (((((Key.isDown(65) && (INVINCIBLE == false)) && (!Key.isDown(87))) && (!Key.isDown(83))) && (ATTACK == false)) && (TELEPORT == false)) {
this.gotoAndPlay("FLYforward");
}
if (((((Key.isDown(65) && (INVINCIBLE == true)) && (!Key.isDown(87))) && (!Key.isDown(83))) && (ATTACK == false)) && (TELEPORT == false)) {
this.gotoAndPlay("SWOOPforward");
}
if (((Key.isDown(65) && (Key.isDown(87))) && (ATTACK == false)) && (TELEPORT == false)) {
this.gotoAndPlay("Somersault");
}
if (((Key.isDown(65) && (Key.isDown(83))) && (ATTACK == false)) && (TELEPORT == false)) {
this.gotoAndPlay("Somersault");
}
if (((Key.isDown(68) && (INVINCIBLE == false)) && (this._x < wallRIGHT._x)) && (PlayerVelX < 25)) {
PlayerVelX = PlayerVelX + 5;
}
if ((((Key.isDown(68) && (CONE == false)) && (INVINCIBLE == true)) && (this._x < wallRIGHT._x)) && (PlayerVelX < 50)) {
PlayerVelX = 50;
PlayerStamina = PlayerStamina - 1;
if (!Key.isDown(87)) {
PlayerVelY = 0;
}
}
if (((((Key.isDown(68) && (INVINCIBLE == false)) && (!Key.isDown(87))) && (!Key.isDown(83))) && (ATTACK == false)) && (TELEPORT == false)) {
this.gotoAndPlay("FLYbackward");
}
if (((((Key.isDown(68) && (INVINCIBLE == true)) && (!Key.isDown(87))) && (!Key.isDown(83))) && (ATTACK == false)) && (TELEPORT == false)) {
this.gotoAndPlay("SWOOPbackward");
}
if (((Key.isDown(68) && (Key.isDown(87))) && (ATTACK == false)) && (TELEPORT == false)) {
this.gotoAndPlay("Somersault2");
}
if (((Key.isDown(68) && (Key.isDown(83))) && (ATTACK == false)) && (TELEPORT == false)) {
this.gotoAndPlay("Somersault2");
}
}
if (!this.hitTest(ground)) {
this._x = 438.6;
this._y = 209.8;
}
if ((((((((HURT == false) && (DEAD == false)) && (EnemyDEAD == false)) && (!Key.isDown(68))) && (!Key.isDown(65))) && (!Key.isDown(87))) && (ATTACK == false)) && (TELEPORT == false)) {
NEUTRAL = true;
if ((((!this.hitTest(ground)) && (!this.hitTest(ROOFtier))) && (!Key.isDown(83))) && (PlayerRestY == false)) {
this.gotoAndPlay("FALL");
Player.onEnterFrame = enginePLAYER;
} else if (this.hitTest(ground)) {
this.gotoAndPlay("IDLE");
PlayerVelX = PlayerVelX * 0.7;
} else if (this.hitTest(ROOFtier)) {
this.gotoAndPlay("IDLE");
PlayerVelX = PlayerVelX * 0.7;
}
} else {
NEUTRAL = false;
}
if (((this.HITBOX.hitTest(Ball) && (BallTag > 1)) && (BallEnergy >= 30)) && (INVINCIBLE == false)) {
HURT = true;
ATTACK = false;
TrainerORBIT = false;
Trainer.gotoAndPlay("ATTACK2");
Kame = false;
KameHame = false;
Spiritball = false;
CHARGE = false;
aura._alpha = 0;
PlayerForce = 0;
TargetReticle._visible = false;
PlayerCombo = 0;
PlayerHealth = PlayerHealth - (BallEnergy / 3);
PlayerVelX = BallVelX * 2;
PlayerVelY = -5 + (BallVelY / 2);
Ball._xscale = BallSize;
Ball._yscale = BallSize;
ChargeSound.stop("ChargePush");
ImpactSound = new Sound();
ImpactSound.attachSound("impactHURT");
PainSound = new Sound();
PainSound.attachSound("painHURT");
if ((PlayerFacingR == true) && (BallVelX > 0)) {
this.gotoAndPlay("HURTback");
HURTback = true;
BallEnergy = BallEnergy / 3;
HURTfront = false;
ImpactSound.start();
PainSound.start();
}
if ((PlayerFacingL == true) && (BallVelX < 0)) {
this.gotoAndPlay("HURTback");
HURTback = true;
BallEnergy = BallEnergy / 3;
HURTfront = false;
ImpactSound.start();
PainSound.start();
}
if ((PlayerFacingR == true) && (BallVelX < 0)) {
this.gotoAndPlay("HURTfront");
HURTfront = true;
BallEnergy = BallEnergy / 3;
HURTback = false;
ImpactSound.start();
PainSound.start();
}
if ((PlayerFacingL == true) && (BallVelX > 0)) {
this.gotoAndPlay("HURTfront");
HURTfront = true;
BallEnergy = BallEnergy / 3;
HURTback = false;
ImpactSound.start();
PainSound.start();
}
if ((BallVelX == 0) && (BallVelY < 0)) {
this.gotoAndPlay("HURTfront");
HURTfront = true;
BallEnergy = BallEnergy / 3;
HURTback = false;
ImpactSound.start();
PainSound.start();
} else if ((BallVelX == 0) && (BallVelY > 0)) {
this.gotoAndPlay("HURTback");
HURTback = true;
BallEnergy = BallEnergy / 3;
HURTfront = false;
ImpactSound.start();
PainSound.start();
}
}
if (((PlayerHealth < 1) && (TrainingMode > 1)) && (DEAD == false)) {
GAMEOVER._visible = true;
GAMEOVER.play();
PlayerHealthHUD._visible = false;
DEAD = true;
Key.removeListener(DefendListener);
Bar._visible = false;
BallEnergyHUD._visible = false;
Mouse.show();
}
if (((PlayerHealth < 1) && (TrainingMode == 1)) && (DEAD == false)) {
PlayerHealth = 100;
}
if (this.AttackBox.hitTest(Ball)) {
BallTag = 1;
if (HIT == false) {
PlayerCombo = PlayerCombo + 1;
SuperBar._yscale = SuperBar._yscale + 1;
PlayerScore = PlayerScore + (PlayerForce * PlayerCombo);
BounceSound = new Sound();
BounceSound.attachSound("BallBounce");
BounceSound.start();
meleeflash._visible = true;
meleeflash._x = Ball._x;
meleeflash._y = Ball._y;
meleeflash._x = meleeflash._x + (-PlayerVelX);
meleeflash._y = meleeflash._y + (-PlayerVelY);
if (PlayerForce <= 25) {
meleeflash.gotoAndPlay("STALL");
} else if ((PlayerForce <= 50) && (PlayerForce > 25)) {
meleeflash.gotoAndPlay("KICK");
} else if ((PlayerForce < 100) && (PlayerForce > 50)) {
meleeflash.gotoAndPlay("PUNCH");
} else if (PlayerForce >= 100) {
meleeflash.gotoAndPlay("POWER");
}
if ((PlayerCombo > 1) && (PlayerHealth < 100)) {
PlayerHealth = PlayerHealth + 5;
}
HIT = true;
}
if ((ATTACK == true) && (hyp >= 70)) {
if (PlayerForce >= 25) {
z = PlayerForce / 600;
} else if (PlayerForce < 25) {
z = PlayerForce / 200;
}
xmov = Xdist * z;
if ((Xdist > 0) && (PlayerVelX > 0)) {
xmov = xmov + PlayerVelX;
}
if ((Xdist < 0) && (PlayerVelX < 0)) {
xmov = xmov + PlayerVelX;
}
ymov = Ydist * z;
if ((Ydist > 0) && (PlayerVelY > 0)) {
ymov = ymov + PlayerVelY;
}
if ((Ydist < 0) && (PlayerVelY < 0)) {
ymov = ymov + PlayerVelY;
}
BallVelX = xmov;
BallVelY = ymov;
ChargeRate = 3 * Difficulty;
BallEnergy = BallEnergy + ((PlayerForce / ChargeRate) * (PlayerCombo + 1));
}
if ((ATTACK == true) && (hyp < 70)) {
if (PlayerForce >= 25) {
z = PlayerForce / 100;
} else if (PlayerForce < 25) {
z = PlayerForce / 80;
}
xmov = Xdist * z;
if ((Xdist > 0) && (PlayerVelX > 0)) {
xmov = xmov + PlayerVelX;
}
if ((Xdist < 0) && (PlayerVelX < 0)) {
xmov = xmov + PlayerVelX;
}
ymov = Ydist * z;
if ((Ydist > 0) && (PlayerVelY > 0)) {
ymov = ymov + PlayerVelY;
}
if ((Ydist < 0) && (PlayerVelY < 0)) {
ymov = ymov + PlayerVelY;
}
BallVelX = xmov;
BallVelY = ymov;
BallEnergy = BallEnergy + (PlayerForce / 5);
}
}
if (this.SHIELD.hitTest(Ball)) {
PlayerCombo = Math.round(PlayerCombo / 2);
PlayerScore = PlayerScore + (PlayerStamina / StageLevel);
meleeflash._visible = true;
meleeflash._x = Ball._x;
meleeflash._y = Ball._y;
meleeflash.gotoAndPlay("blue");
if ((ATTACK == true) && (hyp >= 70)) {
xmov = Xdist / 7;
ymov = Ydist / 7;
BallVelX = xmov;
BallVelY = ymov;
BallEnergy = BallEnergy - (hyp / 7);
}
}
if (((this.AttackBox.hitTest(Enemy) && (PlayerForce > 25)) && (EnemyHURT == true)) && (TrainingMode == 2)) {
if (HIT == false) {
MeleeSound = new Sound();
MeleeSound.attachSound("meleeHIT");
MeleeSound.start();
PlayerCombo = PlayerCombo + 1;
SuperBar._yscale = SuperBar._yscale + 1;
PlayerScore = PlayerScore + (PlayerForce * PlayerCombo);
meleeflash._visible = true;
meleeflash._x = Enemy._x;
meleeflash._y = Enemy._y;
meleeflash._x = meleeflash._x + (-PlayerVelX);
meleeflash._y = meleeflash._y + (-PlayerVelY);
if (PlayerForce <= 25) {
meleeflash.gotoAndPlay("STALL");
} else if ((PlayerForce <= 50) && (PlayerForce > 25)) {
meleeflash.gotoAndPlay("KICK");
} else if ((PlayerForce < 100) && (PlayerForce > 50)) {
meleeflash.gotoAndPlay("PUNCH");
} else if (PlayerForce >= 100) {
meleeflash.gotoAndPlay("POWER");
}
if ((PlayerCombo > 1) && (PlayerHealth < 100)) {
PlayerHealth = PlayerHealth + 5;
}
HIT = true;
}
EnemyHURT = true;
EnemyHealth = EnemyHealth - ((PlayerForce * PlayerCombo) / 100);
xmov = Xdist / 7;
ymov = Ydist / 7;
EnemyVelX = xmov;
EnemyVelY = ymov;
ImpactSound2 = new Sound();
ImpactSound2.attachSound("impactHURT");
PainSound2 = new Sound();
PainSound2.attachSound("painHURT");
if ((EnemyFacingR == true) && (Player._x < Enemy._x)) {
Enemy.gotoAndPlay("HURTback");
EnemyHURTback = true;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingL == true) && (Player._x > Enemy._x)) {
Enemy.gotoAndPlay("HURTback");
EnemyHURTback = true;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingR == true) && (Player._x > Enemy._x)) {
Enemy.gotoAndPlay("HURTfront");
EnemyHURTfront = true;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingL == true) && (Player._x < Enemy._x)) {
Enemy.gotoAndPlay("HURTfront");
EnemyHURTfront = true;
ImpactSound2.start();
PainSound2.start();
}
}
if ((this.AttackBox.hitTest(Enemy) && (INVINCIBLE == true)) && (TrainingMode == 2)) {
if (HIT == false) {
PlayerCombo = PlayerCombo + 1;
SuperBar._yscale = SuperBar._yscale + 1;
PlayerScore = PlayerScore + (PlayerForce * PlayerCombo);
meleeflash._visible = true;
meleeflash._x = Enemy._x;
meleeflash._y = Enemy._y;
if (PlayerForce <= 25) {
meleeflash.gotoAndPlay("STALL");
} else if ((PlayerForce <= 50) && (PlayerForce > 25)) {
meleeflash.gotoAndPlay("KICK");
} else if ((PlayerForce < 100) && (PlayerForce > 50)) {
meleeflash.gotoAndPlay("PUNCH");
} else if (PlayerForce >= 100) {
meleeflash.gotoAndPlay("POWER");
}
if ((PlayerCombo > 1) && (PlayerHealth < 100)) {
PlayerHealth = PlayerHealth + 10;
}
HIT = true;
}
EnemyHURT = true;
EnemyHealth = EnemyHealth - (PlayerForce / 10);
xmov = Xdist / 7;
ymov = Ydist / 7;
EnemyVelX = xmov;
EnemyVelY = ymov;
ImpactSound2 = new Sound();
ImpactSound2.attachSound("impactHURT");
PainSound2 = new Sound();
PainSound2.attachSound("painHURT");
if ((EnemyFacingR == true) && (Player._x < Enemy._x)) {
Enemy.gotoAndPlay("HURTback");
EnemyHURTback = true;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingL == true) && (Player._x > Enemy._x)) {
Enemy.gotoAndPlay("HURTback");
EnemyHURTback = true;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingR == true) && (Player._x > Enemy._x)) {
Enemy.gotoAndPlay("HURTfront");
EnemyHURTfront = true;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingL == true) && (Player._x < Enemy._x)) {
Enemy.gotoAndPlay("HURTfront");
EnemyHURTfront = true;
ImpactSound2.start();
PainSound2.start();
}
}
if (this.hurricane.ring.hitTest(Enemy) && (TrainingMode == 2)) {
if (HIT == false) {
PlayerCombo = PlayerCombo + 1;
SuperBar._yscale = SuperBar._yscale + 1;
PlayerScore = PlayerScore + (PlayerForce * PlayerCombo);
meleeflash._visible = true;
meleeflash._x = Enemy._x;
meleeflash._y = Enemy._y;
if (PlayerForce <= 25) {
meleeflash.gotoAndPlay("STALL");
} else if ((PlayerForce <= 50) && (PlayerForce > 25)) {
meleeflash.gotoAndPlay("KICK");
} else if ((PlayerForce < 100) && (PlayerForce > 50)) {
meleeflash.gotoAndPlay("PUNCH");
} else if (PlayerForce >= 100) {
meleeflash.gotoAndPlay("POWER");
}
if ((PlayerCombo > 1) && (PlayerHealth < 100)) {
PlayerHealth = PlayerHealth + 10;
}
HIT = true;
}
EnemyHURT = true;
EnemyHealth = EnemyHealth - 5;
EnemyVelX = (-random(10)) + 10;
EnemyVelY = (-random(10)) + 10;
ImpactSound2 = new Sound();
ImpactSound2.attachSound("impactHURT");
PainSound2 = new Sound();
PainSound2.attachSound("painHURT");
if ((EnemyFacingR == true) && (Player._x < Enemy._x)) {
Enemy.gotoAndPlay("HURTback");
EnemyHURTback = true;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingL == true) && (Player._x > Enemy._x)) {
Enemy.gotoAndPlay("HURTback");
EnemyHURTback = true;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingR == true) && (Player._x > Enemy._x)) {
Enemy.gotoAndPlay("HURTfront");
EnemyHURTfront = true;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingL == true) && (Player._x < Enemy._x)) {
Enemy.gotoAndPlay("HURTfront");
EnemyHURTfront = true;
ImpactSound2.start();
PainSound2.start();
}
}
if ((this.AttackBox.hitTest(Enemy) && (SWORD == true)) && (TrainingMode == 2)) {
if (HIT == false) {
PlayerCombo = PlayerCombo + 1;
SuperBar._yscale = SuperBar._yscale + 1;
PlayerScore = PlayerScore + (2 * (PlayerCombo + 1));
meleeflash._visible = true;
meleeflash._x = Enemy._x;
meleeflash._y = Enemy._y;
if (PlayerForce <= 25) {
meleeflash.gotoAndPlay("STALL");
} else if ((PlayerForce <= 50) && (PlayerForce > 25)) {
meleeflash.gotoAndPlay("KICK");
} else if ((PlayerForce < 100) && (PlayerForce > 50)) {
meleeflash.gotoAndPlay("PUNCH");
} else if (PlayerForce >= 100) {
meleeflash.gotoAndPlay("POWER");
}
if ((PlayerCombo > 1) && (PlayerHealth < 100)) {
PlayerHealth = PlayerHealth + 10;
}
HIT = true;
}
EnemyHURT = true;
EnemyHealth = EnemyHealth - (PlayerCombo + 1);
EnemyVelX = (Xdist / hyp) / 10;
EnemyVelY = (Ydist / hyp) / 10;
ImpactSound2 = new Sound();
ImpactSound2.attachSound("impactHURT");
PainSound2 = new Sound();
PainSound2.attachSound("painHURT");
if ((EnemyFacingR == true) && (Player._x < Enemy._x)) {
Enemy.gotoAndPlay("HURTback");
EnemyHURTback = true;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingL == true) && (Player._x > Enemy._x)) {
Enemy.gotoAndPlay("HURTback");
EnemyHURTback = true;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingR == true) && (Player._x > Enemy._x)) {
Enemy.gotoAndPlay("HURTfront");
EnemyHURTfront = true;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingL == true) && (Player._x < Enemy._x)) {
Enemy.gotoAndPlay("HURTfront");
EnemyHURTfront = true;
ImpactSound2.start();
PainSound2.start();
}
}
MySpeed = PlayerVelX + PlayerVelY;
if (MySpeed != 0) {
if ((this.hitTest(tree) && (HURT == true)) && (TREEDIE == false)) {
tree.gotoAndPlay("DIE");
TREEDIE = true;
}
if (this.hitTest(stoner) && (STONERATTACK == false)) {
stoner.gotoAndPlay("ATTACK");
STONERATTACK = true;
HURT = true;
PlayerHealth = PlayerHealth - 20;
PlayerVelX = 40;
PlayerVelY = -40;
ImpactSound = new Sound();
ImpactSound.attachSound("impactHURT");
PainSound = new Sound();
PainSound.attachSound("painHURT");
ImpactSound.start();
PainSound.start();
HURTback = true;
HURTfront = false;
this.gotoAndPlay("HURTback");
}
if ((this.hitTest(Cliff) && (HURT == true)) && (WALLDIE == false)) {
Cliff.gotoAndPlay("DIE");
WALLDIE = true;
}
if (((this.AttackBox.hitTest(Cliff) && (ATTACK == true)) && (PlayerForce >= 100)) && (WALLDIE == false)) {
Cliff.gotoAndPlay("DIE");
WALLDIE = true;
}
if ((this.hitTest(Cliff2) && (HURT == true)) && (WALLDIE2 == false)) {
Cliff2.gotoAndPlay("DIE");
WALLDIE2 = true;
}
if (((this.AttackBox.hitTest(Cliff2) && (ATTACK == true)) && (PlayerForce >= 100)) && (WALLDIE2 == false)) {
Cliff2.gotoAndPlay("DIE");
WALLDIE2 = true;
}
if ((this.hitTest(Cliff3) && (HURT == true)) && (WALLDIE3 == false)) {
Cliff3.gotoAndPlay("DIE");
WALLDIE3 = true;
}
if (((this.AttackBox.hitTest(Cliff3) && (ATTACK == true)) && (PlayerForce >= 100)) && (WALLDIE3 == false)) {
Cliff3.gotoAndPlay("DIE");
WALLDIE3 = true;
}
}
EnemySpeed = EnemyVelX + EnemyVelY;
if (EnemySpeed != 0) {
if ((Enemy.hitTest(tree) && (EnemyHURT == true)) && (TREEDIE == false)) {
tree.gotoAndPlay("DIE");
TREEDIE = true;
}
if ((Enemy.hitTest(Cliff) && (EnemyHURT == true)) && (WALLDIE == false)) {
Cliff.gotoAndPlay("DIE");
WALLDIE = true;
}
if ((Enemy.hitTest(Cliff2) && (EnemyHURT == true)) && (WALLDIE2 == false)) {
Cliff2.gotoAndPlay("DIE");
WALLDIE2 = true;
}
if ((Enemy.hitTest(Cliff3) && (EnemyHURT == true)) && (WALLDIE3 == false)) {
Cliff3.gotoAndPlay("DIE");
WALLDIE3 = true;
}
}
if ((((((HURT == false) && (DEAD == false)) && (ATTACK == false)) && (EnemyDEAD == false)) || (Kame == true)) || (Spiritball == true)) {
TargetReticle._x = _xmouse;
TargetReticle._y = _ymouse;
Mouse.hide();
TargetReticle._visible = true;
TargetReticle._alpha = 100;
} else {
Mouse.show();
TargetReticle._alpha = 10;
}
if ((Spiritball == false) && (KameHame == false)) {
if (PlayerForce <= 25) {
TargetReticle.GotoAndStop("SOFT");
}
if ((PlayerForce <= 50) && (PlayerForce > 25)) {
TargetReticle.GotoAndStop("MEDIUM");
}
if ((PlayerForce < 100) && (PlayerForce > 50)) {
TargetReticle.GotoAndStop("HARD");
}
if (PlayerForce >= 100) {
TargetReticle.GotoAndStop("POWER");
}
} else if ((Spiritball == true) || (KameHame == true)) {
TargetReticle.GotoAndStop("POWER");
}
ConsoleMC._alpha = ConsoleMC._alpha * 0.95;
BG._x = BG._x + (-PlayerVelX);
BG._y = BG._y + (-PlayerVelY);
Ball._x = Ball._x + (-PlayerVelX);
Ball._y = Ball._y + (-PlayerVelY);
Enemy._x = Enemy._x + (-PlayerVelX);
Enemy._y = Enemy._y + (-PlayerVelY);
ground._x = ground._x + (-PlayerVelX);
wallTOP._x = wallTOP._x + (-PlayerVelX);
wallLEFT._x = wallLEFT._x + (-PlayerVelX);
wallRIGHT._x = wallRIGHT._x + (-PlayerVelX);
ground._y = ground._y + (-PlayerVelY);
wallTOP._y = wallTOP._y + (-PlayerVelY);
wallLEFT._y = wallLEFT._y + (-PlayerVelY);
wallRIGHT._y = wallRIGHT._y + (-PlayerVelY);
pickupINVINCIBILITY._x = pickupINVINCIBILITY._x + (-PlayerVelX);
pickupINVINCIBILITY._y = pickupINVINCIBILITY._y + (-PlayerVelY);
pickupHEALTH._x = pickupHEALTH._x + (-PlayerVelX);
pickupHEALTH._y = pickupHEALTH._y + (-PlayerVelY);
meleeflash._x = meleeflash._x + (-PlayerVelX);
meleeflash._y = meleeflash._y + (-PlayerVelY);
Cliff._x = Cliff._x + (-PlayerVelX);
Cliff._y = Cliff._y + (-PlayerVelY);
Cliff2._x = Cliff2._x + (-PlayerVelX);
Cliff2._y = Cliff2._y + (-PlayerVelY);
Cliff3._x = Cliff3._x + (-PlayerVelX);
Cliff3._y = Cliff3._y + (-PlayerVelY);
BARRIER._x = BARRIER._x + (-PlayerVelX);
BARRIER._y = BARRIER._y + (-PlayerVelY);
tree._x = tree._x + (-PlayerVelX);
tree._y = tree._y + (-PlayerVelY);
ORB._x = ORB._x + (-PlayerVelX);
ORB._y = ORB._y + (-PlayerVelY);
stoner._x = stoner._x + (-PlayerVelX);
stoner._y = stoner._y + (-PlayerVelY);
cloud._x = cloud._x + (-PlayerVelX);
cloud._y = cloud._y + (-PlayerVelY);
bluey._x = bluey._x + (-PlayerVelX);
bluey._y = bluey._y + (-PlayerVelY);
if ((((this._x > TargetReticle._x) && (HURT == false)) && (ATTACK == false)) && (DEAD == false)) {
this._xscale = -100;
PlayerFacingL = true;
PlayerFacingR = false;
} else if ((((this._x < TargetReticle._x) && (HURT == false)) && (ATTACK == false)) && (DEAD == false)) {
this._xscale = 100;
PlayerFacingR = true;
PlayerFacingL = false;
}
PlayerShadow._x = Player._x;
if (KameHame == false) {
PlayerShadow._xscale = Player._width + (Player._y / 2);
PlayerShadow._y = ground._y;
}
MySuper = SuperBar._yscale;
if (PlayerMaxCombo < 10) {
Rank = "Noob";
} else if (PlayerMaxCombo == 10) {
Rank = "Initiate";
} else if (PlayerMaxCombo == 15) {
Rank = "Goon";
} else if (PlayerMaxCombo == 20) {
Rank = "Thug";
} else if (PlayerMaxCombo == 25) {
Rank = "Novice";
} else if (PlayerMaxCombo == 30) {
Rank = "Average";
} else if (PlayerMaxCombo == 35) {
Rank = "Adept";
} else if (PlayerMaxCombo == 40) {
Rank = "Warrior";
} else if (PlayerMaxCombo == 45) {
Rank = "Solid";
} else if (PlayerMaxCombo == 50) {
Rank = "Liquid";
} else if (PlayerMaxCombo == 55) {
Rank = "Professional";
} else if (PlayerMaxCombo == 60) {
Rank = "Prodigy";
} else if (PlayerMaxCombo == 65) {
Rank = "Monk";
} else if (PlayerMaxCombo == 70) {
Rank = "Tengu";
} else if (PlayerMaxCombo == 75) {
Rank = "Jedi";
} else if (PlayerMaxCombo == 80) {
Rank = "Neo";
} else if (PlayerMaxCombo == 85) {
Rank = "Dragon";
} else if (PlayerMaxCombo == 90) {
Rank = "Master";
} else if (PlayerMaxCombo == 91) {
Rank = "Saiyan";
} else if (PlayerMaxCombo == 92) {
Rank = "Grand Master";
} else if (PlayerMaxCombo == 93) {
Rank = "Super Saiyan";
} else if (PlayerMaxCombo == 94) {
Rank = "Hyper Saiyan";
} else if (PlayerMaxCombo == 95) {
Rank = "Majin";
} else if (PlayerMaxCombo == 96) {
Rank = "Otaku";
} else if (PlayerMaxCombo == 97) {
Rank = "Akira";
} else if (PlayerMaxCombo == 98) {
Rank = "Deity";
} else if (PlayerMaxCombo == 99) {
Rank = "KYnetiK";
} else if (PlayerMaxCombo >= 100) {
Rank = "Wastoid";
}
ConsoleMC._alpha = ConsoleMC._alpha * 0.9;
if (HADOUKEN == true) {
PlayerVelY = 0;
PlayerVelX = 0;
if (PlayerFacingL == true) {
this._rotation = (angle * pi) + 180;
} else if (PlayerFacingR == true) {
this._rotation = angle * pi;
}
}
}
function enginePOWER() {
if (((((((HURT == false) && (SWORD == false)) && (Spiritball == false)) && (KameHame == false)) && (DEAD == false)) && (EnemyDEAD == false)) && (PlayerForce <= PlayerEnergy)) {
CHARGE = true;
Kame = false;
PowerBAR._alpha = 100;
PlayerForce = 0;
ChargeSound = new Sound();
ChargeSound.attachSound("ChargePush");
}
}
function engineATTACK() {
if ((((((((HURT == false) && (SWORD == false)) && (Spiritball == false)) && (Kame == false)) && (KameHame == false)) && (DEAD == false)) && (ATTACK == false)) && (EnemyDEAD == false)) {
ATTACK = true;
CHARGE = false;
PlayerStamina = PlayerStamina - PlayerForce;
aura._alpha = aura._alpha * 0.4;
ChargeSound.stop("ChargePush");
if (TargetReticle._y <= Player._y) {
if (PlayerForce <= 25) {
Player.GotoAndPlay("hitUP1");
}
if ((PlayerForce <= 50) && (PlayerForce > 25)) {
Player.GotoAndPlay("hitUP2");
}
if ((PlayerForce < 100) && (PlayerForce > 50)) {
Player.GotoAndPlay("hitUP3");
}
if (PlayerForce >= 100) {
Player.GotoAndPlay("hitUP4");
}
}
if (TargetReticle._y > Player._y) {
if (PlayerForce <= 25) {
Player.GotoAndPlay("hitDOWN1");
}
if ((PlayerForce <= 50) && (PlayerForce > 25)) {
Player.GotoAndPlay("hitDOWN2");
}
if ((PlayerForce < 100) && (PlayerForce > 50)) {
Player.GotoAndPlay("hitDOWN3");
}
if (PlayerForce >= 100) {
Player.GotoAndPlay("hitDOWN4");
}
}
}
}
function engineDEFEND() {
if (Key.getCode() == 84) {
TrainingMode = TrainingMode + 1;
SuperBar._yscale = 0;
PlayerMaxCombo = PlayerMaxCombo - PlayerMaxCombo;
if (TrainingMode == 0) {
Console = "Solo";
}
if (TrainingMode == 1) {
ConsoleMC.Console = "Training Bot";
ConsoleMC.gotoAndPlay(1);
}
if (TrainingMode == 2) {
ConsoleMC.Console = "Combat";
ConsoleMC.gotoAndPlay(1);
}
if (TrainingMode > 2) {
TrainingMode = 0;
ConsoleMC.Console = "Solo";
ConsoleMC.gotoAndPlay(1);
}
init();
}
if (Key.getCode() == 77) {
MusicMode = MusicMode + 1;
if (MusicMode > 3) {
MusicMode = 0;
}
if (MusicMode == 1) {
PracticeMusic.start(0, 999);
PracticeMusic2.stop("BentoBGM");
ConsoleMC.Console = "BGM 1 by KYnetiK";
ConsoleMC.gotoAndPlay(1);
}
if (MusicMode == 2) {
PracticeMusic2.start(0, 999);
PracticeMusic.stop("PracticeBGM");
ConsoleMC.Console = "BGM 2 by Bento";
ConsoleMC.gotoAndPlay(1);
}
if (MusicMode == 3) {
PracticeMusic3.start(0, 999);
PracticeMusic.stop("BentoBGM");
ConsoleMC.Console = "BGM 3 by Bento";
ConsoleMC.gotoAndPlay(1);
}
if (MusicMode == 0) {
PracticeMusic.stop("PracticeBGM");
PracticeMusic2.stop("BentoBGM");
PracticeMusic3.stop("Bento2BGM");
ConsoleMC.Console = "BGM muted";
ConsoleMC.gotoAndPlay(1);
}
}
if (Key.getCode() == 71) {
MovieQuality = MovieQuality + 1;
if (MovieQuality > 3) {
MovieQuality = 0;
}
if (MovieQuality == 0) {
_quality = "BEST";
ConsoleMC.Console = "Quality set BEST";
ConsoleMC.gotoAndPlay(1);
}
if (MovieQuality == 1) {
_quality = "HIGH";
ConsoleMC.Console = "Quality set HIGH";
ConsoleMC.gotoAndPlay(1);
}
if (MovieQuality == 2) {
_quality = "MEDIUM";
ConsoleMC.Console = "Quality set MEDIUM";
ConsoleMC.gotoAndPlay(1);
}
if (MovieQuality == 3) {
_quality = "LOW";
ConsoleMC.Console = "Quality set LOW";
ConsoleMC.gotoAndPlay(1);
}
}
if (((Key.getCode() == 81) && (DEAD == false)) && (EnemyDEAD == false)) {
TechMode = TechMode - 1;
if (TechMode < 0) {
TechMode = 5;
}
}
if (((Key.getCode() == 69) && (DEAD == false)) && (EnemyDEAD == false)) {
TechMode = TechMode + 1;
if (TechMode > 5) {
TechMode = 0;
}
}
if (((Key.getCode() == 32) && (HURTfront == true)) && (PlayerStamina >= 50)) {
ATTACK = true;
RECOVER = true;
PlayerStamina = PlayerStamina * 0.5;
Player.gotoAndPlay("Recover");
HURTfront = false;
HURT = false;
}
if (((Key.getCode() == 32) && (HURTback == true)) && (PlayerStamina >= 50)) {
ATTACK = true;
RECOVER = true;
PlayerStamina = PlayerStamina * 0.5;
Player.gotoAndPlay("Recover2");
HURTback = false;
HURT = false;
}
if ((((ATTACK == false) && (HURT == false)) && (DEAD == false)) && (EnemyDEAD == false)) {
if (((((Key.getCode() == 32) && (TechMode == 5)) && (CHARGE == false)) && (MySuper >= 30)) && (GodMode == false)) {
ATTACK = true;
Player.gotoAndPlay("Kamehameha");
Kame = true;
PlayerVelY = 0;
PlayerVelX = 0;
SuperBar._yscale = SuperBar._yscale - 30;
}
if ((((Key.getCode() == 32) && (TechMode == 5)) && (CHARGE == false)) && (GodMode == true)) {
ATTACK = true;
Player.gotoAndPlay("Kamehameha");
Kame = true;
PlayerVelY = 0;
PlayerVelX = 0;
}
if (((((Key.getCode() == 32) && (TechMode == 4)) && (CHARGE == false)) && (MySuper >= 20)) && (GodMode == false)) {
ATTACK = true;
Player.gotoAndPlay("Spiritball");
Spiritball = true;
PlayerVelY = 0;
PlayerVelX = 0;
SuperBar._yscale = SuperBar._yscale - 20;
}
if ((((Key.getCode() == 32) && (TechMode == 4)) && (CHARGE == false)) && (GodMode == true)) {
ATTACK = true;
Player.gotoAndPlay("Spiritball");
Spiritball = true;
PlayerVelY = 0;
PlayerVelX = 0;
}
if (((((Key.getCode() == 32) && (TechMode == 3)) && (CHARGE == false)) && (MySuper >= 10)) && (GodMode == false)) {
ATTACK = true;
Player.gotoAndPlay("Flurry");
PlayerForce = 90;
SuperBar._yscale = SuperBar._yscale - 10;
}
if ((((Key.getCode() == 32) && (TechMode == 3)) && (CHARGE == false)) && (GodMode == true)) {
ATTACK = true;
Player.gotoAndPlay("Flurry");
PlayerForce = 90;
}
if (((((Key.getCode() == 32) && (TechMode == 2)) && (CHARGE == false)) && (MySuper >= 5)) && (GodMode == false)) {
ATTACK = true;
Player.gotoAndPlay("SpiritSword");
PlayerForce = 90;
if (Player.hitTest(ground)) {
Player._y = Player._y - 10;
}
SuperBar._yscale = SuperBar._yscale - 5;
}
if ((((Key.getCode() == 32) && (TechMode == 2)) && (CHARGE == false)) && (GodMode == true)) {
ATTACK = true;
Player.gotoAndPlay("SpiritSword");
PlayerForce = 90;
if (Player.hitTest(ground)) {
Player._y = Player._y - 10;
}
}
if (((Key.getCode() == 32) && (TechMode == 1)) && (Trainer._visible == false)) {
TrainerORBIT = true;
ATTACK = true;
Player.gotoAndPlay("ForceBlade");
Trainer._visible = true;
TO = 0;
if (GODMODE == false) {
}
Trainer.gotoAndStop(2);
}
if (((Key.getCode() == 32) && (TechMode == 0)) && (CHARGE == false)) {
Player.gotoAndPlay("SHIELD");
ATTACK = true;
PlayerStamina = PlayerStamina * 0.7;
this.ShieldSparks._rotation = this.ShieldSparks._rotation + random(360);
if (GODMODE == false) {
}
}
if ((((Key.getCode() == 32) && (TechMode != 0)) && (DOSHIELD == true)) && (CHARGE == false)) {
Player.gotoAndPlay("SHIELD");
ATTACK = true;
PlayerStamina = PlayerStamina * 0.7;
this.ShieldSparks._rotation = this.ShieldSparks._rotation + random(360);
if (GODMODE == false) {
}
}
if (((Key.getCode() == 32) && (TechMode == 6)) && (CHARGE == false)) {
HADOUKEN = true;
Player.gotoAndPlay("Hadouken");
ATTACK = true;
PlayerStamina = PlayerStamina * 0.7;
if (GODMODE == false) {
SuperBar._yscale = SuperBar._yscale - 5;
}
shotname = Number(shotname) + 1;
if (Number(shotname) >= 4) {
shotname = 1;
}
if (Number(shotname) < 4) {
shotname = Number(shotname) + 1;
duplicateMovieClip (_root.fireball, "hadouken" + shotname, shotname);
}
setProperty("hadouken" + shotname, _rotation , MYANGLE);
setProperty("hadouken" + shotname, _x , Number(Player._x));
setProperty("hadouken" + shotname, _y , Number(Player._y));
HDistX = _xmouse - Player._x;
HDistY = _ymouse - Player._y;
shotspeed = 5;
Hxmov = HDistX / shotspeed;
Hymov = HDistY / shotspeed;
}
if (Key.getCode() == 16) {
Player.gotoAndPlay("TELEPORT");
TeleportSprite.gotoAndPlay("2");
TELEPORT = true;
PlayerStamina = PlayerStamina / 3;
PlayerScore = PlayerScore + (PlayerStamina * StageLevel);
TeleportSound = new Sound();
TeleportSound.attachSound("SuperSpeed");
TeleportSound.start();
}
}
}
function engineTRAINER() {
if (DEAD == false) {
this._x = this._x + TrainerVelX;
this._y = this._y + TrainerVelY;
TrainerNEUTRAL = true;
MydistX = _xmouse - this._x;
MydistY = _ymouse - this._y;
Mydir = Math.atan2(MydistY, MydistX);
this._rotation = Mydir * pi;
} else {
TrainerNEUTRAL == false;
}
if (this.hitTest(ground) && (TrainerVelY > 0)) {
TrainerVelY = TrainerVelY * -0.5;
}
if (this.hitTest(wallRIGHT) && (TrainerVelX > 0)) {
this._x = this._x - 1;
TrainerVelX = TrainerVelX * -0.5;
}
if (this.hitTest(wallLEFT) && (TrainerVelX < 0)) {
this._x = this._x + 1;
TrainerVelX = TrainerVelX * -0.5;
}
if (this.hitTest(wallTOP) && (TrainerVelY < 0)) {
this._y = this._y + 1;
TrainerVelY = TrainerVelY * -0.5;
}
if (TrainerORBIT == true) {
this._x = this._x + (-PlayerVelX);
this._y = this._y + (-PlayerVelY);
TO = TO + 1;
if (TO >= 25) {
TO = 0;
TrainerORBIT = false;
}
PlayerStamina = PlayerStamina * 0.92;
Txdist = TargetReticle._x - this._x;
Tydist = TargetReticle._y - this._y;
TrainerVelX = TrainerVelX + (Txdist / (hyp / 10));
TrainerVelY = TrainerVelY + (Tydist / (hyp / 10));
} else {
Txdist = Player._x - this._x;
Tydist = Player._y - this._y;
TrainerVelX = TrainerVelX + (Txdist / 50);
TrainerVelY = TrainerVelY + (Tydist / 50);
this._x = this._x + (-PlayerVelX);
this._y = this._y + (-PlayerVelY);
}
TrainerVelX = TrainerVelX * 0.8;
TrainerVelY = TrainerVelY * 0.8;
if ((((this.hitTest(Ball) && (this._visible == true)) && (DEAD == false)) && (EnemyDEAD == false)) && (TrainerATTACK == false)) {
ReflectSound = new Sound();
ReflectSound.attachSound("reflect");
ReflectSound.start();
TrainerORBIT = false;
TrainerVelX = 0;
TrainerVelY = 0;
BallTag = 1;
PlayerCombo = PlayerCombo + 1;
this.gotoAndPlay("ATTACK2");
TrainerATTACK = true;
TrainerPlayerDistX = Player._x - this._x;
TrainerForceX = TrainerPlayerDistX / 15;
TrainerForceY = -20;
BallVelX = TrainerForceX;
BallVelY = BallVelY + TrainerForceY;
}
}
function engineORB() {
if (TrainingMode == 1) {
if (this._x > Player._x) {
this._xscale = 100;
} else if (this._x < Player._x) {
this._xscale = -100;
}
if (BallTag > -1) {
this._x = this._x + ORBvelX;
this._y = this._y + ORBvelY;
ORBtoBallDistX = Ball._x - this._x;
ORBtoBallDistY = Ball._y - this._y;
ORBvelX = ORBtoBallDistX / 30;
ORBvelY = ORBtoBallDistY / 30;
}
if (this.hitTest(Ball) && (!Ball.hitTest(Player))) {
this.gotoAndPlay("ATTACK1");
ORBtoPlayerDistX = Player._x - this._x;
ORBtoPlayerDistY = (Player._y - 50) - this._y;
BallTag = 2;
BallEnergy = BallEnergy + 10;
BallVelX = ORBtoPlayerDistX / 20;
BallVelY = ORBtoPlayerDistY / 10;
}
if (this.hitTest(ground) && (ORBvelY > 0)) {
if (ORBvelY >= 5) {
ORBvelY = ORBvelY * -1;
}
}
if (this.hitTest(wallRIGHT) && (ORBvelX > 0)) {
this._x = this._x - 1;
ORBvelX = ORBvelX * -1;
}
if (this.hitTest(wallLEFT) && (ORBvelX < 0)) {
this._x = this._x + 1;
ORBVelX = ORBVelX * -1;
}
if (this.hitTest(wallTOP) && (ORBvelY < 0)) {
this._y = this._y + 1;
ORBvelY = ORBvelY * -1;
}
}
}
function engineORB2() {
if (this._x > Player._x) {
this._xscale = 100;
} else if (this._x < Player._x) {
this._xscale = -100;
}
this._x = this._x + ORB2velX;
this._y = this._y + ORB2velY;
if (this.hitTest(Ball) && (!Ball.hitTest(Player))) {
this.gotoAndPlay("ATTACK1");
ORB2toPlayerDistX = Player._x - this._x;
ORB2toPlayerDistY = (Player._y - 50) - this._y;
PlayerCombo = PlayerCombo + 1;
ORB2VelX = random(6) - random(6);
ORB2VelY = random(6) - random(6);
BallVelX = ORB2toPlayerDistX / 20;
BallVelY = (-ORB2toPlayerDistY) / 10;
}
if (this.hitTest(ground) && (ORB2velY > 0)) {
this._y = this._y - 1;
ORB2velY = ORB2velY * -1;
}
if (this.hitTest(wallRIGHT) && (ORB2velX > 0)) {
this._x = this._x - 1;
ORB2velX = ORB2velX * -1;
}
if (this.hitTest(wallLEFT) && (ORB2velX < 0)) {
this._x = this._x + 1;
ORB2VelX = ORB2VelX * -1;
}
if (this.hitTest(wallTOP) && (ORB2velY < 0)) {
this._y = this._y + 1;
ORB2velY = ORB2velY * -1;
}
}
function engineENEMY() {
if (TrainingMode == 2) {
EnemyAccel = random(40) + 10;
if ((BallTag == 2) || (BallTag == 0)) {
if ((HURT == false) && (EnemyATTACK == false)) {
EnemyBallDistX = Ball._x - this._x;
EnemyBallDistY = Ball._y - this._y;
EnemyMovX = (EnemyBallDistX + EnemyBallDistX) / 10;
EnemyMovY = (EnemyBallDistY + EnemyBallDistY) / 10;
}
if ((((HURT == true) && (Player._y > 100)) && (!Player.hitTest(ground))) && (EnemyATTACK == false)) {
EnemyBallDistX = Player._x - this._x;
EnemyBallDistY = Player._y - this._y;
EnemyMovX = (EnemyBallDistX / EnemyAccel) * 4;
EnemyMovY = (EnemyBallDistY / EnemyAccel) * 4;
}
if (((HURT == true) && (Player._y < 100)) || (Player.hitTest(ground) && (EnemyATTACK == false))) {
EnemyBallDistX = Ball._x - this._x;
EnemyBallDistY = Ball._y - this._y;
EnemyMovX = (EnemyBallDistX / EnemyAccel) * 3;
EnemyMovY = (EnemyBallDistY / EnemyAccel) * 3;
}
}
if (((BallTag == 1) && (HURT == false)) && (EnemyATTACK == false)) {
EnemyBallDistX = Ball._x - this._x;
EnemyBallDistY = Ball._y - this._y;
EnemyMovX = EnemyBallDistX / EnemyAccel;
EnemyMovY = EnemyBallDistY / EnemyAccel;
}
if (((EnemyHURT == false) && (EnemyATTACK == false)) && (DEAD == false)) {
this._x = this._x + EnemyMovX;
this._y = this._y + EnemyMovY;
}
if (EnemyHURT == true) {
this._x = this._x + EnemyVelX;
this._y = this._y + EnemyVelY;
if (EnemyVelY > 15) {
EnemyVelY = 15;
}
}
if (EnemyHURT == true) {
if (!this.hitTest(ground)) {
EnemyVelY = EnemyVelY + 1;
EnemyVelX = EnemyVelX * 0.95;
EnemyMovY = EnemyMovY + PlayerMass;
EnemyMovX = EnemyMovX * 0.95;
}
}
if ((((this.hitTest(Player) && (Player._y > 100)) && (!Player.hitTest(ground))) && (HURT == true)) && (EnemyATTACK == false)) {
EnemyPower = random(16) + 4;
PlayerHealth = PlayerHealth - EnemyPower;
PlayerStamina = PlayerStamina - EnemyPower;
meleeflash._visible = true;
meleeflash._x = Player._x;
meleeflash._y = Player._y;
meleeflash.gotoAndPlay("POWER");
if (Player._x > Enemy._x) {
if (EnemyPower >= 15) {
this.GotoAndPlay("hitUP4");
EnemyForceX = 30;
EnemyForceY = -20;
} else if ((EnemyPower <= 15) && (EnemyPower > 10)) {
this.GotoAndPlay("hitUP3");
EnemyForceX = 20;
EnemyForceY = -15;
} else if ((EnemyPower < 10) && (EnemyPower > 5)) {
this.GotoAndPlay("hitUP2");
EnemyForceX = 10;
EnemyForceY = -10;
} else if (EnemyPower <= 5) {
this.GotoAndPlay("hitUP2");
EnemyForceX = 15;
EnemyForceY = -15;
}
}
if (Player._x <= Enemy._x) {
if (EnemyPower >= 15) {
this.GotoAndPlay("hitUP4");
EnemyForceX = -30;
EnemyForceY = -20;
} else if ((EnemyPower <= 15) && (EnemyPower > 10)) {
this.GotoAndPlay("hitUP3");
EnemyForceX = -20;
EnemyForceY = -15;
} else if ((EnemyPower < 10) && (EnemyPower > 5)) {
this.GotoAndPlay("hitUP2");
EnemyForceX = -10;
EnemyForceY = -10;
} else if (EnemyPower <= 5) {
this.GotoAndPlay("hitUP2");
EnemyForceX = -15;
EnemyForceY = -15;
}
}
HURT = true;
EnemyATTACK = true;
PlayerVelX = EnemyForceX;
PlayerVelY = EnemyForceY;
if ((PlayerFacingR == true) && (EnemyForceX >= 0)) {
Player.gotoAndPlay("HURTback");
HURTback = true;
HURTfront = false;
ImpactSound.start();
PainSound.start();
}
if ((PlayerFacingL == true) && (EnemyForceX < 0)) {
Player.gotoAndPlay("HURTback");
HURTback = true;
HURTfront = false;
ImpactSound.start();
PainSound.start();
}
if ((PlayerFacingR == true) && (EnemyForceX < 0)) {
Player.gotoAndPlay("HURTfront");
HURTfront = true;
HURTback = false;
ImpactSound.start();
PainSound.start();
}
if ((PlayerFacingL == true) && (EnemyForceX >= 0)) {
Player.gotoAndPlay("HURTfront");
HURTfront = true;
HURTback = false;
ImpactSound.start();
PainSound.start();
}
}
EnemyTeleportNOW = random(101);
if ((((((EnemyTeleport == false) && (EnemyTeleportNOW > 99)) && (EnemyHURT == false)) && (EnemyATTACK == false)) && (DEAD == false)) && (EnemyDEAD == false)) {
Enemy.gotoAndPlay("TELEPORT");
EnemyTeleport = true;
}
EnemyHadoukenNOW = random(51);
if ((((((EnemyHadouken == false) && (EnemyHadoukenNOW > 149)) && (EnemyHURT == false)) && (EnemyATTACK == false)) && (DEAD == false)) && (EnemyDEAD == false)) {
Enemy.gotoAndPlay("Hadouken");
if (this._x > Player._x) {
this._xscale = -90;
Enemy._rotation = -EnemyAngle2;
} else if (this._x < Player._x) {
this._xscale = 90;
Enemy._rotation = -EnemyAngle2;
}
shotname = Number(shotname) + 1;
if (Number(shotname) >= 4) {
shotname = 1;
}
if (Number(shotname) < 4) {
shotname = Number(shotname) + 1;
duplicateMovieClip (_root.fireball, "hadouken" + shotname, shotname);
}
setProperty("hadouken" + shotname, _rotation , EnemyAngle2);
setProperty("hadouken" + shotname, _x , Number(Enemy._x));
setProperty("hadouken" + shotname, _y , Number(Enemy._y));
HDistX = -(Enemy._x - Player._x);
HDistY = -(Enemy._y - Player._y);
shotspeed = 5;
Hxmov = HDistX / shotspeed;
Hymov = HDistY / shotspeed;
EnemyHadouken = true;
}
if (EnemyHURT == true) {
EnemyATTACK == false;
}
if (Enemy.hitTest(Player.BEAhitbox)) {
EnemyHURT = true;
EnemyHealth = EnemyHealth - (PlayerCombo + 1);
EnemyVelX = Xdist / 30;
EnemyVelY = Ydist / 30;
ImpactSound2 = new Sound();
ImpactSound2.attachSound("impactHURT");
PainSound2 = new Sound();
PainSound2.attachSound("painHURT");
if ((EnemyFacingR == true) && (Player._x < this._x)) {
this.gotoAndPlay("HURTback");
EnemyHURTback = true;
BallEnergy = BallEnergy / 3;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingL == true) && (Player._x > this._x)) {
this.gotoAndPlay("HURTback");
EnemyHURTback = true;
BallEnergy = BallEnergy / 3;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingR == true) && (Player._x > this._x)) {
this.gotoAndPlay("HURTfront");
EnemyHURTfront = true;
BallEnergy = BallEnergy / 3;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingL == true) && (Player._x < this._x)) {
this.gotoAndPlay("HURTfront");
EnemyHURTfront = true;
BallEnergy = BallEnergy / 3;
ImpactSound2.start();
PainSound2.start();
}
}
if (((Enemy.hitTest(Ball) && (BallEnergy >= 30)) && (BallTag == 1)) && (EnemyHURT == true)) {
EnemyHURT = true;
PlayerCombo = PlayerCombo + 1;
SuperBar._yscale = SuperBar._yscale + 1;
EnemyHealth = EnemyHealth - (BallEnergy / 3);
EnemyVelX = BallVelX / 2;
EnemyVelY = -5;
Ball._xscale = BallSize;
Ball._yscale = BallSize;
ImpactSound2 = new Sound();
ImpactSound2.attachSound("impactHURT");
PainSound2 = new Sound();
PainSound2.attachSound("painHURT");
if ((EnemyFacingR == true) && (BallVelX > 0)) {
this.gotoAndPlay("HURTback");
EnemyHURTback = true;
BallEnergy = BallEnergy / 3;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingL == true) && (BallVelX < 0)) {
this.gotoAndPlay("HURTback");
EnemyHURTback = true;
BallEnergy = BallEnergy / 3;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingR == true) && (BallVelX < 0)) {
this.gotoAndPlay("HURTfront");
EnemyHURTfront = true;
BallEnergy = BallEnergy / 3;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingL == true) && (BallVelX > 0)) {
this.gotoAndPlay("HURTfront");
EnemyHURTfront = true;
BallEnergy = BallEnergy / 3;
ImpactSound2.start();
PainSound2.start();
}
}
if ((((EnemyHURT == false) && (DEAD == false)) && (EnemyHadouken == false)) && (EnemyDEAD == false)) {
if (((((EnemyMovY < 0) && (EnemyMovX >= -1)) && (EnemyMovX <= 1)) && (EnemyATTACK == false)) && (EnemyTELEPORT == false)) {
this.gotoAndPlay("FLYup");
}
}
if ((((((((((!this.hitTest(ground)) && (EnemyMovX >= -1)) && (EnemyMovX <= 1)) && (EnemyMovY > 0)) && (EnemyHURT == false)) && (DEAD == false)) && (EnemyATTACK == false)) && (EnemyTELEPORT == false)) && (EnemyDEAD == false)) && (EnemyHadouken == false)) {
this.gotoAndPlay("FLYdown");
}
if ((((((EnemyATTACK == false) && (EnemyHadouken == false)) && (EnemyHURT == false)) && (DEAD == false)) && (EnemyFacingR == true)) && (EnemyDEAD == false)) {
if (((EnemyMovX < -1) && (EnemyATTACK == false)) && (EnemyTELEPORT == false)) {
this.gotoAndPlay("FLYbackward");
}
if (((EnemyMovX > 1) && (EnemyATTACK == false)) && (EnemyTELEPORT == false)) {
this.gotoAndPlay("FLYforward");
}
} else if ((((((EnemyATTACK == false) && (EnemyHadouken == false)) && (EnemyHURT == false)) && (DEAD == false)) && (EnemyDEAD == false)) && (EnemyFacingL == true)) {
if (((EnemyMovX > 1) && (EnemyATTACK == false)) && (EnemyTELEPORT == false)) {
this.gotoAndPlay("FLYbackward");
}
if (((EnemyMovX < -1) && (EnemyATTACK == false)) && (EnemyTELEPORT == false)) {
this.gotoAndPlay("FLYforward");
}
}
EnemyShadow._x = Enemy._x;
EnemyShadow._x = EnemyShadow._x + (-PlayerVelX);
EnemyShadow._xscale = Enemy._width + (Enemy._y / 2);
EnemyShadow._y = ground._y;
if (((EnemyHURT == false) && (BallTag == 1)) && (EnemyHadouken == false)) {
if (this._x > Player._x) {
this._xscale = 90;
EnemyFacingL = true;
EnemyFacingR = false;
} else if (this._x < Player._x) {
this._xscale = -90;
EnemyFacingR = true;
EnemyFacingL = false;
}
}
if ((((EnemyHURT == false) && (BallTag != 1)) && (HURT == true)) && (EnemyHadouken == false)) {
if (this._x > Player._x) {
this._xscale = 90;
EnemyFacingL = true;
EnemyFacingR = false;
} else if (this._x < Player._x) {
this._xscale = -90;
EnemyFacingR = true;
EnemyFacingL = false;
}
}
if ((((EnemyHURT == false) && (BallTag != 1)) && (HURT == false)) && (EnemyHadouken == false)) {
if (this._x > Ball._x) {
this._xscale = 90;
EnemyFacingL = true;
EnemyFacingR = false;
} else if (this._x < Ball._x) {
this._xscale = -90;
EnemyFacingR = true;
EnemyFacingL = false;
}
}
if (DEAD == false) {
if (this.hitTest(ground)) {
EnemyVelY = 0;
if (EnemyHURTback == true) {
this.gotoAndPlay("HITground");
EnemyVelX = 0;
} else if (EnemyHURTfront == true) {
this.gotoAndPlay("HITground2");
EnemyVelX = 0;
}
}
if (this.hitTest(wallRIGHT)) {
Enemy._x = Enemy._x - 1;
BARRIER.gotoAndPlay("HITRIGHT");
EnemyVelX = EnemyVelX * -0.5;
EnemyMovX = EnemyMovX * -1.1;
if ((EnemyHURTfront == true) && (EnemyVelX < -1)) {
this.gotoAndPlay("HURTback");
EnemyHURTback = true;
EnemyHURTfront = false;
} else if ((EnemyHURTback == true) && (EnemyVelX < -1)) {
this.gotoAndPlay("HURTfront");
EnemyHURTback = false;
EnemyHURTfront = true;
}
}
if (this.hitTest(wallLEFT)) {
Enemy._x = Enemy._x + 1;
BARRIER.gotoAndPlay("HITLEFT");
EnemyVelX = EnemyVelX * -0.5;
EnemyMovX = EnemyMovX * -1.1;
if ((EnemyHURTfront == true) && (EnemyVelX > 1)) {
this.gotoAndPlay(206);
EnemyHURTback = true;
EnemyHURTfront = false;
WallImpactSound = new Sound();
WallImpactSound.attachSound("wallIMPACT");
WallImpactSound.start();
} else if ((EnemyHURTback == true) && (EnemyVelX > 1)) {
this.gotoAndPlay(239);
EnemyHURTback = false;
EnemyHURTfront = true;
}
}
if (this.hitTest(wallTOP) && (EnemyVelY < 0)) {
Enemy._y = Enemy._y + 1;
BARRIER.gotoAndPlay("HITTOP");
EnemyVelY = EnemyVelY * -1;
}
}
EnemyHealthBall._xscale = EnemyHealth / 2;
EnemyHealthBall._yscale = EnemyHealthBall._xscale;
if (((this.HITBOX.hitTest(Ball) && (EnemyHURT == false)) && (EnemyATTACK == false)) && (EnemyDEAD == false)) {
EnemyChoice = random(101);
if (EnemyChoice >= 30) {
EnemyPower = random(24) + 1;
meleeflash._visible = true;
meleeflash._x = Ball._x;
meleeflash._y = Ball._y;
meleeflash.gotoAndPlay("POWER");
DoICombo = random(101);
if (DoICombo <= 50) {
if (Player._y <= Enemy._y) {
if (EnemyPower <= 5) {
this.GotoAndPlay("hitUP4");
} else if ((EnemyPower <= 10) && (EnemyPower > 5)) {
this.GotoAndPlay("hitUP3");
} else if ((EnemyPower < 15) && (EnemyPower > 10)) {
this.GotoAndPlay("hitUP2");
} else if (EnemyPower >= 15) {
this.GotoAndPlay("hitUP1");
}
}
if (Player._y > Enemy._y) {
if (EnemyPower <= 5) {
this.GotoAndPlay("hitDOWN4");
} else if ((EnemyPower <= 10) && (EnemyPower > 5)) {
this.GotoAndPlay("hitDOWN3");
} else if ((EnemyPower < 15) && (EnemyPower > 10)) {
this.GotoAndPlay("hitDOWN2");
} else if (EnemyPower >= 15) {
this.GotoAndPlay("hitDOWN1");
}
}
BallTag = 2;
EnemyATTACK = true;
BallEnergy = BallEnergy + EnemyPower;
EnemyPlayerDistX = Player._x - this._x;
EnemyPlayerDistY = Player._y - this._y;
EnemyForceX = EnemyPlayerDistX / EnemyPower;
EnemyForceY = EnemyPlayerDistY / EnemyPower;
BallVelX = EnemyForceX;
BallVelY = EnemyForceY;
Ball._xscale = Ball._xscale + (EnemyPower / 3);
Ball._yscale = Ball._yscale + (EnemyPower / 3);
} else if (DoICombo > 50) {
BallTag = 2;
if (EnemyPower <= 5) {
this.GotoAndPlay("hitUP1");
} else if ((EnemyPower <= 10) && (EnemyPower > 5)) {
this.GotoAndPlay("hitUP2");
} else if ((EnemyPower < 15) && (EnemyPower > 10)) {
this.GotoAndPlay("hitUP3");
} else if (EnemyPower >= 15) {
this.GotoAndPlay("hitUP4");
}
EnemyATTACK = true;
BallEnergy = BallEnergy + EnemyPower;
EnemyPlayerDistX = Enemy._x - Ball._x;
EnemyForceX = EnemyPlayerDistX / EnemyPower;
EnemyForceY = -EnemyPower;
BallVelX = EnemyForceX;
BallVelY = EnemyForceY;
}
} else if (((BallEnergy >= 30) && (BallTag == 1)) && (EnemyChoice < 30)) {
EnemyHURT = true;
PlayerCombo = PlayerCombo + 1;
SuperBar._yscale = SuperBar._yscale + 1;
EnemyHealth = EnemyHealth - (((PlayerCombo + 1) * BallEnergy) / 100);
EnemyVelX = BallVelX / 2;
EnemyVelY = -5;
Ball._xscale = BallSize;
Ball._yscale = BallSize;
ImpactSound2 = new Sound();
ImpactSound2.attachSound("impactHURT");
PainSound2 = new Sound();
PainSound2.attachSound("painHURT");
if ((EnemyFacingR == true) && (BallVelX > 0)) {
this.gotoAndPlay("HURTback");
EnemyHURTback = true;
BallEnergy = BallEnergy / 3;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingL == true) && (BallVelX < 0)) {
this.gotoAndPlay("HURTback");
EnemyHURTback = true;
BallEnergy = BallEnergy / 3;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingR == true) && (BallVelX < 0)) {
this.gotoAndPlay("HURTfront");
EnemyHURTfront = true;
BallEnergy = BallEnergy / 3;
ImpactSound2.start();
PainSound2.start();
}
if ((EnemyFacingL == true) && (BallVelX > 0)) {
this.gotoAndPlay("HURTfront");
EnemyHURTfront = true;
BallEnergy = BallEnergy / 3;
ImpactSound2.start();
PainSound2.start();
}
}
}
if ((EnemyHealth < 1) && (EnemyDEAD == false)) {
EnemyDEAD = true;
EnemyHealthBall._alpha = 0;
Mouse.show();
Kame = false;
KameHame = false;
Spiritball = false;
PlayerScore = PlayerScore + (1000 * (StageLevel + 1));
Player.gotoAndPlay("I WIN");
GAMEOVER2._visible = true;
}
}
}
ConsoleMC.Console = "";
GodMode = false;
SuperBar._yscale = 0;
CONE = false;
TechMode = 0;
PlayerScore = 0;
TrainingMode = 0;
MovieQuality = 0;
MusicMode = 1;
StageLevel = 1;
StageLevelE = 0;
PlayerMass = 1.7;
Ball._xscale = 50;
Ball._yscale = 50;
BallVelX = 0;
BallVelY = -15;
PlayerCombo = 0;
PlayerMaxCombo = 0;
DispCoFe._visible = false;
combodisplay._alpha = 0;
combodisplay2._visible = false;
MAXcomboDisplay._visible = false;
DefendListener = new Object();
Key.addListener(DefendListener);
DefaultPlayerRot = Player._rotation;
DefaultBeamRot = Player._rotation;
Trainer._visible = false;
if (BallType == 3) {
BallMass = 0.5;
BallTMass = 0.5;
} else if (BallType == 2) {
BallMass = 1;
BallTMass = 1;
} else if (BallType == 1) {
BallMass = 2;
BallTMass = 2;
}
BallSize = Ball._xscale;
init();
stop();
Symbol 62 MovieClip [hadouken_mcR] Frame 1
my_x = _x;
my_y = _y;
my_x = my_x + (-_root.PlayerVelX);
my_y = my_y + (-_root.PlayerVelY);
if ((((Number(my_y) > Number(_root.ground._y)) or (Number(my_y) < Number(_root.wallTOP._y))) or (Number(my_x) > Number(_root.wallRIGHT._x))) or (Number(my_x) < Number(_root.wallLEFT._x))) {
gotoAndPlay (23);
} else {
_x = (Number(my_x) + Number(_root.Hxmov));
_y = (Number(my_y) + Number(_root.Hymov));
}
Symbol 62 MovieClip [hadouken_mcR] Frame 2
gotoAndPlay (1);
Symbol 62 MovieClip [hadouken_mcR] Frame 23
my_x = _x;
my_y = _y;
my_x = my_x + (-_root.PlayerVelX);
my_y = my_y + (-_root.PlayerVelY);
Symbol 62 MovieClip [hadouken_mcR] Frame 24
my_x = _x;
my_y = _y;
my_x = my_x + (-_root.PlayerVelX);
my_y = my_y + (-_root.PlayerVelY);
Symbol 62 MovieClip [hadouken_mcR] Frame 25
my_x = _x;
my_y = _y;
my_x = my_x + (-_root.PlayerVelX);
my_y = my_y + (-_root.PlayerVelY);
Symbol 62 MovieClip [hadouken_mcR] Frame 26
my_x = _x;
my_y = _y;
my_x = my_x + (-_root.PlayerVelX);
my_y = my_y + (-_root.PlayerVelY);
Symbol 62 MovieClip [hadouken_mcR] Frame 27
my_x = _x;
my_y = _y;
my_x = my_x + (-_root.PlayerVelX);
my_y = my_y + (-_root.PlayerVelY);
Symbol 62 MovieClip [hadouken_mcR] Frame 28
my_x = _x;
my_y = _y;
my_x = my_x + (-_root.PlayerVelX);
my_y = my_y + (-_root.PlayerVelY);
Symbol 62 MovieClip [hadouken_mcR] Frame 29
removeMovieClip("");
Symbol 62 MovieClip [hadouken_mcR] Frame 35
stop();
Symbol 63 MovieClip [solo] Frame 1
stop();
Symbol 63 MovieClip [solo] Frame 5
stop();
Symbol 72 MovieClip [duel] Frame 1
stop();
Symbol 72 MovieClip [duel] Frame 5
stop();
Symbol 163 MovieClip Frame 7
stop();
Symbol 165 Button
on (release) {
_root.gotoAndStop("MAINMENU");
}
Symbol 185 MovieClip Frame 1
_root.stop();
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded != 100) {
setProperty(bar, _xscale , PercentLoaded);
} else {
gotoAndStop (3);
}
Symbol 185 MovieClip Frame 2
gotoAndPlay (1);
Symbol 185 MovieClip Frame 3
_root.P.gotoAndPlay(12);
_root.GameMode = 3;
_root.BallType = 2;
_root.Difficulty = 2;
Symbol 191 MovieClip Frame 1
stop();
Symbol 191 MovieClip Frame 5
stop();
Symbol 194 MovieClip Frame 1
stop();
Symbol 194 MovieClip Frame 5
stop();
Symbol 197 MovieClip Frame 1
stop();
Symbol 197 MovieClip Frame 5
stop();
Symbol 200 MovieClip Frame 1
stop();
Symbol 200 MovieClip Frame 5
stop();
Symbol 203 Button
on (release) {
stopAllSounds();
if (_root.GameMode == 2) {
_root.gotoAndPlay("LEVEL1");
} else if (_root.GameMode == 3) {
_root.gotoAndPlay("TUTORIAL");
}
}
Symbol 208 Button
on (release) {
stopAllSounds();
}
Symbol 246 MovieClip Frame 65
stop();
Symbol 286 MovieClip Frame 29
gotoAndPlay (26);
Symbol 402 MovieClip Frame 50
stop();
Symbol 511 MovieClip Frame 1
_root.HURT = false;
_root.HURTfront = false;
_root.HURTback = false;
Symbol 511 MovieClip Frame 10
gotoAndPlay (1);
Symbol 552 MovieClip Frame 1
_root.BallTag = 0;
stop();
Symbol 552 MovieClip Frame 81
stop();
Symbol 568 MovieClip Frame 1
stop();
Symbol 625 MovieClip Frame 1
stop();
_root.Player._visible = true;
_root.Player._alpha = 100;
Symbol 625 MovieClip Frame 4
_root.Player._visible = false;
_root.PlayerVelX = _root.PlayerVelX * 15;
_root.PlayerVelY = _root.PlayerVelY * 15;
Symbol 625 MovieClip Frame 5
_root.PlayerVelX = 0;
_root.PlayerVelY = 0;
Symbol 625 MovieClip Frame 8
_root.Player._visible = true;
Symbol 625 MovieClip Frame 10
gotoAndStop (1);
Symbol 626 MovieClip Frame 1
_root.HURT = false;
_root.HURTfront = false;
_root.HURTback = false;
Symbol 633 MovieClip Frame 34
stop();
Symbol 755 Button
on (release) {
gotoAndPlay (9);
}
Symbol 763 Button
on (release) {
gotoAndPlay (16);
}
Symbol 1100 MovieClip Frame 1
_root.PlayerVelY = _root.PlayerVelY - _root.PlayerWeight;
Symbol 1100 MovieClip Frame 2
_root.PlayerVelY = _root.PlayerVelY - _root.PlayerWeight;
Symbol 1100 MovieClip Frame 3
_root.PlayerVelY = _root.PlayerVelY - _root.PlayerWeight;
Symbol 1100 MovieClip Frame 4
_root.PlayerVelY = _root.PlayerVelY - _root.PlayerWeight;
Symbol 1100 MovieClip Frame 5
_root.PlayerVelY = _root.PlayerVelY - _root.PlayerWeight;
Symbol 1100 MovieClip Frame 6
_root.PlayerVelY = _root.PlayerVelY - _root.PlayerWeight;
Symbol 1100 MovieClip Frame 7
_root.PlayerVelY = _root.PlayerVelY - _root.PlayerWeight;
Symbol 1100 MovieClip Frame 8
_root.PlayerVelY = _root.PlayerVelY - _root.PlayerWeight;
Symbol 1193 MovieClip Frame 1
_root.HURT = false;
_root.HURTfront = false;
_root.HURTback = false;
_root.SWORD = false;
Symbol 1193 MovieClip Frame 10
gotoAndPlay (1);
Symbol 1193 MovieClip Frame 22
gotoAndPlay (11);
Symbol 1193 MovieClip Frame 34
gotoAndPlay (23);
Symbol 1193 MovieClip Frame 46
gotoAndPlay (35);
Symbol 1193 MovieClip Frame 51
gotoAndPlay (47);
Symbol 1193 MovieClip Frame 58
gotoAndPlay (52);
Symbol 1193 MovieClip Frame 72
_root.ATTACK = false;
_root.TELEPORT = false;
_root.HIT = false;
Symbol 1193 MovieClip Frame 88
_root.ATTACK = false;
_root.HIT = false;
_root.TELEPORT = false;
Symbol 1193 MovieClip Frame 108
_root.ATTACK = false;
_root.HIT = false;
_root.TELEPORT = false;
Symbol 1193 MovieClip Frame 124
_root.ATTACK = false;
_root.HIT = false;
_root.TELEPORT = false;
Symbol 1193 MovieClip Frame 141
_root.ATTACK = false;
_root.HIT = false;
_root.TELEPORT = false;
Symbol 1193 MovieClip Frame 161
_root.ATTACK = false;
_root.HIT = false;
_root.TELEPORT = false;
Symbol 1193 MovieClip Frame 174
_root.ATTACK = false;
_root.HIT = false;
_root.TELEPORT = false;
Symbol 1193 MovieClip Frame 195
_root.ATTACK = false;
_root.HIT = false;
_root.TELEPORT = false;
Symbol 1193 MovieClip Frame 196
_root.ATTACK = false;
_root.HIT = false;
_root.TELEPORT = false;
gotoAndStop (1);
Symbol 1193 MovieClip Frame 205
_root.HURT = true;
_root.HURTback = true;
Symbol 1193 MovieClip Frame 233
stop();
Symbol 1193 MovieClip Frame 238
_root.HURT = true;
_root.HURTfront = true;
Symbol 1193 MovieClip Frame 266
stop();
Symbol 1193 MovieClip Frame 269
_root.HURTback = false;
Symbol 1193 MovieClip Frame 277
_root.PlayerVelX = 0;
_root.PlayerRestX = true;
if (_root.PlayerHealth <= 0) {
stop();
_root.DEAD = true;
}
Symbol 1193 MovieClip Frame 297
gotoAndStop (1);
Symbol 1193 MovieClip Frame 307
_root.HURTfront = false;
_root.HURTfront = false;
Symbol 1193 MovieClip Frame 315
_root.PlayerVelX = 0;
_root.PlayerRestX = true;
if (_root.PlayerHealth <= 0) {
stop();
_root.DEAD = true;
}
Symbol 1193 MovieClip Frame 321
gotoAndStop (1);
Symbol 1193 MovieClip Frame 356
stop();
Symbol 1193 MovieClip Frame 389
stop();
Symbol 1193 MovieClip Frame 399
_root.PlayerVelX = 0;
_root.PlayerVelY = -_root.gravity;
Symbol 1193 MovieClip Frame 400
_root.PlayerVelX = 0;
_root.PlayerVelY = -_root.gravity;
Symbol 1193 MovieClip Frame 401
if (this.hitTest(_root.Ball)) {
_root.PlayerCombo = _root.PlayerCombo + 1;
}
_root.PlayerVelX = 0;
_root.PlayerVelY = -_root.gravity;
Symbol 1193 MovieClip Frame 402
_root.PlayerVelX = 0;
_root.PlayerVelY = -_root.gravity;
Symbol 1193 MovieClip Frame 403
_root.PlayerVelX = 0;
_root.PlayerVelY = -_root.gravity;
Symbol 1193 MovieClip Frame 404
_root.PlayerVelX = 0;
_root.PlayerVelY = -_root.gravity;
Symbol 1193 MovieClip Frame 405
_root.PlayerVelX = 0;
_root.PlayerVelY = -_root.gravity;
Symbol 1193 MovieClip Frame 406
_root.PlayerVelX = 0;
_root.PlayerVelY = -_root.gravity;
Symbol 1193 MovieClip Frame 410
_root.ATTACK = false;
Symbol 1193 MovieClip Frame 412
_root.PlayerVelX = 0;
_root.PlayerVelY = 0;
Symbol 1193 MovieClip Frame 445
gotoAndStop (1);
_root.init();
_root.PlayerHealth = 100;
_root.EnemyHealth = 100;
_root.EnemyDEAD = false;
_root.BallVelY = -30;
_root.Difficulty = _root.Difficulty * 0.9;
_root.PlayerVelY = 2;
_root.StageLevel = _root.StageLevel + 1;
Symbol 1193 MovieClip Frame 454
_root.TELEPORT = false;
Symbol 1193 MovieClip Frame 487
_root.KameHame = true;
Symbol 1193 MovieClip Frame 535
_root.Kame = false;
_root.KameHame = false;
_root.ATTACK = false;
Symbol 1193 MovieClip Frame 574
_root.Spiritball = true;
Symbol 1193 MovieClip Frame 639
_root.Spiritball = false;
_root.ATTACK = false;
Symbol 1193 MovieClip Frame 652
_root.ATTACK = false;
Symbol 1193 MovieClip Frame 663
_root.ATTACK = false;
Symbol 1193 MovieClip Frame 702
_root.Rx = 1;
Symbol 1193 MovieClip Frame 710
_root.Rx = 0;
Symbol 1193 MovieClip Frame 717
_root.ATTACK = false;
_root.RECOVER = false;
Symbol 1193 MovieClip Frame 718
_root.Rx = 1;
Symbol 1193 MovieClip Frame 725
_root.Rx = 0;
Symbol 1193 MovieClip Frame 733
_root.ATTACK = false;
_root.RECOVER = false;
Symbol 1193 MovieClip Frame 819
_root.ATTACK = false;
_root.PlayerForce = 0;
Symbol 1193 MovieClip Frame 821
_root.PlayerVelX = 0;
_root.PlayerVelY = 0;
Symbol 1193 MovieClip Frame 822
_root.PlayerVelX = 0;
_root.PlayerVelY = _root.PlayerVelY - _root.PlayerWeight;
Symbol 1193 MovieClip Frame 823
_root.PlayerVelX = 0;
_root.PlayerVelY = _root.PlayerVelY - _root.PlayerWeight;
Symbol 1193 MovieClip Frame 824
_root.PlayerVelX = 0;
_root.PlayerVelY = _root.PlayerVelY - _root.PlayerWeight;
Symbol 1193 MovieClip Frame 825
_root.PlayerVelX = 0;
_root.PlayerVelY = _root.PlayerVelY - _root.PlayerWeight;
Symbol 1193 MovieClip Frame 826
_root.PlayerVelX = 0;
_root.PlayerVelY = _root.PlayerVelY - _root.PlayerWeight;
Symbol 1193 MovieClip Frame 827
_root.PlayerVelX = 0;
_root.PlayerVelY = _root.PlayerVelY - _root.PlayerWeight;
Symbol 1193 MovieClip Frame 828
_root.PlayerVelX = 0;
_root.PlayerVelY = _root.PlayerVelY - _root.PlayerWeight;
Symbol 1193 MovieClip Frame 829
_root.PlayerVelX = 0;
_root.PlayerVelY = _root.PlayerVelY - _root.PlayerWeight;
Symbol 1193 MovieClip Frame 830
_root.PlayerVelX = 0;
_root.PlayerVelY = _root.PlayerVelY - _root.PlayerWeight;
Symbol 1193 MovieClip Frame 831
_root.PlayerVelX = 0;
_root.PlayerVelY = _root.PlayerVelY - _root.PlayerWeight;
Symbol 1193 MovieClip Frame 832
_root.PlayerVelX = 0;
_root.PlayerVelY = _root.PlayerVelY - _root.PlayerWeight;
Symbol 1193 MovieClip Frame 833
_root.PlayerVelX = 0;
_root.PlayerVelY = _root.PlayerVelY - _root.PlayerWeight;
Symbol 1193 MovieClip Frame 834
_root.PlayerVelX = 0;
_root.PlayerVelY = _root.PlayerVelY - _root.PlayerWeight;
Symbol 1193 MovieClip Frame 835
_root.PlayerVelX = 0;
_root.PlayerVelY = _root.PlayerVelY - _root.PlayerWeight;
Symbol 1193 MovieClip Frame 836
_root.PlayerVelX = 0;
_root.PlayerVelY = 0;
if (_root.Player.hitTest(_root.ground)) {
_root.Player._y = _root.Player._y - 10;
}
Symbol 1193 MovieClip Frame 837
_root.PlayerVelX = _root.Xdist / 4;
_root.PlayerVelY = _root.Ydist / 4;
if (_root.Player.hitTest(_root.ground)) {
_root.Player._y = _root.Player._y - 1;
}
Symbol 1193 MovieClip Frame 838
_root.SWORD = true;
Symbol 1193 MovieClip Frame 843
_root.SWORD = false;
_root.PlayerVelX = _root.PlayerVelX * 0.5;
_root.PlayerVelY = _root.PlayerVelY * 0.5;
Symbol 1193 MovieClip Frame 844
_root.ATTACK = false;
Symbol 1193 MovieClip Frame 860
_root.PlayerVelX = 0;
_root.PlayerVelY = 0;
_root.CONE = true;
Symbol 1193 MovieClip Frame 861
_root.PlayerVelX = 0;
_root.PlayerVelY = 0;
Symbol 1193 MovieClip Frame 862
_root.PlayerVelX = 0;
_root.PlayerVelY = 0;
Symbol 1193 MovieClip Frame 863
_root.PlayerVelX = 0;
_root.PlayerVelY = 0;
Symbol 1193 MovieClip Frame 864
_root.PlayerVelX = 0;
_root.PlayerVelY = 0;
Symbol 1193 MovieClip Frame 865
_root.PlayerVelX = 0;
_root.PlayerVelY = 0;
Symbol 1193 MovieClip Frame 866
_root.PlayerVelX = 0;
_root.PlayerVelY = 0;
Symbol 1193 MovieClip Frame 867
_root.PlayerVelX = 0;
_root.PlayerVelY = 0;
Symbol 1193 MovieClip Frame 868
_root.PlayerVelX = 0;
_root.PlayerVelY = 0;
Symbol 1193 MovieClip Frame 869
_root.PlayerVelX = 0;
_root.PlayerVelY = 0;
Symbol 1193 MovieClip Frame 870
_root.PlayerVelX = 0;
_root.PlayerVelY = 0;
Symbol 1193 MovieClip Frame 871
_root.PlayerVelX = 0;
_root.PlayerVelY = 0;
Symbol 1193 MovieClip Frame 872
_root.PlayerVelX = 0;
_root.PlayerVelY = 0;
Symbol 1193 MovieClip Frame 873
_root.PlayerVelX = 0;
_root.PlayerVelY = 0;
Symbol 1193 MovieClip Frame 874
_root.PlayerVelX = 0;
_root.PlayerVelY = 0;
Symbol 1193 MovieClip Frame 875
_root.PlayerVelX = 0;
_root.PlayerVelY = 0;
Symbol 1193 MovieClip Frame 876
_root.PlayerVelX = 0;
_root.PlayerVelY = 0;
Symbol 1193 MovieClip Frame 877
_root.ATTACK = false;
_root.CONE = false;
Symbol 1193 MovieClip Frame 922
_root.ATTACK = false;
_root.HADOUKEN = false;
Symbol 1193 MovieClip Frame 932
_root.ATTACK = false;
_root.HADOUKEN = false;
Symbol 1193 MovieClip Frame 962
gotoAndPlay (951);
Symbol 1193 MovieClip Frame 974
gotoAndPlay (963);
Symbol 1193 MovieClip Frame 986
gotoAndPlay (975);
Symbol 1193 MovieClip Frame 993
gotoAndPlay (987);
Symbol 1194 Button
on (release) {
gotoAndPlay (22);
}
Symbol 1198 Button
on (release) {
gotoAndPlay (28);
}
Symbol 1205 Button
on (release) {
gotoAndStop (35);
}
Symbol 1211 Button
on (release) {
gotoAndStop (37);
}
Symbol 1218 Button
on (release) {
gotoAndStop (39);
}
Symbol 1223 Button
on (release) {
gotoAndPlay (40);
}
Symbol 1231 Button
on (release) {
gotoAndPlay (46);
}
Symbol 1233 Button
on (release) {
gotoAndPlay (53);
}
Symbol 1241 Button
on (release) {
gotoAndStop (69);
}
Symbol 1256 MovieClip Frame 1
stop();
_root.TrainerATTACK = false;
_root.EnemyATTACK2 = false;
Symbol 1256 MovieClip Frame 20
gotoAndStop (1);
Symbol 1256 MovieClip Frame 27
_root.Trainer._x = _root.Player._x;
_root.Trainer._y = _root.Player._y;
_root.Trainer._visible = false;
Symbol 1256 MovieClip Frame 31
gotoAndStop (1);
Symbol 1257 Button
on (release) {
gotoAndPlay (62);
}
Symbol 1269 MovieClip Frame 3
_root.PlayerVelX = 0;
_root.PlayerVelY = -_root.gravity;
Symbol 1269 MovieClip Frame 5
if (this.hitTest(_root.Ball)) {
_root.PlayerCombo = _root.PlayerCombo + 1;
}
Symbol 1270 Button
on (release) {
gotoAndPlay (70);
}
Symbol 1277 Button
on (release) {
gotoAndStop (1);
}
Symbol 1279 MovieClip Frame 1
stop();
Instance of Symbol 511 MovieClip in Symbol 1279 MovieClip Frame 10
/* no clip actions */
Instance of Symbol 552 MovieClip "Ball" in Symbol 1279 MovieClip Frame 10
onClipEvent (enterFrame) {
}
Symbol 1279 MovieClip Frame 41
reticle.onEnterFrame = function () {
reticle._x = _xmouse;
reticle._y = _ymouse;
if (reticle._x > char._x) {
char._xscale = 190;
}
if (reticle._x < char._x) {
char._xscale = -190;
}
Xdist = reticle._x - char._x;
Ydist = reticle._y - char._y;
pi = 57.2957795130823;
angle = Math.atan2(Ydist, Xdist);
hyp = Math.sqrt((Xdist * Xdist) + (Ydist * Ydist));
Sniperline._xscale = hyp;
Sniperline._alpha = (hyp / 500) * 100;
Sniperline._rotation = angle * pi;
};
Instance of Symbol 511 MovieClip "char" in Symbol 1279 MovieClip Frame 41
/* no clip actions */
Instance of Symbol 511 MovieClip in Symbol 1279 MovieClip Frame 104
/* no clip actions */
Symbol 1279 MovieClip Frame 109
stop();
Symbol 1279 MovieClip Frame 116
stop();
Instance of Symbol 511 MovieClip in Symbol 1279 MovieClip Frame 117
/* no clip actions */
Symbol 1279 MovieClip Frame 122
stop();
Instance of Symbol 511 MovieClip in Symbol 1279 MovieClip Frame 123
/* no clip actions */
Symbol 1279 MovieClip Frame 128
stop();
Symbol 1279 MovieClip Frame 134
stop();
Symbol 1279 MovieClip Frame 136
stop();
Symbol 1279 MovieClip Frame 138
stop();
Symbol 1279 MovieClip Frame 140
stop();
Symbol 1279 MovieClip Frame 146
stop();
Symbol 1279 MovieClip Frame 153
stop();
Symbol 1279 MovieClip Frame 160
stop();
Instance of Symbol 552 MovieClip "Ball" in Symbol 1279 MovieClip Frame 160
onClipEvent (enterFrame) {
}
Symbol 1279 MovieClip Frame 162
stop();
Symbol 1279 MovieClip Frame 170
stop();
Symbol 1279 MovieClip Frame 176
stop();
Instance of Symbol 511 MovieClip in Symbol 1279 MovieClip Frame 176
/* no clip actions */
Symbol 1286 Button
on (release) {
_root.gotoAndStop("MAINMENU");
_root.GAMEOVER2._visible = false;
}
Symbol 1287 MovieClip Frame 1
stop();
Symbol 1287 MovieClip Frame 20
stop();
Symbol 1295 MovieClip Frame 1
stop();
Symbol 1295 MovieClip Frame 2
_root.Enemy.gotoAndPlay("I WIN");
Symbol 1295 MovieClip Frame 46
stop();
Symbol 1296 Button
on (release) {
stopAllSounds();
_root.gotoAndStop("MAINMENU");
}
Symbol 1299 Button
on (release) {
gotoAndStop (268);
}
Symbol 1302 Button
on (release) {
Tutorial.gotoAndStop("MOVEMENT");
}
Symbol 1305 Button
on (release) {
Tutorial.gotoAndStop("CONCEPT");
}
Symbol 1308 Button
on (release) {
Tutorial.gotoAndStop("MELEEATTACK");
}
Symbol 1311 Button
on (release) {
Tutorial.gotoAndStop("AIMING");
}
Symbol 1314 Button
on (release) {
Tutorial.gotoAndStop("SPECIALS");
}
Symbol 1317 Button
on (release) {
Tutorial.gotoAndStop("COMBOS");
}
Symbol 1320 Button
on (release) {
Tutorial.gotoAndStop("PLAYERHUD");
}
Symbol 1341 MovieClip Frame 1
stop();
Symbol 1344 MovieClip Frame 1
stop();
Symbol 1344 MovieClip Frame 12
gotoAndStop (1);
Symbol 1344 MovieClip Frame 24
gotoAndStop (1);
Symbol 1344 MovieClip Frame 36
gotoAndStop (1);
Symbol 1344 MovieClip Frame 48
gotoAndStop (1);
Symbol 1344 MovieClip Frame 60
gotoAndStop (1);
Symbol 1347 MovieClip Frame 1
play();
Symbol 1356 Button
on (release) {
stopAllSounds();
_root.gotoAndStop("PRACTICE GAME");
}
Symbol 1467 MovieClip Frame 34
stop();
Symbol 1593 MovieClip Frame 1
_root.EnemyHURT = false;
_root.EnemyHURTfront = false;
_root.EnemyHURTback = false;
Symbol 1593 MovieClip Frame 10
gotoAndPlay (1);
Symbol 1593 MovieClip Frame 22
gotoAndPlay (11);
Symbol 1593 MovieClip Frame 34
gotoAndPlay (23);
Symbol 1593 MovieClip Frame 46
gotoAndPlay (35);
Symbol 1593 MovieClip Frame 51
gotoAndPlay (47);
Symbol 1593 MovieClip Frame 58
gotoAndPlay (52);
Symbol 1593 MovieClip Frame 72
_root.EnemyATTACK = false;
_root.EnemyTELEPORT = false;
Symbol 1593 MovieClip Frame 88
_root.EnemyATTACK = false;
_root.EnemyTELEPORT = false;
Symbol 1593 MovieClip Frame 108
_root.EnemyATTACK = false;
_root.EnemyTELEPORT = false;
Symbol 1593 MovieClip Frame 124
_root.EnemyATTACK = false;
_root.EnemyTELEPORT = false;
Symbol 1593 MovieClip Frame 141
_root.EnemyATTACK = false;
_root.EnemyTELEPORT = false;
Symbol 1593 MovieClip Frame 164
_root.EnemyATTACK = false;
_root.EnemyTELEPORT = false;
Symbol 1593 MovieClip Frame 174
_root.EnemyATTACK = false;
_root.EnemyTELEPORT = false;
Symbol 1593 MovieClip Frame 196
_root.EnemyATTACK = false;
_root.EnemyTELEPORT = false;
Symbol 1593 MovieClip Frame 205
_root.EnemyHURT = true;
_root.EnemyHURTback = true;
_root.EnemyATTACK = false;
Symbol 1593 MovieClip Frame 233
stop();
Symbol 1593 MovieClip Frame 238
_root.EnemyHURT = true;
_root.EnemyHURTfront = true;
_root.EnemyATTACK = false;
Symbol 1593 MovieClip Frame 266
stop();
Symbol 1593 MovieClip Frame 269
_root.EnemyHURTback = false;
Symbol 1593 MovieClip Frame 277
if (_root.EnemyDEAD == true) {
stop();
}
if (_root.EnemyDEAD == false) {
play();
}
Symbol 1593 MovieClip Frame 297
gotoAndStop (1);
Symbol 1593 MovieClip Frame 307
_root.EnemyHURTfront = false;
Symbol 1593 MovieClip Frame 315
if (_root.EnemyDEAD == true) {
stop();
}
if (_root.EnemyDEAD == false) {
play();
}
Symbol 1593 MovieClip Frame 321
gotoAndStop (1);
Symbol 1593 MovieClip Frame 356
stop();
Symbol 1593 MovieClip Frame 389
stop();
Symbol 1593 MovieClip Frame 399
_root.EnemyVelX = 0;
_root.EnemyVelY = -_root.gravity;
Symbol 1593 MovieClip Frame 410
_root.EnemyATTACK = false;
Symbol 1593 MovieClip Frame 412
_root.EnemyVelX = 0;
_root.EnemyVelY = 0;
Symbol 1593 MovieClip Frame 445
stop();
Symbol 1593 MovieClip Frame 454
_root.EnemyTELEPORT = false;
Symbol 1888 MovieClip Frame 1
_root.EnemyHURT = false;
_root.EnemyHURTfront = false;
_root.EnemyHURTback = false;
_root.EnemyHadouken = false;
_root.EnemyATTACK = false;
Symbol 1888 MovieClip Frame 10
gotoAndPlay (1);
Symbol 1888 MovieClip Frame 22
gotoAndPlay (11);
Symbol 1888 MovieClip Frame 34
gotoAndPlay (23);
Symbol 1888 MovieClip Frame 46
gotoAndPlay (35);
Symbol 1888 MovieClip Frame 51
gotoAndPlay (47);
Symbol 1888 MovieClip Frame 58
gotoAndPlay (52);
Symbol 1888 MovieClip Frame 72
_root.EnemyATTACK = false;
_root.EnemyTELEPORT = false;
Symbol 1888 MovieClip Frame 88
_root.EnemyATTACK = false;
_root.EnemyTELEPORT = false;
Symbol 1888 MovieClip Frame 108
_root.EnemyATTACK = false;
_root.EnemyTELEPORT = false;
Symbol 1888 MovieClip Frame 124
_root.EnemyATTACK = false;
_root.EnemyTELEPORT = false;
Symbol 1888 MovieClip Frame 141
_root.EnemyATTACK = false;
_root.EnemyTELEPORT = false;
Symbol 1888 MovieClip Frame 164
_root.EnemyATTACK = false;
_root.EnemyTELEPORT = false;
Symbol 1888 MovieClip Frame 174
_root.EnemyATTACK = false;
_root.EnemyTELEPORT = false;
Symbol 1888 MovieClip Frame 196
_root.EnemyATTACK = false;
_root.EnemyTELEPORT = false;
Symbol 1888 MovieClip Frame 205
_root.EnemyHURT = true;
_root.EnemyHURTback = true;
_root.EnemyATTACK = false;
Symbol 1888 MovieClip Frame 233
stop();
Symbol 1888 MovieClip Frame 238
_root.EnemyHURT = true;
_root.EnemyHURTfront = true;
_root.EnemyATTACK = false;
Symbol 1888 MovieClip Frame 266
stop();
Symbol 1888 MovieClip Frame 269
_root.EnemyHURTback = false;
Symbol 1888 MovieClip Frame 276
if (_root.EnemyDEAD == true) {
gotoAndPlay (275);
}
Symbol 1888 MovieClip Frame 297
gotoAndStop (1);
Symbol 1888 MovieClip Frame 307
_root.EnemyHURTfront = false;
Symbol 1888 MovieClip Frame 315
if (_root.EnemyDEAD == true) {
gotoAndPlay (314);
}
Symbol 1888 MovieClip Frame 321
gotoAndStop (1);
Symbol 1888 MovieClip Frame 356
stop();
Symbol 1888 MovieClip Frame 389
stop();
Symbol 1888 MovieClip Frame 399
_root.EnemyVelX = 0;
_root.EnemyVelY = -_root.gravity;
Symbol 1888 MovieClip Frame 410
_root.EnemyATTACK = false;
Symbol 1888 MovieClip Frame 412
_root.EnemyVelX = 0;
_root.EnemyVelY = 0;
Symbol 1888 MovieClip Frame 445
stop();
Symbol 1888 MovieClip Frame 453
if (_root.BallTag < 2) {
_root.Enemy._x = random(700) + 100;
_root.Enemy._y = random(200) + 100;
}
if (_root.BallTag == 2) {
_root.Enemy._x = _root.Enemy._x + (_root.EnemyMovX * 5);
_root.Enemy._y = _root.Enemy._y + (_root.EnemyMovY * 5);
}
Symbol 1888 MovieClip Frame 454
_root.EnemyTELEPORT = false;
Symbol 1888 MovieClip Frame 461
_root.EnemyATTACK = true;
Symbol 1888 MovieClip Frame 466
_root.EnemyATTACK = false;
_root.EnemyHadouken = false;
_root.Enemy._rotation = 180;
gotoAndStop (1);
Symbol 2042 MovieClip Frame 1
stop();
Symbol 2042 MovieClip Frame 8
gotoAndStop (1);
Symbol 2042 MovieClip Frame 18
gotoAndStop (1);
Symbol 2042 MovieClip Frame 27
gotoAndStop (1);
Symbol 2074 MovieClip Frame 1
stop();
_root.WALLDIE2 = false;
Symbol 2074 MovieClip Frame 244
stop();
Symbol 2077 MovieClip Frame 1
stop();
_root.WALLDIE = false;
Symbol 2077 MovieClip Frame 244
stop();
Symbol 2079 MovieClip Frame 1
stop();
Symbol 2092 MovieClip Frame 1
stop();
_root.EnemyATTACK = false;
Symbol 2092 MovieClip Frame 20
gotoAndStop (1);
Symbol 2092 MovieClip Frame 31
gotoAndStop (1);
Symbol 2100 MovieClip Frame 1
stop();
_root.TREEDIE = false;
Symbol 2100 MovieClip Frame 10
_root.TREEDIE = true;
Symbol 2100 MovieClip Frame 60
stop();
Symbol 2101 Button
on (release) {
stopAllSounds();
Key.removeListener(DefendListener);
_quality = "BEST";
_root.gotoAndStop("MAINMENU");
}
Symbol 2102 Button
on (release) {
stopAllSounds();
Key.removeListener(DefendListener);
_root.gotoAndStop("TUTORIAL");
_quality = "BEST";
}
Symbol 2111 MovieClip Frame 1
stop();
_root.STONERATTACK = false;
Symbol 2111 MovieClip Frame 16
_root.STONERATTACK = true;
Symbol 2115 MovieClip Frame 1
my_x = _x;
my_y = _y;
my_x = my_x + (-_root.PlayerVelX);
my_y = my_y + (-_root.PlayerVelY);
if (this.hitTest(_root.Player) && (_root.HURT == false)) {
_root.HURT = true;
_root.HURTfront = true;
_root.PlayerHealth = _root.PlayerHealth - 20;
_root.Player.gotoAndPlay("HURTfront");
gotoAndPlay (23);
}
if ((((Number(my_y) > Number(_root.ground._y)) or (Number(my_y) < Number(_root.wallTOP._y))) or (Number(my_x) > Number(_root.wallRIGHT._x))) or (Number(my_x) < Number(_root.wallLEFT._x))) {
gotoAndPlay (23);
} else {
_x = (Number(my_x) + Number(_root.Hxmov));
_y = (Number(my_y) + Number(_root.Hymov));
}
Symbol 2115 MovieClip Frame 2
gotoAndPlay (1);
Symbol 2115 MovieClip Frame 23
my_x = _x;
my_y = _y;
my_x = my_x + (-_root.PlayerVelX);
my_y = my_y + (-_root.PlayerVelY);
Symbol 2115 MovieClip Frame 24
my_x = _x;
my_y = _y;
my_x = my_x + (-_root.PlayerVelX);
my_y = my_y + (-_root.PlayerVelY);
Symbol 2115 MovieClip Frame 25
my_x = _x;
my_y = _y;
my_x = my_x + (-_root.PlayerVelX);
my_y = my_y + (-_root.PlayerVelY);
Symbol 2115 MovieClip Frame 26
my_x = _x;
my_y = _y;
my_x = my_x + (-_root.PlayerVelX);
my_y = my_y + (-_root.PlayerVelY);
Symbol 2115 MovieClip Frame 27
my_x = _x;
my_y = _y;
my_x = my_x + (-_root.PlayerVelX);
my_y = my_y + (-_root.PlayerVelY);
Symbol 2115 MovieClip Frame 28
my_x = _x;
my_y = _y;
my_x = my_x + (-_root.PlayerVelX);
my_y = my_y + (-_root.PlayerVelY);
Symbol 2115 MovieClip Frame 29
removeMovieClip("");
Symbol 2115 MovieClip Frame 35
stop();
Symbol 2133 MovieClip Frame 55
stop();