Frame 1
var CPMStarPoolID = 1052;
var CPMStarSubPoolID = 6;
System.security.allowDomain("server.cpmstar.com");
adBox.loadMovie((("http://server.cpmstar.com/adviewas2.swf?poolid=" + CPMStarPoolID) + "&subpoolid=") + CPMStarSubPoolID);
_lockroot = true;
Frame 2
stopAllSounds();
_root.bytesLoaded = _root.getBytesLoaded();
_root.bytesTotal = _root.getBytesTotal();
_root.percentLoaded = Math.round(100 * (_root.bytesLoaded / _root.bytesTotal));
_root.percentLoadedText = _root.percentLoaded + "%";
_root.bar.gotoAndStop(percentLoaded);
Stage.scaleMode = "noScale";
Stage.showMenu = false;
_quality = "high";
Frame 3
if (_root.percentLoaded == 100) {
gotoAndStop (4);
} else {
gotoAndPlay (2);
}
Frame 5
stop();
Instance of Symbol 196 MovieClip in Frame 5
onClipEvent (enterFrame) {
this.onPress = function () {
getURL ("http://www.armorgames.com", "_blank");
};
}
Frame 6
function onEnterFrame() {
if (fadeActive == false) {
if (FADER._alpha > 0) {
FADER._alpha = FADER._alpha - 5;
}
} else if (fadeActive == true) {
if (FADER._alpha < 100) {
FADER._alpha = FADER._alpha + 10;
} else {
gotoAndStop(fadeTarg);
fadeActive = false;
}
}
}
function gotoFrame(targ, col) {
fadeActive = true;
fadeTarg = targ;
FADER.gotoAndStop(col);
}
function playSound(targ, vol) {
var _local1 = new Sound();
_local1.attachSound(targ);
_local1.start();
}
function newData() {
saveObject.level = 1;
saveObject.coins = 0;
saveObject.deaths = 0;
saveObject.kills = 0;
saveObject.timer = 0;
saveData();
}
function loadData() {
saveObject = savefile.data.saveObject;
}
function newMedal(medal) {
if (savefile.data["S_" + medal] != true) {
savefile.data["S_" + medal] = true;
savefile.flush();
return(true);
}
}
function saveData() {
savefile.data.saveObject = saveObject;
savefile.flush();
}
coinArray = new Array(null, 40, 60, 80, 100, 120, 140, 160, 180, 200, 220);
var fadeActive = false;
var saveObject = new Object();
var savefile = SharedObject.getLocal("SKA_AG");
play();
Frame 7
stop();
if ((savefile.data.saveObject.level == undefined) || (savefile.data.saveObject.level == 1)) {
contButton._alpha = 50;
}
Frame 9
function checkMedals() {
var _local2 = 1;
while (_local2 < 7) {
if (savefile.data["S_" + _local2] == undefined) {
this["S_" + _local2]._alpha = 10;
} else {
this["S_" + _local2]._alpha = 100;
}
_local2++;
}
}
checkMedals();
Frame 14
function __rankz_send__(par1, par2, par3, par4) {
par227 = new LoadVars();
par228 = new LoadVars();
par227.flashkey = par2;
par227.SU0249 = par1;
par227.bmFtZTE = par3;
par227.c2NvcmUx = par4 + "Z";
par227.c2NvcmUx = par227.c2NvcmUx.split("0").join("U");
par227.c2NvcmUx = par227.c2NvcmUx.split("").join("A");
par227.c2NvcmUx = par227.c2NvcmUx.split("AU").join("Y");
par227.c2NvcmUx = par227.c2NvcmUx.split("A1").join("B");
par227.c2NvcmUx = par227.c2NvcmUx.split(".").join("N");
par227.flashkey = par227.flashkey.split("=").join("");
par227.SU0249 = par227.SU0249.split("=").join("");
par228.onLoad = function (success) {
if (success) {
trace(par228.msg);
} else {
trace(par228.loaded);
}
};
par227.sendAndLoad("http://rankz.armorbot.com/submit/as3_v0.php", par228, "POST");
}
var score = _root.timer;
timeText.text = score + " Seconds";
var medalPrompt = false;
if (newMedal(1) == true) {
medalPrompt = true;
}
if (score < 600) {
if (newMedal(2) == true) {
medalPrompt = true;
}
}
if (saveObject.deaths == 0) {
if (newMedal(3) == true) {
medalPrompt = true;
}
}
if (saveObject.coins >= 267) {
if (newMedal(4) == true) {
medalPrompt = true;
}
}
if (saveObject.kills >= 25) {
if (newMedal(5) == true) {
medalPrompt = true;
}
}
if (saveObject.kills == 0) {
if (newMedal(6) == true) {
medalPrompt = true;
}
}
newData();
MP._visible = medalPrompt;
subBut._alpha = 100;
Frame 16
nextFrame();
Frame 17
_quality = "medium";
stop();
Frame 18
if (saveObject.level == 10) {
stopAllSounds();
saveObject.level = 1;
_root.saveData();
gotoAndStop ("OUTRO1");
} else {
gotoAndStop ("GAMEPLAY");
}
Symbol 16 MovieClip [Arrow] Frame 1
var xPos = _x;
var yPos = _y;
var XSpeed = 0;
var YSpeed = 0;
Symbol 21 MovieClip Frame 1
gotoAndStop(_parent.visualStyle);
gotoAndStop(_parent._parent.visualStyle);
gotoAndStop(_parent._parent._parent.visualStyle);
Symbol 27 MovieClip Frame 1
gotoAndStop(_parent.visualStyle);
gotoAndStop(_parent._parent.visualStyle);
gotoAndStop(_parent._parent._parent.visualStyle);
gotoAndStop(_parent._parent._parent._parent.visualStyle);
Symbol 31 MovieClip Frame 1
gotoAndStop(_parent.visualStyle);
gotoAndStop(_parent._parent.visualStyle);
gotoAndStop(_parent._parent._parent.visualStyle);
Symbol 34 MovieClip Frame 1
gotoAndStop(_parent.visualStyle);
gotoAndStop(_parent._parent.visualStyle);
gotoAndStop(_parent._parent._parent.visualStyle);
Symbol 38 MovieClip Frame 1
gotoAndStop(_parent.visualStyle);
gotoAndStop(_parent._parent.visualStyle);
gotoAndStop(_parent._parent._parent.visualStyle);
Symbol 42 MovieClip Frame 1
gotoAndStop(_parent.visualStyle);
gotoAndStop(_parent._parent.visualStyle);
gotoAndStop(_parent._parent._parent.visualStyle);
Symbol 46 MovieClip Frame 1
gotoAndStop(_parent.visualStyle);
gotoAndStop(_parent._parent.visualStyle);
gotoAndStop(_parent._parent._parent.visualStyle);
gotoAndStop(_parent._parent._parent._parent.visualStyle);
Symbol 49 MovieClip Frame 1
gotoAndStop(_parent.visualStyle);
gotoAndStop(_parent._parent.visualStyle);
gotoAndStop(_parent._parent._parent.visualStyle);
Symbol 53 MovieClip Frame 1
gotoAndStop(_parent.visualStyle);
gotoAndStop(_parent._parent.visualStyle);
gotoAndStop(_parent._parent._parent.visualStyle);
Symbol 57 MovieClip Frame 1
gotoAndStop(_parent.visualStyle);
gotoAndStop(_parent._parent.visualStyle);
gotoAndStop(_parent._parent._parent.visualStyle);
Symbol 85 MovieClip Frame 1
stop();
Symbol 85 MovieClip Frame 5
stop();
Symbol 87 MovieClip Frame 1
_alpha = 0;
Symbol 88 MovieClip Frame 1
stop();
Symbol 88 MovieClip Frame 5
stop();
Symbol 100 MovieClip Frame 1
function onEnterFrame() {
_rotation = (_rotation + 30);
}
Symbol 136 MovieClip Frame 1
function onEnterFrame() {
if (ragDollTime > 0) {
_rotation = (_rotation + ragDollSpin);
if (_rotation > (ragDollStart + ragDollLimit)) {
_rotation = (ragDollStart + ragDollLimit);
ragDollSpin = ragDollSpin * -1;
} else if (_rotation < (ragDollStart - ragDollLimit)) {
_rotation = (ragDollStart - ragDollLimit);
ragDollSpin = ragDollSpin * -1;
}
ragDollTime--;
} else {
_rotation = (_rotation / 1.1);
}
}
ragDollTime = random(40) + 40;
ragDollLimit = 30;
ragDollStart = _rotation;
ragDollSpin = random(3) + 2;
Symbol 137 MovieClip Frame 1
function onEnterFrame() {
if (ragDollTime > 0) {
_rotation = (_rotation + ragDollSpin);
if (_rotation > (ragDollStart + ragDollLimit)) {
_rotation = (ragDollStart + ragDollLimit);
ragDollSpin = ragDollSpin * -1;
} else if (_rotation < (ragDollStart - ragDollLimit)) {
_rotation = (ragDollStart - ragDollLimit);
ragDollSpin = ragDollSpin * -1;
}
ragDollTime--;
} else {
_rotation = (_rotation / 1.1);
}
}
ragDollTime = random(60) + 50;
ragDollLimit = 60;
ragDollStart = _rotation;
ragDollSpin = random(10) - 5;
_rotation = (_rotation + random(ragDollLimit));
Symbol 151 MovieClip [SK] Frame 1
stop();
Symbol 186 Button
on (release) {
_root.play();
}
Symbol 196 MovieClip Frame 178
_root.nextFrame();
Symbol 199 MovieClip Frame 1
stop();
Symbol 219 Button
on (release) {
NEWGAMEWARN._x = 0;
NEWGAMEWARN.checkData();
}
Symbol 221 Button
on (release) {
if (_root.contButton._alpha == 100) {
_root.loadData();
stopAllSounds();
_root.gotoFrame("GAME");
}
}
Symbol 223 Button
on (release) {
getURL ("http://rankz.armorbot.com/SKA/", "_blank");
}
Symbol 225 Button
on (release) {
getURL ("http://www.armorgames.com", "_blank");
}
Symbol 227 Button
on (release) {
_root.gotoFrame("STARS");
}
Symbol 229 Button
on (release) {
_root.gotoFrame("CREDITS");
}
Symbol 234 Button
on (release) {
_root.newData();
_root.saveData();
stopAllSounds();
_root.gotoFrame("INTRO1", 2);
}
Symbol 236 Button
on (release) {
_x = -1500;
}
Symbol 239 MovieClip Frame 1
function checkData() {
saveText = ((("Level " + _root.savefile.data.saveObject.level) + " / Game Time ") + Math.round(_root.savefile.data.saveObject.timer / 30)) + " Seconds.";
if ((_root.savefile.data.saveObject.level < 2) || (_root.savefile.data.saveObject.level == undefined)) {
_visible = false;
_root.newData();
_root.saveData();
stopAllSounds();
_root.gotoFrame("INTRO1", 2);
}
}
Symbol 240 Button
on (release) {
_root.gotoFrame("TITLE");
}
Symbol 257 Button
on (release) {
_root.gotoFrame("INTRO2", 2);
}
Symbol 259 Button
on (release) {
stopAllSounds();
_root.gotoFrame("GAME", 1);
}
Symbol 263 Button
on (release) {
_root.gotoFrame("INTRO3", 2);
}
Symbol 267 Button
on (release) {
_root.gotoFrame("OUTRO2");
}
Symbol 273 Button
on (release) {
if (subBut._alpha == 100) {
subBut._alpha = 50;
bXlnYW1lX25hbWVfdmFyaWFibGU = userName.text;
bXlnYW1lX3Njb3JlX3ZhcmlhYmxl = score;
trace(bXlnYW1lX25hbWVfdmFyaWFibGU);
trace(bXlnYW1lX3Njb3JlX3ZhcmlhYmxl);
__rankz_send__("MjU4MmolZSVhJW4lcw==", "UE5TelNoZHo=", bXlnYW1lX25hbWVfdmFyaWFibGU, bXlnYW1lX3Njb3JlX3ZhcmlhYmxl);
stopAllSounds();
_root.gotoFrame("TITLELOAD");
}
}
Symbol 287 MovieClip Frame 1
function onEnterFrame() {
_rotation = (_rotation + 10);
if (this.hitTest(_parent._parent.MAN)) {
_root.coins++;
_root.playSound("COIN", 50);
this.swapDepths(9999);
this.removeMovieClip();
}
}
Symbol 288 MovieClip Frame 1
stop();
Symbol 299 MovieClip Frame 1
stop();
Symbol 303 MovieClip Frame 1
stop();
Symbol 307 MovieClip Frame 1
_parent._parent.addSoldier(_x, _y);
this.swapDepths(0);
this.removeMovieClip();
Symbol 315 MovieClip Frame 1
stop();
Symbol 315 MovieClip Frame 2
stop();
Symbol 347 MovieClip Frame 1
stop();
Symbol 348 MovieClip Frame 1
function pythag(x1, y1, x2, y2) {
return(Math.sqrt(Math.pow(y1 - y2, 2) + Math.pow(x1 - x2, 2)));
}
function angle(x1, y1, x2, y2) {
return(Math.round((Math.atan2(y2 - y1, x2 - x1) / 3.141593) * 180) + 90);
}
function calcSpeed(angle, speed) {
var _local2 = angle * 0.01745329;
var _local1 = new Object();
_local1.x = speed * Math.cos(_local2);
_local1.y = speed * Math.sin(_local2);
return(_local1);
}
function rotatedXY(xPos, yPos, rotate) {
var _local1 = new Object();
var _local2 = 0.0174444444444444 * rotate;
var _local4 = Math.sin(_local2);
var _local3 = Math.cos(_local2);
_local1.x = (xPos * _local3) - (yPos * _local4);
_local1.y = (xPos * _local4) + (yPos * _local3);
return(_local1);
}
function shakeControl() {
}
function newNoise(xPos, yPos, size) {
var _local1 = 0;
while (_local1 < enemyArray.length) {
if (pythag(enemyArray[_local1]._x, enemyArray[_local1]._y, xPos, yPos) < (size * 8)) {
if (enemyArray[_local1].S_State == 0) {
enemyArray[_local1].S_State = 1;
}
}
_local1++;
}
var _local2 = NOISE.attachMovie("noise", "N", NOISE.getNextHighestDepth());
_local2._x = xPos;
_local2._y = yPos;
_local2._xscale = (size + random(10)) - 5;
_local2._yscale = _local2._xscale;
noiseArray.push(_local2);
}
function noiseManagement() {
var _local1 = 0;
while (_local1 < noiseArray.length) {
if (noiseArray[_local1]._alpha > 10) {
noiseArray[_local1]._alpha = noiseArray[_local1]._alpha - 10;
noiseArray[_local1]._xscale = noiseArray[_local1]._xscale * 1.2;
noiseArray[_local1]._yscale = noiseArray[_local1]._xscale;
} else {
noiseArray[_local1].removeMovieClip();
noiseArray.splice(_local1, 1);
_local1--;
}
_local1++;
}
}
function onEnterFrame() {
if (Key.isDown(80) && (gamePauseSwitch == false)) {
gamePauseSwitch = true;
if (gamePaused == false) {
gamePaused = true;
_parent.HUD.gotoAndStop(2);
} else {
_parent.HUD.gotoAndStop(1);
gamePaused = false;
}
} else if (Key.isDown(80) == false) {
gamePauseSwitch = false;
}
if (gamePaused == false) {
if (EOLFreeze == false) {
_root.saveObject.timer++;
_root.timer = Math.round(_root.saveObject.timer / 30);
updateCoins();
updateBlood();
updateEnemy();
noiseManagement();
camPos.x = MAN._x;
camPos.y = MAN._y;
MAN.ySpeed = MAN.ySpeed / 1.05;
if (MAN.dead == true) {
if (MAN.deadTimer < 150) {
MAN.deadTimer++;
} else if (MAN.deadTimer == 150) {
MAN.deadTimer++;
_root.saveObject.coins = coinStore;
_root.deaths++;
_root.saveObject.deaths = _root.deaths;
_root.saveObject.kill = killStore;
_root.saveData();
_root.gotoFrame("blank", 2);
}
_parent.focusBG._alpha = _parent.focusBG._alpha / 2;
if (targScale < 100) {
targScale++;
}
newBlood(MAN._x, MAN._y);
MAN.gotoAndStop("RAGDOLL");
MAN._y = MAN._y + MAN.ySpeed;
MAN.ySpeed = MAN.ySpeed + 2;
while (collision(MAN._x, MAN._y, GROUND)) {
MAN._y--;
MAN.ySpeed = 0;
}
MAN.sprite._rotation = MAN.sprite._rotation / 1.05;
MAN.xSpeed = 0;
} else {
MAN_Control();
manCollision();
objectJump(MAN);
MAN_BowControl();
}
updateArrows();
if ((MAN.jumpBuffer >= jumpBufferStore) && (MAN.climbActive == false)) {
unlockSprite(MAN, "SWING");
setSprite(MAN, "JUMP");
MAN.spriteLock = "JUMP";
}
if (Math.round(_xscale) != targScale) {
camElastic = 1;
} else {
camElastic = 5;
}
if (camPos.y > 600) {
camPos.y = 600;
}
point = {x:camPos.x, y:camPos.y};
localToGlobal(point);
if ((MAN.climbActive == true) && (MAN.keyPressUp == true)) {
if (camYOffset < 250) {
camYOffset = camYOffset + 10;
}
} else if ((MAN.climbActive == true) && (MAN.keyPressDown == true)) {
if (camYOffset > 115) {
camYOffset = camYOffset - 10;
}
} else if (camYOffset < 184) {
camYOffset = camYOffset + 5;
} else if (camYOffset > 192) {
camYOffset = camYOffset - 5;
}
var _local3 = Math.floor((256 - point.x) / camElastic);
var _local4 = Math.floor((camYOffset - point.y) / camElastic);
_x = (_x + _local3);
_y = (_y + _local4);
_parent.BG._x = _parent.BG._x + ((_local3 / 6) - 0.5);
if (_parent.BG._x < 0) {
_parent.BG._x = _parent.BG._x + (_parent.BG._width / 2);
} else if (_parent.BG._x > 512) {
_parent.BG._x = _parent.BG._x - (_parent.BG._width / 2);
}
_parent.BG_1._x = _parent.BG_1._x + (_local3 / 2);
_parent.BG_1._y = _parent.BG_1._y + (_local4 / 6);
if (_parent.BG_1._x < (-(_parent.BG_1._width / 3))) {
_parent.BG_1._x = _parent.BG_1._x + (_parent.BG_1._width / 3);
} else if (_parent.BG_1._x > (_parent.BG_1._width / 3)) {
_parent.BG_1._x = _parent.BG_1._x - (_parent.BG_1._width / 3);
}
_xscale = (_xscale - ((_xscale - (targScale + zoomShake)) / 10));
_yscale = (_yscale - ((_yscale - (targScale + zoomShake)) / 10));
if ((MAN.ySpeed < 0) && (MAN.swingActive == false)) {
MAN.jumpBuffer = jumpBufferStore;
}
GROUND_G.swapDepths(getNextHighestDepth());
spikeDamage();
HUDControl();
}
setFPS();
}
}
function MAN_BowControl() {
if (MAN.bowActive == true) {
if (_parent.focusBG._alpha < 100) {
_parent.focusBG._alpha = _parent.focusBG._alpha + 20;
}
} else if (_parent.focusBG._alpha > 0) {
_parent.focusBG._alpha = _parent.focusBG._alpha - 10;
}
if (MAN.spriteLock == "BOW") {
targScale = 40;
MAN.bowActive = true;
} else if ((((Key.isDown(16) == false) && (MAN.duckActive == false)) && (MAN.climbActive == false)) && (MAN.swingActive == false)) {
targScale = 100;
}
if (MAN.mousePressed == true) {
shakeControl();
MAN.spriteLock = "BOW";
EFFECTS.clear();
EFFECTS.lineStyle(2, 0, 100);
EFFECTS.moveTo(xDragStart, yDragStart);
EFFECTS.lineTo(_xmouse, _ymouse);
MAN.powerVar = Math.round(pythag(_xmouse, _ymouse, xDragStart, yDragStart) / 2);
MAN.anglerVar = angle(_xmouse, _ymouse, xDragStart, yDragStart);
if (MAN.powerVar > bow_Range_Array[bow_Range]) {
MAN.powerVar = bow_Range_Array[bow_Range];
}
if (MAN.anglerVar < 0) {
MAN.anglerVar = MAN.anglerVar + 360;
}
speed = calcSpeed(MAN.anglerVar - 90, MAN.powerVar * 2);
arrowPreview(MAN.anglerVar, MAN.powerVar);
Bow_DataText._visible = true;
Bow_DataText._x = xDragStart;
Bow_DataText._y = yDragStart;
Bow_DataText.textBox.text = ((((((("Angle: " + MAN.anglerVar) + "\nPower: ") + MAN.powerVar) + " / ") + bow_Range_Array[bow_Range]) + " [Level ") + bow_Range) + "]";
} else {
Bow_DataText._visible = false;
}
}
function onMouseDown() {
if (((MAN.climbActive == false) && (MAN.swingActive == false)) && (gamePaused == false)) {
if (MAN.mousePressed == false) {
_root.playSound("CRANK", 50);
}
MAN.moveActive = false;
MAN.mousePressed = true;
xDragStart = _xmouse;
yDragStart = _ymouse;
}
}
function onMouseUp() {
if (MAN.mousePressed == true) {
EFFECTS.clear();
MAN.mousePressed = false;
if (MAN.powerVar > 10) {
newNoise(MAN._x, MAN._y - 40, 15);
_root.playSound("SHOOTSOUND", 50);
newArrow(arrowPosX, arrowPosY, MAN);
arrowArray[arrowArray.length - 1].killSoldier = true;
}
if (bow_Accuracy < 10) {
bow_Accuracy++;
}
}
}
function createArrow(xPos, yPos, caller) {
var _local1 = attachMovie("Arrow", clone, getNextHighestDepth());
_local1._rotation = caller.anglerVar;
_local1.xSpeed = speed.x / 10;
_local1.ySpeed = speed.y / 10;
_local1.timer = 0;
_local1._x = xPos + _local1.xSpeed;
_local1._y = yPos + _local1.ySpeed;
_local1.xPos = _local1._x;
_local1.yPos = _local1._y;
_local1.alive = true;
return(_local1);
}
function newArrow(xPos, yPos, caller) {
arrowArray.push(createArrow(xPos, yPos, caller));
}
function arrowPreview(anglerVar, powerVar) {
newNoise(MAN._x, MAN._y - 40, 10);
preview = createArrow(arrowPosX, arrowPosY);
preview.noiseActive = false;
preview._x = preview._x - preview.xSpeed;
preview._y = preview._y - preview.ySpeed;
preview.timer = bow_Accuracy_Array[bow_Accuracy];
EFFECTS.moveTo(preview.xPos, preview.yPos);
var _local1 = -5;
while (preview.timer > 0) {
EFFECTS.lineStyle(0.1, 16711680, _local1);
_local1 = _local1 + 5;
preview.timer--;
updateTrajectory(preview);
EFFECTS.lineTo(preview._x, preview._y);
}
preview.removeMovieClip();
}
function updateArrows() {
var _local4 = 0;
while (_local4 < arrowArray.length) {
var _local3 = arrowArray[_local4];
updateTrajectory(_local3);
if (_local3.alive == true) {
if (_local3.killSoldier != true) {
if (pythag(_local3._x, _local3._y, MAN._x, MAN._y - 40) < 40) {
if (MAN.dead != true) {
hurtMan(10);
MAN.ySpeed = -10;
}
}
}
if (_local3.killSoldier == true) {
var _local2 = 0;
while (_local2 < enemyArray.length) {
if ((enemyArray[_local2].dead != true) && (pythag(_local3._x, _local3._y, enemyArray[_local2]._x, enemyArray[_local2]._y - 40) < 30)) {
_root.playSound("guardDieSound", 50);
_local3.alive = false;
_local3._visible = false;
enemyArray[_local2].dead = true;
enemyArray[_local2].ySpeed = -10;
newBlood(enemyArray[_local2]._x, enemyArray[_local2]._y - 40);
}
_local2++;
}
}
}
if (_local3.timer < 300) {
_local3.timer++;
} else if (_local3._yscale > 0) {
_local3._yscale = _local3._yscale - 10;
} else {
_local3.removeMovieClip();
arrowArray.splice(_local4, 1);
}
_local4++;
}
}
function updateTrajectory(object) {
if (object.alive == true) {
object.xPos = object._x;
object.yPos = object._y;
object._x = object._x + object.xSpeed;
object._y = object._y + object.ySpeed;
object.xSpeed = object.xSpeed + windSpeed;
object.ySpeed = object.ySpeed + 1;
object._rotation = angle(object.xPos, object.yPos, object._x, object._y);
if (collision(object._x, object._y, GROUND)) {
object._x = object._x + (object.xSpeed / 10);
object._y = object._y + (object.ySpeed / 10);
object.alive = false;
if (object.noiseActive != false) {
newNoise(object._x, object._y, 50);
}
}
}
}
function MAN_Control() {
MAN.sneakActive = false;
if (MAN.dead == false) {
if (Key.isDown(38)) {
MAN.keyPressUp = true;
} else {
MAN.keyPressUp = false;
MAN.keyPressUpSwitch = false;
}
if (Key.isDown(40)) {
MAN.keyPressDown = true;
} else {
MAN.keyPressDown = false;
MAN.keyPressDownSwitch = false;
MAN.duckActive = false;
MAN.rollCount = 10;
}
if (Key.isDown(37)) {
MAN.keyPressLeft = true;
} else {
MAN.keyPressLeft = false;
MAN.keyPressLeftSwitch = false;
}
if (Key.isDown(39)) {
MAN.keyPressRight = true;
} else {
MAN.keyPressRight = false;
MAN.keyPressRightSwitch = false;
}
} else {
MAN.keyPressUp = false;
MAN.keyPressRight = false;
MAN.keyPressDown = false;
MAN.keyPressLeft = false;
}
if (MAN.mousePressed == false) {
MAN.moveActive = false;
if (MAN.keyPressRight == true) {
MAN.moveActive = true;
MAN.bowActive = false;
MAN.xSpeed = MAN.xSpeed + 8;
unlockSprite(MAN, "BOW");
if ((((MAN.keyPressDown == true) && (MAN.swingActive == false)) && (MAN.climbActive == false)) && (MAN.jumpBuffer < 5)) {
if (MAN.rollCount == 0) {
setSprite(MAN, "SNEAK");
MAN.xSpeed = MAN.xSpeed - 4;
MAN.sneakActive = true;
} else {
MAN.rollCount--;
setSprite(MAN, "ROLL");
}
} else {
setSprite(MAN, "RUN");
MAN.rollCount = 10;
}
MAN._xscale = manXScale;
} else if (MAN.keyPressLeft == true) {
MAN.moveActive = true;
MAN.bowActive = false;
MAN.xSpeed = MAN.xSpeed - 8;
unlockSprite(MAN, "BOW");
if ((((MAN.keyPressDown == true) && (MAN.swingActive == false)) && (MAN.climbActive == false)) && (MAN.jumpBuffer < 5)) {
if (MAN.rollCount == 0) {
setSprite(MAN, "SNEAK");
MAN.xSpeed = MAN.xSpeed + 4;
MAN.sneakActive = true;
} else {
MAN.rollCount--;
setSprite(MAN, "ROLL");
}
} else {
setSprite(MAN, "RUN");
MAN.rollCount = 10;
}
MAN._xscale = -manXScale;
} else if (MAN.keyPressDown == true) {
MAN.sneakActive = true;
setSprite(MAN, "DUCK");
if (((MAN.climbActive == false) && (MAN.swingActive == false)) && (MAN.jumpBuffer < 5)) {
MAN.duckActive = true;
targScale = 100;
}
} else {
setSprite(MAN, "STAND");
}
MAN.sprite.bowAim.bow.gotoAndStop(10);
MAN.sprite.bowAim.arms.gotoAndStop(10);
} else {
MAN.gotoAndStop("SHOOT");
if (MAN.powerVar > 10) {
if (MAN.anglerVar < 180) {
MAN.sprite.bowAim._rotation = MAN.anglerVar - 90;
MAN.sprite.bowAim.arms._rotation = (MAN.anglerVar - 90) - (MAN.sprite.bowAim._rotation / 3);
MAN._xscale = manXScale;
} else {
MAN.sprite.bowAim._rotation = -(MAN.anglerVar + 90);
MAN.sprite.bowAim.arms._rotation = (-(MAN.anglerVar + 90)) - (MAN.sprite.bowAim._rotation / 3);
MAN._xscale = -manXScale;
}
}
var _local1 = Math.ceil(((bow_Range_Array[bow_Range] / 100) * MAN.powerVar) / 30);
MAN.sprite.bowAim.bow.gotoAndStop(_local1);
MAN.sprite.bowAim.arms.gotoAndStop(_local1);
MAN.sprite.bowAim.bow._rotation = MAN.sprite.bowAim.arms._rotation;
MAN.sprite.bowAim._rotation = MAN.sprite.bowAim._rotation / 3;
var _local2 = {x:MAN.sprite.bowAim.arms.arrowPoint._x, y:MAN.sprite.bowAim.arms.arrowPoint._y};
MAN.sprite.bowAim.arms.localToGlobal(_local2);
arrowPosX = MAN._x;
arrowPosY = MAN._y - 40;
arrowTrack._x = arrowPosX;
arrowTrack._y = arrowPosY;
}
MAN.xSpeed = MAN.xSpeed / 2;
if (MAN.swingActive == true) {
MAN.xSpeed = MAN.xSpeed / 2;
}
if ((MAN.xSpeed < 0.1) && (MAN.xSpeed > -0.1)) {
MAN.xSpeed = 0;
}
MAN._x = MAN._x + MAN.xSpeed;
}
function manCollision() {
var _local2 = MAN.ySpeed;
MAN._y = MAN._y + MAN.ySpeed;
if ((MAN.keyPressDown == true) || ((MAN.swingActive == false) && (MAN.climbActive == false))) {
MAN.ySpeed = MAN.ySpeed + 2;
}
if (MAN.keyPressDown == false) {
MAN.swingKeySwitch = false;
}
if (((groundCollision(MAN) == true) && ((MAN.moveActive == true) || (_local2 > 10))) && (MAN.climbActive == false)) {
if (MAN.sneakActive == false) {
newNoise(MAN._x, MAN._y, 50);
} else {
newNoise(MAN._x, MAN._y, 10);
}
}
if (roofCollision(MAN) != true) {
if (MAN.swingActive == true) {
MAN.swingActive = false;
if ((MAN.keyPressDown == false) || (MAN.swingKeySwitch == true)) {
MAN.ySpeed = (-MAN.jumpHeight) * 1.2;
} else {
MAN.jumpBuffer = jumpBufferStore;
MAN.ySpeed = 0;
}
if (MAN.keyPressDown == false) {
MAN.xSpeed = MAN._xscale / 5;
}
}
}
if ((wallCollision(MAN, 1) != true) && (wallCollision(MAN, -1) != true)) {
if ((unlockSprite(MAN, "CLIMB") == true) && (collision(MAN._x, MAN._y, GROUND) != true)) {
if (MAN.keyPressDown == false) {
MAN.xSpeed = (-MAN._xscale) / 10;
MAN.ySpeed = (-MAN.jumpHeight) / 1;
_root.playSound("JUMP", 50);
newNoise(MAN._x, MAN._y - 80, 50);
} else {
MAN.xSpeed = MAN._xscale / 2;
MAN.ySpeed = 0;
MAN.swingKeySwitch = true;
}
}
}
}
function wallCollision(object, dir) {
var _local3 = false;
if (dir > 0) {
if (object._xscale > dir) {
_local3 = true;
}
} else if (object._xscale < dir) {
_local3 = true;
}
if (collision(object._x + (wallCSize * dir), object._y - 75, GROUND) && (_local3 == true)) {
object.climbActive = true;
object.doubleJump = false;
object.ySpeed = 0;
while (collision(object._x + (wallCSize * dir), object._y - 75, GROUND)) {
object._x = object._x - (1 * dir);
}
object._x = object._x + (2 * dir);
if (object.keyPressUp == true) {
unlockSprite(MAN, "JUMP");
setSprite(object, "CLIMB");
object.spriteLock = "CLIMB";
object.gotoAndStop("CLIMB");
object.ySpeed = -5;
newNoise(object._x, object._y - 40, 25);
} else if (object.keyPressDown == false) {
unlockSprite(object, "JUMP");
setSprite(object, "SLIDE");
object.spriteLock = "CLIMB";
object.gotoAndStop("GRIP");
object.ySpeed = 0;
} else {
unlockSprite(object, "JUMP");
setSprite(object, "SLIDE");
object.spriteLock = "CLIMB";
object.gotoAndStop("SLIDE");
object.ySpeed = 10;
newNoise(object._x, object._y - 40, 25);
}
return(true);
}
object.climbActive = false;
if (collision(object._x + (wallCSize * dir), object._y - 30, GROUND) && (_local3 == true)) {
while (collision(object._x + (wallCSize * dir), object._y - 30, GROUND)) {
object._x = object._x - (1 * dir);
}
}
}
function roofCollision(object) {
if (collision(object._x, object._y - wallRSize, GROUND)) {
MAN.jumpKeySwitch = true;
object.doubleJump = false;
object.jumpBuffer = 0;
object.swingActive = true;
while (collision(object._x, object._y - wallRSize, GROUND)) {
object._y++;
}
if (object.keyPressDown == false) {
object._y = object._y - 2;
object.ySpeed = -2;
}
if (object.climbActive == false) {
object.setSprite(MAN, "SWING");
object.spriteLock = "SWING";
if ((object.keyPressRight == true) || (object.keyPressLeft == true)) {
object.gotoAndStop("SWING");
newNoise(object._x, object._y - 80, 20);
} else {
object.gotoAndStop("SWINGSTOP");
}
}
return(true);
}
}
function setSprite(object, frame) {
if (object.dead != true) {
if (object.spriteLock == false) {
object.gotoAndStop(frame);
}
} else {
object.gotoAndStop("RAGDOLL");
}
}
function unlockSprite(object, lock) {
if (object.spriteLock == lock) {
object.spriteLock = false;
return(true);
}
}
function groundCollision(object) {
object.jumpBuffer++;
if (collision(object._x, object._y, GROUND) == true) {
while (collision(object._x, object._y, GROUND) == true) {
object._y = object._y - 1;
}
object._y = object._y + 2;
object.ySpeed = 0;
object.jumpBuffer = 0;
if (object.keyPressUp == false) {
object.doubleJump = true;
}
unlockSprite(object, "JUMP");
return(true);
}
}
function collision(xPos, yPos, Targ) {
if (Targ.hitTest((xPos / (100 / _xscale)) + _x, (yPos / (100 / _yscale)) + _y, true)) {
return(true);
}
}
function objectJump(object) {
if (((object.keyPressUp == true) && (object.climbActive == false)) && (object.swingActive == false)) {
jump(object);
} else if (object.jumpBuffer < jumpBufferStore) {
object.jumpSwitch = false;
}
if (object.keyPressUp == false) {
object.jumpKeySwitch = false;
}
}
function jump(object) {
if ((object.swingActive == false) && (object.bowActive == false)) {
if (((object.jumpBuffer < jumpBufferStore) && (object.jumpSwitch == false)) || (object.climbActive == true)) {
object.ySpeed = -object.jumpHeight;
_root.playSound("JUMP", 50);
object.jumpSwitch = true;
object.jumpKeySwitch = true;
if (object.ySpeed < (-object.jumpHeight)) {
object.ySpeed = object.jumpHeight;
}
} else if ((((object.doubleJump == true) && (object.ySpeed > 1)) && (object.jumpKeySwitch == false)) && (object.jumpBuffer > 10)) {
object.jumpSwitch = true;
_root.playSound("JUMP", 50);
object.ySpeed = -object.jumpHeight;
object.doubleJump = false;
}
}
}
function addSoldier(xPos, yPos) {
var _local1 = attachMovie("SK", "SK_Sol", getNextHighestDepth());
_local1._x = xPos;
_local1._y = yPos;
_local1.visualStyle = 2;
_local1.bowActive = false;
_local1.xSpeed = 0;
_local1.ySpeed = 0;
_local1.spriteLock = 0;
_local1.swingActive = false;
_local1.S_State = 0;
_local1.moveDir = 1;
_local1.VA._yscale = 30;
_local1.VA._xscale = 60;
_local1.shockTime = 0;
_local1.deadTimer = 0;
_local1.arrowTimer = 10;
_local1.anglerAdjust = random(10);
_local1.suspectTime = 0;
_local1.power = random(10) / 10;
_local1.scaler = _local1._xscale;
_local1.spotPosX = 0;
_local1.spotPosY = 0;
_local1.jumpBuffer = 0;
if (random(2) == 1) {
_local1._xscale = -_local1.scaler;
_local1.moveDir = -1;
}
enemyArray.push(_local1);
}
function updateEnemy() {
var _local2 = 0;
while (_local2 < enemyArray.length) {
if (enemyArray[_local2]._visible == true) {
if (enemyArray[_local2].dead == true) {
newBlood(enemyArray[_local2]._x, enemyArray[_local2]._y);
enemyArray[_local2].gotoAndStop("RAGDOLL");
enemyArray[_local2]._y = enemyArray[_local2]._y + enemyArray[_local2].ySpeed;
enemyArray[_local2].ySpeed = enemyArray[_local2].ySpeed + 2;
if (enemyArray[_local2].deadTimer < 200) {
if (enemyArray[_local2].deadTimer == 1) {
_root.kills++;
trace(_root.kills);
}
enemyArray[_local2].deadTimer++;
} else if (enemyArray[_local2]._alpha > 0) {
enemyArray[_local2]._alpha = enemyArray[_local2]._alpha - 5;
} else if (enemyArray[_local2]._visible == true) {
enemyArray[_local2]._visible = false;
}
while (collision(enemyArray[_local2]._x, enemyArray[_local2]._y, GROUND)) {
enemyArray[_local2]._y--;
enemyArray[_local2].ySpeed = 0;
}
enemyArray[_local2].sprite._rotation = enemyArray[_local2].sprite._rotation / 1.05;
enemyArray[_local2].xSpeed = 0;
} else {
if (MAN.dead == true) {
enemyArray[_local2].S_State = 0;
unlockSprite(enemyArray[_local2], "SHOOT");
setSprite(enemyArray[_local2], "SNEAK");
enemyArray.spriteLock = "SNEAK";
}
var _local3 = pythag(enemyArray[_local2]._x, enemyArray[_local2]._y, MAN._x, MAN._y);
if ((((_local3 > 100) && (_local3 < 350)) && (enemyArray[_local2].S_State > 1)) && (MAN._y < (enemyArray[_local2]._y + 40))) {
enemyArray[_local2].S_State = 3;
} else if (enemyArray[_local2].S_State == 3) {
unlockSprite(enemyArray[_local2], "SHOOT");
enemyArray[_local2].S_State = 2;
}
if ((_local3 < 150) || (((_local3 < 250) && (enemyArray[_local2].S_State > 0)) && (MAN._y < (enemyArray[_local2]._y + 20)))) {
enemyArray[_local2].curDist = _local3;
if (((MAN._x < enemyArray[_local2]._x) && (enemyArray[_local2].moveDir == -1)) || ((MAN._x > enemyArray[_local2]._x) && (enemyArray[_local2].moveDir == 1))) {
if (enemyArray[_local2].S_State != 3) {
enemyArray[_local2].S_State = 2;
enemyArray[_local2].spotPosX = MAN._x;
enemyArray[_local2].spotPosY = enemyArray[_local2]._x - MAN._x;
if (enemyArray[_local2].S_State == 2) {
enemyArray[_local2].shockTime = 0;
}
}
}
} else {
enemyArray[_local2].spotPosX = enemyArray[_local2]._x - enemyArray[_local2].spotPosY;
}
enemyArray[_local2]._y = enemyArray[_local2]._y + enemyArray[_local2].ySpeed;
enemyArray[_local2].ySpeed = enemyArray[_local2].ySpeed + 2;
enemyArray[_local2].jumpBuffer++;
if (groundCollision(enemyArray[_local2]) == true) {
if (collision(enemyArray[_local2]._x - 25, enemyArray[_local2]._y + 30, GROUND) != true) {
if (enemyArray[_local2].S_State < 1) {
enemyArray[_local2]._x = enemyArray[_local2]._x + 5;
enemyArray[_local2].xSpeed = enemyArray[_local2].xSpeed * -1.1;
enemyArray[_local2].moveDir = enemyArray[_local2].moveDir * -1;
enemyArray[_local2]._xscale = enemyArray[_local2]._xscale * -1;
} else {
enemyArray[_local2].xSpeed = enemyArray[_local2].xSpeed * -1.1;
if (_local3 < 400) {
enemyArray[_local2].S_State = 3;
}
}
}
if (collision(enemyArray[_local2]._x + 25, enemyArray[_local2]._y + 30, GROUND) != true) {
if (enemyArray[_local2].S_State < 1) {
enemyArray[_local2]._x = enemyArray[_local2]._x - 5;
enemyArray[_local2].xSpeed = enemyArray[_local2].xSpeed * -1.1;
enemyArray[_local2].moveDir = enemyArray[_local2].moveDir * -1;
enemyArray[_local2]._xscale = enemyArray[_local2]._xscale * -1;
} else {
enemyArray[_local2].xSpeed = enemyArray[_local2].xSpeed * -1.1;
if (_local3 < 400) {
enemyArray[_local2].S_State = 3;
}
}
}
unlockSprite(enemyArray[_local2], "JUMP");
}
if (enemyArray[_local2].jumpBuffer > 10) {
setSprite(enemyArray[_local2], "JUMP");
enemyArray[_local2].spriteLock = "JUMP";
} else {
unlockSprite(enemyArray[_local2], "JUMP");
}
if (collision(enemyArray[_local2]._x - 20, enemyArray[_local2]._y - 50, GROUND) || (collision(enemyArray[_local2]._x + 20, enemyArray[_local2]._y - 50, GROUND))) {
if (collision(enemyArray[_local2]._x - 20, enemyArray[_local2]._y - 100, GROUND) != true) {
enemyArray[_local2].ySpeed = -15;
enemyArray[_local2].xSpeed = 5;
}
while (collision(enemyArray[_local2]._x - 20, enemyArray[_local2]._y - 50, GROUND)) {
enemyArray[_local2]._x = enemyArray[_local2]._x + 2;
}
while (collision(enemyArray[_local2]._x + 20, enemyArray[_local2]._y - 50, GROUND)) {
enemyArray[_local2]._x = enemyArray[_local2]._x - 2;
}
enemyArray[_local2].xSpeed = enemyArray[_local2].xSpeed * -1.1;
enemyArray[_local2].moveDir = enemyArray[_local2].moveDir * -1;
enemyArray[_local2]._xscale = enemyArray[_local2]._xscale * -1;
}
enemyArray[_local2].xSpeed = enemyArray[_local2].xSpeed / (1.1 + (enemyArray[_local2].power / 10));
if (enemyArray[_local2].S_State != 3) {
enemyArray[_local2]._x = enemyArray[_local2]._x + enemyArray[_local2].xSpeed;
}
enemyArray[_local2]._xscale = enemyArray[_local2].scaler * enemyArray[_local2].moveDir;
if (enemyArray[_local2].S_State == 0) {
enemyArray[_local2].shockTime = 0;
setSprite(enemyArray[_local2], "SNEAK");
enemyArray[_local2].xSpeed = enemyArray[_local2].xSpeed + (enemyArray[_local2].moveDir / 4);
} else if (enemyArray[_local2].S_State == 1) {
enemyArray[_local2].VA._xscale = 70;
enemyArray[_local2].VA._yscale = 70;
setSprite(enemyArray[_local2], "STAND");
if (enemyArray[_local2].shockTime < 30) {
} else if (enemyArray[_local2].shockTime == 30) {
enemyArray[_local2]._xscale = enemyArray[_local2]._xscale * -1;
enemyArray[_local2].moveDir = enemyArray[_local2].moveDir * -1;
} else if (enemyArray[_local2].shockTime == 40) {
enemyArray[_local2]._xscale = enemyArray[_local2]._xscale * -1;
enemyArray[_local2].moveDir = enemyArray[_local2].moveDir * -1;
}
enemyArray[_local2].shockTime++;
if (enemyArray[_local2].shockTime > 50) {
enemyArray[_local2].S_State = 0;
enemyArray[_local2].shockTime = 0;
}
} else if (enemyArray[_local2].S_State == 2) {
if (_local3 < 30) {
if (MAN.dead != true) {
enemyArray[_local2].gotoAndStop("SLASH");
if ((MAN._x > enemyArray[_local2]._x) && (enemyArray[_local2]._xscale > 0)) {
hurtMan(2);
MAN.xSpeed = MAN.xSpeed + 5;
} else if ((MAN._x < enemyArray[_local2]._x) && (enemyArray[_local2]._xscale < 0)) {
hurtMan(2);
MAN.xSpeed = MAN.xSpeed - 5;
}
}
} else if (enemyArray[_local2].shockTime < 200) {
enemyArray[_local2].shockTime++;
enemyArray[_local2].suspectTime++;
if (enemyArray[_local2].suspectTime > 20) {
if (enemyArray[_local2].hitTest(MAN)) {
enemyArray[_local2].shockTime = 0;
}
enemyArray[_local2].VA._xscale = 100;
enemyArray[_local2].VA._yscale = 100;
if (MAN.dead != true) {
setSprite(enemyArray[_local2], "RUN");
}
enemyArray[_local2].xSpeed = enemyArray[_local2].xSpeed + (enemyArray[_local2].moveDir / 1.5);
if (enemyArray[_local2]._x > (enemyArray[_local2].spotPosX + 50)) {
enemyArray[_local2].moveDir = -1;
} else if (enemyArray[_local2]._x < (enemyArray[_local2].spotPosX - 50)) {
enemyArray[_local2].moveDir = 1;
}
} else if (MAN.dead != true) {
setSprite(enemyArray[_local2], "SHOCK");
}
} else {
enemyArray[_local2].shockTime = 0;
enemyArray[_local2].suspectTime = 0;
enemyArray[_local2].S_State = 1;
}
} else if (enemyArray[_local2].S_State == 3) {
enemyArray[_local2].xSpeed = 0;
unlockSprite(enemyArray[_local2], "JUMP");
setSprite(enemyArray[_local2], "SHOOT");
enemyArray[_local2].spriteLock = "SHOOT";
enemyArray[_local2].anglerVar = angle(enemyArray[_local2]._x, enemyArray[_local2]._y, MAN._x, MAN._y);
if (enemyArray[_local2]._x > MAN._x) {
enemyArray[_local2].anglerVar = enemyArray[_local2].anglerVar + (10 + enemyArray[_local2].anglerAdjust);
} else {
enemyArray[_local2].anglerVar = enemyArray[_local2].anglerVar - (10 + enemyArray[_local2].anglerAdjust);
}
if (enemyArray[_local2]._x < MAN._x) {
enemyArray[_local2].sprite.bowAim._rotation = enemyArray[_local2].anglerVar - 90;
enemyArray[_local2].sprite.bowAim.arms._rotation = (enemyArray[_local2].anglerVar - 90) - (enemyArray[_local2].sprite.bowAim._rotation / 1);
enemyArray[_local2]._xscale = enemyArray[_local2].scaler;
} else {
enemyArray[_local2].sprite.bowAim._rotation = -(enemyArray[_local2].anglerVar + 90);
enemyArray[_local2].sprite.bowAim.arms._rotation = (-(enemyArray[_local2].anglerVar + 90)) - (enemyArray[_local2].sprite.bowAim._rotation / 1);
enemyArray[_local2]._xscale = -enemyArray[_local2].scaler;
}
if (enemyArray[_local2].sprite.bowAim.bow._currentframe < 5) {
enemyArray[_local2].sprite.bowAim.bow.nextFrame();
enemyArray[_local2].sprite.bowAim.arms.nextFrame();
}
if (enemyArray[_local2].arrowTimer == 1) {
enemyArray[_local2].arrowTimer = 30 + random(30);
speed = calcSpeed(enemyArray[_local2].anglerVar - 90, random(100) + 200);
enemyArray[_local2].sprite.bowAim.bow.gotoAndStop(1);
enemyArray[_local2].sprite.bowAim.arms.gotoAndStop(1);
newArrow(enemyArray[_local2]._x, enemyArray[_local2]._y - 30, enemyArray[_local2]);
enemyArray[_local2].anglerAdjust = random(10);
} else {
enemyArray[_local2].arrowTimer--;
}
}
}
}
_local2++;
}
}
function setFPS() {
var _local1 = new Date();
var _local2 = 0;
while (_local1.getTime() < FPSTimer) {
_local1 = new Date();
_local2++;
}
if (Key.isDown(16)) {
FPSTimer = _local1.getTime() + 100;
} else {
FPSTimer = _local1.getTime() + 25;
}
}
function newBlood(xPos, yPos) {
if (random(4) == 1) {
var _local1 = EFFECTS.attachMovie("Blood", "B", EFFECTS.getNextHighestDepth());
_local1._x = xPos;
_local1._y = yPos;
_local1.xSpeed = random(6) - 3;
_local1.ySpeed = -(random(15) + 5);
_local1._xscale = random(50);
_local1._yscale = _local1._xscale;
_local1._alpha = 200;
_local1._rotation = random(360);
bloodArray.push(_local1);
}
}
function updateBlood() {
var _local1 = 0;
while (_local1 < bloodArray.length) {
if (bloodArray[_local1]._alpha > 0) {
bloodArray[_local1]._x = bloodArray[_local1]._x + bloodArray[_local1].xSpeed;
bloodArray[_local1]._y = bloodArray[_local1]._y + bloodArray[_local1].ySpeed;
bloodArray[_local1].ySpeed = bloodArray[_local1].ySpeed + 2;
bloodArray[_local1]._alpha = bloodArray[_local1]._alpha - 10;
bloodArray[_local1]._xscale = bloodArray[_local1]._xscale + 5;
bloodArray[_local1]._yscale = bloodArray[_local1]._yscale + 5;
} else {
bloodArray[_local1].removeMovieClip();
bloodArray.splice(_local1, 1);
}
_local1++;
}
}
function HUDControl() {
if (MAN.dead == false) {
_parent.HUD.HBar._width = (150 / (100 * _root.difficulty)) * MAN.health;
_parent.HUD.HBar2._width = 0.75 * MAN.healthTimer;
} else {
_parent.HUD.HBar._width = 0;
}
if (MAN.health < (100 * _root.difficulty)) {
if (MAN.healthTimer > 0) {
MAN.healthTimer--;
} else {
MAN.health++;
}
}
}
function hurtMan(ammount) {
ammount = Math.round(ammount / 1.5);
if (MAN.dead == false) {
_root.playSound("HURT", 100);
_root.FADER._alpha = 50;
_root.FADER.gotoAndStop(3);
newBlood(MAN._x, MAN._y - 40);
MAN.bowActive = false;
MAN.keyPressRight = true;
MAN.health = MAN.health - ammount;
MAN.healthTimer = 200;
if (MAN.health <= 0) {
_root.playSound("DEAD", 100);
MAN.dead = true;
MAN._x = MAN._x - (MAN.xSpeed * 5);
}
}
}
function spikeDamage() {
if ((_root.coins >= _root.coinArray[level]) && (PROPS.EOL._currentframe < 10)) {
PROPS.EOL.nextFrame();
}
if ((MAN._y > 3000) || ((pythag(MAN._x, MAN._y, PROPS.EOL._x, PROPS.EOL._y) < 10) && (_root.coins >= _root.coinArray[level]))) {
_root.saveObject.level++;
_root.saveObject.coins = _root.coins;
_root.saveObject.deaths = _root.deaths;
_root.saveObject.kills = _root.kills;
_root.saveData();
EOLFreeze = true;
MAN.gotoAndStop("STAND");
_root.gotoFrame("blank", 1);
}
if (MAN.dead == false) {
if ((collision(MAN._x, MAN._y - 10, SPIKES) == true) || (collision(MAN._x, MAN._y - 55, SPIKES) == true)) {
spikeTimer++;
if (spikeTimer == 3) {
MAN.ySpeed = -20;
hurtMan(1000);
}
} else {
spikeTimer = 0;
}
}
}
level = _root.saveObject.level;
GROUND.gotoAndStop(level);
GROUND_G.gotoAndStop(level);
SPIKES.gotoAndStop(level);
PROPS.gotoAndStop(level);
createEmptyMovieClip("EFFECTS", 0);
createEmptyMovieClip("NOISE", 1);
NOISE._visible = 0;
this.setMask(_parent.lightSource);
_parent.focusBG._alpha = 0;
coinStore = _root.saveObject.coins;
deathStore = _root.saveObject.deaths;
killStore = _root.saveObject.kills;
_root.coins = _root.saveObject.coins;
_root.deaths = _root.saveObject.deaths;
_root.kills = _root.saveObject.kills;
_root.difficulty = 1;
var xDragStart = 0;
var yDragStart = 0;
var jumpBufferStore = 10;
var arrowPosX = 0;
var arrowPosY = 0;
MAN.powerVar;
MAN.anglerVar;
var speed;
var previewVar = false;
var windSpeed = 0;
MAN.health = 100 * _root.difficulty;
MAN.healthTimer = 0;
MAN.bowActive = false;
MAN.xSpeed = 0;
MAN.ySpeed = 0;
MAN.spriteLock = 0;
MAN.jumpBuffer = 0;
MAN.jumpHeight = 25;
MAN.jumpSwitch = false;
MAN.swingActive = false;
MAN.doubleJump = true;
MAN.sneakActive = false;
MAN.visualStyle = 1;
MAN.deadTimer = 0;
MAN.mousePressed = false;
MAN.dead = false;
MAN.rollCount = 20;
MAN.VA._xscale = 0;
MAN.VA._yscale = 0;
var zoomShake = 0;
var bow_Range = 10;
var bow_Range_Array = new Array(null, 80, 90, 100, 110, 120, 130, 140, 150, 150, 150);
var bow_Accuracy = 10;
var bow_Accuracy_Array = new Array(null, 5, 10, 15, 20, 25, 30, 35, 40, 45, 100);
var bow_Power = 10;
var magic_Speed = 1;
var manXScale = MAN._xscale;
var camElasticTimer = 10;
var point;
var camPos = {x:MAN._x, y:MAN._y};
var noiseArray = new Array();
camYOffset = 188;
gamePaused = false;
gamePauseSwitch = false;
var arrowArray = new Array();
var wallCSize = 15;
var wallRSize = 90;
var oldY = object._y;
var enemyArray = new Array();
var bloodArray = new Array();
var EOLFreeze = false;
var spikeTimer = 0;
PROPS.EOL.coinText = _root.coinArray[level];
Symbol 368 Button
on (release) {
_root.saveData();
stopAllSounds();
_root.gotoFrame("TITLELOAD");
}
Symbol 370 Button
on (release) {
_parent.quitButton._alpha = 100;
_x = 1000;
}
Symbol 373 Button
on (release) {
quitSure._x = 240;
quitButton._alpha = 0;
}
Symbol 374 MovieClip Frame 1
stop();
Symbol 374 MovieClip Frame 2
stop();
Instance of Symbol 203 MovieClip in Symbol 374 MovieClip Frame 2
on (release) {
_x = (_x + 10);
_x = (_x - 10);
}