Frame 1
Stage.scaleMode = "showAll";
Mouse.show();
Stage.showMenu = false;
Mouse.show();
Instance of Symbol 22 MovieClip [duel] "duel" in Frame 2
on (press) {
this.gotoAndStop("ON");
_root.solo.gotoAndStop("OFF");
_root.practice.gotoAndStop("OFF");
_root.GameMode = 2;
}
Instance of Symbol 19 MovieClip [solo] "solo" in Frame 2
on (press) {
}
Instance of Symbol 143 MovieClip "TypeLight" in Frame 2
on (press) {
this.gotoAndStop("ON");
_root.TypeNormal.gotoAndStop("OFF");
_root.TypeHeavy.gotoAndStop("OFF");
_root.BallType = 3;
}
Instance of Symbol 146 MovieClip "TypeNormal" in Frame 2
on (press) {
this.gotoAndStop("ON");
_root.TypeLight.gotoAndStop("OFF");
_root.TypeHeavy.gotoAndStop("OFF");
_root.BallType = 2;
}
Instance of Symbol 149 MovieClip "TypeHeavy" in Frame 2
on (press) {
this.gotoAndStop("ON");
_root.TypeNormal.gotoAndStop("OFF");
_root.TypeLight.gotoAndStop("OFF");
_root.BallType = 1;
}
Instance of Symbol 152 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);
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 502 MovieClip "Ball" in Frame 81
onClipEvent (enterFrame) {
}
Instance of Symbol 846 MovieClip "Player" in Frame 81
/* no clip actions */
Frame 114
Stage.scaleMode = "showAll";
Mouse.show();
bg.bg.gotoAndPlay(2);
Instance of Symbol 1251 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 502 MovieClip "Ball" in Frame 206
onClipEvent (enterFrame) {
}
Instance of Symbol 846 MovieClip "Player" in Frame 206
/* no clip actions */
Instance of Symbol 1530 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 (this.hitTest(EnemyGOAL)) {
BallVelX = 0;
BallVelY = 2;
Ball._x = 440;
Ball._y = 0;
PlayerHealth = 100;
EnemyHealth = EnemyHealth * 0.5;
StageLevel = StageLevel + 1;
}
if (this.hitTest(PlayerGOAL)) {
BallVelX = 0;
BallVelY = 2;
Ball._x = 440;
Ball._y = 0;
EnemyHealth = 100;
PlayerHealth = PlayerHealth * 0.5;
}
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)) {
Trainer._visible = false;
}
if (Trainer._visible == false) {
Trainer._x = this._x;
Trainer._y = this._y;
}
if (TechMode == 0) {
TechLogo.gotoAndStop("Shield");
CurrentTech = "Shield";
}
if (TechMode == 1) {
TechLogo.gotoAndStop("ForceBlade");
CurrentTech = "Force Blade";
} else {
Trainer._visible = false;
}
if (TechMode == 2) {
TechLogo.gotoAndStop("Spiritball");
CurrentTech = "Spiritball";
}
if (TechMode == 3) {
TechLogo.gotoAndStop("Superbeam");
CurrentTech = "Super Beam";
}
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;
aura._visible = false;
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;
}
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");
} 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) && (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;
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;
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) && (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)) {
ATTACK = true;
Player.gotoAndPlay("Kamehameha");
Kame = true;
PlayerVelY = 0;
PlayerVelX = 0;
}
if (((Key.getCode() == 32) && (TechMode == 2)) && (CHARGE == false)) {
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) {
EnemyBallDistX = Ball._x - this._x;
EnemyBallDistY = Ball._y - this._y;
EnemyMovX = EnemyBallDistX / EnemyAccel;
EnemyMovY = EnemyBallDistY / EnemyAccel;
}
if (BallTag < 2) {
EnemyBallDistX = (EnemyGOAL._x - this._x) - Ball._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 (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("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;
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;
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("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 * 50);
EnemyForceY = EnemyPlayerDistY / (Difficulty * 50);
BallVelX = EnemyForceX;
BallVelY = EnemyForceY;
Ball._xscale = Ball._xscale + (EnemyPower / 3);
Ball._yscale = Ball._yscale + (EnemyPower / 3);
} else if ((DoICombo < 90) && (DoICombo > 50)) {
if (PlayerGOAL._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 (PlayerGOAL._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 = PlayerGOAL._x - this._x;
EnemyPlayerDistY = PlayerGOAL._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 > 90) {
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();
Kame = false;
KameHame = false;
Spiritball = false;
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;
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;
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 502 MovieClip "Ball" in Frame 245
onClipEvent (enterFrame) {
}
Instance of Symbol 846 MovieClip "Player" in Frame 245
/* no clip actions */
Instance of Symbol 1530 MovieClip "Enemy" in Frame 245
/* no clip actions */
Symbol 19 MovieClip [solo] Frame 1
stop();
Symbol 19 MovieClip [solo] Frame 5
stop();
Symbol 22 MovieClip [duel] Frame 1
stop();
Symbol 22 MovieClip [duel] Frame 5
stop();
Symbol 117 Button
on (release) {
_root.gotoAndStop("MAINMENU");
}
Symbol 137 MovieClip Frame 1
_root.stop();
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded != 100) {
setProperty(bar, _xscale , PercentLoaded);
} else {
gotoAndStop (3);
}
Symbol 137 MovieClip Frame 2
gotoAndPlay (1);
Symbol 137 MovieClip Frame 3
_root.P.gotoAndPlay(12);
_root.GameMode = 2;
_root.BallType = 2;
_root.Difficulty = 2;
Symbol 143 MovieClip Frame 1
stop();
Symbol 143 MovieClip Frame 5
stop();
Symbol 146 MovieClip Frame 1
stop();
Symbol 146 MovieClip Frame 5
stop();
Symbol 149 MovieClip Frame 1
stop();
Symbol 149 MovieClip Frame 5
stop();
Symbol 152 MovieClip Frame 1
stop();
Symbol 152 MovieClip Frame 5
stop();
Symbol 154 Button
on (release) {
stopAllSounds();
if (_root.GameMode == 2) {
_root.gotoAndPlay("LEVEL1");
} else if (_root.GameMode == 3) {
_root.gotoAndPlay("PRACTICE GAME");
}
}
Symbol 156 Button
on (release) {
stopAllSounds();
_root.gotoAndPlay("TEST");
}
Symbol 195 MovieClip Frame 65
stop();
Symbol 235 MovieClip Frame 29
gotoAndPlay (26);
Symbol 348 MovieClip Frame 50
stop();
Symbol 460 MovieClip Frame 1
stop();
Symbol 464 MovieClip Frame 1
stop();
Symbol 502 MovieClip Frame 1
_root.BallTag = 0;
stop();
Symbol 502 MovieClip Frame 81
stop();
Symbol 504 MovieClip Frame 1
stop();
Symbol 504 MovieClip Frame 12
gotoAndStop (1);
Symbol 504 MovieClip Frame 24
gotoAndStop (1);
Symbol 504 MovieClip Frame 36
gotoAndStop (1);
Symbol 504 MovieClip Frame 48
gotoAndStop (1);
Symbol 507 MovieClip Frame 1
play();
Symbol 520 MovieClip Frame 1
stop();
_root.TrainerATTACK = false;
_root.EnemyATTACK2 = false;
Symbol 520 MovieClip Frame 20
gotoAndStop (1);
Symbol 520 MovieClip Frame 27
_root.Trainer._x = _root.Player._x;
_root.Trainer._y = _root.Player._y;
_root.Trainer._visible = false;
Symbol 520 MovieClip Frame 31
gotoAndStop (1);
Symbol 560 MovieClip Frame 34
stop();
Symbol 846 MovieClip Frame 1
_root.HURT = false;
_root.HURTfront = false;
_root.HURTback = false;
Symbol 846 MovieClip Frame 10
gotoAndPlay (1);
Symbol 846 MovieClip Frame 22
gotoAndPlay (11);
Symbol 846 MovieClip Frame 34
gotoAndPlay (23);
Symbol 846 MovieClip Frame 46
gotoAndPlay (35);
Symbol 846 MovieClip Frame 51
gotoAndPlay (47);
Symbol 846 MovieClip Frame 58
gotoAndPlay (52);
Symbol 846 MovieClip Frame 72
_root.ATTACK = false;
_root.TELEPORT = false;
_root.HIT = false;
Symbol 846 MovieClip Frame 88
_root.ATTACK = false;
_root.HIT = false;
_root.TELEPORT = false;
Symbol 846 MovieClip Frame 108
_root.ATTACK = false;
_root.HIT = false;
_root.TELEPORT = false;
Symbol 846 MovieClip Frame 124
_root.ATTACK = false;
_root.HIT = false;
_root.TELEPORT = false;
Symbol 846 MovieClip Frame 141
_root.ATTACK = false;
_root.HIT = false;
_root.TELEPORT = false;
Symbol 846 MovieClip Frame 164
_root.ATTACK = false;
_root.HIT = false;
_root.TELEPORT = false;
Symbol 846 MovieClip Frame 174
_root.ATTACK = false;
_root.HIT = false;
_root.TELEPORT = false;
Symbol 846 MovieClip Frame 196
_root.ATTACK = false;
_root.HIT = false;
_root.TELEPORT = false;
Symbol 846 MovieClip Frame 205
_root.HURT = true;
_root.HURTback = true;
Symbol 846 MovieClip Frame 233
stop();
Symbol 846 MovieClip Frame 238
_root.HURT = true;
_root.HURTfront = true;
Symbol 846 MovieClip Frame 266
stop();
Symbol 846 MovieClip Frame 269
_root.HURTback = false;
Symbol 846 MovieClip Frame 277
_root.PlayerVelX = 0;
_root.PlayerRestX = true;
if (_root.PlayerHealth <= 0) {
stop();
_root.DEAD = true;
}
Symbol 846 MovieClip Frame 297
gotoAndStop (1);
Symbol 846 MovieClip Frame 307
_root.HURTfront = false;
Symbol 846 MovieClip Frame 315
_root.PlayerVelX = 0;
_root.PlayerRestX = true;
if (_root.PlayerHealth <= 0) {
stop();
_root.DEAD = true;
}
Symbol 846 MovieClip Frame 321
gotoAndStop (1);
Symbol 846 MovieClip Frame 356
stop();
Symbol 846 MovieClip Frame 389
stop();
Symbol 846 MovieClip Frame 399
_root.PlayerVelX = 0;
_root.PlayerVelY = -_root.gravity;
Symbol 846 MovieClip Frame 401
if (this.hitTest(_root.Ball)) {
_root.PlayerCombo = _root.PlayerCombo + 1;
}
Symbol 846 MovieClip Frame 410
_root.ATTACK = false;
Symbol 846 MovieClip Frame 412
_root.PlayerVelX = 0;
_root.PlayerVelY = 0;
Symbol 846 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 846 MovieClip Frame 454
_root.TELEPORT = false;
Symbol 846 MovieClip Frame 487
_root.KameHame = true;
Symbol 846 MovieClip Frame 535
_root.Kame = false;
_root.KameHame = false;
_root.ATTACK = false;
Symbol 846 MovieClip Frame 574
_root.Spiritball = true;
Symbol 846 MovieClip Frame 639
_root.Spiritball = false;
_root.ATTACK = false;
Symbol 846 MovieClip Frame 654
_root.ATTACK = false;
Symbol 856 MovieClip Frame 1
stop();
_root.Player._visible = true;
_root.Player._alpha = 100;
Symbol 856 MovieClip Frame 4
_root.Player._visible = false;
_root.Player._x = _root.Player._x + (_root.PlayerVelX * 3);
_root.Player._y = _root.Player._y + (_root.PlayerVelY * 3);
Symbol 856 MovieClip Frame 8
_root.Player._visible = true;
Symbol 856 MovieClip Frame 10
gotoAndStop (1);
Instance of Symbol 502 MovieClip "Ball" in Symbol 858 MovieClip Frame 1
onClipEvent (enterFrame) {
}
Instance of Symbol 846 MovieClip "Player" in Symbol 858 MovieClip Frame 1
/* no clip actions */
Symbol 861 Button
on (release) {
gotoAndPlay (2);
}
Symbol 864 MovieClip Frame 1
_root.HURT = false;
_root.HURTfront = false;
_root.HURTback = false;
Symbol 864 MovieClip Frame 10
gotoAndPlay (1);
Symbol 865 Button
on (release) {
gotoAndPlay (9);
}
Symbol 878 Button
on (release) {
gotoAndPlay (16);
}
Symbol 883 MovieClip Frame 1
_root.HURT = false;
_root.HURTfront = false;
_root.HURTback = false;
Symbol 884 Button
on (release) {
gotoAndPlay (22);
}
Symbol 887 Button
on (release) {
gotoAndPlay (28);
}
Symbol 892 Button
on (release) {
gotoAndStop (35);
}
Symbol 897 Button
on (release) {
gotoAndStop (37);
}
Symbol 903 Button
on (release) {
gotoAndStop (39);
}
Symbol 907 Button
on (release) {
gotoAndPlay (40);
}
Symbol 915 Button
on (release) {
gotoAndPlay (46);
}
Symbol 961 Button
on (release) {
gotoAndPlay (53);
}
Symbol 968 Button
on (release) {
gotoAndStop (61);
}
Symbol 970 Button
on (release) {
gotoAndPlay (62);
}
Symbol 981 MovieClip Frame 3
_root.PlayerVelX = 0;
_root.PlayerVelY = -_root.gravity;
Symbol 981 MovieClip Frame 5
if (this.hitTest(_root.Ball)) {
_root.PlayerCombo = _root.PlayerCombo + 1;
}
Symbol 982 Button
on (release) {
gotoAndPlay (70);
}
Symbol 986 Button
on (release) {
gotoAndStop (1);
}
Symbol 988 MovieClip Frame 1
stop();
Instance of Symbol 864 MovieClip in Symbol 988 MovieClip Frame 3
/* no clip actions */
Symbol 988 MovieClip Frame 8
stop();
Symbol 988 MovieClip Frame 15
stop();
Instance of Symbol 864 MovieClip in Symbol 988 MovieClip Frame 16
/* no clip actions */
Symbol 988 MovieClip Frame 21
stop();
Instance of Symbol 864 MovieClip in Symbol 988 MovieClip Frame 22
/* no clip actions */
Symbol 988 MovieClip Frame 27
stop();
Symbol 988 MovieClip Frame 33
stop();
Symbol 988 MovieClip Frame 35
stop();
Symbol 988 MovieClip Frame 37
stop();
Symbol 988 MovieClip Frame 39
stop();
Symbol 988 MovieClip Frame 45
stop();
Symbol 988 MovieClip Frame 52
stop();
Symbol 988 MovieClip Frame 59
stop();
Instance of Symbol 502 MovieClip "Ball" in Symbol 988 MovieClip Frame 59
onClipEvent (enterFrame) {
}
Symbol 988 MovieClip Frame 61
stop();
Symbol 988 MovieClip Frame 69
stop();
Symbol 988 MovieClip Frame 75
stop();
Instance of Symbol 864 MovieClip in Symbol 988 MovieClip Frame 75
/* no clip actions */
Symbol 994 Button
on (release) {
_root.gotoAndStop("MAINMENU");
_root.GAMEOVER2._visible = false;
}
Symbol 995 MovieClip Frame 1
stop();
Symbol 995 MovieClip Frame 20
stop();
Symbol 998 Button
on (release) {
_root.gotoAndStop("MAINMENU");
GAMEOVER._visible = false;
stopAllSounds();
}
Symbol 1003 Button
on (release) {
stopAllSounds();
_root.gotoAndStop("MAINMENU");
GAMEOVER._visible = false;
}
Symbol 1004 MovieClip Frame 1
stop();
Symbol 1004 MovieClip Frame 2
_root.Enemy.gotoAndPlay("I WIN");
Symbol 1004 MovieClip Frame 37
stop();
Symbol 1005 Button
on (release) {
stopAllSounds();
_root.gotoAndStop("MAINMENU");
}
Symbol 1007 Button
on (release) {
play();
}
Symbol 1014 Button
on (release) {
stopAllSounds();
_root.gotoAndStop("PRACTICE GAME");
}
Symbol 1125 MovieClip Frame 34
stop();
Symbol 1251 MovieClip Frame 1
_root.EnemyHURT = false;
_root.EnemyHURTfront = false;
_root.EnemyHURTback = false;
Symbol 1251 MovieClip Frame 10
gotoAndPlay (1);
Symbol 1251 MovieClip Frame 22
gotoAndPlay (11);
Symbol 1251 MovieClip Frame 34
gotoAndPlay (23);
Symbol 1251 MovieClip Frame 46
gotoAndPlay (35);
Symbol 1251 MovieClip Frame 51
gotoAndPlay (47);
Symbol 1251 MovieClip Frame 58
gotoAndPlay (52);
Symbol 1251 MovieClip Frame 72
_root.EnemyATTACK = false;
_root.EnemyTELEPORT = false;
Symbol 1251 MovieClip Frame 88
_root.EnemyATTACK = false;
_root.EnemyTELEPORT = false;
Symbol 1251 MovieClip Frame 108
_root.EnemyATTACK = false;
_root.EnemyTELEPORT = false;
Symbol 1251 MovieClip Frame 124
_root.EnemyATTACK = false;
_root.EnemyTELEPORT = false;
Symbol 1251 MovieClip Frame 141
_root.EnemyATTACK = false;
_root.EnemyTELEPORT = false;
Symbol 1251 MovieClip Frame 164
_root.EnemyATTACK = false;
_root.EnemyTELEPORT = false;
Symbol 1251 MovieClip Frame 174
_root.EnemyATTACK = false;
_root.EnemyTELEPORT = false;
Symbol 1251 MovieClip Frame 196
_root.EnemyATTACK = false;
_root.EnemyTELEPORT = false;
Symbol 1251 MovieClip Frame 205
_root.EnemyHURT = true;
_root.EnemyHURTback = true;
_root.EnemyATTACK = false;
Symbol 1251 MovieClip Frame 233
stop();
Symbol 1251 MovieClip Frame 238
_root.EnemyHURT = true;
_root.EnemyHURTfront = true;
_root.EnemyATTACK = false;
Symbol 1251 MovieClip Frame 266
stop();
Symbol 1251 MovieClip Frame 269
_root.EnemyHURTback = false;
Symbol 1251 MovieClip Frame 277
if (_root.EnemyDEAD == true) {
stop();
}
if (_root.EnemyDEAD == false) {
play();
}
Symbol 1251 MovieClip Frame 297
gotoAndStop (1);
Symbol 1251 MovieClip Frame 307
_root.EnemyHURTfront = false;
Symbol 1251 MovieClip Frame 315
if (_root.EnemyDEAD == true) {
stop();
}
if (_root.EnemyDEAD == false) {
play();
}
Symbol 1251 MovieClip Frame 321
gotoAndStop (1);
Symbol 1251 MovieClip Frame 356
stop();
Symbol 1251 MovieClip Frame 389
stop();
Symbol 1251 MovieClip Frame 399
_root.EnemyVelX = 0;
_root.EnemyVelY = -_root.gravity;
Symbol 1251 MovieClip Frame 410
_root.EnemyATTACK = false;
Symbol 1251 MovieClip Frame 412
_root.EnemyVelX = 0;
_root.EnemyVelY = 0;
Symbol 1251 MovieClip Frame 445
stop();
Symbol 1251 MovieClip Frame 454
_root.EnemyTELEPORT = false;
Symbol 1530 MovieClip Frame 1
_root.EnemyHURT = false;
_root.EnemyHURTfront = false;
_root.EnemyHURTback = false;
Symbol 1530 MovieClip Frame 10
gotoAndPlay (1);
Symbol 1530 MovieClip Frame 22
gotoAndPlay (11);
Symbol 1530 MovieClip Frame 34
gotoAndPlay (23);
Symbol 1530 MovieClip Frame 46
gotoAndPlay (35);
Symbol 1530 MovieClip Frame 51
gotoAndPlay (47);
Symbol 1530 MovieClip Frame 58
gotoAndPlay (52);
Symbol 1530 MovieClip Frame 72
_root.EnemyATTACK = false;
_root.EnemyTELEPORT = false;
Symbol 1530 MovieClip Frame 88
_root.EnemyATTACK = false;
_root.EnemyTELEPORT = false;
Symbol 1530 MovieClip Frame 108
_root.EnemyATTACK = false;
_root.EnemyTELEPORT = false;
Symbol 1530 MovieClip Frame 124
_root.EnemyATTACK = false;
_root.EnemyTELEPORT = false;
Symbol 1530 MovieClip Frame 141
_root.EnemyATTACK = false;
_root.EnemyTELEPORT = false;
Symbol 1530 MovieClip Frame 164
_root.EnemyATTACK = false;
_root.EnemyTELEPORT = false;
Symbol 1530 MovieClip Frame 174
_root.EnemyATTACK = false;
_root.EnemyTELEPORT = false;
Symbol 1530 MovieClip Frame 196
_root.EnemyATTACK = false;
_root.EnemyTELEPORT = false;
Symbol 1530 MovieClip Frame 205
_root.EnemyHURT = true;
_root.EnemyHURTback = true;
_root.EnemyATTACK = false;
Symbol 1530 MovieClip Frame 233
stop();
Symbol 1530 MovieClip Frame 238
_root.EnemyHURT = true;
_root.EnemyHURTfront = true;
_root.EnemyATTACK = false;
Symbol 1530 MovieClip Frame 266
stop();
Symbol 1530 MovieClip Frame 269
_root.EnemyHURTback = false;
Symbol 1530 MovieClip Frame 276
if (_root.EnemyDEAD == true) {
gotoAndPlay (275);
}
Symbol 1530 MovieClip Frame 297
gotoAndStop (1);
Symbol 1530 MovieClip Frame 307
_root.EnemyHURTfront = false;
Symbol 1530 MovieClip Frame 315
if (_root.EnemyDEAD == true) {
gotoAndPlay (314);
}
Symbol 1530 MovieClip Frame 321
gotoAndStop (1);
Symbol 1530 MovieClip Frame 356
stop();
Symbol 1530 MovieClip Frame 389
stop();
Symbol 1530 MovieClip Frame 399
_root.EnemyVelX = 0;
_root.EnemyVelY = -_root.gravity;
Symbol 1530 MovieClip Frame 410
_root.EnemyATTACK = false;
Symbol 1530 MovieClip Frame 412
_root.EnemyVelX = 0;
_root.EnemyVelY = 0;
Symbol 1530 MovieClip Frame 445
stop();
Symbol 1530 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 1530 MovieClip Frame 454
_root.EnemyTELEPORT = false;