Frame 1
stop();
onEnterFrame = function () {
};
Instance of Symbol 7 MovieClip in Frame 1
onClipEvent (enterFrame) {
if (_root.getBytesLoaded() > 130000) {
_root.play();
}
}
Frame 2
stop();
onEnterFrame = function () {
};
Frame 3
stop();
onEnterFrame = function () {
};
Frame 4
stop();
onEnterFrame = function () {
};
Frame 5
onEnterFrame = function () {
};
_x = 0;
_y = 0;
for (cObject in _root) {
if (typeof(_root[cObject]) == "movieclip") {
_root[cObject].removeMovieClip();
}
}
_root.gotoAndStop(_root._currentframe + 1);
Instance of Symbol 123 MovieClip in Frame 5
onClipEvent (enterFrame) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
Frame 6
_quality = "HIGH";
stop();
onEnterFrame = function () {
};
Instance of Symbol 126 MovieClip in Frame 6
onClipEvent (load) {
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
_visible = false;
_alpha = 0;
}
}
onClipEvent (enterFrame) {
_xscale = ((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (_xscale >= 100) {
_alpha = (_alpha - 5);
_root.aBar._alpha = _alpha;
if ((_alpha <= -10) && (_root.inFade.go == true)) {
_root.play();
}
}
}
Instance of Symbol 128 MovieClip "aBar" in Frame 6
onClipEvent (load) {
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
_visible = false;
_alpha = 0;
}
}
Instance of Symbol 143 MovieClip "inFade" in Frame 6
onClipEvent (load) {
function action() {
go = true;
}
}
Instance of Symbol 145 MovieClip in Frame 6
onClipEvent (load) {
_visible = _root.aBar._visible;
if (_visible == false) {
_y = (_y + 500);
}
}
on (release) {
stopAllSounds();
}
Instance of Symbol 192 MovieClip in Frame 6
on (release) {
getURL ("http://newgrounds.com/collection/halloween2006.html", "_blank");
}
Instance of Symbol 194 MovieClip in Frame 6
on (release) {
getURL ("http://www.deadtoast.com/", "_blank");
}
Instance of Symbol 197 MovieClip in Frame 6
on (release) {
getURL ("mailto:koolfox@deadtoast.com", "_blank");
}
Frame 7
buttonHide = false;
story = false;
if (gameLoaded != true) {
stopAllSounds();
var music = new Sound();
music.attachSound("music");
music.start(0, 99999999999);
var projektorSound = new Sound();
projektorSound.attachSound("projektor");
projektorSound.start(0, 999999999);
}
gameLoaded = true;
_quality = "HIGH";
stop();
onEnterFrame = function () {
};
if (mochiRegister != true) {
__com_mochibot__("feb6b0f5", this, 10301, true);
}
mochiRegister = true;
Instance of Symbol 200 MovieClip in Frame 7
onClipEvent (load) {
xTar = _x;
startX = _x;
_x = 900;
}
onClipEvent (enterFrame) {
if (hitTest(_root._xmouse, _root._ymouse, true) && (_root.buttonHide != true)) {
xTar = startX - 20;
} else if (_root.buttonHide == true) {
xTar = 900;
} else {
xTar = startX;
}
_x = (_x + ((xTar - _x) * 0.3));
}
on (release) {
_root.fade.play();
_root.buttonHide = true;
}
Instance of Symbol 202 MovieClip in Frame 7
onClipEvent (load) {
xTar = _x;
startX = _x;
_x = 900;
}
onClipEvent (enterFrame) {
if (hitTest(_root._xmouse, _root._ymouse, true) && (_root.buttonHide != true)) {
xTar = startX - 20;
} else if (_root.buttonHide == true) {
xTar = 900;
} else {
xTar = startX;
}
_x = (_x + ((xTar - _x) * 0.3));
}
on (release) {
_root.story = true;
_root.buttonHide = true;
}
Instance of Symbol 204 MovieClip in Frame 7
onClipEvent (load) {
xTar = _x;
startX = _x;
_x = 900;
}
onClipEvent (enterFrame) {
if (hitTest(_root._xmouse, _root._ymouse, true) && (_root.buttonHide != true)) {
xTar = startX - 20;
} else if (_root.buttonHide == true) {
xTar = 900;
} else {
xTar = startX;
}
_x = (_x + ((xTar - _x) * 0.3));
}
on (release) {
getURL ("http://www.armorgames.com", "_blank");
}
Instance of Symbol 209 MovieClip in Frame 7
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
if ((_root.story == true) && (_alpha < 100)) {
_alpha = (_alpha + 5);
} else if ((_root.story == false) && (_alpha > 0)) {
_alpha = (_alpha - 5);
}
}
Instance of Symbol 210 MovieClip "fade" in Frame 7
onClipEvent (load) {
function action() {
_root.play();
}
}
Frame 8
stop();
onEnterFrame = function () {
};
Instance of Symbol 213 MovieClip in Frame 8
on (release) {
_root.fade.play();
}
Instance of Symbol 215 MovieClip in Frame 8
on (release) {
_root.tutorial.play();
}
Instance of Symbol 143 MovieClip in Frame 8
onClipEvent (load) {
play();
}
Frame 9
onEnterFrame = function () {
};
for (cObject in _root) {
if (typeof(_root[cObject]) == "movieclip") {
_root[cObject].removeMovieClip();
}
}
_root.gotoAndStop(_root._currentframe + 1);
Instance of Symbol 123 MovieClip in Frame 9
onClipEvent (enterFrame) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
Frame 10
function getDistance(xPos1, yPos1, xPos2, yPos2) {
return(Math.sqrt(((xPos1 - xPos2) * (xPos1 - xPos2)) + ((yPos1 - yPos2) * (yPos1 - yPos2))));
}
function getDistance(xPos1, yPos1, xPos2, yPos2) {
return(Math.sqrt(((xPos1 - xPos2) * (xPos1 - xPos2)) + ((yPos1 - yPos2) * (yPos1 - yPos2))));
}
stop();
_quality = "LOW";
paused = false;
gTim = false;
level = 1;
candy = 0;
maxCandy = 10;
score = 0;
magicPower = 0;
enemyTimer = 50;
zombies = 0;
bats = 0;
maxEnemies = 3 + level;
currentEnemies = 0;
totalEnemies = 0;
press80 = false;
onEnterFrame = function () {
if (Key.isDown(80)) {
if (press80 == false) {
if (paused == true) {
paused = false;
} else if (paused == false) {
paused = true;
}
press80 = true;
}
} else {
press80 = false;
}
if (candy >= maxCandy) {
for (cObject in _root) {
if (_root[cObject].removeOnLevelChange == true) {
_root[cObject].swapDepths(_root.getNextHighestDepth());
_root[cObject].removeMovieClip();
}
}
currentEnemies = 0;
if (maxEnemies < 9) {
maxEnemies = 3 + level;
} else {
maxEnemies = 9;
}
zombies = 0;
bats = 0;
candy = 0;
enemyTimer = 150;
score = score + 150;
magicPower = 0;
if ((_root.player.health + 40) >= 100) {
_root.player.health = 100;
} else {
_root.player.health = _root.player.health + 40;
}
maxCandy = 10 + Math.round(level * 5);
_root.player._x = 120;
_root._x = (-_root.player._x) + 325;
level++;
if (level < 6) {
_root.backG.gotoAndStop(level);
} else {
_root.backG.gotoAndStop(6);
}
}
if ((_root.player._x > ((-_x) + 500)) || (_root.player._x < ((-_x) + 150))) {
followTarget = true;
}
if (followTarget == true) {
screenTarget = (-_root.player._x) + 325;
}
if (Math.abs(_root.player.xSpeed) <= 0.3) {
followTarget = false;
}
if ((-_x) < 0) {
_x = 0;
}
if (((-_x) + 650) > 1100) {
_x = -450;
}
if (paused == false) {
_x = (_x + ((screenTarget - _x) * 0.06));
if (gTim == true) {
enemyTimer = enemyTimer - (1 + (level / 3));
}
if (enemyTimer <= 0) {
if (currentEnemies < maxEnemies) {
if (currentEnemies < maxEnemies) {
var _local3 = random(3);
if (_local3 == 1) {
if (zombies <= (2 + Math.round(level / 2))) {
zombieName = "zom" + _root.getNextHighestDepth();
duplicateMovieClip (_root.zom, zombieName, _root.getNextHighestDepth());
_root[zombieName]._x = 100 + random(900);
_root[zombieName]._y = 284;
} else {
devilName = "dev" + _root.getNextHighestDepth();
duplicateMovieClip (_root.devil, devilName, _root.getNextHighestDepth());
_root[devilName]._x = 100 + random(900);
_root[devilName]._y = 0;
}
} else if (_local3 == 2) {
devilName = "dev" + _root.getNextHighestDepth();
duplicateMovieClip (_root.devil, devilName, _root.getNextHighestDepth());
_root[devilName]._x = 100 + random(900);
_root[devilName]._y = 0;
} else if ((currentEnemies >= 2) && (bats < currentEnemies)) {
var _local2 = "bat" + _root.getNextHighestDepth();
duplicateMovieClip (_root.bat, _local2, _root.getNextHighestDepth());
_root[_local2]._x = (_root.player._x - 200) + random(400);
_root[_local2]._y = 0;
} else {
devilName = "dev" + _root.getNextHighestDepth();
duplicateMovieClip (_root.devil, devilName, _root.getNextHighestDepth());
_root[devilName]._x = 100 + random(900);
_root[devilName]._y = 0;
}
}
}
enemyTimer = 150;
}
}
onTop._x = -_root._x;
onTop._y = -_root._y;
fade._x = -_root._x;
fade._y = -_root._y;
moon._x = -_root._x;
topGround.swapDepths(_root.getNextHighestDepth());
onTop.swapDepths(_root.getNextHighestDepth() + 1);
if (_root.player.dead == true) {
fade.swapDepths(_root.onTop.getDepth() - 1);
}
};
Instance of Symbol 143 MovieClip in Frame 10
onClipEvent (enterFrame) {
this.swapDepths(_root.getNextHighestDepth() + 5);
_x = (-_root._x);
_y = (-_root._y);
}
Instance of Symbol 210 MovieClip "fade" in Frame 10
onClipEvent (load) {
function action() {
_root.play();
}
}
Instance of Symbol 277 MovieClip "platform" in Frame 10
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 312 MovieClip "player" in Frame 10
onClipEvent (load) {
xSpeed = 0;
xSpeed2 = 0;
xscale = _xscale;
health = 100;
dead = false;
}
onClipEvent (enterFrame) {
if ((_root.paused == false) && (dead == false)) {
xSpeed2 = xSpeed2 + ((xSpeed - xSpeed2) * 0.2);
if ((Math.abs(xSpeed2) <= 0.05) && (xSpeed == 0)) {
xSpeed2 = 0;
}
_x = (_x + xSpeed2);
if (_x < 0) {
_x = 0;
xSpeed = 0;
xSpeed2 = 0;
}
if (_x > 1100) {
_x = 1100;
xSpeed = 0;
xSpeed2 = 0;
}
if (Key.isDown(68) || (Key.isDown(39))) {
xSpeed = 5;
} else if (Key.isDown(65) || (Key.isDown(37))) {
xSpeed = -5;
} else {
xSpeed = 0;
}
if (Math.abs(xSpeed) > 0.2) {
if ((_root._xmouse > _x) && (xSpeed < 0)) {
this.legs.gotoAndStop(3);
} else if ((_root._xmouse > _x) && (xSpeed > 0)) {
this.legs.gotoAndStop(2);
} else if ((_root._xmouse < _x) && (xSpeed < 0)) {
this.legs.gotoAndStop(2);
} else if ((_root._xmouse < _x) && (xSpeed > 0)) {
this.legs.gotoAndStop(3);
}
} else {
this.legs.gotoAndStop(1);
}
if (_root._xmouse < _x) {
this.gotoAndStop(2);
} else if (_root._xmouse > _x) {
this.gotoAndStop(1);
}
if (health <= 0) {
dead = true;
}
}
if ((_root.paused == false) && (dead == true)) {
_x = (_x + xSpeed2);
xSpeed2 = xSpeed2 * 0.8;
if (this._currentframe != 3) {
if (this._currentframe == 1) {
_xscale = xscale;
} else if (this._currentframe == 2) {
_xscale = (-xscale);
}
}
this.gotoAndStop(3);
}
}
Instance of Symbol 314 MovieClip in Frame 10
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
_x = _root._xmouse;
_y = _root._ymouse;
_alpha = (_alpha + ((_root.magicPower - _alpha) * 0.2));
}
Instance of Symbol 314 MovieClip "smoke" in Frame 10
onClipEvent (load) {
if (_name != "smoke") {
if (times == undefined) {
times = 1;
}
scale = (7 + random(8)) * times;
_alpha = (120 + random(70));
moveSpeedX = (-4 + random(8)) * times;
moveSpeedY = (-5 + random(7)) * times;
_x = (_x + ((-4 + random(8)) * times));
_y = (_y + ((-4 + random(8)) * times));
}
}
onClipEvent (enterFrame) {
if (_name != "smoke") {
_x = (_x + moveSpeedX);
_y = (_y + moveSpeedY);
scale = scale + ((200 - scale) * 0.1);
_alpha = (_alpha - 6);
_yscale = scale;
_xscale = scale;
if (_alpha <= 0) {
this.removeMovieClip();
}
}
}
Instance of Symbol 219 MovieClip "whiteFlash" in Frame 10
onClipEvent (enterFrame) {
if (_name != "whiteFlash") {
_alpha = (_alpha - 10);
_yscale = (_alpha - 10);
_xscale = (_alpha - 10);
if (_xscale <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
}
Instance of Symbol 340 MovieClip "smallDevil" in Frame 10
on (press) {
if ((_name != "smallDevil") && (_root.player.dead == false)) {
_root.magicPower = 100;
drag = true;
nrOfHits = 0;
physActive = true;
}
}
on (release) {
if (_name != "smallDevil") {
_root.magicPower = 0;
_root.mousePress = false;
drag = false;
nrOfHits = 0;
physActive = true;
}
}
on (releaseOutside) {
if (_name != "smallDevil") {
_root.magicPower = 0;
_root.mousePress = false;
drag = false;
nrOfHits = 0;
physActive = true;
}
}
onClipEvent (load) {
function setPhysPoints(obj, nrOfPhysPoints) {
var _local6 = obj._rotation;
obj._rotation = 0;
if (nrOfPhysPoints == undefined) {
obj.physP1Dist = Math.sqrt((((obj._x - (obj.objectWidth / 2)) - obj._x) * ((obj._x - (obj.objectWidth / 2)) - obj._x)) + (((obj._y - (obj.objectHeight / 2)) - obj._y) * ((obj._y - (obj.objectHeight / 2)) - obj._y)));
obj.physP2Dist = Math.sqrt((((obj._x + (obj.objectWidth / 2)) - obj._x) * ((obj._x + (obj.objectWidth / 2)) - obj._x)) + (((obj._y - (obj.objectHeight / 2)) - obj._y) * ((obj._y - (obj.objectHeight / 2)) - obj._y)));
obj.physP3Dist = Math.sqrt((((obj._x - (obj.objectWidth / 2)) - obj._x) * ((obj._x - (obj.objectWidth / 2)) - obj._x)) + (((obj._y + (obj.objectHeight / 2)) - obj._y) * ((obj._y + (obj.objectHeight / 2)) - obj._y)));
obj.physP4Dist = Math.sqrt((((obj._x + (obj.objectWidth / 2)) - obj._x) * ((obj._x + (obj.objectWidth / 2)) - obj._x)) + (((obj._y + (obj.objectHeight / 2)) - obj._y) * ((obj._y + (obj.objectHeight / 2)) - obj._y)));
obj.physP1Angle = ((Math.atan2((obj._y - (obj.objectHeight / 2)) - obj._y, (obj._x - (obj.objectWidth / 2)) - obj._x) * 180) / Math.PI) - 90;
obj.physP2Angle = ((Math.atan2((obj._y - (obj.objectHeight / 2)) - obj._y, (obj._x + (obj.objectWidth / 2)) - obj._x) * 180) / Math.PI) - 90;
obj.physP3Angle = ((Math.atan2((obj._y + (obj.objectHeight / 2)) - obj._y, (obj._x - (obj.objectWidth / 2)) - obj._x) * 180) / Math.PI) - 90;
obj.physP4Angle = ((Math.atan2((obj._y + (obj.objectHeight / 2)) - obj._y, (obj._x + (obj.objectWidth / 2)) - obj._x) * 180) / Math.PI) - 90;
} else {
var _local5 = 360 / nrOfPhysPoints;
var _local3 = -45;
var _local2 = 0;
i = 1;
while (i <= nrOfPhysPoints) {
_local2 = 0;
_local3 = _local3 + _local5;
obj[("physP" + i) + "Angle"] = _local3;
while (obj.hitTest(obj._x + (Math.sin((_local3 * Math.PI) / 180) * _local2), obj._y - (Math.cos((_local3 * Math.PI) / 180) * _local2), true)) {
_local2 = _local2 + 1;
obj[("physP" + i) + "Dist"] = _local2 + 1;
}
i++;
}
}
obj._rotation = _local6;
}
function calcPhysPoints(obj) {
obj.physP1X = obj._x + (Math.sin(((obj.physP1Angle - obj._rotation) * Math.PI) / 180) * obj.physP1Dist);
obj.physP1Y = obj._y + (Math.cos(((obj.physP1Angle - obj._rotation) * Math.PI) / 180) * obj.physP1Dist);
obj.physP2X = obj._x + (Math.sin(((obj.physP2Angle - obj._rotation) * Math.PI) / 180) * obj.physP2Dist);
obj.physP2Y = obj._y + (Math.cos(((obj.physP2Angle - obj._rotation) * Math.PI) / 180) * obj.physP2Dist);
obj.physP3X = obj._x + (Math.sin(((obj.physP3Angle - obj._rotation) * Math.PI) / 180) * obj.physP3Dist);
obj.physP3Y = obj._y + (Math.cos(((obj.physP3Angle - obj._rotation) * Math.PI) / 180) * obj.physP3Dist);
obj.physP4X = obj._x + (Math.sin(((obj.physP4Angle - obj._rotation) * Math.PI) / 180) * obj.physP4Dist);
obj.physP4Y = obj._y + (Math.cos(((obj.physP4Angle - obj._rotation) * Math.PI) / 180) * obj.physP4Dist);
}
function rotAAngleDifference(obj, xPos, yPos) {
return(obj._rotation - ((Math.atan2(yPos - obj._y, xPos - obj._x) * 180) / Math.PI));
}
function rotA(obj, xPos, yPos, moveAmount, dist, angleDiff2) {
var _local5 = (Math.atan2(yPos - obj._y, xPos - obj._x) * 180) / Math.PI;
if (angleDiff2 == undefined) {
var _local6 = obj._rotation - _local5;
} else {
var _local6 = angleDiff2;
}
if (dist == undefined) {
var _local4 = Math.sqrt(((xPos - obj._x) * (xPos - obj._x)) + ((yPos - obj._y) * (yPos - obj._y)));
} else {
var _local4 = dist;
}
if (_local4 < 15) {
var _local7 = false;
}
obj._x = xPos + (Math.sin((((_local5 + 90) + moveAmount) * Math.PI) / 180) * (-_local4));
obj._y = yPos - (Math.cos((((_local5 + 90) + moveAmount) * Math.PI) / 180) * (-_local4));
if (_local7 != false) {
obj._rotation = ((Math.atan2(yPos - obj._y, xPos - obj._x) * 180) / Math.PI) + _local6;
} else if (obj.rotSpeed != undefined) {
obj._rotation = obj._rotation + obj.rotSpeed;
}
}
function getDistance(xPos1, yPos1, xPos2, yPos2) {
return(Math.sqrt(((xPos1 - xPos2) * (xPos1 - xPos2)) + ((yPos1 - yPos2) * (yPos1 - yPos2))));
}
function perparePhysics(obj) {
var _local2 = obj._rotation;
obj._rotation = -45;
obj.maxHeight = obj._height;
obj._rotation = _local2;
}
damage = 3;
xscale = _xscale;
jumpTimer = 20;
bildruta = 1 + random(4);
objectHeight = (objectWidth = _height / 1.5);
preparePhysics(this);
setPhysPoints(this);
if (fallspeed == undefined) {
fallspeed = 0;
}
if (rotSpeed == undefined) {
rotSpeed = 0;
}
if (xSpeed == undefined) {
xSpeed = 0;
}
if (_name != smallDevil) {
_root.currentEnemies = _root.currentEnemies + 0.5;
}
physActive = true;
gravity = 0.6;
throwDamage = true;
if (_name != "smallDevil") {
removeOnLevelChange = true;
}
}
onClipEvent (enterFrame) {
if ((_name != "smallDevil") && (_root.paused == false)) {
for (cObject in _root) {
if ((cObject != _name) && (_root[cObject].throwDamage == true)) {
if ((Math.abs(_root[cObject].fallspeed) > 10) || (Math.abs(_root[cObject].xSpeed) > 10)) {
if ((_root[cObject].drag == false) && (_root.getDistance(_root[cObject]._x, _root[cObject]._y, _x, _y) < (_width / 1.5))) {
_root[cObject].die = true;
die = true;
}
}
}
}
if (physActive == true) {
calcPhysPoints(this);
if (physRotate != false) {
if (_root.platform.hitTest(physP1X, physP1Y, true)) {
rotA(this, physP1X, physP1Y, (_x - physP1X) * 0.09);
rotSpeed = rotSpeed * 0.95;
xSpeed = xSpeed * 0.7;
physP1Hit = true;
} else {
physP1Hit = false;
}
if (_root.platform.hitTest(physP2X, physP2Y, true)) {
rotA(this, physP2X, physP2Y, (_x - physP2X) * 0.09);
rotSpeed = rotSpeed * 0.95;
xSpeed = xSpeed * 0.7;
physP2Hit = true;
} else {
physP2Hit = false;
}
if (_root.platform.hitTest(physP3X, physP3Y, true)) {
rotA(this, physP3X, physP3Y, (_x - physP3X) * 0.09);
rotSpeed = rotSpeed * 0.95;
xSpeed = xSpeed * 0.7;
physP3Hit = true;
} else {
physP3Hit = false;
}
if (_root.platform.hitTest(physP4X, physP4Y, true)) {
rotA(this, physP4X, physP4Y, (_x - physP4X) * 0.09);
rotSpeed = rotSpeed * 0.95;
xSpeed = xSpeed * 0.7;
physP4Hit = true;
} else {
physP4Hit = false;
}
} else {
if (_root.platform.hitTest(physP1X, physP1Y + 7, true)) {
rotSpeed = rotSpeed * 0.95;
xSpeed = xSpeed * 0.7;
physP1Hit = true;
} else {
physP1Hit = false;
}
if (_root.platform.hitTest(physP2X, physP2Y + 7, true)) {
rotSpeed = rotSpeed * 0.95;
xSpeed = xSpeed * 0.7;
physP2Hit = true;
} else {
physP2Hit = false;
}
if (_root.platform.hitTest(physP3X, physP3Y + 7, true)) {
rotSpeed = rotSpeed * 0.95;
xSpeed = xSpeed * 0.7;
physP3Hit = true;
} else {
physP3Hit = false;
}
if (_root.platform.hitTest(physP4X, physP4Y + 7, true)) {
rotSpeed = rotSpeed * 0.95;
xSpeed = xSpeed * 0.7;
physP4Hit = true;
} else {
physP4Hit = false;
}
}
}
if (drag == true) {
this.gotoAndStop(3);
physActive = true;
if (dragDist == undefined) {
angleDifference = rotAAngleDifference(this, _root._xmouse, _root._ymouse);
dragDist = getDistance(_x, _y, _root._xmouse, _root._ymouse);
}
rotSpeed = rotSpeed + ((_x - _root._xmouse) * 0.05);
rotSpeed = rotSpeed / 1.1;
rotA(this, _root._xmouse, _root._ymouse, rotSpeed, dragDist, angleDifference);
xSpeed = _x - prevX;
fallspeed2 = _y - prevY;
prevX = _x;
prevY = _y;
} else {
if (dragDist != undefined) {
fallspeed = fallspeed2;
dragDist = undefined;
}
if (physActive == true) {
fallspeed = fallspeed + gravity;
_x = (_x + xSpeed);
rotSpeed = rotSpeed * 0.97;
_y = (_y + fallspeed);
_rotation = (_rotation + rotSpeed);
}
}
var nrOfHits = 0;
i = 1;
while (i <= 4) {
if (this[("physP" + i) + "Hit"] == true) {
nrOfHits++;
}
i++;
}
if (nrOfHits >= 2) {
physRotate = false;
nrOfHits = 0;
if (((_rotation > -4) && (_rotation < 4)) && (xSpeed <= 1)) {
if (_x > _root.player._x) {
_xscale = xscale;
} else {
_xscale = (-xscale);
}
if ((_x < (_root.player._x + 300)) && (_x > (_root.player._x - 300))) {
if (_x < (_root.player._x - 50)) {
this.gotoAndStop(4);
_x = (_x + 2.7);
} else if (_x > (_root.player._x + 50)) {
this.gotoAndStop(4);
_x = (_x - 2.7);
} else {
this.gotoAndStop(5);
}
} else if (_x <= (_root.player._x - 300)) {
this.gotoAndStop(2);
_x = (_x + 0.5);
} else if (_x >= (_root.player._x + 300)) {
this.gotoAndStop(2);
_x = (_x - 0.5);
} else {
this.gotoAndStop(5);
}
_rotation = 0;
fallspeed = 0;
rotSpeed = 0;
physActive = false;
}
if (((_rotation > 84) && (_rotation < 94)) && (xSpeed <= 1)) {
_rotation = 90;
fallspeed = 0;
rotSpeed = 0;
physActive = false;
}
if ((Math.abs(_rotation) > 174) && (xSpeed <= 1)) {
_rotation = 180;
fallspeed = 0;
rotSpeed = 0;
physActive = false;
}
if (((_rotation < -84) && (_rotation > -94)) && (xSpeed <= 1)) {
_rotation = -90;
fallspeed = 0;
rotSpeed = 0;
physActive = false;
}
} else {
physRotate = true;
}
if (_y > (_root.platform._y - (objectHeight / 2))) {
_y = (_root.platform._y - (objectHeight / 2));
if (fallspeed > 30) {
die = true;
}
fallspeed = 0;
}
if (die == true) {
_root.magicPower = 0;
var flashName = ("f" + _root.getNextHighestDepth());
duplicateMovieClip (_root.whiteFlash, flashName, _root.getNextHighestDepth());
_root[flashName]._x = _x;
_root[flashName]._y = _y;
_root[flashName]._xscale = (_root[flashName]._yscale = 50);
var i = 0;
while ((++i) < 3) {
var smokeName = ("s" + _root.getNextHighestDepth());
duplicateMovieClip (_root.smoke, smokeName, _root.getNextHighestDepth());
_root[smokeName]._x = _x;
_root[smokeName]._y = _y;
_root[smokeName].times = 0.5;
}
_root.currentEnemies = _root.currentEnemies - 0.5;
_root.score = _root.score + 5;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
if (_x < 0) {
_x = 0;
xSpeed = 0;
}
if (_x > 1100) {
_x = 1100;
xSpeed = 0;
}
if (_y < -800) {
fallspeed = fallspeed / 2;
_y = -800;
}
if ((physActive == false) && (_rotation != 0)) {
jumpTimer--;
if (jumpTimer <= 0) {
_y = (_y - 10);
fallspeed = -5 - random(10);
rotSpeed = -5 + random(10);
physActive = true;
jumpTimer = 20;
}
}
}
}
Instance of Symbol 346 MovieClip "candy1" in Frame 10
onClipEvent (load) {
moving = true;
fallspeed = -5 - random(5);
xSpeed = -7 + random(14);
moveMode = 1;
if (_name != "candy1") {
removeOnLevelChange = true;
}
}
onClipEvent (enterFrame) {
if (_name != "candy1") {
if (moveMode == 1) {
if (_x < 0) {
_x = 0;
} else if (_x > 1100) {
_x = 1100;
}
if ((_x > (_root.player._x - 20)) && (_x < (_root.player._x + 20))) {
_root.score = _root.score + 12;
_root.candy++;
moveMode = 2;
}
if (moving == true) {
fallspeed = fallspeed + 0.4;
_y = (_y + fallspeed);
}
xSpeed = xSpeed * 0.95;
_x = (_x + xSpeed);
if (_y > _root.platform._y) {
fallspeed = 0;
xSpeed = xSpeed * 0.5;
_y = _root.platform._y;
moving = false;
}
}
}
if (moveMode == 2) {
_x = (_x + ((_root.player._x - _x) * 0.2));
_y = (_y + ((_root.player._y - _y) * 0.2));
_yscale = (_yscale * 0.7);
_xscale = (_yscale * 0.7);
_rotation = (_rotation + 22);
if (_xscale <= 0.3) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
}
Instance of Symbol 354 MovieClip "zArm" in Frame 10
on (press) {
if (((_name != "zArm") && (_root[attachPart].started == true)) && (_root.player.dead == false)) {
_root.magicPower = 100;
drag = true;
nrOfHits = 0;
physActive = true;
}
}
on (release) {
if ((_name != "zArm") && (_root[attachPart].started == true)) {
_root.magicPower = 0;
_root.mousePress = false;
drag = false;
nrOfHits = 0;
physActive = true;
}
}
on (releaseOutside) {
if ((_name != "zArm") && (_root[attachPart].started == true)) {
_root.magicPower = 0;
_root.mousePress = false;
drag = false;
nrOfHits = 0;
physActive = true;
}
}
onClipEvent (load) {
function setPhysPoints(obj, nrOfPhysPoints) {
var _local6 = obj._rotation;
obj._rotation = 0;
if (nrOfPhysPoints == undefined) {
obj.physP1Dist = Math.sqrt(((obj._x - obj._x) * (obj._x - obj._x)) + (((obj._y - (obj._height / 2)) - obj._y) * ((obj._y - (obj._height / 2)) - obj._y)));
obj.physP2Dist = Math.sqrt(((obj._x - obj._x) * (obj._x - obj._x)) + (((obj._y + (obj._height / 2)) - obj._y) * ((obj._y + (obj._height / 2)) - obj._y)));
obj.physP1Angle = ((Math.atan2((obj._y - (obj._height / 2)) - obj._y, obj._x - obj._x) * 180) / Math.PI) - 90;
obj.physP2Angle = ((Math.atan2((obj._y + (obj._height / 2)) - obj._y, obj._x - obj._x) * 180) / Math.PI) - 90;
} else {
var _local5 = 360 / nrOfPhysPoints;
var _local3 = -45;
var _local2 = 0;
i = 1;
while (i <= nrOfPhysPoints) {
_local2 = 0;
_local3 = _local3 + _local5;
obj[("physP" + i) + "Angle"] = _local3;
while (obj.hitTest(obj._x + (Math.sin((_local3 * Math.PI) / 180) * _local2), obj._y - (Math.cos((_local3 * Math.PI) / 180) * _local2), true)) {
_local2 = _local2 + 1;
obj[("physP" + i) + "Dist"] = _local2 + 1;
}
i++;
}
}
obj._rotation = _local6;
}
function calcPhysPoints(obj) {
obj.physP1X = obj._x + (Math.sin(((obj.physP1Angle - obj._rotation) * Math.PI) / 180) * obj.physP1Dist);
obj.physP1Y = obj._y + (Math.cos(((obj.physP1Angle - obj._rotation) * Math.PI) / 180) * obj.physP1Dist);
obj.physP2X = obj._x + (Math.sin(((obj.physP2Angle - obj._rotation) * Math.PI) / 180) * obj.physP2Dist);
obj.physP2Y = obj._y + (Math.cos(((obj.physP2Angle - obj._rotation) * Math.PI) / 180) * obj.physP2Dist);
}
function rotAAngleDifference(obj, xPos, yPos) {
return(obj._rotation - ((Math.atan2(yPos - obj._y, xPos - obj._x) * 180) / Math.PI));
}
function rotA(obj, xPos, yPos, moveAmount, dist, angleDiff2) {
var _local5 = (Math.atan2(yPos - obj._y, xPos - obj._x) * 180) / Math.PI;
if (angleDiff2 == undefined) {
var _local6 = obj._rotation - _local5;
} else {
var _local6 = angleDiff2;
}
if (dist == undefined) {
var _local4 = Math.sqrt(((xPos - obj._x) * (xPos - obj._x)) + ((yPos - obj._y) * (yPos - obj._y)));
} else {
var _local4 = dist;
}
if (_local4 < 15) {
var _local7 = false;
}
obj._x = xPos + (Math.sin((((_local5 + 90) + moveAmount) * Math.PI) / 180) * (-_local4));
obj._y = yPos - (Math.cos((((_local5 + 90) + moveAmount) * Math.PI) / 180) * (-_local4));
if (_local7 != false) {
obj._rotation = ((Math.atan2(yPos - obj._y, xPos - obj._x) * 180) / Math.PI) + _local6;
} else if (obj.rotSpeed != undefined) {
obj._rotation = obj._rotation + obj.rotSpeed;
}
}
function getDistance(xPos1, yPos1, xPos2, yPos2) {
return(Math.sqrt(((xPos1 - xPos2) * (xPos1 - xPos2)) + ((yPos1 - yPos2) * (yPos1 - yPos2))));
}
function perparePhysics(obj) {
var _local2 = obj._rotation;
obj._rotation = -45;
obj.maxHeight = obj._height;
obj._rotation = _local2;
}
var startRotation = _rotation;
_rotation = 0;
maxWidth = _width;
_rotation = startRotation;
playerHit = false;
attached = true;
drag = false;
preparePhysics(this);
setPhysPoints(this);
fallspeed = 0;
rotSpeed = 0;
xSpeed = 0;
physActive = true;
gravity = 0.8;
_visible = false;
throwDamage = false;
if (_name != "zArm") {
removeOnLevelChange = true;
}
}
onClipEvent (enterFrame) {
if (_name != "zArm") {
_visible = _root[attachPart].started;
if (_root[attachPart]._name == undefined) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
if (((_name != "zArm") && (_root[attachPart].started == true)) && (_root.paused == false)) {
if (attached == false) {
for (cObject in _root) {
if ((cObject != _name) && (_root[cObject].throwDamage == true)) {
if ((Math.abs(_root[cObject].fallspeed) > 10) || (Math.abs(_root[cObject].xSpeed) > 10)) {
if ((_root[cObject].drag == false) && (_root.getDistance(_root[cObject]._x, _root[cObject]._y, _x, _y) < (_width / 1.5))) {
_root[cObject].die = true;
xSpeed = 0;
fallspeed = 0;
}
}
}
}
}
if (attached == false) {
throwDamage = true;
}
if (_root[attachPart]._name == undefined) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
if (physActive == true) {
calcPhysPoints(this);
if (physRotate != false) {
if (_root.platform.hitTest(physP1X, physP1Y + (maxWidth / 2), true)) {
rotA(this, physP1X, physP1Y, (_x - physP1X) * 0.12);
rotSpeed = rotSpeed * 0.95;
xSpeed = xSpeed * 0.7;
physP1Hit = true;
} else {
physP1Hit = false;
}
if (_root.platform.hitTest(physP2X, physP2Y + (maxWidth / 2), true)) {
rotA(this, physP2X, physP2Y, (_x - physP2X) * 0.12);
rotSpeed = rotSpeed * 0.95;
xSpeed = xSpeed * 0.7;
physP2Hit = true;
} else {
physP2Hit = false;
}
} else {
if (_root.platform.hitTest(physP1X, physP1Y, true)) {
rotSpeed = rotSpeed * 0.95;
xSpeed = xSpeed * 0.7;
physP1Hit = true;
} else {
physP1Hit = false;
}
if (_root.platform.hitTest(physP2X, physP2Y, true)) {
rotSpeed = rotSpeed * 0.95;
xSpeed = xSpeed * 0.7;
physP2Hit = true;
} else {
physP2Hit = false;
}
}
}
if (attached == true) {
if (((_root[attachPart]._x < (_root.player._x + 110)) && (_root[attachPart]._x > (_root.player._x - 110))) && (Math.abs(rotSpeed) < 15)) {
if (_xscale > 0) {
rotSpeed = rotSpeed - 2.5;
} else {
rotSpeed = rotSpeed + 2.5;
}
}
if (((Math.abs(rotSpeed) > 5) && (physP2X < (_root.player._x + 50))) && (physP2X > (_root.player._x - 50))) {
if (playerHit == false) {
_root.player.health = _root.player.health - 12;
playerHit = true;
}
} else {
playerHit = false;
}
physActive = true;
if (dragDist2 == undefined) {
angleDifference2 = rotAAngleDifference(this, _root[attachPart]._x, _root[attachPart]._y);
dragDist2 = getDistance(_x, _y, _root[attachPart]._x, _root[attachPart]._y);
}
if (_root[attachPart]._xscale < 0) {
_xscale = -100;
} else {
_xscale = 100;
}
if (drag == true) {
if (Math.abs(getDistance(physP1X, physP1Y, _root._xmouse, _root._ymouse)) > 90) {
var i = 0;
while ((++i) < 6) {
var bloodName = ("blood" + _root.getNextHighestDepth());
duplicateMovieClip (_root.bloodDrip, bloodName, _root.getNextHighestDepth());
_root[bloodName]._x = _root[attachPart]._x;
_root[bloodName]._y = _root[attachPart]._y;
}
attached = false;
}
rotSpeed = (((Math.atan2(_root._ymouse - _root[attachPart]._y, _root._xmouse - _root[attachPart]._x) * 180) / Math.PI) - _rotation) - 90;
if (rotSpeed < -250) {
rotSpeed = rotSpeed + 360;
}
} else {
rotSpeed = rotSpeed + ((_x - _root[attachPart]._x) * 0.05);
rotSpeed = rotSpeed / 1.1;
}
rotA(this, _root[attachPart]._x, _root[attachPart]._y, rotSpeed, dragDist2, angleDifference2);
xSpeed = _x - prevX;
fallspeed = _y - prevY;
prevX = _x;
prevY = _y;
} else if (drag == true) {
physActive = true;
if (dragDist == undefined) {
angleDifference = rotAAngleDifference(this, _root._xmouse, _root._ymouse);
dragDist = getDistance(_x, _y, _root._xmouse, _root._ymouse);
}
rotSpeed = rotSpeed + ((_x - _root._xmouse) * 0.05);
rotSpeed = rotSpeed / 1.1;
rotA(this, _root._xmouse, _root._ymouse, rotSpeed, dragDist, angleDifference);
xSpeed = _x - prevX;
fallspeed = _y - prevY;
prevX = _x;
prevY = _y;
} else {
dragDist = undefined;
if (physActive == true) {
fallspeed = fallspeed + gravity;
_x = (_x + xSpeed);
rotSpeed = rotSpeed * 0.97;
_y = (_y + fallspeed);
_rotation = (_rotation + rotSpeed);
}
}
var nrOfHits = 0;
i = 1;
while (i <= 2) {
if (this[("physP" + i) + "Hit"] == true) {
nrOfHits++;
}
i++;
}
if (nrOfHits >= 2) {
physRotate = false;
nrOfHits = 0;
if (((_rotation > -4) && (_rotation < 4)) && (xSpeed <= 1)) {
_rotation = 0;
fallspeed = 0;
rotSpeed = 0;
physActive = false;
}
if (((_rotation > 84) && (_rotation < 94)) && (xSpeed <= 1)) {
_rotation = 90;
fallspeed = 0;
rotSpeed = 0;
physActive = false;
}
if ((Math.abs(_rotation) > 174) && (xSpeed <= 1)) {
_rotation = 180;
fallspeed = 0;
rotSpeed = 0;
physActive = false;
}
if (((_rotation < -84) && (_rotation > -94)) && (xSpeed <= 1)) {
_rotation = -90;
fallspeed = 0;
rotSpeed = 0;
physActive = false;
}
} else {
physRotate = true;
}
if (_y > (_root.platform._y - (_height / 3))) {
_y = (_root.platform._y - (_height / 3));
xSpeed = xSpeed * 0.7;
fallspeed = 0;
}
if (_x < 0) {
_x = 0;
xSpeed = 0;
}
if (_x > 1100) {
_x = 1100;
xSpeed = 0;
}
if (_y < -800) {
fallspeed = fallspeed / 2;
_y = -800;
}
}
}
Instance of Symbol 356 MovieClip "zHead" in Frame 10
on (press) {
if (((_name != "zHead") && (_root[attachPart].started == true)) && (_root.player.dead == false)) {
_root.magicPower = 100;
drag = true;
nrOfHits = 0;
physActive = true;
}
}
on (release) {
if ((_name != "zHead") && (_root[attachPart].started == true)) {
_root.magicPower = 0;
_root.mousePress = false;
drag = false;
nrOfHits = 0;
physActive = true;
}
}
on (releaseOutside) {
if ((_name != "zHead") && (_root[attachPart].started == true)) {
_root.magicPower = 0;
_root.mousePress = false;
drag = false;
nrOfHits = 0;
physActive = true;
}
}
onClipEvent (load) {
function setPhysPoints(obj, nrOfPhysPoints) {
var _local6 = obj._rotation;
obj._rotation = 0;
if (nrOfPhysPoints == undefined) {
obj.physP1Dist = Math.sqrt(((obj._x - obj._x) * (obj._x - obj._x)) + (((obj._y - (obj._height / 2)) - obj._y) * ((obj._y - (obj._height / 2)) - obj._y)));
obj.physP2Dist = Math.sqrt(((obj._x - obj._x) * (obj._x - obj._x)) + (((obj._y + (obj._height / 2)) - obj._y) * ((obj._y + (obj._height / 2)) - obj._y)));
obj.physP1Angle = ((Math.atan2((obj._y - (obj._height / 2)) - obj._y, obj._x - obj._x) * 180) / Math.PI) - 90;
obj.physP2Angle = ((Math.atan2((obj._y + (obj._height / 2)) - obj._y, obj._x - obj._x) * 180) / Math.PI) - 90;
} else {
var _local5 = 360 / nrOfPhysPoints;
var _local3 = -45;
var _local2 = 0;
i = 1;
while (i <= nrOfPhysPoints) {
_local2 = 0;
_local3 = _local3 + _local5;
obj[("physP" + i) + "Angle"] = _local3;
while (obj.hitTest(obj._x + (Math.sin((_local3 * Math.PI) / 180) * _local2), obj._y - (Math.cos((_local3 * Math.PI) / 180) * _local2), true)) {
_local2 = _local2 + 1;
obj[("physP" + i) + "Dist"] = _local2 + 1;
}
i++;
}
}
obj._rotation = _local6;
}
function calcPhysPoints(obj) {
obj.physP1X = obj._x + (Math.sin(((obj.physP1Angle - obj._rotation) * Math.PI) / 180) * obj.physP1Dist);
obj.physP1Y = obj._y + (Math.cos(((obj.physP1Angle - obj._rotation) * Math.PI) / 180) * obj.physP1Dist);
obj.physP2X = obj._x + (Math.sin(((obj.physP2Angle - obj._rotation) * Math.PI) / 180) * obj.physP2Dist);
obj.physP2Y = obj._y + (Math.cos(((obj.physP2Angle - obj._rotation) * Math.PI) / 180) * obj.physP2Dist);
}
function rotAAngleDifference(obj, xPos, yPos) {
return(obj._rotation - ((Math.atan2(yPos - obj._y, xPos - obj._x) * 180) / Math.PI));
}
function rotA(obj, xPos, yPos, moveAmount, dist, angleDiff2) {
var _local5 = (Math.atan2(yPos - obj._y, xPos - obj._x) * 180) / Math.PI;
if (angleDiff2 == undefined) {
var _local6 = obj._rotation - _local5;
} else {
var _local6 = angleDiff2;
}
if (dist == undefined) {
var _local4 = Math.sqrt(((xPos - obj._x) * (xPos - obj._x)) + ((yPos - obj._y) * (yPos - obj._y)));
} else {
var _local4 = dist;
}
if (_local4 < 15) {
var _local7 = false;
}
obj._x = xPos + (Math.sin((((_local5 + 90) + moveAmount) * Math.PI) / 180) * (-_local4));
obj._y = yPos - (Math.cos((((_local5 + 90) + moveAmount) * Math.PI) / 180) * (-_local4));
if (_local7 != false) {
obj._rotation = ((Math.atan2(yPos - obj._y, xPos - obj._x) * 180) / Math.PI) + _local6;
} else if (obj.rotSpeed != undefined) {
obj._rotation = obj._rotation + obj.rotSpeed;
}
}
function getDistance(xPos1, yPos1, xPos2, yPos2) {
return(Math.sqrt(((xPos1 - xPos2) * (xPos1 - xPos2)) + ((yPos1 - yPos2) * (yPos1 - yPos2))));
}
function perparePhysics(obj) {
var _local2 = obj._rotation;
obj._rotation = -45;
obj.maxHeight = obj._height;
obj._rotation = _local2;
}
var startRotation = _rotation;
_rotation = 0;
maxWidth = _width;
_rotation = startRotation;
_alpha = 0;
xscale = _xscale;
bildruta = 1 + random(4);
preparePhysics(this);
setPhysPoints(this);
fallspeed = 0;
rotSpeed = 0;
xSpeed = 0;
physActive = true;
physRotate = true;
gravity = 0.8;
throwDamage = true;
if (_name != "zHead") {
removeOnLevelChange = true;
}
}
onClipEvent (enterFrame) {
if (((_name != "zHead") && (_alpha == 0)) && (_root.paused == false)) {
if (_root[attachPart]._xscale > 0) {
_x = (_root[attachPart]._x - 19);
_y = (_root[attachPart]._y - 3);
_xscale = xscale;
} else {
_x = (_root[attachPart]._x + 19);
_y = (_root[attachPart]._y - 3);
_xscale = (-xscale);
}
if ((drag == true) && (Math.abs(getDistance(_x, _y, _root._xmouse, _root._ymouse)) > 30)) {
var i = 0;
while ((++i) < 10) {
var bloodName = ("blood" + _root.getNextHighestDepth());
duplicateMovieClip (_root.bloodDrip, bloodName, _root.getNextHighestDepth());
_root[bloodName]._x = _root[attachPart]._x - _xscale;
_root[bloodName]._y = _root[attachPart]._y - 20;
}
_root[attachPart].head = false;
_alpha = 100;
}
}
if ((_name != "zHead") && (_alpha == 100)) {
for (cObject in _root) {
if ((cObject != _name) && (_root[cObject].throwDamage == true)) {
if ((Math.abs(_root[cObject].fallspeed) > 10) || (Math.abs(_root[cObject].xSpeed) > 10)) {
if ((_root[cObject].drag == false) && (_root.getDistance(_root[cObject]._x, _root[cObject]._y, _x, _y) < (_width / 1.5))) {
_root[cObject].die = true;
die = true;
}
}
}
}
if (physActive == true) {
calcPhysPoints(this);
if (physRotate != false) {
if (_root.platform.hitTest(physP1X, physP1Y + (maxWidth / 2), true)) {
rotA(this, physP1X, physP1Y, (_x - physP1X) * 0.12);
rotSpeed = rotSpeed * 0.95;
xSpeed = xSpeed * 0.7;
physP1Hit = true;
} else {
physP1Hit = false;
}
if (_root.platform.hitTest(physP2X, physP2Y + (maxWidth / 2), true)) {
rotA(this, physP2X, physP2Y, (_x - physP2X) * 0.12);
rotSpeed = rotSpeed * 0.95;
xSpeed = xSpeed * 0.7;
physP2Hit = true;
} else {
physP2Hit = false;
}
} else {
if (_root.platform.hitTest(physP1X, physP1Y, true)) {
rotSpeed = rotSpeed * 0.95;
xSpeed = xSpeed * 0.7;
physP1Hit = true;
} else {
physP1Hit = false;
}
if (_root.platform.hitTest(physP2X, physP2Y, true)) {
rotSpeed = rotSpeed * 0.95;
xSpeed = xSpeed * 0.7;
physP2Hit = true;
} else {
physP2Hit = false;
}
}
}
if (drag == true) {
physActive = true;
if (dragDist == undefined) {
angleDifference = rotAAngleDifference(this, _root._xmouse, _root._ymouse);
dragDist = getDistance(_x, _y, _root._xmouse, _root._ymouse);
}
rotSpeed = rotSpeed + ((_x - _root._xmouse) * 0.05);
rotSpeed = rotSpeed / 1.1;
rotA(this, _root._xmouse, _root._ymouse, rotSpeed, dragDist, angleDifference);
if (prevX == undefined) {
prevY = _y;
prevX = _x;
}
xSpeed = _x - prevX;
fallspeed2 = _y - prevY;
prevX = _x;
prevY = _y;
} else {
if (dragDist != undefined) {
fallspeed = fallspeed2;
dragDist = undefined;
}
if (physActive == true) {
fallspeed = fallspeed + gravity;
_x = (_x + xSpeed);
rotSpeed = rotSpeed * 0.97;
_y = (_y + fallspeed);
_rotation = (_rotation + rotSpeed);
}
}
var nrOfHits = 0;
i = 1;
while (i <= 2) {
if (this[("physP" + i) + "Hit"] == true) {
nrOfHits++;
}
i++;
}
if (nrOfHits >= 2) {
physRotate = false;
nrOfHits = 0;
if (((_rotation > -4) && (_rotation < 4)) && (xSpeed <= 1)) {
_rotation = 0;
fallspeed = 0;
rotSpeed = 0;
physActive = false;
}
if (((_rotation > 84) && (_rotation < 94)) && (xSpeed <= 1)) {
_rotation = 90;
fallspeed = 0;
rotSpeed = 0;
physActive = false;
}
if ((Math.abs(_rotation) > 174) && (xSpeed <= 1)) {
_rotation = 180;
fallspeed = 0;
rotSpeed = 0;
physActive = false;
}
if (((_rotation < -84) && (_rotation > -94)) && (xSpeed <= 1)) {
_rotation = -90;
fallspeed = 0;
rotSpeed = 0;
physActive = false;
}
} else {
physRotate = true;
}
if (_y > (_root.platform._y - (_height / 3))) {
if (fallspeed > 30) {
die = true;
}
_y = (_root.platform._y - (_height / 3));
xSpeed = xSpeed * 0.7;
fallspeed = 0;
}
if (die == true) {
var i = 0;
while ((++i) < 3) {
var candyName = ("can" + _root.getNextHighestDepth());
duplicateMovieClip (_root.candy1, candyName, _root.getNextHighestDepth());
_root[candyName]._x = _x;
_root[candyName]._y = _y;
}
_root.magicPower = 0;
var flashName = ("f" + _root.getNextHighestDepth());
duplicateMovieClip (_root.whiteFlash, flashName, _root.getNextHighestDepth());
_root[flashName]._x = _x;
_root[flashName]._y = _y;
var flashName = ("f" + _root.getNextHighestDepth());
duplicateMovieClip (_root.whiteFlash, flashName, _root.getNextHighestDepth());
_root[flashName]._x = _root[attachPart]._x;
_root[flashName]._y = _root[attachPart]._y;
_root[flashName]._xscale = (_root[flashName]._yscale = 200);
var i = 0;
while ((++i) < 5) {
var smokeName = ("s" + _root.getNextHighestDepth());
duplicateMovieClip (_root.smoke, smokeName, _root.getNextHighestDepth());
_root[smokeName]._x = (_root[attachPart]._x - 40) + random(80);
_root[smokeName]._y = (_root[attachPart]._y - 30) + random(170);
}
_root[attachPart].swapDepths(_root.getNextHighestDepth());
_root.currentEnemies--;
_root.score = _root.score + 16;
_root[attachPart].removeMovieClip();
var i = 0;
while ((++i) < 3) {
var smokeName = ("s" + _root.getNextHighestDepth());
duplicateMovieClip (_root.smoke, smokeName, _root.getNextHighestDepth());
_root[smokeName]._x = _x;
_root[smokeName]._y = _y;
}
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
if (_x < 0) {
_x = 0;
xSpeed = 0;
}
if (_x > 1100) {
_x = 1100;
xSpeed = 0;
}
if (_y < -800) {
fallspeed = fallspeed / 2;
_y = -800;
}
}
}
Instance of Symbol 340 MovieClip "devil" in Frame 10
on (press) {
if ((_name != "devil") && (_root.player.dead == false)) {
_root.magicPower = 100;
drag = true;
nrOfHits = 0;
physActive = true;
}
}
on (release) {
if (_name != "devil") {
_root.magicPower = 0;
_root.mousePress = false;
drag = false;
nrOfHits = 0;
physActive = true;
}
}
on (releaseOutside) {
if (_name != "devil") {
_root.magicPower = 0;
_root.mousePress = false;
drag = false;
nrOfHits = 0;
physActive = true;
}
}
onClipEvent (load) {
function setPhysPoints(obj, nrOfPhysPoints) {
var _local6 = obj._rotation;
obj._rotation = 0;
if (nrOfPhysPoints == undefined) {
obj.physP1Dist = Math.sqrt((((obj._x - (obj.objectWidth / 2)) - obj._x) * ((obj._x - (obj.objectWidth / 2)) - obj._x)) + (((obj._y - (obj.objectHeight / 2)) - obj._y) * ((obj._y - (obj.objectHeight / 2)) - obj._y)));
obj.physP2Dist = Math.sqrt((((obj._x + (obj.objectWidth / 2)) - obj._x) * ((obj._x + (obj.objectWidth / 2)) - obj._x)) + (((obj._y - (obj.objectHeight / 2)) - obj._y) * ((obj._y - (obj.objectHeight / 2)) - obj._y)));
obj.physP3Dist = Math.sqrt((((obj._x - (obj.objectWidth / 2)) - obj._x) * ((obj._x - (obj.objectWidth / 2)) - obj._x)) + (((obj._y + (obj.objectHeight / 2)) - obj._y) * ((obj._y + (obj.objectHeight / 2)) - obj._y)));
obj.physP4Dist = Math.sqrt((((obj._x + (obj.objectWidth / 2)) - obj._x) * ((obj._x + (obj.objectWidth / 2)) - obj._x)) + (((obj._y + (obj.objectHeight / 2)) - obj._y) * ((obj._y + (obj.objectHeight / 2)) - obj._y)));
obj.physP1Angle = ((Math.atan2((obj._y - (obj.objectHeight / 2)) - obj._y, (obj._x - (obj.objectWidth / 2)) - obj._x) * 180) / Math.PI) - 90;
obj.physP2Angle = ((Math.atan2((obj._y - (obj.objectHeight / 2)) - obj._y, (obj._x + (obj.objectWidth / 2)) - obj._x) * 180) / Math.PI) - 90;
obj.physP3Angle = ((Math.atan2((obj._y + (obj.objectHeight / 2)) - obj._y, (obj._x - (obj.objectWidth / 2)) - obj._x) * 180) / Math.PI) - 90;
obj.physP4Angle = ((Math.atan2((obj._y + (obj.objectHeight / 2)) - obj._y, (obj._x + (obj.objectWidth / 2)) - obj._x) * 180) / Math.PI) - 90;
} else {
var _local5 = 360 / nrOfPhysPoints;
var _local3 = -45;
var _local2 = 0;
i = 1;
while (i <= nrOfPhysPoints) {
_local2 = 0;
_local3 = _local3 + _local5;
obj[("physP" + i) + "Angle"] = _local3;
while (obj.hitTest(obj._x + (Math.sin((_local3 * Math.PI) / 180) * _local2), obj._y - (Math.cos((_local3 * Math.PI) / 180) * _local2), true)) {
_local2 = _local2 + 1;
obj[("physP" + i) + "Dist"] = _local2 + 1;
}
i++;
}
}
obj._rotation = _local6;
}
function calcPhysPoints(obj) {
obj.physP1X = obj._x + (Math.sin(((obj.physP1Angle - obj._rotation) * Math.PI) / 180) * obj.physP1Dist);
obj.physP1Y = obj._y + (Math.cos(((obj.physP1Angle - obj._rotation) * Math.PI) / 180) * obj.physP1Dist);
obj.physP2X = obj._x + (Math.sin(((obj.physP2Angle - obj._rotation) * Math.PI) / 180) * obj.physP2Dist);
obj.physP2Y = obj._y + (Math.cos(((obj.physP2Angle - obj._rotation) * Math.PI) / 180) * obj.physP2Dist);
obj.physP3X = obj._x + (Math.sin(((obj.physP3Angle - obj._rotation) * Math.PI) / 180) * obj.physP3Dist);
obj.physP3Y = obj._y + (Math.cos(((obj.physP3Angle - obj._rotation) * Math.PI) / 180) * obj.physP3Dist);
obj.physP4X = obj._x + (Math.sin(((obj.physP4Angle - obj._rotation) * Math.PI) / 180) * obj.physP4Dist);
obj.physP4Y = obj._y + (Math.cos(((obj.physP4Angle - obj._rotation) * Math.PI) / 180) * obj.physP4Dist);
}
function rotAAngleDifference(obj, xPos, yPos) {
return(obj._rotation - ((Math.atan2(yPos - obj._y, xPos - obj._x) * 180) / Math.PI));
}
function rotA(obj, xPos, yPos, moveAmount, dist, angleDiff2) {
var _local5 = (Math.atan2(yPos - obj._y, xPos - obj._x) * 180) / Math.PI;
if (angleDiff2 == undefined) {
var _local6 = obj._rotation - _local5;
} else {
var _local6 = angleDiff2;
}
if (dist == undefined) {
var _local4 = Math.sqrt(((xPos - obj._x) * (xPos - obj._x)) + ((yPos - obj._y) * (yPos - obj._y)));
} else {
var _local4 = dist;
}
if (_local4 < 15) {
var _local7 = false;
}
obj._x = xPos + (Math.sin((((_local5 + 90) + moveAmount) * Math.PI) / 180) * (-_local4));
obj._y = yPos - (Math.cos((((_local5 + 90) + moveAmount) * Math.PI) / 180) * (-_local4));
if (_local7 != false) {
obj._rotation = ((Math.atan2(yPos - obj._y, xPos - obj._x) * 180) / Math.PI) + _local6;
} else if (obj.rotSpeed != undefined) {
obj._rotation = obj._rotation + obj.rotSpeed;
}
}
function getDistance(xPos1, yPos1, xPos2, yPos2) {
return(Math.sqrt(((xPos1 - xPos2) * (xPos1 - xPos2)) + ((yPos1 - yPos2) * (yPos1 - yPos2))));
}
function perparePhysics(obj) {
var _local2 = obj._rotation;
obj._rotation = -45;
obj.maxHeight = obj._height;
obj._rotation = _local2;
}
if (_name != "devil") {
_root.currentEnemies++;
_root.totalEnemies++;
}
damage = 5;
xscale = _xscale;
jumpTimer = 20;
bildruta = 1 + random(4);
objectHeight = (objectWidth = _height / 1.5);
preparePhysics(this);
setPhysPoints(this);
fallspeed = 0;
rotSpeed = 0;
xSpeed = 0;
physActive = true;
gravity = 0.8;
throwDamage = true;
if (_name != "devil") {
removeOnLevelChange = true;
}
}
onClipEvent (enterFrame) {
if ((_name != "devil") && (_root.paused == false)) {
for (cObject in _root) {
if ((cObject != _name) && (_root[cObject].throwDamage == true)) {
if ((Math.abs(_root[cObject].fallspeed) > 10) || (Math.abs(_root[cObject].xSpeed) > 10)) {
if ((_root[cObject].drag == false) && (_root.getDistance(_root[cObject]._x, _root[cObject]._y, _x, _y) < (_width / 1.5))) {
_root[cObject].die = true;
die = true;
}
}
}
}
if (physActive == true) {
calcPhysPoints(this);
if (physRotate != false) {
if (_root.platform.hitTest(physP1X, physP1Y, true)) {
rotA(this, physP1X, physP1Y, (_x - physP1X) * 0.09);
rotSpeed = rotSpeed * 0.95;
xSpeed = xSpeed * 0.7;
physP1Hit = true;
} else {
physP1Hit = false;
}
if (_root.platform.hitTest(physP2X, physP2Y, true)) {
rotA(this, physP2X, physP2Y, (_x - physP2X) * 0.09);
rotSpeed = rotSpeed * 0.95;
xSpeed = xSpeed * 0.7;
physP2Hit = true;
} else {
physP2Hit = false;
}
if (_root.platform.hitTest(physP3X, physP3Y, true)) {
rotA(this, physP3X, physP3Y, (_x - physP3X) * 0.09);
rotSpeed = rotSpeed * 0.95;
xSpeed = xSpeed * 0.7;
physP3Hit = true;
} else {
physP3Hit = false;
}
if (_root.platform.hitTest(physP4X, physP4Y, true)) {
rotA(this, physP4X, physP4Y, (_x - physP4X) * 0.09);
rotSpeed = rotSpeed * 0.95;
xSpeed = xSpeed * 0.7;
physP4Hit = true;
} else {
physP4Hit = false;
}
} else {
if (_root.platform.hitTest(physP1X, physP1Y + 7, true)) {
rotSpeed = rotSpeed * 0.95;
xSpeed = xSpeed * 0.7;
physP1Hit = true;
} else {
physP1Hit = false;
}
if (_root.platform.hitTest(physP2X, physP2Y + 7, true)) {
rotSpeed = rotSpeed * 0.95;
xSpeed = xSpeed * 0.7;
physP2Hit = true;
} else {
physP2Hit = false;
}
if (_root.platform.hitTest(physP3X, physP3Y + 7, true)) {
rotSpeed = rotSpeed * 0.95;
xSpeed = xSpeed * 0.7;
physP3Hit = true;
} else {
physP3Hit = false;
}
if (_root.platform.hitTest(physP4X, physP4Y + 7, true)) {
rotSpeed = rotSpeed * 0.95;
xSpeed = xSpeed * 0.7;
physP4Hit = true;
} else {
physP4Hit = false;
}
}
}
if (drag == true) {
this.gotoAndStop(3);
physActive = true;
if (dragDist == undefined) {
angleDifference = rotAAngleDifference(this, _root._xmouse, _root._ymouse);
dragDist = getDistance(_x, _y, _root._xmouse, _root._ymouse);
}
rotSpeed = rotSpeed + ((_x - _root._xmouse) * 0.05);
rotSpeed = rotSpeed / 1.1;
rotA(this, _root._xmouse, _root._ymouse, rotSpeed, dragDist, angleDifference);
xSpeed = _x - prevX;
fallspeed2 = _y - prevY;
prevX = _x;
prevY = _y;
} else {
if (dragDist != undefined) {
fallspeed = fallspeed2;
dragDist = undefined;
}
if (physActive == true) {
fallspeed = fallspeed + gravity;
_x = (_x + xSpeed);
rotSpeed = rotSpeed * 0.97;
_y = (_y + fallspeed);
_rotation = (_rotation + rotSpeed);
}
}
var nrOfHits = 0;
i = 1;
while (i <= 4) {
if (this[("physP" + i) + "Hit"] == true) {
nrOfHits++;
}
i++;
}
if (nrOfHits >= 2) {
physRotate = false;
nrOfHits = 0;
if (((_rotation > -4) && (_rotation < 4)) && (xSpeed <= 1)) {
if (_x > _root.player._x) {
_xscale = xscale;
} else {
_xscale = (-xscale);
}
if ((_x < (_root.player._x + 300)) && (_x > (_root.player._x - 300))) {
if (_x < (_root.player._x - 50)) {
this.gotoAndStop(4);
_x = (_x + 2.7);
} else if (_x > (_root.player._x + 50)) {
this.gotoAndStop(4);
_x = (_x - 2.7);
} else {
this.gotoAndStop(5);
}
} else if (_x <= (_root.player._x - 300)) {
this.gotoAndStop(2);
_x = (_x + 0.5);
} else if (_x >= (_root.player._x + 300)) {
this.gotoAndStop(2);
_x = (_x - 0.5);
} else {
this.gotoAndStop(5);
}
_rotation = 0;
fallspeed = 0;
rotSpeed = 0;
physActive = false;
}
if (((_rotation > 84) && (_rotation < 94)) && (xSpeed <= 1)) {
_rotation = 90;
fallspeed = 0;
rotSpeed = 0;
physActive = false;
}
if ((Math.abs(_rotation) > 174) && (xSpeed <= 1)) {
_rotation = 180;
fallspeed = 0;
rotSpeed = 0;
physActive = false;
}
if (((_rotation < -84) && (_rotation > -94)) && (xSpeed <= 1)) {
_rotation = -90;
fallspeed = 0;
rotSpeed = 0;
physActive = false;
}
} else {
physRotate = true;
}
if (_y > (_root.platform._y - (objectHeight / 2))) {
_y = (_root.platform._y - (objectHeight / 2));
if (fallspeed > 40) {
die = true;
}
fallspeed = 0;
}
if (die == true) {
if (random(6) == 3) {
var healthName = ("heal" + _root.getNextHighestDepth());
duplicateMovieClip (_root.healthObj, healthName, _root.getNextHighestDepth());
_root[healthName]._x = _x;
_root[healthName]._y = _y;
}
var candyName = ("can" + _root.getNextHighestDepth());
duplicateMovieClip (_root.candy1, candyName, _root.getNextHighestDepth());
_root[candyName]._x = _x;
_root[candyName]._y = _y;
_root.magicPower = 0;
var flashName = ("f" + _root.getNextHighestDepth());
duplicateMovieClip (_root.whiteFlash, flashName, _root.getNextHighestDepth());
_root[flashName]._x = _x;
_root[flashName]._y = _y;
var i = 0;
while ((++i) < 3) {
var smokeName = ("s" + _root.getNextHighestDepth());
duplicateMovieClip (_root.smoke, smokeName, _root.getNextHighestDepth());
_root[smokeName]._x = _x;
_root[smokeName]._y = _y;
}
if (_root.currentEnemies < _root.maxEnemies) {
var i = 0;
var nrOfMinis = (3 + random(2));
while ((++i) < nrOfMinis) {
var devilName = ("d" + _root.getNextHighestDepth());
duplicateMovieClip (_root.smallDevil, devilName, _root.getNextHighestDepth());
_root[devilName]._x = _x;
_root[devilName]._y = _y;
_root[devilName].fallspeed = -3 - random(4);
_root[devilName].xSpeed = (_root[devilName].rotSpeed = -5 + random(10));
}
}
this.swapDepths(_root.getNextHighestDepth());
_root.score = _root.score + 7;
_root.currentEnemies--;
this.removeMovieClip();
}
if (_x < 0) {
_x = 0;
xSpeed = 0;
}
if (_x > 1100) {
_x = 1100;
xSpeed = 0;
}
if (_y < -800) {
fallspeed = fallspeed / 2;
_y = -800;
}
if ((physActive == false) && (_rotation != 0)) {
jumpTimer--;
if (jumpTimer <= 0) {
_y = (_y - 10);
fallspeed = -5 - random(10);
rotSpeed = -5 + random(10);
physActive = true;
jumpTimer = 20;
}
}
}
}
Instance of Symbol 380 MovieClip "zom" in Frame 10
onClipEvent (load) {
if (_name != "zom") {
xMouse = _root._xmouse;
yMouse = _root._ymouse;
arm2 = true;
head = true;
xSpeed = 0;
xSpeed2 = 0;
xscale = _xscale;
zombieNr = _root.zombies;
_name = ("zom" + _root.zombies);
zArmName = "zA" + _root.getNextHighestDepth();
duplicateMovieClip (_root.zArm, zArmName, _root.getNextHighestDepth());
_root[zArmName]._x = _x;
_root[zArmName]._y = _y + 38;
_root[zArmName].attachPart = _name;
zHeadName = "zH" + _root.getNextHighestDepth();
duplicateMovieClip (_root.zHead, zHeadName, _root.getNextHighestDepth());
_root[zHeadName]._x = _x;
_root[zHeadName]._y = _y;
_root[zHeadName].attachPart = _name;
_root.zombies++;
_root.totalEnemies++;
_root.currentEnemies++;
this.gotoAndStop(4);
if (_root.player._x > _x) {
_xscale = (-xscale);
} else {
_xscale = xscale;
}
started = false;
removeOnLevelChange = true;
}
}
onClipEvent (enterFrame) {
if ((_name != "zom") && (_root.paused == false)) {
if (started == false) {
this.gotoAndStop(4);
} else {
xSpeed = xSpeed + ((xSpeed2 - xSpeed) * 0.2);
_x = (_x + xSpeed);
if ((_root.player._x + 110) < _x) {
this.gotoAndStop(2);
xSpeed2 = -2;
} else if ((_root.player._x - 110) > _x) {
this.gotoAndStop(2);
xSpeed2 = 2;
} else {
this.gotoAndStop(3);
xSpeed2 = 0;
}
if (_x > _root.player._x) {
_xscale = xscale;
} else {
_xscale = (-xscale);
}
xMouse = _root._xmouse;
yMouse = _root._ymouse;
}
}
}
Instance of Symbol 226 MovieClip "healthObj" in Frame 10
onClipEvent (load) {
moving = true;
fallspeed = -5 - random(5);
xSpeed = -7 + random(14);
moveMode = 1;
if (_name != "healthObj") {
removeOnLevelChange = true;
}
}
onClipEvent (enterFrame) {
if (_name != "healthObj") {
if (moveMode == 1) {
if (_x < 0) {
_x = 0;
} else if (_x > 1100) {
_x = 1100;
}
if ((_x > (_root.player._x - 20)) && (_x < (_root.player._x + 20))) {
moveMode = 2;
}
if (moving == true) {
fallspeed = fallspeed + 0.4;
_y = (_y + fallspeed);
}
xSpeed = xSpeed * 0.95;
_x = (_x + xSpeed);
if (_y > _root.platform._y) {
fallspeed = 0;
xSpeed = xSpeed * 0.5;
_y = _root.platform._y;
moving = false;
}
}
}
if (moveMode == 2) {
_x = (_x + ((_root.player._x - _x) * 0.2));
_y = (_y + ((_root.player._y - _y) * 0.2));
_yscale = (_yscale * 0.7);
_xscale = (_yscale * 0.7);
_rotation = (_rotation + 22);
if (_xscale <= 0) {
_root.score = _root.score + 27;
if ((_root.player.health + 30) >= 100) {
_root.player.health = 100;
} else {
_root.player.health = _root.player.health + 30;
}
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
}
Instance of Symbol 382 MovieClip "bloodDrip" in Frame 10
onClipEvent (load) {
if (_name != "bloodDrip") {
_rotation = random(180);
speed = 2 + (0.2 * random(20));
_yscale = (20 + random(40));
_xscale = (20 + random(40));
removeOnLevelChange = true;
}
}
onClipEvent (enterFrame) {
if (_name != "bloodDrip") {
speed = speed + 0.4;
if (_rotation < 90) {
_rotation = (_rotation + ((-90 - _rotation) * 0.05));
} else {
_rotation = (_rotation + ((280 - _rotation) * 0.05));
}
_x = (_x + (Math.sin((_rotation - 90) * (Math.PI/180)) * speed));
_y = (_y - (Math.cos((_rotation - 90) * (Math.PI/180)) * speed));
if (_y > (_root.platform._y + 30)) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
}
Instance of Symbol 394 MovieClip "bat" in Frame 10
onClipEvent (load) {
if (_name != "bat") {
this.gotoAndStop(2);
_root.currentEnemies++;
_root.bats++;
speed = 0.1;
xPos = (xPos2 = _x);
yPos = (yPos2 = _y);
attack = false;
timer = 70;
dead = false;
removeOnLevelChange = true;
}
}
onClipEvent (enterFrame) {
if ((_name != "bat") && (_root.paused == false)) {
if (_x < 0) {
_x = 0;
} else if (_x > 1100) {
_x = 1100;
}
if (dead == false) {
for (cObject in _root) {
if ((cObject != _name) && (_root[cObject].throwDamage == true)) {
if ((_root[cObject].drag == false) && (_root.getDistance(_root[cObject]._x, _root[cObject]._y, _x, _y) < (_width / 1.5))) {
_root.score = _root.score + 13;
dead = true;
}
}
}
_x = (_x + ((xPos2 - _x) * speed));
_y = (_y + ((yPos2 - _y) * speed));
_rotation = ((xPos2 - _x) * 0.4);
timer--;
if (timer <= 0) {
attack = true;
}
if (attack == true) {
this.gotoAndStop(3);
speed = 0.2;
if (yPos == 235) {
xPos = _root.player._x;
}
if (timer <= -5) {
if (_root.getDistance(_root._xmouse, _root._ymouse, _x, _y) < 150) {
mouseDistance = _root.getDistance(_root._xmouse, _root._ymouse, _x, _y);
mouseAngle = (Math.atan2(_root._ymouse - _y, _root._xmouse - _x) * 180) / Math.PI;
xPos2 = xPos + (Math.sin((mouseAngle - 90) * (Math.PI/180)) * (150 - mouseDistance));
yPos2 = yPos - (Math.cos((mouseAngle - 90) * (Math.PI/180)) * (150 - mouseDistance));
} else {
xPos2 = xPos;
yPos2 = yPos;
}
}
xPos2 = xPos;
yPos2 = yPos;
} else {
if (_root.getDistance(_root._xmouse, _root._ymouse, _x, _y) < 150) {
mouseDistance = _root.getDistance(_root._xmouse, _root._ymouse, _x, _y);
mouseAngle = (Math.atan2(_root._ymouse - _y, _root._xmouse - _x) * 180) / Math.PI;
xPos2 = xPos + (Math.sin((mouseAngle - 90) * (Math.PI/180)) * (150 - mouseDistance));
yPos2 = yPos - (Math.cos((mouseAngle - 90) * (Math.PI/180)) * (150 - mouseDistance));
} else {
xPos2 = xPos;
yPos2 = yPos;
}
speed = 0.1;
this.gotoAndStop(2);
yPos = yPos + ((135 - yPos) * 0.07);
xPos = xPos + ((_root.player._x - xPos) * 0.07);
}
} else {
this.gotoAndStop(4);
if (deadStart == undefined) {
xSpeed = -10 + random(20);
fallspeed = -5 - random(5);
rotSpeed = 10 + random(10);
deadStart = true;
}
fallspeed = fallspeed + 0.4;
_rotation = (_rotation + rotSpeed);
_x = (_x + xSpeed);
_y = (_y + fallspeed);
if (_y > _root.platform._y) {
var flashName = ("f" + _root.getNextHighestDepth());
duplicateMovieClip (_root.whiteFlash, flashName, _root.getNextHighestDepth());
_root[flashName]._x = _x;
_root[flashName]._y = _y;
_root[flashName]._xscale = (_root[flashName]._yscale = 50);
var i = 0;
while ((++i) < 5) {
var smokeName = ("s" + _root.getNextHighestDepth());
duplicateMovieClip (_root.smoke, smokeName, _root.getNextHighestDepth());
_root[smokeName]._x = _x;
_root[smokeName]._y = _y;
_root[smokeName].times = 0.5;
}
if (random(4) == 3) {
var healthName = ("heal" + _root.getNextHighestDepth());
duplicateMovieClip (_root.healthObj, healthName, _root.getNextHighestDepth());
_root[healthName]._x = _x;
_root[healthName]._y = _y;
}
var candyName = ("can" + _root.getNextHighestDepth());
duplicateMovieClip (_root.candy1, candyName, _root.getNextHighestDepth());
_root[candyName]._x = _x;
_root[candyName]._y = _y;
_root.currentEnemies--;
_root.bats--;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
}
}
Instance of Symbol 340 MovieClip "tutDevil" in Frame 10
on (press) {
if ((_name != "devil") && (_root.player.dead == false)) {
_root.magicPower = 100;
drag = true;
nrOfHits = 0;
physActive = true;
}
}
on (release) {
if (_name != "devil") {
_root.magicPower = 0;
_root.mousePress = false;
drag = false;
nrOfHits = 0;
physActive = true;
}
}
on (releaseOutside) {
if (_name != "devil") {
_root.magicPower = 0;
_root.mousePress = false;
drag = false;
nrOfHits = 0;
physActive = true;
}
}
onClipEvent (load) {
function setPhysPoints(obj, nrOfPhysPoints) {
var _local6 = obj._rotation;
obj._rotation = 0;
if (nrOfPhysPoints == undefined) {
obj.physP1Dist = Math.sqrt((((obj._x - (obj.objectWidth / 2)) - obj._x) * ((obj._x - (obj.objectWidth / 2)) - obj._x)) + (((obj._y - (obj.objectHeight / 2)) - obj._y) * ((obj._y - (obj.objectHeight / 2)) - obj._y)));
obj.physP2Dist = Math.sqrt((((obj._x + (obj.objectWidth / 2)) - obj._x) * ((obj._x + (obj.objectWidth / 2)) - obj._x)) + (((obj._y - (obj.objectHeight / 2)) - obj._y) * ((obj._y - (obj.objectHeight / 2)) - obj._y)));
obj.physP3Dist = Math.sqrt((((obj._x - (obj.objectWidth / 2)) - obj._x) * ((obj._x - (obj.objectWidth / 2)) - obj._x)) + (((obj._y + (obj.objectHeight / 2)) - obj._y) * ((obj._y + (obj.objectHeight / 2)) - obj._y)));
obj.physP4Dist = Math.sqrt((((obj._x + (obj.objectWidth / 2)) - obj._x) * ((obj._x + (obj.objectWidth / 2)) - obj._x)) + (((obj._y + (obj.objectHeight / 2)) - obj._y) * ((obj._y + (obj.objectHeight / 2)) - obj._y)));
obj.physP1Angle = ((Math.atan2((obj._y - (obj.objectHeight / 2)) - obj._y, (obj._x - (obj.objectWidth / 2)) - obj._x) * 180) / Math.PI) - 90;
obj.physP2Angle = ((Math.atan2((obj._y - (obj.objectHeight / 2)) - obj._y, (obj._x + (obj.objectWidth / 2)) - obj._x) * 180) / Math.PI) - 90;
obj.physP3Angle = ((Math.atan2((obj._y + (obj.objectHeight / 2)) - obj._y, (obj._x - (obj.objectWidth / 2)) - obj._x) * 180) / Math.PI) - 90;
obj.physP4Angle = ((Math.atan2((obj._y + (obj.objectHeight / 2)) - obj._y, (obj._x + (obj.objectWidth / 2)) - obj._x) * 180) / Math.PI) - 90;
} else {
var _local5 = 360 / nrOfPhysPoints;
var _local3 = -45;
var _local2 = 0;
i = 1;
while (i <= nrOfPhysPoints) {
_local2 = 0;
_local3 = _local3 + _local5;
obj[("physP" + i) + "Angle"] = _local3;
while (obj.hitTest(obj._x + (Math.sin((_local3 * Math.PI) / 180) * _local2), obj._y - (Math.cos((_local3 * Math.PI) / 180) * _local2), true)) {
_local2 = _local2 + 1;
obj[("physP" + i) + "Dist"] = _local2 + 1;
}
i++;
}
}
obj._rotation = _local6;
}
function calcPhysPoints(obj) {
obj.physP1X = obj._x + (Math.sin(((obj.physP1Angle - obj._rotation) * Math.PI) / 180) * obj.physP1Dist);
obj.physP1Y = obj._y + (Math.cos(((obj.physP1Angle - obj._rotation) * Math.PI) / 180) * obj.physP1Dist);
obj.physP2X = obj._x + (Math.sin(((obj.physP2Angle - obj._rotation) * Math.PI) / 180) * obj.physP2Dist);
obj.physP2Y = obj._y + (Math.cos(((obj.physP2Angle - obj._rotation) * Math.PI) / 180) * obj.physP2Dist);
obj.physP3X = obj._x + (Math.sin(((obj.physP3Angle - obj._rotation) * Math.PI) / 180) * obj.physP3Dist);
obj.physP3Y = obj._y + (Math.cos(((obj.physP3Angle - obj._rotation) * Math.PI) / 180) * obj.physP3Dist);
obj.physP4X = obj._x + (Math.sin(((obj.physP4Angle - obj._rotation) * Math.PI) / 180) * obj.physP4Dist);
obj.physP4Y = obj._y + (Math.cos(((obj.physP4Angle - obj._rotation) * Math.PI) / 180) * obj.physP4Dist);
}
function rotAAngleDifference(obj, xPos, yPos) {
return(obj._rotation - ((Math.atan2(yPos - obj._y, xPos - obj._x) * 180) / Math.PI));
}
function rotA(obj, xPos, yPos, moveAmount, dist, angleDiff2) {
var _local5 = (Math.atan2(yPos - obj._y, xPos - obj._x) * 180) / Math.PI;
if (angleDiff2 == undefined) {
var _local6 = obj._rotation - _local5;
} else {
var _local6 = angleDiff2;
}
if (dist == undefined) {
var _local4 = Math.sqrt(((xPos - obj._x) * (xPos - obj._x)) + ((yPos - obj._y) * (yPos - obj._y)));
} else {
var _local4 = dist;
}
if (_local4 < 15) {
var _local7 = false;
}
obj._x = xPos + (Math.sin((((_local5 + 90) + moveAmount) * Math.PI) / 180) * (-_local4));
obj._y = yPos - (Math.cos((((_local5 + 90) + moveAmount) * Math.PI) / 180) * (-_local4));
if (_local7 != false) {
obj._rotation = ((Math.atan2(yPos - obj._y, xPos - obj._x) * 180) / Math.PI) + _local6;
} else if (obj.rotSpeed != undefined) {
obj._rotation = obj._rotation + obj.rotSpeed;
}
}
function getDistance(xPos1, yPos1, xPos2, yPos2) {
return(Math.sqrt(((xPos1 - xPos2) * (xPos1 - xPos2)) + ((yPos1 - yPos2) * (yPos1 - yPos2))));
}
function perparePhysics(obj) {
var _local2 = obj._rotation;
obj._rotation = -45;
obj.maxHeight = obj._height;
obj._rotation = _local2;
}
if (_name != "devil") {
_root.currentEnemies++;
_root.totalEnemies++;
}
damage = 5;
xscale = _xscale;
jumpTimer = 20;
bildruta = 1 + random(4);
objectHeight = (objectWidth = _height / 1.5);
preparePhysics(this);
setPhysPoints(this);
fallspeed = 0;
rotSpeed = 0;
xSpeed = 0;
physActive = true;
gravity = 0.8;
throwDamage = true;
if (_name != "devil") {
removeOnLevelChange = true;
}
}
onClipEvent (enterFrame) {
if ((_name != "devil") && (_root.paused == false)) {
for (cObject in _root) {
if ((cObject != _name) && (_root[cObject].throwDamage == true)) {
if ((Math.abs(_root[cObject].fallspeed) > 10) || (Math.abs(_root[cObject].xSpeed) > 10)) {
if ((_root[cObject].drag == false) && (_root.getDistance(_root[cObject]._x, _root[cObject]._y, _x, _y) < (_width / 1.5))) {
_root[cObject].die = true;
die = true;
}
}
}
}
if (physActive == true) {
calcPhysPoints(this);
if (physRotate != false) {
if (_root.platform.hitTest(physP1X, physP1Y, true)) {
rotA(this, physP1X, physP1Y, (_x - physP1X) * 0.09);
rotSpeed = rotSpeed * 0.95;
xSpeed = xSpeed * 0.7;
physP1Hit = true;
} else {
physP1Hit = false;
}
if (_root.platform.hitTest(physP2X, physP2Y, true)) {
rotA(this, physP2X, physP2Y, (_x - physP2X) * 0.09);
rotSpeed = rotSpeed * 0.95;
xSpeed = xSpeed * 0.7;
physP2Hit = true;
} else {
physP2Hit = false;
}
if (_root.platform.hitTest(physP3X, physP3Y, true)) {
rotA(this, physP3X, physP3Y, (_x - physP3X) * 0.09);
rotSpeed = rotSpeed * 0.95;
xSpeed = xSpeed * 0.7;
physP3Hit = true;
} else {
physP3Hit = false;
}
if (_root.platform.hitTest(physP4X, physP4Y, true)) {
rotA(this, physP4X, physP4Y, (_x - physP4X) * 0.09);
rotSpeed = rotSpeed * 0.95;
xSpeed = xSpeed * 0.7;
physP4Hit = true;
} else {
physP4Hit = false;
}
} else {
if (_root.platform.hitTest(physP1X, physP1Y + 7, true)) {
rotSpeed = rotSpeed * 0.95;
xSpeed = xSpeed * 0.7;
physP1Hit = true;
} else {
physP1Hit = false;
}
if (_root.platform.hitTest(physP2X, physP2Y + 7, true)) {
rotSpeed = rotSpeed * 0.95;
xSpeed = xSpeed * 0.7;
physP2Hit = true;
} else {
physP2Hit = false;
}
if (_root.platform.hitTest(physP3X, physP3Y + 7, true)) {
rotSpeed = rotSpeed * 0.95;
xSpeed = xSpeed * 0.7;
physP3Hit = true;
} else {
physP3Hit = false;
}
if (_root.platform.hitTest(physP4X, physP4Y + 7, true)) {
rotSpeed = rotSpeed * 0.95;
xSpeed = xSpeed * 0.7;
physP4Hit = true;
} else {
physP4Hit = false;
}
}
}
if (drag == true) {
this.gotoAndStop(3);
physActive = true;
if (dragDist == undefined) {
angleDifference = rotAAngleDifference(this, _root._xmouse, _root._ymouse);
dragDist = getDistance(_x, _y, _root._xmouse, _root._ymouse);
}
rotSpeed = rotSpeed + ((_x - _root._xmouse) * 0.05);
rotSpeed = rotSpeed / 1.1;
rotA(this, _root._xmouse, _root._ymouse, rotSpeed, dragDist, angleDifference);
xSpeed = _x - prevX;
fallspeed2 = _y - prevY;
prevX = _x;
prevY = _y;
} else {
if (dragDist != undefined) {
fallspeed = fallspeed2;
dragDist = undefined;
}
if (physActive == true) {
fallspeed = fallspeed + gravity;
_x = (_x + xSpeed);
rotSpeed = rotSpeed * 0.97;
_y = (_y + fallspeed);
_rotation = (_rotation + rotSpeed);
}
}
var nrOfHits = 0;
i = 1;
while (i <= 4) {
if (this[("physP" + i) + "Hit"] == true) {
nrOfHits++;
}
i++;
}
if (nrOfHits >= 2) {
physRotate = false;
nrOfHits = 0;
if (((_rotation > -4) && (_rotation < 4)) && (xSpeed <= 1)) {
if (_x > _root.player._x) {
_xscale = xscale;
} else {
_xscale = (-xscale);
}
if ((_x < (_root.player._x + 300)) && (_x > (_root.player._x - 300))) {
if (_x < (_root.player._x - 50)) {
this.gotoAndStop(4);
_x = (_x + 2.7);
} else if (_x > (_root.player._x + 50)) {
this.gotoAndStop(4);
_x = (_x - 2.7);
} else {
this.gotoAndStop(5);
}
} else if (_x <= (_root.player._x - 300)) {
this.gotoAndStop(2);
_x = (_x + 0.5);
} else if (_x >= (_root.player._x + 300)) {
this.gotoAndStop(2);
_x = (_x - 0.5);
} else {
this.gotoAndStop(5);
}
_rotation = 0;
fallspeed = 0;
rotSpeed = 0;
physActive = false;
}
if (((_rotation > 84) && (_rotation < 94)) && (xSpeed <= 1)) {
_rotation = 90;
fallspeed = 0;
rotSpeed = 0;
physActive = false;
}
if ((Math.abs(_rotation) > 174) && (xSpeed <= 1)) {
_rotation = 180;
fallspeed = 0;
rotSpeed = 0;
physActive = false;
}
if (((_rotation < -84) && (_rotation > -94)) && (xSpeed <= 1)) {
_rotation = -90;
fallspeed = 0;
rotSpeed = 0;
physActive = false;
}
} else {
physRotate = true;
}
if (_y > (_root.platform._y - (objectHeight / 2))) {
_y = (_root.platform._y - (objectHeight / 2));
if (fallspeed > 40) {
die = true;
}
fallspeed = 0;
}
if (die == true) {
if (random(6) == 3) {
var healthName = ("heal" + _root.getNextHighestDepth());
duplicateMovieClip (_root.healthObj, healthName, _root.getNextHighestDepth());
_root[healthName]._x = _x;
_root[healthName]._y = _y;
}
var candyName = ("can" + _root.getNextHighestDepth());
duplicateMovieClip (_root.candy1, candyName, _root.getNextHighestDepth());
_root[candyName]._x = _x;
_root[candyName]._y = _y;
_root.magicPower = 0;
var flashName = ("f" + _root.getNextHighestDepth());
duplicateMovieClip (_root.whiteFlash, flashName, _root.getNextHighestDepth());
_root[flashName]._x = _x;
_root[flashName]._y = _y;
var i = 0;
while ((++i) < 3) {
var smokeName = ("s" + _root.getNextHighestDepth());
duplicateMovieClip (_root.smoke, smokeName, _root.getNextHighestDepth());
_root[smokeName]._x = _x;
_root[smokeName]._y = _y;
}
if (_root.currentEnemies < _root.maxEnemies) {
var i = 0;
var nrOfMinis = (3 + random(2));
while ((++i) < nrOfMinis) {
var devilName = ("d" + _root.getNextHighestDepth());
duplicateMovieClip (_root.smallDevil, devilName, _root.getNextHighestDepth());
_root[devilName]._x = _x;
_root[devilName]._y = _y;
_root[devilName].fallspeed = -3 - random(4);
_root[devilName].xSpeed = (_root[devilName].rotSpeed = -5 + random(10));
}
}
this.swapDepths(_root.getNextHighestDepth());
_root.score = _root.score + 7;
_root.currentEnemies--;
this.removeMovieClip();
}
if (_x < 0) {
_x = 0;
xSpeed = 0;
}
if (_x > 1100) {
_x = 1100;
xSpeed = 0;
}
if (_y < -800) {
fallspeed = fallspeed / 2;
_y = -800;
}
if ((physActive == false) && (_rotation != 0)) {
jumpTimer--;
if (jumpTimer <= 0) {
_y = (_y - 10);
fallspeed = -5 - random(10);
rotSpeed = -5 + random(10);
physActive = true;
jumpTimer = 20;
}
}
}
}
Instance of Symbol 399 MovieClip in Frame 10
onClipEvent (load) {
_alpha = ((targetAlpha = 0));
}
onClipEvent (enterFrame) {
if ((_root.tutDevil._x < ((-_root._x) + 600)) && (_root.tutDevil._x > (-_root._x))) {
targetAlpha = 100;
} else {
targetAlpha = 0;
}
_x = _root.tutDevil._x;
_y = _root.tutDevil._y;
if (_root.tutDevil.drag == true) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
}
if (_root.tutDevil._name == undefined) {
targetAlpha = -50;
}
_alpha = (_alpha + ((targetAlpha - _alpha) * 0.15));
if (_alpha <= -20) {
_root.gTim = true;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 402 MovieClip "topGround" in Frame 10
onClipEvent (enterFrame) {
this.gotoAndStop(_root.backG._currentframe);
}
Frame 11
onEnterFrame = function () {
};
for (cObject in _root) {
if (typeof(_root[cObject]) == "movieclip") {
_root[cObject].removeMovieClip();
}
}
_root.gotoAndStop(_root._currentframe + 1);
Frame 12
_x = 0;
_y = 0;
fade._x = 0;
fade._y = 0;
stop();
onEnterFrame = function () {
if (Key.isDown(32)) {
_root.fade.play();
}
};
Instance of Symbol 409 MovieClip in Frame 12
on (release) {
getURL ("http://www.armorgames.com", "_blank");
}
Instance of Symbol 210 MovieClip "fade" in Frame 12
onClipEvent (load) {
function action() {
_root.gotoAndStop(5);
}
}
Symbol 63 MovieClip Frame 231
stop();
_root.play();
Instance of Symbol 67 MovieClip in Symbol 73 MovieClip Frame 1
onClipEvent (enterFrame) {
_height = (5 + random(150));
_width = (2 + random(3));
_alpha = (50 + random(50));
_x = random(650);
_y = random(500);
}
Instance of Symbol 69 MovieClip in Symbol 73 MovieClip Frame 1
onClipEvent (load) {
_alpha = (50 + random(50));
_width = (1 + random(2));
_x = (5 + random(650));
xSpeed = 1 + random(3);
timer = 40 + random(50);
}
onClipEvent (enterFrame) {
_x = (_x - 3);
timer--;
if (timer <= 0) {
_alpha = (50 + random(50));
_width = (1 + random(2));
_x = (5 + random(650));
if (random(2) == 1) {
_visible = false;
} else {
_visible = true;
}
timer = 40 + random(50);
}
}
Instance of Symbol 69 MovieClip in Symbol 73 MovieClip Frame 1
onClipEvent (load) {
_alpha = (50 + random(50));
_width = (1 + random(2));
_x = (5 + random(650));
xSpeed = 1 + random(3);
timer = 40 + random(50);
}
onClipEvent (enterFrame) {
_x = (_x - 3);
timer--;
if (timer <= 0) {
_alpha = (50 + random(50));
_width = (1 + random(2));
_x = (5 + random(650));
if (random(2) == 1) {
_visible = false;
} else {
_visible = true;
}
timer = 40 + random(50);
}
}
Instance of Symbol 67 MovieClip in Symbol 73 MovieClip Frame 1
onClipEvent (enterFrame) {
_height = (5 + random(150));
_width = (2 + random(3));
_alpha = (50 + random(50));
_x = random(650);
_y = random(500);
}
Symbol 116 Button
on (release) {
_root.play();
}
Symbol 117 MovieClip Frame 143
_root.play();
stop();
Instance of Symbol 118 MovieClip in Symbol 122 MovieClip Frame 1
on (release) {
getURL ("http://www.deadtoast.com/", "_blank");
}
Instance of Symbol 118 MovieClip in Symbol 122 MovieClip Frame 1
on (release) {
getURL ("http://www.deadtoast.com/", "_blank");
}
Symbol 122 MovieClip Frame 150
stop();
_root.play();
Symbol 143 MovieClip Frame 15
action();
stop();
Instance of Symbol 207 MovieClip in Symbol 209 MovieClip Frame 1
onClipEvent (load) {
startX = _x;
}
onClipEvent (enterFrame) {
if (_root.story == false) {
_x = (_x + (((startX + 40) - _x) * 0.2));
} else {
_x = (_x + ((startX - _x) * 0.2));
}
}
on (release) {
_root.story = false;
_root.buttonHide = false;
}
Symbol 210 MovieClip Frame 1
stop();
Symbol 210 MovieClip Frame 16
action();
Instance of Symbol 219 MovieClip "whiteFlash" in Symbol 226 MovieClip Frame 1
onClipEvent (load) {
targetAlpha = -30;
}
onClipEvent (enterFrame) {
_alpha = (_alpha + ((targetAlpha - _alpha) * 0.1));
if (_alpha <= -10) {
targetAlpha = 100;
}
if (_alpha >= 70) {
targetAlpha = -30;
}
}
Instance of Symbol 224 MovieClip in Symbol 226 MovieClip Frame 1
onClipEvent (load) {
startY = _y;
_yscale = (20 + random(80));
_xscale = (20 + random(80));
_x = (-15 + random(30));
}
onClipEvent (enterFrame) {
_y = (_y - (_xscale / 100));
if (_y < -50) {
_yscale = (20 + random(80));
_xscale = (20 + random(80));
_y = startY;
_x = (-15 + random(30));
}
}
Instance of Symbol 224 MovieClip in Symbol 226 MovieClip Frame 1
onClipEvent (load) {
startY = _y;
_yscale = (20 + random(80));
_xscale = (20 + random(80));
_x = (-15 + random(30));
}
onClipEvent (enterFrame) {
_y = (_y - (_xscale / 100));
if (_y < -50) {
_yscale = (20 + random(80));
_xscale = (20 + random(80));
_y = startY;
_x = (-15 + random(30));
}
}
Instance of Symbol 224 MovieClip in Symbol 226 MovieClip Frame 1
onClipEvent (load) {
startY = _y;
_yscale = (20 + random(80));
_xscale = (20 + random(80));
_x = (-15 + random(30));
}
onClipEvent (enterFrame) {
_y = (_y - (_xscale / 100));
if (_y < -50) {
_yscale = (20 + random(80));
_xscale = (20 + random(80));
_y = startY;
_x = (-15 + random(30));
}
}
Instance of Symbol 224 MovieClip in Symbol 226 MovieClip Frame 1
onClipEvent (load) {
startY = _y;
_yscale = (20 + random(80));
_xscale = (20 + random(80));
_x = (-15 + random(30));
}
onClipEvent (enterFrame) {
_y = (_y - (_xscale / 100));
if (_y < -50) {
_yscale = (20 + random(80));
_xscale = (20 + random(80));
_y = startY;
_x = (-15 + random(30));
}
}
Instance of Symbol 224 MovieClip in Symbol 226 MovieClip Frame 1
onClipEvent (load) {
startY = _y;
_yscale = (20 + random(80));
_xscale = (20 + random(80));
_x = (-15 + random(30));
}
onClipEvent (enterFrame) {
_y = (_y - (_xscale / 100));
if (_y < -50) {
_yscale = (20 + random(80));
_xscale = (20 + random(80));
_y = startY;
_x = (-15 + random(30));
}
}
Instance of Symbol 224 MovieClip in Symbol 226 MovieClip Frame 1
onClipEvent (load) {
startY = _y;
_yscale = (20 + random(80));
_xscale = (20 + random(80));
_x = (-15 + random(30));
}
onClipEvent (enterFrame) {
_y = (_y - (_xscale / 100));
if (_y < -50) {
_yscale = (20 + random(80));
_xscale = (20 + random(80));
_y = startY;
_x = (-15 + random(30));
}
}
Symbol 240 MovieClip Frame 1
stop();
Instance of Symbol 219 MovieClip "whiteFlash" in Symbol 240 MovieClip Frame 1
onClipEvent (load) {
targetAlpha = -30;
_alpha = random(100);
}
onClipEvent (enterFrame) {
_alpha = (_alpha + ((targetAlpha - _alpha) * 0.1));
if (_alpha <= -10) {
targetAlpha = 100;
}
if (_alpha >= 70) {
targetAlpha = -30;
}
}
Instance of Symbol 219 MovieClip "whiteFlash" in Symbol 240 MovieClip Frame 1
onClipEvent (load) {
targetAlpha = -30;
_alpha = random(100);
}
onClipEvent (enterFrame) {
_alpha = (_alpha + ((targetAlpha - _alpha) * 0.1));
if (_alpha <= -10) {
targetAlpha = 100;
}
if (_alpha >= 70) {
targetAlpha = -30;
}
}
Instance of Symbol 219 MovieClip "whiteFlash" in Symbol 240 MovieClip Frame 1
onClipEvent (load) {
targetAlpha = -30;
_alpha = random(100);
}
onClipEvent (enterFrame) {
_alpha = (_alpha + ((targetAlpha - _alpha) * 0.1));
if (_alpha <= -10) {
targetAlpha = 100;
}
if (_alpha >= 70) {
targetAlpha = -30;
}
}
Instance of Symbol 219 MovieClip "whiteFlash" in Symbol 240 MovieClip Frame 1
onClipEvent (load) {
targetAlpha = -30;
_alpha = random(100);
}
onClipEvent (enterFrame) {
_alpha = (_alpha + ((targetAlpha - _alpha) * 0.1));
if (_alpha <= -10) {
targetAlpha = 100;
}
if (_alpha >= 70) {
targetAlpha = -30;
}
}
Instance of Symbol 219 MovieClip "whiteFlash" in Symbol 240 MovieClip Frame 1
onClipEvent (load) {
targetAlpha = -30;
_alpha = random(100);
}
onClipEvent (enterFrame) {
_alpha = (_alpha + ((targetAlpha - _alpha) * 0.1));
if (_alpha <= -10) {
targetAlpha = 100;
}
if (_alpha >= 70) {
targetAlpha = -30;
}
}
Symbol 240 MovieClip Frame 2
stop();
Instance of Symbol 249 MovieClip in Symbol 251 MovieClip Frame 1
onClipEvent (enterFrame) {
_yscale = _root.player.health;
}
Instance of Symbol 249 MovieClip in Symbol 251 MovieClip Frame 1
onClipEvent (enterFrame) {
_yscale = _root.player.health;
if (_yscale < 0) {
_yscale = 0;
}
}
Instance of Symbol 224 MovieClip in Symbol 251 MovieClip Frame 1
onClipEvent (load) {
startY = _y;
_yscale = (20 + random(80));
_xscale = (20 + random(80));
_x = (-15 + random(30));
}
onClipEvent (enterFrame) {
_y = (_y - (_xscale / 100));
if (_y < -50) {
_yscale = (20 + random(80));
_xscale = (20 + random(80));
_y = startY;
_x = (-15 + random(30));
}
}
Instance of Symbol 224 MovieClip in Symbol 251 MovieClip Frame 1
onClipEvent (load) {
startY = _y;
_yscale = (20 + random(80));
_xscale = (20 + random(80));
_x = (-15 + random(30));
}
onClipEvent (enterFrame) {
_y = (_y - (_xscale / 100));
if (_y < -50) {
_yscale = (20 + random(80));
_xscale = (20 + random(80));
_y = startY;
_x = (-15 + random(30));
}
}
Instance of Symbol 224 MovieClip in Symbol 251 MovieClip Frame 1
onClipEvent (load) {
startY = _y;
_yscale = (20 + random(80));
_xscale = (20 + random(80));
_x = (-15 + random(30));
}
onClipEvent (enterFrame) {
_y = (_y - (_xscale / 100));
if (_y < -50) {
_yscale = (20 + random(80));
_xscale = (20 + random(80));
_y = startY;
_x = (-15 + random(30));
}
}
Instance of Symbol 224 MovieClip in Symbol 251 MovieClip Frame 1
onClipEvent (load) {
startY = _y;
_yscale = (20 + random(80));
_xscale = (20 + random(80));
_x = (-15 + random(30));
}
onClipEvent (enterFrame) {
_y = (_y - (_xscale / 100));
if (_y < -50) {
_yscale = (20 + random(80));
_xscale = (20 + random(80));
_y = startY;
_x = (-15 + random(30));
}
}
Instance of Symbol 224 MovieClip in Symbol 251 MovieClip Frame 1
onClipEvent (load) {
startY = _y;
_yscale = (20 + random(80));
_xscale = (20 + random(80));
_x = (-15 + random(30));
}
onClipEvent (enterFrame) {
_y = (_y - (_xscale / 100));
if (_y < -50) {
_yscale = (20 + random(80));
_xscale = (20 + random(80));
_y = startY;
_x = (-15 + random(30));
}
}
Instance of Symbol 224 MovieClip in Symbol 251 MovieClip Frame 1
onClipEvent (load) {
startY = _y;
_yscale = (20 + random(80));
_xscale = (20 + random(80));
_x = (-15 + random(30));
}
onClipEvent (enterFrame) {
_y = (_y - (_xscale / 100));
if (_y < -50) {
_yscale = (20 + random(80));
_xscale = (20 + random(80));
_y = startY;
_x = (-15 + random(30));
}
}
Instance of Symbol 242 MovieClip in Symbol 265 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
onClipEvent (enterFrame) {
_visible = _root.paused;
}
Instance of Symbol 245 MovieClip in Symbol 265 MovieClip Frame 1
onClipEvent (load) {
lastLevel = _root.level;
_visible = false;
timer = 0;
}
onClipEvent (enterFrame) {
if (_root.level != lastLevel) {
_visible = true;
timer = 70;
lastLevel = _root.level;
}
if (timer == 0) {
_root.paused = false;
_visible = false;
timer--;
} else if (timer > 0) {
_root.paused = true;
timer--;
}
}
Instance of Symbol 67 MovieClip in Symbol 265 MovieClip Frame 1
onClipEvent (enterFrame) {
_height = (5 + random(150));
_width = (2 + random(3));
_alpha = (50 + random(50));
_x = random(650);
_y = random(500);
}
Instance of Symbol 69 MovieClip in Symbol 265 MovieClip Frame 1
onClipEvent (load) {
_alpha = (50 + random(50));
_width = (1 + random(2));
_x = (5 + random(650));
xSpeed = 1 + random(3);
timer = 40 + random(50);
}
onClipEvent (enterFrame) {
_x = (_x - 3);
timer--;
if (timer <= 0) {
_alpha = (50 + random(50));
_width = (1 + random(2));
_x = (5 + random(650));
if (random(2) == 1) {
_visible = false;
} else {
_visible = true;
}
timer = 40 + random(50);
}
}
Instance of Symbol 69 MovieClip in Symbol 265 MovieClip Frame 1
onClipEvent (load) {
_alpha = (50 + random(50));
_width = (1 + random(2));
_x = (5 + random(650));
xSpeed = 1 + random(3);
timer = 40 + random(50);
}
onClipEvent (enterFrame) {
_x = (_x - 3);
timer--;
if (timer <= 0) {
_alpha = (50 + random(50));
_width = (1 + random(2));
_x = (5 + random(650));
if (random(2) == 1) {
_visible = false;
} else {
_visible = true;
}
timer = 40 + random(50);
}
}
Instance of Symbol 67 MovieClip in Symbol 265 MovieClip Frame 1
onClipEvent (enterFrame) {
_height = (5 + random(150));
_width = (2 + random(3));
_alpha = (50 + random(50));
_x = random(650);
_y = random(500);
}
Instance of Symbol 263 MovieClip "musicVolScale" in Symbol 265 MovieClip Frame 1
onClipEvent (load) {
_xscale = _root.music.getVolume();
}
onClipEvent (enterFrame) {
if (_xscale > 100) {
_xscale = 100;
}
_root.music.setVolume(_xscale);
}
Instance of Symbol 263 MovieClip in Symbol 265 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
go = false;
}
onClipEvent (enterFrame) {
if (go == true) {
_parent.musicVolScale._width = _parent._xmouse - _x;
}
}
on (press) {
go = true;
}
on (release) {
go = false;
}
on (releaseOutside) {
go = false;
}
Symbol 275 MovieClip Frame 1
stop();
Symbol 275 MovieClip Frame 6
this.gotoAndStop(1 + random(5));
Symbol 288 MovieClip Frame 26
this.gotoAndPlay(8);
Symbol 289 MovieClip Frame 25
gotoAndPlay (5);
Symbol 290 MovieClip Frame 1
stop();
Instance of Symbol 307 MovieClip in Symbol 308 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
_alpha = (_alpha + ((_root.magicPower - _alpha) * 0.2));
}
Instance of Symbol 293 MovieClip "arm2" in Symbol 309 MovieClip Frame 1
onClipEvent (enterFrame) {
_rotation = _parent.arm1._rotation;
}
Instance of Symbol 298 MovieClip in Symbol 309 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_rotation < 70) {
_rotation = 70;
}
if (_rotation > 100) {
_rotation = 100;
}
_rotation = (_rotation + (_xmouse / 20));
}
Instance of Symbol 308 MovieClip "arm1" in Symbol 309 MovieClip Frame 1
onClipEvent (enterFrame) {
_rotation = (_rotation + (_xmouse / 15));
if (_rotation > 120) {
_rotation = 120;
}
}
Symbol 311 MovieClip Frame 32
_root.fade.play();
stop();
Symbol 312 MovieClip Frame 1
stop();
Instance of Symbol 309 MovieClip in Symbol 312 MovieClip Frame 1
/* no clip actions */
Symbol 324 MovieClip Frame 1
this.gotoAndStop(_parent._parent.bildruta);
stop();
Symbol 337 MovieClip Frame 1
this.gotoAndStop(_parent._parent.bildruta);
stop();
Symbol 339 MovieClip Frame 19
if (_root.paused == false) {
_root.player.health = _root.player.health - _parent.damage;
}
Symbol 340 MovieClip Frame 1
stop();
Symbol 346 MovieClip Frame 1
gotoAndStop(1 + random(5));
stop();
Instance of Symbol 219 MovieClip "whiteFlash" in Symbol 346 MovieClip Frame 1
onClipEvent (load) {
targetAlpha = -30;
}
onClipEvent (enterFrame) {
_alpha = (_alpha + ((targetAlpha - _alpha) * 0.1));
if (_alpha <= -10) {
targetAlpha = 100;
}
if (_alpha >= 70) {
targetAlpha = -30;
}
}
Symbol 354 MovieClip Frame 1
stop();
Instance of Symbol 364 MovieClip in Symbol 367 MovieClip Frame 1
onClipEvent (enterFrame) {
_visible = _parent._parent.arm2;
}
Instance of Symbol 351 MovieClip in Symbol 367 MovieClip Frame 1
onClipEvent (enterFrame) {
_visible = _parent._parent.arm2;
}
Instance of Symbol 353 MovieClip in Symbol 367 MovieClip Frame 1
onClipEvent (enterFrame) {
_visible = _parent._parent.arm2;
}
Instance of Symbol 366 MovieClip in Symbol 367 MovieClip Frame 1
onClipEvent (enterFrame) {
_parent._parent.bodyX = _x;
_parent._parent.bodyY = _y;
}
Instance of Symbol 356 MovieClip in Symbol 367 MovieClip Frame 1
onClipEvent (load) {
_visible = _parent._parent.head;
}
onClipEvent (enterFrame) {
_visible = _parent._parent.head;
}
Symbol 367 MovieClip Frame 50
this.gotoAndPlay(10);
Instance of Symbol 364 MovieClip in Symbol 368 MovieClip Frame 1
onClipEvent (enterFrame) {
_visible = _parent._parent.arm2;
}
Instance of Symbol 351 MovieClip in Symbol 368 MovieClip Frame 1
onClipEvent (enterFrame) {
_visible = _parent._parent.arm2;
}
Instance of Symbol 353 MovieClip in Symbol 368 MovieClip Frame 1
onClipEvent (enterFrame) {
_visible = _parent._parent.arm2;
}
Instance of Symbol 366 MovieClip in Symbol 368 MovieClip Frame 1
onClipEvent (enterFrame) {
_parent._parent.bodyX = _x;
_parent._parent.bodyY = _y;
}
Instance of Symbol 356 MovieClip in Symbol 368 MovieClip Frame 1
onClipEvent (load) {
_visible = _parent._parent.head;
}
onClipEvent (enterFrame) {
_visible = _parent._parent.head;
}
Symbol 368 MovieClip Frame 29
if (((_parent._x < (_root.player._x + 110)) && (_parent._x > (_root.player._x - 110))) && (_root.paused == false)) {
_root.player.health = _root.player.health - 7;
}
Instance of Symbol 364 MovieClip in Symbol 379 MovieClip Frame 1
onClipEvent (enterFrame) {
_visible = _parent._parent.arm2;
}
Instance of Symbol 351 MovieClip in Symbol 379 MovieClip Frame 1
onClipEvent (enterFrame) {
_visible = _parent._parent.arm2;
}
Instance of Symbol 353 MovieClip in Symbol 379 MovieClip Frame 1
onClipEvent (enterFrame) {
_visible = _parent._parent.arm2;
}
Instance of Symbol 366 MovieClip in Symbol 379 MovieClip Frame 1
onClipEvent (enterFrame) {
_parent._parent.bodyX = _x;
_parent._parent.bodyY = _y;
}
Instance of Symbol 356 MovieClip in Symbol 379 MovieClip Frame 1
onClipEvent (load) {
_visible = _parent.head;
}
onClipEvent (enterFrame) {
_visible = _parent.head;
}
Symbol 379 MovieClip Frame 73
stop();
_parent.started = true;
Symbol 380 MovieClip Frame 1
stop();
Instance of Symbol 364 MovieClip in Symbol 380 MovieClip Frame 1
onClipEvent (enterFrame) {
_visible = _parent._parent.arm2;
}
Instance of Symbol 351 MovieClip in Symbol 380 MovieClip Frame 1
onClipEvent (enterFrame) {
_visible = _parent._parent.arm2;
}
Instance of Symbol 353 MovieClip in Symbol 380 MovieClip Frame 1
onClipEvent (enterFrame) {
_visible = _parent._parent.arm2;
}
Instance of Symbol 366 MovieClip in Symbol 380 MovieClip Frame 1
onClipEvent (enterFrame) {
_parent._parent.bodyX = _x;
_parent._parent.bodyY = _y;
}
Instance of Symbol 356 MovieClip in Symbol 380 MovieClip Frame 1
onClipEvent (load) {
_visible = _parent.head;
}
onClipEvent (enterFrame) {
_visible = _parent.head;
}
Symbol 391 MovieClip Frame 21
this.gotoAndPlay(3);
Symbol 392 MovieClip Frame 13
_parent.yPos = 235;
Symbol 392 MovieClip Frame 32
if (_root.paused == false) {
_root.player.health = _root.player.health - 6;
}
Symbol 392 MovieClip Frame 48
_parent.timer = 70;
_parent.attack = false;
Symbol 393 MovieClip Frame 9
stop();
Symbol 394 MovieClip Frame 1
stop();
Symbol 399 MovieClip Frame 1
stop();
Symbol 402 MovieClip Frame 1
stop();
Instance of Symbol 67 MovieClip in Symbol 411 MovieClip Frame 1
onClipEvent (enterFrame) {
_height = (5 + random(150));
_width = (2 + random(3));
_alpha = (50 + random(50));
_x = random(650);
_y = random(500);
}
Instance of Symbol 69 MovieClip in Symbol 411 MovieClip Frame 1
onClipEvent (load) {
_alpha = (50 + random(50));
_width = (1 + random(2));
_x = (5 + random(650));
xSpeed = 1 + random(3);
timer = 40 + random(50);
}
onClipEvent (enterFrame) {
_x = (_x - 3);
timer--;
if (timer <= 0) {
_alpha = (50 + random(50));
_width = (1 + random(2));
_x = (5 + random(650));
if (random(2) == 1) {
_visible = false;
} else {
_visible = true;
}
timer = 40 + random(50);
}
}
Instance of Symbol 69 MovieClip in Symbol 411 MovieClip Frame 1
onClipEvent (load) {
_alpha = (50 + random(50));
_width = (1 + random(2));
_x = (5 + random(650));
xSpeed = 1 + random(3);
timer = 40 + random(50);
}
onClipEvent (enterFrame) {
_x = (_x - 3);
timer--;
if (timer <= 0) {
_alpha = (50 + random(50));
_width = (1 + random(2));
_x = (5 + random(650));
if (random(2) == 1) {
_visible = false;
} else {
_visible = true;
}
timer = 40 + random(50);
}
}
Instance of Symbol 67 MovieClip in Symbol 411 MovieClip Frame 1
onClipEvent (enterFrame) {
_height = (5 + random(150));
_width = (2 + random(3));
_alpha = (50 + random(50));
_x = random(650);
_y = random(500);
}