Frame 1
function newContextMenu() {
var _local2 = new ContextMenu();
_local2.hideBuiltInItems();
_root.menu = _local2;
}
function gotoSite() {
}
stop();
var sound = true;
mutebtn.swapDepths(this.getNextHighestDepth());
var musicvolume = 70;
cmouse = attachMovie("cmouse", "cmouse", this.getNextHighestDepth());
cmouse.startDrag("true");
Mouse.hide();
fscommand ("allowscale", true);
newContextMenu();
this.onEnterFrame = function () {
perc = _root.getBytesLoaded() / _root.getBytesTotal();
loadbar._xscale = perc * 100;
if (perc == 1) {
this.onEnterFrame = undefined;
gotoAndPlay (2);
}
};
var gKeys = new Array(87, 83, 65, 68, 81, 69, 80);
Frame 2
text = " ";
var bgMusic = new Sound(this);
bgMusic.loadSound("http://resequenced.com/music/resequenced_september.mp3", true);
bgMusic.setVolume(musicvolume);
bgMusic.onSoundComplete = function () {
bgMusic.loadSound("http://resequenced.com/music/resequenced_september.mp3", true);
bgMusic.setVolume(musicvolume);
};
Frame 16
function createText(msg, xCoord, yCoord) {
_root.startTime = getTimer();
x = 0;
while (x < msg.length) {
if (msg.charAt(x) != " ") {
l = _root.attachMovie("letter" + msg.charAt(x), "letter" + x, _root.getNextHighestDepth());
letters.push(l);
l._x = xCoord;
l._y = yCoord;
xCoord = xCoord + ((l._width / 2) + 10);
l._alpha = 0;
l.a = 0;
l._xscale = (l._yscale = 200);
l.num = x;
l.onEnterFrame = function () {
if ((getTimer() - _root.startTime) >= (this.num * 300)) {
if (this.a == 0) {
snd = new Sound(this);
snd.attachSound("exp");
snd.setVolume(20);
snd.start(Math.random() / 5, 0);
}
this._alpha = (this.a = this.a + 20);
this._xscale = (this._yscale = this._yscale - 20);
if (this.a >= 100) {
this.onEnterFrame = undefined;
}
}
};
} else {
xCoord = xCoord + 20;
}
x++;
}
}
function removeText() {
x = 0;
while (x < letters.length) {
l = letters[x];
l.removeMovieClip();
x++;
}
letters = undefined;
}
var currSong = 0;
stop();
var Bullets;
var AssaultBullets;
var ShotgunBullets;
var TinyBullets;
var Rockets;
var Oil;
var startingscore = 0;
var startingABullets = 160;
var startingSBullets = 50;
var startingTBullets = 100;
var startingRockets = 4;
var startingOil = 160;
var health;
var maxh;
var movespeed;
var level;
var money;
var stats;
var atk;
var dex;
var shots;
var hits;
var accuracy;
var seconds;
var minutes;
var kills;
var knife;
var godMode = false;
var got_ar = new Array(true, false, false, false, false, true);
var letters = new Array();
createText("HITFIGHT 2", 270, 140);
instructbtn.onRelease = function () {
gotoAndStop (500);
removeText();
};
newbtn.onRelease = function () {
gotoAndStop (501);
removeText();
};
optionsbtn.onRelease = function () {
removeText();
gotoAndStop (17);
};
loadbtn.onRelease = function () {
sObj = SharedObject.getLocal("HitFight2");
if (sObj.data.health == undefined) {
_root.text = "No Saved Game.";
return(undefined);
}
_root.songs = new Array("http://www.tindeck.com/audio/files/3g4ji-Daven-Tesseract.mp3", "http://www.tindeck.com/audio/files/3g4ji-Daven-Tesseract.mp3", "http://www.tindeck.com/audio/files/1dolu-NG58106.mp3");
currSong = Math.floor(_root.songs.length * Math.random());
bgMusic.loadSound(songs[currSong++], true);
bgMusic.setVolume(musicvolume);
bgMusic.onSoundComplete = function () {
if (currSong >= songs.length) {
currSong = 0;
}
bgMusic.loadSound(_root.songs[currSong], true);
currSong++;
bgMusic.setVolume(musicvolume);
};
removeText();
health = sObj.data.health;
maxh = sObj.data.maxh;
money = sObj.data.money;
atk = sObj.data.atk;
dex = sObj.data.dex;
level = sObj.data.level;
stats = sObj.data.stats;
movespeed = sObj.data.movespeed;
Bullets = sObj.data.Bullets;
AssaultBullets = sObj.data.AssaultBullets;
ShotgunBullets = sObj.data.ShotgunBullets;
TinyBullets = sObj.data.TinyBullets;
Rockets = sObj.data.Rockets;
Oil = sObj.data.Oil;
score = sObj.data.score;
accuracy = sObj.data.accuracy;
seconds = sObj.data.seconds;
minutes = sObj.data.minutes;
shots = sObj.data.shots;
hits = sObj.data.hits;
score2 = sObj.data.score2;
wshots_ar = sObj.data.wshots_ar;
got_ar = sObj.data.got_ar;
cheats = sObj.data.cheats;
var got_ar = new Array(got0, got1, got2, got3);
var wshots_ar = new Array(shot0, shot1, shot2, shot3);
gotoAndPlay (469);
};
Frame 17
function createBtns() {
x = 0;
while (x < 7) {
btn = _root.attachMovie("optionbutton", "btn" + x, _root.getNextHighestDepth());
btn._x = 166;
btn._y = (x * 28) + 145;
btn.num = x;
cmouse.swapDepths(btn);
btn.onRelease = function () {
this.txt.text = "PRESS ANY KEY";
num = this.num;
};
x++;
}
}
function loadPrev() {
sObj = SharedObject.getLocal("HITFIGHT2OPTIONS");
if (!sObj.data.key00) {
sObj.data.key0 = 87;
sObj.data.key1 = 83;
sObj.data.key2 = 65;
sObj.data.key3 = 68;
sObj.data.key4 = 81;
sObj.data.key5 = 69;
sObj.data.key6 = 80;
}
x = 0;
while (x < 7) {
gKeys[x] = sObj.data["key" + x];
_root["btn" + x].txt.text = findKeyName(sObj.data["key" + x]);
x++;
}
sObj.flush();
}
function findKeyName(keynum) {
if ((keynum >= 48) && (keynum <= 90)) {
gKeys[num] = keynum;
return(String.fromCharCode(keynum));
}
z = 0;
while (z < keys.length) {
if (keynum == Key[keys[z]]) {
return(keys[z]);
}
z++;
}
}
stop();
var gKeys = new Array(87, 68, 65, 68, 81, 69, 80);
var num;
btnreturn.onRelease = function () {
x = 0;
while (x < 7) {
_root["btn" + x].removeMovieClip();
x++;
}
gotoAndStop (16);
};
btndefault.onRelease = function () {
if (!sObj.data.key00) {
sObj.data.key0 = 87;
sObj.data.key1 = 83;
sObj.data.key2 = 65;
sObj.data.key3 = 68;
sObj.data.key4 = 81;
sObj.data.key5 = 69;
sObj.data.key6 = 80;
}
x = 0;
while (x < 7) {
gKeys[x] = sObj.data["key" + x];
_root["btn" + x].txt.text = findKeyName(sObj.data["key" + x]);
x++;
}
_root.volSlider.dragger._x = musicvolume * 3;
};
createBtns();
var alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var keys = new Array("CONTROL", "SHIFT", "SPACE", "CAPSLOCK", "ENTER", "UP", "DOWN", "LEFT", "RIGHT", "BACKSPACE", "PgUp", "PgDown", "DEL", "INSERT", "HOME", "END");
onKeyDown = function () {
if (num == undefined) {
return(undefined);
}
sObj = SharedObject.getLocal("HITFIGHT2OPTIONS");
keynum = Key.getCode();
if ((keynum >= 48) && (keynum <= 90)) {
gKeys[num] = keynum;
_root["btn" + num].txt.text = String.fromCharCode(keynum);
sObj.data["key" + num] = keynum;
sObj.flush();
delete num;
return(undefined);
}
x = 0;
while (x < keys.length) {
if (Key[keys[x]] == keynum) {
gKeys[num] = keynum;
_root["btn" + num].txt.text = keys[x];
sObj.data["key" + num] = keynum;
sObj.flush();
delete num;
return(undefined);
}
x++;
}
};
Key.addListener(_root);
onEnterFrame = function () {
volumetext.text = Math.round(musicvolume);
};
loadPrev();
Frame 18
cheatspoiler._visible = false;
mainmenubtn.onRelease = function () {
gotoAndPlay (2);
};
cheatbtn.onRelease = function () {
if (cheatspoiler._visible == false) {
cheatspoiler._visible = true;
} else {
cheatspoiler._visible = false;
}
};
var bgMusic = new Sound(this);
bgMusic.loadSound("http://resequenced.com/music/resequenced_september.mp3", true);
bgMusic.setVolume(70);
bgMusic.onSoundComplete = function () {
bgMusic.loadSound("http://resequenced.com/music/resequenced_september.mp3", true);
bgMusic.setVolume(70);
};
Frame 467
stop();
Frame 468
function addSec() {
if (Pause == false) {
if (seconds == 59) {
seconds = 0;
minutes = minutes + 1;
} else {
seconds = seconds + 1;
}
}
}
function pauseon() {
Pausetxt = "PAUSE";
Pause = true;
Barriers._alpha = 100;
}
function pauseoff() {
Pausetxt = " ";
Pause = false;
Barriers._alpha = 0;
}
function createKit() {
if (Pause == false) {
_root.healthKit._x = random(800);
_root.healthKit._y = random(600);
_root.healthKit.onEnterFrame = function () {
if (this.hitTest(_root.char.inner)) {
health = health + 30;
this._x = this._x + 1000;
if (Pause == false) {
clearInterval(newKit);
time = (Math.random() * 5000) + 5000;
newKit = setInterval(createKit, time);
}
}
if (health >= maxh) {
health = maxh;
}
};
}
}
function createKit2() {
if (Pause == false) {
_root.healthKit2._x = random(800);
_root.healthKit2._y = random(600);
_root.healthKit2.onEnterFrame = function () {
if (this.hitTest(_root.char.inner)) {
score = score + 500;
score2 = score2 + 500;
this._x = this._x + 1000;
if (Pause == false) {
clearInterval(newKit2);
time = (Math.random() * 5000) + 6000;
newKit2 = setInterval(createKit2, time);
}
}
if (health >= maxh) {
health = maxh;
}
};
}
}
function addAssaultBullets() {
if (Pause == false) {
_root.assaultbullets._x = random(800);
_root.assaultbullets._y = random(600);
_root.assaultbullets.onEnterFrame = function () {
if (this.hitTest(_root.char.inner)) {
snd2 = new Sound();
snd2.attachSound("reload");
snd2.start(0, 0);
this._x = this._x + 1000;
if (weap == 0) {
Bullets = Bullets + 50;
AssaultBullets = AssaultBullets + 50;
} else {
AssaultBullets = AssaultBullets + 50;
}
if (Pause == false) {
clearInterval(newAssault);
newAssault = setInterval(addAssaultBullets, 10000);
}
}
};
}
}
function addShotgunBullets() {
if (got_ar[1] == true) {
if (Pause == false) {
_root.shotgunbullets._x = random(800);
_root.shotgunbullets._y = random(600);
_root.shotgunbullets.onEnterFrame = function () {
if (this.hitTest(_root.char.inner)) {
snd2 = new Sound();
snd2.attachSound("reload");
snd2.start(0, 0);
this._x = this._x + 1000;
if (weap == 1) {
Bullets = Bullets + 30;
ShotgunBullets = ShotgunBullets + 30;
} else {
ShotgunBullets = ShotgunBullets + 30;
}
if (Pause == false) {
clearInterval(newShotgun);
newShotgun = setInterval(addShotgunBullets, 15000);
}
}
};
}
}
}
function addTinyBullets() {
if (got_ar[2] == true) {
if (Pause == false) {
_root.tinybullets._x = random(800);
_root.tinybullets._y = random(600);
_root.tinybullets.onEnterFrame = function () {
if (this.hitTest(_root.char.inner)) {
snd2 = new Sound();
snd2.attachSound("reload");
snd2.start(0, 0);
this._x = this._x + 1000;
if (weap == 2) {
Bullets = Bullets + 60;
TinyBullets = TinyBullets + 60;
} else {
TinyBullets = TinyBullets + 60;
}
if (Pause == false) {
clearInterval(newMachinegun);
newMachinegun = setInterval(addTinyBullets, 20000);
}
}
};
}
}
}
function addRockets() {
if (got_ar[3] == true) {
if (Pause == false) {
_root.rocketammo._x = random(800);
_root.rocketammo._y = random(600);
_root.rocketammo.onEnterFrame = function () {
if (this.hitTest(_root.char.inner)) {
this._x = this._x + 1000;
if (weap == 3) {
Bullets = Bullets + 8;
Rockets = Rockets + 8;
} else {
Rockets = Rockets + 8;
}
if (Pause == false) {
clearInterval(newRocket);
newRocket = setInterval(addRockets, 17000);
}
}
};
}
}
}
function addOil() {
if (got_ar[4] == true) {
if (Pause == false) {
_root.oiltank._x = random(800);
_root.oiltank._y = random(600);
_root.oiltank.onEnterFrame = function () {
if (this.hitTest(_root.char.inner)) {
this._x = this._x + 1000;
if (weap == 4) {
Bullets = Bullets + 100;
Oil = Oil + 100;
} else {
Oil = Oil + 5100;
}
if (Pause == false) {
clearInterval(newOil);
newOil = setInterval(addOil, 17000);
}
}
};
}
}
}
function addSpeedup() {
if (level >= 3) {
if (Pause == false) {
_root.speedup._x = random(1400);
_root.speedup._y = random(600);
_root.speedup.onEnterFrame = function () {
if (this.hitTest(_root.char.inner)) {
score = score + 400;
score2 = score2 + 400;
this._x = this._x + 1000;
_root.movespeed = 9;
clearInterval(SpeedUpTime);
SpeedUpTime = setInterval(speeddown, 6000);
if (Pause == false) {
clearInterval(newSpeedup);
newSpeedup = setInterval(addSpeedup, 20000);
}
}
};
}
}
}
function speeddown() {
movespeed = 4;
}
function oneSec() {
frames.text = ("fps: " + fCount) + "/25";
fCount = 0;
}
function resetAll() {
x = 0;
while (x < enemies.length) {
enemy = enemies[x];
enemy.removeMovieClip();
x++;
}
enemies = undefined;
clearInterval(newKit);
}
function createEnemy() {
if (Pause == false) {
x = 0;
while (x < enemies.length) {
if (enemies[x] == undefined) {
break;
}
x++;
}
eNum = Math.floor(Math.random() * level);
if (x >= enemies.length) {
if (x >= 200) {
return(undefined);
}
enemy = _root[eName[eNum]].duplicateMovieClip("enemy" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
enemy.num = enemies.length;
enemies.push(enemy);
} else {
enemy = _root[eName[eNum]].duplicateMovieClip("enemy" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
enemies[x] = enemy;
enemy.num = x;
}
side = Math.floor(Math.random() * 4);
if ((side / 2) == Math.floor(side / 2)) {
enemy._x = Math.random() * 700;
enemy._y = (side * 300) - 100;
} else {
enemy._y = Math.random() * 600;
enemy._x = ((side - 1) * 350) - 100;
}
enemy.h = eHealth[eNum];
enemy.range = eRange[eNum];
side = Math.floor(Math.random() * 4);
if ((side / 2) == (side >> 1)) {
enemy._x = (side * 500) - 100;
enemy._y = Math.random() * 600;
} else {
enemy._x = Math.random() * 800;
enemy._y = ((side >> 1) * 800) - 100;
}
enemy.onEnterFrame = function () {
if (Pause == false) {
this.angle = Math.atan2(this._y - _root.char._y, this._x - _root.char._x) * 57.2957795130823;
this._rotation = this.angle - 90;
pDist = Math.sqrt(Math.pow(this._y - _root.char._y, 2) + Math.pow(this._x - _root.char._x, 2));
if (pDist <= this.range) {
xspeed = 0;
yspeed = 0;
this.play();
} else {
this.gotoAndStop(1);
enemy.Speed = eSpeed[eNum];
this.xspeed = this.Speed * (-Math.cos((this.angle * 3.14) / 180));
this.yspeed = this.Speed * (-Math.sin((this.angle * 3.14) / 180));
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
}
} else {
this.stop();
}
if (this.h <= 0) {
this.gotoAndStop(1);
points = ePoints[eNum];
kills = kills + 1;
score = score + points;
score2 = score2 + points;
_root.enemiesleft--;
this.a = 70;
this.onEnterFrame = function () {
this._alpha = (this.a = this.a - 5);
if (this.a <= 0) {
this.removeMovieClip();
}
};
}
};
secs = 3;
time = (Math.random() * secs) * 1000;
time1 = (Math.random() * secs) * 1000;
time2 = (Math.random() * secs) * 1000;
time = ((time + time1) + time2) / 3;
clearInterval(newEnemyTime);
newEnemyTime = setInterval(createEnemy, time);
}
}
stop();
Barriers._alpha = 0;
Pausetxt = " ";
var rnd = random(60);
var score2 = 0;
var ready;
var stream = 0;
_root.brg._alpha = rnd;
_root.Barriers.cheatbox.text = " ";
seconds = 0;
minutes = 0;
shots = 0;
hits = 0;
Knife = 1;
Barriers.mainmenubtn.onRelease = function () {
resetAll();
gotoAndPlay (2);
};
_root.Barriers.volSlider.dragger._x = musicvolume * 3;
setInterval(addSec, 1000);
var weap = 0;
var wDmg_ar = new Array(3, 8, 2, "ROCKET", 12, 10);
var weapNames_ar = new Array("Assault Rifle", "Shotgun", "Machine Gun", "Rocket Launcher", "Flamethrower", "Army Knife");
var wshots_ar = new Array(0, 0, 0, 0, 0, 0);
var bullets_ar = new Array("AssaultBullets", "ShotgunBullets", "TinyBullets", "Rockets", "Oil", "Knife");
var stopAtFrameNum = new Array(1, 9, 13, 5, 37, 30);
weapname = weapNames_ar[weap];
wDmg = wDmg_ar[weap];
var Pause = false;
pauseon();
pauseoff();
onKeyDown = function () {
key = Key.getCode();
left = gKeys[4];
right = gKeys[5];
cheatkey = 67;
cheat1 = 66;
cheat2 = 89;
cheat3 = 71;
cheat4 = 76;
Pausebtn = gKeys[6];
if (key == Pausebtn) {
if (Pause == false) {
pauseon();
} else {
pauseoff();
}
}
if (key == left) {
if (Pause == false) {
weap--;
if (got_ar[weap] == false) {
weap--;
}
if (got_ar[weap] == false) {
weap--;
}
if (got_ar[weap] == false) {
weap--;
}
if (got_ar[weap] == false) {
weap--;
}
if (got_ar[weap] == false) {
weap--;
}
if (got_ar[weap] == false) {
weap--;
}
if (weap < 0) {
weap = 5;
}
ready = false;
_root.Bullets = _root[bullets_ar[weap]];
weapname = weapNames_ar[weap];
wDmg = wDmg_ar[weap];
_root.char.gotoAndStop(stopAtFrameNum[weap]);
}
}
if (key == right) {
if (Pause == false) {
weap++;
if (got_ar[weap] == false) {
weap++;
}
if (got_ar[weap] == false) {
weap++;
}
if (got_ar[weap] == false) {
weap++;
}
if (got_ar[weap] == false) {
weap++;
}
if (got_ar[weap] == false) {
weap++;
}
if (got_ar[weap] == false) {
weap++;
}
if (weap >= 6) {
weap = 0;
}
ready = false;
weapname = weapNames_ar[weap];
_root.Bullets = _root[bullets_ar[weap]];
wDmg = wDmg_ar[weap];
_root.char.gotoAndStop(stopAtFrameNum[weap]);
}
}
if (key == cheatkey) {
if (Pause == true) {
_root.Barriers.cheatbox.text = "CHEATS AVAIABLE!";
_root.cheats = true;
}
}
if (key == cheat1) {
if (cheats == true) {
if (Pause == true) {
_root.Barriers.cheatbox.text = "999 AMMUNITION!";
_root.Bullets = 999;
_root.AssaultBullets = 999;
_root.ShotgunBullets = 999;
_root.TinyBullets = 999;
_root.Rockets = 999;
_root.Oil = 999;
}
}
}
if (key == cheat2) {
if (cheats == true) {
if (Pause == true) {
_root.Barriers.cheatbox.text = "ALL WEAPONS AVAIABLE!";
_root.got_ar[0] = true;
_root.got_ar[1] = true;
_root.got_ar[2] = true;
_root.got_ar[3] = true;
_root.got_ar[4] = true;
_root.got_ar[5] = true;
}
}
}
if (key == cheat3) {
if (cheats == true) {
if (Pause == true) {
if (godMode == false) {
_root.Barriers.cheatbox.text = "GOD MODE ON!";
godMode = true;
} else {
godMode = false;
_root.Barriers.cheatbox.text = "GOD MODE OFF!";
}
}
}
}
if (key == cheat4) {
if (cheats == true) {
if (Pause == true) {
if (level <= 8) {
level++;
stats = stats + 2;
resetAll();
gotoAndPlay (469);
} else {
gotoAndPlay (18);
}
}
}
}
};
Key.addListener(this);
createKit();
createKit2();
addAssaultBullets();
addShotgunBullets();
addTinyBullets();
addRockets();
addOil();
addSpeedup();
speeddown();
_root.lvl.text = level;
if (level >= 10) {
_root.zero._alpha = 0;
} else {
_root.zero._alpha = 100;
}
var enemies = new Array();
var enemiesleft = ((2 * level) + 18);
var fCount = 0;
clearInterval(countF);
countF = setInterval(oneSec, 1000);
this.char.onEnterFrame = function () {
if (_root.health <= 0) {
health = 0;
resetAll();
stopAllSounds();
gotoAndPlay (470);
}
_root.hbar._xscale = (health / maxh) * 100;
_root.eleft.text = enemiesleft;
if (_root.enemiesleft >= 10) {
_root.zero2._alpha = 0;
} else {
_root.zero2._alpha = 100;
}
if (enemiesleft <= 0) {
if (level <= 7) {
level++;
stats = stats + 2;
resetAll();
gotoAndPlay (469);
} else {
gotoAndPlay (18);
}
}
if (Pause == false) {
myRadians = Math.atan2(_ymouse - this._y, _xmouse - this._x);
myDegrees = Math.round((myRadians * 180) / Math.PI);
this._rotation = myDegrees + 90;
}
if (Pause == false) {
if (Key.isDown(gKeys[0])) {
this._y = this._y - movespeed;
}
if (Key.isDown(gKeys[2])) {
this._x = this._x - movespeed;
}
if (Key.isDown(gKeys[1])) {
this._y = this._y + movespeed;
}
if (Key.isDown(gKeys[3])) {
this._x = this._x + movespeed;
}
}
if (this._y > 585) {
this._y = 585;
}
if (this._y < 15) {
this._y = 15;
}
if (this._x > 785) {
this._x = 785;
}
if (this._x < 15) {
this._x = 15;
}
};
var enemy;
var eName = new Array("osoldier", "osoldier", "ouzi", "ouzi", "okamikaze", "otank", "okamikaze", "osoldier");
var eHealth = new Array(6, 6, 6, 6, 6, 100, 6, 6);
var eSpeed = new Array(6, 6, 6, 6, 9, 4, 9, 6);
var eRange = new Array(150, 150, 150, 150, 10, 240, 10, 150);
var ePoints = new Array(50, 50, 100, 100, 150, 300, 150, 300);
createEnemy();
onEnterFrame = function () {
if (godMode == true) {
health = 100;
}
if (stream <= -5) {
stream = stream + 2;
} else if (stream >= 10) {
stream = stream - 2;
}
if (ready == true) {
if (weap == 4) {
clearInterval(flame);
f = fireball.duplicateMovieClip("fire" + this.getNextHighestDepth(), this.getNextHighestDepth());
f._x = char._x;
f._y = char._y;
f.weap = weap;
f.angle = (char._rotation - 90) + stream;
f._rotation = f.angle + 90;
f.xspeed = 20 * Math.cos((f.angle * 3.14) / 180);
f.yspeed = 20 * Math.sin((f.angle * 3.14) / 180);
f.onEnterFrame = function () {
if (Pause == false) {
this._alpha = this._alpha - 10;
this.see = this.see - 10;
if (this._alpha <= 0) {
removeMovieClip(this);
}
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
}
x = 0;
while (x < enemies.length) {
enemy = enemies[x];
if (enemy.inner.hitTest(this._x, this._y, true)) {
enemy.h = enemy.h - 10;
}
x++;
}
};
}
}
_root.Barriers.volumetext.text = Math.round(musicvolume);
_root.Ammotxt.text = "Ammo: " + Bullets;
timetext.text = (minutes + ":") + seconds;
scoretext.text = score + "$";
fCount++;
if (weap == 2) {
if (Bullets <= 0) {
_root.char.gotoAndStop(13);
}
}
if (weap == 4) {
if (Bullets <= 0) {
_root.ready = false;
_root.char.gotoAndStop(37);
}
}
if (weap == 2) {
x = 0;
while (x < enemies.length) {
enemy = enemies[x];
if (char.shot.hitTest(enemy._x, enemy._y, true)) {
_root.hits = _root.hits + 1;
enemy.h = enemy.h - (wDmg + atk);
}
x++;
}
}
};
onMouseDown = function () {
if (Pause == false) {
if (Bullets >= 1) {
ready = true;
x = 0;
while (x < enemies.length) {
enemy = enemies[x];
if (char.shot.hitTest(enemy._x, enemy._y, true)) {
_root.hits = _root.hits + 2;
enemy.h = enemy.h - wDmg;
}
if (char.knife.hitTest(enemy._x, enemy._y, true)) {
enemy.h = enemy.h - 10;
}
_root.char.play();
if (weap == 3) {
r = orocket.duplicateMovieClip("rocket" + this.getNextHighestDepth(), this.getNextHighestDepth());
r._x = char._x;
r._y = char._y;
r.weap = weap;
r.angle = char._rotation - 90;
r._rotation = char._rotation;
r.xspeed = 20 * Math.cos((r.angle * 3.14) / 180);
r.yspeed = 20 * Math.sin((r.angle * 3.14) / 180);
r.onEnterFrame = function () {
if (Pause == false) {
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
}
x = 0;
while (x < enemies.length) {
enemy = enemies[x];
if (enemy.hit.hitTest(this._x, this._y, true)) {
_root.hits = _root.hits + 1;
snd = new Sound();
snd.attachSound("Cannon");
snd.start(0, 0);
e = _root.attachMovie("oexp", "exp" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
e._x = enemy._x;
e._y = enemy._y;
x = 0;
while (x < enemies.length) {
enemy = enemies[x];
if (e.hitTest(enemy._x, enemy._y, true)) {
enemy.h = enemy.h - 100;
}
x++;
}
e.onEnterFrame = function () {
this._alpha = this._alpha - 5;
if (this._alpha <= 2) {
this.removeMovieClip();
}
};
this.removeMovieClip();
}
x++;
}
};
return(undefined);
}
if (weap == 4) {
ready = true;
}
x++;
}
} else {
Bullets = 0;
}
}
};
onMouseUp = function () {
if (weap == 2) {
_root.char.gotoAndStop(13);
}
if (weap == 4) {
_root.ready = false;
_root.char.gotoAndStop(37);
}
};
Instance of Symbol 247 MovieClip "char" in Frame 468
/* no clip actions */
Frame 469
function setUpStore() {
x = 0;
while (x < 5) {
_root["upg" + x].num = x;
_root["upg" + x].onRelease = function () {
if (stats >= 1) {
stats--;
if ((varNames[this.num] == "health") || (varNames[this.num] == "maxh")) {
_root[varNames[this.num]] = _root[varNames[this.num]] + 20;
if (varNames[this.num] == "maxh") {
_root.health = _root.health + 17;
}
if (_root.health >= _root.maxh) {
_root.health = _root.maxh;
}
} else {
_root[varNames[this.num]]++;
}
refreshScr();
}
};
x++;
}
}
function refreshScr() {
pointsleft.text = "Stat Points Left: " + stats;
i = 0;
while (i < 5) {
_root["txt" + i].text = _root[varNames[i]];
i++;
}
}
money1.text = " ";
money2.text = " ";
money3.text = " ";
money4.text = " ";
var used = " ";
stop();
if (cheats == true) {
used = "used";
} else {
used = "not used";
}
cheattxt.text = "Cheats: " + used;
scoretxt.text = ("Level earnings: " + score2) + "$";
text2 = " ";
onEnterFrame = function () {
moneytext.text = ("Cash: " + score) + "$";
};
trace((hits + "/") + shots);
accuracy = (hits / shots) * 100;
mostShots = 0;
var i = 0;
while (i <= 5) {
if (_root.wshots_ar[i] >= mostShots) {
mostShots = _root.wshots_ar[i];
numb = i;
}
i++;
}
if (accuracy >= 100) {
accuracy = 100;
rank = "perfect";
}
if ((accuracy >= 80) && (accuracy <= 99)) {
rank = "excellent";
}
if ((accuracy >= 60) && (accuracy <= 79)) {
rank = "good";
}
if ((accuracy >= 40) && (accuracy <= 59)) {
rank = "fair";
}
if ((accuracy >= 0) && (accuracy <= 39)) {
rank = "poor";
}
if (got_ar[1] == true) {
weapbtn0.gotoAndStop(2);
}
if (got_ar[2] == true) {
weapbtn1.gotoAndStop(2);
}
if (got_ar[3] == true) {
weapbtn2.gotoAndStop(2);
}
if (got_ar[4] == true) {
weapbtn3.gotoAndStop(2);
}
weapbtn0.onRelease = function () {
if (_root.got_ar[1] == false) {
if (_root.score >= 1300) {
cash1 = new Sound();
cash1.attachSound("cashmachine");
cash1.start(0, 0);
this.gotoAndStop(2);
_root.score = _root.score - 1300;
_root.got_ar[1] = true;
} else {
_root.money1.text = "Not enough money!";
}
} else {
_root.money1.text = "You alredy have this weapon";
}
};
weapbtn1.onRelease = function () {
if (_root.got_ar[2] == false) {
if (_root.score >= 3200) {
cash1 = new Sound();
cash1.attachSound("cashmachine");
cash1.start(0, 0);
this.gotoAndStop(2);
_root.score = _root.score - 3200;
_root.got_ar[2] = true;
} else {
_root.money2.text = "Not enough money!";
}
} else {
_root.money2.text = "You alredy have this weapon";
}
};
weapbtn2.onRelease = function () {
if (_root.got_ar[3] == false) {
if (_root.score >= 4000) {
cash1 = new Sound();
cash1.attachSound("cashmachine");
cash1.start(0, 0);
this.gotoAndStop(2);
_root.score = _root.score - 4000;
_root.got_ar[3] = true;
} else {
_root.money3.text = "Not enough money!";
}
} else {
_root.money3.text = "You alredy have this weapon";
}
};
weapbtn3.onRelease = function () {
if (_root.got_ar[4] == false) {
if (_root.score >= 5000) {
cash1 = new Sound();
cash1.attachSound("cashmachine");
cash1.start(0, 0);
this.gotoAndStop(2);
_root.score = _root.score - 5000;
_root.got_ar[4] = true;
} else {
_root.money4.text = "Not enough money!";
}
} else {
_root.money4.text = "You alredy have this weapon";
}
};
ranktxt.text = "Level rank: " + rank;
favouriteWeap = weapNames_ar[numb];
nextLevel.onRelease = function () {
if (level <= 7) {
_root.startingscore = score;
_root.startingABullets = AssaultBullets;
_root.startingSBullets = ShotgunBullets;
_root.startingTBullets = TinyBullets;
_root.startingRockets = Rockets;
_root.startingOil = Oil;
gotoAndPlay (468);
_root.weapname = "Assault rifle";
_root.health = maxh;
_root.score2 = 0;
_root.brightness._alpha = rnd;
} else {
gotoAndStop (18);
}
};
savegame.onRelease = function () {
text2 = "saved";
sObj = SharedObject.getLocal("HitFight2");
sObj.data.health = health;
sObj.data.maxh = maxh;
sObj.data.level = level;
sObj.data.money = money;
sObj.data.stats = stats;
sObj.data.atk = atk;
sObj.data.dex = dex;
sObj.data.movespeed = movespeed;
sObj.data.Bullets = Bullets;
sObj.data.AssaultBullets = AssaultBullets;
sObj.data.ShotgunBullets = ShotgunBullets;
sObj.data.TinyBullets = TinyBullets;
sObj.data.Rockets = Rockets;
sObj.data.Oil = Oil;
sObj.data.score = score;
sObj.data.accuracy = accuracy;
sObj.data.seconds = seconds;
sObj.data.minutes = minutes;
sObj.data.shots = shots;
sObj.data.hits = hits;
sObj.data.score2 = score2;
sObj.data.got_ar = got_ar;
sObj.data.wshots_ar = wshots_ar;
sObj.data.cheats = cheats;
sObj.flush();
};
var varNames = new Array("dex", "movespeed", "atk", "health", "maxh");
var uCost = new Array(100, 100, 100, 100, 100);
accuracytext.text = ("Accuracy: " + Math.round(accuracy)) + "%";
timetext2.text = ((("Time: " + minutes) + "min ") + seconds) + "sec";
fvweap.text = "Favourite weapon: " + favouriteWeap;
setUpStore();
refreshScr();
Frame 470
mainmenubtn.onRelease = function () {
gotoAndPlay (2);
};
var bgMusic = new Sound(this);
bgMusic.loadSound("http://resequenced.com/music/resequenced_september.mp3", true);
bgMusic.setVolume(musicvolume);
bgMusic.onSoundComplete = function () {
bgMusic.loadSound("http://resequenced.com/music/resequenced_september.mp3", true);
bgMusic.setVolume(musicvolume);
};
restartbtn.onRelease = function () {
score = startingscore;
Bullets = startingABullets;
AssaultBullets = startingABullets;
ShotgunBullets = startingSBullets;
TinyBullets = startingTBullets;
Rockets = startingRockets;
Oil = startingOil;
health = maxh;
stopAllSounds();
bgMusic.loadSound("http://www.tindeck.com/audio/files/3g4ji-Daven-Tesseract.mp3", true);
bgMusic.setVolume(musicvolume);
bgMusic.onSoundComplete = function () {
bgMusic.loadSound("http://www.tindeck.com/audio/files/3g4ji-Daven-Tesseract.mp3", true);
bgMusic.setVolume(musicvolume);
};
gotoAndPlay (468);
};
Frame 499
stop();
Frame 500
stop();
mainmenubtn.onRelease = function () {
gotoAndStop (16);
};
playbtn.onRelease = function () {
_root.songs = new Array("http://www.tindeck.com/audio/files/3g4ji-Daven-Tesseract.mp3", "http://www.tindeck.com/audio/files/3g4ji-Daven-Tesseract.mp3", "http://www.tindeck.com/audio/files/1dolu-NG58106.mp3");
currSong = Math.floor(_root.songs.length * Math.random());
bgMusic.loadSound(songs[currSong++], true);
bgMusic.setVolume(musicvolume);
bgMusic.onSoundComplete = function () {
if (currSong >= songs.length) {
currSong = 0;
}
bgMusic.loadSound(_root.songs[currSong], true);
currSong++;
bgMusic.setVolume(musicvolume);
trace(currSong);
};
removeText();
score = 0;
health = 100;
maxh = 100;
wDmg = 2;
money = 500;
stats = 0;
level = 1;
Bullets = 160;
AssaultBullets = 160;
ShotgunBullets = 50;
TinyBullets = 100;
Rockets = 4;
Oil = 160;
atk = 0;
movespeed = 5;
shots = 0;
hits = 0;
kills = 0;
accuracy = undefined;
gotoAndPlay (468);
};
Frame 501
stop();
mainmenubtn.onRelease = function () {
gotoAndStop (16);
};
playbtn.onRelease = function () {
_root.songs = new Array("http://www.tindeck.com/audio/files/3g4ji-Daven-Tesseract.mp3", "http://www.tindeck.com/audio/files/3g4ji-Daven-Tesseract.mp3", "http://www.tindeck.com/audio/files/1dolu-NG58106.mp3");
currSong = Math.floor(_root.songs.length * Math.random());
bgMusic.loadSound(songs[currSong++], true);
bgMusic.setVolume(musicvolume);
bgMusic.onSoundComplete = function () {
if (currSong >= songs.length) {
currSong = 0;
}
bgMusic.loadSound(_root.songs[currSong], true);
currSong++;
bgMusic.setVolume(musicvolume);
trace(currSong);
};
removeText();
score = 0;
health = 100;
maxh = 100;
wDmg = 2;
money = 500;
stats = 0;
level = 1;
Bullets = 160;
AssaultBullets = 160;
ShotgunBullets = 50;
TinyBullets = 100;
Rockets = 4;
Oil = 160;
atk = 0;
movespeed = 6;
shots = 0;
hits = 0;
kills = 0;
accuracy = undefined;
gotoAndPlay (468);
};
Symbol 20 MovieClip [cmouse] Frame 1
onEnterFrame = function () {
this.inner._rotation = this.inner._rotation + 2;
};
Symbol 59 Button
on (press) {
startDrag (dragger, false, 0, 0, 300, 0);
_root.cmouse._visible = false;
}
on (release) {
stopDrag();
_root.cmouse.startDrag("true");
_root.cmouse._visible = true;
}
on (releaseOutside) {
stopDrag();
_root.cmouse.startDrag("true");
_root.cmouse._visible = true;
}
Symbol 60 MovieClip Frame 1
dragger.useHandCursor = false;
onEnterFrame = function () {
_root.musicvolume = dragger._x / 3;
_root.bgMusic.setVolume(_root.musicvolume);
};
Symbol 111 MovieClip Frame 1
stop();
Symbol 111 MovieClip Frame 5
if (this.shot.hitTest(_root.char._x, _root.char._y, true)) {
_root.health = _root.health - 5;
}
Symbol 111 MovieClip Frame 33
gotoAndPlay (1);
Symbol 111 MovieClip Frame 36
stop();
Symbol 124 MovieClip Frame 1
stop();
Symbol 124 MovieClip Frame 7
if (this.shot.hitTest(_root.char._x, _root.char._y, true)) {
_root.health = _root.health - 10;
}
Symbol 127 MovieClip [rocket] Frame 1
if (_root.Pause == true) {
this.stop();
} else {
this.play();
}
Symbol 127 MovieClip [rocket] Frame 2
if (_root.Pause == true) {
this.stop();
} else {
this.play();
}
Symbol 141 MovieClip Frame 1
stop();
Symbol 141 MovieClip Frame 9
_root.health = _root.health - 30;
Symbol 141 MovieClip Frame 12
removeMovieClip(this);
Symbol 214 MovieClip Frame 1
stop();
Symbol 214 MovieClip Frame 4
if (this.shot.hitTest(_root.char._x, _root.char._y, true)) {
_root.health = _root.health - 2;
}
Symbol 214 MovieClip Frame 8
if (this.shot.hitTest(_root.char._x, _root.char._y, true)) {
_root.health = _root.health - 2;
}
Symbol 214 MovieClip Frame 12
if (this.shot.hitTest(_root.char._x, _root.char._y, true)) {
_root.health = _root.health - 2;
}
Symbol 214 MovieClip Frame 14
gotoAndPlay (2);
Symbol 214 MovieClip Frame 16
stop();
Symbol 247 MovieClip Frame 1
stop();
Symbol 247 MovieClip Frame 2
_root.Bullets = _root.Bullets - 1;
_root.AssaultBullets = _root.AssaultBullets - 1;
_root.shots = _root.shots + 2;
_root.wshots_ar[0] = _root.wshots_ar[0] + 1;
Symbol 247 MovieClip Frame 4
gotoAndPlay (1);
Symbol 247 MovieClip Frame 5
stop();
Symbol 247 MovieClip Frame 6
play();
_root.Rockets = _root.Rockets - 1;
_root.Bullets = _root.Bullets - 1;
_root.shots = _root.shots + 2;
_root.wshots_ar[3] = _root.wshots_ar[3] + 1;
Symbol 247 MovieClip Frame 8
gotoAndStop (5);
Symbol 247 MovieClip Frame 9
stop();
Symbol 247 MovieClip Frame 10
_root.ShotgunBullets = _root.ShotgunBullets - 1;
_root.Bullets = _root.Bullets - 1;
_root.shots = _root.shots + 2;
_root.wshots_ar[1] = _root.wshots_ar[1] + 1;
Symbol 247 MovieClip Frame 12
gotoAndStop (9);
Symbol 247 MovieClip Frame 13
stop();
Symbol 247 MovieClip Frame 14
_root.TinyBullets = _root.TinyBullets - 1;
_root.Bullets = _root.Bullets - 1;
_root.shots = _root.shots + 2;
_root.wshots_ar[2] = _root.wshots_ar[2] + 1;
Symbol 247 MovieClip Frame 18
_root.TinyBullets = _root.TinyBullets - 1;
_root.Bullets = _root.Bullets - 1;
_root.shots = _root.shots + 2;
Symbol 247 MovieClip Frame 22
_root.TinyBullets = _root.TinyBullets - 1;
_root.Bullets = _root.Bullets - 1;
_root.shots = _root.shots + 2;
_root.wshots_ar[2] = _root.wshots_ar[2] + 1;
Symbol 247 MovieClip Frame 26
_root.TinyBullets = _root.TinyBullets - 1;
_root.Bullets = _root.Bullets - 1;
_root.shots = _root.shots + 2;
Symbol 247 MovieClip Frame 29
gotoAndPlay (14);
Symbol 247 MovieClip Frame 30
stop();
Symbol 247 MovieClip Frame 31
_root.wshots_ar[5] = _root.wshots_ar[5] + 1;
Symbol 247 MovieClip Frame 36
gotoAndStop (30);
Symbol 247 MovieClip Frame 37
stop();
Symbol 247 MovieClip Frame 38
_root.Bullets = _root.Bullets - 1;
_root.Oil = _root.Oil - 1;
_root.wshots_ar[4] = _root.wshots_ar[4] + 1;
Symbol 247 MovieClip Frame 40
_root.Bullets = _root.Bullets - 1;
_root.Oil = _root.Oil - 1;
_root.wshots_ar[4] = _root.wshots_ar[4] + 1;
Symbol 247 MovieClip Frame 41
gotoAndPlay (38);
Symbol 330 MovieClip Frame 1
stop();
Symbol 330 MovieClip Frame 2
stop();