Frame 1
function gotoURL() {
getURL ("http://www.games2win.com");
}
function randomRange(min, max) {
var _local1 = Math.floor(Math.random() * ((max - min) + 1)) + min;
return(_local1);
}
var newMenu = new ContextMenu();
newMenu.hideBuiltInItems();
newMenu.customItems.push(new ContextMenuItem("Game2win", gotoURL));
this.menu = newMenu;
_root.playIntro = true;
_root.allSounds = new Sound();
_root.score = 0;
_root.timeScore = 0;
_root.levelScore = 0;
_root.isPause = false;
_root.levelArray = ["lblgame", "level2", "level3", "level4", "level5", "level6", "level7", "level8", "level9", "level10"];
_root.level = 1;
_root.isEasy = false;
_root.playIntroSound = true;
_root.playerId = 1;
_root.isOver = false;
Frame 2
Frame 3
function displayScores(mc) {
names = _root.topnickname.split(",");
scores = _root.topscore.split(",");
i = 0;
while (i <= 19) {
if (names[i] == undefined) {
names[i] = "";
}
if (scores[i] == undefined) {
scores[i] = "";
}
eval ((mc + ".n") + (i + 1)).text = names[i];
eval ((mc + ".p") + (i + 1)).text = scores[i];
i++;
}
}
function cancelSubmit(mc, useridframe) {
trace("cancelSubmit");
delete _root.send_lv.onLoad;
_root.skipsubmit = true;
mc.gotoAndStop(useridframe);
}
function _newUser() {
getURL (_root._registerurl, "_blank");
}
function _trackClickThru(mc) {
if (_root._allowclick) {
mc.hit_area.onRelease = function () {
getURL (_root._clickthru, "_blank");
};
} else {
mc.hit_area.useHandCursor = false;
}
}
function _resetUsername(txt) {
txt.onSetFocus = function () {
if ((this.text == _root._msgValid) or (this.text == "Connecting Error!")) {
this.text = "";
}
};
}
function _readSharedData() {
_root.so_uname = ((_root._sostatus.data.so_uname == undefined) ? "" : (_root._sostatus.data.so_uname));
_root.so_jumpframe = ((_root._sostatus.data.so_jumpframe == undefined) ? "" : (_root._sostatus.data.so_jumpframe));
_root.so_sound = ((_root._sostatus.data.so_sound == undefined) ? 1 : (_root._sostatus.data.so_sound));
_resetString = _root._sostatus.data.so_resetString;
trace("==========================");
trace((("_root.so_jumpframe : " + _root._sostatus.data.so_jumpframe) + " : ") + _root.so_uname);
if (_root.so_jumpframe != "") {
_assignValue(_resetString);
_root.createEmptyMovieClip("eye", _root.getNextHighestDepth());
_root.eye.onEnterFrame = function () {
if ((_root.getBytesTotal() == _root.getBytesLoaded()) and (_root.getBytesLoaded() > 50000)) {
_root.intro = 0;
_root._sostatus.data.so_jumpframe = "";
_root._sostatus.flush();
this.onEnterFrame = null;
_root.gotoAndStop(_root.so_jumpframe);
}
};
} else {
_root.intro = 1;
play();
}
_root.uname = _root.so_uname;
_root.gamesound = _root.so_sound;
}
function _writeSharedData(jumpframe, jumpurl, _resetString) {
_root._sostatus.data.so_uname = ((_root.so_uname == undefined) ? "" : (_root.so_uname));
_root._sostatus.data.so_sound = _root.so_sound;
_root._sostatus.data.so_resetString = _resetString;
_root._sostatus.data.so_jumpframe = jumpframe;
_root._sostatus.flush();
if (jumpurl != "") {
getURL (jumpurl);
} else {
gotoAndPlay (1);
}
}
function _assignValue(_val) {
_arr = new Array();
_arr = _val.split("|");
i = 0;
while (i < (_arr.length / 2)) {
_var2 = ((i * 2) + 1) - 1;
_var3 = _var2 + 1;
_root[_arr[_var2]] = _arr[_var3];
i++;
}
}
function _playAgain(mc, jumpframe, _resetString) {
_root.so_uname = _root.uname;
if ((_root.gurl != undefined) and (_root.gurl != "")) {
_writeSharedData(jumpframe, _root.gurl, _resetString);
} else {
_root.intro = 0;
_assignValue(_resetString);
mc.gotoAndStop(jumpframe);
}
}
_root._google_txt.text = "Magic finger";
_root._gameid = "1020";
_root._clickthru = "http://www.games2win.com";
_root._customer_id = "games2win";
_root.uname = "";
_root.submiturl = "/gamesubmit.asp";
_root.topnickname = [];
_root.topscore = [];
dataSubmit = function (myname, myscore, mygameid, destmc, useridframe, connframe, top10frame, _ord) {
trace("dataSubmit");
_root.skipsubmit = false;
myname = myname.trim();
_loc = eval (destmc);
if (((myname.length == 0) or (myname == "Invalid Nickname!")) or (myname == "Connecting Error!")) {
_root.uname = "Invalid Nickname!";
} else {
_root.send_lv = new LoadVars();
_root.send_lv.onLoad = function (success) {
if (success and (!_root.skipsubmit)) {
if (_root.send_lv.isreg == 0) {
_root.uname = "Invalid Nickname!";
_loc.gotoAndStop(useridframe);
} else if (_root.send_lv.isreg == 1) {
_root.topnickname = send_lv.topnicknames;
_root.topscore = send_lv.topscores;
_loc.gotoAndPlay(top10frame);
}
}
};
_root.send_lv.nickname = myname;
_root.send_lv.points = myscore;
_root.send_lv.gameid = mygameid;
_root.send_lv.order = _ord;
_root.send_lv.sendAndLoad(submiturl, _root.send_lv, "POST");
_loc.gotoAndPlay(connframe);
}
};
String.prototype.trim = function () {
var _local3 = 0;
var _local2 = this.length;
white = new Object();
white._32 = 1;
_local2--;
while (white["_" + ord(this.charAt(_local2))]) {
}
while (white["_" + ord(this.charAt(_local3++))]) {
}
return(this.slice(_local3 - 1, _local2 + 1));
};
_root._registerurl = "http://www.games2win.com/register.asp";
_root._allowclick = true;
var _sostatus = SharedObject.getLocal("gamestatus", "/");
_readSharedData();
Frame 4
Frame 5
Frame 6
stop();
Frame 7
function gotoURL() {
getURL ("http://www.amoebastudios.com");
}
function randomRange(min, max) {
var _local1 = Math.floor(Math.random() * ((max - min) + 1)) + min;
return(_local1);
}
var newMenu = new ContextMenu();
newMenu.hideBuiltInItems();
this.menu = newMenu;
_root.playIntro = true;
_root.allSounds = new Sound();
_root.score = 0;
_root.timeScore = 0;
_root.levelScore = 0;
_root.isPause = false;
_root.levelArray = ["lblgame", "level2", "level3", "level4", "level5", "level6", "level7", "level8", "level9", "level10"];
_root.level = 1;
_root.isEasy = false;
_root.playIntroSound = true;
_root.playerId = 1;
_root.isOver = false;
stop();
Frame 8
stopAllSounds();
Frame 9
stop();
Instance of Symbol 152 MovieClip in Frame 9
on (release) {
this.gotoAndPlay(_currentframe + 1);
}
Frame 10
stop();
Frame 11
stop();
Frame 12
stop();
_root.score = 0;
Frame 13
stop();
stopAllSounds();
_root.level = 1;
Frame 14
stop();
stopAllSounds();
_root.level = 2;
Frame 15
stop();
stopAllSounds();
_root.level = 3;
Frame 16
stop();
stopAllSounds();
_root.level = 4;
Frame 17
stop();
Frame 18
stop();
stopAllSounds();
Frame 19
stop();
Frame 20
stop();
Symbol 554 MovieClip [__Packages.classes.CollisionDetection] Frame 0
class classes.CollisionDetection
{
function CollisionDetection () {
}
static function checkForCollision(p_clip1, p_clip2, p_alphaTolerance, p_scope) {
if (p_alphaTolerance == undefined) {
p_alphaTolerance = 255;
}
if (p_scope == undefined) {
p_scope = p_clip1._parent;
}
var _local3 = p_clip1.getBounds(p_scope);
var _local2 = p_clip2.getBounds(p_scope);
if (((_local3.xMax < _local2.xMin) || (_local2.xMax < _local3.xMin)) || ((_local3.yMax < _local2.yMin) || (_local2.yMax < _local3.yMin))) {
return(null);
}
var _local1 = {};
_local1.xMin = Math.max(_local3.xMin, _local2.xMin);
_local1.xMax = Math.min(_local3.xMax, _local2.xMax);
_local1.yMin = Math.max(_local3.yMin, _local2.yMin);
_local1.yMax = Math.min(_local3.yMax, _local2.yMax);
var _local8 = new flash.display.BitmapData(_local1.xMax - _local1.xMin, _local1.yMax - _local1.yMin, false);
var _local4 = p_clip1.transform.matrix;
_local4.tx = p_clip1._x - _local1.xMin;
_local4.ty = p_clip1._y - _local1.yMin;
_local8.draw(p_clip1, _local4, new flash.geom.ColorTransform(1, 1, 1, 1, 255, -255, -255, p_alphaTolerance));
_local4 = p_clip2.transform.matrix;
_local4.tx = p_clip2._x - _local1.xMin;
_local4.ty = p_clip2._y - _local1.yMin;
_local8.draw(p_clip2, _local4, new flash.geom.ColorTransform(1, 1, 1, 1, 255, 255, 255, p_alphaTolerance), "difference");
var _local6 = _local8.getColorBoundsRect(4294967295, 4278255615);
if (_local6.width == 0) {
return(null);
}
_local6.x = _local6.x + _local1.xMin;
_local6.y = _local6.y + _local1.yMin;
return(_local6);
}
}
Symbol 68 MovieClip Frame 139
_root.gotoAndStop("lblloader");
Symbol 71 MovieClip Frame 1
_root._trackClickThru(this);
Symbol 81 MovieClip Frame 1
stop();
var loaded = 0;
var temp = 0;
onEnterFrame = function () {
loaded = Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
mask_mc._yscale = loaded;
if (loaded >= 100) {
_root.gotoAndStop("lblgameintro");
}
};
Symbol 89 MovieClip Frame 4
stop();
_parent.removeMovieClip();
Symbol 90 MovieClip [ammo] Frame 2
stop();
Instance of Symbol 88 MovieClip "target_mc" in Symbol 90 MovieClip [ammo] Frame 2
onClipEvent (load) {
var speed = 40;
}
onClipEvent (enterFrame) {
if ((_parent._x <= 820) && (_parent._x >= -10)) {
_parent._x = _parent._x + (speed * _parent.dir);
} else {
_parent.removeMovieClip();
}
}
Symbol 92 MovieClip [ammo2] Frame 2
stop();
Instance of Symbol 88 MovieClip "target_mc" in Symbol 92 MovieClip [ammo2] Frame 2
onClipEvent (load) {
var speed = 40;
}
onClipEvent (enterFrame) {
if ((_parent._x <= 820) && (_parent._x >= -10)) {
_parent._x = _parent._x + (speed * _parent.dir);
} else {
_parent.removeMovieClip();
}
}
Symbol 96 MovieClip [ammoTank] Frame 2
stop();
Instance of Symbol 95 MovieClip "target_mc" in Symbol 96 MovieClip [ammoTank] Frame 2
onClipEvent (load) {
var speed = 40;
}
onClipEvent (enterFrame) {
if ((_parent._x <= 820) && (_parent._x >= -10)) {
_parent._x = _parent._x + (speed * _parent.dir);
} else {
_parent.removeMovieClip();
}
}
Symbol 103 MovieClip Frame 26
stop();
_parent.removeMovieClip();
Symbol 104 MovieClip [dynamite] Frame 1
var increment = 0.05;
var nextPoint = new Point(0, 0);
var ypt = this._y;
var time = 0;
onEnterFrame = function () {
this._x = this._x - _root.speed;
if (((time = time + increment)) > 1) {
onEnterFrame = null;
nextFrame();
}
this.BezierPosition(bezier1, time);
if ((time + increment) < 1) {
nextPoint.BezierPosition(bezier1, time + increment);
this._rotation = (Math.atan2(nextPoint._y - _y, nextPoint._x - _x) * 180) / Math.PI;
}
if (this.hitTest(_parent.hero_mc)) {
_parent.hero_mc.health = _parent.hero_mc.health - 20;
_parent.hero_mc.checkDead2();
onEnterFrame = null;
nextFrame();
}
};
stop();
Symbol 104 MovieClip [dynamite] Frame 2
stop();
Symbol 108 MovieClip [grenade] Frame 1
var increment = 0.05;
var nextPoint = new Point(0, 0);
var ypt = this._y;
var time = 0;
onEnterFrame = function () {
this._x = this._x - _root.speed;
if (((time = time + increment)) > 1) {
onEnterFrame = null;
nextFrame();
}
this.BezierPosition(bezier1, time);
if ((time + increment) < 1) {
nextPoint.BezierPosition(bezier1, time + increment);
this._rotation = (Math.atan2(nextPoint._y - _y, nextPoint._x - _x) * 180) / Math.PI;
}
if (this.hitTest(_parent.hero_mc)) {
_parent.hero_mc.health = _parent.hero_mc.health - 20;
_parent.hero_mc.checkDead2();
onEnterFrame = null;
nextFrame();
}
};
stop();
Symbol 108 MovieClip [grenade] Frame 2
stop();
Symbol 111 MovieClip [knife] Frame 1
function checkCollision(mc2, mc1) {
var _local4;
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
var speed = 40;
onEnterFrame = function () {
if ((this._x <= 820) && (this._x >= -10)) {
if (this._currentframe == 1) {
this._x = this._x - (speed * this.dir);
}
} else {
this.removeMovieClip();
}
if ((this.hitTest(_parent.hero_mc) && (_parent.hero_mc.health > 0)) && (this._currentframe == 1)) {
if ((checkCollision(this, _parent.hero_mc) != undefined) || (checkCollision(this, _parent.hero_mc) != null)) {
this.gotoAndStop(2);
_parent.hero_mc.health = _parent.hero_mc.health - 10;
_parent.hero_mc.checkDead();
}
}
};
stop();
Symbol 111 MovieClip [knife] Frame 2
stop();
Symbol 147 MovieClip Frame 1
stop();
Symbol 147 MovieClip Frame 2
stop();
Symbol 148 MovieClip Frame 1
if (!_root.playIntro) {
gotoAndStop(_totalframes);
}
if (_root.playIntroSound) {
stopAllSounds();
sound_mc.gotoAndStop(2);
}
_root.playIntroSound = false;
_root.playIntro = false;
Symbol 148 MovieClip Frame 2
stop();
story_btn.onRelease = function () {
_root.gotoAndStop("story");
};
instructions_btn.onRelease = function () {
_root.gotoAndStop("instructions");
};
start_btn.onRelease = function () {
_root.gotoAndStop("lblgame");
};
Symbol 152 MovieClip Frame 1
stop();
_root.allSounds.setVolume(100);
Symbol 152 MovieClip Frame 2
stop();
_root.allSounds.setVolume(0);
Symbol 168 MovieClip Frame 1
stop();
start_btn.onRelease = function () {
_root.gotoAndStop("lblgame");
};
back_btn.onRelease = function () {
_root.gotoAndStop("lblgameintro");
};
Symbol 171 MovieClip Frame 1
stop();
start_btn.onRelease = function () {
_root.gotoAndStop("lblgame");
};
back_btn.onRelease = function () {
_root.gotoAndStop("lblgameintro");
};
Symbol 184 MovieClip Frame 1
var speed = _root.speed;
var oldxpos = this._x;
onEnterFrame = function () {
this._x = this._x - (_root.speed / 2);
if ((this._x + (this._width / 2)) <= 0) {
_parent.distance = _parent.distance + Math.round(this._width / 800);
if (_parent.distance < _parent.maxDistance) {
this._x = (this._x + (this._width * 2)) - (_root.speed / 2);
}
}
};
Symbol 189 MovieClip Frame 1
gotoAndStop(_root.level);
stop();
Symbol 189 MovieClip Frame 2
stop();
Symbol 189 MovieClip Frame 3
stop();
Symbol 189 MovieClip Frame 4
stop();
Symbol 202 MovieClip Frame 1
stop();
Symbol 202 MovieClip Frame 2
play();
Symbol 202 MovieClip Frame 19
_parent._parent.throwGrenade2(_parent);
Symbol 237 MovieClip Frame 36
stop();
Symbol 238 MovieClip Frame 1
stop();
Symbol 238 MovieClip Frame 2
stop();
Symbol 242 MovieClip Frame 19
_parent._parent.throwGrenade(_parent);
_parent.state = 0;
Symbol 243 MovieClip Frame 55
stop();
Symbol 246 MovieClip Frame 40
if (_parent._parent.hero_mc.health > 0) {
_parent._parent.hero_mc.health = _parent._parent.hero_mc.health - 10;
_parent._parent.hero_mc.checkDead();
}
Symbol 248 MovieClip Frame 36
_parent.respawn();
Symbol 250 MovieClip Frame 36
_parent.respawn();
Symbol 251 MovieClip Frame 1
stop();
Symbol 251 MovieClip Frame 2
stop();
Symbol 251 MovieClip Frame 3
stop();
Symbol 251 MovieClip Frame 4
stop();
Symbol 251 MovieClip Frame 5
stop();
Symbol 251 MovieClip Frame 6
stop();
Symbol 251 MovieClip Frame 7
stop();
Symbol 255 MovieClip Frame 1
stop();
Symbol 255 MovieClip Frame 2
play();
Symbol 257 MovieClip Frame 27
stop();
_parent.respawn();
Symbol 258 MovieClip Frame 1
stop();
Symbol 258 MovieClip Frame 2
stop();
Symbol 260 MovieClip Frame 1
stop();
Instance of Symbol 259 MovieClip in Symbol 260 MovieClip Frame 1
onClipEvent (enterFrame) {
point = new Object({x:0, y:0});
localToGlobal(point);
_root.b1_gunPoint = point;
}
Symbol 260 MovieClip Frame 2
play();
Symbol 260 MovieClip Frame 20
_parent.throwKnife();
Symbol 260 MovieClip Frame 30
_parent.done = false;
Symbol 262 MovieClip Frame 1
stop();
Instance of Symbol 259 MovieClip in Symbol 262 MovieClip Frame 1
onClipEvent (enterFrame) {
point = new Object({x:0, y:0});
localToGlobal(point);
_root.b1_gunPoint = point;
}
Symbol 262 MovieClip Frame 2
play();
Symbol 262 MovieClip Frame 16
_parent.throwKnife();
Symbol 262 MovieClip Frame 28
_parent.done = false;
Symbol 264 MovieClip Frame 25
stop();
Symbol 265 MovieClip Frame 49
stop();
_parent._parent.nextFrame();
Symbol 266 MovieClip Frame 1
stop();
Symbol 266 MovieClip Frame 2
stop();
Symbol 266 MovieClip Frame 3
stop();
Instance of Symbol 281 MovieClip in Symbol 282 MovieClip Frame 1
onClipEvent (enterFrame) {
point = new Object({x:0, y:0});
localToGlobal(point);
_root.gunPoint = point;
}
Instance of Symbol 281 MovieClip in Symbol 283 MovieClip Frame 1
onClipEvent (enterFrame) {
point = new Object({x:0, y:0});
localToGlobal(point);
_root.gunPoint = point;
}
Instance of Symbol 281 MovieClip in Symbol 286 MovieClip Frame 1
onClipEvent (enterFrame) {
point = new Object({x:0, y:0});
localToGlobal(point);
_root.gunPoint = point;
}
Symbol 286 MovieClip Frame 3
stop();
Instance of Symbol 281 MovieClip in Symbol 287 MovieClip Frame 1
onClipEvent (enterFrame) {
point = new Object({x:0, y:0});
localToGlobal(point);
_root.gunPoint = point;
}
Symbol 287 MovieClip Frame 17
stop();
_parent.state = 0;
_parent.onGround = true;
_parent.gotoAndStop(1);
Symbol 289 MovieClip Frame 68
stop();
_root.gotoAndStop("gameOver");
Symbol 290 MovieClip Frame 68
stop();
Symbol 291 MovieClip Frame 4
stop();
Symbol 292 MovieClip Frame 1
stop();
Symbol 292 MovieClip Frame 2
stop();
Symbol 292 MovieClip Frame 3
stop();
Symbol 292 MovieClip Frame 4
stop();
Symbol 292 MovieClip Frame 5
stop();
Symbol 292 MovieClip Frame 6
stop();
Symbol 292 MovieClip Frame 7
stop();
Symbol 292 MovieClip Frame 8
stop();
Symbol 292 MovieClip Frame 9
stop();
Symbol 300 MovieClip Frame 1
function getBloodStatus(n) {
var _local1 = n * percent;
mask_mc._x = mask_mc._x - Math.round(_local1);
}
stop();
var min = mask_mc._x;
var max = mask_mc._width;
var percent = ((mask_mc._width - mask_mc._x) / 200);
Symbol 308 MovieClip Frame 1
var time = 0;
var maxTime = 4320;
onEnterFrame = function () {
if (time <= maxTime) {
time++;
myTime = Math.round(time / 24);
}
};
Symbol 310 MovieClip Frame 2
stop();
Symbol 336 MovieClip Frame 31
stop();
Symbol 337 MovieClip Frame 1
stop();
next_btn.onRelease = function () {
_root.nextFrame();
};
Symbol 338 MovieClip Frame 1
function throwGrenade(clip) {
var _local3 = this.attachMovie("grenade", "grenade" + count, count++);
_local3._x = ((clip._x - (clip._width / 2)) * clip._xscale) / clip.myScale;
_local3._y = ((clip._y - (clip._height / 2)) * clip._xscale) / clip.myScale;
_local3._xscale = (_local3._yscale = 35);
startpx = hero_mc._x;
startpy = clip._y + (clip._height / 2);
endpx = clip._x;
endpy = clip._y;
MovieClip.prototype.bezier1 = new BezierCurve(startpx, startpy, endpx, endpy);
count++;
}
function throwGrenade2(clip) {
var _local3 = this.attachMovie("grenade", "grenade1" + count, count++);
_local3._x = ((clip._x - (clip._width / 2)) * clip._xscale) / clip.myScale;
_local3._y = ((clip._y - (clip._height / 2)) * clip._xscale) / clip.myScale;
_local3._xscale = (_local3._yscale = 30);
startpx = hero_mc._x;
startpy = 530;
endpx = clip._x + (clip._width / 2);
endpy = clip._y - (clip._height / 2);
MovieClip.prototype.bezier1 = new BezierCurve(startpx, startpy, endpx, endpy);
count++;
}
function throwDynamite(clip) {
var _local3 = this.attachMovie("dynamite", "dynamite" + count, count++);
_local3._x = ((clip._x - (clip._width / 2)) * clip._xscale) / clip.myScale;
_local3._y = ((clip._y - (clip._height / 2)) * clip._xscale) / clip.myScale;
_local3._xscale = (_local3._yscale = 50);
startpx = hero_mc._x;
startpy = 530;
endpx = boss_mc._x;
endpy = boss_mc._y;
MovieClip.prototype.bezier1 = new BezierCurve(startpx, startpy, endpx, endpy);
count++;
}
stop();
MovieClip.prototype.Point = function (x, y) {
this._x = x;
this._y = y;
};
MovieClip.prototype.BezierCurve = function (endpx1, endpy1, endpx2, endpy2) {
this.x0 = endpx2 + _root.speed;
this.y0 = endpy2;
this.x3 = endpx1 + _root.speed;
this.y3 = endpy1;
this.x1 = (this.x0 + this.x3) / 2;
this.y1 = (this.y0 + this.y3) / 20;
this.x2 = (this.x0 + this.x3) / 2;
this.y2 = (this.y0 + this.y3) / 20;
};
Object.prototype.BezierPosition = function (bez, t) {
t = Math.min(Math.max(t, 0), 1);
var _local4 = 3 * (bez.x1 - bez.x0);
var _local5 = (3 * (bez.x2 - bez.x1)) - _local4;
var _local6 = ((bez.x3 - bez.x0) - _local4) - _local5;
this._x = (((((_local6 * t) * t) * t) + ((_local5 * t) * t)) + (_local4 * t)) + bez.x0;
_local4 = 3 * (bez.y1 - bez.y0);
_local5 = (3 * (bez.y2 - bez.y1)) - _local4;
_local6 = ((bez.y3 - bez.y0) - _local4) - _local5;
this._y = (((((_local6 * t) * t) * t) + ((_local5 * t) * t)) + (_local4 * t)) + bez.y0;
};
count = 0;
_root.speed = 0;
_root.boss = false;
_root.kills = 0;
_root.levelScore = 6000;
var maxKills = 50;
var numberOfEnemies = 5;
var levelComplete = false;
var distance = 0;
var maxDistance = 6;
onEnterFrame = function () {
if (!levelComplete) {
if (distance >= maxDistance) {
i = 1;
while (i < numberOfEnemies) {
this["enemy" + i].kill = true;
_parent["enemy" + i].health = 0;
this["enemy" + i].state = 5;
i++;
}
_root.speed = 0;
_root.boss = true;
levelComplete = true;
}
}
};
Instance of Symbol 238 MovieClip "enemy3" in Symbol 338 MovieClip Frame 1
onClipEvent (load) {
function respawn() {
if (!_root.bosss) {
if (!kill) {
this._x = oldxpos;
this._y = oldypos;
state = 0;
health = 10;
die = false;
this._xscale = myScale;
gotoAndStop (1);
} else {
this._x = oldxpos;
this._y = oldypos;
die = false;
gotoAndStop (1);
this.enabled = false;
}
}
}
function checkDead() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + (100 * _root.level);
gotoAndStop (2);
}
}
function attack() {
if ((random(25) == 1) && (this.target_mc._currentframe == 1)) {
this.target_mc.gotoAndPlay(2);
}
}
var speed = 10;
var oldxpos = this._x;
var oldypos = this._y;
var myScale = this._xscale;
var health = 10;
var die = false;
var kill = false;
}
onClipEvent (enterFrame) {
this._x = this._x - (_root.speed / 2);
if (_root.boss) {
gotoAndStop (2);
}
if ((((!die) && (this._x > _parent.hero_mc._x)) && (this._x < 800)) && (this._currentframe == 1)) {
attack();
}
if (((this._x + this._width) <= 0) && (!_root.boss)) {
respawn();
}
}
Instance of Symbol 251 MovieClip "enemy2" in Symbol 338 MovieClip Frame 1
onClipEvent (load) {
function action() {
if (_parent.hero_mc._x > this._x) {
this._xscale = -myScale;
if ((this._x + this._width) <= (((_parent.hero_mc._x - _parent.hero_mc._width) + this._width) - 40)) {
this._x = this._x - ((_root.speed / 3) - (speed / 3));
state = 1;
} else if (!_parent.hero_mc.die) {
this._x = this._x - (_root.speed / 3);
state = 4;
}
} else {
this._xscale = myScale;
if ((this._x + this._width) >= (((_parent.hero_mc._x + _parent.hero_mc._width) + this._width) + 30)) {
this._x = this._x - speed;
state = 1;
} else if (!_parent.hero_mc.die) {
this._x = this._x - (_root.speed / 3);
state = 4;
}
}
}
function respawn() {
if (!_root.bosss) {
if (!kill) {
this._x = oldxpos;
this._y = oldypos;
state = 0;
health = 10;
die = false;
this._xscale = myScale;
gotoAndStop (1);
} else {
this._x = oldxpos;
this._y = oldypos;
die = false;
gotoAndStop (1);
state = 10;
this.enabled = false;
}
}
}
function checkDead() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + (100 * _root.level);
state = 5;
}
}
function checkDead2() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + (50 * _root.level);
state = 6;
}
}
var speed = 10;
var oldxpos = this._x;
var oldypos = this._y;
var myScale = this._xscale;
var states = ["idle", "walk", "bomb1", "bomb2", "attack", "die1", "die2"];
var state = 0;
var health = 10;
var die = false;
var kill = false;
}
onClipEvent (enterFrame) {
if (((state == 0) || (state == 1)) || (state == 4)) {
if (this._y < (_parent.hero_mc._y - 19)) {
this._y = this._y + 30;
} else {
if (((this._x + this._width) <= 0) && (!_root.boss)) {
respawn();
}
lastState = state;
state = 0;
action();
if ((((random(30) == 1) && (Math.abs(this._x - _parent.hero_mc._x) > 150)) && (this._x > 0)) && (this._x < 800)) {
lastState = state;
state = 2;
}
if (state != lastState) {
this.gotoAndStop(states[state]);
}
}
}
if (state == 2) {
this._x = this._x - (_root.speed / 3);
}
if ((state == 5) || (state == 6)) {
this._x = this._x - (_root.speed / 3);
if (!die) {
this.gotoAndPlay(states[state]);
die = true;
}
}
}
Instance of Symbol 251 MovieClip "enemy1" in Symbol 338 MovieClip Frame 1
onClipEvent (load) {
function action() {
if (_parent.hero_mc._x > this._x) {
this._xscale = -myScale;
if ((this._x + this._width) <= (((_parent.hero_mc._x - _parent.hero_mc._width) + this._width) - 40)) {
this._x = this._x - ((_root.speed / 3) - (speed / 3));
state = 1;
} else if (!_parent.hero_mc.die) {
this._x = this._x - (_root.speed / 3);
state = 4;
}
} else {
this._xscale = myScale;
if ((this._x + this._width) >= (((_parent.hero_mc._x + _parent.hero_mc._width) + this._width) + 30)) {
this._x = this._x - speed;
state = 1;
} else if (!_parent.hero_mc.die) {
this._x = this._x - (_root.speed / 3);
state = 4;
}
}
}
function respawn() {
if (!_root.bosss) {
if (!kill) {
this._x = oldxpos;
this._y = oldypos;
state = 0;
health = 10;
die = false;
this._xscale = myScale;
gotoAndStop (1);
} else {
this._x = oldxpos;
this._y = oldypos;
die = false;
gotoAndStop (1);
state = 10;
this.enabled = false;
}
}
}
function checkDead() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + (50 * _root.level);
state = 5;
}
}
function checkDead2() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + 100;
state = 6;
}
}
var speed = 10;
var oldxpos = this._x;
var oldypos = this._y;
var myScale = this._xscale;
var states = ["idle", "walk", "bomb1", "bomb2", "attack", "die1", "die2"];
var state = 0;
var health = 10;
var die = false;
var kill = false;
}
onClipEvent (enterFrame) {
if (((state == 0) || (state == 1)) || (state == 4)) {
if (this._y < (_parent.hero_mc._y - 19)) {
this._y = this._y + 30;
} else {
if ((this._x + this._width) <= 0) {
respawn();
}
lastState = state;
state = 0;
action();
if ((((random(30) == 1) && (Math.abs(this._x - _parent.hero_mc._x) > 150)) && (this._x > 0)) && (this._x < 800)) {
lastState = state;
state = 2;
}
if (state != lastState) {
this.gotoAndStop(states[state]);
}
}
}
if (state == 2) {
this._x = this._x - (_root.speed / 3);
}
if ((state == 5) || (state == 6)) {
this._x = this._x - (_root.speed / 3);
if (!die) {
this.gotoAndPlay(states[state]);
die = true;
}
}
}
Instance of Symbol 258 MovieClip "enemy4" in Symbol 338 MovieClip Frame 1
onClipEvent (load) {
function checkCollision(mc2, mc1) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
function respawn() {
if (!_root.bosss) {
if (!kill) {
this._x = oldxpos;
this._y = oldypos;
state = 0;
health = 10;
die = false;
this._xscale = myScale;
gotoAndStop (1);
} else {
this._x = oldxpos;
this._y = oldypos;
die = false;
gotoAndStop (1);
this.enabled = false;
}
}
}
function checkDead2() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + (100 * _root.level);
gotoAndStop (2);
}
}
function attack() {
if (shootSpeed == maxshootSpeed) {
shootSpeed = 0;
this.target_mc.gotoAndPlay(2);
var _local3 = _parent.attachMovie("ammo2", "ammo1" + _parent.getNextHighestDepth(), _parent.getNextHighestDepth());
_local3.dir = -1;
_local3._xscale = -20;
_local3._x = this._x - 80;
_local3._y = this._y + 9;
_local3.onEnterFrame = function () {
if ((this.hitTest(_parent.hero_mc) && (_parent.hero_mc.health > 0)) && (this._currentframe == 2)) {
if ((checkCollision(this, _parent.hero_mc) != undefined) || (checkCollision(this, _parent.hero_mc) != null)) {
this.gotoAndStop(3);
_parent.hero_mc.health = _parent.hero_mc.health - 10;
_parent.hero_mc.checkDead();
}
}
};
} else {
shootSpeed++;
}
}
var speed = 10;
var oldxpos = this._x;
var oldypos = this._y;
var myScale = this._xscale;
var health = 10;
var die = false;
var kill = false;
var maxshootSpeed = 25;
var shootSpeed = 25;
}
onClipEvent (enterFrame) {
if (_root.boss) {
gotoAndStop (2);
}
this._x = this._x - (_root.speed / 2);
if ((((!die) && (this._x > _parent.hero_mc._x)) && (this._x < 820)) && (this._currentframe == 1)) {
attack();
}
if ((this._x + this._width) <= 0) {
respawn();
}
}
Instance of Symbol 266 MovieClip "boss_mc" in Symbol 338 MovieClip Frame 1
onClipEvent (load) {
function checkDead() {
if ((!die) && (health <= 0)) {
die = true;
_root.score = _root.score + 1000;
gotoAndStop (3);
}
}
function throwKnife() {
var _local3 = _parent.attachMovie("knife", "knife" + counter, counter);
_local3.dir = dir;
_local3._x = _root.b1_gunPoint.x;
_local3._y = _root.b1_gunPoint.y;
counter++;
}
var counter = 100;
var done = false;
var health = 200;
var die = false;
var throwArray = [1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2];
var counter = 0;
var dir = 1;
var scale = this._xscale;
}
onClipEvent (enterFrame) {
if (_root.boss) {
if (this._y < (_parent.hero_mc._y - 20)) {
this._y = this._y + 30;
}
if ((this._x > _parent.hero_mc._x) && (dir == -1)) {
dir = 1;
this._xscale = scale;
} else if ((this._x <= _parent.hero_mc._x) && (dir == 1)) {
dir = -1;
this._xscale = -scale;
}
if ((!die) && (_parent.hero_mc.health > 0)) {
if (!done) {
gotoAndStop(throwArray[counter]);
target_mc.gotoAndPlay(2);
done = true;
if (counter < throwArray.length) {
counter++;
} else {
counter = 0;
}
}
}
}
}
Instance of Symbol 292 MovieClip "hero_mc" in Symbol 338 MovieClip Frame 1
onClipEvent (load) {
function checkCollision(mc2, mc1) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
function checkDead() {
_parent.hud_mc.health_mc.getBloodStatus(10);
if ((health <= 0) && (!die)) {
state = 6;
this.gotoAndPlay(states[state]);
die = true;
_root.speed = 0;
}
}
function checkDead2() {
_parent.hud_mc.health_mc.getBloodStatus(15);
if ((health <= 0) && (!die)) {
state = 6;
this.gotoAndPlay(states[state]);
die = true;
_root.speed = 0;
}
}
function run() {
lastState = state;
state = 0;
dir = null;
if (isShooting == true) {
if (shootSpeed == maxshootSpeed) {
i = 0;
while (i < noOfBullets) {
var _local4 = _parent.attachMovie("ammo", "ammo" + _parent.getNextHighestDepth(), _parent.getNextHighestDepth());
_local4.dir = Math.round(this._xscale / 40.3);
_local4._xscale = _local4.dir * 100;
_local4._x = _root.gunPoint.x;
_local4._y = _root.gunPoint.y;
_local4.onEnterFrame = function () {
if (_root.boss != true) {
i = 1;
while (i < _parent.numberOfEnemies) {
if (((this.hitTest(_parent["enemy" + i].target_mc) && (_parent["enemy" + i]._currentframe < 6)) && (_parent["enemy" + i]._x < 850)) && (this._currentframe == 2)) {
if ((checkCollision(this, _parent["enemy" + i]) != undefined) || (checkCollision(this, _parent["enemy" + i]) != null)) {
this.gotoAndStop(3);
_parent["enemy" + i].health = _parent["enemy" + i].health - 10;
if (this._y < (_parent["enemy" + i]._y - 43)) {
_parent["enemy" + i].checkDead();
} else {
_parent["enemy" + i].checkDead2();
}
}
}
i++;
}
} else if (this.hitTest(_parent.boss_mc) && (this._currentframe == 2)) {
if ((checkCollision(this, _parent.boss_mc) != undefined) || (checkCollision(this, _parent.boss_mc) != null)) {
this.gotoAndStop(3);
_parent.boss_mc.health = _parent.boss_mc.health - 10;
_parent.boss_mc.checkDead();
}
}
};
i++;
}
shootSpeed = 3;
} else {
shootSpeed++;
}
}
if (Key.isDown(37) && (!Key.isDown(40))) {
xspeed = xspeed - speed;
this._xscale = -40.3;
state = 2;
dir = "L";
}
if (Key.isDown(39) && (!Key.isDown(40))) {
xspeed = xspeed + speed;
this._xscale = 40.3;
state = 2;
dir = "R";
}
if (Key.isDown(40) && (Key.isDown(39))) {
state = 3;
this._xscale = 40.3;
dir = "R";
}
if (Key.isDown(40) && (Key.isDown(37))) {
state = 3;
this._xscale = -40.3;
dir = "L";
}
if (Key.isDown(40)) {
state = 3;
}
if (Key.isDown(38)) {
state = 4;
}
if (Key.isDown(32)) {
isShooting = true;
if ((((!Key.isDown(39)) && (!Key.isDown(37))) && (!Key.isDown(38))) && (!Key.isDown(40))) {
state = 1;
}
} else {
isShooting = false;
}
if (state != lastState) {
this.gotoAndPlay(states[state]);
}
}
function runB() {
this.xspeed = this.xspeed * airFriction;
if (this.xspeed < (-this.maxspeed)) {
this.xspeed = -this.maxspeed;
}
if (this.maxspeed < this.xspeed) {
this.xspeed = this.maxspeed;
}
this.xpos = this.xpos + (this.xspeed * 3);
}
function renderB() {
if (!_root.boss) {
if ((this._x < 300) && (this._x >= 40)) {
var _local3 = this._x;
this._x = this.xpos;
} else if (this._x < 40) {
this._x = 40;
this.xpos = 40;
} else if (this._x >= 300) {
this._x = 300;
this.xpos = 300;
if (this.xspeed > 0) {
_root.speed = Math.round(this.xspeed * 5);
} else {
if (dir == "L") {
this._x = 299;
this.xpos = 299;
}
_root.speed = 0;
}
}
} else if ((this._x < 760) && (this._x >= 40)) {
var _local3 = this._x;
this._x = this.xpos;
} else if (this._x < 40) {
this._x = 40;
this.xpos = 40;
} else if (this._x > 760) {
this._x = 758;
this.xpos = 758;
}
}
var states = ["idle", "shoot", "walk", "duck", "jump", "shoot2", "death1", "death2", "death3", "idle2"];
var onGround = true;
var isShooting = false;
var speed = 12;
var maxshootSpeed = 8;
var shootSpeed = 8;
var health = 200;
var maxhealth = 100;
var noOfBullets = 1;
var gunType = 1;
var die = false;
speed = 1.8;
state = 0;
q = 0;
var xpos = this._x;
var ypos = this._y;
var scale = (this._xscale / 100);
var maxspeed = 6;
var bounceFriction = 0;
var xspeed = 0;
var yspeed = 0;
var radius = 8;
var mass = (radius * radius);
var laststate;
var state = 0;
var dir;
var xh = 12;
var hitRight = false;
var hitLeft = false;
var gravity = 2.2;
var airFriction = 0.956;
var slidingFriction = 0.6;
var firespeed = 10;
_root.speed = 0;
}
onClipEvent (enterFrame) {
if (!Key.isDown(90)) {
this.xspeed = this.xspeed * slidingFriction;
} else {
this.xspeed = this.xspeed * 0.9;
}
if (state != 6) {
run();
runB();
renderB();
}
}
Symbol 338 MovieClip Frame 2
stop();
Symbol 374 MovieClip Frame 1
var speed = _root.speed;
var oldxpos = this._x;
onEnterFrame = function () {
this._x = this._x - (_root.speed / 2);
if ((this._x + (this._width / 2)) <= 0) {
_parent.distance = _parent.distance + Math.round(this._width / 800);
if (_parent.distance < _parent.maxDistance) {
this._x = (this._x + (this._width * 2)) - (_root.speed / 2);
}
}
};
Symbol 375 MovieClip Frame 1
stop();
Symbol 375 MovieClip Frame 2
play();
Symbol 375 MovieClip Frame 8
_parent.shield_mc._visible = false;
Symbol 375 MovieClip Frame 20
_parent._parent.throwDynamite(_parent._parent);
Symbol 375 MovieClip Frame 25
_parent.shield_mc._visible = true;
Symbol 375 MovieClip Frame 48
_parent.done = false;
Symbol 379 MovieClip Frame 1
stop();
Symbol 379 MovieClip Frame 2
stop();
Symbol 380 MovieClip Frame 1
function throwGrenade(clip) {
var _local3 = this.attachMovie("grenade", "grenade" + count, count++);
_local3._x = ((clip._x - (clip._width / 2)) * clip._xscale) / clip.myScale;
_local3._y = ((clip._y - (clip._height / 2)) * clip._xscale) / clip.myScale;
_local3._xscale = (_local3._yscale = 35);
startpx = hero_mc._x;
startpy = clip._y + (clip._height / 2);
endpx = clip._x;
endpy = clip._y;
MovieClip.prototype.bezier1 = new BezierCurve(startpx, startpy, endpx, endpy);
count++;
}
function throwGrenade2(clip) {
var _local3 = this.attachMovie("grenade", "grenade1" + count, count++);
_local3._x = ((clip._x - (clip._width / 2)) * clip._xscale) / clip.myScale;
_local3._y = ((clip._y - (clip._height / 2)) * clip._xscale) / clip.myScale;
_local3._xscale = (_local3._yscale = 30);
startpx = hero_mc._x;
startpy = 530;
endpx = clip._x + (clip._width / 2);
endpy = clip._y - (clip._height / 2);
MovieClip.prototype.bezier1 = new BezierCurve(startpx, startpy, endpx, endpy);
count++;
}
function throwDynamite(clip) {
var _local3 = this.attachMovie("dynamite", "dynamite" + count, count++);
_local3._x = ((clip._x - (clip._width / 2)) * clip._xscale) / clip.myScale;
_local3._y = ((clip._y - (clip._height / 2)) * clip._xscale) / clip.myScale;
_local3._xscale = (_local3._yscale = 50);
startpx = hero_mc._x;
startpy = 530;
endpx = boss_mc._x;
endpy = boss_mc._y;
MovieClip.prototype.bezier1 = new BezierCurve(startpx, startpy, endpx, endpy);
count++;
}
stop();
MovieClip.prototype.Point = function (x, y) {
this._x = x;
this._y = y;
};
MovieClip.prototype.BezierCurve = function (endpx1, endpy1, endpx2, endpy2) {
this.x0 = endpx2 + _root.speed;
this.y0 = endpy2;
this.x3 = endpx1 + _root.speed;
this.y3 = endpy1;
this.x1 = (this.x0 + this.x3) / 2;
this.y1 = (this.y0 + this.y3) / 20;
this.x2 = (this.x0 + this.x3) / 2;
this.y2 = (this.y0 + this.y3) / 20;
};
Object.prototype.BezierPosition = function (bez, t) {
t = Math.min(Math.max(t, 0), 1);
var _local4 = 3 * (bez.x1 - bez.x0);
var _local5 = (3 * (bez.x2 - bez.x1)) - _local4;
var _local6 = ((bez.x3 - bez.x0) - _local4) - _local5;
this._x = (((((_local6 * t) * t) * t) + ((_local5 * t) * t)) + (_local4 * t)) + bez.x0;
_local4 = 3 * (bez.y1 - bez.y0);
_local5 = (3 * (bez.y2 - bez.y1)) - _local4;
_local6 = ((bez.y3 - bez.y0) - _local4) - _local5;
this._y = (((((_local6 * t) * t) * t) + ((_local5 * t) * t)) + (_local4 * t)) + bez.y0;
};
count = 0;
_root.speed = 0;
_root.boss = false;
_root.kills = 0;
_root.levelScore = 9000;
var maxKills = 75;
var numberOfEnemies = 6;
var levelComplete = false;
var distance = 0;
var maxDistance = 9;
onEnterFrame = function () {
if (!levelComplete) {
if (distance >= maxDistance) {
i = 1;
while (i < numberOfEnemies) {
this["enemy" + i].kill = true;
_parent["enemy" + i].health = 0;
this["enemy" + i].state = 5;
i++;
}
_root.speed = 0;
_root.boss = true;
levelComplete = true;
}
}
};
Instance of Symbol 238 MovieClip "enemy3" in Symbol 380 MovieClip Frame 1
onClipEvent (load) {
function respawn() {
if (!kill) {
this._x = oldxpos;
this._y = oldypos;
state = 0;
health = 10;
die = false;
this._xscale = myScale;
gotoAndStop (1);
} else {
this._x = oldxpos;
this._y = oldypos;
die = false;
gotoAndStop (1);
this.enabled = false;
}
}
function checkDead() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + (100 * _root.level);
gotoAndStop (2);
}
}
function attack() {
if ((random(25) == 1) && (this.target_mc._currentframe == 1)) {
this.target_mc.gotoAndPlay(2);
}
}
var speed = 10;
var oldxpos = this._x;
var oldypos = this._y;
var myScale = this._xscale;
var health = 10;
var die = false;
var kill = false;
}
onClipEvent (enterFrame) {
if (_root.boss) {
gotoAndStop (2);
}
this._x = this._x - (_root.speed / 2);
if ((((!die) && (this._x > _parent.hero_mc._x)) && (this._x < 800)) && (this._currentframe == 1)) {
attack();
}
if (((this._x + this._width) <= 0) && (!_root.boss)) {
respawn();
}
}
Instance of Symbol 251 MovieClip "enemy2" in Symbol 380 MovieClip Frame 1
onClipEvent (load) {
function action() {
if (_parent.hero_mc._x > this._x) {
this._xscale = -myScale;
if ((this._x + this._width) <= (((_parent.hero_mc._x - _parent.hero_mc._width) + this._width) - 40)) {
this._x = this._x - ((_root.speed / 3) - (speed / 3));
state = 1;
} else if (!_parent.hero_mc.die) {
this._x = this._x - (_root.speed / 3);
state = 4;
}
} else {
this._xscale = myScale;
if ((this._x + this._width) >= (((_parent.hero_mc._x + _parent.hero_mc._width) + this._width) + 30)) {
this._x = this._x - speed;
state = 1;
} else if (!_parent.hero_mc.die) {
this._x = this._x - (_root.speed / 3);
state = 4;
}
}
}
function respawn() {
if (!kill) {
this._x = oldxpos;
this._y = oldypos;
state = 0;
health = 10;
die = false;
this._xscale = myScale;
gotoAndStop (1);
} else {
this._x = oldxpos;
this._y = oldypos;
die = false;
gotoAndStop (1);
state = 10;
this.enabled = false;
}
}
function checkDead() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + (100 * _root.level);
state = 5;
}
}
function checkDead2() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + (50 * _root.level);
state = 6;
}
}
var speed = 10;
var oldxpos = this._x;
var oldypos = this._y;
var myScale = this._xscale;
var states = ["idle", "walk", "bomb1", "bomb2", "attack", "die1", "die2"];
var state = 0;
var health = 10;
var die = false;
var kill = false;
}
onClipEvent (enterFrame) {
if (((state == 0) || (state == 1)) || (state == 4)) {
if (this._y < (_parent.hero_mc._y - 19)) {
this._y = this._y + 30;
} else {
if (((this._x + this._width) <= 0) && (!_root.boss)) {
respawn();
}
lastState = state;
state = 0;
action();
if ((((random(30) == 1) && (Math.abs(this._x - _parent.hero_mc._x) > 150)) && (this._x > 0)) && (this._x < 800)) {
lastState = state;
state = 2;
}
if (state != lastState) {
this.gotoAndStop(states[state]);
}
}
}
if (state == 2) {
this._x = this._x - (_root.speed / 3);
}
if ((state == 5) || (state == 6)) {
this._x = this._x - (_root.speed / 3);
if (!die) {
this.gotoAndPlay(states[state]);
die = true;
}
}
}
Instance of Symbol 251 MovieClip "enemy1" in Symbol 380 MovieClip Frame 1
onClipEvent (load) {
function action() {
if (_parent.hero_mc._x > this._x) {
this._xscale = -myScale;
if ((this._x + this._width) <= (((_parent.hero_mc._x - _parent.hero_mc._width) + this._width) - 40)) {
this._x = this._x - ((_root.speed / 3) - (speed / 3));
state = 1;
} else if (!_parent.hero_mc.die) {
this._x = this._x - (_root.speed / 3);
state = 4;
}
} else {
this._xscale = myScale;
if ((this._x + this._width) >= (((_parent.hero_mc._x + _parent.hero_mc._width) + this._width) + 30)) {
this._x = this._x - speed;
state = 1;
} else if (!_parent.hero_mc.die) {
this._x = this._x - (_root.speed / 3);
state = 4;
}
}
}
function respawn() {
if (!kill) {
this._x = oldxpos;
this._y = oldypos;
state = 0;
health = 10;
die = false;
this._xscale = myScale;
gotoAndStop (1);
} else {
this._x = oldxpos;
this._y = oldypos;
die = false;
gotoAndStop (1);
state = 10;
this.enabled = false;
}
}
function checkDead() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + (50 * _root.level);
state = 5;
}
}
function checkDead2() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + 100;
state = 6;
}
}
var speed = 10;
var oldxpos = this._x;
var oldypos = this._y;
var myScale = this._xscale;
var states = ["idle", "walk", "bomb1", "bomb2", "attack", "die1", "die2"];
var state = 0;
var health = 10;
var die = false;
var kill = false;
}
onClipEvent (enterFrame) {
if (((state == 0) || (state == 1)) || (state == 4)) {
if (this._y < (_parent.hero_mc._y - 19)) {
this._y = this._y + 30;
} else {
if (((this._x + this._width) <= 0) && (!_root.boss)) {
respawn();
}
lastState = state;
state = 0;
action();
if ((((random(30) == 1) && (Math.abs(this._x - _parent.hero_mc._x) > 150)) && (this._x > 0)) && (this._x < 800)) {
lastState = state;
state = 2;
}
if (state != lastState) {
this.gotoAndStop(states[state]);
}
}
}
if (state == 2) {
this._x = this._x - (_root.speed / 3);
}
if ((state == 5) || (state == 6)) {
this._x = this._x - (_root.speed / 3);
if (!die) {
this.gotoAndPlay(states[state]);
die = true;
}
}
}
Instance of Symbol 251 MovieClip "enemy5" in Symbol 380 MovieClip Frame 1
onClipEvent (load) {
function action() {
if (_parent.hero_mc._x > this._x) {
this._xscale = -myScale;
if ((this._x + this._width) <= (((_parent.hero_mc._x - _parent.hero_mc._width) + this._width) - 40)) {
this._x = this._x - ((_root.speed / 3) - speed);
state = 1;
} else if (!_parent.hero_mc.die) {
this._x = this._x - (_root.speed / 3);
state = 4;
}
} else {
this._xscale = myScale;
if ((this._x + this._width) >= (((_parent.hero_mc._x + _parent.hero_mc._width) + this._width) + 30)) {
this._x = this._x - speed;
state = 1;
} else if (!_parent.hero_mc.die) {
this._x = this._x - (_root.speed / 3);
state = 4;
}
}
}
function respawn() {
if (!kill) {
this._x = oldxpos;
this._y = oldypos;
state = 0;
health = 10;
die = false;
this._xscale = myScale;
gotoAndStop (1);
} else {
this._x = oldxpos;
this._y = oldypos;
die = false;
gotoAndStop (1);
state = 10;
this.enabled = false;
}
}
function checkDead() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + (100 * _root.level);
state = 5;
}
}
function checkDead2() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + (50 * _root.level);
state = 6;
}
}
var speed = 10;
var oldxpos = this._x;
var oldypos = this._y;
var myScale = this._xscale;
var states = ["idle", "walk", "bomb1", "bomb2", "attack", "die1", "die2"];
var state = 0;
var health = 10;
var die = false;
var kill = false;
}
onClipEvent (enterFrame) {
if (((state == 0) || (state == 1)) || (state == 4)) {
if (this._y < (_parent.hero_mc._y - 19)) {
this._y = this._y + 30;
} else {
if (((this._x + this._width) <= 0) && (!_root.boss)) {
respawn();
}
lastState = state;
state = 0;
action();
if ((((random(30) == 1) && (Math.abs(this._x - _parent.hero_mc._x) > 150)) && (this._x > 0)) && (this._x < 800)) {
lastState = state;
state = 2;
}
if (state != lastState) {
this.gotoAndStop(states[state]);
}
}
}
if (state == 2) {
this._x = this._x - (_root.speed / 3);
}
if ((state == 5) || (state == 6)) {
this._x = this._x - (_root.speed / 3);
if (!die) {
this.gotoAndPlay(states[state]);
die = true;
}
}
}
Instance of Symbol 258 MovieClip "enemy4" in Symbol 380 MovieClip Frame 1
onClipEvent (load) {
function checkCollision(mc2, mc1) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
function respawn() {
if (!kill) {
this._x = oldxpos;
this._y = oldypos;
state = 0;
health = 10;
die = false;
this._xscale = myScale;
gotoAndStop (1);
} else {
this._x = oldxpos;
this._y = oldypos;
die = false;
gotoAndStop (1);
this.enabled = false;
}
}
function checkDead2() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + (100 * _root.level);
gotoAndStop (2);
}
}
function attack() {
if (shootSpeed == maxshootSpeed) {
shootSpeed = 0;
this.target_mc.gotoAndPlay(2);
var _local3 = _parent.attachMovie("ammo2", "ammo1" + _parent.getNextHighestDepth(), _parent.getNextHighestDepth());
_local3.dir = -1;
_local3._xscale = -20;
_local3._x = this._x - 80;
_local3._y = this._y + 9;
_local3.onEnterFrame = function () {
if ((this.hitTest(_parent.hero_mc) && (_parent.hero_mc.health > 0)) && (this._currentframe == 2)) {
if ((checkCollision(this, _parent.hero_mc) != undefined) || (checkCollision(this, _parent.hero_mc) != null)) {
this.gotoAndStop(3);
_parent.hero_mc.health = _parent.hero_mc.health - 10;
_parent.hero_mc.checkDead();
}
}
};
} else {
shootSpeed++;
}
}
var speed = 10;
var oldxpos = this._x;
var oldypos = this._y;
var myScale = this._xscale;
var health = 10;
var die = false;
var kill = false;
var maxshootSpeed = 25;
var shootSpeed = 25;
}
onClipEvent (enterFrame) {
if (_root.boss) {
gotoAndStop (2);
}
this._x = this._x - (_root.speed / 2);
if ((((!die) && (this._x > _parent.hero_mc._x)) && (this._x < 820)) && (this._currentframe == 1)) {
attack();
}
if (((this._x + this._width) <= 0) && (!_root.boss)) {
respawn();
}
}
Instance of Symbol 379 MovieClip "boss_mc" in Symbol 380 MovieClip Frame 1
onClipEvent (load) {
function checkDead() {
if (this.shield_mc._visible) {
health = health + 10;
}
if ((!die) && (health <= 0)) {
die = true;
_root.score = _root.score + 1000;
gotoAndStop (3);
}
}
var counter = 100;
var done = false;
var health = 200;
var die = false;
var counter = 0;
var dir = 1;
var scale = this._xscale;
}
onClipEvent (enterFrame) {
if (_root.boss) {
if (this._y < (_parent.hero_mc._y - 20)) {
this._y = this._y + 30;
}
if ((this._x > _parent.hero_mc._x) && (dir == -1)) {
dir = 1;
this._xscale = scale;
} else if ((this._x <= _parent.hero_mc._x) && (dir == 1)) {
dir = -1;
this._xscale = -scale;
}
if ((!die) && (_parent.hero_mc.health > 0)) {
if (!done) {
target_mc.gotoAndPlay(2);
done = true;
}
}
}
}
Instance of Symbol 292 MovieClip "hero_mc" in Symbol 380 MovieClip Frame 1
onClipEvent (load) {
function checkCollision(mc2, mc1) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
function checkDead() {
_parent.hud_mc.health_mc.getBloodStatus(10);
if ((health <= 0) && (!die)) {
state = 6;
this.gotoAndPlay(states[state]);
die = true;
_root.speed = 0;
}
}
function checkDead2() {
_parent.hud_mc.health_mc.getBloodStatus(15);
if ((health <= 0) && (!die)) {
state = 6;
this.gotoAndPlay(states[state]);
die = true;
_root.speed = 0;
}
}
function run() {
lastState = state;
state = 0;
dir = null;
if (isShooting == true) {
if (shootSpeed == maxshootSpeed) {
i = 0;
while (i < noOfBullets) {
var _local4 = _parent.attachMovie("ammo", "ammo" + _parent.getNextHighestDepth(), _parent.getNextHighestDepth());
_local4.dir = Math.round(this._xscale / 40.3);
_local4._xscale = _local4.dir * 100;
_local4._x = _root.gunPoint.x;
_local4._y = _root.gunPoint.y;
_local4.onEnterFrame = function () {
if (_root.boss != true) {
i = 1;
while (i < _parent.numberOfEnemies) {
if (((this.hitTest(_parent["enemy" + i].target_mc) && (_parent["enemy" + i]._currentframe < 6)) && (_parent["enemy" + i]._x < 850)) && (this._currentframe == 2)) {
if ((checkCollision(this, _parent["enemy" + i]) != undefined) || (checkCollision(this, _parent["enemy" + i]) != null)) {
this.gotoAndStop(3);
_parent["enemy" + i].health = _parent["enemy" + i].health - 10;
if (this._y < (_parent["enemy" + i]._y - 43)) {
_parent["enemy" + i].checkDead();
} else {
_parent["enemy" + i].checkDead2();
}
}
}
i++;
}
} else if (this.hitTest(_parent.boss_mc) && (this._currentframe == 2)) {
if ((checkCollision(this, _parent.boss_mc) != undefined) || (checkCollision(this, _parent.boss_mc) != null)) {
this.gotoAndStop(3);
_parent.boss_mc.health = _parent.boss_mc.health - 10;
_parent.boss_mc.checkDead();
}
}
};
i++;
}
shootSpeed = 3;
} else {
shootSpeed++;
}
}
if (Key.isDown(37) && (!Key.isDown(40))) {
xspeed = xspeed - speed;
this._xscale = -40.3;
state = 2;
dir = "L";
}
if (Key.isDown(39) && (!Key.isDown(40))) {
xspeed = xspeed + speed;
this._xscale = 40.3;
state = 2;
dir = "R";
}
if (Key.isDown(40) && (Key.isDown(39))) {
state = 3;
this._xscale = 40.3;
dir = "R";
}
if (Key.isDown(40) && (Key.isDown(37))) {
state = 3;
this._xscale = -40.3;
dir = "L";
}
if (Key.isDown(40)) {
state = 3;
}
if (Key.isDown(38)) {
state = 4;
}
if (Key.isDown(32)) {
isShooting = true;
if ((((!Key.isDown(39)) && (!Key.isDown(37))) && (!Key.isDown(38))) && (!Key.isDown(40))) {
state = 1;
}
} else {
isShooting = false;
}
if (state != lastState) {
this.gotoAndPlay(states[state]);
}
}
function runB() {
this.xspeed = this.xspeed * airFriction;
if (this.xspeed < (-this.maxspeed)) {
this.xspeed = -this.maxspeed;
}
if (this.maxspeed < this.xspeed) {
this.xspeed = this.maxspeed;
}
this.xpos = this.xpos + (this.xspeed * 3);
}
function renderB() {
if (!_root.boss) {
if ((this._x < 300) && (this._x >= 40)) {
var _local3 = this._x;
this._x = this.xpos;
} else if (this._x < 40) {
this._x = 40;
this.xpos = 40;
} else if (this._x >= 300) {
this._x = 300;
this.xpos = 300;
if (this.xspeed > 0) {
_root.speed = Math.round(this.xspeed * 5);
} else {
if (dir == "L") {
this._x = 299;
this.xpos = 299;
}
_root.speed = 0;
}
}
} else if ((this._x < 760) && (this._x >= 40)) {
var _local3 = this._x;
this._x = this.xpos;
} else if (this._x < 40) {
this._x = 40;
this.xpos = 40;
} else if (this._x > 760) {
this._x = 758;
this.xpos = 758;
}
}
var states = ["idle", "shoot", "walk", "duck", "jump", "shoot2", "death1", "death2", "death3", "idle2"];
var onGround = true;
var isShooting = false;
var speed = 12;
var maxshootSpeed = 8;
var shootSpeed = 8;
var health = 200;
var maxhealth = 100;
var noOfBullets = 1;
var gunType = 1;
var die = false;
speed = 1.8;
state = 0;
q = 0;
var xpos = this._x;
var ypos = this._y;
var scale = (this._xscale / 100);
var maxspeed = 6;
var bounceFriction = 0;
var xspeed = 0;
var yspeed = 0;
var radius = 8;
var mass = (radius * radius);
var laststate;
var state = 0;
var dir;
var xh = 12;
var hitRight = false;
var hitLeft = false;
var gravity = 2.2;
var airFriction = 0.956;
var slidingFriction = 0.6;
var firespeed = 10;
_root.speed = 0;
}
onClipEvent (enterFrame) {
if (!Key.isDown(90)) {
this.xspeed = this.xspeed * slidingFriction;
} else {
this.xspeed = this.xspeed * 0.9;
}
if (state != 6) {
run();
runB();
renderB();
}
}
Symbol 380 MovieClip Frame 2
stop();
Symbol 411 MovieClip Frame 1
var speed = _root.speed;
var oldxpos = this._x;
onEnterFrame = function () {
this._x = this._x - (_root.speed / 2);
if ((this._x + (this._width / 2)) <= 0) {
_parent.distance = _parent.distance + Math.round(this._width / 800);
if (_parent.distance < _parent.maxDistance) {
this._x = (this._x + (this._width * 2)) - (_root.speed / 2);
}
}
};
Symbol 412 MovieClip Frame 1
stop();
Symbol 412 MovieClip Frame 2
play();
Symbol 412 MovieClip Frame 19
_parent._parent._parent.throwGrenade(_parent._parent);
_parent._parent.delay();
Symbol 414 MovieClip Frame 36
stop();
_parent._parent._parent.nextFrame();
Symbol 415 MovieClip Frame 1
stop();
Symbol 415 MovieClip Frame 2
stop();
Symbol 437 MovieClip Frame 1
function checkCollision(mc2, mc1) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
var hit = false;
onEnterFrame = function () {
if (this.hitTest(_parent._parent._parent.hero_mc) && (!hit)) {
if ((checkCollision(_parent._parent, _parent._parent._parent.hero_mc) != undefined) || (checkCollision(_parent._parent, _parent._parent._parent.hero_mc != null))) {
_parent._parent._parent.hero_mc.health = _parent._parent._parent.hero_mc.health - 10;
_parent._parent._parent.hero_mc.checkDead();
hit = true;
}
}
};
Symbol 437 MovieClip Frame 16
hit = false;
Symbol 438 MovieClip Frame 1
stop();
Symbol 438 MovieClip Frame 74
_parent.delay();
Symbol 439 MovieClip Frame 1
stop();
Symbol 439 MovieClip Frame 2
play();
Symbol 439 MovieClip Frame 19
_parent.done = false;
Symbol 441 MovieClip Frame 1
function throwGrenade(clip) {
var _local3 = this.attachMovie("grenade", "grenade" + count, count++);
_local3._x = ((clip._x - (clip._width / 2)) * clip._xscale) / clip.myScale;
_local3._y = ((clip._y - (clip._height / 2)) * clip._xscale) / clip.myScale;
_local3._xscale = (_local3._yscale = 35);
startpx = hero_mc._x;
startpy = clip._y + (clip._height / 2);
endpx = clip._x;
endpy = clip._y;
MovieClip.prototype.bezier1 = new BezierCurve(startpx, startpy, endpx, endpy);
count++;
}
function throwGrenade2(clip) {
var _local3 = this.attachMovie("grenade", "grenade1" + count, count++);
_local3._x = ((clip._x - (clip._width / 2)) * clip._xscale) / clip.myScale;
_local3._y = ((clip._y - (clip._height / 2)) * clip._xscale) / clip.myScale;
_local3._xscale = (_local3._yscale = 30);
startpx = hero_mc._x;
startpy = 530;
endpx = clip._x + (clip._width / 2);
endpy = clip._y - (clip._height / 2);
MovieClip.prototype.bezier1 = new BezierCurve(startpx, startpy, endpx, endpy);
count++;
}
function throwDynamite(clip) {
var _local3 = this.attachMovie("dynamite", "dynamite" + count, count++);
_local3._x = ((clip._x - (clip._width / 2)) * clip._xscale) / clip.myScale;
_local3._y = ((clip._y - (clip._height / 2)) * clip._xscale) / clip.myScale;
_local3._xscale = (_local3._yscale = 50);
startpx = hero_mc._x;
startpy = 530;
endpx = boss_mc._x;
endpy = boss_mc._y;
MovieClip.prototype.bezier1 = new BezierCurve(startpx, startpy, endpx, endpy);
count++;
}
stop();
MovieClip.prototype.Point = function (x, y) {
this._x = x;
this._y = y;
};
MovieClip.prototype.BezierCurve = function (endpx1, endpy1, endpx2, endpy2) {
this.x0 = endpx2 + _root.speed;
this.y0 = endpy2;
this.x3 = endpx1 + _root.speed;
this.y3 = endpy1;
this.x1 = (this.x0 + this.x3) / 2;
this.y1 = (this.y0 + this.y3) / 20;
this.x2 = (this.x0 + this.x3) / 2;
this.y2 = (this.y0 + this.y3) / 20;
};
Object.prototype.BezierPosition = function (bez, t) {
t = Math.min(Math.max(t, 0), 1);
var _local4 = 3 * (bez.x1 - bez.x0);
var _local5 = (3 * (bez.x2 - bez.x1)) - _local4;
var _local6 = ((bez.x3 - bez.x0) - _local4) - _local5;
this._x = (((((_local6 * t) * t) * t) + ((_local5 * t) * t)) + (_local4 * t)) + bez.x0;
_local4 = 3 * (bez.y1 - bez.y0);
_local5 = (3 * (bez.y2 - bez.y1)) - _local4;
_local6 = ((bez.y3 - bez.y0) - _local4) - _local5;
this._y = (((((_local6 * t) * t) * t) + ((_local5 * t) * t)) + (_local4 * t)) + bez.y0;
};
count = 0;
_root.speed = 0;
_root.boss = false;
_root.kills = 0;
_root.levelScore = 12000;
var maxKills = 90;
var numberOfEnemies = 7;
var levelComplete = false;
var distance = 0;
var maxDistance = 12;
onEnterFrame = function () {
if (!levelComplete) {
if (distance >= maxDistance) {
i = 1;
while (i < numberOfEnemies) {
this["enemy" + i].kill = true;
_parent["enemy" + i].health = 0;
this["enemy" + i].state = 5;
i++;
}
_root.speed = 0;
_root.boss = true;
levelComplete = true;
}
}
};
Instance of Symbol 238 MovieClip "enemy3" in Symbol 441 MovieClip Frame 1
onClipEvent (load) {
function respawn() {
if (!kill) {
this._x = oldxpos;
this._y = oldypos;
state = 0;
health = 10;
die = false;
this._xscale = myScale;
gotoAndStop (1);
} else {
this._x = oldxpos;
this._y = oldypos;
die = false;
gotoAndStop (1);
this.enabled = false;
}
}
function checkDead() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + (100 * _root.level);
gotoAndStop (2);
}
}
function attack() {
if ((random(25) == 1) && (this.target_mc._currentframe == 1)) {
this.target_mc.gotoAndPlay(2);
}
}
var speed = 10;
var oldxpos = this._x;
var oldypos = this._y;
var myScale = this._xscale;
var health = 10;
var die = false;
var kill = false;
}
onClipEvent (enterFrame) {
if (_root.boss) {
gotoAndStop (2);
}
this._x = this._x - (_root.speed / 2);
if ((((!die) && (this._x > _parent.hero_mc._x)) && (this._x < 800)) && (this._currentframe == 1)) {
attack();
}
if (((this._x + this._width) <= 0) && (!_root.boss)) {
respawn();
}
}
Instance of Symbol 251 MovieClip "enemy2" in Symbol 441 MovieClip Frame 1
onClipEvent (load) {
function action() {
if (_parent.hero_mc._x > this._x) {
this._xscale = -myScale;
if ((this._x + this._width) <= (((_parent.hero_mc._x - _parent.hero_mc._width) + this._width) - 40)) {
this._x = this._x - ((_root.speed / 3) - (speed / 3));
state = 1;
} else if (!_parent.hero_mc.die) {
this._x = this._x - (_root.speed / 3);
state = 4;
}
} else {
this._xscale = myScale;
if ((this._x + this._width) >= (((_parent.hero_mc._x + _parent.hero_mc._width) + this._width) + 30)) {
this._x = this._x - speed;
state = 1;
} else if (!_parent.hero_mc.die) {
this._x = this._x - (_root.speed / 3);
state = 4;
}
}
}
function respawn() {
if (!kill) {
this._x = oldxpos;
this._y = oldypos;
state = 0;
health = 10;
die = false;
this._xscale = myScale;
gotoAndStop (1);
} else {
this._x = oldxpos;
this._y = oldypos;
die = false;
gotoAndStop (1);
state = 10;
this.enabled = false;
}
}
function checkDead() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + (100 * _root.level);
state = 5;
}
}
function checkDead2() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + (50 * _root.level);
state = 6;
}
}
var speed = 10;
var oldxpos = this._x;
var oldypos = this._y;
var myScale = this._xscale;
var states = ["idle", "walk", "bomb1", "bomb2", "attack", "die1", "die2"];
var state = 0;
var health = 10;
var die = false;
var kill = false;
}
onClipEvent (enterFrame) {
if (((state == 0) || (state == 1)) || (state == 4)) {
if (this._y < (_parent.hero_mc._y - 19)) {
this._y = this._y + 30;
} else {
if (((this._x + this._width) <= 0) && (!_root.boss)) {
respawn();
}
lastState = state;
state = 0;
action();
if ((((random(30) == 1) && (Math.abs(this._x - _parent.hero_mc._x) > 150)) && (this._x > 0)) && (this._x < 800)) {
lastState = state;
state = 2;
}
if (state != lastState) {
this.gotoAndStop(states[state]);
}
}
}
if (state == 2) {
this._x = this._x - (_root.speed / 3);
}
if ((state == 5) || (state == 6)) {
this._x = this._x - (_root.speed / 3);
if (!die) {
this.gotoAndPlay(states[state]);
die = true;
}
}
}
Instance of Symbol 251 MovieClip "enemy1" in Symbol 441 MovieClip Frame 1
onClipEvent (load) {
function action() {
if (_parent.hero_mc._x > this._x) {
this._xscale = -myScale;
if ((this._x + this._width) <= (((_parent.hero_mc._x - _parent.hero_mc._width) + this._width) - 40)) {
this._x = this._x - ((_root.speed / 3) - (speed / 3));
state = 1;
} else if (!_parent.hero_mc.die) {
this._x = this._x - (_root.speed / 3);
state = 4;
}
} else {
this._xscale = myScale;
if ((this._x + this._width) >= (((_parent.hero_mc._x + _parent.hero_mc._width) + this._width) + 30)) {
this._x = this._x - speed;
state = 1;
} else if (!_parent.hero_mc.die) {
this._x = this._x - (_root.speed / 3);
state = 4;
}
}
}
function respawn() {
if (!kill) {
this._x = oldxpos;
this._y = oldypos;
state = 0;
health = 10;
die = false;
this._xscale = myScale;
gotoAndStop (1);
} else {
this._x = oldxpos;
this._y = oldypos;
die = false;
gotoAndStop (1);
state = 10;
this.enabled = false;
}
}
function checkDead() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + (50 * _root.level);
state = 5;
}
}
function checkDead2() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + 100;
state = 6;
}
}
var speed = 10;
var oldxpos = this._x;
var oldypos = this._y;
var myScale = this._xscale;
var states = ["idle", "walk", "bomb1", "bomb2", "attack", "die1", "die2"];
var state = 0;
var health = 10;
var die = false;
var kill = false;
}
onClipEvent (enterFrame) {
if (((state == 0) || (state == 1)) || (state == 4)) {
if (this._y < (_parent.hero_mc._y - 19)) {
this._y = this._y + 30;
} else {
if (((this._x + this._width) <= 0) && (!_root.boss)) {
respawn();
}
lastState = state;
state = 0;
action();
if ((((random(30) == 1) && (Math.abs(this._x - _parent.hero_mc._x) > 150)) && (this._x > 0)) && (this._x < 800)) {
lastState = state;
state = 2;
}
if (state != lastState) {
this.gotoAndStop(states[state]);
}
}
}
if (state == 2) {
this._x = this._x - (_root.speed / 3);
}
if ((state == 5) || (state == 6)) {
this._x = this._x - (_root.speed / 3);
if (!die) {
this.gotoAndPlay(states[state]);
die = true;
}
}
}
Instance of Symbol 251 MovieClip "enemy5" in Symbol 441 MovieClip Frame 1
onClipEvent (load) {
function action() {
if (_parent.hero_mc._x > this._x) {
this._xscale = -myScale;
if ((this._x + this._width) <= (((_parent.hero_mc._x - _parent.hero_mc._width) + this._width) - 40)) {
this._x = this._x - ((_root.speed / 3) - speed);
state = 1;
} else if (!_parent.hero_mc.die) {
this._x = this._x - (_root.speed / 3);
state = 4;
}
} else {
this._xscale = myScale;
if ((this._x + this._width) >= (((_parent.hero_mc._x + _parent.hero_mc._width) + this._width) + 30)) {
this._x = this._x - speed;
state = 1;
} else if (!_parent.hero_mc.die) {
this._x = this._x - (_root.speed / 3);
state = 4;
}
}
}
function respawn() {
if (!kill) {
this._x = oldxpos;
this._y = oldypos;
state = 0;
health = 10;
die = false;
this._xscale = myScale;
gotoAndStop (1);
} else {
this._x = oldxpos;
this._y = oldypos;
die = false;
gotoAndStop (1);
state = 10;
this.enabled = false;
}
}
function checkDead() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + (100 * _root.level);
state = 5;
}
}
function checkDead2() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + (50 * _root.level);
state = 6;
}
}
var speed = 10;
var oldxpos = this._x;
var oldypos = this._y;
var myScale = this._xscale;
var states = ["idle", "walk", "bomb1", "bomb2", "attack", "die1", "die2"];
var state = 0;
var health = 10;
var die = false;
var kill = false;
}
onClipEvent (enterFrame) {
if (((state == 0) || (state == 1)) || (state == 4)) {
if (this._y < (_parent.hero_mc._y - 19)) {
this._y = this._y + 30;
} else {
if (((this._x + this._width) <= 0) && (!_root.boss)) {
respawn();
}
lastState = state;
state = 0;
action();
if ((((random(30) == 1) && (Math.abs(this._x - _parent.hero_mc._x) > 150)) && (this._x > 0)) && (this._x < 800)) {
lastState = state;
state = 2;
}
if (state != lastState) {
this.gotoAndStop(states[state]);
}
}
}
if (state == 2) {
this._x = this._x - (_root.speed / 3);
}
if ((state == 5) || (state == 6)) {
this._x = this._x - (_root.speed / 3);
if (!die) {
this.gotoAndPlay(states[state]);
die = true;
}
}
}
Instance of Symbol 251 MovieClip "enemy6" in Symbol 441 MovieClip Frame 1
onClipEvent (load) {
function action() {
if (_parent.hero_mc._x > this._x) {
this._xscale = -myScale;
if ((this._x + this._width) <= (((_parent.hero_mc._x - _parent.hero_mc._width) + this._width) - 40)) {
this._x = this._x - ((_root.speed / 3) - speed);
state = 1;
} else if (!_parent.hero_mc.die) {
this._x = this._x - (_root.speed / 3);
state = 4;
}
} else {
this._xscale = myScale;
if ((this._x + this._width) >= (((_parent.hero_mc._x + _parent.hero_mc._width) + this._width) + 30)) {
this._x = this._x - speed;
state = 1;
} else if (!_parent.hero_mc.die) {
this._x = this._x - (_root.speed / 3);
state = 4;
}
}
}
function respawn() {
if (!kill) {
this._x = _parent.hero_mc._x;
this._y = oldypos;
state = 0;
health = 10;
die = false;
this._xscale = myScale;
gotoAndStop (1);
} else {
this._x = oldxpos;
this._y = oldypos;
die = false;
gotoAndStop (1);
state = 10;
this.enabled = false;
}
}
function checkDead() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + (50 * _root.level);
state = 5;
}
}
function checkDead2() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + 100;
state = 6;
}
}
var speed = 10;
this._x = _parent.hero_mc._x;
var oldxpos = this._x;
var oldypos = this._y;
var myScale = this._xscale;
var states = ["idle", "walk", "bomb1", "bomb2", "attack", "die1", "die2"];
var state = 0;
var health = 10;
var die = false;
var kill = false;
}
onClipEvent (enterFrame) {
if (((state == 0) || (state == 1)) || (state == 4)) {
if (this._y < (_parent.hero_mc._y - 19)) {
this._y = this._y + 30;
} else {
if (((this._x + this._width) <= 0) && (!_root.boss)) {
respawn();
}
lastState = state;
state = 0;
action();
if ((((random(30) == 1) && (Math.abs(this._x - _parent.hero_mc._x) > 150)) && (this._x > 0)) && (this._x < 800)) {
lastState = state;
state = 2;
}
if (state != lastState) {
this.gotoAndStop(states[state]);
}
}
}
if (state == 2) {
this._x = this._x - (_root.speed / 3);
}
if ((state == 5) || (state == 6)) {
this._x = this._x - (_root.speed / 3);
if (!die) {
this.gotoAndPlay(states[state]);
die = true;
}
}
}
Instance of Symbol 251 MovieClip "enemy4" in Symbol 441 MovieClip Frame 1
onClipEvent (load) {
function action() {
if (_parent.hero_mc._x > this._x) {
this._xscale = -myScale;
if ((this._x + this._width) <= (((_parent.hero_mc._x - _parent.hero_mc._width) + this._width) - 40)) {
this._x = this._x - ((_root.speed / 3) - (speed / 3));
state = 1;
} else if (!_parent.hero_mc.die) {
this._x = this._x - (_root.speed / 3);
state = 4;
}
} else {
this._xscale = myScale;
if ((this._x + this._width) >= (((_parent.hero_mc._x + _parent.hero_mc._width) + this._width) + 30)) {
this._x = this._x - speed;
state = 1;
} else if (!_parent.hero_mc.die) {
this._x = this._x - (_root.speed / 3);
state = 4;
}
}
}
function respawn() {
if (!kill) {
this._x = oldxpos;
this._y = oldypos;
state = 0;
health = 10;
die = false;
this._xscale = myScale;
gotoAndStop (1);
} else {
this._x = oldxpos;
this._y = oldypos;
die = false;
gotoAndStop (1);
state = 10;
this.enabled = false;
}
}
function checkDead() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + (100 * _root.level);
state = 5;
}
}
function checkDead2() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + (50 * _root.level);
state = 6;
}
}
var speed = 10;
var oldxpos = this._x;
var oldypos = this._y;
var myScale = this._xscale;
var states = ["idle", "walk", "bomb1", "bomb2", "attack", "die1", "die2"];
var state = 0;
var health = 10;
var die = false;
var kill = false;
}
onClipEvent (enterFrame) {
if (((state == 0) || (state == 1)) || (state == 4)) {
if (this._y < (_parent.hero_mc._y - 19)) {
this._y = this._y + 30;
} else {
if (((this._x + this._width) <= 0) && (!_root.boss)) {
respawn();
}
lastState = state;
state = 0;
action();
if ((((random(30) == 1) && (Math.abs(this._x - _parent.hero_mc._x) > 150)) && (this._x > 0)) && (this._x < 800)) {
lastState = state;
state = 2;
}
if (state != lastState) {
this.gotoAndStop(states[state]);
}
}
}
if (state == 2) {
this._x = this._x - (_root.speed / 3);
}
if ((state == 5) || (state == 6)) {
this._x = this._x - (_root.speed / 3);
if (!die) {
this.gotoAndPlay(states[state]);
die = true;
}
}
}
Instance of Symbol 440 MovieClip "boss_mc" in Symbol 441 MovieClip Frame 1
onClipEvent (load) {
function checkDead() {
if ((!die) && (health <= 0)) {
die = true;
_root.score = _root.score + 3000;
this.target_mc.gotoAndPlay(2);
}
}
function attack1() {
this.gun_mc.gotoAndPlay(2);
}
function attack2() {
this.target_mc.target_mc.gotoAndPlay(2);
}
function delay() {
this.delay_mc.gotoAndPlay(2);
}
var speed = 6;
var done = false;
var health = 300;
var die = false;
var dir = 1;
var scale = this._xscale;
var sy = this._y;
var ang = 0;
}
onClipEvent (enterFrame) {
if (_root.boss) {
this._y = sy + (4 * Math.cos((ang = ang + 0.092)));
if (this._x >= 700) {
this._x = this._x - speed;
} else if (((!die) && (_parent.hero_mc.health > 0)) && (this.health > 0)) {
if (!done) {
if (_parent.hero_mc._x > 300) {
attack1();
} else {
if (random(30) == 1) {
attack1();
}
attack2();
}
done = true;
}
}
}
}
Instance of Symbol 292 MovieClip "hero_mc" in Symbol 441 MovieClip Frame 1
onClipEvent (load) {
function checkCollision(mc2, mc1) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
function checkDead() {
_parent.hud_mc.health_mc.getBloodStatus(10);
if ((health <= 0) && (!die)) {
state = 6;
this.gotoAndPlay(states[state]);
die = true;
_root.speed = 0;
}
}
function checkDead2() {
_parent.hud_mc.health_mc.getBloodStatus(15);
if ((health <= 0) && (!die)) {
state = 6;
this.gotoAndPlay(states[state]);
die = true;
_root.speed = 0;
}
}
function run() {
lastState = state;
state = 0;
dir = null;
if (isShooting == true) {
if (shootSpeed == maxshootSpeed) {
i = 0;
while (i < noOfBullets) {
var _local4 = _parent.attachMovie("ammo", "ammo" + _parent.getNextHighestDepth(), _parent.getNextHighestDepth());
_local4.dir = Math.round(this._xscale / 40.3);
_local4._xscale = _local4.dir * 100;
_local4._x = _root.gunPoint.x;
_local4._y = _root.gunPoint.y;
_local4.onEnterFrame = function () {
if (_root.boss != true) {
i = 1;
while (i < _parent.numberOfEnemies) {
if (((this.hitTest(_parent["enemy" + i].target_mc) && (_parent["enemy" + i]._currentframe < 6)) && (_parent["enemy" + i]._x < 850)) && (this._currentframe == 2)) {
if ((checkCollision(this, _parent["enemy" + i]) != undefined) || (checkCollision(this, _parent["enemy" + i]) != null)) {
this.gotoAndStop(3);
_parent["enemy" + i].health = _parent["enemy" + i].health - 10;
if (this._y < (_parent["enemy" + i]._y - 43)) {
_parent["enemy" + i].checkDead();
} else {
_parent["enemy" + i].checkDead2();
}
}
}
i++;
}
} else if ((this.hitTest(_parent.boss_mc.target_mc) && (this._currentframe == 2)) && (!this.hitTest(_parent.boss_mc.boat_mc))) {
if ((checkCollision(this, _parent.boss_mc) != undefined) || (checkCollision(this, _parent.boss_mc) != null)) {
this.gotoAndStop(3);
_parent.boss_mc.health = _parent.boss_mc.health - 10;
_parent.boss_mc.checkDead();
}
}
};
i++;
}
shootSpeed = 3;
} else {
shootSpeed++;
}
}
if (Key.isDown(37) && (!Key.isDown(40))) {
xspeed = xspeed - speed;
this._xscale = -40.3;
state = 2;
dir = "L";
}
if (Key.isDown(39) && (!Key.isDown(40))) {
xspeed = xspeed + speed;
this._xscale = 40.3;
state = 2;
dir = "R";
}
if (Key.isDown(40) && (Key.isDown(39))) {
state = 3;
this._xscale = 40.3;
dir = "R";
}
if (Key.isDown(40) && (Key.isDown(37))) {
state = 3;
this._xscale = -40.3;
dir = "L";
}
if (Key.isDown(40)) {
state = 3;
}
if (Key.isDown(38)) {
state = 4;
}
if (Key.isDown(32)) {
isShooting = true;
if ((((!Key.isDown(39)) && (!Key.isDown(37))) && (!Key.isDown(38))) && (!Key.isDown(40))) {
state = 1;
}
} else {
isShooting = false;
}
if (state != lastState) {
this.gotoAndPlay(states[state]);
}
}
function runB() {
this.xspeed = this.xspeed * airFriction;
if (this.xspeed < (-this.maxspeed)) {
this.xspeed = -this.maxspeed;
}
if (this.maxspeed < this.xspeed) {
this.xspeed = this.maxspeed;
}
this.xpos = this.xpos + (this.xspeed * 3);
}
function renderB() {
if (!_root.boss) {
if ((this._x < 300) && (this._x >= 40)) {
var _local3 = this._x;
this._x = this.xpos;
} else if (this._x < 40) {
this._x = 40;
this.xpos = 40;
} else if (this._x >= 300) {
this._x = 300;
this.xpos = 300;
if (this.xspeed > 0) {
_root.speed = Math.round(this.xspeed * 5);
} else {
if (dir == "L") {
this._x = 299;
this.xpos = 299;
}
_root.speed = 0;
}
}
} else if ((this._x < 460) && (this._x >= 40)) {
var _local3 = this._x;
this._x = this.xpos;
} else if (this._x < 40) {
this._x = 40;
this.xpos = 40;
} else if (this._x > 460) {
this._x = 459;
this.xpos = 459;
}
}
var states = ["idle", "shoot", "walk", "duck", "jump", "shoot2", "death1", "death2", "death3", "idle2"];
var onGround = true;
var isShooting = false;
var speed = 12;
var maxshootSpeed = 8;
var shootSpeed = 8;
var health = 200;
var maxhealth = 100;
var noOfBullets = 1;
var gunType = 1;
var die = false;
speed = 1.8;
state = 0;
q = 0;
var xpos = this._x;
var ypos = this._y;
var scale = (this._xscale / 100);
var maxspeed = 6;
var bounceFriction = 0;
var xspeed = 0;
var yspeed = 0;
var radius = 8;
var mass = (radius * radius);
var laststate;
var state = 0;
var dir;
var xh = 12;
var hitRight = false;
var hitLeft = false;
var gravity = 2.2;
var airFriction = 0.956;
var slidingFriction = 0.6;
var firespeed = 10;
_root.speed = 0;
}
onClipEvent (enterFrame) {
if (!Key.isDown(90)) {
this.xspeed = this.xspeed * slidingFriction;
} else {
this.xspeed = this.xspeed * 0.9;
}
if (state != 6) {
run();
runB();
renderB();
}
}
Symbol 441 MovieClip Frame 2
stop();
Symbol 453 MovieClip Frame 1
var speed = _root.speed;
var oldxpos = this._x;
onEnterFrame = function () {
this._x = this._x - (_root.speed / 2);
if ((this._x + (this._width / 2)) <= 0) {
_parent.distance = _parent.distance + Math.round(this._width / 800);
if (_parent.distance < _parent.maxDistance) {
this._x = (this._x + (this._width * 2)) - (_root.speed / 2);
}
}
};
Symbol 454 MovieClip Frame 49
stop();
_parent._parent._parent.nextFrame();
Symbol 455 MovieClip Frame 1
stop();
Symbol 455 MovieClip Frame 2
stop();
Symbol 456 MovieClip Frame 1
stop();
Symbol 456 MovieClip Frame 2
play();
Symbol 456 MovieClip Frame 90
_parent.done = false;
Symbol 469 MovieClip Frame 1
function throwGrenade(clip) {
var _local3 = this.attachMovie("grenade", "grenade" + count, count++);
_local3._x = ((clip._x - (clip._width / 2)) * clip._xscale) / clip.myScale;
_local3._y = ((clip._y - (clip._height / 2)) * clip._xscale) / clip.myScale;
_local3._xscale = (_local3._yscale = 35);
startpx = hero_mc._x;
startpy = clip._y + (clip._height / 2);
endpx = clip._x;
endpy = clip._y;
MovieClip.prototype.bezier1 = new BezierCurve(startpx, startpy, endpx, endpy);
count++;
}
function throwGrenade2(clip) {
var _local3 = this.attachMovie("grenade", "grenade1" + count, count++);
_local3._x = ((clip._x - (clip._width / 2)) * clip._xscale) / clip.myScale;
_local3._y = ((clip._y - (clip._height / 2)) * clip._xscale) / clip.myScale;
_local3._xscale = (_local3._yscale = 30);
startpx = hero_mc._x;
startpy = 530;
endpx = clip._x + (clip._width / 2);
endpy = clip._y - (clip._height / 2);
MovieClip.prototype.bezier1 = new BezierCurve(startpx, startpy, endpx, endpy);
count++;
}
function throwDynamite(clip) {
var _local3 = this.attachMovie("dynamite", "dynamite" + count, count++);
_local3._x = ((clip._x - (clip._width / 2)) * clip._xscale) / clip.myScale;
_local3._y = ((clip._y - (clip._height / 2)) * clip._xscale) / clip.myScale;
_local3._xscale = (_local3._yscale = 50);
startpx = hero_mc._x;
startpy = 530;
endpx = boss_mc._x;
endpy = boss_mc._y;
MovieClip.prototype.bezier1 = new BezierCurve(startpx, startpy, endpx, endpy);
count++;
}
stop();
MovieClip.prototype.Point = function (x, y) {
this._x = x;
this._y = y;
};
MovieClip.prototype.BezierCurve = function (endpx1, endpy1, endpx2, endpy2) {
this.x0 = endpx2 + _root.speed;
this.y0 = endpy2;
this.x3 = endpx1 + _root.speed;
this.y3 = endpy1;
this.x1 = (this.x0 + this.x3) / 2;
this.y1 = (this.y0 + this.y3) / 20;
this.x2 = (this.x0 + this.x3) / 2;
this.y2 = (this.y0 + this.y3) / 20;
};
Object.prototype.BezierPosition = function (bez, t) {
t = Math.min(Math.max(t, 0), 1);
var _local4 = 3 * (bez.x1 - bez.x0);
var _local5 = (3 * (bez.x2 - bez.x1)) - _local4;
var _local6 = ((bez.x3 - bez.x0) - _local4) - _local5;
this._x = (((((_local6 * t) * t) * t) + ((_local5 * t) * t)) + (_local4 * t)) + bez.x0;
_local4 = 3 * (bez.y1 - bez.y0);
_local5 = (3 * (bez.y2 - bez.y1)) - _local4;
_local6 = ((bez.y3 - bez.y0) - _local4) - _local5;
this._y = (((((_local6 * t) * t) * t) + ((_local5 * t) * t)) + (_local4 * t)) + bez.y0;
};
count = 0;
_root.speed = 0;
_root.boss = false;
_root.kills = 0;
_root.levelScore = 15000;
var maxKills = 120;
var numberOfEnemies = 7;
var levelComplete = false;
var distance = 0;
var maxDistance = 15;
onEnterFrame = function () {
if (!levelComplete) {
if (distance >= maxDistance) {
i = 1;
while (i < numberOfEnemies) {
this["enemy" + i].kill = true;
_parent["enemy" + i].health = 0;
this["enemy" + i].state = 5;
i++;
}
_root.speed = 0;
_root.boss = true;
levelComplete = true;
}
}
};
Instance of Symbol 238 MovieClip "enemy3" in Symbol 469 MovieClip Frame 1
onClipEvent (load) {
function respawn() {
if (!kill) {
this._x = oldxpos;
this._y = oldypos;
state = 0;
health = 10;
die = false;
this._xscale = myScale;
gotoAndStop (1);
} else {
this._x = oldxpos;
this._y = oldypos;
die = false;
gotoAndStop (1);
this.enabled = false;
}
}
function checkDead() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + (100 * _root.level);
gotoAndStop (2);
}
}
function attack() {
if ((random(25) == 1) && (this.target_mc._currentframe == 1)) {
this.target_mc.gotoAndPlay(2);
}
}
var speed = 10;
var oldxpos = this._x;
var oldypos = this._y;
var myScale = this._xscale;
var health = 10;
var die = false;
var kill = false;
}
onClipEvent (enterFrame) {
if (_root.boss) {
gotoAndStop (2);
}
this._x = this._x - (_root.speed / 2);
if ((((!die) && (this._x > _parent.hero_mc._x)) && (this._x < 800)) && (this._currentframe == 1)) {
attack();
}
if (((this._x + this._width) <= 0) && (!_root.boss)) {
respawn();
}
}
Instance of Symbol 251 MovieClip "enemy2" in Symbol 469 MovieClip Frame 1
onClipEvent (load) {
function action() {
if (_parent.hero_mc._x > this._x) {
this._xscale = -myScale;
if ((this._x + this._width) <= (((_parent.hero_mc._x - _parent.hero_mc._width) + this._width) - 40)) {
this._x = this._x - ((_root.speed / 3) - (speed / 3));
state = 1;
} else if (!_parent.hero_mc.die) {
this._x = this._x - (_root.speed / 3);
state = 4;
}
} else {
this._xscale = myScale;
if ((this._x + this._width) >= (((_parent.hero_mc._x + _parent.hero_mc._width) + this._width) + 30)) {
this._x = this._x - speed;
state = 1;
} else if (!_parent.hero_mc.die) {
this._x = this._x - (_root.speed / 3);
state = 4;
}
}
}
function respawn() {
if (!kill) {
this._x = oldxpos;
this._y = oldypos;
state = 0;
health = 10;
die = false;
this._xscale = myScale;
gotoAndStop (1);
} else {
this._x = oldxpos;
this._y = oldypos;
die = false;
gotoAndStop (1);
state = 10;
this.enabled = false;
}
}
function checkDead() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + (100 * _root.level);
state = 5;
}
}
function checkDead2() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + (50 * _root.level);
state = 6;
}
}
var speed = 10;
var oldxpos = this._x;
var oldypos = this._y;
var myScale = this._xscale;
var states = ["idle", "walk", "bomb1", "bomb2", "attack", "die1", "die2"];
var state = 0;
var health = 10;
var die = false;
var kill = false;
}
onClipEvent (enterFrame) {
if (((state == 0) || (state == 1)) || (state == 4)) {
if (this._y < (_parent.hero_mc._y - 19)) {
this._y = this._y + 30;
} else {
if (((this._x + this._width) <= 0) && (!_root.boss)) {
respawn();
}
lastState = state;
state = 0;
action();
if ((((random(30) == 1) && (Math.abs(this._x - _parent.hero_mc._x) > 150)) && (this._x > 0)) && (this._x < 800)) {
lastState = state;
state = 2;
}
if (state != lastState) {
this.gotoAndStop(states[state]);
}
}
}
if (state == 2) {
this._x = this._x - (_root.speed / 3);
}
if ((state == 5) || (state == 6)) {
this._x = this._x - (_root.speed / 3);
if (!die) {
this.gotoAndPlay(states[state]);
die = true;
}
}
}
Instance of Symbol 251 MovieClip "enemy1" in Symbol 469 MovieClip Frame 1
onClipEvent (load) {
function action() {
if (_parent.hero_mc._x > this._x) {
this._xscale = -myScale;
if ((this._x + this._width) <= (((_parent.hero_mc._x - _parent.hero_mc._width) + this._width) - 40)) {
this._x = this._x - ((_root.speed / 3) - (speed / 3));
state = 1;
} else if (!_parent.hero_mc.die) {
this._x = this._x - (_root.speed / 3);
state = 4;
}
} else {
this._xscale = myScale;
if ((this._x + this._width) >= (((_parent.hero_mc._x + _parent.hero_mc._width) + this._width) + 30)) {
this._x = this._x - speed;
state = 1;
} else if (!_parent.hero_mc.die) {
this._x = this._x - (_root.speed / 3);
state = 4;
}
}
}
function respawn() {
if (!kill) {
this._x = oldxpos;
this._y = oldypos;
state = 0;
health = 10;
die = false;
this._xscale = myScale;
gotoAndStop (1);
} else {
this._x = oldxpos;
this._y = oldypos;
die = false;
gotoAndStop (1);
state = 10;
this.enabled = false;
}
}
function checkDead() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + (50 * _root.level);
state = 5;
}
}
function checkDead2() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + 100;
state = 6;
}
}
var speed = 10;
var oldxpos = this._x;
var oldypos = this._y;
var myScale = this._xscale;
var states = ["idle", "walk", "bomb1", "bomb2", "attack", "die1", "die2"];
var state = 0;
var health = 10;
var die = false;
var kill = false;
}
onClipEvent (enterFrame) {
if (((state == 0) || (state == 1)) || (state == 4)) {
if (this._y < (_parent.hero_mc._y - 19)) {
this._y = this._y + 30;
} else {
if (((this._x + this._width) <= 0) && (!_root.boss)) {
respawn();
}
lastState = state;
state = 0;
action();
if ((((random(30) == 1) && (Math.abs(this._x - _parent.hero_mc._x) > 150)) && (this._x > 0)) && (this._x < 800)) {
lastState = state;
state = 2;
}
if (state != lastState) {
this.gotoAndStop(states[state]);
}
}
}
if (state == 2) {
this._x = this._x - (_root.speed / 3);
}
if ((state == 5) || (state == 6)) {
this._x = this._x - (_root.speed / 3);
if (!die) {
this.gotoAndPlay(states[state]);
die = true;
}
}
}
Instance of Symbol 251 MovieClip "enemy5" in Symbol 469 MovieClip Frame 1
onClipEvent (load) {
function action() {
if (_parent.hero_mc._x > this._x) {
this._xscale = -myScale;
if ((this._x + this._width) <= (((_parent.hero_mc._x - _parent.hero_mc._width) + this._width) - 40)) {
this._x = this._x - ((_root.speed / 3) - speed);
state = 1;
} else if (!_parent.hero_mc.die) {
this._x = this._x - (_root.speed / 3);
state = 4;
}
} else {
this._xscale = myScale;
if ((this._x + this._width) >= (((_parent.hero_mc._x + _parent.hero_mc._width) + this._width) + 30)) {
this._x = this._x - speed;
state = 1;
} else if (!_parent.hero_mc.die) {
this._x = this._x - (_root.speed / 3);
state = 4;
}
}
}
function respawn() {
if (!kill) {
this._x = oldxpos;
this._y = oldypos;
state = 0;
health = 10;
die = false;
this._xscale = myScale;
gotoAndStop (1);
} else {
this._x = oldxpos;
this._y = oldypos;
die = false;
gotoAndStop (1);
state = 10;
this.enabled = false;
}
}
function checkDead() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + (100 * _root.level);
state = 5;
}
}
function checkDead2() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + (50 * _root.level);
state = 6;
}
}
var speed = 10;
var oldxpos = this._x;
var oldypos = this._y;
var myScale = this._xscale;
var states = ["idle", "walk", "bomb1", "bomb2", "attack", "die1", "die2"];
var state = 0;
var health = 10;
var die = false;
var kill = false;
}
onClipEvent (enterFrame) {
if (((state == 0) || (state == 1)) || (state == 4)) {
if (this._y < (_parent.hero_mc._y - 19)) {
this._y = this._y + 30;
} else {
if (((this._x + this._width) <= 0) && (!_root.boss)) {
respawn();
}
lastState = state;
state = 0;
action();
if ((((random(30) == 1) && (Math.abs(this._x - _parent.hero_mc._x) > 150)) && (this._x > 0)) && (this._x < 800)) {
lastState = state;
state = 2;
}
if (state != lastState) {
this.gotoAndStop(states[state]);
}
}
}
if (state == 2) {
this._x = this._x - (_root.speed / 3);
}
if ((state == 5) || (state == 6)) {
this._x = this._x - (_root.speed / 3);
if (!die) {
this.gotoAndPlay(states[state]);
die = true;
}
}
}
Instance of Symbol 251 MovieClip "enemy6" in Symbol 469 MovieClip Frame 1
onClipEvent (load) {
function action() {
if (_parent.hero_mc._x > this._x) {
this._xscale = -myScale;
if ((this._x + this._width) <= (((_parent.hero_mc._x - _parent.hero_mc._width) + this._width) - 40)) {
this._x = this._x - ((_root.speed / 3) - speed);
state = 1;
} else if (!_parent.hero_mc.die) {
this._x = this._x - (_root.speed / 3);
state = 4;
}
} else {
this._xscale = myScale;
if ((this._x + this._width) >= (((_parent.hero_mc._x + _parent.hero_mc._width) + this._width) + 30)) {
this._x = this._x - speed;
state = 1;
} else if (!_parent.hero_mc.die) {
this._x = this._x - (_root.speed / 3);
state = 4;
}
}
}
function respawn() {
if (!kill) {
this._x = oldxpos;
this._y = oldypos;
state = 0;
health = 10;
die = false;
this._xscale = myScale;
gotoAndStop (1);
} else {
this._x = oldxpos;
this._y = oldypos;
die = false;
gotoAndStop (1);
state = 10;
this.enabled = false;
}
}
function checkDead() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + (50 * _root.level);
state = 5;
}
}
function checkDead2() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + 100;
state = 6;
}
}
var speed = 10;
var oldxpos = this._x;
var oldypos = this._y;
var myScale = this._xscale;
var states = ["idle", "walk", "bomb1", "bomb2", "attack", "die1", "die2"];
var state = 0;
var health = 10;
var die = false;
var kill = false;
}
onClipEvent (enterFrame) {
if (((state == 0) || (state == 1)) || (state == 4)) {
if (this._y < (_parent.hero_mc._y - 19)) {
this._y = this._y + 30;
} else {
if (((this._x + this._width) <= 0) && (!_root.boss)) {
respawn();
}
lastState = state;
state = 0;
action();
if ((((random(30) == 1) && (Math.abs(this._x - _parent.hero_mc._x) > 150)) && (this._x > 0)) && (this._x < 800)) {
lastState = state;
state = 2;
}
if (state != lastState) {
this.gotoAndStop(states[state]);
}
}
}
if (state == 2) {
this._x = this._x - (_root.speed / 3);
}
if ((state == 5) || (state == 6)) {
this._x = this._x - (_root.speed / 3);
if (!die) {
this.gotoAndPlay(states[state]);
die = true;
}
}
}
Instance of Symbol 258 MovieClip "enemy4" in Symbol 469 MovieClip Frame 1
onClipEvent (load) {
function checkCollision(mc2, mc1) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
function respawn() {
if (!kill) {
this._x = oldxpos;
this._y = oldypos;
state = 0;
health = 10;
die = false;
this._xscale = myScale;
gotoAndStop (1);
} else {
this._x = oldxpos;
this._y = oldypos;
die = false;
gotoAndStop (1);
this.enabled = false;
}
}
function checkDead2() {
if ((health <= 0) && (!die)) {
_root.kills++;
_root.score = _root.score + (100 * _root.level);
gotoAndStop (2);
}
}
function attack() {
if (shootSpeed == maxshootSpeed) {
shootSpeed = 0;
this.target_mc.gotoAndPlay(2);
var _local3 = _parent.attachMovie("ammo2", "ammo1" + _parent.getNextHighestDepth(), _parent.getNextHighestDepth());
_local3.dir = -1;
_local3._xscale = -20;
_local3._x = this._x - 80;
_local3._y = this._y + 9;
_local3.onEnterFrame = function () {
if ((this.hitTest(_parent.hero_mc) && (_parent.hero_mc.health > 0)) && (this._currentframe == 2)) {
if ((checkCollision(this, _parent.hero_mc) != undefined) || (checkCollision(this, _parent.hero_mc) != null)) {
this.gotoAndStop(3);
_parent.hero_mc.health = _parent.hero_mc.health - 10;
_parent.hero_mc.checkDead();
}
}
};
} else {
shootSpeed++;
}
}
var speed = 10;
var oldxpos = this._x;
var oldypos = this._y;
var myScale = this._xscale;
var health = 10;
var die = false;
var kill = false;
var maxshootSpeed = 25;
var shootSpeed = 25;
}
onClipEvent (enterFrame) {
if (_root.boss) {
gotoAndStop (2);
}
this._x = this._x - (_root.speed / 2);
if ((((!die) && (this._x > _parent.hero_mc._x)) && (this._x < 820)) && (this._currentframe == 1)) {
attack();
}
if (((this._x + this._width) <= 0) && (!_root.boss)) {
respawn();
}
}
Instance of Symbol 468 MovieClip "boss_mc" in Symbol 469 MovieClip Frame 1
onClipEvent (load) {
function checkCollision(mc2, mc1) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
function checkDead() {
if ((!die) && (health <= 0)) {
die = true;
_root.score = _root.score + 3000;
this.target_mc.gotoAndPlay(2);
}
}
function attack() {
var randomNo = _root.randomRange(1, 3);
var _local4 = _parent.attachMovie("ammoTank", "ammotank" + _parent.getNextHighestDepth(), _parent.getNextHighestDepth());
_local4.dir = -Math.round(this._xscale / 40.3);
if (randomNo == 1) {
_local4._xscale = (_local4.dir * 100) / 3;
_local4._yscale = (_local4.dir * 100) / 3;
_local4._x = 400;
_local4._y = 500;
}
if (randomNo == 2) {
_local4._xscale = _local4.dir * 100;
_local4._yscale = _local4.dir * 100;
_local4._x = 350;
_local4._y = 430;
}
if (randomNo == 3) {
_local4._xscale = (_local4.dir * 100) / 3;
_local4._yscale = (_local4.dir * 100) / 3;
_local4._x = 590;
_local4._y = 372;
}
_local4.onEnterFrame = function () {
if (this.hitTest(_parent.hero_mc.target_mc) && (this._currentframe == 2)) {
if ((checkCollision(this, _parent.hero_mc) != undefined) || (checkCollision(this, _parent.hero_mc) != null)) {
this.gotoAndStop(3);
_parent.hero_mc.health = _parent.hero_mc.health - 10;
_parent.hero_mc.checkDead();
if (randomNo == 2) {
_parent.hero_mc.health = _parent.hero_mc.health - 10;
_parent.hero_mc.checkDead();
_parent.hero_mc.health = _parent.hero_mc.health - 10;
_parent.hero_mc.checkDead();
}
}
}
};
this[("gun" + randomNo) + "_mc"].gotoAndPlay(2);
}
function delay() {
this.delay_mc.gotoAndPlay(2);
}
var speed = 6;
var done = false;
var health = 100;
var die = false;
var dir = 1;
var scale = this._xscale;
}
onClipEvent (enterFrame) {
if (_root.boss) {
if ((_parent.hero_mc.hitTest(this.tank_mc) && (this.health > 0)) && (_parent.hero_mc.health > 0)) {
if ((checkCollision(this, _parent.hero_mc) != undefined) || (checkCollision(this, _parent.hero_mc) != null)) {
_parent.hero_mc.health = _parent.hero_mc.health - 15;
_parent.hero_mc.checkDead2();
}
}
if (this._x >= 700) {
this._x = this._x - speed;
} else if (((!die) && (_parent.hero_mc.health > 0)) && (this.health > 0)) {
if (!done) {
attack();
done = true;
}
}
}
}
Instance of Symbol 292 MovieClip "hero_mc" in Symbol 469 MovieClip Frame 1
onClipEvent (load) {
function checkCollision(mc2, mc1) {
var _local1 = classes.CollisionDetection.checkForCollision(mc1, mc2, 120);
return(_local1);
}
function checkDead() {
_parent.hud_mc.health_mc.getBloodStatus(10);
if ((health <= 0) && (!die)) {
state = 6;
this.gotoAndPlay(states[state]);
die = true;
_root.speed = 0;
}
}
function checkDead2() {
_parent.hud_mc.health_mc.getBloodStatus(15);
if ((health <= 0) && (!die)) {
state = 6;
this.gotoAndPlay(states[state]);
die = true;
_root.speed = 0;
}
}
function run() {
lastState = state;
state = 0;
dir = null;
if (isShooting == true) {
if (shootSpeed == maxshootSpeed) {
i = 0;
while (i < noOfBullets) {
var _local4 = _parent.attachMovie("ammo", "ammo" + _parent.getNextHighestDepth(), _parent.getNextHighestDepth());
_local4.dir = Math.round(this._xscale / 40.3);
_local4._xscale = _local4.dir * 100;
_local4._x = _root.gunPoint.x;
_local4._y = _root.gunPoint.y;
_local4.onEnterFrame = function () {
if (_root.boss != true) {
i = 1;
while (i < _parent.numberOfEnemies) {
if (((this.hitTest(_parent["enemy" + i].target_mc) && (_parent["enemy" + i]._currentframe < 6)) && (_parent["enemy" + i]._x < 850)) && (this._currentframe == 2)) {
if ((checkCollision(this, _parent["enemy" + i]) != undefined) || (checkCollision(this, _parent["enemy" + i]) != null)) {
this.gotoAndStop(3);
_parent["enemy" + i].health = _parent["enemy" + i].health - 10;
if (this._y < (_parent["enemy" + i]._y - 43)) {
_parent["enemy" + i].checkDead();
} else {
_parent["enemy" + i].checkDead2();
}
}
}
i++;
}
} else if ((this.hitTest(_parent.boss_mc.target_mc) && (this._currentframe == 2)) && (!this.hitTest(_parent.boss_mc.tank_mc))) {
if ((checkCollision(this, _parent.boss_mc) != undefined) || (checkCollision(this, _parent.boss_mc) != null)) {
this.gotoAndStop(3);
_parent.boss_mc.health = _parent.boss_mc.health - 10;
_parent.boss_mc.checkDead();
}
}
};
i++;
}
shootSpeed = 3;
} else {
shootSpeed++;
}
}
if (Key.isDown(37) && (!Key.isDown(40))) {
xspeed = xspeed - speed;
this._xscale = -40.3;
state = 2;
dir = "L";
}
if (Key.isDown(39) && (!Key.isDown(40))) {
xspeed = xspeed + speed;
this._xscale = 40.3;
state = 2;
dir = "R";
}
if (Key.isDown(40) && (Key.isDown(39))) {
state = 3;
this._xscale = 40.3;
dir = "R";
}
if (Key.isDown(40) && (Key.isDown(37))) {
state = 3;
this._xscale = -40.3;
dir = "L";
}
if (Key.isDown(40)) {
state = 3;
}
if (Key.isDown(38)) {
state = 4;
}
if (Key.isDown(32)) {
isShooting = true;
if ((((!Key.isDown(39)) && (!Key.isDown(37))) && (!Key.isDown(38))) && (!Key.isDown(40))) {
state = 1;
}
} else {
isShooting = false;
}
if (state != lastState) {
this.gotoAndPlay(states[state]);
}
}
function runB() {
this.xspeed = this.xspeed * airFriction;
if (this.xspeed < (-this.maxspeed)) {
this.xspeed = -this.maxspeed;
}
if (this.maxspeed < this.xspeed) {
this.xspeed = this.maxspeed;
}
this.xpos = this.xpos + (this.xspeed * 3);
}
function renderB() {
if (!_root.boss) {
if ((this._x < 300) && (this._x >= 40)) {
var _local3 = this._x;
this._x = this.xpos;
} else if (this._x < 40) {
this._x = 40;
this.xpos = 40;
} else if (this._x >= 300) {
this._x = 300;
this.xpos = 300;
if (this.xspeed > 0) {
_root.speed = Math.round(this.xspeed * 5);
} else {
if (dir == "L") {
this._x = 299;
this.xpos = 299;
}
_root.speed = 0;
}
}
} else if ((this._x < 760) && (this._x >= 40)) {
var _local3 = this._x;
this._x = this.xpos;
} else if (this._x < 40) {
this._x = 40;
this.xpos = 40;
} else if (this._x > 760) {
this._x = 758;
this.xpos = 758;
}
}
var states = ["idle", "shoot", "walk", "duck", "jump", "shoot2", "death1", "death2", "death3", "idle2"];
var onGround = true;
var isShooting = false;
var speed = 12;
var maxshootSpeed = 8;
var shootSpeed = 8;
var health = 200;
var maxhealth = 100;
var noOfBullets = 1;
var gunType = 1;
var die = false;
speed = 1.8;
state = 0;
q = 0;
var xpos = this._x;
var ypos = this._y;
var scale = (this._xscale / 100);
var maxspeed = 6;
var bounceFriction = 0;
var xspeed = 0;
var yspeed = 0;
var radius = 8;
var mass = (radius * radius);
var laststate;
var state = 0;
var dir;
var xh = 12;
var hitRight = false;
var hitLeft = false;
var gravity = 2.2;
var airFriction = 0.956;
var slidingFriction = 0.6;
var firespeed = 10;
_root.speed = 0;
}
onClipEvent (enterFrame) {
if (!Key.isDown(90)) {
this.xspeed = this.xspeed * slidingFriction;
} else {
this.xspeed = this.xspeed * 0.9;
}
if (state != 6) {
run();
runB();
renderB();
}
}
Symbol 469 MovieClip Frame 2
stop();
Symbol 482 MovieClip Frame 50
stopAllSounds();
next_btn.onRelease = function () {
_parent.nextFrame();
};
Symbol 491 Button
on (release) {
_root._newUser();
}
Symbol 498 MovieClip Frame 1
stop();
username_txt.onSetFocus = function () {
if (username_txt.text == "Invalid Nickname!") {
username_txt.text = "";
}
};
Selection.setFocus("username_txt");
playAgain_btn.onRelease = function () {
_root.score = 0;
mystr = _root.levelArray[int(_root.level - 1)];
_root._playAgain(_root, mystr);
};
submit_btn.onRelease = function () {
trace((((_root.score + " ") + _root._gameid) + " ") + _root.uname);
_root.dataSubmit(_root.uname, _root.score, _root._gameid, _root, "gameOver", "connecting", "highScores");
};
Symbol 513 MovieClip Frame 1
stop();
playAgain_btn.onRelease = function () {
_root.score = 0;
_root.gotoAndStop(_root.levelArray[int(_root.level - 1)]);
};
submit_btn.onRelease = function () {
_root.gotoAndStop("highScores");
};
Symbol 516 Button
on (release) {
_root.cancelSubmit(_root, "gameOver");
}
Symbol 553 MovieClip Frame 1
stop();
_root.displayScores(this);
playAgain_btn.onRelease = function () {
_root.score = 0;
_root.playIntro = true;
_root.playIntroSound = true;
_root.level = 1;
mystr = _root.levelArray[int(_root.level - 1)];
_root._playAgain(_root, "lblgameintro");
};
mainMenu_btn.onRelease = function () {
_root.score = 0;
_root.level = 1;
_root.gotoAndStop("select");
};