Frame 1
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);
Frame 2
if (_root.percentLoaded == 100) {
gotoAndPlay (3);
} else {
gotoAndPlay (1);
}
Frame 3
stop();
Frame 4
function itemHandler1(obj, item) {
getURL ("http://www.armorgames.com/", "_blank");
}
function itemHandler4(obj, item) {
_quality = "high";
}
function itemHandler5(obj, item) {
_quality = "medium";
}
function itemHandler6(obj, item) {
_quality = "low";
}
stopAllSounds();
Mouse.hide();
root_cm = new ContextMenu();
root_cm.hideBuiltInItems();
aaa_cmi = new ContextMenuItem("Play More Games", itemHandler1);
eee_cmi = new ContextMenuItem("High Quality", itemHandler4);
fff_cmi = new ContextMenuItem("Mid Quality", itemHandler5);
ggg_cmi = new ContextMenuItem("Low Quality", itemHandler6);
bbb_cmi.separatorBefore = true;
eee_cmi.separatorBefore = true;
root_cm.customItems.push(aaa_cmi, bbb_cmi, ccc_cmi, eee_cmi, fff_cmi, ggg_cmi);
_root.menu = root_cm;
_global.playgame = false;
_root.cursor_hit = false;
Instance of Symbol 155 MovieClip "menuu" in Frame 4
onClipEvent (enterFrame) {
if (Key.isDown(39)) {
if (!_global.menu_end) {
this.play();
}
}
if (Key.isDown(37)) {
_global.menu_move = true;
}
if (_global.menu_move) {
this.gotoAndStop(this._currentframe - 1);
}
}
Instance of Symbol 210 MovieClip in Frame 4
on (release) {
getURL ("http://www.newgrounds.com/collection/christmas2007", "_blank");
}
Instance of Symbol 213 MovieClip in Frame 4
on (release) {
getURL ("http://www.armorgames.com/", "_blank");
}
Instance of Symbol 222 MovieClip "cursor" in Frame 4
onClipEvent (enterFrame) {
i = 0;
while (i < 12) {
if (_root["present" + i].hitTest(_x, _y, true)) {
_root.cursor_hit = true;
} else {
_root.cursor_hit = false;
}
i++;
}
_x = _root._xmouse;
_y = _root._ymouse;
updateAfterEvent();
}
Frame 63
stop();
Instance of Symbol 318 MovieClip "present3" in Frame 63
onClipEvent (load) {
this.stop();
clicked = false;
}
onClipEvent (enterFrame) {
if (this._currentframe == 50) {
stopAllSounds();
Mouse.show();
_global.playgame = true;
_root.gotoAndStop("game3");
}
if (!clicked) {
if (this.hitTest(_root.cursor._x, _root.cursor._y, true) && (!_root.cursor_hit)) {
thiscursor = true;
_root.cursor_hit = true;
if (this._currentframe == 30) {
this.stop();
} else {
this.play();
}
} else if (thiscursor) {
thiscursor = false;
_root.cursor_hit = false;
this.gotoAndStop(1);
} else {
this.gotoAndStop(1);
}
}
}
on (release) {
clicked = true;
this.gotoAndPlay(31);
}
Instance of Symbol 330 MovieClip "present9" in Frame 63
onClipEvent (load) {
this.stop();
clicked = false;
}
onClipEvent (enterFrame) {
if (this._currentframe == 50) {
stopAllSounds();
Mouse.show();
_global.playgame = true;
_root.gotoAndStop("game8");
}
if (!clicked) {
if (this.hitTest(_root.cursor._x, _root.cursor._y, true) && (!_root.cursor_hit)) {
thiscursor = true;
_root.cursor_hit = true;
if (this._currentframe == 30) {
this.stop();
} else {
this.play();
}
} else if (thiscursor) {
thiscursor = false;
_root.cursor_hit = false;
this.gotoAndStop(1);
} else {
this.gotoAndStop(1);
}
}
}
on (release) {
clicked = true;
this.gotoAndPlay(31);
}
Instance of Symbol 243 MovieClip "present5" in Frame 63
onClipEvent (load) {
this.stop();
clicked = false;
}
onClipEvent (enterFrame) {
if (this._currentframe == 50) {
stopAllSounds();
Mouse.show();
_global.playgame = true;
_root.gotoAndStop("game6");
}
if (!clicked) {
if (this.hitTest(_root.cursor._x, _root.cursor._y, true) && (!_root.cursor_hit)) {
thiscursor = true;
_root.cursor_hit = true;
if (this._currentframe == 30) {
this.stop();
} else {
this.play();
}
} else if (thiscursor) {
thiscursor = false;
_root.cursor_hit = false;
this.gotoAndStop(1);
} else {
this.gotoAndStop(1);
}
}
}
on (release) {
clicked = true;
this.gotoAndPlay(31);
}
Instance of Symbol 302 MovieClip "present6" in Frame 63
onClipEvent (load) {
this.stop();
clicked = false;
}
onClipEvent (enterFrame) {
if (this._currentframe == 50) {
stopAllSounds();
Mouse.show();
_global.playgame = true;
_root.gotoAndStop("game7");
}
if (!clicked) {
if (this.hitTest(_root.cursor._x, _root.cursor._y, true) && (!_root.cursor_hit)) {
thiscursor = true;
_root.cursor_hit = true;
if (this._currentframe == 30) {
this.stop();
} else {
this.play();
}
} else if (thiscursor) {
thiscursor = false;
_root.cursor_hit = false;
this.gotoAndStop(1);
} else {
this.gotoAndStop(1);
}
}
}
on (release) {
clicked = true;
this.gotoAndPlay(31);
}
Instance of Symbol 292 MovieClip "present10" in Frame 63
onClipEvent (load) {
this.stop();
clicked = false;
}
onClipEvent (enterFrame) {
if (this._currentframe == 50) {
stopAllSounds();
Mouse.show();
_global.playgame = true;
_root.gotoAndStop("game10");
}
if (!clicked) {
if (this.hitTest(_root.cursor._x, _root.cursor._y, true) && (!_root.cursor_hit)) {
thiscursor = true;
_root.cursor_hit = true;
if (this._currentframe == 30) {
this.stop();
} else {
this.play();
}
} else if (thiscursor) {
thiscursor = false;
_root.cursor_hit = false;
this.gotoAndStop(1);
} else {
this.gotoAndStop(1);
}
}
}
on (release) {
clicked = true;
this.gotoAndPlay(31);
}
Instance of Symbol 264 MovieClip "present1" in Frame 63
onClipEvent (load) {
this.stop();
clicked = false;
}
onClipEvent (enterFrame) {
if (this._currentframe == 50) {
stopAllSounds();
Mouse.show();
_global.playgame = true;
_root.gotoAndStop("game9");
}
if (!clicked) {
if (this.hitTest(_root.cursor._x, _root.cursor._y, true) && (!_root.cursor_hit)) {
thiscursor = true;
_root.cursor_hit = true;
if (this._currentframe == 30) {
this.stop();
} else {
this.play();
}
} else if (thiscursor) {
thiscursor = false;
_root.cursor_hit = false;
this.gotoAndStop(1);
} else {
this.gotoAndStop(1);
}
}
}
on (release) {
clicked = true;
this.gotoAndPlay(31);
}
Instance of Symbol 253 MovieClip "present2" in Frame 63
onClipEvent (load) {
this.stop();
clicked = false;
}
onClipEvent (enterFrame) {
if (this._currentframe == 50) {
stopAllSounds();
Mouse.show();
_global.playgame = true;
_root.gotoAndStop("game4");
}
if (!clicked) {
if (this.hitTest(_root.cursor._x, _root.cursor._y, true) && (!_root.cursor_hit)) {
thiscursor = true;
_root.cursor_hit = true;
if (this._currentframe == 30) {
this.stop();
} else {
this.play();
}
} else if (thiscursor) {
thiscursor = false;
_root.cursor_hit = false;
this.gotoAndStop(1);
} else {
this.gotoAndStop(1);
}
}
}
on (release) {
clicked = true;
this.gotoAndPlay(31);
}
Instance of Symbol 282 MovieClip "present4" in Frame 63
onClipEvent (load) {
this.stop();
clicked = false;
}
onClipEvent (enterFrame) {
if (this._currentframe == 50) {
stopAllSounds();
Mouse.show();
_global.playgame = true;
_root.gotoAndStop("game5");
}
if (!clicked) {
if (this.hitTest(_root.cursor._x, _root.cursor._y, true) && (!_root.cursor_hit)) {
thiscursor = true;
_root.cursor_hit = true;
if (this._currentframe == 30) {
this.stop();
} else {
this.play();
}
} else if (thiscursor) {
thiscursor = false;
_root.cursor_hit = false;
this.gotoAndStop(1);
} else {
this.gotoAndStop(1);
}
}
}
on (release) {
clicked = true;
this.gotoAndPlay(31);
}
Instance of Symbol 347 MovieClip "present8" in Frame 63
onClipEvent (load) {
this.stop();
clicked = false;
}
onClipEvent (enterFrame) {
if (this._currentframe == 50) {
stopAllSounds();
Mouse.show();
_global.playgame = true;
_root.gotoAndStop("game2");
}
if (!clicked) {
if (this.hitTest(_root.cursor._x, _root.cursor._y, true) && (!_root.cursor_hit)) {
thiscursor = true;
_root.cursor_hit = true;
if (this._currentframe == 30) {
this.stop();
} else {
this.play();
}
} else if (thiscursor) {
thiscursor = false;
_root.cursor_hit = false;
this.gotoAndStop(1);
} else {
this.gotoAndStop(1);
}
}
}
on (release) {
clicked = true;
this.gotoAndPlay(31);
}
Instance of Symbol 356 MovieClip "present7" in Frame 63
onClipEvent (load) {
this.stop();
clicked = false;
}
onClipEvent (enterFrame) {
if (this._currentframe == 50) {
stopAllSounds();
Mouse.show();
_global.playgame = true;
_root.gotoAndStop("game1");
}
if (!clicked) {
if (this.hitTest(_root.cursor._x, _root.cursor._y, true) && (!_root.cursor_hit)) {
thiscursor = true;
_root.cursor_hit = true;
if (this._currentframe == 30) {
this.stop();
} else {
this.play();
}
} else if (thiscursor) {
thiscursor = false;
_root.cursor_hit = false;
this.gotoAndStop(1);
} else {
this.gotoAndStop(1);
}
}
}
on (release) {
clicked = true;
this.gotoAndPlay(31);
}
Frame 64
stop();
Mouse.show();
Frame 65
stop();
Instance of Symbol 396 MovieClip in Frame 65
onClipEvent (load) {
function Sbouncer() {
return(_root.ground.Sbouncer.hitTest(_x, _y + 5, true));
}
function bouncer() {
return(_root.ground.bouncer1.hitTest(_x, _y + 5, true));
}
function bouncer2() {
return(_root.ground.bouncer2.hitTest(_x, _y + 5, true));
}
function bouncer3() {
return(_root.ground.bouncer3.hitTest(_x, _y + 5, true));
}
function bouncer4() {
return(_root.ground.bouncer4.hitTest(_x, _y + 5, true));
}
dead = false;
BOUNCE = false;
moveit = false;
SBOUNCE = false;
xspeed = 0;
grav = 0;
speed = 7;
jumpHeight = 12;
bounceHeight = 20;
SbounceHeight = 35;
scale = _xscale;
slowfall = 0.5;
}
onClipEvent (enterFrame) {
if (SBOUNCE) {
_root.ground._x = _root.ground._x - 15;
_root.bg._x = _root.bg._x - 1.5;
_y = (_y - 5);
this.gotoAndStop(3);
if (_root.endoflvl1.hitTest(this)) {
_root.play();
}
} else {
_root.ground._x = _root.ground._x - xspeed;
_root.bg._x = _root.bg._x - (xspeed / 10);
if (moveit) {
_xspeed++;
} else {
xspeed = 0;
}
grav++;
_y = (_y + grav);
while (_root.ground.hitTest(_x, _y, true)) {
_y = (_y-1);
grav = 0;
}
if (_root.ground.spikes.hitTest(this) || (_root.DEATH.hitTest(this))) {
dead = true;
}
if (dead) {
this.gotoAndStop(5);
if (this.death._currentframe == 50) {
dead = false;
xspeed = 0;
grav = 0;
speed = 7;
this.gotoAndStop(1);
_xscale = scale;
_root.ground._x = 0;
_root.bg._x = 0;
this._y = 300;
}
} else if (Key.isDown(39)) {
xspeed = xspeed + speed;
_xscale = scale;
if (_root.ground.hitTest(_x, _y + 3, true)) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(4);
}
} else if (Key.isDown(37)) {
xspeed = xspeed - speed;
_xscale = (-scale);
if (_root.ground.hitTest(_x, _y + 3, true)) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(4);
}
} else if (_root.ground.hitTest(_x, _y + 3, true) && (!Key.isDown(79))) {
this.gotoAndStop(1);
}
if (BOUNCE && (_root.ground.hitTest(_x, _y + 3, true))) {
grav = -bounceHeight;
_y = (_y - 4);
this.gotoAndStop(3);
}
if (((((bouncer() || (bouncer2())) || (bouncer3())) || (bouncer4())) || (Sbouncer())) || (dead)) {
} else if (Key.isDown(38) && (_root.ground.hitTest(_x, _y + 3, true))) {
grav = -jumpHeight;
_y = (_y - 4);
this.gotoAndStop(3);
}
if (_root.ground.hitTest(_x + (_width / 2), _y - (_height / 2), true) || (_root.ground.hitTest(_x + (_width / 2), _y - ((_height / 6) * 4), true))) {
xspeed = xspeed - speed;
}
if (_root.ground.hitTest(_x - (_width / 2), _y - (_height / 2), true) || (_root.ground.hitTest(_x - (_width / 2), _y - ((_height / 6) * 4), true))) {
xspeed = xspeed + speed;
}
if (_root.ground.hitTest(_x, _y - _height, true)) {
grav = 2;
}
if (((bouncer() || (bouncer2())) || (bouncer3())) || (bouncer4())) {
BOUNCE = true;
} else {
BOUNCE = false;
}
if (Sbouncer()) {
SBOUNCE = true;
} else {
SBOUNCE = false;
}
}
}
Frame 151
stop();
Instance of Symbol 396 MovieClip in Frame 151
onClipEvent (load) {
function Sbouncer() {
return(_root.ground.Sbouncer.hitTest(_x, _y + 5, true));
}
function bouncer() {
return(_root.ground.bouncer1.hitTest(_x, _y + 5, true));
}
function bouncer2() {
return(_root.ground.bouncer2.hitTest(_x, _y + 5, true));
}
function bouncer3() {
return(_root.ground.bouncer3.hitTest(_x, _y + 5, true));
}
function endoflvl2() {
return(_root.ground.endoflvl2.hitTest(this));
}
dead = false;
_root.stop();
BOUNCE = false;
moveit = false;
SBOUNCE = false;
xspeed = 0;
grav = 0;
speed = 7;
jumpHeight = 12;
bounceHeight = 20;
SbounceHeight = 35;
scale = _xscale;
slowfall = 0.5;
}
onClipEvent (enterFrame) {
if (SBOUNCE) {
_root.ground._x = _root.ground._x - 15;
_root.bg._x = _root.bg._x - 1.5;
_y = (_y - 5);
this.gotoAndStop(3);
if (_root.endoflvl1.hitTest(this)) {
_root.play();
}
} else {
if (endoflvl2()) {
_root.play();
}
if (_root.ground._y < 800) {
_root.ground._y = _root.ground._y + 0.8;
}
_x = (_x + (xspeed / 1.5));
_root.bg._x = _root.bg._x - (xspeed / 10);
if (moveit) {
_xspeed++;
} else {
xspeed = 0;
}
grav++;
_y = (_y + grav);
while (_root.ground.hitTest(_x, _y, true)) {
_y = (_y-1);
grav = 0;
}
if (_root.ground.spikes.hitTest(this) || (_root.DEATH.hitTest(this))) {
dead = true;
}
if (dead) {
this.gotoAndStop(5);
if (this.death._currentframe == 50) {
dead = false;
xspeed = 0;
grav = 0;
speed = 7;
this.gotoAndStop(1);
_xscale = scale;
_root.ground._y = 216;
this._y = 205;
this._x = 120;
}
} else if (Key.isDown(39)) {
xspeed = xspeed + speed;
_xscale = scale;
if (_root.ground.hitTest(_x, _y + 3, true)) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(4);
}
} else if (Key.isDown(37)) {
xspeed = xspeed - speed;
_xscale = (-scale);
if (_root.ground.hitTest(_x, _y + 3, true)) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(4);
}
} else if (_root.ground.hitTest(_x, _y + 3, true) && (!Key.isDown(79))) {
this.gotoAndStop(1);
}
if (BOUNCE && (_root.ground.hitTest(_x, _y + 3, true))) {
grav = -bounceHeight;
_y = (_y - 4);
this.gotoAndStop(3);
}
if ((((bouncer() || (bouncer2())) || (bouncer3())) || (bouncer4())) || (Sbouncer())) {
} else if (Key.isDown(38) && (_root.ground.hitTest(_x, _y + 3, true))) {
grav = -jumpHeight;
_y = (_y - 4);
this.gotoAndStop(3);
}
if (_root.ground.hitTest(_x + (_width / 2), _y - (_height / 2), true) || (_root.ground.hitTest(_x + (_width / 2), _y - ((_height / 6) * 4), true))) {
xspeed = xspeed - speed;
}
if (_root.ground.hitTest(_x - (_width / 2), _y - (_height / 2), true) || (_root.ground.hitTest(_x - (_width / 2), _y - ((_height / 6) * 4), true))) {
xspeed = xspeed + speed;
}
if (_root.ground.hitTest(_x, _y - _height, true)) {
grav = 2;
}
if (((bouncer() || (bouncer2())) || (bouncer3())) || (bouncer4())) {
BOUNCE = true;
} else {
BOUNCE = false;
}
if (Sbouncer()) {
SBOUNCE = true;
} else {
SBOUNCE = false;
}
}
}
Frame 194
stopAllSounds();
_root.gotoAndStop("game1");
Frame 195
stop();
Mouse.show();
Frame 196
stop();
healthvar = false;
health3 = false;
var health = 3;
score = 0;
level = 1;
_global.dead = false;
onEnterFrame = function () {
if (score == level) {
score = 0;
level++;
i = 0;
while (i < level) {
duplicateMovieClip ("enemy", "enemy_" + i, i);
i++;
}
a = 100;
while (a < (level + 98)) {
duplicateMovieClip ("enemy2", "enemy2_" + a, _root.getNextHighestDepth());
a++;
}
}
if ((_root.health < 3) && (!health3)) {
health3 = true;
_root.health1.play();
}
if ((_root.health < 2) && (!healthvar)) {
healthvar = true;
_root.health2.play();
}
if ((_root.health < 1) && (_global.dead == false)) {
stopAllSounds();
_root.prevFrame();
_global.dead = true;
}
};
Instance of Symbol 419 MovieClip "gun" in Frame 196
onClipEvent (load) {
Mouse.hide();
speed = 5;
}
onClipEvent (enterFrame) {
Xd = _root._xmouse - this._x;
Yd = _root._ymouse - this._y;
radAngle = Math.atan2(Yd, Xd);
this._rotation = int(((radAngle * 360) / (Math.PI*2)) + 90);
updateAfterEvent();
endX = _root._xmouse;
endY = _root._ymouse;
_x = (_x + ((endX - _x) / speed));
_y = (_y + ((endY - _y) / speed));
}
Instance of Symbol 421 MovieClip "enemy" in Frame 196
onClipEvent (load) {
function getPoints() {
(getX = random(550));
(getY = random(400));
(gotoX = (getX - _x) / speed);
(gotoY = (getY - _y) / speed);
clearInterval(id);
id = setInterval(getPoints, random(2000) + 500);
}
_x = random(550);
_y = random(400);
no_move = false;
speed = 60;
id = setInterval(getPoints, 1);
(getX = random(550));
(getY = random(400));
}
onClipEvent (enterFrame) {
if (_global.dead == true) {
this.removeMovieClip();
} else if (_root.gun.hitTest(this)) {
_root.score++;
this._x = -200;
no_move = true;
} else if (!no_move) {
_x = (_x + gotoX);
_x + gotoX;
_y = (_y + gotoY);
_y + gotoY;
_rotation = (_rotation + gotoX);
}
}
Instance of Symbol 429 MovieClip "enemy2" in Frame 196
onClipEvent (load) {
function getPoints() {
(getX = random(550));
(getY = random(400));
(gotoX = (getX - _x) / speed);
(gotoY = (getY - _y) / speed);
clearInterval(id);
id = setInterval(getPoints, random(2000) + 500);
}
_x = random(550);
_y = random(400);
no_move = false;
speed = 60;
id = setInterval(getPoints, 1);
(getX = random(550));
(getY = random(400));
}
onClipEvent (enterFrame) {
if (_global.dead == true) {
this.removeMovieClip();
} else if (_name == "enemy2") {
_x = -1000;
} else {
if (_root.gun.hitTest(this)) {
_root.health--;
this.removeMovieClip();
}
_x = (_x + gotoX);
_x + gotoX;
_y = (_y + gotoY);
_y + gotoY;
_rotation = (_rotation + gotoX);
}
}
Frame 197
stop();
var correctFrame = _root._currentframe;
var i = 2;
var lineColour = 1;
var score = 0;
var life = 100;
var level = 1;
var instructionsOn = false;
var gameStarted = false;
var gamePause = true;
var scoreToNextLv = 10;
var userName = "InsertName";
createEmptyMovieClip("terrain", 1);
terrain.lineStyle(10, 16711935, 0);
imdrawing = false;
Instance of Symbol 446 MovieClip "reindeer" in Frame 197
onClipEvent (enterFrame) {
if (_root.gamePause == false) {
while (_root.terrain.hitTest(_x, _y - (_height / 2), true)) {
_y = (_y+1);
}
while (_root.terrain.hitTest(_x, _y + (_height / 2), true)) {
_y = (_y-1);
}
while (_y < 150) {
_y = (_y+1);
}
while (_y > 330) {
_y = (_y-1);
}
if (Key.isDown(38)) {
_y = (_y - (4 + _root.level));
}
if (Key.isDown(40)) {
_y = (_y + (4 + _root.level));
}
}
adjside = (_root.rope._x + 0) - _root.reindeer._x;
oppside = (_root.rope._y + 0) - _root.reindeer._y;
angle = Math.atan2(-oppside, adjside);
angle = Math.round((angle / Math.PI) * 180);
_root.rope._rotation = -angle;
}
Instance of Symbol 451 MovieClip "santa" in Frame 197
onClipEvent (load) {
var randomSpawnPresent;
var randomSpawnObstacle;
var obstacleDifficulty = 300;
var presentDifficulty = 100;
}
onClipEvent (enterFrame) {
if (_root.gamePause == false) {
this._y = _root.reindeer._y;
_root.rope._x = _x + 20;
_root.rope._y = _y + 10;
randomSpawnPresent = Math.round(Math.random() * presentDifficulty);
if (randomSpawnPresent == 1) {
duplicateMovieClip (_root.present, "newPresent" + _root.i, _root.i + 500);
_root["newPresent" + _root.i]._x = 600;
_root["newPresent" + _root.i]._y = random(150) + 150;
_root.i++;
}
randomSpawnObstacle = Math.round(Math.random() * obstacleDifficulty);
if (randomSpawnObstacle == 1) {
duplicateMovieClip (_root.obstacle, "newObstacle" + _root.i, _root.i + 250);
_root["newObstacle" + _root.i]._x = 600;
_root["newObstacle" + _root.i]._y = random(150) + 150;
_root.i++;
}
}
}
Instance of Symbol 454 MovieClip "rope" in Frame 197
onClipEvent (enterFrame) {
adjside = (_root.rope._x + 0) - _root.reindeer._x;
oppside = (_root.rope._y + 0) - _root.reindeer._y;
angle = Math.atan2(-oppside, adjside);
angle = Math.round((angle / Math.PI) * 180);
_root.rope._rotation = -angle;
}
Instance of Symbol 460 MovieClip "present" in Frame 197
onClipEvent (load) {
var goldPresent = false;
if (Math.round(Math.random() * 20) == 1) {
gotoAndStop (198);
goldPresent = true;
}
}
onClipEvent (enterFrame) {
if (_root.gamePause == false) {
if (!_root.terrain.hitTest(_x - (_width / 2), _y, true)) {
_x = (_x - (2 + _root.level));
}
if (goldPresent == true) {
_x = (_x - (_root.level / 2));
}
if (this.hitTest(_root.santa)) {
_root.score++;
if (goldPresent == true) {
_root.score = _root.score + 9;
}
}
if ((_x < 0) || (this.hitTest(_root.santa))) {
if (this._name == "present") {
this._x = -100;
} else {
removeMovieClip(this);
}
}
}
if (_root._currentFrame != _root.correctFrame) {
removeMovieClip(this);
}
if ((_root.gameScreens._currentframe == 4) && (this._name != "present")) {
removeMovieClip(this);
}
}
Instance of Symbol 473 MovieClip "obstacle" in Frame 197
onClipEvent (load) {
var bombPresent = false;
if (Math.round(Math.random() * 10) == 1) {
gotoAndStop (198);
bombPresent = true;
}
var randomSpawn = ((Math.random() * 4) + 1);
}
onClipEvent (enterFrame) {
if (_root.gamePause == false) {
if (!_root.terrain.hitTest(_x - (_width / 2), _y, true)) {
_x = (_x - (3 + _root.level));
}
if (this.hitTest(_root.santa)) {
j = 1;
while (j <= randomSpawn) {
_root.i++;
duplicateMovieClip (_root.flame, "newSmoke" + _root.i, _root.i);
_root["newSmoke" + _root.i]._x = _x - 70;
_root["newSmoke" + _root.i]._y = _y;
j++;
}
_root.life = _root.life - 10;
if (bombPresent == false) {
_root.life = _root.life - 10;
} else {
_root.score = _root.score - 3;
}
}
if ((_x < 0) || (this.hitTest(_root.santa))) {
if (this._name == "obstacle") {
this._x = -100;
} else {
removeMovieClip(this);
}
}
}
if (_root._currentFrame != _root.correctFrame) {
removeMovieClip(this);
}
if ((_root.gameScreens._currentframe == 4) && (this._name != "obstacle")) {
removeMovieClip(this);
}
}
Instance of Symbol 479 MovieClip in Frame 197
onClipEvent (enterFrame) {
_xscale = _root.life;
}
Instance of Symbol 489 MovieClip "flame" in Frame 197
onClipEvent (load) {
_root.i++;
this.swapDepths(_root.i + 9999);
var xvel = ((Math.random() * 10) - (Math.random() * 10));
var yvel = ((Math.random() * -13) - 5);
var spin = ((Math.random() * 30) - (Math.random() * 30));
gotoAndStop(Math.round(Math.random() * 3) + 1 +196);
}
onClipEvent (enterFrame) {
if (_y < 500) {
_x = (_x + xvel);
_y = (_y + yvel);
yvel++;
_rotation = (_rotation + spin);
_root.i++;
duplicateMovieClip (_root.smoke, "newSmoke" + _root.i, _root.i);
_root["newSmoke" + _root.i]._x = _x - 10;
_root["newSmoke" + _root.i]._y = _y;
} else if (_name != "flame") {
removeMovieClip(this);
}
}
Instance of Symbol 534 MovieClip "gameScreens" in Frame 197
onClipEvent (enterFrame) {
if (_root.score >= _root.scoreToNextLv) {
_root.gamePause = true;
}
if ((_root.gamePause == true) && (_root.gameStarted == true)) {
this.gotoAndStop(2);
}
if (_root.life <= 0) {
this.gotoAndStop(4);
}
}
Frame 198
stop();
nott = 0;
Mouse.show();
Frame 199
stop();
nott = 1;
onMouseMove = function () {
if (nott == 1) {
Mouse.hide();
}
};
i = 0;
onEnterFrame = function () {
if (nott == 1) {
seconds++;
i++;
if (random(8) == 0) {
_root.attachMovie("circlez", "circlez1" + i, i);
}
}
};
seconds = 0;
plus_p = 0;
Instance of Symbol 572 MovieClip "pf" in Frame 199
onClipEvent (enterFrame) {
this._x = _root._xmouse;
this._y = _root._ymouse;
}
Frame 200
function __rankz_send__(par1, par2, par3, par4) {
par227 = new LoadVars();
par228 = new LoadVars();
par227.flashkey = par2;
par227.SU0249 = par1;
par227.bmFtZTE = Armor_Bot_30_En_AS1.Encode(par3);
par227.c2NvcmUx = Armor_Bot_30_En_AS1.Encode(par4 + "j%e%a%n%s");
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/", par228, "POST");
}
stop();
nott = 0;
Mouse.show();
onEnterFrame = function () {
bXlnYW1lX25hbWVfdmFyaWFibGU = my_name1_variable;
bXlnYW1lX3Njb3JlX3ZhcmlhYmxl = plus_p;
};
Frame 201
stop();
conteoPerder = 0;
started = 0;
if (started == 0) {
var theme = new Sound();
theme.attachSound("The Beat 02");
theme.start();
}
function playfps() {
clearInterval(_root.mysetinterval);
_root.mysetinterval = setInterval(playAndLoop, 10000000000, this);
}
stop();
Instance of Symbol 586 MovieClip in Frame 201
on (press) {
this._parent.gotoAndStop(2);
}
Frame 202
function started() {
if (startMap == 0) {
cloudsMovie.attachMovie("cloud1", "cloud1MC", cloudsMovie.getNextHighestDepth(), {_x:0, _y:0});
cloudCount1 = 1;
startMap = 1;
}
}
function setSpeed() {
speedCounter = speedCounter + 1;
if (speedCounter == 8000) {
cloudsMoveAmount = cloudsMoveAmount + 1;
speedCounter = 0;
}
cloudsMovie._x = cloudsMovie._x - cloudsMoveAmount;
}
function checkClouds() {
if ((createCloudsCount == 0) && (cloudsMovie._x < -550)) {
newCloud = random(10);
if ((newCloud == cloudCount1) && (newCloud > 2)) {
newCloud = newCloud - 1;
}
if ((newCloud == cloudCount1) && (newCloud < 2)) {
newCloud = newCloud + 1;
}
if (newCloud == 0) {
newCloud = 1;
}
if (newCloud == 1) {
cloudsMovie.attachMovie("cloud1", "cloud1MC", cloudsMovie.getNextHighestDepth(), {_x:550 + (-1 * cloudsMovie._x), _y:0});
cloudCount2 = newCloud;
}
if (newCloud == 2) {
cloudsMovie.attachMovie("cloud2", "cloud2MC", cloudsMovie.getNextHighestDepth(), {_x:550 + (-1 * cloudsMovie._x), _y:0});
cloudCount2 = newCloud;
}
if (newCloud == 3) {
cloudsMovie.attachMovie("cloud3", "cloud3MC", cloudsMovie.getNextHighestDepth(), {_x:550 + (-1 * cloudsMovie._x), _y:0});
cloudCount2 = newCloud;
}
if (newCloud == 4) {
cloudsMovie.attachMovie("cloud4", "cloud4MC", cloudsMovie.getNextHighestDepth(), {_x:550 + (-1 * cloudsMovie._x), _y:0});
cloudCount2 = newCloud;
}
if (newCloud == 5) {
cloudsMovie.attachMovie("cloud5", "cloud5MC", cloudsMovie.getNextHighestDepth(), {_x:550 + (-1 * cloudsMovie._x), _y:0});
cloudCount2 = newCloud;
}
if (newCloud == 6) {
cloudsMovie.attachMovie("cloud6", "cloud6MC", cloudsMovie.getNextHighestDepth(), {_x:550 + (-1 * cloudsMovie._x), _y:0});
cloudCount2 = newCloud;
}
if (newCloud == 7) {
cloudsMovie.attachMovie("cloud7", "cloud7MC", cloudsMovie.getNextHighestDepth(), {_x:550 + (-1 * cloudsMovie._x), _y:0});
cloudCount2 = newCloud;
}
if (newCloud == 8) {
cloudsMovie.attachMovie("cloud8", "cloud8MC", cloudsMovie.getNextHighestDepth(), {_x:550 + (-1 * cloudsMovie._x), _y:0});
cloudCount2 = newCloud;
}
if (newCloud == 9) {
cloudsMovie.attachMovie("cloud9", "cloud9MC", cloudsMovie.getNextHighestDepth(), {_x:550 + (-1 * cloudsMovie._x), _y:0});
cloudCount2 = newCloud;
}
if (newCloud == 10) {
cloudsMovie.attachMovie("cloud10", "cloud10MC", cloudsMovie.getNextHighestDepth(), {_x:550 + (-1 * cloudsMovie._x), _y:0});
cloudCount2 = newCloud;
}
createCloudsCount = 1;
}
if (((((((((((createCloudsCount == 1) && (stopLine.hitTest(cloudsMovie.cloud1MC))) || (stopLine.hitTest(cloudsMovie.cloud2MC))) || (stopLine.hitTest(cloudsMovie.cloud3MC))) || (stopLine.hitTest(cloudsMovie.cloud4MC))) || (stopLine.hitTest(cloudsMovie.cloud5MC))) || (stopLine.hitTest(cloudsMovie.cloud6MC))) || (stopLine.hitTest(cloudsMovie.cloud7MC))) || (stopLine.hitTest(cloudsMovie.cloud8MC))) || (stopLine.hitTest(cloudsMovie.cloud9MC))) || (stopLine.hitTest(cloudsMovie.cloud10MC))) {
if (cloudCount1 == 1) {
removeMovieClip(cloudsMovie.cloud1MC);
createCloudsCount = 0;
}
if (cloudCount1 == 2) {
removeMovieClip(cloudsMovie.cloud2MC);
createCloudsCount = 0;
}
if (cloudCount1 == 3) {
removeMovieClip(cloudsMovie.cloud3MC);
createCloudsCount = 0;
}
if (cloudCount1 == 4) {
removeMovieClip(cloudsMovie.cloud4MC);
createCloudsCount = 0;
}
if (cloudCount1 == 5) {
removeMovieClip(cloudsMovie.cloud5MC);
createCloudsCount = 0;
}
if (cloudCount1 == 6) {
removeMovieClip(cloudsMovie.cloud6MC);
createCloudsCount = 0;
}
if (cloudCount1 == 7) {
removeMovieClip(cloudsMovie.cloud7MC);
createCloudsCount = 0;
}
if (cloudCount1 == 8) {
removeMovieClip(cloudsMovie.cloud8MC);
createCloudsCount = 0;
}
if (cloudCount1 == 9) {
removeMovieClip(cloudsMovie.cloud9MC);
createCloudsCount = 0;
}
if (cloudCount1 == 10) {
removeMovieClip(cloudsMovie.cloud10MC);
createCloudsCount = 0;
}
cloudCount1 = cloudCount2;
}
}
function perder() {
if (cloudsMovie.cloud1MC.hitTest(plane._x, plane._y, true)) {
visibilityGraph.nextFrame();
}
if (cloudsMovie.cloud2MC.hitTest(plane._x, plane._y, true)) {
visibilityGraph.nextFrame();
}
if (cloudsMovie.cloud3MC.hitTest(plane._x, plane._y, true)) {
visibilityGraph.nextFrame();
}
if (cloudsMovie.cloud4MC.hitTest(plane._x, plane._y, true)) {
visibilityGraph.nextFrame();
}
if (cloudsMovie.cloud5MC.hitTest(plane._x, plane._y, true)) {
visibilityGraph.nextFrame();
}
if (cloudsMovie.cloud6MC.hitTest(plane._x, plane._y, true)) {
visibilityGraph.nextFrame();
}
if (cloudsMovie.cloud7MC.hitTest(plane._x, plane._y, true)) {
visibilityGraph.nextFrame();
}
if (cloudsMovie.cloud8MC.hitTest(plane._x, plane._y, true)) {
visibilityGraph.nextFrame();
}
if (cloudsMovie.cloud9MC.hitTest(plane._x, plane._y, true)) {
visibilityGraph.nextFrame();
}
if (cloudsMovie.cloud10MC.hitTest(plane._x, plane._y, true)) {
visibilityGraph.nextFrame();
}
}
function gravity() {
plane._y = plane._y + 10;
if (up == 0) {
plane.gotoAndStop("1");
}
up = 0;
}
function air() {
onMouseDown = function () {
mousePress = 1;
};
onMouseUp = function () {
mousePress = 0;
};
if (mousePress == 1) {
plane.gotoAndStop("2");
plane._y = plane._y - 20;
up = 1;
}
}
function badCloud() {
if (cloudsMovie.cloud3MC.darkCloud.hitTest(plane._x, plane._y, true) || (thunders == 1)) {
thunders = 1;
thundersGraph.nextFrame();
stormSound.start();
}
if (cloudsMovie.cloud8MC.darkCloud.hitTest(plane._x, plane._y, true) || (thunders == 1)) {
thunders = 1;
thundersGraph.nextFrame();
stormSound.start();
}
if (cloudsMovie.cloud8MC.god.cloud4Silva.hitTest(plane._x, plane._y, true) || (thunders == 1)) {
visibilityGraph.prevFrame();
visibilityGraph.prevFrame();
visibilityGraph.prevFrame();
visibilityGraph.prevFrame();
visibilityGraph.prevFrame();
visibilityGraph.prevFrame();
angelSound.start();
}
if (cloudsMovie.cloud8MC.god.hitTest(plane._x, plane._y, true) || (thunders == 1)) {
visibilityGraph.prevFrame();
}
if (cloudsMovie.cloud6MC.god.cloud4Silva.hitTest(plane._x, plane._y, true) || (thunders == 1)) {
visibilityGraph.prevFrame();
visibilityGraph.prevFrame();
visibilityGraph.prevFrame();
visibilityGraph.prevFrame();
visibilityGraph.prevFrame();
visibilityGraph.prevFrame();
angelSound.start();
}
if (cloudsMovie.cloud6MC.god.hitTest(plane._x, plane._y, true) || (thunders == 1)) {
visibilityGraph.prevFrame();
}
}
function countMiles() {
Miles = Miles + 1;
}
function smoke() {
smoke15._y = smoke14._y + 7;
smoke14._y = smoke13._y - 2;
smoke13._y = smoke12._y + 2;
smoke12._y = smoke11._y + 6;
smoke11._y = smoke10._y + 1;
smoke10._y = smoke9._y - 8;
smoke9._y = smoke8._y + 1;
smoke8._y = smoke7._y + 4;
smoke7._y = smoke6._y + 2;
smoke6._y = smoke5._y - 5;
smoke5._y = smoke4._y + 2;
smoke4._y = smoke3._y + 8;
smoke3._y = smoke2._y;
smoke2._y = smoke1._y;
smoke1._y = plane._y + 6;
if (up == 0) {
smoke1._y = smoke1._y - 40;
}
}
function badAltitude() {
if ((plane._y < 0) || (plane._y > 500)) {
perdio = 1;
}
}
function soundLoop() {
windSound.onSoundComplete = function () {
windSound.start();
};
}
theme.stop();
speedCount = 5;
speedCounter = 0;
verifyRandom = 0;
startMap = 0;
up = 0;
conteo = 0;
Miles = 0;
perdio = 0;
cloudsMoveAmount = 20;
thunders = 0;
var windSound = new Sound();
windSound.attachSound("Space Wind");
windSound.start();
windSound.setVolume(10);
var stormSound = new Sound();
stormSound.attachSound("Foreign Storm");
stormSound.setVolume(50);
var angelSound = new Sound();
angelSound.attachSound("Angel Wonder");
angelSound.setVolume(50);
createCloudsCount = 0;
onEnterFrame = function () {
if (perdio == 0) {
setSpeed();
checkClouds();
started();
perder();
gravity();
air();
badCloud();
countMiles();
smoke();
badAltitude();
soundLoop();
}
if (perdio == 1) {
gotoAndStop ("F3");
}
};
Frame 204
started = 0;
if (started == 0) {
var theme = new Sound();
theme.attachSound("The Beat 02");
theme.start();
}
onEnterFrame = function () {
if (started == 1) {
theme.stop();
}
};
Instance of Symbol 586 MovieClip in Frame 204
on (press) {
this._parent.gotoAndStop(2);
}
Frame 205
theme.stop();
Frame 208
stop();
Frame 224
stop();
var HOUSESPEED = 5;
var HOUSESPACE = 40;
var shootTimerRESET = 15;
_root.win._visible = false;
var houseTimer = HOUSESPACE;
var shootTimer = 15;
var AMPM = " PM";
var hour = 11;
var minute = 0;
var timer = "11:00 PM";
var houseCount = 0;
var houseDeleted = 0;
var presentCount = 0;
var particleCount = 0;
var coalCount = 0;
var birdCount = 0;
var SCOREINC = 100;
var SCOREDEC = 100;
var BIRDDEC = 50;
var score = 0;
var avgDis = 0;
var disTot = 0;
var shots = 0;
var miss = 0;
var hit = 0;
_root.crosshair.swapDepths(1000000);
_root.onMouseDown = function () {
if (shootTimer == 0) {
if (_root.gun._currentframe == 1) {
duplicateMovieClip (_root.presents, "presant" + _root.presentCount, 6000 + _root.presentCount);
_root.presentCount++;
} else {
duplicateMovieClip (_root.coal, "coal" + _root.coalCount, 5000 + _root.coalCount);
_root.coalCount++;
}
shootTimer = _root.shootTimerRESET;
}
};
onEnterFrame = function () {
if (shootTimer > 0) {
shootTimer--;
}
if (score < 0) {
score = 0;
}
};
var snowCount = 0;
snowGen = setInterval(function () {
if (_root.snowCount == 250) {
_root.snowCount = 0;
}
duplicateMovieClip (_root.snow, "snow" + _root.snowCount, 10000 + _root.snowCount);
_root.snowCount++;
}, 50);
timerInterval = setInterval(function () {
_root.minute++;
if ((_root.minute == 60) && (_root.hour == 4)) {
clearInterval(snowGen);
_root.gotoAndStop("CS_over");
i = 0;
while (i < _root.houseCount) {
removeMovieClip(_root["house" + i]);
i++;
}
i = 0;
while (i < 250) {
removeMovieClip(_root["snow" + i]);
i++;
}
i = 0;
while (i < _root.birdCount) {
removeMovieClip(_root["bird" + i]);
i++;
}
clearInterval(timerInterval);
} else {
if (_root.minute == 60) {
if (_root.hour == 12) {
_root.hour = 0;
}
_root.hour++;
_root.minute = 0;
}
if (_root.hour == 1) {
_root.AMPM = " AM";
}
if (_root.minute < 10) {
_root.timer = ((_root.hour + ":0") + _root.minute) + _root.AMPM;
} else {
_root.timer = ((_root.hour + ":") + _root.minute) + _root.AMPM;
}
}
}, 100);
Instance of Symbol 780 MovieClip "house" in Frame 224
onClipEvent (load) {
this.chimney.gotoAndStop(random(3) + 1);
this.roof.gotoAndStop(random(3) + 1);
this.wall.gotoAndStop(random(3) + 1);
if (this._name != "house") {
this._width = random(85) + 100;
this._height = random(85) + 100;
this._y = 385;
this._x = 600 + (this._width / 2);
ranZ = random(2);
if (ranZ == 0) {
this._xscale = -100;
}
}
}
onClipEvent (enterFrame) {
if (this._name != "house") {
this._x = this._x - _root.HOUSESPEED;
if (this._x < (-(this._width / 2))) {
_root.houseDeleted++;
removeMovieClip(this);
}
}
}
Instance of Symbol 783 MovieClip in Frame 224
onClipEvent (enterFrame) {
houseSpawn = random(10);
birdSpawn = random(110);
if (birdSpawn == 0) {
duplicateMovieClip (_root.bird, "bird" + _root.birdCount, 1000 + _root.birdCount);
_root.birdCount++;
}
if ((houseSpawn == 0) && (_root.houseTimer == 0)) {
duplicateMovieClip (_root.house, "house" + _root.houseCount, 100 + _root.houseCount);
_root.houseCount++;
_root.houseTimer = _root.HOUSESPACE;
} else if (_root.houseTimer > 0) {
_root.houseTimer--;
}
}
Instance of Symbol 787 MovieClip "coal" in Frame 224
onClipEvent (load) {
if (this._name != "coal") {
_root.shots++;
this._rotation = _root.gun._rotation + 90;
score = 0;
speed = 20;
this._x = _root.gun._x;
this._y = _root.gun._y;
}
}
onClipEvent (enterFrame) {
if (this._name != "coal") {
if (_rotation > 180) {
_y = (_y + (speed * Math.cos((Math.PI/180) * _rotation)));
_x = (_x - (speed * Math.sin((Math.PI/180) * _rotation)));
} else {
_y = (_y - (speed * Math.cos((Math.PI/180) * _rotation)));
_x = (_x + (speed * Math.sin((Math.PI/180) * _rotation)));
}
if ((((this._x < -20) || (this._x > 570)) || (this._y > 420)) || (this._y < -20)) {
_root.miss++;
removeMovieClip(this);
}
duplicateMovieClip (_root.particle, "particle" + _root.particleCount, 50000 + _root.particleCount);
_root["particle" + _root.particleCount]._x = this._x;
_root["particle" + _root.particleCount]._y = this._y;
_root["particle" + _root.particleCount]._rotation = (this._rotation + random(90)) - 45;
_root["particle" + _root.particleCount].gotoAndStop(3);
_root.particleCount++;
duplicateMovieClip (_root.particle, "particle" + _root.particleCount, 50000 + _root.particleCount);
_root["particle" + _root.particleCount]._x = this._x;
_root["particle" + _root.particleCount]._y = this._y;
_root["particle" + _root.particleCount]._rotation = (this._rotation + random(90)) - 45;
_root["particle" + _root.particleCount].gotoAndStop(3);
_root.particleCount++;
duplicateMovieClip (_root.particle, "particle" + _root.particleCount, 50000 + _root.particleCount);
_root["particle" + _root.particleCount]._x = this._x;
_root["particle" + _root.particleCount]._y = this._y;
_root["particle" + _root.particleCount]._rotation = (this._rotation + random(90)) - 45;
_root["particle" + _root.particleCount].gotoAndStop(3);
_root.particleCount++;
score++;
i = _root.houseDeleted;
while (i < _root.houseCount) {
if (_root["house" + i].hitBox.hitTest(this._x, this._y, false) && (_root["house" + i]._currentframe > 1)) {
_root.score = _root.score - _root.SCOREDEC;
_root.hit++;
removeMovieClip(this);
} else if (_root["house" + i].hitBox.hitTest(this._x, this._y, false) && (_root["house" + i]._currentframe == 1)) {
_root.disTot = _root.disTot + score;
_root.score = _root.score + (_root.SCOREINC + score);
_root.hit++;
removeMovieClip(this);
}
i++;
}
}
}
Instance of Symbol 789 MovieClip "sleigh" in Frame 224
onClipEvent (load) {
xSpeed = 0;
ySpeed = 0;
accel = 0.5;
decel = 0.5;
halfWidth = this._width / 2;
halfHeight = this._height / 2;
}
onClipEvent (enterFrame) {
this._x = this._x + xSpeed;
this._y = this._y - ySpeed;
_root.gun._x = this._x;
_root.gun._y = this._y;
if (Key.isDown(68) && (this._x < (550 - halfWidth))) {
xSpeed = xSpeed + accel;
} else if (Key.isDown(65) && (this._x > (0 + halfWidth))) {
xSpeed = xSpeed - accel;
} else if (xSpeed > 0) {
xSpeed = xSpeed - decel;
if (xSpeed < 0) {
xSpeed = 0;
}
} else if (xSpeed < 0) {
xSpeed = xSpeed + decel;
if (xSpeed > 0) {
xSpeed = 0;
}
}
if (Key.isDown(87) && (this._y > (0 + halfHeight))) {
ySpeed = ySpeed + accel;
this._rotation = this._rotation - 0.25;
} else if (Key.isDown(83) && (this._y < (200 - halfHeight))) {
ySpeed = ySpeed - accel;
this._rotation = this._rotation + 0.25;
} else {
if (ySpeed > 0) {
ySpeed = ySpeed - decel;
if (ySpeed < 0) {
ySpeed = 0;
}
} else if (ySpeed < 0) {
ySpeed = ySpeed + decel;
if (ySpeed > 0) {
ySpeed = 0;
}
}
if (this._rotation > 0) {
this._rotation = this._rotation - 2;
if (this._rotation < 0) {
this._rotation = 0;
}
} else if (this._rotation < 0) {
this._rotation = this._rotation + 2;
if (this._rotation > 0) {
this._rotation = 0;
}
}
}
while (this._x < (0 + halfWidth)) {
xSpeed = 0;
this._x++;
}
while (this._x > (600 - halfWidth)) {
xSpeed = 0;
this._x--;
}
while (this._y < (0 + halfHeight)) {
ySpeed = 0;
this._y++;
}
while (this._y > (200 - halfHeight)) {
ySpeed = 0;
this._y--;
}
duplicateMovieClip (_root.particle, "particle" + _root.particleCount, 50000 + _root.particleCount);
_root["particle" + _root.particleCount]._x = this._x - 45;
_root["particle" + _root.particleCount]._y = this._y + 8;
_root["particle" + _root.particleCount]._rotation = ((this._rotation - 90) + random(30)) - 15;
_root["particle" + _root.particleCount].gotoAndStop(2);
_root.particleCount++;
}
Instance of Symbol 791 MovieClip "crosshair" in Frame 224
onClipEvent (load) {
this.startDrag(true);
Mouse.hide();
}
Instance of Symbol 795 MovieClip "gun" in Frame 224
onClipEvent (load) {
stop();
}
onClipEvent (enterFrame) {
Xd = _root._xmouse - _x;
Yd = _root._ymouse - _y;
radAngle = Math.atan2(Yd, Xd);
_rotation = int((radAngle * 360) / (Math.PI*2));
if (Key.isDown(81)) {
this.gotoAndStop(1);
} else if (Key.isDown(69)) {
this.gotoAndStop(2);
}
}
Instance of Symbol 799 MovieClip "presents" in Frame 224
onClipEvent (load) {
this.gotoAndStop(random(3) + 1);
if (this._name != "presents") {
_root.shots++;
this._rotation = _root.gun._rotation + 90;
score = 0;
speed = 20;
this._x = _root.gun._x;
this._y = _root.gun._y;
}
}
onClipEvent (enterFrame) {
if (this._name != "presents") {
duplicateMovieClip (_root.particle, "particle" + _root.particleCount, 50000 + _root.particleCount);
_root["particle" + _root.particleCount]._x = this._x;
_root["particle" + _root.particleCount]._y = this._y;
_root["particle" + _root.particleCount]._rotation = (this._rotation + random(90)) - 45;
_root.particleCount++;
duplicateMovieClip (_root.particle, "particle" + _root.particleCount, 50000 + _root.particleCount);
_root["particle" + _root.particleCount]._x = this._x;
_root["particle" + _root.particleCount]._y = this._y;
_root["particle" + _root.particleCount]._rotation = (this._rotation + random(90)) - 45;
_root.particleCount++;
duplicateMovieClip (_root.particle, "particle" + _root.particleCount, 50000 + _root.particleCount);
_root["particle" + _root.particleCount]._x = this._x;
_root["particle" + _root.particleCount]._y = this._y;
_root["particle" + _root.particleCount]._rotation = (this._rotation + random(90)) - 45;
_root.particleCount++;
if (_rotation > 180) {
_y = (_y + (speed * Math.cos((Math.PI/180) * _rotation)));
_x = (_x - (speed * Math.sin((Math.PI/180) * _rotation)));
} else {
_y = (_y - (speed * Math.cos((Math.PI/180) * _rotation)));
_x = (_x + (speed * Math.sin((Math.PI/180) * _rotation)));
}
score++;
if ((((this._x < -20) || (this._x > 570)) || (this._y > 420)) || (this._y < -20)) {
_root.miss++;
removeMovieClip(this);
}
i = _root.houseDeleted;
while (i < _root.houseCount) {
if (_root["house" + i].hitBox.hitTest(this._x, this._y, false) && (_root["house" + i].chimney._currentframe > 1)) {
_root.score = _root.score + (_root.SCOREINC + score);
_root.hit++;
removeMovieClip(this);
} else if (_root["house" + i].hitBox.hitTest(this._x, this._y, false) && (_root["house" + i].chimney._currentframe == 1)) {
_root.score = _root.score - _root.SCOREDEC;
_root.disTot = _root.disTot + score;
_root.hit++;
removeMovieClip(this);
}
i++;
}
}
}
Instance of Symbol 801 MovieClip "snow" in Frame 224
onClipEvent (load) {
if (this._name != "snow") {
speed = 3;
xSpeed = random(3) - 4;
ran = random(25) + 25;
this._xscale = ran;
this._yscale = ran;
this._x = random(900);
this._y = -(this._width / 2);
}
}
onClipEvent (enterFrame) {
if (this._name != "snow") {
this._y = this._y + speed;
this._x = this._x + xSpeed;
if (this._y > (400 + (this._height / 2))) {
removeMovieClip(this);
}
}
}
Instance of Symbol 807 MovieClip "bird" in Frame 224
onClipEvent (load) {
if (this._name != "bird") {
dead = false;
speed = 8;
this._x = 550 + (this._width / 2);
this._y = random(200 - this._height) + (this._height / 2);
}
}
onClipEvent (enterFrame) {
if (this._name != "bird") {
if (!dead) {
this._x = this._x - speed;
} else if (dead) {
speed++;
}
if ((this._x < (-(this._width / 2))) && (this._y > (600 + (this._width / 2)))) {
removeMovieClip(this);
}
if (this.hitTest(_root.sleigh) && (!dead)) {
_root.score = _root.score - _root.BIRDDEC;
speed = -5;
stop();
dead = true;
}
if (dead) {
this._rotation = 180;
this._y = this._y + speed;
}
}
}
Instance of Symbol 810 MovieClip "particle" in Frame 224
onClipEvent (load) {
if (this._name != "particle") {
speed = 5;
this._width = 1;
this._height = 1;
}
}
onClipEvent (enterFrame) {
if (this._name != "particle") {
this._alpha = this._alpha - 10;
speed = speed - 0.25;
this._width = this._width + 0.5;
this._height = this._height + 0.5;
if (_rotation > 180) {
_y = (_y + (speed * Math.cos((Math.PI/180) * _rotation)));
_x = (_x - (speed * Math.sin((Math.PI/180) * _rotation)));
} else {
_y = (_y - (speed * Math.cos((Math.PI/180) * _rotation)));
_x = (_x + (speed * Math.sin((Math.PI/180) * _rotation)));
}
if (this._alpha < 1) {
removeMovieClip(this);
}
}
}
Frame 238
avgDis = Math.round((disTot / shots) * 10);
_root.crosshair.removeMovieClip();
Mouse.show();
Frame 253
stop();
var PC_snowCount = 0;
snowGen = setInterval(function () {
if (_root.PC_snowCount == 250) {
_root.PC_snowCount = 0;
}
duplicateMovieClip (_root.PC_snow, "PC_snow" + _root.PC_snowCount, 1000 + _root.PC_snowCount);
_root.PC_snowCount++;
}, 50);
Instance of Symbol 823 MovieClip "PC_snow" in Frame 253
onClipEvent (load) {
if (this._name != "snow") {
speed = 3;
xSpeed = random(3) - 4;
ran = random(25) + 25;
this._xscale = ran;
this._yscale = ran;
this._x = random(900);
this._y = -(this._width / 2);
}
}
onClipEvent (enterFrame) {
if (this._name != "snow") {
this._y = this._y + speed;
this._x = this._x + xSpeed;
if (this._y > (400 + (this._height / 2))) {
removeMovieClip(this);
}
}
}
Frame 258
var PC_presentCount = 0;
var PC_score = 0;
PC_pTimer = random(45) + 15;
PC_time = 45;
onEnterFrame = function () {
if (PC_pTimer > 0) {
PC_pTimer--;
} else {
duplicateMovieClip (_root.PC_present, "PC_present" + _root.PC_presentCount, 2000 + _root.PC_presentCount);
if (_root.PC_presentCount <= 100) {
_root.PC_presentCount++;
} else {
_root.PC_presentCount = 0;
}
PC_pTimer = random(20) + 10;
}
};
timerInterval = setInterval(function () {
_root.PC_time--;
if (_root.PC_time == 0) {
_root.gotoAndStop("PC_over");
clearInterval(timerInterval);
}
}, 1000);
snowGen = setInterval(function () {
if (_root.PC_snowCount == 250) {
_root.PC_snowCount = 0;
}
duplicateMovieClip (_root.PC_snow, "PC_snow" + _root.PC_snowCount, 1000 + _root.PC_snowCount);
_root.PC_snowCount++;
}, 50);
Instance of Symbol 840 MovieClip "PC_present" in Frame 258
onClipEvent (load) {
this.gotoAndStop(random(4) + 1);
if (this._name != "present") {
wid = this._width;
this._rotation = random(360);
this._x = random(550 - this.wid) + (this.wid / 2);
speed = random(2) + 6;
rotSpeed = random(9) - 4;
}
}
onClipEvent (enterFrame) {
if (this._name != "PC_present") {
this._y = this._y + speed;
this._rotation = this._rotation + rotSpeed;
if (this._y > (400 + (this._height / 2))) {
if (_root.PC_score >= 50) {
_root.PC_score = _root.PC_score - 25;
} else {
_root.PC_score = 0;
}
removeMovieClip(this);
}
}
}
Instance of Symbol 823 MovieClip "snow" in Frame 258
onClipEvent (load) {
if (this._name != "snow") {
speed = 3;
xSpeed = random(3) - 4;
ran = random(25) + 25;
this._xscale = ran;
this._yscale = ran;
this._x = random(900);
this._y = -(this._width / 2);
}
}
onClipEvent (enterFrame) {
if (this._name != "snow") {
this._y = this._y + speed;
this._x = this._x + xSpeed;
if (this._y > (400 + (this._height / 2))) {
removeMovieClip(this);
}
}
}
Instance of Symbol 848 MovieClip "PC_sled" in Frame 258
onClipEvent (load) {
this.swapDepths(5000);
xSpeed = 0;
}
onClipEvent (enterFrame) {
if (_root.PC_time == 0) {
this.removeMovieClip();
}
this._x = this._x + xSpeed;
if (Key.isDown(39) && (xSpeed < 20)) {
xSpeed++;
}
if (Key.isDown(37) && (xSpeed > -20)) {
xSpeed--;
}
if ((!Key.isDown(37)) && (!Key.isDown(39))) {
if (xSpeed > 0) {
xSpeed--;
} else if (xSpeed < 0) {
xSpeed++;
}
}
if (this._x > (550 - (this._width / 2))) {
this._x = 550 - (this._width / 2);
xSpeed = 0;
} else if (this._x < (0 + (this._width / 2))) {
this._x = 0 + (this._width / 2);
xSpeed = 0;
}
i = 0;
while (i < 100) {
if (this.PC_hitArea.hitTest(_root["PC_present" + i])) {
_root.PC_score = _root.PC_score + (100 + Math.round((_root["PC_present" + i]._width / 2) - Math.abs(this._x - _root["PC_present" + i]._x)));
removeMovieClip(_root["PC_present" + i]);
}
i++;
}
}
Frame 263
i = 0;
while (i <= 102) {
removeMovieClip(_root["PC_present" + i]);
i++;
}
snowGen = setInterval(function () {
if (_root.PC_snowCount == 250) {
_root.PC_snowCount = 0;
}
duplicateMovieClip (_root.PC_snow, "PC_snow" + _root.PC_snowCount, 1000 + _root.PC_snowCount);
_root.PC_snowCount++;
}, 50);
Frame 268
stop();
Frame 273
stop();
var PF_presentSpeed = 4;
var PF_presentCount = 0;
var PF_toyCount = 0;
var PF_score = 0;
PF_pTimer = random(30);
PF_tTimer = 0;
PF_dropped = 0;
PF_missed = 0;
PF_packed = 0;
PF_time = 45;
onEnterFrame = function () {
if (PF_pTimer == 0) {
duplicateMovieClip (_root.PF_present, "PF_present" + _root.PF_presentCount, 100 + _root.PF_presentCount);
if (_root.PF_presentCount < 100) {
_root.PF_presentCount++;
} else {
_root.PF_presentCount = 0;
}
PF_pTimer = random(30) + 30;
} else {
PF_pTimer--;
}
if (PF_tTimer > 0) {
PF_tTimer--;
}
};
onMouseDown = function () {
if (PF_tTimer == 0) {
duplicateMovieClip (_root.PF_toy, "PF_toy" + _root.PF_toyCount, 200 + _root.PF_toyCount);
if (_root.PF_toyCount < 100) {
_root.PF_toyCount++;
} else {
_root.PF_toyCount = 0;
}
PF_tTimer = 15;
}
};
timerInterval = setInterval(function () {
_root.PF_time--;
if (_root.PF_time == 0) {
_root.gotoAndStop("PF_over");
}
}, 1000);
Instance of Symbol 872 MovieClip "PF_present" in Frame 273
onClipEvent (load) {
this.gotoAndStop(random(4) + 1);
this._xscale = random(50) + 75;
this._yscale = random(50) + 75;
hit = false;
}
onClipEvent (enterFrame) {
if (this._name != "PF_present") {
this._x = this._x - _root.PF_presentSpeed;
if (this._x < (-(this._width / 2))) {
if ((_root.PF_score >= 150) && (!hit)) {
_root.PF_missed++;
_root.PF_score = _root.PF_score - 150;
} else if (_root.PF_score < 150) {
_root.PF_missed++;
_root.PF_score = 0;
}
removeMovieClip(this);
}
}
}
Instance of Symbol 877 MovieClip "PF_pipe" in Frame 273
onClipEvent (load) {
this.stop();
this.swapDepths(100000);
}
onClipEvent (enterFrame) {
this._x = _root._xmouse;
if (Key.isDown(65)) {
this.gotoAndStop(1);
} else if (Key.isDown(83)) {
this.gotoAndStop(2);
} else if (Key.isDown(68)) {
this.gotoAndStop(3);
} else if (Key.isDown(70)) {
this.gotoAndStop(4);
}
}
Instance of Symbol 883 MovieClip "PF_toy" in Frame 273
onClipEvent (load) {
if (this._name != "PF_toy") {
this.gotoAndStop(_root.PF_pipe._currentframe);
this._x = _root.PF_pipe._x;
this._y = _root.PF_pipe._y;
speed = 1;
}
}
onClipEvent (enterFrame) {
speed++;
this._y = this._y + speed;
i = 0;
while (i < 100) {
if ((this.hitTest(_root["PF_present" + i]) && (!_root["PF_present" + i].hit)) && (_root["PF_present" + i]._currentframe == this._currentframe)) {
_root.PF_score = _root.PF_score + (100 + Math.round((_root["PF_present" + i]._width / 2) - Math.abs(this._x - _root["PF_present" + i]._x)));
_root["PF_present" + i].hit = true;
_root.PF_packed++;
removeMovieClip(this);
}
i++;
}
if (this._y > 400) {
if (_root.PF_score >= 150) {
_root.PF_score = _root.PF_score - 150;
} else {
_root.PF_score = 0;
}
_root.PF_dropped++;
removeMovieClip(this);
}
}
Frame 278
removeMovieClip(_root.PF_pipe);
clearInterval(timerInterval);
i = 0;
while (i <= 100) {
removeMovieClip(_root["PF_present" + i]);
i++;
}
Symbol 20 MovieClip [esplode] Frame 22
stop();
Symbol 23 MovieClip [snowball] Frame 29
stop();
Instance of Symbol 25 MovieClip in Symbol 32 MovieClip [power] Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.game.shooter.body) == true) {
tellTarget ("_root.game.health") {
prevFrame();
};
removeMovieClip("_root.game.power");
_root.game.pp.play();
}
}
Instance of Symbol 30 MovieClip in Symbol 32 MovieClip [power] Frame 22
onClipEvent (enterFrame) {
if (this.hitTest(_root.game.shooter.body) == true) {
_root.game.shooter.mspeed = 12;
removeMovieClip("_root.game.power");
_root.game.pt.play();
}
}
Symbol 35 MovieClip [ammo] Frame 26
stop();
Symbol 61 Button
on (release) {
getURL ("http://www.cheezeworld.com/blog", _blank);
}
Symbol 71 MovieClip [Evilelf] Frame 1
function endPhase1(done) {
if (done) {
BG.theScore = 0;
clearInterval(endP1ID);
deInitializeBG();
deInitializePresent();
deInitializePlayer();
startPhase1();
} else {
Gameworld.State = "phase2";
endP1ID = setInterval(endPhase1, 3000, {done:true});
}
}
function runPhase1() {
if (Player.isAlive) {
moveChainedPresents();
moveElf();
} else {
endPhase1();
}
}
function initializeBG() {
switch (Gameworld.State) {
case "phase1" :
var _local1 = attachMovie("Phase1BG", "Phase1BG", 1);
break;
case "phase2" :
break;
case "menu" :
}
}
function deInitializeBG() {
removeMovieClip(BG);
}
function startPhase1() {
Player = new Object();
Gameworld = new Object();
initializePlayer();
initializePresent();
Gameworld.State = "phase1";
initializeBG();
}
function hitWorldPresent() {
somesound = new Sound();
somesound.attachSound("pop");
somesound.start(0, 1);
BG.theScore++;
Gameworld.Present.S._x = (GRIDX + (CELLSIZE / 2)) + (Math.floor(Math.random() * GRIDHCELLS) * CELLSIZE);
Gameworld.Present.S._y = (GRIDY + (CELLSIZE / 2)) + (Math.floor(Math.random() * GRIDVCELLS) * CELLSIZE);
var _local1 = Player.presents.length;
addToChain(_local1);
}
function initializePresent() {
Gameworld.Present = {};
Gameworld.Present.S = attachMovie("Present", "Present", 300);
Gameworld.Present.S._x = (GRIDX + (CELLSIZE / 2)) + (Math.floor(0.3 * GRIDHCELLS) * CELLSIZE);
Gameworld.Present.S._y = (GRIDY + (CELLSIZE / 2)) + (Math.floor(0.3 * GRIDVCELLS) * CELLSIZE);
}
function deInitializePresent() {
removeMovieClip(Gameworld.Present.S);
}
function addToChain(Index) {
Player.presents[Index] = {};
Player.presents[Index].MC = attachMovie("Present", "Present" + Index, 200 + Index);
Player.presents[Index].MC._x = Player.presents[Index - 1].MC._x;
Player.presents[Index].MC._y = Player.presents[Index - 1].MC._y;
Player.presents[Index].MC.Index = Index;
Player.presents[Index].counter = PLAYERCOUNTER;
Player.presents[Index].canTurn = false;
Player.presents[Index].speed = CELLSIZE / PLAYERCOUNTER;
Player.presents[Index].vX = 0;
Player.presents[Index].vY = 0;
Player.presents[Index].newDir = Player.presents[Index - 1].dir;
Player.presents[Index].dir = Player.presents[Index - 1].dir;
Player.presents[Index].isAlive = true;
}
function initializePlayer() {
Player.MC = attachMovie("Elf", "Elf", 100);
Player.MC._x = GRIDX + (CELLSIZE / 2);
Player.MC._y = GRIDY + (CELLSIZE / 2);
Player.counter = PLAYERCOUNTER;
Player.canTurn = false;
Player.speed = CELLSIZE / PLAYERCOUNTER;
Player.vX = Player.speed;
Player.vY = 0;
Player.dir = 3;
Player.isAlive = true;
Player.presents = new Array();
var _local1 = 0;
Player.presents[_local1] = {};
Player.presents[_local1].MC = attachMovie("Present", "Present" + _local1, 200 + _local1);
Player.presents[_local1].MC._x = Player.MC._x;
Player.presents[_local1].MC._y = Player.MC._y;
Player.presents[_local1].MC.Index = _local1;
Player.presents[_local1].counter = PLAYERCOUNTER + 1;
Player.presents[_local1].canTurn = false;
Player.presents[_local1].speed = CELLSIZE / PLAYERCOUNTER;
Player.presents[_local1].vX = 0;
Player.presents[_local1].vY = 0;
Player.presents[_local1].newDir = Player.dir;
Player.presents[_local1].dir = Player.dir;
Player.presents[_local1].isAlive = true;
}
function deInitializePlayer() {
removeMovieClip(Player.MC);
Player.isAlive = false;
i = 0;
while (i < Player.presents.length) {
removeMovieClip(Player.presents[i].MC);
Player.presents[i].isAlive = false;
i++;
}
}
function checkPlayerContact() {
var _local1 = 0;
while (_local1 < Player.presents.length) {
if (Player.presents[_local1].MC._x == Player.MC._x) {
if (Player.presents[_local1].MC._y == Player.MC._y) {
Player.isAlive = false;
somesound2 = new Sound();
somesound2.attachSound("agony");
somesound2.start(0, 1);
}
} else if (Player.presents[_local1].MC.hitTest(Player.MC._x, Player.MC._y + (Player.vY * PLAYERCOUNTER), false)) {
Player.isAlive = false;
somesound2 = new Sound();
somesound2.attachSound("agony");
somesound2.start(0, 1);
}
_local1++;
}
if (Gameworld.Present.S._x == Player.MC._x) {
if (Gameworld.Present.S._y == Player.MC._y) {
hitWorldPresent();
}
} else if (Gameworld.Present.S.hitTest(Player.MC._x, Player.MC._y + (Player.vY * PLAYERCOUNTER), false)) {
hitWorldPresent();
}
}
function moveChainedPresents() {
Index = 0;
while (Index < Player.presents.length) {
if (Player.presents[Index].counter == 0) {
Player.presents[Index].canTurn = true;
}
if (Player.presents[Index].canTurn) {
Player.presents[Index].counter = PLAYERCOUNTER;
if ((Player.presents.length - 1) != Index) {
Player.presents[Index + 1].newDir = Player.presents[Index].dir;
}
changeDirection(Player.presents[Index], Player.presents[Index].newDir);
Player.presents[Index].canTurn = false;
}
Player.presents[Index].MC._x = Player.presents[Index].MC._x + Player.presents[Index].vX;
Player.presents[Index].MC._y = Player.presents[Index].MC._y + Player.presents[Index].vY;
Player.presents[Index].counter--;
Index++;
}
}
function moveElf() {
if (Player.counter == 0) {
Player.canTurn = true;
}
if (Player.canTurn) {
Player.counter = PLAYERCOUNTER;
Player.presents[0].newDir = Player.dir;
changeDirection(Player, Player.newDir);
Player.canTurn = false;
checkPlayerContact();
}
Player.MC._x = Player.MC._x + Player.vX;
Player.MC._y = Player.MC._y + Player.vY;
Player.counter--;
if (Player.MC._x > (((GRIDX + (CELLSIZE / 2)) + (GRIDHCELLS * CELLSIZE)) - CELLSIZE)) {
Player.isAlive = false;
somesound2 = new Sound();
somesound2.attachSound("agony");
somesound2.start(0, 1);
} else if (Player.MC._x < ((GRIDX - (CELLSIZE / 2)) + CELLSIZE)) {
Player.isAlive = false;
somesound2 = new Sound();
somesound2.attachSound("agony");
somesound2.start(0, 1);
} else if (Player.MC._y > (((GRIDY + (CELLSIZE / 2)) + (GRIDVCELLS * CELLSIZE)) - CELLSIZE)) {
Player.isAlive = false;
somesound2 = new Sound();
somesound2.attachSound("agony");
somesound2.start(0, 1);
} else if (Player.MC._y < ((GRIDY - (CELLSIZE / 2)) + CELLSIZE)) {
Player.isAlive = false;
somesound2 = new Sound();
somesound2.attachSound("agony");
somesound2.start(0, 1);
}
}
function changeDirection(_Obj, dir) {
_Obj.dir = dir;
switch (dir) {
case 1 :
if (_Obj.vX == 0) {
_Obj.MC._rotation = 180;
_Obj.vX = -_Obj.speed;
_Obj.vY = 0;
}
break;
case 2 :
if (_Obj.vY == 0) {
_Obj.MC._rotation = -90;
_Obj.vX = 0;
_Obj.vY = -_Obj.speed;
}
break;
case 3 :
if (_Obj.vX == 0) {
_Obj.MC._rotation = 0;
_Obj.vX = _Obj.speed;
_Obj.vY = 0;
}
break;
case 4 :
if (_Obj.vY != 0) {
break;
}
_Obj.MC._rotation = 90;
_Obj.vX = 0;
_Obj.vY = _Obj.speed;
}
}
function drawGrid() {
var _local2 = new Shape();
_local2.graphics.lineStyle(1, 0);
var _local1 = 0;
while (_local1 < (GRIDHCELLS + 1)) {
_local2.graphics.moveTo(GRIDX + (_local1 * CELLSIZE), GRIDY);
_local2.graphics.lineTo(GRIDX + (_local1 * CELLSIZE), GRIDY + (CELLSIZE * GRIDVCELLS));
_local1++;
}
_local1 = 0;
while (_local1 < (GRIDVCELLS + 1)) {
_local2.graphics.moveTo(GRIDX, GRIDY + (_local1 * CELLSIZE));
_local2.graphics.lineTo(GRIDX + (CELLSIZE * GRIDHCELLS), GRIDY + (_local1 * CELLSIZE));
_local1++;
}
addChild(_local2);
}
var CELLSIZE = 48;
var GRIDX = 138;
var GRIDY = 28;
var GRIDHCELLS = 8;
var GRIDVCELLS = 7;
var PLAYERCOUNTER = 4;
var Player;
var Gameworld;
stop();
startPhase1();
Key.addListener(this);
onEnterFrame = function () {
switch (Gameworld.State) {
case "menu" :
return;
case "phase1" :
runPhase1();
return;
case "phase2" :
return;
case "highscores" :
}
};
onKeyDown = function () {
if (!(Gameworld.State === "phase1")) {
} else {
switch (Key.getCode()) {
case 37 :
Player.newDir = 1;
return;
case 38 :
Player.newDir = 2;
return;
case 39 :
Player.newDir = 3;
return;
case 40 :
Player.newDir = 4;
}
}
};
Symbol 106 MovieClip [circlez] Frame 1
_y = -10;
_x = (Math.random() * 550);
_rotation = random(360);
speed = Math.random(3) * 9;
onEnterFrame = function () {
_y = (_y + speed);
if (this.hitTest(_root.pf)) {
removeMovieClip(this);
_root.plus_p++;
}
if (this.hitTest(_root.Limit)) {
removeMovieClip(this);
_root.nextFrame();
}
if (_root.nott == 0) {
removeMovieClip(this);
}
};
Symbol 113 Button
on (release) {
if (_root.instructions) {
this._alpha = 0;
_root.instructions = false;
trace("erkay");
if (_root.gameOver) {
_root.SANTALIFE = 40;
_root.gameOver = false;
_root.killCount = 0;
}
}
}
Symbol 118 MovieClip [instructions] Frame 1
stop();
Symbol 120 MovieClip [smoke] Frame 10
removeMovieClip(this);
Symbol 138 Button
on (release) {
getURL ("http://www.armorgames.com", "blank");
}
Symbol 145 MovieClip Frame 81
_root.play();
_root.play();
Symbol 153 Button
on (release) {
if (!_global.menu_end) {
this.play();
}
}
Symbol 154 Button
on (release) {
_global.menu_move = true;
}
Symbol 155 MovieClip Frame 1
stop();
_global.menu_move = false;
Symbol 155 MovieClip Frame 20
stop();
_global.menu_move = false;
Symbol 155 MovieClip Frame 40
stop();
_global.menu_move = false;
_global.menu_end = false;
Symbol 155 MovieClip Frame 60
stop();
_global.menu_move = false;
_global.menu_end = true;
Symbol 218 Button
on (release) {
getURL ("http://www.armorgames.com/", "_blank");
}
Symbol 235 MovieClip Frame 1
stop();
_root.game.shoot = false;
Symbol 243 MovieClip Frame 1
stop();
Symbol 253 MovieClip Frame 1
stop();
Symbol 264 MovieClip Frame 1
stop();
Symbol 282 MovieClip Frame 1
stop();
Symbol 292 MovieClip Frame 1
stop();
Symbol 302 MovieClip Frame 1
stop();
Symbol 318 MovieClip Frame 1
stop();
Symbol 360 Button
on (release) {
_root.nextFrame();
}
Symbol 363 Button
on (release) {
stopAllSounds();
_root.gotoAndPlay("main_menu");
}
Symbol 391 MovieClip Frame 13
stop();
Symbol 394 MovieClip Frame 40
stop();
Symbol 395 MovieClip Frame 50
stop();
Symbol 396 MovieClip Frame 1
stop();
Symbol 411 Button
on (release) {
_root.nextFrame();
}
Symbol 415 Button
on (release) {
stopAllSounds();
_root.gotoAndPlay("main_menu");
}
Symbol 421 MovieClip Frame 1
stop();
Symbol 425 MovieClip Frame 1
stop();
Symbol 425 MovieClip Frame 6
stop();
Symbol 429 MovieClip Frame 1
stop();
Symbol 460 MovieClip Frame 1
stop();
Symbol 460 MovieClip Frame 2
stop();
Symbol 473 MovieClip Frame 1
stop();
Symbol 473 MovieClip Frame 2
stop();
Symbol 489 MovieClip Frame 1
stop();
Symbol 489 MovieClip Frame 2
stop();
Symbol 489 MovieClip Frame 3
stop();
Symbol 489 MovieClip Frame 4
stop();
Symbol 497 Button
on (press) {
if (_root.instructionsOn == false) {
bgSound = new Sound(this);
bgSound.attachSound("sound1");
bgSound.start(0, 99);
_root.gameStarted = true;
_root.gamePause = false;
_root.gameScreens.gotoAndStop(3);
}
}
Symbol 500 Button
on (press) {
if (_root.instructionsOn == false) {
_root.gotoAndPlay("main_menu");
}
}
Symbol 503 Button
on (press) {
if (_root.instructionsOn == false) {
_root.instructionsScreen._x = 250;
_root.instructionsOn = true;
}
}
Symbol 511 Button
on (press) {
_root.gameScreens.gotoAndStop(3);
_root.gamePause = false;
_root.scoreToNextLv = _root.scoreToNextLv + (Math.round(_root.scoreToNextLv * 0.1) + _root.scoreToNextLv);
_root.santa.presentDifficulty = _root.santa.presentDifficulty - 10;
_root.santa.obstacleDifficulty = _root.santa.obstacleDifficulty - 30;
_root.level++;
}
Symbol 517 Button
on (press) {
bgSound = new Sound(this);
bgSound.attachSound("sound1");
bgSound.start(0, 99);
_root.gameStarted = true;
_root.gamePause = false;
_root.score = 0;
_root.gameScreens.gotoAndStop(3);
}
Symbol 520 Button
on (press) {
function __rankz_send__(par1, par2, par3, par4) {
par227 = new LoadVars();
par228 = new LoadVars();
par227.flashkey = par2;
par227.SU0249 = par1;
par227.bmFtZTE = Armor_Bot_30_En_AS1.Encode(par3);
par227.c2NvcmUx = Armor_Bot_30_En_AS1.Encode(par4 + "j%e%a%n%s");
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/", par228, "POST");
}
bXlnYW1lX25hbWVfdmFyaWFibGU = _root.userName;
bXlnYW1lX3Njb3JlX3ZhcmlhYmxl = _root.score;
__rankz_send__("MjA1NWolZSVhJW4lcw==", "dFBpblFYcXI=", bXlnYW1lX25hbWVfdmFyaWFibGU, bXlnYW1lX3Njb3JlX3ZhcmlhYmxl);
_root.gameScreens.submitButton._y = _root.gameScreens.submitButton._y + 5000;
}
Symbol 523 Button
on (press) {
getURL ("http://rankz.armorbot.com/santalineguide/", "_blank");
}
Symbol 528 Button
on (press) {
_root.gotoAndPlay("main_menu");
}
Symbol 534 MovieClip Frame 1
stop();
_root.correctFrame = _root._currentframe;
_root.i = 2;
_root.lineColour = 1;
_root.score = 0;
_root.life = 100;
_root.level = 1;
_root.gameStarted = false;
_root.gamePause = true;
_root.scoreToNextLv = 10;
Symbol 534 MovieClip Frame 2
stop();
Symbol 534 MovieClip Frame 3
stop();
Symbol 534 MovieClip Frame 4
stop();
stopAllSounds();
_root.correctFrame = _root._currentframe;
_root.i = 2;
_root.lineColour = 1;
_root.life = 100;
_root.level = 1;
_root.gameStarted = false;
_root.gamePause = true;
_root.scoreToNextLv = 10;
_root.santa.presentDifficulty = 100;
_root.santa.obstacleDifficulty = 300;
Symbol 544 Button
on (press) {
_root.instructionsScreen.gotoAndStop(2);
}
Symbol 547 Button
on (press) {
_root.instructionsOn = false;
_root.instructionsScreen._x = 1000;
}
Symbol 554 Button
on (press) {
_root.instructionsOn = false;
_root.instructionsScreen._x = 1000;
_root.instructionsScreen.gotoAndStop(1);
}
Symbol 559 Button
on (press) {
_root.instructionsScreen.gotoAndStop(1);
}
Symbol 560 MovieClip Frame 1
stop();
Symbol 560 MovieClip Frame 2
stop();
Symbol 564 Button
on (release) {
_root.nextFrame();
}
Symbol 567 Button
on (release) {
getURL ("http://rankz.armorbot.com/Xmas_Ball_catcher/");
}
Symbol 569 Button
on (release) {
_root.gotoAndPlay("main_menu");
}
Symbol 581 Button
on (release) {
_root.__rankz_send__("MjAzN2olZSVhJW4lcw==", "UnRTS25FTUQ=", bXlnYW1lX25hbWVfdmFyaWFibGU, bXlnYW1lX3Njb3JlX3ZhcmlhYmxl);
_root.gotoAndStop("game4");
}
Symbol 594 Button
on (release) {
gotoAndStop ("F2");
}
Symbol 598 Button
on (release) {
gotoAndStop ("F5");
}
Symbol 602 Button
on (release) {
_root.gotoAndPlay("main_menu");
}
Symbol 618 MovieClip Frame 4
stop();
Symbol 619 MovieClip Frame 4
stop();
Symbol 620 MovieClip Frame 1
stop();
Symbol 623 MovieClip Frame 1
onEnterFrame = function () {
if (this._parent.perdio == 0) {
moveSmoke = random(5);
if (moveSmoke == 0) {
gotoAndPlay ("1");
}
if (moveSmoke == 1) {
gotoAndPlay ("2");
}
if (moveSmoke == 2) {
gotoAndPlay ("3");
}
if (moveSmoke == 3) {
gotoAndPlay ("4");
}
if (moveSmoke == 4) {
gotoAndPlay ("5");
}
if (moveSmoke == 5) {
gotoAndPlay ("6");
}
}
};
stop();
Symbol 632 MovieClip Frame 1
stop();
Symbol 639 MovieClip Frame 1
stop();
Symbol 639 MovieClip Frame 15
this._parent.perdio = 1;
Symbol 645 MovieClip Frame 1
stop();
Symbol 645 MovieClip Frame 15
this._parent.perdio = 1;
Symbol 657 Button
on (release) {
gotoAndStop ("F4");
}
Symbol 683 MovieClip Frame 129
stopAllSounds();
stop();
Symbol 688 Button
on (release) {
gotoAndStop ("F4");
}
Symbol 692 MovieClip Frame 1
r = 0;
Symbol 692 MovieClip Frame 2
setProperty("snow", _rotation , r);
r = r + 2;
Symbol 692 MovieClip Frame 3
gotoAndPlay (2);
Symbol 711 Button
on (release) {
_root.game._quality = "low";
}
Symbol 713 Button
on (release) {
_root.game._quality = "medium";
}
Symbol 715 Button
on (release) {
_root.game._quality = "high";
}
Symbol 716 MovieClip Frame 1
stop();
Instance of Symbol 705 MovieClip in Symbol 716 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.game.shooter.body) == true) {
_root.game.shooter.mspeed = 10;
removeMovieClip("_root.game.power");
_root.game.pt.play();
}
}
Instance of Symbol 706 MovieClip in Symbol 716 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.game.shooter.body) == true) {
tellTarget ("_root.game.health") {
prevFrame();
};
removeMovieClip("_root.game.power");
_root.game.pp.play();
}
}
Symbol 718 Button
on (release) {
_root.gotoAndPlay("main_menu");
}
Symbol 735 MovieClip Frame 1
stop();
Symbol 738 MovieClip Frame 1
stop();
Symbol 738 MovieClip Frame 21
_root.game.gotoAndStop(3);
Symbol 740 MovieClip Frame 60
_root.game.attachMovie("snowball", "snow1", 10, {_x:_root.game.t1._x, _y:_root.game.t1._y});
_root.game.attachMovie("snowball", "snow2", 11, {_x:_root.game.t2._x, _y:_root.game.t2._y});
_root.game.attachMovie("snowball", "snow3", 12, {_x:_root.game.t3._x, _y:_root.game.t3._y});
_root.game.attachMovie("snowball", "snow4", 13, {_x:_root.game.t4._x, _y:_root.game.t4._y});
_root.game.snow1._rotation = _root.game.t1._rotation;
_root.game.snow2._rotation = _root.game.t2._rotation;
_root.game.snow3._rotation = _root.game.t3._rotation;
_root.game.snow4._rotation = _root.game.t4._rotation;
gotoAndPlay (1);
Symbol 741 MovieClip Frame 210
_root.game.attachMovie("power", "power", 17, {_x:0, _y:0});
gotoAndStop (1);
Symbol 744 MovieClip Frame 1
stop();
Symbol 744 MovieClip Frame 125
gotoAndStop (1);
_root.game.shooter.mspeed = 6;
_root.game.pp.play();
Symbol 748 MovieClip Frame 1
stop();
play_mc.onRelease = function () {
_root.game.gotoAndStop(2);
};
instr_mc.onRelease = function () {
_root.game.box.gotoAndStop(2);
};
sett_mc.onRelease = function () {
_root.game.box.gotoAndStop(3);
};
Instance of Symbol 720 MovieClip in Symbol 748 MovieClip Frame 1
onClipEvent (enterFrame) {
this.startDrag(true);
Mouse.hide();
}
Symbol 748 MovieClip Frame 2
stop();
shoot = false;
score = 0;
onealmost = false;
onehit = 0;
twoalmost = false;
twohit = 0;
threealmost = false;
threehit = 0;
fouralmost = false;
fourhit = 0;
ogone = false;
tgone = false;
thgone = false;
fgone = false;
onEnterFrame = function () {
if (Key.isDown(32)) {
if (shoot == false) {
attachMovie("ammo", "ammo", 5, {_x:_root.game.shooter._x, _y:_root.game.shooter._y});
_root.game.ammo._rotation = _root.game.shooter.head._rotation - 90;
shoot = true;
_root.game.shooter.gotoAndPlay(2);
}
}
if (_root.game.ammo.hitTest(_root.game.t1) == true) {
removeMovieClip("ammo");
tellTarget ("t1") {
nextFrame();
};
score++;
onehit++;
}
if (onehit == 5) {
attachMovie("esplode", "ex", 7, {_x:_root.game.t1._x, _y:_root.game.t1._y - 30});
t1._x = t1._x + 1000;
onehit = 0;
ogone = true;
}
if (_root.game.ammo.hitTest(_root.game.t2) == true) {
removeMovieClip("ammo");
tellTarget ("t2") {
nextFrame();
};
score++;
twohit++;
}
if (twohit == 5) {
attachMovie("esplode", "ex", 7, {_x:_root.game.t2._x, _y:_root.game.t2._y - 30});
t2._x = t2._x - 1000;
twohit = 0;
tgone = true;
}
if (_root.game.ammo.hitTest(_root.game.t3) == true) {
removeMovieClip("ammo");
tellTarget ("t3") {
nextFrame();
};
score++;
threehit++;
}
if (threehit == 5) {
attachMovie("esplode", "ex", 7, {_x:_root.game.t3._x, _y:_root.game.t3._y - 30});
t3._x = t3._x - 1000;
threehit = 0;
thgone = true;
}
if (_root.game.ammo.hitTest(_root.game.t4) == true) {
removeMovieClip("ammo");
tellTarget ("t4") {
nextFrame();
};
score++;
fourhit++;
}
if (fourhit == 5) {
attachMovie("esplode", "ex", 7, {_x:_root.game.t4._x, _y:_root.game.t4._y - 30});
t4._x = t4._x + 1000;
fourhit = 0;
fgone = true;
}
if (shooter.body.hitTest(_root.game.snow1) == true) {
removeMovieClip("_root.game.snow1");
tellTarget ("health") {
nextFrame();
};
}
if (shooter.body.hitTest(_root.game.snow2) == true) {
removeMovieClip("_root.game.snow2");
tellTarget ("health") {
nextFrame();
};
}
if (shooter.body.hitTest(_root.game.snow3) == true) {
removeMovieClip("_root.game.snow3");
tellTarget ("health") {
nextFrame();
};
}
if (shooter.body.hitTest(_root.game.snow4) == true) {
removeMovieClip("_root.game.snow4");
tellTarget ("health") {
nextFrame();
};
}
if ((((ogone == true) & (tgone == true)) & (thgone == true)) & (fgone == true)) {
_root.game.gotoAndStop(3);
removeMovieClip("power");
}
};
Instance of Symbol 692 MovieClip in Symbol 748 MovieClip Frame 2
onClipEvent (load) {
this._rotation = (Math.random() * 300) + 30;
this.snow.gotoAndPlay(8);
}
Instance of Symbol 692 MovieClip in Symbol 748 MovieClip Frame 2
onClipEvent (load) {
this._rotation = (Math.random() * 300) + 30;
this.snow.gotoAndPlay(5);
}
Instance of Symbol 692 MovieClip in Symbol 748 MovieClip Frame 2
onClipEvent (load) {
this._rotation = (Math.random() * 300) + 30;
this.snow.gotoAndPlay(3);
}
Instance of Symbol 735 MovieClip "t1" in Symbol 748 MovieClip Frame 2
onClipEvent (enterFrame) {
myRadians = Math.atan2(_root.game.shooter._y - this._y, _root.game.shooter._x - this._x);
myDegrees = Math.round((myRadians * 180) / Math.PI);
_root.yChange = Math.round(_root.game.shooter._y - this._y);
_root.xChange = Math.round(_root.game.shooter._x - this._x);
_root.yMove = Math.round(_root.yChange / 20);
_root.xMove = Math.round(_root.xChange / 20);
this._rotation = myDegrees + 90;
}
Instance of Symbol 735 MovieClip "t2" in Symbol 748 MovieClip Frame 2
onClipEvent (enterFrame) {
myRadians = Math.atan2(_root.game.shooter._y - this._y, _root.game.shooter._x - this._x);
myDegrees = Math.round((myRadians * 180) / Math.PI);
_root.yChange = Math.round(_root.game.shooter._y - this._y);
_root.xChange = Math.round(_root.game.shooter._x - this._x);
_root.yMove = Math.round(_root.yChange / 20);
_root.xMove = Math.round(_root.xChange / 20);
this._rotation = myDegrees + 90;
}
Instance of Symbol 735 MovieClip "t4" in Symbol 748 MovieClip Frame 2
onClipEvent (enterFrame) {
myRadians = Math.atan2(_root.game.shooter._y - this._y, _root.game.shooter._x - this._x);
myDegrees = Math.round((myRadians * 180) / Math.PI);
_root.yChange = Math.round(_root.game.shooter._y - this._y);
_root.xChange = Math.round(_root.game.shooter._x - this._x);
_root.yMove = Math.round(_root.yChange / 20);
_root.xMove = Math.round(_root.xChange / 20);
this._rotation = myDegrees + 90;
}
Instance of Symbol 735 MovieClip "t3" in Symbol 748 MovieClip Frame 2
onClipEvent (enterFrame) {
myRadians = Math.atan2(_root.game.shooter._y - this._y, _root.game.shooter._x - this._x);
myDegrees = Math.round((myRadians * 180) / Math.PI);
_root.yChange = Math.round(_root.game.shooter._y - this._y);
_root.xChange = Math.round(_root.game.shooter._x - this._x);
_root.yMove = Math.round(_root.yChange / 20);
_root.xMove = Math.round(_root.xChange / 20);
this._rotation = myDegrees + 90;
}
Instance of Symbol 235 MovieClip "shooter" in Symbol 748 MovieClip Frame 2
onClipEvent (load) {
yspeed = 0;
xspeed = 0;
mspeed = 7;
}
onClipEvent (enterFrame) {
this._x = this._x + xspeed;
this._y = this._y + yspeed;
if (Key.isDown(65) && (xspeed > (-mspeed))) {
xspeed--;
}
if (Key.isDown(68) && (xspeed < mspeed)) {
xspeed++;
}
if (Key.isDown(87) && (yspeed > (-mspeed))) {
yspeed--;
}
if (Key.isDown(83) && (yspeed < mspeed)) {
yspeed++;
}
if (this._x > 252) {
this._x = 252;
xspeed = 0;
}
if (this._x < -247.6) {
this._x = -247.5;
xspeed = 0;
}
if (this._y > 176.9) {
this._y = 176.9;
yspeed = 0;
}
if (this._y < -153.1) {
this._y = -153.1;
yspeed = 0;
}
if ((yspeed > 0) && (!Key.isDown(83))) {
yspeed = yspeed - 1;
}
if ((yspeed < 0) && (!Key.isDown(87))) {
yspeed = yspeed + 1;
}
if ((xspeed > 0) && (!Key.isDown(68))) {
xspeed = xspeed - 1;
}
if ((xspeed < 0) && (!Key.isDown(65))) {
xspeed = xspeed + 1;
}
myRadians = Math.atan2(_root.game._ymouse - this._y, _root.game._xmouse - this._x);
myDegrees = Math.round((myRadians * 180) / Math.PI);
this.head._rotation = myDegrees + 90;
}
Symbol 748 MovieClip Frame 3
menu_mc.onRelease = function () {
_root.game.gotoAndStop(1);
};
ogone = false;
tgone = false;
thgone = false;
fgone = false;
Symbol 749 MovieClip Frame 1
function endPhase1(done) {
if (done) {
BG.theScore = 0;
clearInterval(endP1ID);
deInitializeBG();
deInitializePresent();
deInitializePlayer();
startPhase1();
} else {
Gameworld.State = "phase2";
endP1ID = setInterval(endPhase1, 3000, {done:true});
}
}
function runPhase1() {
if (Player.isAlive) {
moveChainedPresents();
moveElf();
} else {
endPhase1();
}
}
function initializeBG() {
switch (Gameworld.State) {
case "phase1" :
var _local1 = attachMovie("Phase1BG", "Phase1BG", 1);
break;
case "phase2" :
break;
case "menu" :
}
}
function deInitializeBG() {
removeMovieClip(BG);
}
function startPhase1() {
Player = new Object();
Gameworld = new Object();
initializePlayer();
initializePresent();
Gameworld.State = "phase1";
initializeBG();
}
function hitWorldPresent() {
somesound = new Sound();
somesound.attachSound("pop");
somesound.start(0, 1);
BG.theScore++;
Gameworld.Present.S._x = (GRIDX + (CELLSIZE / 2)) + (Math.floor(Math.random() * GRIDHCELLS) * CELLSIZE);
Gameworld.Present.S._y = (GRIDY + (CELLSIZE / 2)) + (Math.floor(Math.random() * GRIDVCELLS) * CELLSIZE);
var _local1 = Player.presents.length;
addToChain(_local1);
}
function initializePresent() {
Gameworld.Present = {};
Gameworld.Present.S = attachMovie("Present", "Present", 300);
Gameworld.Present.S._x = (GRIDX + (CELLSIZE / 2)) + (Math.floor(0.3 * GRIDHCELLS) * CELLSIZE);
Gameworld.Present.S._y = (GRIDY + (CELLSIZE / 2)) + (Math.floor(0.3 * GRIDVCELLS) * CELLSIZE);
}
function deInitializePresent() {
removeMovieClip(Gameworld.Present.S);
}
function addToChain(Index) {
Player.presents[Index] = {};
Player.presents[Index].MC = attachMovie("Present", "Present" + Index, 200 + Index);
Player.presents[Index].MC._x = Player.presents[Index - 1].MC._x;
Player.presents[Index].MC._y = Player.presents[Index - 1].MC._y;
Player.presents[Index].MC.Index = Index;
Player.presents[Index].counter = PLAYERCOUNTER;
Player.presents[Index].canTurn = false;
Player.presents[Index].speed = CELLSIZE / PLAYERCOUNTER;
Player.presents[Index].vX = 0;
Player.presents[Index].vY = 0;
Player.presents[Index].newDir = Player.presents[Index - 1].dir;
Player.presents[Index].dir = Player.presents[Index - 1].dir;
Player.presents[Index].isAlive = true;
}
function initializePlayer() {
Player.MC = attachMovie("Elf", "Elf", 100);
Player.MC._x = GRIDX + (CELLSIZE / 2);
Player.MC._y = GRIDY + (CELLSIZE / 2);
Player.counter = PLAYERCOUNTER;
Player.canTurn = false;
Player.speed = CELLSIZE / PLAYERCOUNTER;
Player.vX = Player.speed;
Player.vY = 0;
Player.dir = 3;
Player.isAlive = true;
Player.presents = new Array();
var _local1 = 0;
Player.presents[_local1] = {};
Player.presents[_local1].MC = attachMovie("Present", "Present" + _local1, 200 + _local1);
Player.presents[_local1].MC._x = Player.MC._x;
Player.presents[_local1].MC._y = Player.MC._y;
Player.presents[_local1].MC.Index = _local1;
Player.presents[_local1].counter = PLAYERCOUNTER + 1;
Player.presents[_local1].canTurn = false;
Player.presents[_local1].speed = CELLSIZE / PLAYERCOUNTER;
Player.presents[_local1].vX = 0;
Player.presents[_local1].vY = 0;
Player.presents[_local1].newDir = Player.dir;
Player.presents[_local1].dir = Player.dir;
Player.presents[_local1].isAlive = true;
}
function deInitializePlayer() {
removeMovieClip(Player.MC);
Player.isAlive = false;
i = 0;
while (i < Player.presents.length) {
removeMovieClip(Player.presents[i].MC);
Player.presents[i].isAlive = false;
i++;
}
}
function checkPlayerContact() {
var _local1 = 0;
while (_local1 < Player.presents.length) {
if (Player.presents[_local1].MC._x == Player.MC._x) {
if (Player.presents[_local1].MC._y == Player.MC._y) {
Player.isAlive = false;
somesound2 = new Sound();
somesound2.attachSound("agony");
somesound2.start(0, 1);
}
} else if (Player.presents[_local1].MC.hitTest(Player.MC._x, Player.MC._y + (Player.vY * PLAYERCOUNTER), false)) {
Player.isAlive = false;
somesound2 = new Sound();
somesound2.attachSound("agony");
somesound2.start(0, 1);
}
_local1++;
}
if (Gameworld.Present.S._x == Player.MC._x) {
if (Gameworld.Present.S._y == Player.MC._y) {
hitWorldPresent();
}
} else if (Gameworld.Present.S.hitTest(Player.MC._x, Player.MC._y + (Player.vY * PLAYERCOUNTER), false)) {
hitWorldPresent();
}
}
function moveChainedPresents() {
Index = 0;
while (Index < Player.presents.length) {
if (Player.presents[Index].counter == 0) {
Player.presents[Index].canTurn = true;
}
if (Player.presents[Index].canTurn) {
Player.presents[Index].counter = PLAYERCOUNTER;
if ((Player.presents.length - 1) != Index) {
Player.presents[Index + 1].newDir = Player.presents[Index].dir;
}
changeDirection(Player.presents[Index], Player.presents[Index].newDir);
Player.presents[Index].canTurn = false;
}
Player.presents[Index].MC._x = Player.presents[Index].MC._x + Player.presents[Index].vX;
Player.presents[Index].MC._y = Player.presents[Index].MC._y + Player.presents[Index].vY;
Player.presents[Index].counter--;
Index++;
}
}
function moveElf() {
if (Player.counter == 0) {
Player.canTurn = true;
}
if (Player.canTurn) {
Player.counter = PLAYERCOUNTER;
Player.presents[0].newDir = Player.dir;
changeDirection(Player, Player.newDir);
Player.canTurn = false;
checkPlayerContact();
}
Player.MC._x = Player.MC._x + Player.vX;
Player.MC._y = Player.MC._y + Player.vY;
Player.counter--;
if (Player.MC._x > (((GRIDX + (CELLSIZE / 2)) + (GRIDHCELLS * CELLSIZE)) - CELLSIZE)) {
Player.isAlive = false;
somesound2 = new Sound();
somesound2.attachSound("agony");
somesound2.start(0, 1);
} else if (Player.MC._x < ((GRIDX - (CELLSIZE / 2)) + CELLSIZE)) {
Player.isAlive = false;
somesound2 = new Sound();
somesound2.attachSound("agony");
somesound2.start(0, 1);
} else if (Player.MC._y > (((GRIDY + (CELLSIZE / 2)) + (GRIDVCELLS * CELLSIZE)) - CELLSIZE)) {
Player.isAlive = false;
somesound2 = new Sound();
somesound2.attachSound("agony");
somesound2.start(0, 1);
} else if (Player.MC._y < ((GRIDY - (CELLSIZE / 2)) + CELLSIZE)) {
Player.isAlive = false;
somesound2 = new Sound();
somesound2.attachSound("agony");
somesound2.start(0, 1);
}
}
function changeDirection(_Obj, dir) {
_Obj.dir = dir;
switch (dir) {
case 1 :
if (_Obj.vX == 0) {
_Obj.MC._rotation = 180;
_Obj.vX = -_Obj.speed;
_Obj.vY = 0;
}
break;
case 2 :
if (_Obj.vY == 0) {
_Obj.MC._rotation = -90;
_Obj.vX = 0;
_Obj.vY = -_Obj.speed;
}
break;
case 3 :
if (_Obj.vX == 0) {
_Obj.MC._rotation = 0;
_Obj.vX = _Obj.speed;
_Obj.vY = 0;
}
break;
case 4 :
if (_Obj.vY != 0) {
break;
}
_Obj.MC._rotation = 90;
_Obj.vX = 0;
_Obj.vY = _Obj.speed;
}
}
function drawGrid() {
var _local2 = new Shape();
_local2.graphics.lineStyle(1, 0);
var _local1 = 0;
while (_local1 < (GRIDHCELLS + 1)) {
_local2.graphics.moveTo(GRIDX + (_local1 * CELLSIZE), GRIDY);
_local2.graphics.lineTo(GRIDX + (_local1 * CELLSIZE), GRIDY + (CELLSIZE * GRIDVCELLS));
_local1++;
}
_local1 = 0;
while (_local1 < (GRIDVCELLS + 1)) {
_local2.graphics.moveTo(GRIDX, GRIDY + (_local1 * CELLSIZE));
_local2.graphics.lineTo(GRIDX + (CELLSIZE * GRIDHCELLS), GRIDY + (_local1 * CELLSIZE));
_local1++;
}
addChild(_local2);
}
var CELLSIZE = 48;
var GRIDX = 138;
var GRIDY = 28;
var GRIDHCELLS = 8;
var GRIDVCELLS = 7;
var PLAYERCOUNTER = 4;
var Player;
var Gameworld;
stop();
startPhase1();
Key.addListener(this);
onEnterFrame = function () {
switch (Gameworld.State) {
case "menu" :
return;
case "phase1" :
runPhase1();
return;
case "phase2" :
return;
case "highscores" :
}
};
onKeyDown = function () {
if (!(Gameworld.State === "phase1")) {
} else {
switch (Key.getCode()) {
case 37 :
Player.newDir = 1;
return;
case 38 :
Player.newDir = 2;
return;
case 39 :
Player.newDir = 3;
return;
case 40 :
Player.newDir = 4;
}
}
};
Symbol 753 Button
on (release) {
_root.gotoAndStop("CS_game");
}
Symbol 756 Button
on (release) {
_root.gotoAndPlay("main_menu");
}
Symbol 810 MovieClip Frame 1
stop();
Symbol 813 Button
on (release) {
_root.gotoAndPlay("main_menu");
}
Symbol 827 Button
on (release) {
_root.gotoAndStop("PC_game");
}
Symbol 831 Button
on (release) {
clearInterval(snowGen);
_root.gotoAndPlay("main_menu");
}
Symbol 865 Button
on (release) {
_root.gotoAndStop("PF_game");
}
Symbol 866 Button
on (release) {
_root.gotoAndPlay("main_menu");
}