Frame 1
var myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
copyrightNotice.separatorBefore = true;
myMenu.customItems.push(mySiteLink, copyrightNotice);
_root.menu = myMenu;
function sitelock(urls_allowed) {
lock = true;
domain_parts = _url.split("://");
real_domain = domain_parts[1].split("/");
domain.text = real_domain[0];
for (x in urls_allowed) {
if (urls_allowed[x] == real_domain[0]) {
lock = false;
}
}
if (lock) {
_global.showTheAd = true;
}
}
_global.showTheAd = false;
urls_allowed = ["flashgamelicense.com", "agame.com", "kongregate.com"];
sitelock(urls_allowed);
gamename = "stargunheroes";
lab.onRelease = function () {
getURL (("http://www.longanimalsgames.com?referral=" + gamename) + "&refmode=mainlogo", "_blank");
};
bytes_loaded = Math.round(_root.getBytesLoaded());
bytes_total = Math.round(_root.getBytesTotal());
getPercent = bytes_loaded / bytes_total;
_root.loadBar._width = getPercent * 100;
_root.loadText = Math.round(getPercent * 100) + "%";
if (bytes_loaded == bytes_total) {
if (_global.showTheAd) {
_root.gotoAndPlay(3);
}
if (!_global.showTheAd) {
_root.gotoAndPlay(4);
}
}
Frame 2
gotoAndPlay (1);
Frame 3
stop();
var CPMStarContentSpotID = "4519Q17336003";
System.security.allowDomain("server.cpmstar.com");
adBox.loadMovie("http://server.cpmstar.com/adviewas2.swf?contentspotid=" + CPMStarContentSpotID);
adtimer = 0;
playButtonClip.onEnterFrame = function () {
adtimer++;
if (adtimer > 300) {
playButtonClip._y = 410;
}
};
Instance of Symbol 66 MovieClip "playButtonClip" in Frame 3
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
_root.nextFrame();
}
Frame 4
removeMovieClip(adBox);
gamename = "stargunheroes";
lalogo.onPress = function () {
getURL (("http://www.longanimalsgames.com?referral=" + gamename) + "&refmode=mainlogo", "_blank");
};
Frame 5
var myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
copyrightNotice.separatorBefore = true;
myMenu.customItems.push(mySiteLink, copyrightNotice);
_root.menu = myMenu;
Frame 6
stopAllSounds();
user = SharedObject.getLocal("star_gun_heroes_saved_data");
if (user.data.twoLocked_s == undefined) {
numberOfCoins = 0;
weapon = 0;
twoLocked = true;
threeLocked = true;
fourLocked = true;
stageOneComplete = false;
stageTwoComplete = false;
stageThreeComplete = false;
stageFourComplete = false;
stageFiveComplete = false;
stageSixComplete = false;
stageTwoOpen = false;
stageThreeOpen = false;
stageFourOpen = false;
stageFiveOpen = false;
stageSixOpen = false;
} else {
numberOfCoins = user.data.numberOfCoins_s;
weapon = user.data.weapon_s;
twoLocked = user.data.twoLocked_s;
threeLocked = user.data.threeLocked_s;
fourLocked = user.data.fourLocked_s;
stageOneComplete = user.data.stageOneComplete_s;
stageTwoComplete = user.data.stageTwoComplete_s;
stageThreeComplete = user.data.stageThreeComplete_s;
stageFourComplete = user.data.stageFourComplete_s;
stageFiveComplete = user.data.stageFiveComplete_s;
stageSixComplete = user.data.stageSixComplete_s;
stageTwoOpen = user.data.stageTwoOpen_s;
stageThreeOpen = user.data.stageThreeOpen_s;
stageFourOpen = user.data.stageFourOpen_s;
stageFiveOpen = user.data.stageFiveOpen_s;
stageSixOpen = user.data.stageSixOpen_s;
}
play();
Frame 7
stopAllSounds();
play();
Instance of Symbol 556 MovieClip in Frame 8
on (release) {
_root.nextFrame();
}
Frame 9
stop();
gamename = "stargunheroes";
lab.onRelease = function () {
getURL (("http://www.longanimalsgames.com?referral=" + gamename) + "&refmode=mainlogo", "_blank");
};
_root.attachMovie("flash", "flash", _root.getNextHighestDepth());
blip_sound = new Sound();
blip_sound.attachSound("blu");
moveOn = false;
moveOnTimer = 0;
cam._xscale = 100;
cam._yscale = 100;
cam._x = that._x;
cam._y = that._y;
startButton.onEnterFrame = function () {
if (moveOn) {
moveOnTimer++;
if (moveOnTimer == 15) {
nextFrame();
}
}
};
startButton.onRelease = function () {
blip_sound.start();
moveOn = true;
_root.attachMovie("flash", "flash", _root.getNextHighestDepth());
};
Instance of Symbol 562 MovieClip in Frame 9
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
getURL ("http://www.longanimalsgames.com/?referral=stargunheroes&refmode=moregames", "_blank");
}
Instance of Symbol 565 MovieClip "startButton" in Frame 9
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
Frame 10
stopAllSounds();
play();
Frame 11
stop();
player.removeMovieClip();
setLevel = 0;
blip_sound = new Sound();
blip_sound.attachSound("blu");
moveOn = false;
moveOnTimer = 0;
canSelect = true;
cam._xscale = 100;
cam._yscale = 100;
cam._x = that._x;
cam._y = that._y;
lvl1.onRelease = function () {
blip_sound.start();
moveOn = true;
_root.attachMovie("flash", "flash", _root.getNextHighestDepth());
canSelect = false;
setLevel = 1;
};
lvl2.onRelease = function () {
if (this._alpha == 100) {
blip_sound.start();
moveOn = true;
_root.attachMovie("flash", "flash", _root.getNextHighestDepth());
canSelect = false;
setLevel = 2;
}
};
lvl3.onRelease = function () {
if (this._alpha == 100) {
blip_sound.start();
moveOn = true;
_root.attachMovie("flash", "flash", _root.getNextHighestDepth());
canSelect = false;
setLevel = 3;
}
};
lvl4.onRelease = function () {
if (this._alpha == 100) {
blip_sound.start();
moveOn = true;
_root.attachMovie("flash", "flash", _root.getNextHighestDepth());
canSelect = false;
setLevel = 4;
}
};
lvl5.onRelease = function () {
if (this._alpha == 100) {
blip_sound.start();
moveOn = true;
_root.attachMovie("flash", "flash", _root.getNextHighestDepth());
canSelect = false;
setLevel = 5;
}
};
lvl6.onRelease = function () {
if (this._alpha == 100) {
blip_sound.start();
moveOn = true;
_root.attachMovie("flash", "flash", _root.getNextHighestDepth());
canSelect = false;
setLevel = 6;
}
};
that.onEnterFrame = function () {
if (moveOn) {
moveOnTimer++;
if (moveOnTimer == 15) {
nextFrame();
}
}
if (stageOneComplete) {
stageTwoOpen = true;
}
if (stageTwoComplete) {
stageThreeOpen = true;
}
if (stageThreeComplete) {
stageFourOpen = true;
}
if (stageFourComplete) {
stageFiveOpen = true;
}
if (stageFiveComplete) {
stageSixOpen = true;
}
if (!stageTwoOpen) {
lvl2._alpha = 40;
} else {
lvl2._alpha = 100;
}
if (!stageThreeOpen) {
lvl3._alpha = 40;
} else {
lvl3._alpha = 100;
}
if (!stageFourOpen) {
lvl4._alpha = 40;
} else {
lvl4._alpha = 100;
}
if (!stageFiveOpen) {
lvl5._alpha = 40;
} else {
lvl5._alpha = 100;
}
if (!stageSixOpen) {
lvl6._alpha = 40;
} else {
lvl6._alpha = 100;
}
};
Instance of Symbol 579 MovieClip "lvl1" in Frame 11
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
Instance of Symbol 582 MovieClip "lvl2" in Frame 11
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
Instance of Symbol 584 MovieClip "lvl3" in Frame 11
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
Instance of Symbol 587 MovieClip "lvl4" in Frame 11
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
Instance of Symbol 590 MovieClip "lvl5" in Frame 11
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
Instance of Symbol 592 MovieClip "lvl6" in Frame 11
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
Frame 12
stop();
hiddenForMe = 0;
blip_sound = new Sound();
blip_sound.attachSound("blu");
moveOn = false;
moveOnTimer = 0;
canSelect = true;
if (twoLocked) {
two._alpha = 50;
}
if (threeLocked) {
three._alpha = 50;
}
if (fourLocked) {
four._alpha = 50;
}
twoB.onRelease = function () {
if (numberOfCoins > 99) {
numberOfCoins = numberOfCoins - 100;
twoLocked = false;
}
};
threeB.onRelease = function () {
if (numberOfCoins > 199) {
numberOfCoins = numberOfCoins - 200;
threeLocked = false;
}
};
fourB.onRelease = function () {
if (numberOfCoins > 299) {
numberOfCoins = numberOfCoins - 300;
fourLocked = false;
}
};
one.onEnterFrame = function () {
if ((hiddenForMe > 30) && (canSelect)) {
playerSelect = 5;
blip_sound.start();
moveOn = true;
_root.attachMovie("flash", "flash", _root.getNextHighestDepth());
canSelect = false;
}
if (Key.isDown(13)) {
hiddenForMe++;
}
if (Key.isDown(32)) {
if (canSelect && (stageSixComplete)) {
playerSelect = 5;
blip_sound.start();
moveOn = true;
_root.attachMovie("flash", "flash", _root.getNextHighestDepth());
canSelect = false;
}
}
if (!twoLocked) {
twoB.gotoAndStop(2);
two._alpha = 100;
}
if (!threeLocked) {
threeB.gotoAndStop(2);
three._alpha = 100;
}
if (!fourLocked) {
fourB.gotoAndStop(2);
four._alpha = 100;
}
if (moveOn) {
moveOnTimer++;
if (moveOnTimer == 15) {
stopAllSounds();
if (setLevel == 1) {
gotoAndStop ("levelOne");
}
if (setLevel == 2) {
gotoAndStop ("levelTwo");
}
if (setLevel == 3) {
gotoAndStop ("levelThree");
}
if (setLevel == 4) {
gotoAndStop ("levelFour");
}
if (setLevel == 5) {
gotoAndStop ("levelFive");
}
if (setLevel == 6) {
gotoAndStop ("levelSix");
}
}
}
};
one.onRelease = function () {
if (canSelect) {
playerSelect = 1;
blip_sound.start();
moveOn = true;
_root.attachMovie("flash", "flash", _root.getNextHighestDepth());
canSelect = false;
}
};
two.onRelease = function () {
if (this._alpha == 100) {
if (canSelect) {
playerSelect = 2;
blip_sound.start();
moveOn = true;
_root.attachMovie("flash", "flash", _root.getNextHighestDepth());
canSelect = false;
}
}
};
three.onRelease = function () {
if (this._alpha == 100) {
if (canSelect) {
playerSelect = 3;
blip_sound.start();
moveOn = true;
_root.attachMovie("flash", "flash", _root.getNextHighestDepth());
canSelect = false;
}
}
};
four.onRelease = function () {
if (this._alpha == 100) {
if (canSelect) {
playerSelect = 4;
blip_sound.start();
moveOn = true;
_root.attachMovie("flash", "flash", _root.getNextHighestDepth());
canSelect = false;
}
}
};
Instance of Symbol 602 MovieClip "two" in Frame 12
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
Instance of Symbol 603 MovieClip "four" in Frame 12
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
Instance of Symbol 604 MovieClip "one" in Frame 12
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
Instance of Symbol 606 MovieClip "three" in Frame 12
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
Frame 13
player.removeMovieClip();
stopAllSounds();
cam._xscale = 100;
cam._yscale = 100;
cam._x = that._x;
cam._y = that._y;
stop();
Instance of Symbol 562 MovieClip in Frame 13
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
getURL ("http://www.longanimalsgames.com/?referral=stargunheroes&refmode=moregames", "_blank");
}
Instance of Symbol 619 MovieClip in Frame 13
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
_root.nextFrame();
}
Instance of Symbol 622 MovieClip in Frame 13
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
_root.gotoAndStop("title");
}
Frame 14
function clearAll() {
Mouse.show();
stopAllSounds();
hud.removeMovieClip();
place.removeMovieClip();
bossWarning.removeMovieClip();
crosshair.removeMovieClip();
arm_mc.removeMovieClip();
i = diamonds.length - 1;
while (i >= 0) {
diamonds[i].removeMovieClip();
diamonds.splice(i, 1);
i--;
}
i = coin.length - 1;
while (i >= 0) {
coin[i].removeMovieClip();
coin.splice(i, 1);
i--;
}
i = boxes.length - 1;
while (i >= 0) {
boxes[i].removeMovieClip();
boxes.splice(i, 1);
i--;
}
i = enemy.length - 1;
while (i >= 0) {
enemy[i].removeMovieClip();
enemy.splice(i, 1);
i--;
}
i = enemyType.length - 1;
while (i >= 0) {
enemyType.splice(i, 1);
i--;
}
i = enemyHealth.length - 1;
while (i >= 0) {
enemyHealth.splice(i, 1);
i--;
}
i = selfDestruct.length - 1;
while (i >= 0) {
selfDestruct.splice(i, 1);
i--;
}
i = enemyHit.length - 1;
while (i >= 0) {
enemyHit.splice(i, 1);
i--;
}
i = enemyHitTimer.length - 1;
while (i >= 0) {
enemyHitTimer.splice(i, 1);
i--;
}
i = enemyShotClock.length - 1;
while (i >= 0) {
enemyShotClock.splice(i, 1);
i--;
}
i = bullets.length - 1;
while (i >= 0) {
bullets[i].removeMovieClip();
bullets.splice(i, 1);
i--;
}
i = enemyShot.length - 1;
while (i >= 0) {
enemyShot[i].removeMovieClip();
enemyShot.splice(i, 1);
i--;
}
i = bomb.length - 1;
while (i >= 0) {
bomb[i].removeMovieClip();
bomb.splice(i, 1);
i--;
}
}
stop();
shotsnd = new Sound();
shotsnd.attachSound("reflect");
_root.attachMovie("hud", "hud", _root.getNextHighestDepth());
if (playerSelect == 5) {
hitBoost = 3;
maxaccel = 5;
maxjump = 3;
playerStrength = 10;
hud.faces.gotoAndStop(5);
_root.attachMovie("arm_mc", "arm_mc", _root.getNextHighestDepth());
arm_mc.gotoAndStop(5);
_root.attachMovie("hiddenGuy", "player", _root.getNextHighestDepth(), {_x:startPoint._x, _y:startPoint._y});
}
if (playerSelect == 1) {
hitBoost = 0;
maxaccel = 3;
maxjump = 3;
playerStrength = 10;
_root.attachMovie("arm_mc", "arm_mc", _root.getNextHighestDepth());
arm_mc.gotoAndStop(1);
_root.attachMovie("player", "player", _root.getNextHighestDepth(), {_x:startPoint._x, _y:startPoint._y});
}
if (playerSelect == 2) {
hitBoost = 0;
maxaccel = 5;
maxjump = 5;
playerStrength = 8;
hud.faces.gotoAndStop(2);
_root.attachMovie("arm_mc", "arm_mc", _root.getNextHighestDepth());
arm_mc.gotoAndStop(2);
_root.attachMovie("playerTwo", "player", _root.getNextHighestDepth(), {_x:startPoint._x, _y:startPoint._y});
}
if (playerSelect == 3) {
hitBoost = 1.5;
maxaccel = 3.5;
maxjump = 3;
playerStrength = 5;
hud.faces.gotoAndStop(3);
_root.attachMovie("arm_mc", "arm_mc", _root.getNextHighestDepth());
arm_mc.gotoAndStop(3);
_root.attachMovie("playerThree", "player", _root.getNextHighestDepth(), {_x:startPoint._x, _y:startPoint._y});
}
if (playerSelect == 4) {
hitBoost = 2;
maxaccel = 5;
maxjump = 3;
playerStrength = 10;
hud.faces.gotoAndStop(4);
_root.attachMovie("arm_mc", "arm_mc", _root.getNextHighestDepth());
arm_mc.gotoAndStop(4);
_root.attachMovie("playerFour", "player", _root.getNextHighestDepth(), {_x:startPoint._x, _y:startPoint._y});
}
_root.attachMovie("crosshair", "crosshair", _root.getNextHighestDepth());
_root.attachMovie("place", "place", _root.getNextHighestDepth());
atBoss = false;
bossDead = false;
moveOnTimer = 0;
arm_mc.spark._alpha = 0;
place._alpha = 0;
crosshair._xscale = 50;
crosshair._yscale = 50;
Mouse.hide();
cam._xscale = 100;
cam._yscale = 100;
showWarning = true;
transTimer = 0;
randomNumber = 0;
running = false;
gravity = 0;
gravityaccel = 0.2;
xaccel = 0;
runaccelamt = 0.3;
friction = 0.5;
airrisist = 0.05;
doubleJump = false;
doubleJumping = false;
jump = true;
pressOnce = 0;
playerDamaged = 0;
playerDamagedTimer = 0;
cam.lens._xscale = 50;
cam.lens._yscale = 50;
damaged = false;
inControl = true;
fireRate = 300;
shotPower = 1;
shootingTimer = 0;
shooting = false;
addEnemyTimer = 0;
choice = 0;
playerHealth = 100;
var diamonds = new Array();
diamonds.push(d1, d2, d3);
var coin = new Array();
var boxes = new Array();
boxes.push(box1, box2, box3, box4, box5, box6, box7, box8, box9, box10, box11);
var enemy = new Array();
enemy.push(enemy1, enemy2, enemy3, enemy4, enemy5, enemy6, enemy7, flame1, flame2, flame3, flame4, flame5, flame6, boss);
var enemyType = new Array();
enemyType.push("static_left", "static_left", "static_left", "static_left", "static_left", "static_left", "static_left", "flame_gun", "flame_gun", "flame_gun", "flame_gun", "flame_gun", "flame_gun", "boss_mc");
var enemyHealth = new Array();
enemyHealth.push(10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 100);
var selfDestruct = new Array();
selfDestruct.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var enemyHit = new Array();
enemyHit.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var enemyHitTimer = new Array();
enemyHitTimer.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var enemyShotClock = new Array();
enemyShotClock.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var bullets = new Array();
var enemyShot = new Array();
var bomb = new Array();
onMouseDown = function () {
if ((!damaged) && (inControl)) {
shooting = true;
}
};
onMouseUp = function () {
shooting = false;
};
player.onEnterFrame = function () {
if (playerDamaged == 0) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
if (playerDamaged == 1) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:200, gb:200, bb:200};
myColor.setTransform(myColorTransform);
playerDamagedTimer++;
if (playerDamagedTimer == 1) {
weapon--;
playerDamaged = 0;
playerDamagedTimer = 0;
}
}
if (player._x < 3000) {
if ((addEnemyTimer + 6000) < getTimer()) {
addEnemyTimer = getTimer();
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
randomNumber++;
metalBee_mc = _root.attachMovie("metalBee", "metalBee" + randomNumber, _root.getNextHighestDepth(), {_x:cam._x - 800, _y:player._y - 60});
metalBee_mc._xscale = -100;
enemy.push(metalBee_mc);
enemyType.push("metal_bee");
enemyHealth.push(1);
selfDestruct.push(500);
enemyHitTimer.push(0);
enemyHit.push(0);
enemyShotClock.push(0);
}
if (choice == 1) {
randomNumber++;
metalBee_mc = _root.attachMovie("metalBee", "metalBee" + randomNumber, _root.getNextHighestDepth(), {_x:cam._x + 800, _y:player._y - 60});
enemy.push(metalBee_mc);
enemyType.push("metal_bee");
enemyHealth.push(1);
selfDestruct.push(500);
enemyHitTimer.push(0);
enemyHit.push(0);
enemyShotClock.push(0);
}
}
}
if (!shooting) {
arm_mc.spark._alpha = 0;
}
myRadians = Math.atan2(_root._ymouse - place._y, _root._xmouse - place._x);
myDegrees = Math.round((myRadians * 180) / Math.PI);
place._rotation = myDegrees;
if (shooting) {
if (weapon == 0) {
fireRate = 300;
shotPower = 1;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
if (weapon == 1) {
fireRate = 500;
shotPower = 1;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
randomNumber++;
bullet_mc = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullets.push(bullet_mc);
angle = place._rotation - 6;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
randomNumber++;
bullet_mc = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullets.push(bullet_mc);
angle = place._rotation + 6;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
if (weapon == 2) {
shotPower = 1.5;
fireRate = 200;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("laser", "laser" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
if (weapon == 3) {
shotPower = 2;
fireRate = 200;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("laser", "laser" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._yscale = 200;
bullet_mc._xscale = 600;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
if (weapon == 4) {
shotPower = 2.5;
fireRate = 200;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("largeBullet", "largeBullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
if (weapon == 5) {
shotPower = 2.5;
fireRate = 100;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("largeBullet", "largeBullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._yscale = 50;
bullet_mc._xscale = 50;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
randomNumber++;
bullet_mc = _root.attachMovie("largeBullet", "largeBullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._yscale = 50;
bullet_mc._xscale = 50;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation + 15;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
randomNumber++;
bullet_mc = _root.attachMovie("largeBullet", "largeBullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._yscale = 50;
bullet_mc._xscale = 50;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation - 15;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
}
i = enemy.length - 1;
while (i >= 0) {
if (enemyType[i] == "boss_mc") {
if (enemy[i].hitBox.hitTest(player.hit)) {
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - 0.1;
playerDamaged = 1;
}
if (atBoss) {
enemyShotClock[i]++;
if (enemyShotClock[i] < 60) {
enemy[i].gotoAndStop("warning");
}
if (enemyShotClock[i] > 60) {
selfDestruct[i]++;
if (selfDestruct[i] == 15) {
selfDestruct[i] = 0;
randomNumber++;
bombs_mc = _root.attachMovie("bombs", "bombs" + randomNumber, _root.getNextHighestDepth(), {_x:((cam._x + 320) - Math.round(Math.random() * 640)) + 0, _y:0});
bomb.push(bombs_mc);
}
enemy[i].gotoAndStop("shooting");
}
if (enemyShotClock[i] > 150) {
randomNumber++;
bombs_mc = _root.attachMovie("bombs", "bombs" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:0});
bomb.push(bombs_mc);
enemyShotClock[i] = 0;
selfDestruct[i] = 0;
}
}
}
if (enemyType[i] == "flame_gun") {
if (enemy[i].hitBox.hitTest(player.hit)) {
enemyHealth[i] = 0;
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
}
if (player.hitTest(enemy[i].area)) {
enemyShotClock[i]++;
if (enemyShotClock[i] == 3) {
enemyShotClock[i] = 0;
randomNumber++;
enemyBullet_mc = _root.attachMovie("flameBullet", "flameBullet" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x - 10, _y:enemy[i]._y - 30});
enemyShot.push(enemyBullet_mc);
enemyBullet_mc.onEnterFrame = function () {
this._xscale = this._xscale + 5;
this._yscale = this._yscale + 5;
this._y = this._y - 5;
};
}
}
}
if (enemyType[i] == "static_left") {
if (enemy[i].hitBox.hitTest(player.hit)) {
enemyHealth[i] = 0;
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
}
if (player.hitTest(enemy[i].area)) {
enemyShotClock[i]++;
if (enemyShotClock[i] == 30) {
enemyShotClock[i] = 0;
randomNumber++;
enemyBullet_mc = _root.attachMovie("enemyBullet", "enemyBullet" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x - 15, _y:enemy[i]._y - 3});
enemyShot.push(enemyBullet_mc);
enemyBullet_mc.onEnterFrame = function () {
this._x = this._x - 5;
};
}
}
}
if ((enemyType[i] == "metal_bee") && (enemy[i]._xscale == -100)) {
if (enemy[i].hitBox.hitTest(player.hit)) {
enemyHealth[i] = 0;
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
}
if (enemy[i].marker.hitTest(player)) {
enemy[i].marker.gotoAndStop(2);
randomNumber++;
bombs_mc = _root.attachMovie("bombs", "bombs" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
bomb.push(bombs_mc);
}
selfDestruct[i]--;
enemy[i]._x = enemy[i]._x + 3;
if (selfDestruct[i] < 1) {
enemyHealth[i] = 0;
}
if (player._x > 3000) {
enemyHealth[i] = 0;
}
}
if ((enemyType[i] == "metal_bee") && (enemy[i]._xscale == 100)) {
if (enemy[i].hitBox.hitTest(player.hit)) {
enemyHealth[i] = 0;
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
}
if (enemy[i].marker.hitTest(player)) {
enemy[i].marker.gotoAndStop(2);
randomNumber++;
bombs_mc = _root.attachMovie("bombs", "bombs" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
bomb.push(bombs_mc);
}
selfDestruct[i]--;
enemy[i]._x = enemy[i]._x - 3;
if (selfDestruct[i] < 1) {
enemyHealth[i] = 0;
}
if (player._x > 3000) {
enemyHealth[i] = 0;
}
}
if (enemyHit[i] == 0) {
myColor = new Color(enemy[i]);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
if (enemyHit[i] == 1) {
myColor = new Color(enemy[i]);
myColorTransform = new Object();
myColorTransform = {rb:200, gb:200, bb:200};
myColor.setTransform(myColorTransform);
enemyHitTimer[i]++;
if (enemyHitTimer[i] == 3) {
enemyHitTimer[i] = 0;
enemyHit[i] = 0;
}
}
if (enemyHealth[i] < 1) {
if (enemyType[i] == "boss_mc") {
bossDead = true;
atBoss = false;
enemy[i].gotoAndStop(3);
_root.attachMovie("deadBoss", "deadBoss", _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
}
if ((enemyType[i] == "static_left") or (enemyType[i] == "flame_gun")) {
enemy[i].gotoAndStop(2);
}
randomNumber++;
_root.attachMovie("explosion", "explosion" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
enemy[i].removeMovieClip();
enemy.splice(i, 1);
enemyType.splice(i, 1);
enemyHealth.splice(i, 1);
selfDestruct.splice(i, 1);
enemyHitTimer.splice(i, 1);
enemyHit.splice(i, 1);
enemyShotClock.splice(i, 1);
}
i--;
}
i = bomb.length - 1;
while (i >= 0) {
if (bomb[i].hitTest(player.hit)) {
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
randomNumber++;
_root.attachMovie("explosion", "explosion" + randomNumber, _root.getNextHighestDepth(), {_x:bomb[i]._x, _y:bomb[i]._y});
bomb[i].removeMovieClip();
bomb.splice(i, 1);
}
bomb[i]._y = bomb[i]._y + 6;
if (ground.hitTest(bomb[i]._x, bomb[i]._y, true)) {
randomNumber++;
_root.attachMovie("explosion", "explosion" + randomNumber, _root.getNextHighestDepth(), {_x:bomb[i]._x, _y:bomb[i]._y});
bomb[i].removeMovieClip();
bomb.splice(i, 1);
}
i--;
}
i = enemyShot.length - 1;
while (i >= 0) {
if (enemyShot[i]._xscale > 200) {
enemyShot[i].removeMovieClip();
enemyShot.splice(i, 1);
}
if (enemyShot[i].hitTest(player.hit)) {
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:enemyShot[i]._x, _y:enemyShot[i]._y});
enemyShot[i].removeMovieClip();
enemyShot.splice(i, 1);
}
if (ground.hitTest(enemyShot[i]._x, enemyShot[i]._y, true)) {
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:enemyShot[i]._x, _y:enemyShot[i]._y});
enemyShot[i].removeMovieClip();
enemyShot.splice(i, 1);
}
i--;
}
i = coin.length - 1;
while (i >= 0) {
if (coin[i].hitTest(player)) {
numberOfCoins = numberOfCoins + 10;
randomNumber++;
_root.attachMovie("ping", "ping" + randomNumber, _root.getNextHighestDepth(), {_x:coin[i]._x, _y:coin[i]._y});
coin[i].removeMovieClip();
coin.splice(i, 1);
}
i--;
}
i = diamonds.length - 1;
while (i >= 0) {
if (diamonds[i].hitTest(player)) {
diamonds[i].gotoAndStop(2);
weapon++;
randomNumber++;
_root.attachMovie("ping", "ping" + randomNumber, _root.getNextHighestDepth(), {_x:diamonds[i]._x, _y:diamonds[i]._y});
diamonds[i].removeMovieClip();
diamonds.splice(i, 1);
}
i--;
}
i = bullets.length - 1;
while (i >= 0) {
if (playerSelect == 1) {
bullets[i].gotoAndStop(1);
}
if (playerSelect == 2) {
bullets[i].gotoAndStop(2);
}
if (playerSelect == 3) {
bullets[i].gotoAndStop(3);
}
if (playerSelect == 4) {
bullets[i].gotoAndStop(4);
}
l = boxes.length - 1;
while (l >= 0) {
if (bullets[i].hitTest(boxes[l])) {
boxes[l].gotoAndStop(2);
randomNumber++;
coins_mc = _root.attachMovie("coins", "coins" + randomNumber, _root.getNextHighestDepth(), {_x:boxes[l]._x, _y:boxes[l]._y});
coin.push(coins_mc);
randomNumber++;
_root.attachMovie("explosion", "explosion" + randomNumber, _root.getNextHighestDepth(), {_x:boxes[l]._x, _y:boxes[l]._y});
boxes[l].removeMovieClip();
boxes.splice(l, 1);
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:bullets[i]._x, _y:bullets[i]._y});
bullets[i].removeMovieClip();
bullets.splice(i, 1);
}
l--;
}
k = bomb.length - 1;
while (k >= 0) {
if (bullets[i].hitTest(bomb[k])) {
randomNumber++;
_root.attachMovie("explosion", "explosion" + randomNumber, _root.getNextHighestDepth(), {_x:bomb[k]._x, _y:bomb[k]._y});
bomb[k].removeMovieClip();
bomb.splice(k, 1);
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:bullets[i]._x, _y:bullets[i]._y});
bullets[i].removeMovieClip();
bullets.splice(i, 1);
}
k--;
}
j = enemy.length - 1;
while (j >= 0) {
if (bullets[i].hitTest(enemy[j].hitBox)) {
enemyHit[j] = 1;
enemyHealth[j] = enemyHealth[j] - (shotPower + hitBoost);
if (enemyType[j] == "boss_mc") {
if (player._x < 3000) {
enemyHealth[j] = enemyHealth[j] + (shotPower + hitBoost);
}
}
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:bullets[i]._x, _y:bullets[i]._y});
bullets[i].removeMovieClip();
bullets.splice(i, 1);
}
j--;
}
if (ground.hitTest(bullets[i]._x, bullets[i]._y, true)) {
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:bullets[i]._x, _y:bullets[i]._y});
bullets[i].removeMovieClip();
bullets.splice(i, 1);
}
i--;
}
if ((ground.hitTest(player._x, player._y + 11, true) && (jump)) && (!doubleJumping)) {
arm_mc._alpha = 100;
if (running) {
player.gotoAndStop("run");
} else {
player.gotoAndStop("idle");
}
} else {
player.gotoAndStop("jump");
arm_mc._alpha = 0;
}
if (Key.isDown(68) or Key.isDown(65)) {
running = true;
} else {
running = false;
}
if (!ground.hitTest(player._x, player._y + 10, true)) {
falling = true;
grounded = false;
}
if (ground.hitTest(player._x, player._y + 11, true)) {
doubleJumping = false;
doubleJump = false;
jump = true;
grounded = true;
falling = false;
while (ground.hitTest(player._x, player._y + 9, true)) {
player._y--;
}
}
if (falling == true) {
gravity = gravity + gravityaccel;
} else {
gravity = 0;
}
if (((inControl && (Key.isDown(68))) && (xaccel < maxaccel)) && (falling == true)) {
xaccel = xaccel + (runaccelamt - airrisist);
} else if (((inControl && (Key.isDown(65))) && (xaccel > (-maxaccel))) && (falling == true)) {
xaccel = xaccel - (runaccelamt - airrisist);
} else if (((inControl && (Key.isDown(65))) && (xaccel > (-maxaccel))) && (falling == false)) {
xaccel = xaccel - runaccelamt;
} else if (((inControl && (Key.isDown(68))) && (xaccel < maxaccel)) && (falling == false)) {
xaccel = xaccel + runaccelamt;
} else if (grounded == true) {
if (xaccel > 0) {
xaccel = xaccel - friction;
}
if (xaccel < 0) {
xaccel = xaccel + friction;
}
if ((xaccel < 0) && (xaccel > friction)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < friction)) {
xaccel = 0;
}
} else {
if (xaccel > 0) {
xaccel = xaccel - airrisist;
}
if (xaccel < 0) {
xaccel = xaccel + airrisist;
}
if ((xaccel < 0) && (xaccel > airrisist)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < airrisist)) {
xaccel = 0;
}
}
if (_root.ground.hitTest(this._x, this._y - 11, true)) {
gravity = 1;
while (_root.ground.hitTest(this._x, this._y - 10, true)) {
this._y++;
}
}
if (_xmouse > player._x) {
player._xscale = 100;
}
if (_xmouse < player._x) {
player._xscale = -100;
}
if (!Key.isDown(87)) {
pressOnce = 0;
}
if ((inControl && (Key.isDown(87))) && (jump == true)) {
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
if (playerSelect == 2) {
_root.attachMovie("dust", "dust", _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
jump = false;
doubleJump = true;
pressOnce = 1;
}
if (((inControl && (Key.isDown(87))) && (doubleJump == true)) && (pressOnce == 0)) {
gravity = 0;
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
doubleJump = false;
doubleJumping = true;
}
leftx = player._x + (Math.cos(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
lefty = player._y - (Math.sin(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
rightx = player._x + (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * 7);
righty = player._y - (Math.sin(3.141593 * ((player._rotation * -1) / 180)) * 7);
if (ground.hitTest(leftx, lefty, true)) {
xaccel = 0;
player._x++;
}
if (ground.hitTest(rightx, righty, true)) {
xaccel = 0;
player._x--;
}
if (cam._y > 310) {
cam._y = 310;
}
if (cam._x > 3932) {
cam._x = 3932;
}
if (cam._x < 320) {
cam._x = 320;
}
crosshair._x = _xmouse;
crosshair._y = _ymouse;
bg._x = cam._x;
bg._y = cam._y;
place._x = player._x;
place._y = player._y;
endX = player._x;
cam._x = cam._x + ((endX - cam._x) / 20);
endY = player._y;
cam._y = cam._y + ((endY - cam._y) / 20);
cam.camControl();
hud._x = cam._x;
hud._y = cam._y;
hud._xscale = cam.lens._xscale;
hud._yscale = cam.lens._yscale;
bossWarning._x = cam._x;
bossWarning._y = cam._y;
bossWarning._xscale = cam.lens._xscale;
bossWarning._yscale = cam.lens._yscale;
player._y = player._y + gravity;
player._x = player._x + xaccel;
hud.healthBar._xscale = playerHealth;
if (playerHealth > 100) {
playerHealth = 100;
}
if (playerHealth < 1) {
shooting = false;
playerHealth = 0;
inControl = false;
player._alpha = 0;
arm_mc._alpha = 0;
if (transTimer == 0) {
_root.attachMovie("bubbs", "bubbs", _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
_root.attachMovie("trans", "trans", _root.getNextHighestDepth(), {_x:cam._x, _y:cam._y});
}
transTimer++;
if (transTimer > 79) {
clearAll();
prevFrame();
}
}
if (bossDead) {
moveOnTimer++;
if (moveOnTimer == 89) {
_root.attachMovie("stageComplete", "stageComplete", _root.getNextHighestDepth(), {_x:cam._x, _y:cam._y});
}
if (moveOnTimer == 110) {
_root.attachMovie("trans", "trans", _root.getNextHighestDepth(), {_x:cam._x, _y:cam._y});
}
if (moveOnTimer == 189) {
clearAll();
stageOneComplete = true;
user.data.numberOfCoins_s = numberOfCoins;
user.data.weapon_s = weapon;
user.data.twoLocked_s = twoLocked;
user.data.threeLocked_s = threeLocked;
user.data.fourLocked_s = fourLocked;
user.data.stageOneComplete_s = stageOneComplete;
user.data.stageTwoComplete_s = stageTwoComplete;
user.data.stageThreeComplete_s = stageThreeComplete;
user.data.stageFourComplete_s = stageFourComplete;
user.data.stageFiveComplete_s = stageFiveComplete;
user.data.stageSixComplete_s = stageSixComplete;
user.data.stageTwoOpen_s = stageTwoOpen;
user.data.stageThreeOpen_s = stageThreeOpen;
user.data.stageFourOpen_s = stageFourOpen;
user.data.stageFiveOpen_s = stageFiveOpen;
user.data.stageSixOpen_s = stageSixOpen;
user.flush();
gotoAndStop ("stageSelect");
}
}
if (weapon < 0) {
weapon = 0;
}
if (weapon > 5) {
weapon = 5;
}
if (player._y > 500) {
playerHealth = 0;
}
if (player._x > 3000) {
atBoss = true;
if (showWarning) {
_root.attachMovie("bossWarning", "bossWarning", _root.getNextHighestDepth());
showWarning = false;
}
}
if (player._xscale == 100) {
myRadiansA = Math.atan2(_root._ymouse - arm_mc._y, _root._xmouse - arm_mc._x);
myDegreesA = Math.round((myRadiansA * 180) / Math.PI);
arm_mc._rotation = myDegreesA;
arm_mc._xscale = 100;
}
if (player._xscale == -100) {
myRadiansA = Math.atan2(_root._ymouse - arm_mc._y, _root._xmouse - arm_mc._x);
myDegreesA = Math.round((myRadiansA * 180) / Math.PI) - 180;
arm_mc._rotation = myDegreesA;
arm_mc._xscale = -100;
}
stageComplete._x = cam._x;
stageComplete._y = cam._y;
stageComplete._xscale = cam.lens._xscale;
stageComplete._yscale = cam.lens._yscale;
arm_mc._x = player._x;
arm_mc._y = player._y - 3;
hud.cnn.text = numberOfCoins;
trans.swapDepths(_root.getNextHighestDepth());
};
Frame 15
player.removeMovieClip();
stopAllSounds();
cam._xscale = 100;
cam._yscale = 100;
cam._x = that._x;
cam._y = that._y;
stop();
Instance of Symbol 562 MovieClip in Frame 15
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
getURL ("http://www.longanimalsgames.com/?referral=stargunheroes&refmode=moregames", "_blank");
}
Instance of Symbol 619 MovieClip in Frame 15
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
_root.nextFrame();
}
Instance of Symbol 622 MovieClip in Frame 15
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
_root.gotoAndStop("title");
}
Frame 16
function clearAll() {
Mouse.show();
stopAllSounds();
hud.removeMovieClip();
place.removeMovieClip();
bossWarning.removeMovieClip();
crosshair.removeMovieClip();
arm_mc.removeMovieClip();
i = diamonds.length - 1;
while (i >= 0) {
diamonds[i].removeMovieClip();
diamonds.splice(i, 1);
i--;
}
i = coin.length - 1;
while (i >= 0) {
coin[i].removeMovieClip();
coin.splice(i, 1);
i--;
}
i = boxes.length - 1;
while (i >= 0) {
boxes[i].removeMovieClip();
boxes.splice(i, 1);
i--;
}
i = enemy.length - 1;
while (i >= 0) {
enemy[i].removeMovieClip();
enemy.splice(i, 1);
i--;
}
i = enemyType.length - 1;
while (i >= 0) {
enemyType.splice(i, 1);
i--;
}
i = enemyHealth.length - 1;
while (i >= 0) {
enemyHealth.splice(i, 1);
i--;
}
i = selfDestruct.length - 1;
while (i >= 0) {
selfDestruct.splice(i, 1);
i--;
}
i = enemyHit.length - 1;
while (i >= 0) {
enemyHit.splice(i, 1);
i--;
}
i = enemyHitTimer.length - 1;
while (i >= 0) {
enemyHitTimer.splice(i, 1);
i--;
}
i = enemyShotClock.length - 1;
while (i >= 0) {
enemyShotClock.splice(i, 1);
i--;
}
i = bullets.length - 1;
while (i >= 0) {
bullets[i].removeMovieClip();
bullets.splice(i, 1);
i--;
}
i = enemyShot.length - 1;
while (i >= 0) {
enemyShot[i].removeMovieClip();
enemyShot.splice(i, 1);
i--;
}
i = bomb.length - 1;
while (i >= 0) {
bomb[i].removeMovieClip();
bomb.splice(i, 1);
i--;
}
}
stop();
shotsnd = new Sound();
shotsnd.attachSound("reflect");
_root.attachMovie("hud", "hud", _root.getNextHighestDepth());
if (playerSelect == 5) {
hitBoost = 3;
maxaccel = 5;
maxjump = 3;
playerStrength = 10;
hud.faces.gotoAndStop(5);
_root.attachMovie("arm_mc", "arm_mc", _root.getNextHighestDepth());
arm_mc.gotoAndStop(5);
_root.attachMovie("hiddenGuy", "player", _root.getNextHighestDepth(), {_x:startPoint._x, _y:startPoint._y});
}
if (playerSelect == 1) {
hitBoost = 0;
maxaccel = 3;
maxjump = 3;
playerStrength = 10;
_root.attachMovie("arm_mc", "arm_mc", _root.getNextHighestDepth());
arm_mc.gotoAndStop(1);
_root.attachMovie("player", "player", _root.getNextHighestDepth(), {_x:startPoint._x, _y:startPoint._y});
}
if (playerSelect == 2) {
hitBoost = 0;
maxaccel = 5;
maxjump = 5;
playerStrength = 8;
hud.faces.gotoAndStop(2);
_root.attachMovie("arm_mc", "arm_mc", _root.getNextHighestDepth());
arm_mc.gotoAndStop(2);
_root.attachMovie("playerTwo", "player", _root.getNextHighestDepth(), {_x:startPoint._x, _y:startPoint._y});
}
if (playerSelect == 3) {
hitBoost = 1.5;
maxaccel = 3.5;
maxjump = 3;
playerStrength = 5;
hud.faces.gotoAndStop(3);
_root.attachMovie("arm_mc", "arm_mc", _root.getNextHighestDepth());
arm_mc.gotoAndStop(3);
_root.attachMovie("playerThree", "player", _root.getNextHighestDepth(), {_x:startPoint._x, _y:startPoint._y});
}
if (playerSelect == 4) {
hitBoost = 2;
maxaccel = 5;
maxjump = 3;
playerStrength = 10;
hud.faces.gotoAndStop(4);
_root.attachMovie("arm_mc", "arm_mc", _root.getNextHighestDepth());
arm_mc.gotoAndStop(4);
_root.attachMovie("playerFour", "player", _root.getNextHighestDepth(), {_x:startPoint._x, _y:startPoint._y});
}
_root.attachMovie("crosshair", "crosshair", _root.getNextHighestDepth());
_root.attachMovie("place", "place", _root.getNextHighestDepth());
atBoss = false;
bossDead = false;
moveOnTimer = 0;
arm_mc.spark._alpha = 0;
place._alpha = 0;
crosshair._xscale = 50;
crosshair._yscale = 50;
Mouse.hide();
cam._xscale = 100;
cam._yscale = 100;
showWarning = true;
transTimer = 0;
randomNumber = 0;
running = false;
gravity = 0;
gravityaccel = 0.2;
xaccel = 0;
runaccelamt = 0.3;
friction = 0.5;
airrisist = 0.05;
doubleJump = false;
doubleJumping = false;
jump = true;
pressOnce = 0;
playerDamaged = 0;
playerDamagedTimer = 0;
cam.lens._xscale = 50;
cam.lens._yscale = 50;
damaged = false;
inControl = true;
fireRate = 300;
shotPower = 1;
shootingTimer = 0;
shooting = false;
addEnemyTimer = 0;
choice = 0;
playerHealth = 100;
var diamonds = new Array();
diamonds.push(d1, d2, d3);
var coin = new Array();
var boxes = new Array();
boxes.push(box1, box2, box3, box4, box5, box6, box7, box8, box9, box10, box11);
var enemy = new Array();
enemy.push(enemy1, enemy2, enemy3, enemy4, enemy5, enemy6, enemy7, flame1, flame2, flame3, flame4, flame5, flame6, boss);
var enemyType = new Array();
enemyType.push("static_left", "static_left", "static_left", "static_left", "static_left", "static_left", "static_left", "flame_gun", "flame_gun", "flame_gun", "flame_gun", "flame_gun", "flame_gun", "boss_mc");
var enemyHealth = new Array();
enemyHealth.push(10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 100);
var selfDestruct = new Array();
selfDestruct.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var enemyHit = new Array();
enemyHit.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var enemyHitTimer = new Array();
enemyHitTimer.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var enemyShotClock = new Array();
enemyShotClock.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var bullets = new Array();
var enemyShot = new Array();
var bomb = new Array();
onMouseDown = function () {
if ((!damaged) && (inControl)) {
shooting = true;
}
};
onMouseUp = function () {
shooting = false;
};
player.onEnterFrame = function () {
if (playerDamaged == 0) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
if (playerDamaged == 1) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:200, gb:200, bb:200};
myColor.setTransform(myColorTransform);
playerDamagedTimer++;
if (playerDamagedTimer == 1) {
weapon--;
playerDamaged = 0;
playerDamagedTimer = 0;
}
}
if (player._x < 3000) {
if ((addEnemyTimer + 6000) < getTimer()) {
addEnemyTimer = getTimer();
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
randomNumber++;
metalBee_mc = _root.attachMovie("metalBee", "metalBee" + randomNumber, _root.getNextHighestDepth(), {_x:cam._x - 800, _y:player._y - 60});
metalBee_mc._xscale = -100;
enemy.push(metalBee_mc);
enemyType.push("metal_bee");
enemyHealth.push(1);
selfDestruct.push(500);
enemyHitTimer.push(0);
enemyHit.push(0);
enemyShotClock.push(0);
}
if (choice == 1) {
randomNumber++;
metalBee_mc = _root.attachMovie("metalBee", "metalBee" + randomNumber, _root.getNextHighestDepth(), {_x:cam._x + 800, _y:player._y - 60});
enemy.push(metalBee_mc);
enemyType.push("metal_bee");
enemyHealth.push(1);
selfDestruct.push(500);
enemyHitTimer.push(0);
enemyHit.push(0);
enemyShotClock.push(0);
}
}
}
if (!shooting) {
arm_mc.spark._alpha = 0;
}
myRadians = Math.atan2(_root._ymouse - place._y, _root._xmouse - place._x);
myDegrees = Math.round((myRadians * 180) / Math.PI);
place._rotation = myDegrees;
if (shooting) {
if (weapon == 0) {
fireRate = 300;
shotPower = 1;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
if (weapon == 1) {
fireRate = 500;
shotPower = 1;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
randomNumber++;
bullet_mc = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullets.push(bullet_mc);
angle = place._rotation - 6;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
randomNumber++;
bullet_mc = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullets.push(bullet_mc);
angle = place._rotation + 6;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
if (weapon == 2) {
shotPower = 1.5;
fireRate = 200;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("laser", "laser" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
if (weapon == 3) {
shotPower = 2;
fireRate = 200;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("laser", "laser" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._yscale = 200;
bullet_mc._xscale = 600;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
if (weapon == 4) {
shotPower = 2.5;
fireRate = 200;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("largeBullet", "largeBullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
if (weapon == 5) {
shotPower = 2.5;
fireRate = 100;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("largeBullet", "largeBullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._yscale = 50;
bullet_mc._xscale = 50;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
randomNumber++;
bullet_mc = _root.attachMovie("largeBullet", "largeBullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._yscale = 50;
bullet_mc._xscale = 50;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation + 15;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
randomNumber++;
bullet_mc = _root.attachMovie("largeBullet", "largeBullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._yscale = 50;
bullet_mc._xscale = 50;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation - 15;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
}
if (player.hitTest(beamer_mc.beam)) {
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - 1;
playerDamaged = 1;
}
i = enemy.length - 1;
while (i >= 0) {
if (enemyType[i] == "boss_mc") {
if (enemy[i].hitBox.hitTest(player.hit)) {
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - 0.1;
playerDamaged = 1;
}
if (atBoss) {
enemyShotClock[i]++;
if (enemyShotClock[i] < 60) {
enemy[i].gotoAndStop("warning");
}
if (enemyShotClock[i] > 60) {
selfDestruct[i]++;
if (selfDestruct[i] == 40) {
selfDestruct[i] = 0;
randomNumber++;
beamer_mc = _root.attachMovie("bossAttack", "bossAttack" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
enemy[i].gotoAndStop("shooting");
}
if (enemyShotClock[i] > 150) {
randomNumber++;
bombs_mc = _root.attachMovie("bombs", "bombs" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:0});
bomb.push(bombs_mc);
enemyShotClock[i] = 0;
selfDestruct[i] = 0;
}
}
}
if (enemyType[i] == "flame_gun") {
if (enemy[i].hitBox.hitTest(player.hit)) {
enemyHealth[i] = 0;
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
}
if (player.hitTest(enemy[i].area)) {
enemyShotClock[i]++;
if (enemyShotClock[i] == 3) {
enemyShotClock[i] = 0;
randomNumber++;
enemyBullet_mc = _root.attachMovie("flameBullet", "flameBullet" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x - 10, _y:enemy[i]._y - 30});
enemyShot.push(enemyBullet_mc);
enemyBullet_mc.onEnterFrame = function () {
this._xscale = this._xscale + 5;
this._yscale = this._yscale + 5;
this._y = this._y - 5;
};
}
}
}
if (enemyType[i] == "static_left") {
if (enemy[i].hitBox.hitTest(player.hit)) {
enemyHealth[i] = 0;
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
}
if (player.hitTest(enemy[i].area)) {
enemyShotClock[i]++;
if (enemyShotClock[i] == 30) {
enemyShotClock[i] = 0;
randomNumber++;
enemyBullet_mc = _root.attachMovie("enemyBullet", "enemyBullet" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x - 15, _y:enemy[i]._y - 3});
enemyShot.push(enemyBullet_mc);
enemyBullet_mc.onEnterFrame = function () {
this._x = this._x - 5;
};
}
}
}
if ((enemyType[i] == "metal_bee") && (enemy[i]._xscale == -100)) {
if (enemy[i].hitBox.hitTest(player.hit)) {
enemyHealth[i] = 0;
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
}
if (enemy[i].marker.hitTest(player)) {
enemy[i].marker.gotoAndStop(2);
randomNumber++;
bombs_mc = _root.attachMovie("bombs", "bombs" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
bomb.push(bombs_mc);
}
selfDestruct[i]--;
enemy[i]._x = enemy[i]._x + 3;
if (selfDestruct[i] < 1) {
enemyHealth[i] = 0;
}
if (player._x > 3000) {
enemyHealth[i] = 0;
}
}
if ((enemyType[i] == "metal_bee") && (enemy[i]._xscale == 100)) {
if (enemy[i].hitBox.hitTest(player.hit)) {
enemyHealth[i] = 0;
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
}
if (enemy[i].marker.hitTest(player)) {
enemy[i].marker.gotoAndStop(2);
randomNumber++;
bombs_mc = _root.attachMovie("bombs", "bombs" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
bomb.push(bombs_mc);
}
selfDestruct[i]--;
enemy[i]._x = enemy[i]._x - 3;
if (selfDestruct[i] < 1) {
enemyHealth[i] = 0;
}
if (player._x > 3000) {
enemyHealth[i] = 0;
}
}
if (enemyHit[i] == 0) {
myColor = new Color(enemy[i]);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
if (enemyHit[i] == 1) {
myColor = new Color(enemy[i]);
myColorTransform = new Object();
myColorTransform = {rb:200, gb:200, bb:200};
myColor.setTransform(myColorTransform);
enemyHitTimer[i]++;
if (enemyHitTimer[i] == 3) {
enemyHitTimer[i] = 0;
enemyHit[i] = 0;
}
}
if (enemyHealth[i] < 1) {
if (enemyType[i] == "boss_mc") {
bossDead = true;
atBoss = false;
enemy[i].gotoAndStop(3);
_root.attachMovie("bossDeath2", "bossDeath2", _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
}
if ((enemyType[i] == "static_left") or (enemyType[i] == "flame_gun")) {
enemy[i].gotoAndStop(2);
}
randomNumber++;
_root.attachMovie("explosion", "explosion" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
enemy[i].removeMovieClip();
enemy.splice(i, 1);
enemyType.splice(i, 1);
enemyHealth.splice(i, 1);
selfDestruct.splice(i, 1);
enemyHitTimer.splice(i, 1);
enemyHit.splice(i, 1);
enemyShotClock.splice(i, 1);
}
i--;
}
i = bomb.length - 1;
while (i >= 0) {
if (bomb[i].hitTest(player.hit)) {
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
randomNumber++;
_root.attachMovie("explosion", "explosion" + randomNumber, _root.getNextHighestDepth(), {_x:bomb[i]._x, _y:bomb[i]._y});
bomb[i].removeMovieClip();
bomb.splice(i, 1);
}
bomb[i]._y = bomb[i]._y + 6;
if (ground.hitTest(bomb[i]._x, bomb[i]._y, true)) {
randomNumber++;
_root.attachMovie("explosion", "explosion" + randomNumber, _root.getNextHighestDepth(), {_x:bomb[i]._x, _y:bomb[i]._y});
bomb[i].removeMovieClip();
bomb.splice(i, 1);
}
i--;
}
i = enemyShot.length - 1;
while (i >= 0) {
if (enemyShot[i]._xscale > 200) {
enemyShot[i].removeMovieClip();
enemyShot.splice(i, 1);
}
if (enemyShot[i].hitTest(player.hit)) {
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:enemyShot[i]._x, _y:enemyShot[i]._y});
enemyShot[i].removeMovieClip();
enemyShot.splice(i, 1);
}
if (ground.hitTest(enemyShot[i]._x, enemyShot[i]._y, true)) {
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:enemyShot[i]._x, _y:enemyShot[i]._y});
enemyShot[i].removeMovieClip();
enemyShot.splice(i, 1);
}
i--;
}
i = coin.length - 1;
while (i >= 0) {
if (coin[i].hitTest(player)) {
numberOfCoins = numberOfCoins + 10;
randomNumber++;
_root.attachMovie("ping", "ping" + randomNumber, _root.getNextHighestDepth(), {_x:coin[i]._x, _y:coin[i]._y});
coin[i].removeMovieClip();
coin.splice(i, 1);
}
i--;
}
i = diamonds.length - 1;
while (i >= 0) {
if (diamonds[i].hitTest(player)) {
diamonds[i].gotoAndStop(2);
weapon++;
randomNumber++;
_root.attachMovie("ping", "ping" + randomNumber, _root.getNextHighestDepth(), {_x:diamonds[i]._x, _y:diamonds[i]._y});
diamonds[i].removeMovieClip();
diamonds.splice(i, 1);
}
i--;
}
i = bullets.length - 1;
while (i >= 0) {
if (playerSelect == 1) {
bullets[i].gotoAndStop(1);
}
if (playerSelect == 2) {
bullets[i].gotoAndStop(2);
}
if (playerSelect == 3) {
bullets[i].gotoAndStop(3);
}
if (playerSelect == 4) {
bullets[i].gotoAndStop(4);
}
l = boxes.length - 1;
while (l >= 0) {
if (bullets[i].hitTest(boxes[l])) {
boxes[l].gotoAndStop(2);
randomNumber++;
coins_mc = _root.attachMovie("coins", "coins" + randomNumber, _root.getNextHighestDepth(), {_x:boxes[l]._x, _y:boxes[l]._y});
coin.push(coins_mc);
randomNumber++;
_root.attachMovie("explosion", "explosion" + randomNumber, _root.getNextHighestDepth(), {_x:boxes[l]._x, _y:boxes[l]._y});
boxes[l].removeMovieClip();
boxes.splice(l, 1);
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:bullets[i]._x, _y:bullets[i]._y});
bullets[i].removeMovieClip();
bullets.splice(i, 1);
}
l--;
}
k = bomb.length - 1;
while (k >= 0) {
if (bullets[i].hitTest(bomb[k])) {
randomNumber++;
_root.attachMovie("explosion", "explosion" + randomNumber, _root.getNextHighestDepth(), {_x:bomb[k]._x, _y:bomb[k]._y});
bomb[k].removeMovieClip();
bomb.splice(k, 1);
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:bullets[i]._x, _y:bullets[i]._y});
bullets[i].removeMovieClip();
bullets.splice(i, 1);
}
k--;
}
j = enemy.length - 1;
while (j >= 0) {
if (bullets[i].hitTest(enemy[j].hitBox)) {
enemyHit[j] = 1;
enemyHealth[j] = enemyHealth[j] - (shotPower + hitBoost);
if (enemyType[j] == "boss_mc") {
if (player._x < 3000) {
enemyHealth[j] = enemyHealth[j] + (shotPower + hitBoost);
}
}
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:bullets[i]._x, _y:bullets[i]._y});
bullets[i].removeMovieClip();
bullets.splice(i, 1);
}
j--;
}
if (ground.hitTest(bullets[i]._x, bullets[i]._y, true)) {
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:bullets[i]._x, _y:bullets[i]._y});
bullets[i].removeMovieClip();
bullets.splice(i, 1);
}
i--;
}
if ((ground.hitTest(player._x, player._y + 11, true) && (jump)) && (!doubleJumping)) {
arm_mc._alpha = 100;
if (running) {
player.gotoAndStop("run");
} else {
player.gotoAndStop("idle");
}
} else {
player.gotoAndStop("jump");
arm_mc._alpha = 0;
}
if (Key.isDown(68) or Key.isDown(65)) {
running = true;
} else {
running = false;
}
if (!ground.hitTest(player._x, player._y + 10, true)) {
falling = true;
grounded = false;
}
if (ground.hitTest(player._x, player._y + 11, true)) {
doubleJumping = false;
doubleJump = false;
jump = true;
grounded = true;
falling = false;
while (ground.hitTest(player._x, player._y + 9, true)) {
player._y--;
}
}
if (falling == true) {
gravity = gravity + gravityaccel;
} else {
gravity = 0;
}
if (((inControl && (Key.isDown(68))) && (xaccel < maxaccel)) && (falling == true)) {
xaccel = xaccel + (runaccelamt - airrisist);
} else if (((inControl && (Key.isDown(65))) && (xaccel > (-maxaccel))) && (falling == true)) {
xaccel = xaccel - (runaccelamt - airrisist);
} else if (((inControl && (Key.isDown(65))) && (xaccel > (-maxaccel))) && (falling == false)) {
xaccel = xaccel - runaccelamt;
} else if (((inControl && (Key.isDown(68))) && (xaccel < maxaccel)) && (falling == false)) {
xaccel = xaccel + runaccelamt;
} else if (grounded == true) {
if (xaccel > 0) {
xaccel = xaccel - friction;
}
if (xaccel < 0) {
xaccel = xaccel + friction;
}
if ((xaccel < 0) && (xaccel > friction)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < friction)) {
xaccel = 0;
}
} else {
if (xaccel > 0) {
xaccel = xaccel - airrisist;
}
if (xaccel < 0) {
xaccel = xaccel + airrisist;
}
if ((xaccel < 0) && (xaccel > airrisist)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < airrisist)) {
xaccel = 0;
}
}
if (_root.ground.hitTest(this._x, this._y - 11, true)) {
gravity = 1;
while (_root.ground.hitTest(this._x, this._y - 10, true)) {
this._y++;
}
}
if (_xmouse > player._x) {
player._xscale = 100;
}
if (_xmouse < player._x) {
player._xscale = -100;
}
if (!Key.isDown(87)) {
pressOnce = 0;
}
if ((inControl && (Key.isDown(87))) && (jump == true)) {
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
if (playerSelect == 2) {
_root.attachMovie("dust", "dust", _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
jump = false;
doubleJump = true;
pressOnce = 1;
}
if (((inControl && (Key.isDown(87))) && (doubleJump == true)) && (pressOnce == 0)) {
gravity = 0;
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
doubleJump = false;
doubleJumping = true;
}
leftx = player._x + (Math.cos(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
lefty = player._y - (Math.sin(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
rightx = player._x + (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * 7);
righty = player._y - (Math.sin(3.141593 * ((player._rotation * -1) / 180)) * 7);
if (ground.hitTest(leftx, lefty, true)) {
xaccel = 0;
player._x++;
}
if (ground.hitTest(rightx, righty, true)) {
xaccel = 0;
player._x--;
}
if (cam._y > 310) {
cam._y = 310;
}
if (cam._x > 3529) {
cam._x = 3529;
}
if (cam._x < 320) {
cam._x = 320;
}
crosshair._x = _xmouse;
crosshair._y = _ymouse;
bg._x = cam._x;
bg._y = cam._y;
place._x = player._x;
place._y = player._y;
endX = player._x;
cam._x = cam._x + ((endX - cam._x) / 20);
endY = player._y;
cam._y = cam._y + ((endY - cam._y) / 20);
cam.camControl();
hud._x = cam._x;
hud._y = cam._y;
hud._xscale = cam.lens._xscale;
hud._yscale = cam.lens._yscale;
bossWarning._x = cam._x;
bossWarning._y = cam._y;
bossWarning._xscale = cam.lens._xscale;
bossWarning._yscale = cam.lens._yscale;
player._y = player._y + gravity;
player._x = player._x + xaccel;
hud.healthBar._xscale = playerHealth;
if (playerHealth > 100) {
playerHealth = 100;
}
if (playerHealth < 1) {
shooting = false;
playerHealth = 0;
inControl = false;
player._alpha = 0;
arm_mc._alpha = 0;
if (transTimer == 0) {
_root.attachMovie("bubbs", "bubbs", _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
_root.attachMovie("trans", "trans", _root.getNextHighestDepth(), {_x:cam._x, _y:cam._y});
}
transTimer++;
if (transTimer > 79) {
clearAll();
prevFrame();
}
}
if (bossDead) {
moveOnTimer++;
if (moveOnTimer == 89) {
_root.attachMovie("stageComplete", "stageComplete", _root.getNextHighestDepth(), {_x:cam._x, _y:cam._y});
}
if (moveOnTimer == 110) {
_root.attachMovie("trans", "trans", _root.getNextHighestDepth(), {_x:cam._x, _y:cam._y});
}
if (moveOnTimer == 189) {
clearAll();
stageTwoComplete = true;
user.data.numberOfCoins_s = numberOfCoins;
user.data.weapon_s = weapon;
user.data.twoLocked_s = twoLocked;
user.data.threeLocked_s = threeLocked;
user.data.fourLocked_s = fourLocked;
user.data.stageOneComplete_s = stageOneComplete;
user.data.stageTwoComplete_s = stageTwoComplete;
user.data.stageThreeComplete_s = stageThreeComplete;
user.data.stageFourComplete_s = stageFourComplete;
user.data.stageFiveComplete_s = stageFiveComplete;
user.data.stageSixComplete_s = stageSixComplete;
user.data.stageTwoOpen_s = stageTwoOpen;
user.data.stageThreeOpen_s = stageThreeOpen;
user.data.stageFourOpen_s = stageFourOpen;
user.data.stageFiveOpen_s = stageFiveOpen;
user.data.stageSixOpen_s = stageSixOpen;
user.flush();
gotoAndStop ("stageSelect");
}
}
if (weapon < 0) {
weapon = 0;
}
if (weapon > 5) {
weapon = 5;
}
if (player._y > 500) {
playerHealth = 0;
}
if (player._x > 3000) {
atBoss = true;
if (showWarning) {
_root.attachMovie("bossWarning", "bossWarning", _root.getNextHighestDepth());
showWarning = false;
}
}
if (player._xscale == 100) {
myRadiansA = Math.atan2(_root._ymouse - arm_mc._y, _root._xmouse - arm_mc._x);
myDegreesA = Math.round((myRadiansA * 180) / Math.PI);
arm_mc._rotation = myDegreesA;
arm_mc._xscale = 100;
}
if (player._xscale == -100) {
myRadiansA = Math.atan2(_root._ymouse - arm_mc._y, _root._xmouse - arm_mc._x);
myDegreesA = Math.round((myRadiansA * 180) / Math.PI) - 180;
arm_mc._rotation = myDegreesA;
arm_mc._xscale = -100;
}
stageComplete._x = cam._x;
stageComplete._y = cam._y;
stageComplete._xscale = cam.lens._xscale;
stageComplete._yscale = cam.lens._yscale;
arm_mc._x = player._x;
arm_mc._y = player._y - 3;
hud.cnn.text = numberOfCoins;
trans.swapDepths(_root.getNextHighestDepth());
};
Frame 17
player.removeMovieClip();
stopAllSounds();
cam._xscale = 100;
cam._yscale = 100;
cam._x = that._x;
cam._y = that._y;
stop();
Instance of Symbol 562 MovieClip in Frame 17
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
getURL ("http://www.longanimalsgames.com/?referral=stargunheroes&refmode=moregames", "_blank");
}
Instance of Symbol 619 MovieClip in Frame 17
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
_root.nextFrame();
}
Instance of Symbol 622 MovieClip in Frame 17
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
_root.gotoAndStop("title");
}
Frame 18
function clearAll() {
Mouse.show();
stopAllSounds();
hud.removeMovieClip();
place.removeMovieClip();
bossWarning.removeMovieClip();
crosshair.removeMovieClip();
arm_mc.removeMovieClip();
i = diamonds.length - 1;
while (i >= 0) {
diamonds[i].removeMovieClip();
diamonds.splice(i, 1);
i--;
}
i = coin.length - 1;
while (i >= 0) {
coin[i].removeMovieClip();
coin.splice(i, 1);
i--;
}
i = boxes.length - 1;
while (i >= 0) {
boxes[i].removeMovieClip();
boxes.splice(i, 1);
i--;
}
i = enemy.length - 1;
while (i >= 0) {
enemy[i].removeMovieClip();
enemy.splice(i, 1);
i--;
}
i = enemyType.length - 1;
while (i >= 0) {
enemyType.splice(i, 1);
i--;
}
i = enemyHealth.length - 1;
while (i >= 0) {
enemyHealth.splice(i, 1);
i--;
}
i = selfDestruct.length - 1;
while (i >= 0) {
selfDestruct.splice(i, 1);
i--;
}
i = enemyHit.length - 1;
while (i >= 0) {
enemyHit.splice(i, 1);
i--;
}
i = enemyHitTimer.length - 1;
while (i >= 0) {
enemyHitTimer.splice(i, 1);
i--;
}
i = enemyShotClock.length - 1;
while (i >= 0) {
enemyShotClock.splice(i, 1);
i--;
}
i = bullets.length - 1;
while (i >= 0) {
bullets[i].removeMovieClip();
bullets.splice(i, 1);
i--;
}
i = enemyShot.length - 1;
while (i >= 0) {
enemyShot[i].removeMovieClip();
enemyShot.splice(i, 1);
i--;
}
i = bomb.length - 1;
while (i >= 0) {
bomb[i].removeMovieClip();
bomb.splice(i, 1);
i--;
}
}
stop();
shotsnd = new Sound();
shotsnd.attachSound("reflect");
_root.attachMovie("hud", "hud", _root.getNextHighestDepth());
if (playerSelect == 5) {
hitBoost = 3;
maxaccel = 5;
maxjump = 3;
playerStrength = 10;
hud.faces.gotoAndStop(5);
_root.attachMovie("arm_mc", "arm_mc", _root.getNextHighestDepth());
arm_mc.gotoAndStop(5);
_root.attachMovie("hiddenGuy", "player", _root.getNextHighestDepth(), {_x:startPoint._x, _y:startPoint._y});
}
if (playerSelect == 1) {
hitBoost = 0;
maxaccel = 3;
maxjump = 3;
playerStrength = 10;
_root.attachMovie("arm_mc", "arm_mc", _root.getNextHighestDepth());
arm_mc.gotoAndStop(1);
_root.attachMovie("player", "player", _root.getNextHighestDepth(), {_x:startPoint._x, _y:startPoint._y});
}
if (playerSelect == 2) {
hitBoost = 0;
maxaccel = 5;
maxjump = 5;
playerStrength = 8;
hud.faces.gotoAndStop(2);
_root.attachMovie("arm_mc", "arm_mc", _root.getNextHighestDepth());
arm_mc.gotoAndStop(2);
_root.attachMovie("playerTwo", "player", _root.getNextHighestDepth(), {_x:startPoint._x, _y:startPoint._y});
}
if (playerSelect == 3) {
hitBoost = 1.5;
maxaccel = 3.5;
maxjump = 3;
playerStrength = 5;
hud.faces.gotoAndStop(3);
_root.attachMovie("arm_mc", "arm_mc", _root.getNextHighestDepth());
arm_mc.gotoAndStop(3);
_root.attachMovie("playerThree", "player", _root.getNextHighestDepth(), {_x:startPoint._x, _y:startPoint._y});
}
if (playerSelect == 4) {
hitBoost = 2;
maxaccel = 5;
maxjump = 3;
playerStrength = 10;
hud.faces.gotoAndStop(4);
_root.attachMovie("arm_mc", "arm_mc", _root.getNextHighestDepth());
arm_mc.gotoAndStop(4);
_root.attachMovie("playerFour", "player", _root.getNextHighestDepth(), {_x:startPoint._x, _y:startPoint._y});
}
_root.attachMovie("crosshair", "crosshair", _root.getNextHighestDepth());
_root.attachMovie("place", "place", _root.getNextHighestDepth());
atBoss = false;
bossDead = false;
moveOnTimer = 0;
arm_mc.spark._alpha = 0;
place._alpha = 0;
crosshair._xscale = 50;
crosshair._yscale = 50;
Mouse.hide();
cam._xscale = 100;
cam._yscale = 100;
showWarning = true;
transTimer = 0;
randomNumber = 0;
running = false;
gravity = 0;
gravityaccel = 0.2;
xaccel = 0;
runaccelamt = 0.3;
friction = 0.5;
airrisist = 0.05;
doubleJump = false;
doubleJumping = false;
jump = true;
pressOnce = 0;
playerDamaged = 0;
playerDamagedTimer = 0;
cam.lens._xscale = 50;
cam.lens._yscale = 50;
damaged = false;
inControl = true;
fireRate = 300;
shotPower = 1;
shootingTimer = 0;
shooting = false;
addEnemyTimer = 0;
choice = 0;
playerHealth = 100;
var diamonds = new Array();
diamonds.push(d1, d2, d3);
var coin = new Array();
var boxes = new Array();
boxes.push(box1, box2, box3, box4, box5, box6, box7, box8, box9, box10, box11);
var enemy = new Array();
enemy.push(enemy1, enemy2, enemy3, enemy4, enemy5, enemy6, enemy7, flame1, flame2, flame3, flame4, flame5, flame6, boss);
var enemyType = new Array();
enemyType.push("static_left", "static_left", "static_left", "static_left", "static_left", "static_left", "static_left", "flame_gun", "flame_gun", "flame_gun", "flame_gun", "flame_gun", "flame_gun", "boss_mc");
var enemyHealth = new Array();
enemyHealth.push(10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 100);
var selfDestruct = new Array();
selfDestruct.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var enemyHit = new Array();
enemyHit.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var enemyHitTimer = new Array();
enemyHitTimer.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var enemyShotClock = new Array();
enemyShotClock.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var bullets = new Array();
var enemyShot = new Array();
var bomb = new Array();
onMouseDown = function () {
if ((!damaged) && (inControl)) {
shooting = true;
}
};
onMouseUp = function () {
shooting = false;
};
player.onEnterFrame = function () {
if (playerDamaged == 0) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
if (playerDamaged == 1) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:200, gb:200, bb:200};
myColor.setTransform(myColorTransform);
playerDamagedTimer++;
if (playerDamagedTimer == 1) {
weapon--;
playerDamaged = 0;
playerDamagedTimer = 0;
}
}
if (player._x < 3000) {
if ((addEnemyTimer + 6000) < getTimer()) {
addEnemyTimer = getTimer();
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
randomNumber++;
metalBee_mc = _root.attachMovie("metalBee", "metalBee" + randomNumber, _root.getNextHighestDepth(), {_x:cam._x - 800, _y:player._y - 60});
metalBee_mc._xscale = -100;
enemy.push(metalBee_mc);
enemyType.push("metal_bee");
enemyHealth.push(1);
selfDestruct.push(500);
enemyHitTimer.push(0);
enemyHit.push(0);
enemyShotClock.push(0);
}
if (choice == 1) {
randomNumber++;
metalBee_mc = _root.attachMovie("metalBee", "metalBee" + randomNumber, _root.getNextHighestDepth(), {_x:cam._x + 800, _y:player._y - 60});
enemy.push(metalBee_mc);
enemyType.push("metal_bee");
enemyHealth.push(1);
selfDestruct.push(500);
enemyHitTimer.push(0);
enemyHit.push(0);
enemyShotClock.push(0);
}
}
}
if (!shooting) {
arm_mc.spark._alpha = 0;
}
myRadians = Math.atan2(_root._ymouse - place._y, _root._xmouse - place._x);
myDegrees = Math.round((myRadians * 180) / Math.PI);
place._rotation = myDegrees;
if (shooting) {
if (weapon == 0) {
fireRate = 300;
shotPower = 1;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
if (weapon == 1) {
fireRate = 500;
shotPower = 1;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
randomNumber++;
bullet_mc = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullets.push(bullet_mc);
angle = place._rotation - 6;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
randomNumber++;
bullet_mc = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullets.push(bullet_mc);
angle = place._rotation + 6;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
if (weapon == 2) {
shotPower = 1.5;
fireRate = 200;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("laser", "laser" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
if (weapon == 3) {
shotPower = 2;
fireRate = 200;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("laser", "laser" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._yscale = 200;
bullet_mc._xscale = 600;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
if (weapon == 4) {
shotPower = 2.5;
fireRate = 200;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("largeBullet", "largeBullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
if (weapon == 5) {
shotPower = 2.5;
fireRate = 100;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("largeBullet", "largeBullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._yscale = 50;
bullet_mc._xscale = 50;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
randomNumber++;
bullet_mc = _root.attachMovie("largeBullet", "largeBullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._yscale = 50;
bullet_mc._xscale = 50;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation + 15;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
randomNumber++;
bullet_mc = _root.attachMovie("largeBullet", "largeBullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._yscale = 50;
bullet_mc._xscale = 50;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation - 15;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
}
i = enemy.length - 1;
while (i >= 0) {
if (enemyType[i] == "boss_mc") {
if (enemy[i].hitBox.hitTest(player.hit)) {
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - 0.1;
playerDamaged = 1;
}
if (atBoss) {
enemyShotClock[i]++;
if (enemyShotClock[i] < 60) {
}
if (enemyShotClock[i] > 60) {
selfDestruct[i]++;
if (selfDestruct[i] == 15) {
selfDestruct[i] = 0;
randomNumber++;
bombs_mc = _root.attachMovie("bombs", "bombs" + randomNumber, _root.getNextHighestDepth(), {_x:((cam._x + 320) - Math.round(Math.random() * 640)) + 0, _y:0});
bomb.push(bombs_mc);
}
}
if (enemyShotClock[i] > 150) {
randomNumber++;
bombs_mc = _root.attachMovie("bombs", "bombs" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:0});
bomb.push(bombs_mc);
enemyShotClock[i] = 0;
selfDestruct[i] = 0;
}
}
}
if (enemyType[i] == "flame_gun") {
if (enemy[i].hitBox.hitTest(player.hit)) {
enemyHealth[i] = 0;
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
}
if (player.hitTest(enemy[i].area)) {
enemyShotClock[i]++;
if (enemyShotClock[i] == 3) {
enemyShotClock[i] = 0;
randomNumber++;
enemyBullet_mc = _root.attachMovie("flameBullet", "flameBullet" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x - 10, _y:enemy[i]._y - 30});
enemyShot.push(enemyBullet_mc);
enemyBullet_mc.onEnterFrame = function () {
this._xscale = this._xscale + 5;
this._yscale = this._yscale + 5;
this._y = this._y - 5;
};
}
}
}
if (enemyType[i] == "static_left") {
if (enemy[i].hitBox.hitTest(player.hit)) {
enemyHealth[i] = 0;
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
}
if (player.hitTest(enemy[i].area)) {
enemyShotClock[i]++;
if (enemyShotClock[i] == 43) {
enemyShotClock[i] = 0;
randomNumber++;
enemyBullet_mc = _root.attachMovie("enemyBullet", "enemyBullet" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x - 15, _y:enemy[i]._y - 3});
enemyShot.push(enemyBullet_mc);
enemyBullet_mc.onEnterFrame = function () {
this._x = this._x - 5;
};
}
}
}
if ((enemyType[i] == "metal_bee") && (enemy[i]._xscale == -100)) {
if (enemy[i].hitBox.hitTest(player.hit)) {
enemyHealth[i] = 0;
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
}
if (enemy[i].marker.hitTest(player)) {
enemy[i].marker.gotoAndStop(2);
randomNumber++;
bombs_mc = _root.attachMovie("bombs", "bombs" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
bomb.push(bombs_mc);
}
selfDestruct[i]--;
enemy[i]._x = enemy[i]._x + 3;
if (selfDestruct[i] < 1) {
enemyHealth[i] = 0;
}
if (player._x > 3000) {
enemyHealth[i] = 0;
}
}
if ((enemyType[i] == "metal_bee") && (enemy[i]._xscale == 100)) {
if (enemy[i].hitBox.hitTest(player.hit)) {
enemyHealth[i] = 0;
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
}
if (enemy[i].marker.hitTest(player)) {
enemy[i].marker.gotoAndStop(2);
randomNumber++;
bombs_mc = _root.attachMovie("bombs", "bombs" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
bomb.push(bombs_mc);
}
selfDestruct[i]--;
enemy[i]._x = enemy[i]._x - 3;
if (selfDestruct[i] < 1) {
enemyHealth[i] = 0;
}
if (player._x > 3000) {
enemyHealth[i] = 0;
}
}
if (enemyHit[i] == 0) {
myColor = new Color(enemy[i]);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
if (enemyHit[i] == 1) {
myColor = new Color(enemy[i]);
myColorTransform = new Object();
myColorTransform = {rb:200, gb:200, bb:200};
myColor.setTransform(myColorTransform);
enemyHitTimer[i]++;
if (enemyHitTimer[i] == 3) {
enemyHitTimer[i] = 0;
enemyHit[i] = 0;
}
}
if (enemyHealth[i] < 1) {
if (enemyType[i] == "boss_mc") {
bossDead = true;
atBoss = false;
enemy[i].gotoAndStop(2);
_root.attachMovie("dead3Boss", "dead3Boss", _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
}
if ((enemyType[i] == "static_left") or (enemyType[i] == "flame_gun")) {
enemy[i].gotoAndStop(2);
}
randomNumber++;
_root.attachMovie("explosion", "explosion" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
enemy[i].removeMovieClip();
enemy.splice(i, 1);
enemyType.splice(i, 1);
enemyHealth.splice(i, 1);
selfDestruct.splice(i, 1);
enemyHitTimer.splice(i, 1);
enemyHit.splice(i, 1);
enemyShotClock.splice(i, 1);
}
i--;
}
i = bomb.length - 1;
while (i >= 0) {
if (bomb[i].hitTest(player.hit)) {
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
randomNumber++;
_root.attachMovie("explosion", "explosion" + randomNumber, _root.getNextHighestDepth(), {_x:bomb[i]._x, _y:bomb[i]._y});
bomb[i].removeMovieClip();
bomb.splice(i, 1);
}
bomb[i]._y = bomb[i]._y + 6;
if (ground.hitTest(bomb[i]._x, bomb[i]._y, true)) {
randomNumber++;
_root.attachMovie("explosion", "explosion" + randomNumber, _root.getNextHighestDepth(), {_x:bomb[i]._x, _y:bomb[i]._y});
bomb[i].removeMovieClip();
bomb.splice(i, 1);
}
i--;
}
i = enemyShot.length - 1;
while (i >= 0) {
if (enemyShot[i]._xscale > 200) {
enemyShot[i].removeMovieClip();
enemyShot.splice(i, 1);
}
if (enemyShot[i].hitTest(player.hit)) {
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:enemyShot[i]._x, _y:enemyShot[i]._y});
enemyShot[i].removeMovieClip();
enemyShot.splice(i, 1);
}
if (ground.hitTest(enemyShot[i]._x, enemyShot[i]._y, true)) {
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:enemyShot[i]._x, _y:enemyShot[i]._y});
enemyShot[i].removeMovieClip();
enemyShot.splice(i, 1);
}
i--;
}
i = coin.length - 1;
while (i >= 0) {
if (coin[i].hitTest(player)) {
numberOfCoins = numberOfCoins + 10;
randomNumber++;
_root.attachMovie("ping", "ping" + randomNumber, _root.getNextHighestDepth(), {_x:coin[i]._x, _y:coin[i]._y});
coin[i].removeMovieClip();
coin.splice(i, 1);
}
i--;
}
i = diamonds.length - 1;
while (i >= 0) {
if (diamonds[i].hitTest(player)) {
diamonds[i].gotoAndStop(2);
weapon++;
randomNumber++;
_root.attachMovie("ping", "ping" + randomNumber, _root.getNextHighestDepth(), {_x:diamonds[i]._x, _y:diamonds[i]._y});
diamonds[i].removeMovieClip();
diamonds.splice(i, 1);
}
i--;
}
i = bullets.length - 1;
while (i >= 0) {
if (playerSelect == 1) {
bullets[i].gotoAndStop(1);
}
if (playerSelect == 2) {
bullets[i].gotoAndStop(2);
}
if (playerSelect == 3) {
bullets[i].gotoAndStop(3);
}
if (playerSelect == 4) {
bullets[i].gotoAndStop(4);
}
l = boxes.length - 1;
while (l >= 0) {
if (bullets[i].hitTest(boxes[l])) {
boxes[l].gotoAndStop(2);
randomNumber++;
coins_mc = _root.attachMovie("coins", "coins" + randomNumber, _root.getNextHighestDepth(), {_x:boxes[l]._x, _y:boxes[l]._y});
coin.push(coins_mc);
randomNumber++;
_root.attachMovie("explosion", "explosion" + randomNumber, _root.getNextHighestDepth(), {_x:boxes[l]._x, _y:boxes[l]._y});
boxes[l].removeMovieClip();
boxes.splice(l, 1);
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:bullets[i]._x, _y:bullets[i]._y});
bullets[i].removeMovieClip();
bullets.splice(i, 1);
}
l--;
}
k = bomb.length - 1;
while (k >= 0) {
if (bullets[i].hitTest(bomb[k])) {
randomNumber++;
_root.attachMovie("explosion", "explosion" + randomNumber, _root.getNextHighestDepth(), {_x:bomb[k]._x, _y:bomb[k]._y});
bomb[k].removeMovieClip();
bomb.splice(k, 1);
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:bullets[i]._x, _y:bullets[i]._y});
bullets[i].removeMovieClip();
bullets.splice(i, 1);
}
k--;
}
j = enemy.length - 1;
while (j >= 0) {
if (bullets[i].hitTest(enemy[j].hitBox)) {
enemyHit[j] = 1;
enemyHealth[j] = enemyHealth[j] - (shotPower + hitBoost);
if (enemyType[j] == "boss_mc") {
if (player._x < 3000) {
enemyHealth[j] = enemyHealth[j] + (shotPower + hitBoost);
}
}
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:bullets[i]._x, _y:bullets[i]._y});
bullets[i].removeMovieClip();
bullets.splice(i, 1);
}
j--;
}
if (ground.hitTest(bullets[i]._x, bullets[i]._y, true)) {
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:bullets[i]._x, _y:bullets[i]._y});
bullets[i].removeMovieClip();
bullets.splice(i, 1);
}
i--;
}
if ((ground.hitTest(player._x, player._y + 11, true) && (jump)) && (!doubleJumping)) {
arm_mc._alpha = 100;
if (running) {
player.gotoAndStop("run");
} else {
player.gotoAndStop("idle");
}
} else {
player.gotoAndStop("jump");
arm_mc._alpha = 0;
}
if (Key.isDown(68) or Key.isDown(65)) {
running = true;
} else {
running = false;
}
if (!ground.hitTest(player._x, player._y + 10, true)) {
falling = true;
grounded = false;
}
if (ground.hitTest(player._x, player._y + 11, true)) {
doubleJumping = false;
doubleJump = false;
jump = true;
grounded = true;
falling = false;
while (ground.hitTest(player._x, player._y + 9, true)) {
player._y--;
}
}
if (falling == true) {
gravity = gravity + gravityaccel;
} else {
gravity = 0;
}
if (((inControl && (Key.isDown(68))) && (xaccel < maxaccel)) && (falling == true)) {
xaccel = xaccel + (runaccelamt - airrisist);
} else if (((inControl && (Key.isDown(65))) && (xaccel > (-maxaccel))) && (falling == true)) {
xaccel = xaccel - (runaccelamt - airrisist);
} else if (((inControl && (Key.isDown(65))) && (xaccel > (-maxaccel))) && (falling == false)) {
xaccel = xaccel - runaccelamt;
} else if (((inControl && (Key.isDown(68))) && (xaccel < maxaccel)) && (falling == false)) {
xaccel = xaccel + runaccelamt;
} else if (grounded == true) {
if (xaccel > 0) {
xaccel = xaccel - friction;
}
if (xaccel < 0) {
xaccel = xaccel + friction;
}
if ((xaccel < 0) && (xaccel > friction)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < friction)) {
xaccel = 0;
}
} else {
if (xaccel > 0) {
xaccel = xaccel - airrisist;
}
if (xaccel < 0) {
xaccel = xaccel + airrisist;
}
if ((xaccel < 0) && (xaccel > airrisist)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < airrisist)) {
xaccel = 0;
}
}
if (_root.ground.hitTest(this._x, this._y - 11, true)) {
gravity = 1;
while (_root.ground.hitTest(this._x, this._y - 10, true)) {
this._y++;
}
}
if (_xmouse > player._x) {
player._xscale = 100;
}
if (_xmouse < player._x) {
player._xscale = -100;
}
if (!Key.isDown(87)) {
pressOnce = 0;
}
if ((inControl && (Key.isDown(87))) && (jump == true)) {
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
if (playerSelect == 2) {
_root.attachMovie("dust", "dust", _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
jump = false;
doubleJump = true;
pressOnce = 1;
}
if (((inControl && (Key.isDown(87))) && (doubleJump == true)) && (pressOnce == 0)) {
gravity = 0;
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
doubleJump = false;
doubleJumping = true;
}
leftx = player._x + (Math.cos(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
lefty = player._y - (Math.sin(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
rightx = player._x + (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * 7);
righty = player._y - (Math.sin(3.141593 * ((player._rotation * -1) / 180)) * 7);
if (ground.hitTest(leftx, lefty, true)) {
xaccel = 0;
player._x++;
}
if (ground.hitTest(rightx, righty, true)) {
xaccel = 0;
player._x--;
}
if (cam._y > 290) {
cam._y = 290;
}
if (cam._x > 3932) {
cam._x = 3932;
}
if (cam._x < 320) {
cam._x = 320;
}
crosshair._x = _xmouse;
crosshair._y = _ymouse;
bg._x = cam._x;
bg._y = cam._y;
place._x = player._x;
place._y = player._y;
endX = player._x;
cam._x = cam._x + ((endX - cam._x) / 20);
endY = player._y;
cam._y = cam._y + ((endY - cam._y) / 20);
cam.camControl();
hud._x = cam._x;
hud._y = cam._y;
hud._xscale = cam.lens._xscale;
hud._yscale = cam.lens._yscale;
bossWarning._x = cam._x;
bossWarning._y = cam._y;
bossWarning._xscale = cam.lens._xscale;
bossWarning._yscale = cam.lens._yscale;
player._y = player._y + gravity;
player._x = player._x + xaccel;
hud.healthBar._xscale = playerHealth;
if (playerHealth > 100) {
playerHealth = 100;
}
if (playerHealth < 1) {
shooting = false;
playerHealth = 0;
inControl = false;
player._alpha = 0;
arm_mc._alpha = 0;
if (transTimer == 0) {
_root.attachMovie("bubbs", "bubbs", _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
_root.attachMovie("trans", "trans", _root.getNextHighestDepth(), {_x:cam._x, _y:cam._y});
}
transTimer++;
if (transTimer > 79) {
clearAll();
prevFrame();
}
}
if (bossDead) {
moveOnTimer++;
if (moveOnTimer == 89) {
_root.attachMovie("stageComplete", "stageComplete", _root.getNextHighestDepth(), {_x:cam._x, _y:cam._y});
}
if (moveOnTimer == 110) {
_root.attachMovie("trans", "trans", _root.getNextHighestDepth(), {_x:cam._x, _y:cam._y});
}
if (moveOnTimer == 189) {
clearAll();
stageThreeComplete = true;
user.data.numberOfCoins_s = numberOfCoins;
user.data.weapon_s = weapon;
user.data.twoLocked_s = twoLocked;
user.data.threeLocked_s = threeLocked;
user.data.fourLocked_s = fourLocked;
user.data.stageOneComplete_s = stageOneComplete;
user.data.stageTwoComplete_s = stageTwoComplete;
user.data.stageThreeComplete_s = stageThreeComplete;
user.data.stageFourComplete_s = stageFourComplete;
user.data.stageFiveComplete_s = stageFiveComplete;
user.data.stageSixComplete_s = stageSixComplete;
user.data.stageTwoOpen_s = stageTwoOpen;
user.data.stageThreeOpen_s = stageThreeOpen;
user.data.stageFourOpen_s = stageFourOpen;
user.data.stageFiveOpen_s = stageFiveOpen;
user.data.stageSixOpen_s = stageSixOpen;
user.flush();
gotoAndStop ("stageSelect");
}
}
if (weapon < 0) {
weapon = 0;
}
if (weapon > 5) {
weapon = 5;
}
if (player._y > 500) {
playerHealth = 0;
}
if (player._x > 3000) {
atBoss = true;
if (showWarning) {
_root.attachMovie("bossWarning", "bossWarning", _root.getNextHighestDepth());
showWarning = false;
}
}
if (player._xscale == 100) {
myRadiansA = Math.atan2(_root._ymouse - arm_mc._y, _root._xmouse - arm_mc._x);
myDegreesA = Math.round((myRadiansA * 180) / Math.PI);
arm_mc._rotation = myDegreesA;
arm_mc._xscale = 100;
}
if (player._xscale == -100) {
myRadiansA = Math.atan2(_root._ymouse - arm_mc._y, _root._xmouse - arm_mc._x);
myDegreesA = Math.round((myRadiansA * 180) / Math.PI) - 180;
arm_mc._rotation = myDegreesA;
arm_mc._xscale = -100;
}
stageComplete._x = cam._x;
stageComplete._y = cam._y;
stageComplete._xscale = cam.lens._xscale;
stageComplete._yscale = cam.lens._yscale;
arm_mc._x = player._x;
arm_mc._y = player._y - 3;
hud.cnn.text = numberOfCoins;
trans.swapDepths(_root.getNextHighestDepth());
};
Frame 19
player.removeMovieClip();
stopAllSounds();
cam._xscale = 100;
cam._yscale = 100;
cam._x = that._x;
cam._y = that._y;
stop();
Instance of Symbol 562 MovieClip in Frame 19
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
getURL ("http://www.longanimalsgames.com/?referral=stargunheroes&refmode=moregames", "_blank");
}
Instance of Symbol 619 MovieClip in Frame 19
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
_root.nextFrame();
}
Instance of Symbol 622 MovieClip in Frame 19
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
_root.gotoAndStop("title");
}
Frame 20
function clearAll() {
Mouse.show();
stopAllSounds();
hud.removeMovieClip();
place.removeMovieClip();
bossWarning.removeMovieClip();
crosshair.removeMovieClip();
arm_mc.removeMovieClip();
i = diamonds.length - 1;
while (i >= 0) {
diamonds[i].removeMovieClip();
diamonds.splice(i, 1);
i--;
}
i = coin.length - 1;
while (i >= 0) {
coin[i].removeMovieClip();
coin.splice(i, 1);
i--;
}
i = boxes.length - 1;
while (i >= 0) {
boxes[i].removeMovieClip();
boxes.splice(i, 1);
i--;
}
i = enemy.length - 1;
while (i >= 0) {
enemy[i].removeMovieClip();
enemy.splice(i, 1);
i--;
}
i = enemyType.length - 1;
while (i >= 0) {
enemyType.splice(i, 1);
i--;
}
i = enemyHealth.length - 1;
while (i >= 0) {
enemyHealth.splice(i, 1);
i--;
}
i = selfDestruct.length - 1;
while (i >= 0) {
selfDestruct.splice(i, 1);
i--;
}
i = enemyHit.length - 1;
while (i >= 0) {
enemyHit.splice(i, 1);
i--;
}
i = enemyHitTimer.length - 1;
while (i >= 0) {
enemyHitTimer.splice(i, 1);
i--;
}
i = enemyShotClock.length - 1;
while (i >= 0) {
enemyShotClock.splice(i, 1);
i--;
}
i = bullets.length - 1;
while (i >= 0) {
bullets[i].removeMovieClip();
bullets.splice(i, 1);
i--;
}
i = enemyShot.length - 1;
while (i >= 0) {
enemyShot[i].removeMovieClip();
enemyShot.splice(i, 1);
i--;
}
i = bomb.length - 1;
while (i >= 0) {
bomb[i].removeMovieClip();
bomb.splice(i, 1);
i--;
}
}
stop();
shotsnd = new Sound();
shotsnd.attachSound("reflect");
_root.attachMovie("hud", "hud", _root.getNextHighestDepth());
if (playerSelect == 5) {
hitBoost = 3;
maxaccel = 5;
maxjump = 3;
playerStrength = 10;
hud.faces.gotoAndStop(5);
_root.attachMovie("arm_mc", "arm_mc", _root.getNextHighestDepth());
arm_mc.gotoAndStop(5);
_root.attachMovie("hiddenGuy", "player", _root.getNextHighestDepth(), {_x:startPoint._x, _y:startPoint._y});
}
if (playerSelect == 1) {
hitBoost = 0;
maxaccel = 3;
maxjump = 3;
playerStrength = 10;
_root.attachMovie("arm_mc", "arm_mc", _root.getNextHighestDepth());
arm_mc.gotoAndStop(1);
_root.attachMovie("player", "player", _root.getNextHighestDepth(), {_x:startPoint._x, _y:startPoint._y});
}
if (playerSelect == 2) {
hitBoost = 0;
maxaccel = 5;
maxjump = 5;
playerStrength = 8;
hud.faces.gotoAndStop(2);
_root.attachMovie("arm_mc", "arm_mc", _root.getNextHighestDepth());
arm_mc.gotoAndStop(2);
_root.attachMovie("playerTwo", "player", _root.getNextHighestDepth(), {_x:startPoint._x, _y:startPoint._y});
}
if (playerSelect == 3) {
hitBoost = 1.5;
maxaccel = 3.5;
maxjump = 3;
playerStrength = 5;
hud.faces.gotoAndStop(3);
_root.attachMovie("arm_mc", "arm_mc", _root.getNextHighestDepth());
arm_mc.gotoAndStop(3);
_root.attachMovie("playerThree", "player", _root.getNextHighestDepth(), {_x:startPoint._x, _y:startPoint._y});
}
if (playerSelect == 4) {
hitBoost = 2;
maxaccel = 5;
maxjump = 3;
playerStrength = 10;
hud.faces.gotoAndStop(4);
_root.attachMovie("arm_mc", "arm_mc", _root.getNextHighestDepth());
arm_mc.gotoAndStop(4);
_root.attachMovie("playerFour", "player", _root.getNextHighestDepth(), {_x:startPoint._x, _y:startPoint._y});
}
_root.attachMovie("crosshair", "crosshair", _root.getNextHighestDepth());
_root.attachMovie("place", "place", _root.getNextHighestDepth());
atBoss = false;
bossDead = false;
moveOnTimer = 0;
arm_mc.spark._alpha = 0;
place._alpha = 0;
crosshair._xscale = 50;
crosshair._yscale = 50;
Mouse.hide();
cam._xscale = 100;
cam._yscale = 100;
showWarning = true;
transTimer = 0;
randomNumber = 0;
running = false;
gravity = 0;
gravityaccel = 0.2;
xaccel = 0;
runaccelamt = 0.3;
friction = 0.5;
airrisist = 0.05;
doubleJump = false;
doubleJumping = false;
jump = true;
pressOnce = 0;
playerDamaged = 0;
playerDamagedTimer = 0;
cam.lens._xscale = 50;
cam.lens._yscale = 50;
damaged = false;
inControl = true;
fireRate = 300;
shotPower = 1;
shootingTimer = 0;
shooting = false;
addEnemyTimer = 0;
choice = 0;
playerHealth = 100;
var diamonds = new Array();
diamonds.push(d1, d2, d3);
var coin = new Array();
var boxes = new Array();
boxes.push(box1, box2, box3, box4, box5, box6, box7, box8, box9, box10, box11);
var enemy = new Array();
enemy.push(enemy1, enemy2, enemy3, enemy4, enemy5, enemy6, enemy7, flame1, flame2, flame3, flame4, flame5, flame6, boss);
var enemyType = new Array();
enemyType.push("static_left", "static_left", "static_left", "static_left", "static_left", "static_left", "static_left", "flame_gun", "flame_gun", "flame_gun", "flame_gun", "flame_gun", "flame_gun", "boss_mc");
var enemyHealth = new Array();
enemyHealth.push(10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 100);
var selfDestruct = new Array();
selfDestruct.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var enemyHit = new Array();
enemyHit.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var enemyHitTimer = new Array();
enemyHitTimer.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var enemyShotClock = new Array();
enemyShotClock.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var bullets = new Array();
var enemyShot = new Array();
var bomb = new Array();
onMouseDown = function () {
if ((!damaged) && (inControl)) {
shooting = true;
}
};
onMouseUp = function () {
shooting = false;
};
player.onEnterFrame = function () {
if (playerDamaged == 0) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
if (playerDamaged == 1) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:200, gb:200, bb:200};
myColor.setTransform(myColorTransform);
playerDamagedTimer++;
if (playerDamagedTimer == 1) {
weapon--;
playerDamaged = 0;
playerDamagedTimer = 0;
}
}
if (player._x < 3000) {
if ((addEnemyTimer + 3000) < getTimer()) {
addEnemyTimer = getTimer();
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
randomNumber++;
metalBee_mc = _root.attachMovie("metalBee", "metalBee" + randomNumber, _root.getNextHighestDepth(), {_x:cam._x - 800, _y:player._y - 60});
metalBee_mc._xscale = -100;
enemy.push(metalBee_mc);
enemyType.push("metal_bee");
enemyHealth.push(1);
selfDestruct.push(500);
enemyHitTimer.push(0);
enemyHit.push(0);
enemyShotClock.push(0);
}
if (choice == 1) {
randomNumber++;
metalBee_mc = _root.attachMovie("metalBee", "metalBee" + randomNumber, _root.getNextHighestDepth(), {_x:cam._x + 800, _y:player._y - 60});
enemy.push(metalBee_mc);
enemyType.push("metal_bee");
enemyHealth.push(1);
selfDestruct.push(500);
enemyHitTimer.push(0);
enemyHit.push(0);
enemyShotClock.push(0);
}
}
}
if (!shooting) {
arm_mc.spark._alpha = 0;
}
myRadians = Math.atan2(_root._ymouse - place._y, _root._xmouse - place._x);
myDegrees = Math.round((myRadians * 180) / Math.PI);
place._rotation = myDegrees;
if (shooting) {
if (weapon == 0) {
fireRate = 300;
shotPower = 1;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
if (weapon == 1) {
fireRate = 500;
shotPower = 1;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
randomNumber++;
bullet_mc = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullets.push(bullet_mc);
angle = place._rotation - 6;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
randomNumber++;
bullet_mc = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullets.push(bullet_mc);
angle = place._rotation + 6;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
if (weapon == 2) {
shotPower = 1.5;
fireRate = 200;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("laser", "laser" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
if (weapon == 3) {
shotPower = 2;
fireRate = 200;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("laser", "laser" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._yscale = 200;
bullet_mc._xscale = 600;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
if (weapon == 4) {
shotPower = 2.5;
fireRate = 200;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("largeBullet", "largeBullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
if (weapon == 5) {
shotPower = 2.5;
fireRate = 100;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("largeBullet", "largeBullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._yscale = 50;
bullet_mc._xscale = 50;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
randomNumber++;
bullet_mc = _root.attachMovie("largeBullet", "largeBullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._yscale = 50;
bullet_mc._xscale = 50;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation + 15;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
randomNumber++;
bullet_mc = _root.attachMovie("largeBullet", "largeBullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._yscale = 50;
bullet_mc._xscale = 50;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation - 15;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
}
if (player.hitTest(beamer_mc.beam)) {
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - 1;
playerDamaged = 1;
}
i = enemy.length - 1;
while (i >= 0) {
if (enemyType[i] == "boss_mc") {
if (enemy[i].hitBox.hitTest(player.hit)) {
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - 0.1;
playerDamaged = 1;
}
if (atBoss) {
enemyShotClock[i]++;
if (enemyShotClock[i] < 60) {
enemy[i].gotoAndStop("warning");
}
if (enemyShotClock[i] > 60) {
selfDestruct[i]++;
if (selfDestruct[i] == 40) {
selfDestruct[i] = 0;
randomNumber++;
beamer_mc = _root.attachMovie("bossAttack", "bossAttack" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
enemy[i].gotoAndStop("shooting");
}
if (enemyShotClock[i] > 150) {
enemyShotClock[i] = 0;
selfDestruct[i] = 0;
}
}
}
if (enemyType[i] == "flame_gun") {
if (enemy[i].hitBox.hitTest(player.hit)) {
enemyHealth[i] = 0;
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
}
if (player.hitTest(enemy[i].area)) {
enemyShotClock[i]++;
if (enemyShotClock[i] == 3) {
enemyShotClock[i] = 0;
randomNumber++;
enemyBullet_mc = _root.attachMovie("flameBullet", "flameBullet" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x - 10, _y:enemy[i]._y - 30});
enemyShot.push(enemyBullet_mc);
enemyBullet_mc.onEnterFrame = function () {
this._xscale = this._xscale + 5;
this._yscale = this._yscale + 5;
this._y = this._y - 5;
};
}
}
}
if (enemyType[i] == "static_left") {
if (enemy[i].hitBox.hitTest(player.hit)) {
enemyHealth[i] = 0;
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
}
if (player.hitTest(enemy[i].area)) {
enemyShotClock[i]++;
if (enemyShotClock[i] == 30) {
enemyShotClock[i] = 0;
randomNumber++;
enemyBullet_mc = _root.attachMovie("enemyBullet", "enemyBullet" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x - 15, _y:enemy[i]._y - 3});
enemyShot.push(enemyBullet_mc);
enemyBullet_mc.onEnterFrame = function () {
this._x = this._x - 5;
};
}
}
}
if ((enemyType[i] == "metal_bee") && (enemy[i]._xscale == -100)) {
if (enemy[i].hitBox.hitTest(player.hit)) {
enemyHealth[i] = 0;
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
}
if (enemy[i].marker.hitTest(player)) {
enemy[i].marker.gotoAndStop(2);
randomNumber++;
bombs_mc = _root.attachMovie("bombs", "bombs" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
bomb.push(bombs_mc);
}
selfDestruct[i]--;
enemy[i]._x = enemy[i]._x + 3;
if (selfDestruct[i] < 1) {
enemyHealth[i] = 0;
}
if (player._x > 3000) {
enemyHealth[i] = 0;
}
}
if ((enemyType[i] == "metal_bee") && (enemy[i]._xscale == 100)) {
if (enemy[i].hitBox.hitTest(player.hit)) {
enemyHealth[i] = 0;
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
}
if (enemy[i].marker.hitTest(player)) {
enemy[i].marker.gotoAndStop(2);
randomNumber++;
bombs_mc = _root.attachMovie("bombs", "bombs" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
bomb.push(bombs_mc);
}
selfDestruct[i]--;
enemy[i]._x = enemy[i]._x - 3;
if (selfDestruct[i] < 1) {
enemyHealth[i] = 0;
}
if (player._x > 3000) {
enemyHealth[i] = 0;
}
}
if (enemyHit[i] == 0) {
myColor = new Color(enemy[i]);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
if (enemyHit[i] == 1) {
myColor = new Color(enemy[i]);
myColorTransform = new Object();
myColorTransform = {rb:200, gb:200, bb:200};
myColor.setTransform(myColorTransform);
enemyHitTimer[i]++;
if (enemyHitTimer[i] == 3) {
enemyHitTimer[i] = 0;
enemyHit[i] = 0;
}
}
if (enemyHealth[i] < 1) {
if (enemyType[i] == "boss_mc") {
bossDead = true;
atBoss = false;
enemy[i].gotoAndStop(3);
_root.attachMovie("bossDeath4", "bossDeath4", _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
}
if ((enemyType[i] == "static_left") or (enemyType[i] == "flame_gun")) {
enemy[i].gotoAndStop(2);
}
randomNumber++;
_root.attachMovie("explosion", "explosion" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
enemy[i].removeMovieClip();
enemy.splice(i, 1);
enemyType.splice(i, 1);
enemyHealth.splice(i, 1);
selfDestruct.splice(i, 1);
enemyHitTimer.splice(i, 1);
enemyHit.splice(i, 1);
enemyShotClock.splice(i, 1);
}
i--;
}
i = bomb.length - 1;
while (i >= 0) {
if (bomb[i].hitTest(player.hit)) {
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
randomNumber++;
_root.attachMovie("explosion", "explosion" + randomNumber, _root.getNextHighestDepth(), {_x:bomb[i]._x, _y:bomb[i]._y});
bomb[i].removeMovieClip();
bomb.splice(i, 1);
}
bomb[i]._y = bomb[i]._y + 6;
if (ground.hitTest(bomb[i]._x, bomb[i]._y, true)) {
randomNumber++;
_root.attachMovie("explosion", "explosion" + randomNumber, _root.getNextHighestDepth(), {_x:bomb[i]._x, _y:bomb[i]._y});
bomb[i].removeMovieClip();
bomb.splice(i, 1);
}
i--;
}
i = enemyShot.length - 1;
while (i >= 0) {
if (enemyShot[i]._xscale > 200) {
enemyShot[i].removeMovieClip();
enemyShot.splice(i, 1);
}
if (enemyShot[i].hitTest(player.hit)) {
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:enemyShot[i]._x, _y:enemyShot[i]._y});
enemyShot[i].removeMovieClip();
enemyShot.splice(i, 1);
}
if (ground.hitTest(enemyShot[i]._x, enemyShot[i]._y, true)) {
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:enemyShot[i]._x, _y:enemyShot[i]._y});
enemyShot[i].removeMovieClip();
enemyShot.splice(i, 1);
}
i--;
}
i = coin.length - 1;
while (i >= 0) {
if (coin[i].hitTest(player)) {
numberOfCoins = numberOfCoins + 10;
randomNumber++;
_root.attachMovie("ping", "ping" + randomNumber, _root.getNextHighestDepth(), {_x:coin[i]._x, _y:coin[i]._y});
coin[i].removeMovieClip();
coin.splice(i, 1);
}
i--;
}
i = diamonds.length - 1;
while (i >= 0) {
if (diamonds[i].hitTest(player)) {
diamonds[i].gotoAndStop(2);
weapon++;
randomNumber++;
_root.attachMovie("ping", "ping" + randomNumber, _root.getNextHighestDepth(), {_x:diamonds[i]._x, _y:diamonds[i]._y});
diamonds[i].removeMovieClip();
diamonds.splice(i, 1);
}
i--;
}
i = bullets.length - 1;
while (i >= 0) {
if (playerSelect == 1) {
bullets[i].gotoAndStop(1);
}
if (playerSelect == 2) {
bullets[i].gotoAndStop(2);
}
if (playerSelect == 3) {
bullets[i].gotoAndStop(3);
}
if (playerSelect == 4) {
bullets[i].gotoAndStop(4);
}
l = boxes.length - 1;
while (l >= 0) {
if (bullets[i].hitTest(boxes[l])) {
boxes[l].gotoAndStop(2);
randomNumber++;
coins_mc = _root.attachMovie("coins", "coins" + randomNumber, _root.getNextHighestDepth(), {_x:boxes[l]._x, _y:boxes[l]._y});
coin.push(coins_mc);
randomNumber++;
_root.attachMovie("explosion", "explosion" + randomNumber, _root.getNextHighestDepth(), {_x:boxes[l]._x, _y:boxes[l]._y});
boxes[l].removeMovieClip();
boxes.splice(l, 1);
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:bullets[i]._x, _y:bullets[i]._y});
bullets[i].removeMovieClip();
bullets.splice(i, 1);
}
l--;
}
k = bomb.length - 1;
while (k >= 0) {
if (bullets[i].hitTest(bomb[k])) {
randomNumber++;
_root.attachMovie("explosion", "explosion" + randomNumber, _root.getNextHighestDepth(), {_x:bomb[k]._x, _y:bomb[k]._y});
bomb[k].removeMovieClip();
bomb.splice(k, 1);
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:bullets[i]._x, _y:bullets[i]._y});
bullets[i].removeMovieClip();
bullets.splice(i, 1);
}
k--;
}
j = enemy.length - 1;
while (j >= 0) {
if (bullets[i].hitTest(enemy[j].hitBox)) {
enemyHit[j] = 1;
enemyHealth[j] = enemyHealth[j] - (shotPower + hitBoost);
if (enemyType[j] == "boss_mc") {
if (player._x < 3000) {
enemyHealth[j] = enemyHealth[j] + (shotPower + hitBoost);
}
}
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:bullets[i]._x, _y:bullets[i]._y});
bullets[i].removeMovieClip();
bullets.splice(i, 1);
}
j--;
}
if (ground.hitTest(bullets[i]._x, bullets[i]._y, true)) {
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:bullets[i]._x, _y:bullets[i]._y});
bullets[i].removeMovieClip();
bullets.splice(i, 1);
}
i--;
}
if ((ground.hitTest(player._x, player._y + 11, true) && (jump)) && (!doubleJumping)) {
arm_mc._alpha = 100;
if (running) {
player.gotoAndStop("run");
} else {
player.gotoAndStop("idle");
}
} else {
player.gotoAndStop("jump");
arm_mc._alpha = 0;
}
if (Key.isDown(68) or Key.isDown(65)) {
running = true;
} else {
running = false;
}
if (!ground.hitTest(player._x, player._y + 10, true)) {
falling = true;
grounded = false;
}
if (ground.hitTest(player._x, player._y + 11, true)) {
doubleJumping = false;
doubleJump = false;
jump = true;
grounded = true;
falling = false;
while (ground.hitTest(player._x, player._y + 9, true)) {
player._y--;
}
}
if (falling == true) {
gravity = gravity + gravityaccel;
} else {
gravity = 0;
}
if (((inControl && (Key.isDown(68))) && (xaccel < maxaccel)) && (falling == true)) {
xaccel = xaccel + (runaccelamt - airrisist);
} else if (((inControl && (Key.isDown(65))) && (xaccel > (-maxaccel))) && (falling == true)) {
xaccel = xaccel - (runaccelamt - airrisist);
} else if (((inControl && (Key.isDown(65))) && (xaccel > (-maxaccel))) && (falling == false)) {
xaccel = xaccel - runaccelamt;
} else if (((inControl && (Key.isDown(68))) && (xaccel < maxaccel)) && (falling == false)) {
xaccel = xaccel + runaccelamt;
} else if (grounded == true) {
if (xaccel > 0) {
xaccel = xaccel - friction;
}
if (xaccel < 0) {
xaccel = xaccel + friction;
}
if ((xaccel < 0) && (xaccel > friction)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < friction)) {
xaccel = 0;
}
} else {
if (xaccel > 0) {
xaccel = xaccel - airrisist;
}
if (xaccel < 0) {
xaccel = xaccel + airrisist;
}
if ((xaccel < 0) && (xaccel > airrisist)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < airrisist)) {
xaccel = 0;
}
}
if (_root.ground.hitTest(this._x, this._y - 11, true)) {
gravity = 1;
while (_root.ground.hitTest(this._x, this._y - 10, true)) {
this._y++;
}
}
if (_xmouse > player._x) {
player._xscale = 100;
}
if (_xmouse < player._x) {
player._xscale = -100;
}
if (!Key.isDown(87)) {
pressOnce = 0;
}
if ((inControl && (Key.isDown(87))) && (jump == true)) {
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
if (playerSelect == 2) {
_root.attachMovie("dust", "dust", _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
jump = false;
doubleJump = true;
pressOnce = 1;
}
if (((inControl && (Key.isDown(87))) && (doubleJump == true)) && (pressOnce == 0)) {
gravity = 0;
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
doubleJump = false;
doubleJumping = true;
}
leftx = player._x + (Math.cos(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
lefty = player._y - (Math.sin(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
rightx = player._x + (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * 7);
righty = player._y - (Math.sin(3.141593 * ((player._rotation * -1) / 180)) * 7);
if (ground.hitTest(leftx, lefty, true)) {
xaccel = 0;
player._x++;
}
if (ground.hitTest(rightx, righty, true)) {
xaccel = 0;
player._x--;
}
if (cam._y > 310) {
cam._y = 310;
}
if (cam._x > 3529) {
cam._x = 3529;
}
if (cam._x < 320) {
cam._x = 320;
}
crosshair._x = _xmouse;
crosshair._y = _ymouse;
bg._x = cam._x;
bg._y = cam._y;
place._x = player._x;
place._y = player._y;
endX = player._x;
cam._x = cam._x + ((endX - cam._x) / 20);
endY = player._y;
cam._y = cam._y + ((endY - cam._y) / 20);
cam.camControl();
hud._x = cam._x;
hud._y = cam._y;
hud._xscale = cam.lens._xscale;
hud._yscale = cam.lens._yscale;
bossWarning._x = cam._x;
bossWarning._y = cam._y;
bossWarning._xscale = cam.lens._xscale;
bossWarning._yscale = cam.lens._yscale;
player._y = player._y + gravity;
player._x = player._x + xaccel;
hud.healthBar._xscale = playerHealth;
if (playerHealth > 100) {
playerHealth = 100;
}
if (playerHealth < 1) {
shooting = false;
playerHealth = 0;
inControl = false;
player._alpha = 0;
arm_mc._alpha = 0;
if (transTimer == 0) {
_root.attachMovie("bubbs", "bubbs", _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
_root.attachMovie("trans", "trans", _root.getNextHighestDepth(), {_x:cam._x, _y:cam._y});
}
transTimer++;
if (transTimer > 79) {
clearAll();
prevFrame();
}
}
if (bossDead) {
moveOnTimer++;
if (moveOnTimer == 89) {
_root.attachMovie("stageComplete", "stageComplete", _root.getNextHighestDepth(), {_x:cam._x, _y:cam._y});
}
if (moveOnTimer == 110) {
_root.attachMovie("trans", "trans", _root.getNextHighestDepth(), {_x:cam._x, _y:cam._y});
}
if (moveOnTimer == 189) {
clearAll();
stageFourComplete = true;
user.data.numberOfCoins_s = numberOfCoins;
user.data.weapon_s = weapon;
user.data.twoLocked_s = twoLocked;
user.data.threeLocked_s = threeLocked;
user.data.fourLocked_s = fourLocked;
user.data.stageOneComplete_s = stageOneComplete;
user.data.stageTwoComplete_s = stageTwoComplete;
user.data.stageThreeComplete_s = stageThreeComplete;
user.data.stageFourComplete_s = stageFourComplete;
user.data.stageFiveComplete_s = stageFiveComplete;
user.data.stageSixComplete_s = stageSixComplete;
user.data.stageTwoOpen_s = stageTwoOpen;
user.data.stageThreeOpen_s = stageThreeOpen;
user.data.stageFourOpen_s = stageFourOpen;
user.data.stageFiveOpen_s = stageFiveOpen;
user.data.stageSixOpen_s = stageSixOpen;
user.flush();
gotoAndStop ("stageSelect");
}
}
if (weapon < 0) {
weapon = 0;
}
if (weapon > 5) {
weapon = 5;
}
if (player._y > 420) {
playerHealth = 0;
}
if (player._x > 3000) {
atBoss = true;
if (showWarning) {
_root.attachMovie("bossWarning", "bossWarning", _root.getNextHighestDepth());
showWarning = false;
}
}
if (player._xscale == 100) {
myRadiansA = Math.atan2(_root._ymouse - arm_mc._y, _root._xmouse - arm_mc._x);
myDegreesA = Math.round((myRadiansA * 180) / Math.PI);
arm_mc._rotation = myDegreesA;
arm_mc._xscale = 100;
}
if (player._xscale == -100) {
myRadiansA = Math.atan2(_root._ymouse - arm_mc._y, _root._xmouse - arm_mc._x);
myDegreesA = Math.round((myRadiansA * 180) / Math.PI) - 180;
arm_mc._rotation = myDegreesA;
arm_mc._xscale = -100;
}
stageComplete._x = cam._x;
stageComplete._y = cam._y;
stageComplete._xscale = cam.lens._xscale;
stageComplete._yscale = cam.lens._yscale;
arm_mc._x = player._x;
arm_mc._y = player._y - 3;
hud.cnn.text = numberOfCoins;
trans.swapDepths(_root.getNextHighestDepth());
};
Frame 21
player.removeMovieClip();
stopAllSounds();
cam._xscale = 100;
cam._yscale = 100;
cam._x = that._x;
cam._y = that._y;
stop();
Instance of Symbol 562 MovieClip in Frame 21
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
getURL ("http://www.longanimalsgames.com/?referral=stargunheroes&refmode=moregames", "_blank");
}
Instance of Symbol 619 MovieClip in Frame 21
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
_root.nextFrame();
}
Instance of Symbol 622 MovieClip in Frame 21
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
_root.gotoAndStop("title");
}
Frame 22
function clearAll() {
Mouse.show();
stopAllSounds();
hud.removeMovieClip();
place.removeMovieClip();
bossWarning.removeMovieClip();
crosshair.removeMovieClip();
arm_mc.removeMovieClip();
i = diamonds.length - 1;
while (i >= 0) {
diamonds[i].removeMovieClip();
diamonds.splice(i, 1);
i--;
}
i = coin.length - 1;
while (i >= 0) {
coin[i].removeMovieClip();
coin.splice(i, 1);
i--;
}
i = boxes.length - 1;
while (i >= 0) {
boxes[i].removeMovieClip();
boxes.splice(i, 1);
i--;
}
i = enemy.length - 1;
while (i >= 0) {
enemy[i].removeMovieClip();
enemy.splice(i, 1);
i--;
}
i = enemyType.length - 1;
while (i >= 0) {
enemyType.splice(i, 1);
i--;
}
i = enemyHealth.length - 1;
while (i >= 0) {
enemyHealth.splice(i, 1);
i--;
}
i = selfDestruct.length - 1;
while (i >= 0) {
selfDestruct.splice(i, 1);
i--;
}
i = enemyHit.length - 1;
while (i >= 0) {
enemyHit.splice(i, 1);
i--;
}
i = enemyHitTimer.length - 1;
while (i >= 0) {
enemyHitTimer.splice(i, 1);
i--;
}
i = enemyShotClock.length - 1;
while (i >= 0) {
enemyShotClock.splice(i, 1);
i--;
}
i = bullets.length - 1;
while (i >= 0) {
bullets[i].removeMovieClip();
bullets.splice(i, 1);
i--;
}
i = enemyShot.length - 1;
while (i >= 0) {
enemyShot[i].removeMovieClip();
enemyShot.splice(i, 1);
i--;
}
i = bomb.length - 1;
while (i >= 0) {
bomb[i].removeMovieClip();
bomb.splice(i, 1);
i--;
}
}
stop();
shotsnd = new Sound();
shotsnd.attachSound("reflect");
_root.attachMovie("hud", "hud", _root.getNextHighestDepth());
if (playerSelect == 5) {
hitBoost = 3;
maxaccel = 5;
maxjump = 3;
playerStrength = 10;
hud.faces.gotoAndStop(5);
_root.attachMovie("arm_mc", "arm_mc", _root.getNextHighestDepth());
arm_mc.gotoAndStop(5);
_root.attachMovie("hiddenGuy", "player", _root.getNextHighestDepth(), {_x:startPoint._x, _y:startPoint._y});
}
if (playerSelect == 1) {
hitBoost = 0;
maxaccel = 3;
maxjump = 3;
playerStrength = 10;
_root.attachMovie("arm_mc", "arm_mc", _root.getNextHighestDepth());
arm_mc.gotoAndStop(1);
_root.attachMovie("player", "player", _root.getNextHighestDepth(), {_x:startPoint._x, _y:startPoint._y});
}
if (playerSelect == 2) {
hitBoost = 0;
maxaccel = 5;
maxjump = 5;
playerStrength = 8;
hud.faces.gotoAndStop(2);
_root.attachMovie("arm_mc", "arm_mc", _root.getNextHighestDepth());
arm_mc.gotoAndStop(2);
_root.attachMovie("playerTwo", "player", _root.getNextHighestDepth(), {_x:startPoint._x, _y:startPoint._y});
}
if (playerSelect == 3) {
hitBoost = 1.5;
maxaccel = 3.5;
maxjump = 3;
playerStrength = 5;
hud.faces.gotoAndStop(3);
_root.attachMovie("arm_mc", "arm_mc", _root.getNextHighestDepth());
arm_mc.gotoAndStop(3);
_root.attachMovie("playerThree", "player", _root.getNextHighestDepth(), {_x:startPoint._x, _y:startPoint._y});
}
if (playerSelect == 4) {
hitBoost = 2;
maxaccel = 5;
maxjump = 3;
playerStrength = 10;
hud.faces.gotoAndStop(4);
_root.attachMovie("arm_mc", "arm_mc", _root.getNextHighestDepth());
arm_mc.gotoAndStop(4);
_root.attachMovie("playerFour", "player", _root.getNextHighestDepth(), {_x:startPoint._x, _y:startPoint._y});
}
_root.attachMovie("crosshair", "crosshair", _root.getNextHighestDepth());
_root.attachMovie("place", "place", _root.getNextHighestDepth());
atBoss = false;
bossDead = false;
moveOnTimer = 0;
arm_mc.spark._alpha = 0;
place._alpha = 0;
crosshair._xscale = 50;
crosshair._yscale = 50;
Mouse.hide();
cam._xscale = 100;
cam._yscale = 100;
showWarning = true;
transTimer = 0;
randomNumber = 0;
running = false;
gravity = 0;
gravityaccel = 0.2;
xaccel = 0;
runaccelamt = 0.3;
friction = 0.5;
airrisist = 0.05;
doubleJump = false;
doubleJumping = false;
jump = true;
pressOnce = 0;
playerDamaged = 0;
playerDamagedTimer = 0;
cam.lens._xscale = 50;
cam.lens._yscale = 50;
damaged = false;
inControl = true;
fireRate = 300;
shotPower = 1;
shootingTimer = 0;
shooting = false;
addEnemyTimer = 0;
choice = 0;
playerHealth = 100;
var diamonds = new Array();
diamonds.push(d1, d2, d3);
var coin = new Array();
var boxes = new Array();
boxes.push(box1, box2, box3, box4, box5, box6, box7, box8, box9, box10, box11);
var enemy = new Array();
enemy.push(enemy1, enemy2, enemy3, enemy4, enemy5, enemy6, enemy7, flame1, flame2, flame3, flame4, flame5, flame6);
var enemyType = new Array();
enemyType.push("static_left", "static_left", "static_left", "static_left", "static_left", "static_left", "static_left", "flame_gun", "flame_gun", "flame_gun", "flame_gun", "flame_gun", "flame_gun");
var enemyHealth = new Array();
enemyHealth.push(20, 20, 20, 20, 20, 20, 30, 30, 30, 40, 40, 40, 40);
var selfDestruct = new Array();
selfDestruct.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var enemyHit = new Array();
enemyHit.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var enemyHitTimer = new Array();
enemyHitTimer.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var enemyShotClock = new Array();
enemyShotClock.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var bullets = new Array();
var enemyShot = new Array();
var bomb = new Array();
onMouseDown = function () {
if ((!damaged) && (inControl)) {
shooting = true;
}
};
onMouseUp = function () {
shooting = false;
};
player.onEnterFrame = function () {
if (playerDamaged == 0) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
if (playerDamaged == 1) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:200, gb:200, bb:200};
myColor.setTransform(myColorTransform);
playerDamagedTimer++;
if (playerDamagedTimer == 1) {
weapon--;
playerDamaged = 0;
playerDamagedTimer = 0;
}
}
if (player._x < 3000) {
if ((addEnemyTimer + 1500) < getTimer()) {
addEnemyTimer = getTimer();
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
randomNumber++;
metalBee_mc = _root.attachMovie("metalBee", "metalBee" + randomNumber, _root.getNextHighestDepth(), {_x:cam._x - 800, _y:player._y - 60});
metalBee_mc._xscale = -100;
enemy.push(metalBee_mc);
enemyType.push("metal_bee");
enemyHealth.push(5);
selfDestruct.push(500);
enemyHitTimer.push(0);
enemyHit.push(0);
enemyShotClock.push(0);
}
if (choice == 1) {
randomNumber++;
metalBee_mc = _root.attachMovie("metalBee", "metalBee" + randomNumber, _root.getNextHighestDepth(), {_x:cam._x + 800, _y:player._y - 60});
enemy.push(metalBee_mc);
enemyType.push("metal_bee");
enemyHealth.push(5);
selfDestruct.push(500);
enemyHitTimer.push(0);
enemyHit.push(0);
enemyShotClock.push(0);
}
}
}
if (!shooting) {
arm_mc.spark._alpha = 0;
}
myRadians = Math.atan2(_root._ymouse - place._y, _root._xmouse - place._x);
myDegrees = Math.round((myRadians * 180) / Math.PI);
place._rotation = myDegrees;
if (shooting) {
if (weapon == 0) {
fireRate = 300;
shotPower = 1;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
if (weapon == 1) {
fireRate = 500;
shotPower = 1;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
randomNumber++;
bullet_mc = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullets.push(bullet_mc);
angle = place._rotation - 6;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
randomNumber++;
bullet_mc = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullets.push(bullet_mc);
angle = place._rotation + 6;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
if (weapon == 2) {
shotPower = 1.5;
fireRate = 200;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("laser", "laser" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
if (weapon == 3) {
shotPower = 2;
fireRate = 200;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("laser", "laser" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._yscale = 200;
bullet_mc._xscale = 600;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
if (weapon == 4) {
shotPower = 2.5;
fireRate = 200;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("largeBullet", "largeBullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
if (weapon == 5) {
shotPower = 2.5;
fireRate = 100;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("largeBullet", "largeBullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._yscale = 50;
bullet_mc._xscale = 50;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
randomNumber++;
bullet_mc = _root.attachMovie("largeBullet", "largeBullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._yscale = 50;
bullet_mc._xscale = 50;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation + 15;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
randomNumber++;
bullet_mc = _root.attachMovie("largeBullet", "largeBullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._yscale = 50;
bullet_mc._xscale = 50;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation - 15;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
}
if (player.hitTest(beamer_mc.beam)) {
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - 1;
playerDamaged = 1;
}
i = enemy.length - 1;
while (i >= 0) {
if (enemyType[i] == "flame_gun") {
if (enemy[i].hitBox.hitTest(player.hit)) {
enemyHealth[i] = 0;
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
}
if (player.hitTest(enemy[i].area)) {
enemyShotClock[i]++;
if (enemyShotClock[i] == 3) {
enemyShotClock[i] = 0;
randomNumber++;
enemyBullet_mc = _root.attachMovie("flameBullet", "flameBullet" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x - 10, _y:enemy[i]._y - 30});
enemyShot.push(enemyBullet_mc);
enemyBullet_mc.onEnterFrame = function () {
this._xscale = this._xscale + 5;
this._yscale = this._yscale + 5;
this._y = this._y - 5;
};
}
}
}
if (enemyType[i] == "static_left") {
if (enemy[i].hitBox.hitTest(player.hit)) {
enemyHealth[i] = 0;
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
}
if (player.hitTest(enemy[i].area)) {
enemyShotClock[i]++;
if (enemyShotClock[i] == 30) {
enemyShotClock[i] = 0;
randomNumber++;
enemyBullet_mc = _root.attachMovie("enemyBullet", "enemyBullet" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x - 15, _y:enemy[i]._y - 3});
enemyShot.push(enemyBullet_mc);
enemyBullet_mc.onEnterFrame = function () {
this._x = this._x - 5;
};
}
}
}
if ((enemyType[i] == "metal_bee") && (enemy[i]._xscale == -100)) {
if (enemy[i].hitBox.hitTest(player.hit)) {
enemyHealth[i] = 0;
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
}
if (enemy[i].marker.hitTest(player)) {
enemy[i].marker.gotoAndStop(2);
randomNumber++;
bombs_mc = _root.attachMovie("bombs", "bombs" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
bomb.push(bombs_mc);
}
selfDestruct[i]--;
enemy[i]._x = enemy[i]._x + 3;
if (selfDestruct[i] < 1) {
enemyHealth[i] = 0;
}
if (player._x > 3000) {
enemyHealth[i] = 0;
}
}
if ((enemyType[i] == "metal_bee") && (enemy[i]._xscale == 100)) {
if (enemy[i].hitBox.hitTest(player.hit)) {
enemyHealth[i] = 0;
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
}
if (enemy[i].marker.hitTest(player)) {
enemy[i].marker.gotoAndStop(2);
randomNumber++;
bombs_mc = _root.attachMovie("bombs", "bombs" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
bomb.push(bombs_mc);
}
selfDestruct[i]--;
enemy[i]._x = enemy[i]._x - 3;
if (selfDestruct[i] < 1) {
enemyHealth[i] = 0;
}
if (player._x > 3000) {
enemyHealth[i] = 0;
}
}
if (enemyHit[i] == 0) {
myColor = new Color(enemy[i]);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
if (enemyHit[i] == 1) {
myColor = new Color(enemy[i]);
myColorTransform = new Object();
myColorTransform = {rb:200, gb:200, bb:200};
myColor.setTransform(myColorTransform);
enemyHitTimer[i]++;
if (enemyHitTimer[i] == 3) {
enemyHitTimer[i] = 0;
enemyHit[i] = 0;
}
}
if (enemyHealth[i] < 1) {
if ((enemyType[i] == "static_left") or (enemyType[i] == "flame_gun")) {
enemy[i].gotoAndStop(2);
}
randomNumber++;
_root.attachMovie("explosion", "explosion" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
enemy[i].removeMovieClip();
enemy.splice(i, 1);
enemyType.splice(i, 1);
enemyHealth.splice(i, 1);
selfDestruct.splice(i, 1);
enemyHitTimer.splice(i, 1);
enemyHit.splice(i, 1);
enemyShotClock.splice(i, 1);
}
i--;
}
i = bomb.length - 1;
while (i >= 0) {
if (bomb[i].hitTest(player.hit)) {
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
randomNumber++;
_root.attachMovie("explosion", "explosion" + randomNumber, _root.getNextHighestDepth(), {_x:bomb[i]._x, _y:bomb[i]._y});
bomb[i].removeMovieClip();
bomb.splice(i, 1);
}
bomb[i]._y = bomb[i]._y + 6;
if (ground.hitTest(bomb[i]._x, bomb[i]._y, true)) {
randomNumber++;
_root.attachMovie("explosion", "explosion" + randomNumber, _root.getNextHighestDepth(), {_x:bomb[i]._x, _y:bomb[i]._y});
bomb[i].removeMovieClip();
bomb.splice(i, 1);
}
i--;
}
i = enemyShot.length - 1;
while (i >= 0) {
if (enemyShot[i]._xscale > 200) {
enemyShot[i].removeMovieClip();
enemyShot.splice(i, 1);
}
if (enemyShot[i].hitTest(player.hit)) {
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:enemyShot[i]._x, _y:enemyShot[i]._y});
enemyShot[i].removeMovieClip();
enemyShot.splice(i, 1);
}
if (ground.hitTest(enemyShot[i]._x, enemyShot[i]._y, true)) {
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:enemyShot[i]._x, _y:enemyShot[i]._y});
enemyShot[i].removeMovieClip();
enemyShot.splice(i, 1);
}
i--;
}
i = coin.length - 1;
while (i >= 0) {
if (coin[i].hitTest(player)) {
numberOfCoins = numberOfCoins + 10;
randomNumber++;
_root.attachMovie("ping", "ping" + randomNumber, _root.getNextHighestDepth(), {_x:coin[i]._x, _y:coin[i]._y});
coin[i].removeMovieClip();
coin.splice(i, 1);
}
i--;
}
i = diamonds.length - 1;
while (i >= 0) {
if (diamonds[i].hitTest(player)) {
diamonds[i].gotoAndStop(2);
weapon++;
randomNumber++;
_root.attachMovie("ping", "ping" + randomNumber, _root.getNextHighestDepth(), {_x:diamonds[i]._x, _y:diamonds[i]._y});
diamonds[i].removeMovieClip();
diamonds.splice(i, 1);
}
i--;
}
i = bullets.length - 1;
while (i >= 0) {
if (playerSelect == 1) {
bullets[i].gotoAndStop(1);
}
if (playerSelect == 2) {
bullets[i].gotoAndStop(2);
}
if (playerSelect == 3) {
bullets[i].gotoAndStop(3);
}
if (playerSelect == 4) {
bullets[i].gotoAndStop(4);
}
l = boxes.length - 1;
while (l >= 0) {
if (bullets[i].hitTest(boxes[l])) {
boxes[l].gotoAndStop(2);
randomNumber++;
coins_mc = _root.attachMovie("coins", "coins" + randomNumber, _root.getNextHighestDepth(), {_x:boxes[l]._x, _y:boxes[l]._y});
coin.push(coins_mc);
randomNumber++;
_root.attachMovie("explosion", "explosion" + randomNumber, _root.getNextHighestDepth(), {_x:boxes[l]._x, _y:boxes[l]._y});
boxes[l].removeMovieClip();
boxes.splice(l, 1);
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:bullets[i]._x, _y:bullets[i]._y});
bullets[i].removeMovieClip();
bullets.splice(i, 1);
}
l--;
}
k = bomb.length - 1;
while (k >= 0) {
if (bullets[i].hitTest(bomb[k])) {
randomNumber++;
_root.attachMovie("explosion", "explosion" + randomNumber, _root.getNextHighestDepth(), {_x:bomb[k]._x, _y:bomb[k]._y});
bomb[k].removeMovieClip();
bomb.splice(k, 1);
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:bullets[i]._x, _y:bullets[i]._y});
bullets[i].removeMovieClip();
bullets.splice(i, 1);
}
k--;
}
j = enemy.length - 1;
while (j >= 0) {
if (bullets[i].hitTest(enemy[j].hitBox)) {
enemyHit[j] = 1;
enemyHealth[j] = enemyHealth[j] - (shotPower + hitBoost);
if (enemyType[j] == "boss_mc") {
if (player._x < 3000) {
enemyHealth[j] = enemyHealth[j] + (shotPower + hitBoost);
}
}
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:bullets[i]._x, _y:bullets[i]._y});
bullets[i].removeMovieClip();
bullets.splice(i, 1);
}
j--;
}
if (ground.hitTest(bullets[i]._x, bullets[i]._y, true)) {
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:bullets[i]._x, _y:bullets[i]._y});
bullets[i].removeMovieClip();
bullets.splice(i, 1);
}
i--;
}
if ((ground.hitTest(player._x, player._y + 11, true) && (jump)) && (!doubleJumping)) {
arm_mc._alpha = 100;
if (running) {
player.gotoAndStop("run");
} else {
player.gotoAndStop("idle");
}
} else {
player.gotoAndStop("jump");
arm_mc._alpha = 0;
}
if (Key.isDown(68) or Key.isDown(65)) {
running = true;
} else {
running = false;
}
if (!ground.hitTest(player._x, player._y + 10, true)) {
falling = true;
grounded = false;
}
if (ground.hitTest(player._x, player._y + 11, true)) {
doubleJumping = false;
doubleJump = false;
jump = true;
grounded = true;
falling = false;
while (ground.hitTest(player._x, player._y + 9, true)) {
player._y--;
}
}
if (falling == true) {
gravity = gravity + gravityaccel;
} else {
gravity = 0;
}
if (((inControl && (Key.isDown(68))) && (xaccel < maxaccel)) && (falling == true)) {
xaccel = xaccel + (runaccelamt - airrisist);
} else if (((inControl && (Key.isDown(65))) && (xaccel > (-maxaccel))) && (falling == true)) {
xaccel = xaccel - (runaccelamt - airrisist);
} else if (((inControl && (Key.isDown(65))) && (xaccel > (-maxaccel))) && (falling == false)) {
xaccel = xaccel - runaccelamt;
} else if (((inControl && (Key.isDown(68))) && (xaccel < maxaccel)) && (falling == false)) {
xaccel = xaccel + runaccelamt;
} else if (grounded == true) {
if (xaccel > 0) {
xaccel = xaccel - friction;
}
if (xaccel < 0) {
xaccel = xaccel + friction;
}
if ((xaccel < 0) && (xaccel > friction)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < friction)) {
xaccel = 0;
}
} else {
if (xaccel > 0) {
xaccel = xaccel - airrisist;
}
if (xaccel < 0) {
xaccel = xaccel + airrisist;
}
if ((xaccel < 0) && (xaccel > airrisist)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < airrisist)) {
xaccel = 0;
}
}
if (_root.ground.hitTest(this._x, this._y - 11, true)) {
gravity = 1;
while (_root.ground.hitTest(this._x, this._y - 10, true)) {
this._y++;
}
}
if (_xmouse > player._x) {
player._xscale = 100;
}
if (_xmouse < player._x) {
player._xscale = -100;
}
if (!Key.isDown(87)) {
pressOnce = 0;
}
if ((inControl && (Key.isDown(87))) && (jump == true)) {
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
if (playerSelect == 2) {
_root.attachMovie("dust", "dust", _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
jump = false;
doubleJump = true;
pressOnce = 1;
}
if (((inControl && (Key.isDown(87))) && (doubleJump == true)) && (pressOnce == 0)) {
gravity = 0;
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
doubleJump = false;
doubleJumping = true;
}
leftx = player._x + (Math.cos(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
lefty = player._y - (Math.sin(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
rightx = player._x + (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * 7);
righty = player._y - (Math.sin(3.141593 * ((player._rotation * -1) / 180)) * 7);
if (ground.hitTest(leftx, lefty, true)) {
xaccel = 0;
player._x++;
}
if (ground.hitTest(rightx, righty, true)) {
xaccel = 0;
player._x--;
}
if (cam._y > 310) {
cam._y = 310;
}
if (cam._x > 3529) {
cam._x = 3529;
}
if (cam._x < 320) {
cam._x = 320;
}
crosshair._x = _xmouse;
crosshair._y = _ymouse;
bg._x = cam._x;
bg._y = cam._y;
place._x = player._x;
place._y = player._y;
endX = player._x;
cam._x = cam._x + ((endX - cam._x) / 20);
endY = player._y;
cam._y = cam._y + ((endY - cam._y) / 20);
cam.camControl();
hud._x = cam._x;
hud._y = cam._y;
hud._xscale = cam.lens._xscale;
hud._yscale = cam.lens._yscale;
bossWarning._x = cam._x;
bossWarning._y = cam._y;
bossWarning._xscale = cam.lens._xscale;
bossWarning._yscale = cam.lens._yscale;
player._y = player._y + gravity;
player._x = player._x + xaccel;
hud.healthBar._xscale = playerHealth;
if (playerHealth > 100) {
playerHealth = 100;
}
if (playerHealth < 1) {
shooting = false;
playerHealth = 0;
inControl = false;
player._alpha = 0;
arm_mc._alpha = 0;
if (transTimer == 0) {
_root.attachMovie("bubbs", "bubbs", _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
_root.attachMovie("trans", "trans", _root.getNextHighestDepth(), {_x:cam._x, _y:cam._y});
}
transTimer++;
if (transTimer > 79) {
clearAll();
prevFrame();
}
}
if (bossDead) {
moveOnTimer++;
if (moveOnTimer == 89) {
_root.attachMovie("stageComplete", "stageComplete", _root.getNextHighestDepth(), {_x:cam._x, _y:cam._y});
}
if (moveOnTimer == 110) {
_root.attachMovie("trans", "trans", _root.getNextHighestDepth(), {_x:cam._x, _y:cam._y});
}
if (moveOnTimer == 189) {
clearAll();
stageFiveComplete = true;
user.data.numberOfCoins_s = numberOfCoins;
user.data.weapon_s = weapon;
user.data.twoLocked_s = twoLocked;
user.data.threeLocked_s = threeLocked;
user.data.fourLocked_s = fourLocked;
user.data.stageOneComplete_s = stageOneComplete;
user.data.stageTwoComplete_s = stageTwoComplete;
user.data.stageThreeComplete_s = stageThreeComplete;
user.data.stageFourComplete_s = stageFourComplete;
user.data.stageFiveComplete_s = stageFiveComplete;
user.data.stageSixComplete_s = stageSixComplete;
user.data.stageTwoOpen_s = stageTwoOpen;
user.data.stageThreeOpen_s = stageThreeOpen;
user.data.stageFourOpen_s = stageFourOpen;
user.data.stageFiveOpen_s = stageFiveOpen;
user.data.stageSixOpen_s = stageSixOpen;
user.flush();
gotoAndStop ("stageSelect");
}
}
if (weapon < 0) {
weapon = 0;
}
if (weapon > 5) {
weapon = 5;
}
if (player._y > 420) {
playerHealth = 0;
}
if (player._x > 3300) {
bossDead = true;
}
if (player._xscale == 100) {
myRadiansA = Math.atan2(_root._ymouse - arm_mc._y, _root._xmouse - arm_mc._x);
myDegreesA = Math.round((myRadiansA * 180) / Math.PI);
arm_mc._rotation = myDegreesA;
arm_mc._xscale = 100;
}
if (player._xscale == -100) {
myRadiansA = Math.atan2(_root._ymouse - arm_mc._y, _root._xmouse - arm_mc._x);
myDegreesA = Math.round((myRadiansA * 180) / Math.PI) - 180;
arm_mc._rotation = myDegreesA;
arm_mc._xscale = -100;
}
stageComplete._x = cam._x;
stageComplete._y = cam._y;
stageComplete._xscale = cam.lens._xscale;
stageComplete._yscale = cam.lens._yscale;
arm_mc._x = player._x;
arm_mc._y = player._y - 3;
hud.cnn.text = numberOfCoins;
trans.swapDepths(_root.getNextHighestDepth());
};
Frame 23
player.removeMovieClip();
stopAllSounds();
cam._xscale = 100;
cam._yscale = 100;
cam._x = that._x;
cam._y = that._y;
stop();
Instance of Symbol 562 MovieClip in Frame 23
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
getURL ("http://www.longanimalsgames.com/?referral=stargunheroes&refmode=moregames", "_blank");
}
Instance of Symbol 619 MovieClip in Frame 23
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
_root.nextFrame();
}
Instance of Symbol 622 MovieClip in Frame 23
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
_root.gotoAndStop("title");
}
Frame 24
function clearAll() {
Mouse.show();
hud.removeMovieClip();
place.removeMovieClip();
bossWarning.removeMovieClip();
crosshair.removeMovieClip();
arm_mc.removeMovieClip();
i = diamonds.length - 1;
while (i >= 0) {
diamonds[i].removeMovieClip();
diamonds.splice(i, 1);
i--;
}
i = coin.length - 1;
while (i >= 0) {
coin[i].removeMovieClip();
coin.splice(i, 1);
i--;
}
i = boxes.length - 1;
while (i >= 0) {
boxes[i].removeMovieClip();
boxes.splice(i, 1);
i--;
}
i = enemy.length - 1;
while (i >= 0) {
enemy[i].removeMovieClip();
enemy.splice(i, 1);
i--;
}
i = enemyType.length - 1;
while (i >= 0) {
enemyType.splice(i, 1);
i--;
}
i = enemyHealth.length - 1;
while (i >= 0) {
enemyHealth.splice(i, 1);
i--;
}
i = selfDestruct.length - 1;
while (i >= 0) {
selfDestruct.splice(i, 1);
i--;
}
i = enemyHit.length - 1;
while (i >= 0) {
enemyHit.splice(i, 1);
i--;
}
i = enemyHitTimer.length - 1;
while (i >= 0) {
enemyHitTimer.splice(i, 1);
i--;
}
i = enemyShotClock.length - 1;
while (i >= 0) {
enemyShotClock.splice(i, 1);
i--;
}
i = bullets.length - 1;
while (i >= 0) {
bullets[i].removeMovieClip();
bullets.splice(i, 1);
i--;
}
i = enemyShot.length - 1;
while (i >= 0) {
enemyShot[i].removeMovieClip();
enemyShot.splice(i, 1);
i--;
}
i = bomb.length - 1;
while (i >= 0) {
bomb[i].removeMovieClip();
bomb.splice(i, 1);
i--;
}
}
stop();
shotsnd = new Sound();
shotsnd.attachSound("reflect");
_root.attachMovie("hud", "hud", _root.getNextHighestDepth());
if (playerSelect == 5) {
hitBoost = 3;
maxaccel = 5;
maxjump = 3;
playerStrength = 10;
hud.faces.gotoAndStop(5);
_root.attachMovie("arm_mc", "arm_mc", _root.getNextHighestDepth());
arm_mc.gotoAndStop(5);
_root.attachMovie("hiddenGuy", "player", _root.getNextHighestDepth(), {_x:startPoint._x, _y:startPoint._y});
}
if (playerSelect == 1) {
hitBoost = 0;
maxaccel = 3;
maxjump = 3;
playerStrength = 10;
_root.attachMovie("arm_mc", "arm_mc", _root.getNextHighestDepth());
arm_mc.gotoAndStop(1);
_root.attachMovie("player", "player", _root.getNextHighestDepth(), {_x:startPoint._x, _y:startPoint._y});
}
if (playerSelect == 2) {
hitBoost = 0;
maxaccel = 5;
maxjump = 5;
playerStrength = 8;
hud.faces.gotoAndStop(2);
_root.attachMovie("arm_mc", "arm_mc", _root.getNextHighestDepth());
arm_mc.gotoAndStop(2);
_root.attachMovie("playerTwo", "player", _root.getNextHighestDepth(), {_x:startPoint._x, _y:startPoint._y});
}
if (playerSelect == 3) {
hitBoost = 1.5;
maxaccel = 3.5;
maxjump = 3;
playerStrength = 5;
hud.faces.gotoAndStop(3);
_root.attachMovie("arm_mc", "arm_mc", _root.getNextHighestDepth());
arm_mc.gotoAndStop(3);
_root.attachMovie("playerThree", "player", _root.getNextHighestDepth(), {_x:startPoint._x, _y:startPoint._y});
}
if (playerSelect == 4) {
hitBoost = 2;
maxaccel = 5;
maxjump = 3;
playerStrength = 10;
hud.faces.gotoAndStop(4);
_root.attachMovie("arm_mc", "arm_mc", _root.getNextHighestDepth());
arm_mc.gotoAndStop(4);
_root.attachMovie("playerFour", "player", _root.getNextHighestDepth(), {_x:startPoint._x, _y:startPoint._y});
}
_root.attachMovie("crosshair", "crosshair", _root.getNextHighestDepth());
_root.attachMovie("place", "place", _root.getNextHighestDepth());
atBoss = false;
bossDead = false;
moveOnTimer = 0;
arm_mc.spark._alpha = 0;
place._alpha = 0;
crosshair._xscale = 50;
crosshair._yscale = 50;
Mouse.hide();
cam._xscale = 100;
cam._yscale = 100;
showWarning = true;
transTimer = 0;
randomNumber = 0;
running = false;
gravity = 0;
gravityaccel = 0.2;
xaccel = 0;
runaccelamt = 0.3;
friction = 0.5;
airrisist = 0.05;
doubleJump = false;
doubleJumping = false;
jump = true;
pressOnce = 0;
playerDamaged = 0;
playerDamagedTimer = 0;
cam.lens._xscale = 50;
cam.lens._yscale = 50;
damaged = false;
inControl = true;
fireRate = 300;
shotPower = 1;
shootingTimer = 0;
shooting = false;
addEnemyTimer = 0;
choice = 0;
playerHealth = 100;
var diamonds = new Array();
diamonds.push(d1, d2, d3);
var coin = new Array();
var boxes = new Array();
boxes.push(box1, box2, box3, box4, box5, box6, box7, box8, box9, box10, box11);
var enemy = new Array();
enemy.push(enemy1, enemy2, enemy3, enemy4, enemy5, enemy6, enemy7, flame1, flame2, flame3, flame4, flame5, flame6, boss);
var enemyType = new Array();
enemyType.push("static_left", "static_left", "static_left", "static_left", "static_left", "static_left", "static_left", "flame_gun", "flame_gun", "flame_gun", "flame_gun", "flame_gun", "flame_gun", "boss_mc");
var enemyHealth = new Array();
enemyHealth.push(30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 300);
var selfDestruct = new Array();
selfDestruct.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var enemyHit = new Array();
enemyHit.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var enemyHitTimer = new Array();
enemyHitTimer.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var enemyShotClock = new Array();
enemyShotClock.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var bullets = new Array();
var enemyShot = new Array();
var bomb = new Array();
onMouseDown = function () {
if ((!damaged) && (inControl)) {
shooting = true;
}
};
onMouseUp = function () {
shooting = false;
};
player.onEnterFrame = function () {
if (playerDamaged == 0) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
if (playerDamaged == 1) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:200, gb:200, bb:200};
myColor.setTransform(myColorTransform);
playerDamagedTimer++;
if (playerDamagedTimer == 1) {
weapon--;
playerDamaged = 0;
playerDamagedTimer = 0;
}
}
if (player._x < 3000) {
if ((addEnemyTimer + 1500) < getTimer()) {
addEnemyTimer = getTimer();
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
randomNumber++;
metalBee_mc = _root.attachMovie("metalBee", "metalBee" + randomNumber, _root.getNextHighestDepth(), {_x:cam._x - 800, _y:player._y - 60});
metalBee_mc._xscale = -100;
enemy.push(metalBee_mc);
enemyType.push("metal_bee");
enemyHealth.push(1);
selfDestruct.push(500);
enemyHitTimer.push(0);
enemyHit.push(0);
enemyShotClock.push(0);
}
if (choice == 1) {
randomNumber++;
metalBee_mc = _root.attachMovie("metalBee", "metalBee" + randomNumber, _root.getNextHighestDepth(), {_x:cam._x + 800, _y:player._y - 60});
enemy.push(metalBee_mc);
enemyType.push("metal_bee");
enemyHealth.push(1);
selfDestruct.push(500);
enemyHitTimer.push(0);
enemyHit.push(0);
enemyShotClock.push(0);
}
}
}
if (!shooting) {
arm_mc.spark._alpha = 0;
}
myRadians = Math.atan2(_root._ymouse - place._y, _root._xmouse - place._x);
myDegrees = Math.round((myRadians * 180) / Math.PI);
place._rotation = myDegrees;
if (shooting) {
if (weapon == 0) {
fireRate = 300;
shotPower = 1;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
if (weapon == 1) {
fireRate = 500;
shotPower = 1;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
randomNumber++;
bullet_mc = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullets.push(bullet_mc);
angle = place._rotation - 6;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
randomNumber++;
bullet_mc = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullets.push(bullet_mc);
angle = place._rotation + 6;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
if (weapon == 2) {
shotPower = 1.5;
fireRate = 200;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("laser", "laser" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
if (weapon == 3) {
shotPower = 2;
fireRate = 200;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("laser", "laser" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._yscale = 200;
bullet_mc._xscale = 600;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
if (weapon == 4) {
shotPower = 2.5;
fireRate = 200;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("largeBullet", "largeBullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
if (weapon == 5) {
shotPower = 2.5;
fireRate = 100;
if ((shootingTimer + fireRate) < getTimer()) {
shootingTimer = getTimer();
arm_mc.spark._alpha = 100;
shotsnd.start();
randomNumber++;
bullet_mc = _root.attachMovie("largeBullet", "largeBullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._yscale = 50;
bullet_mc._xscale = 50;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
randomNumber++;
bullet_mc = _root.attachMovie("largeBullet", "largeBullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._yscale = 50;
bullet_mc._xscale = 50;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation + 15;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
randomNumber++;
bullet_mc = _root.attachMovie("largeBullet", "largeBullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
bullet_mc._alpha = 0;
bullet_mc._yscale = 50;
bullet_mc._xscale = 50;
bullet_mc._rotation = place._rotation;
bullets.push(bullet_mc);
angle = place._rotation - 15;
bullet_mc.dirx = Math.cos((angle * Math.PI) / 180) * 15;
bullet_mc.diry = Math.sin((angle * Math.PI) / 180) * 15;
bullet_mc.onEnterFrame = function () {
if (!this.hitTest(player)) {
this._alpha = 100;
}
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
};
}
}
}
if (player.hitTest(beamer_mc.beam)) {
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - 2.5;
playerDamaged = 1;
}
i = enemy.length - 1;
while (i >= 0) {
if (enemyType[i] == "boss_mc") {
if (enemy[i].hitBox.hitTest(player.hit)) {
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - 0.1;
playerDamaged = 1;
}
if (atBoss) {
enemyShotClock[i]++;
if (enemyShotClock[i] < 60) {
enemy[i].gotoAndStop("warning");
}
if (enemyShotClock[i] > 60) {
selfDestruct[i]++;
if (selfDestruct[i] == 15) {
selfDestruct[i] = 0;
randomNumber++;
bombs_mc = _root.attachMovie("bombs", "bombs" + randomNumber, _root.getNextHighestDepth(), {_x:((cam._x + 320) - Math.round(Math.random() * 640)) + 0, _y:0});
bomb.push(bombs_mc);
randomNumber++;
beamer_mc = _root.attachMovie("bossAttack", "bossAttack" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
myColor = new Color(beamer_mc);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:100, bb:0};
myColor.setTransform(myColorTransform);
}
enemy[i].gotoAndStop("shooting");
}
if (enemyShotClock[i] > 150) {
enemyShotClock[i] = 0;
selfDestruct[i] = 0;
}
}
}
if (enemyType[i] == "flame_gun") {
if (enemy[i].hitBox.hitTest(player.hit)) {
enemyHealth[i] = 0;
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
}
if (player.hitTest(enemy[i].area)) {
enemyShotClock[i]++;
if (enemyShotClock[i] == 3) {
enemyShotClock[i] = 0;
randomNumber++;
enemyBullet_mc = _root.attachMovie("flameBullet", "flameBullet" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x - 10, _y:enemy[i]._y - 30});
enemyShot.push(enemyBullet_mc);
enemyBullet_mc.onEnterFrame = function () {
this._xscale = this._xscale + 5;
this._yscale = this._yscale + 5;
this._y = this._y - 5;
};
}
}
}
if (enemyType[i] == "static_left") {
if (enemy[i].hitBox.hitTest(player.hit)) {
enemyHealth[i] = 0;
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
}
if (player.hitTest(enemy[i].area)) {
enemyShotClock[i]++;
if (enemyShotClock[i] == 30) {
enemyShotClock[i] = 0;
randomNumber++;
enemyBullet_mc = _root.attachMovie("enemyBullet", "enemyBullet" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x - 15, _y:enemy[i]._y - 3});
enemyShot.push(enemyBullet_mc);
enemyBullet_mc.onEnterFrame = function () {
this._x = this._x - 5;
};
}
}
}
if ((enemyType[i] == "metal_bee") && (enemy[i]._xscale == -100)) {
if (enemy[i].hitBox.hitTest(player.hit)) {
enemyHealth[i] = 0;
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
}
if (enemy[i].marker.hitTest(player)) {
enemy[i].marker.gotoAndStop(2);
randomNumber++;
bombs_mc = _root.attachMovie("bombs", "bombs" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
bomb.push(bombs_mc);
}
selfDestruct[i]--;
enemy[i]._x = enemy[i]._x + 3;
if (selfDestruct[i] < 1) {
enemyHealth[i] = 0;
}
if (player._x > 3000) {
enemyHealth[i] = 0;
}
}
if ((enemyType[i] == "metal_bee") && (enemy[i]._xscale == 100)) {
if (enemy[i].hitBox.hitTest(player.hit)) {
enemyHealth[i] = 0;
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
}
if (enemy[i].marker.hitTest(player)) {
enemy[i].marker.gotoAndStop(2);
randomNumber++;
bombs_mc = _root.attachMovie("bombs", "bombs" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
bomb.push(bombs_mc);
}
selfDestruct[i]--;
enemy[i]._x = enemy[i]._x - 3;
if (selfDestruct[i] < 1) {
enemyHealth[i] = 0;
}
if (player._x > 3000) {
enemyHealth[i] = 0;
}
}
if (enemyHit[i] == 0) {
myColor = new Color(enemy[i]);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
if (enemyHit[i] == 1) {
myColor = new Color(enemy[i]);
myColorTransform = new Object();
myColorTransform = {rb:200, gb:200, bb:200};
myColor.setTransform(myColorTransform);
enemyHitTimer[i]++;
if (enemyHitTimer[i] == 3) {
enemyHitTimer[i] = 0;
enemyHit[i] = 0;
}
}
if (enemyHealth[i] < 1) {
if (enemyType[i] == "boss_mc") {
bossDead = true;
atBoss = false;
enemy[i].gotoAndStop(3);
_root.attachMovie("bossDeath5", "bossDeath5", _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
}
if ((enemyType[i] == "static_left") or (enemyType[i] == "flame_gun")) {
enemy[i].gotoAndStop(2);
}
randomNumber++;
_root.attachMovie("explosion", "explosion" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
enemy[i].removeMovieClip();
enemy.splice(i, 1);
enemyType.splice(i, 1);
enemyHealth.splice(i, 1);
selfDestruct.splice(i, 1);
enemyHitTimer.splice(i, 1);
enemyHit.splice(i, 1);
enemyShotClock.splice(i, 1);
}
i--;
}
i = bomb.length - 1;
while (i >= 0) {
if (bomb[i].hitTest(player.hit)) {
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
randomNumber++;
_root.attachMovie("explosion", "explosion" + randomNumber, _root.getNextHighestDepth(), {_x:bomb[i]._x, _y:bomb[i]._y});
bomb[i].removeMovieClip();
bomb.splice(i, 1);
}
bomb[i]._y = bomb[i]._y + 6;
if (ground.hitTest(bomb[i]._x, bomb[i]._y, true)) {
randomNumber++;
_root.attachMovie("explosion", "explosion" + randomNumber, _root.getNextHighestDepth(), {_x:bomb[i]._x, _y:bomb[i]._y});
bomb[i].removeMovieClip();
bomb.splice(i, 1);
}
i--;
}
i = enemyShot.length - 1;
while (i >= 0) {
if (enemyShot[i]._xscale > 200) {
enemyShot[i].removeMovieClip();
enemyShot.splice(i, 1);
}
if (enemyShot[i].hitTest(player.hit)) {
if (weapon > 0) {
_root.attachMovie("lostIt", "lostIt" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
playerHealth = playerHealth - playerStrength;
playerDamaged = 1;
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:enemyShot[i]._x, _y:enemyShot[i]._y});
enemyShot[i].removeMovieClip();
enemyShot.splice(i, 1);
}
if (ground.hitTest(enemyShot[i]._x, enemyShot[i]._y, true)) {
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:enemyShot[i]._x, _y:enemyShot[i]._y});
enemyShot[i].removeMovieClip();
enemyShot.splice(i, 1);
}
i--;
}
i = coin.length - 1;
while (i >= 0) {
if (coin[i].hitTest(player)) {
numberOfCoins = numberOfCoins + 10;
randomNumber++;
_root.attachMovie("ping", "ping" + randomNumber, _root.getNextHighestDepth(), {_x:coin[i]._x, _y:coin[i]._y});
coin[i].removeMovieClip();
coin.splice(i, 1);
}
i--;
}
i = diamonds.length - 1;
while (i >= 0) {
if (diamonds[i].hitTest(player)) {
diamonds[i].gotoAndStop(2);
weapon++;
randomNumber++;
_root.attachMovie("ping", "ping" + randomNumber, _root.getNextHighestDepth(), {_x:diamonds[i]._x, _y:diamonds[i]._y});
diamonds[i].removeMovieClip();
diamonds.splice(i, 1);
}
i--;
}
i = bullets.length - 1;
while (i >= 0) {
if (playerSelect == 1) {
bullets[i].gotoAndStop(1);
}
if (playerSelect == 2) {
bullets[i].gotoAndStop(2);
}
if (playerSelect == 3) {
bullets[i].gotoAndStop(3);
}
if (playerSelect == 4) {
bullets[i].gotoAndStop(4);
}
l = boxes.length - 1;
while (l >= 0) {
if (bullets[i].hitTest(boxes[l])) {
boxes[l].gotoAndStop(2);
randomNumber++;
coins_mc = _root.attachMovie("coins", "coins" + randomNumber, _root.getNextHighestDepth(), {_x:boxes[l]._x, _y:boxes[l]._y});
coin.push(coins_mc);
randomNumber++;
_root.attachMovie("explosion", "explosion" + randomNumber, _root.getNextHighestDepth(), {_x:boxes[l]._x, _y:boxes[l]._y});
boxes[l].removeMovieClip();
boxes.splice(l, 1);
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:bullets[i]._x, _y:bullets[i]._y});
bullets[i].removeMovieClip();
bullets.splice(i, 1);
}
l--;
}
k = bomb.length - 1;
while (k >= 0) {
if (bullets[i].hitTest(bomb[k])) {
randomNumber++;
_root.attachMovie("explosion", "explosion" + randomNumber, _root.getNextHighestDepth(), {_x:bomb[k]._x, _y:bomb[k]._y});
bomb[k].removeMovieClip();
bomb.splice(k, 1);
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:bullets[i]._x, _y:bullets[i]._y});
bullets[i].removeMovieClip();
bullets.splice(i, 1);
}
k--;
}
j = enemy.length - 1;
while (j >= 0) {
if (bullets[i].hitTest(enemy[j].hitBox)) {
enemyHit[j] = 1;
enemyHealth[j] = enemyHealth[j] - (shotPower + hitBoost);
if (enemyType[j] == "boss_mc") {
if (player._x < 3000) {
enemyHealth[j] = enemyHealth[j] + (shotPower + hitBoost);
}
}
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:bullets[i]._x, _y:bullets[i]._y});
bullets[i].removeMovieClip();
bullets.splice(i, 1);
}
j--;
}
if (ground.hitTest(bullets[i]._x, bullets[i]._y, true)) {
randomNumber++;
_root.attachMovie("pow", "pow" + randomNumber, _root.getNextHighestDepth(), {_x:bullets[i]._x, _y:bullets[i]._y});
bullets[i].removeMovieClip();
bullets.splice(i, 1);
}
i--;
}
if ((ground.hitTest(player._x, player._y + 11, true) && (jump)) && (!doubleJumping)) {
arm_mc._alpha = 100;
if (running) {
player.gotoAndStop("run");
} else {
player.gotoAndStop("idle");
}
} else {
player.gotoAndStop("jump");
arm_mc._alpha = 0;
}
if (Key.isDown(68) or Key.isDown(65)) {
running = true;
} else {
running = false;
}
if (!ground.hitTest(player._x, player._y + 10, true)) {
falling = true;
grounded = false;
}
if (ground.hitTest(player._x, player._y + 11, true)) {
doubleJumping = false;
doubleJump = false;
jump = true;
grounded = true;
falling = false;
while (ground.hitTest(player._x, player._y + 9, true)) {
player._y--;
}
}
if (falling == true) {
gravity = gravity + gravityaccel;
} else {
gravity = 0;
}
if (((inControl && (Key.isDown(68))) && (xaccel < maxaccel)) && (falling == true)) {
xaccel = xaccel + (runaccelamt - airrisist);
} else if (((inControl && (Key.isDown(65))) && (xaccel > (-maxaccel))) && (falling == true)) {
xaccel = xaccel - (runaccelamt - airrisist);
} else if (((inControl && (Key.isDown(65))) && (xaccel > (-maxaccel))) && (falling == false)) {
xaccel = xaccel - runaccelamt;
} else if (((inControl && (Key.isDown(68))) && (xaccel < maxaccel)) && (falling == false)) {
xaccel = xaccel + runaccelamt;
} else if (grounded == true) {
if (xaccel > 0) {
xaccel = xaccel - friction;
}
if (xaccel < 0) {
xaccel = xaccel + friction;
}
if ((xaccel < 0) && (xaccel > friction)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < friction)) {
xaccel = 0;
}
} else {
if (xaccel > 0) {
xaccel = xaccel - airrisist;
}
if (xaccel < 0) {
xaccel = xaccel + airrisist;
}
if ((xaccel < 0) && (xaccel > airrisist)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < airrisist)) {
xaccel = 0;
}
}
if (_root.ground.hitTest(this._x, this._y - 11, true)) {
gravity = 1;
while (_root.ground.hitTest(this._x, this._y - 10, true)) {
this._y++;
}
}
if (_xmouse > player._x) {
player._xscale = 100;
}
if (_xmouse < player._x) {
player._xscale = -100;
}
if (!Key.isDown(87)) {
pressOnce = 0;
}
if ((inControl && (Key.isDown(87))) && (jump == true)) {
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
if (playerSelect == 2) {
_root.attachMovie("dust", "dust", _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
}
jump = false;
doubleJump = true;
pressOnce = 1;
}
if (((inControl && (Key.isDown(87))) && (doubleJump == true)) && (pressOnce == 0)) {
gravity = 0;
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
doubleJump = false;
doubleJumping = true;
}
leftx = player._x + (Math.cos(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
lefty = player._y - (Math.sin(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
rightx = player._x + (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * 7);
righty = player._y - (Math.sin(3.141593 * ((player._rotation * -1) / 180)) * 7);
if (ground.hitTest(leftx, lefty, true)) {
xaccel = 0;
player._x++;
}
if (ground.hitTest(rightx, righty, true)) {
xaccel = 0;
player._x--;
}
if (cam._y > 310) {
cam._y = 310;
}
if (cam._x > 3529) {
cam._x = 3529;
}
if (cam._x < 320) {
cam._x = 320;
}
crosshair._x = _xmouse;
crosshair._y = _ymouse;
bg._x = cam._x;
bg._y = cam._y;
place._x = player._x;
place._y = player._y;
endX = player._x;
cam._x = cam._x + ((endX - cam._x) / 20);
endY = player._y;
cam._y = cam._y + ((endY - cam._y) / 20);
cam.camControl();
hud._x = cam._x;
hud._y = cam._y;
hud._xscale = cam.lens._xscale;
hud._yscale = cam.lens._yscale;
bossWarning._x = cam._x;
bossWarning._y = cam._y;
bossWarning._xscale = cam.lens._xscale;
bossWarning._yscale = cam.lens._yscale;
player._y = player._y + gravity;
player._x = player._x + xaccel;
hud.healthBar._xscale = playerHealth;
if (playerHealth > 100) {
playerHealth = 100;
}
if (playerHealth < 1) {
shooting = false;
playerHealth = 0;
inControl = false;
player._alpha = 0;
arm_mc._alpha = 0;
if (transTimer == 0) {
_root.attachMovie("bubbs", "bubbs", _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
_root.attachMovie("trans", "trans", _root.getNextHighestDepth(), {_x:cam._x, _y:cam._y});
}
transTimer++;
if (transTimer > 79) {
clearAll();
prevFrame();
}
}
if (bossDead) {
moveOnTimer++;
if (moveOnTimer == 89) {
_root.attachMovie("stageComplete", "stageComplete", _root.getNextHighestDepth(), {_x:cam._x, _y:cam._y});
}
if (moveOnTimer == 110) {
_root.attachMovie("trans", "trans", _root.getNextHighestDepth(), {_x:cam._x, _y:cam._y});
}
if (moveOnTimer == 189) {
clearAll();
stageSixComplete = true;
user.data.numberOfCoins_s = numberOfCoins;
user.data.weapon_s = weapon;
user.data.twoLocked_s = twoLocked;
user.data.threeLocked_s = threeLocked;
user.data.fourLocked_s = fourLocked;
user.data.stageOneComplete_s = stageOneComplete;
user.data.stageTwoComplete_s = stageTwoComplete;
user.data.stageThreeComplete_s = stageThreeComplete;
user.data.stageFourComplete_s = stageFourComplete;
user.data.stageFiveComplete_s = stageFiveComplete;
user.data.stageSixComplete_s = stageSixComplete;
user.data.stageTwoOpen_s = stageTwoOpen;
user.data.stageThreeOpen_s = stageThreeOpen;
user.data.stageFourOpen_s = stageFourOpen;
user.data.stageFiveOpen_s = stageFiveOpen;
user.data.stageSixOpen_s = stageSixOpen;
user.flush();
nextFrame();
}
}
if (weapon < 0) {
weapon = 0;
}
if (weapon > 5) {
weapon = 5;
}
if (player._y > 420) {
playerHealth = 0;
}
if (player._x > 3000) {
atBoss = true;
if (showWarning) {
_root.attachMovie("bossWarning", "bossWarning", _root.getNextHighestDepth());
showWarning = false;
}
}
if (player._xscale == 100) {
myRadiansA = Math.atan2(_root._ymouse - arm_mc._y, _root._xmouse - arm_mc._x);
myDegreesA = Math.round((myRadiansA * 180) / Math.PI);
arm_mc._rotation = myDegreesA;
arm_mc._xscale = 100;
}
if (player._xscale == -100) {
myRadiansA = Math.atan2(_root._ymouse - arm_mc._y, _root._xmouse - arm_mc._x);
myDegreesA = Math.round((myRadiansA * 180) / Math.PI) - 180;
arm_mc._rotation = myDegreesA;
arm_mc._xscale = -100;
}
stageComplete._x = cam._x;
stageComplete._y = cam._y;
stageComplete._xscale = cam.lens._xscale;
stageComplete._yscale = cam.lens._yscale;
arm_mc._x = player._x;
arm_mc._y = player._y - 3;
hud.cnn.text = numberOfCoins;
trans.swapDepths(_root.getNextHighestDepth());
};
Frame 25
player.removeMovieClip();
cam._xscale = 100;
cam._yscale = 100;
cam._x = that._x;
cam._y = that._y;
stop();
Symbol 66 MovieClip Frame 1
stop();
Symbol 70 MovieClip Frame 1
_root.stop();
Symbol 70 MovieClip Frame 80
_root.play();
Symbol 100 MovieClip Frame 1
_root.stop();
Symbol 100 MovieClip Frame 374
_root.play();
Symbol 123 MovieClip [lostIt] Frame 20
this.removeMovieClip();
Symbol 142 MovieClip [ping] Frame 9
this.removeMovieClip();
Symbol 173 MovieClip [pow] Frame 14
this.removeMovieClip();
Symbol 174 MovieClip Frame 1
stop();
Symbol 218 MovieClip [explosion] Frame 45
this.removeMovieClip();
Symbol 238 MovieClip Frame 1
stop();
Symbol 238 MovieClip Frame 2
stop();
Symbol 238 MovieClip Frame 3
stop();
Symbol 238 MovieClip Frame 4
stop();
Symbol 238 MovieClip Frame 5
stop();
Symbol 245 MovieClip Frame 12
stop();
Symbol 249 Button
on (release) {
gotoAndPlay (2);
_root.soundstatus = "off";
}
Symbol 250 MovieClip Frame 11
stop();
Symbol 252 Button
on (release) {
gotoAndPlay (1);
_root.soundstatus = "on";
}
Symbol 253 MovieClip Frame 1
stop();
Symbol 253 MovieClip Frame 2
stop();
Instance of Symbol 257 MovieClip in Symbol 258 MovieClip Frame 1
onClipEvent (load) {
_root.soundstatus = "on";
_root.mySound = new Sound(_level0);
_root.mySound2 = new Sound(_level1);
_root.mySound3 = new Sound(_level2);
_root.mySound4 = new Sound(_level3);
_root.mySound5 = new Sound(_level4);
maxvolume = 100;
minvolume = 0;
}
onClipEvent (enterFrame) {
if (_root.soundstatus == "on") {
step = 5;
}
if (_root.soundstatus == "off") {
step = -5;
}
maxvolume = maxvolume + step;
if (maxvolume > 100) {
maxvolume = 100;
}
if (maxvolume < 0) {
maxvolume = 0;
}
_root.mySound.setVolume(maxvolume);
_root.mySound2.setVolume(maxvolume);
_root.mySound3.setVolume(maxvolume);
_root.mySound4.setVolume(maxvolume);
_root.mySound5.setVolume(maxvolume);
}
Symbol 261 MovieClip Frame 1
stop();
Instance of Symbol 261 MovieClip in Symbol 262 MovieClip [hud] Frame 1
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
getURL ("http://www.longanimalsgames.com/?referral=stargunheroes&refmode=moregames", "_blank");
}
Symbol 301 MovieClip [bubbs] Frame 41
this.removeMovieClip();
Symbol 302 MovieClip [trans] Frame 80
this.removeMovieClip();
Symbol 307 MovieClip [bossWarning] Frame 121
this.removeMovieClip();
Symbol 312 MovieClip [deadBoss] Frame 111
this.removeMovieClip();
Symbol 313 MovieClip [flash] Frame 8
this.removeMovieClip();
Symbol 331 MovieClip [player] Frame 1
stop();
Symbol 331 MovieClip [player] Frame 2
stop();
Symbol 331 MovieClip [player] Frame 3
stop();
Symbol 346 MovieClip [playerTwo] Frame 1
stop();
Symbol 346 MovieClip [playerTwo] Frame 2
stop();
Symbol 346 MovieClip [playerTwo] Frame 3
stop();
Symbol 363 MovieClip [playerThree] Frame 1
stop();
Symbol 363 MovieClip [playerThree] Frame 2
stop();
Symbol 363 MovieClip [playerThree] Frame 3
stop();
Symbol 373 MovieClip [dust] Frame 9
this.removeMovieClip();
Symbol 390 MovieClip [playerFour] Frame 1
stop();
Symbol 390 MovieClip [playerFour] Frame 2
stop();
Symbol 390 MovieClip [playerFour] Frame 3
stop();
Symbol 405 MovieClip [bossAttack] Frame 72
this.removeMovieClip();
Symbol 410 MovieClip [bossDeath2] Frame 55
this.removeMovieClip();
Symbol 416 MovieClip [dead3Boss] Frame 69
this.removeMovieClip();
Symbol 438 MovieClip Frame 108
stop();
Symbol 453 MovieClip [bossDeath5] Frame 108
this.removeMovieClip();
Symbol 458 MovieClip [bossDeath4] Frame 55
this.removeMovieClip();
Symbol 471 MovieClip [gfl] Frame 6
this.removeMovieClip();
Symbol 480 MovieClip [arm_mc] Frame 1
stop();
Symbol 496 MovieClip [hiddenGuy] Frame 1
stop();
Symbol 496 MovieClip [hiddenGuy] Frame 2
stop();
Symbol 496 MovieClip [hiddenGuy] Frame 3
stop();
Symbol 520 MovieClip [stageComplete] Frame 101
this.removeMovieClip();
Symbol 529 MovieClip Frame 129
stop();
Symbol 532 MovieClip Frame 1
stop();
Symbol 532 MovieClip Frame 2
stop();
Symbol 532 MovieClip Frame 3
stop();
Symbol 534 MovieClip Frame 129
stop();
Symbol 539 MovieClip Frame 129
stop();
Symbol 545 MovieClip Frame 28
stop();
Symbol 551 MovieClip Frame 1
var phrase_string = "We're not going\nto make it!";
var n = phrase_string.length;
var i = 0;
this.onEnterFrame = function () {
if (i < n) {
LSR_txt.text = LSR_txt.text + phrase_string.substr(i, 1);
i = i + 1;
}
};
Symbol 551 MovieClip Frame 129
var phrase_string = "That light\nwe've failed!!";
var n = phrase_string.length;
var i = 0;
this.onEnterFrame = function () {
if (i < n) {
LSR_txt.text = LSR_txt.text + phrase_string.substr(i, 1);
i = i + 1;
}
};
Symbol 551 MovieClip Frame 285
stop();
var phrase_string = "No one being can\nbe allowed to possess\nthis much power!";
var n = phrase_string.length;
var i = 0;
this.onEnterFrame = function () {
if (i < n) {
LSR_txt.text = LSR_txt.text + phrase_string.substr(i, 1);
i = i + 1;
}
};
Symbol 554 MovieClip Frame 1
_root.stop();
Symbol 554 MovieClip Frame 394
_root.play();
Symbol 561 MovieClip Frame 1
function camControl() {
parentColor.setTransform(camColor.getTransform());
var _local3 = sX / this._width;
var _local4 = sY / this._height;
_parent._x = cX - (this._x * _local3);
_parent._y = cY - (this._y * _local4);
_parent._xscale = 100 * _local3;
_parent._yscale = 100 * _local4;
}
stop();
this._visible = true;
var oldMode = Stage.scaleMode;
Stage.scaleMode = "exactFit";
var cX = (Stage.width / 2);
var cY = (Stage.height / 2);
var sX = Stage.width;
var sY = Stage.height;
Stage.scaleMode = oldMode;
camControl();
Symbol 562 MovieClip Frame 1
stop();
Symbol 565 MovieClip Frame 1
stop();
Symbol 568 MovieClip Frame 1
function camControl() {
parentColor.setTransform(camColor.getTransform());
var _local3 = sX / this._width;
var _local4 = sY / this._height;
_parent._x = cX - (this._x * _local3);
_parent._y = cY - (this._y * _local4);
_parent._xscale = 100 * _local3;
_parent._yscale = 100 * _local4;
}
stop();
this._visible = true;
var oldMode = Stage.scaleMode;
Stage.scaleMode = "exactFit";
var cX = (Stage.width / 2);
var cY = (Stage.height / 2);
var sX = Stage.width;
var sY = Stage.height;
Stage.scaleMode = oldMode;
camControl();
Symbol 578 MovieClip Frame 20
stop();
Symbol 579 MovieClip Frame 1
stop();
Symbol 582 MovieClip Frame 1
stop();
Symbol 584 MovieClip Frame 1
stop();
Symbol 587 MovieClip Frame 1
stop();
Symbol 590 MovieClip Frame 1
stop();
Symbol 592 MovieClip Frame 1
stop();
Symbol 602 MovieClip Frame 1
stop();
Symbol 603 MovieClip Frame 1
stop();
Symbol 604 MovieClip Frame 1
stop();
Symbol 606 MovieClip Frame 1
stop();
Symbol 608 MovieClip Frame 1
stop();
Symbol 610 MovieClip Frame 1
stop();
Symbol 612 MovieClip Frame 1
stop();
Symbol 619 MovieClip Frame 1
stop();
Symbol 622 MovieClip Frame 1
stop();
Symbol 645 MovieClip Frame 1
stop();
Symbol 648 MovieClip Frame 1
stop();
Symbol 651 MovieClip Frame 1
stop();
Symbol 652 MovieClip Frame 1
stop();
Symbol 694 MovieClip Frame 155
stop();
Symbol 695 MovieClip Frame 1
function camControl() {
parentColor.setTransform(camColor.getTransform());
var _local3 = sX / this._width;
var _local4 = sY / this._height;
_parent._x = cX - (this._x * _local3);
_parent._y = cY - (this._y * _local4);
_parent._xscale = 100 * _local3;
_parent._yscale = 100 * _local4;
}
stop();
this._visible = true;
var oldMode = Stage.scaleMode;
Stage.scaleMode = "exactFit";
var cX = (Stage.width / 2);
var cY = (Stage.height / 2);
var sX = Stage.width;
var sY = Stage.height;
Stage.scaleMode = oldMode;
camControl();
Symbol 722 MovieClip Frame 107
stop();
Symbol 739 MovieClip Frame 1
stop();
Symbol 742 MovieClip Frame 1
stop();
Symbol 748 MovieClip Frame 1
stop();
Symbol 795 MovieClip Frame 108
stop();
Symbol 800 MovieClip Frame 1
stop();
Instance of Symbol 562 MovieClip in Symbol 802 MovieClip Frame 1
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
getURL ("http://www.longanimalsgames.com/?referral=stargunheroes&refmode=moregames", "_blank");
}
Instance of Symbol 800 MovieClip in Symbol 802 MovieClip Frame 1
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
stopAllSounds();
_root.gotoAndStop("title");
}
Symbol 802 MovieClip Frame 100
stop();
var phrase_string = "We did it! He's dead! That was a lot easier then I thought it\nwould be! We didn't even need the hidden character,\nthe one you unlock by hitting SPACE BAR on the character select screen!";
var n = phrase_string.length;
var i = 0;
this.onEnterFrame = function () {
if (i < n) {
LSR_txt.text = LSR_txt.text + phrase_string.substr(i, 1);
i = i + 1;
}
};