Frame 1
stop();
music = new Sound(this);
music.attachSound("MenuMusic");
music.start(0, 999);
snowOn = 0;
onEnterFrame = function () {
if ((_root._currentframe != 1) && (_root._currentframe != 9)) {
snowOn = undefined;
delete onEnterFrame;
} else if (((Math.random() * 100) > 40) && (snowOn < 40)) {
snowOn++;
mc = attachMovie("snow", "snow" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
mc._x = Math.random() * Stage.width;
mc.speed = (Math.random() * 4) + 2;
mc.wind = ((Math.random() * 2) * (Math.round(Math.random() * 1.5) - 1)) + 0.5;
mc._alpha = (Math.random() * 42) + 14;
scale = (Math.random() * 0.7) + 0.5;
mc._xscale = mc._xscale * scale;
mc._yscale = mc._yscale * scale;
mc.onEnterFrame = function () {
this._y = this._y + this.speed;
this._x = this._x + this.wind;
if ((((this._x > Stage.width) || (this._x < 0)) || (this._y > Stage.height)) || ((_root._currentframe != 1) && (_root._currentframe != 9))) {
_root.snowOn--;
this.removeMovieClip();
}
};
}
};
Frame 2
function spewMoney(xx, yy) {
mc = _root.attachMovie("money", "money" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
mc._x = xx;
mc._y = yy;
mc.starty = yy;
}
function spewPresent(xx, yy) {
mc = _root.attachMovie("present", "present" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
mc.sett = true;
mc._x = xx;
mc._y = yy;
mc.starty = yy;
}
function dropPresent() {
mc = _root.attachMovie("present", "present" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
mc._x = _root.player._x + _root.master.worldx;
mc._y = _root.player._y;
mc.startx = mc._x;
_root.master.props.push(mc);
_root.master.giftsleft--;
_root.presents.push(mc);
}
function makeCrow(mc) {
crow = _root.attachMovie("crow", "crow" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
extra = 0;
if (_root.master.worldx != undefined) {
extra = extra + _root.master.worldx;
}
crow._x = (mc._x + mc.chimney._x) + extra;
crow._y = mc._y + mc.chimney._y;
crow.houseOn = mc;
mc.crow = crow;
crows.push(crow);
}
function playerResetValues(who) {
who._x = Stage.width / 2;
who._y = Stage.height / 2;
who.jumping = false;
who.xvel = 0;
who.yvel = 0;
who.friction = 0.5;
who.gravity = 2.5;
who.speed = 9 + (spower * 3);
who.running = false;
who.dir = 1;
who.onGround = false;
who.justjumped = false;
who.jumped = true;
who.tackling = false;
who.houseOn = null;
who.chimney = null;
who.onChimney = false;
who.dropping = false;
who.dealthit = false;
who.hit = false;
who.hitdir = 1;
who.jetting = false;
who.jetx = 0;
who.jetted = false;
}
function makeHouse() {
mc = _root.attachMovie("houses", "houses" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
extra = 0;
if (_root.master.worldx != undefined) {
extra = extra + _root.master.worldx;
}
if (lasthouse == undefined) {
mc._x = 800;
} else {
mc._x = lasthouse._x - 759.7;
}
mc._y = 300;
lasthouse = mc;
rand = Math.round(Math.random() * 4);
if (rand != 1) {
mc.gotoAndStop(rand);
}
if (rand < 3) {
mc.hascrow = true;
makeCrow(mc);
}
rand = Math.random() * 100;
if (rand > 32) {
cat = _root.attachMovie("enemycat", "enemycat" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
cat._x = mc._x + (mc._width / 2);
cat._y = mc._y + mc.hit._y;
cat.origx = cat._x;
cat.origy = cat._y;
cats.push(cat);
mc.cat = cat;
}
_root.houses.push(mc);
}
function CreateLevel() {
punch1 = new Sound(this);
punch2 = new Sound(this);
punch1.attachSound("punch1");
punch2.attachSound("punch2");
punch1.setVolume(50);
punch2.setVolume(50);
master = _root.attachMovie("master", "master", _root.getNextHighestDepth());
i = 0;
while (i < 4) {
makeHouse();
i++;
}
i = 0;
while (i < 5) {
mc = _root.attachMovie("edd", "healthhead" + i, _root.getNextHighestDepth());
mc._xscale = mc._xscale * 0.6;
mc._yscale = mc._yscale * 0.6;
mc._x = 2;
mc._y = 61 + (i * 39);
mc.num = i + 1;
i++;
}
gifts = _root.attachMovie("gifts", "gifts", _root.getNextHighestDepth());
gifts._x = 500;
gifts._y = 31.75;
leveltell = _root.attachMovie("leveltell", "leveltell", _root.getNextHighestDepth());
leveltell._x = 258.45;
leveltell._y = 125.1;
leveltell.txt.text = ((("Level " + level) + " - ") + (level * 5)) + " Presents";
timer = _root.attachMovie("timer", "timer", _root.getNextHighestDepth());
timer._x = 99;
timer._y = 30.5;
_root.wrongway = _root.attachMovie("wrongway", "wrongway", _root.getNextHighestDepth());
wrongway._x = Stage.width / 2;
wrongway._y = (Stage.height / 2) - 70;
moneytxt = _root.attachMovie("moneytxt", "moneytxt", _root.getNextHighestDepth());
moneytxt._x = 165.5;
moneytxt._y = -3;
player = _root.attachMovie("player", "player", _root.getNextHighestDepth());
player._xscale = player._xscale * 0.65;
player._yscale = player._yscale * 0.65;
playerResetValues(player);
player.onEnterFrame = function () {
if (_root.life <= 0) {
_root.life = 0;
_root.lives--;
if (lives > 0) {
_root.RestartLevel();
} else {
_root.gameOver();
}
}
_root.fueltank._visible = _root.hasjetpack;
_root.wrongway.swapDepths(_root.getNextHighestDepth());
this.swapDepths(_root.getNextHighestDepth());
this.xvel = 0;
this.running = false;
this.onGround = false;
if (this.onChimney) {
if ((this._x > (this.chimney._x + this.houseOn._x)) && (this._x < ((this.chimney._x + this.houseOn._x) + this.chimney._width))) {
num = (this.houseOn._y + this.houseOn.chimney._y) - this._y;
if (Math.abs(num) < 10) {
this._y = this.houseOn._y + this.houseOn.chimney._y;
this.onChimney = true;
this.onGround = true;
this.chimney = this.houseOn.chimney;
this.yvel = 0;
this.justjumped = this.jumping;
this.jumping = false;
} else {
this.jumped = true;
}
} else {
this.jumped = true;
}
}
if (!this.onGround) {
this.onChimney = false;
this.chimney = null;
i = 0;
while (i < _root.master.houses.length) {
if (this.hitTest(_root.master.houses[i].hit)) {
if (_root.master.houses[i].hit.hitTest(this._x, this._y + this.yvel, false) && ((this._y + this.yvel) >= _root.master.houses[i]._y)) {
if ((!this.jumped) && (this.yvel > 0)) {
if (this.dir == 1) {
this._x = ((_root.master.houses[i]._x + 30) + _root.master.houses[i].hit._x) - this._width;
} else {
this._x = ((_root.master.houses[i]._x + _root.master.houses[i].hit._x) + 30) + _root.master.houses[i].hit._width;
}
} else {
this.houseOn = _root.master.houses[i];
this.jumped = false;
this.onGround = true;
this.yvel = 0;
this.justjumped = this.jumping;
this.jumping = false;
this._y = _root.master.houses[i].hit._y + _root.master.houses[i]._y;
break;
}
}
}
i++;
}
}
if ((Key.isDown(37) && (!this.tackling)) && (!this.dropping)) {
if (this.jetting) {
this.jetx = this.jetx - (this.speed / 10);
} else {
this.xvel = this.xvel - this.speed;
}
this.running = true;
this.dir = -1;
}
if ((Key.isDown(39) && (!this.tackling)) && (!this.dropping)) {
if (this.jetting) {
this.jetx = this.jetx + (this.speed / 10);
} else {
this.xvel = this.xvel + this.speed;
}
this.running = true;
this.dir = 1;
}
if ((((Key.isDown(38) && (!this.jumping)) && (this.onGround)) && (!this.tackling)) && (!this.dropping)) {
this.jumped = true;
this.onGround = false;
this.jumping = true;
this.yvel = -30;
}
if (((((Key.isDown(70) && (!this.tackling)) && (this.onChimney)) && (!this.running)) && (_root.master.giftsleft > 0)) && (!this.chimney.done)) {
this.dropping = true;
_root.master.giftsleft--;
_root.master.given++;
this.chimney.done = true;
}
if (((Key.isDown(68) && (!this.tackling)) && (_root.curfuel > 0)) && (_root.hasjetpack)) {
this.jetting = true;
this.jumped = true;
this.jetted = true;
_root.curfuel = _root.curfuel - 0.3;
} else {
this.jetting = false;
}
if (Key.isDown(88)) {
_root.curfuel = _root.maxfuel;
_root.hasjetpack = true;
}
if ((((Key.isDown(32) && (!this.tackling)) && (!this.jumping)) && (this.onGround)) && (!jetting)) {
this.dealthit = false;
this.tackling = true;
}
if (this.dropping) {
this.gotoAndStop("giftdrop");
} else if (this.hit) {
this.gotoAndStop("hit");
this.xvel = this.hitdir * 13;
} else if (this.jetting) {
this.yvel = this.yvel - 0.8;
this.gotoAndStop("jet");
} else if (this.jumping || (!this.onGround)) {
this.gotoAndStop("fly");
if ((!this.onChimney) && (this.yvel >= 0)) {
if (this.houseOn.crow != undefined) {
if ((!this.houseOn.crow.dead) && (this._y < (this.houseOn.crow._y - (this.houseOn.crow._height / 2)))) {
if (this.hitTest(this.houseOn.crow)) {
this.yvel = -16;
this.houseOn.crow.dead = true;
}
}
}
}
this.tackling = false;
} else if (this.tackling) {
_root.master.worldx = _root.master.worldx + (this.dir * ((185.05 + (tpower * 20)) / 10));
if (!this.dealthit) {
i = 0;
while (i < _root.master.enemies.length) {
if (this.hitTest(_root.master.enemies[i])) {
rand = Math.round(Math.random() + 1);
_root["punch" + rand].start(0, 0);
_root.master.enemies[i].hit = true;
_root.master.enemies[i].hitdir = -this.dir;
this.tackling = false;
this.dealthit = true;
break;
}
i++;
}
}
this.gotoAndStop("tackle");
} else if (this.running) {
this.gotoAndStop("run");
if (this.justjumped) {
this.justjumped = false;
this.guy.gotoAndPlay("fromfly");
}
} else {
this.gotoAndStop("idle");
}
if (!this.onGround) {
if (this.jetting) {
this.yvel = this.yvel + (this.gravity / 4);
} else if (this.jetted) {
this.yvel = this.yvel + (this.gravity / 2);
} else {
this.yvel = this.yvel + this.gravity;
}
}
if (this.yvel > 20) {
this.yvel = 20;
}
if ((this.yvel < -15) && (this.jetted)) {
this.yvel = -15;
}
if (((this._y - this._height) < 0) && (this.jetted)) {
this._y = this._height;
this.yvel = 0;
}
if (this.jumping) {
num = (this.houseOn._y + this.houseOn.chimney._y) - this._y;
if ((num > 0) && (num < this.yvel)) {
this._y = this.houseOn._y + this.houseOn.chimney._y;
this.jumped = false;
this.onChimney = true;
this.chimney = this.houseOn.chimney;
this.yvel = 0;
this.justjumped = this.jumping;
this.jumping = false;
}
}
this._y = this._y + this.yvel;
if (this._y > Stage.height) {
lives--;
if (lives > 0) {
_root.RestartLevel();
} else {
_root.gameOver();
}
}
i = 0;
while (i < _root.master.money.length) {
if (this.hitTest(_root.master.money[i])) {
_root.master.money[i].removeMovieClip();
_root.money = _root.money + Math.round((Math.random() * 10) + 10);
}
i++;
}
i = 0;
while (i < _root.master.presents.length) {
if (this.hitTest(_root.master.presents[i])) {
_root.master.presents[i].removeMovieClip();
_root.master.giftsleft++;
}
i++;
}
if ((!this.jumped) && (this.jetted)) {
this.jetted = false;
}
if (!this.jetting) {
this.jetx = this.jetx * 0.9;
}
_root.master.worldx = _root.master.worldx + (this.xvel + this.jetx);
this.jetx = this.jetx * 0.97;
this._xscale = this.dir * Math.abs(this._xscale);
};
}
function RestartLevel() {
_root.gifts.removeMovieClip();
_root.moneytxt.removeMovieClip();
_root.timer.removeMovieClip();
bgmusic.stop();
_root.restarted = true;
delete player.onEnterFrame;
_root.gotoAndStop("died");
}
function cleanUp() {
i = 0;
while (i < 5) {
_root["healthhead" + i].removeMovieClip();
i++;
}
lasthouse = undefined;
i = 0;
while (i < _root.houses.length) {
_root.houses[i].crow.removeMovieClip();
_root.houses[i].cat.removeMovieClip();
_root.houses[i].removeMovieClip();
i++;
}
i = 0;
while (i < presents.length) {
presents[i].removeMovieClip();
i++;
}
i = 0;
while (i < _root.master.money.length) {
_root.master.money[i].removeMovieClip();
i++;
}
_root.wrongway.removeMovieClip();
_root.master.removeMovieClip();
delete master;
_root.player.removeMovieClip();
delete player;
_root.leveltell.removeMovieClip();
_root.gifts.removeMovieClip();
_root.moneytxt.removeMovieClip();
_root.timer.removeMovieClip();
bgmusic.stop();
punch1.stop();
punch2.stop();
delete bgmusic;
delete punch1;
delete punch2;
}
function notEnoughDeliveries() {
_root.score = _root.score - _root.levelscore;
_root.money = _root.money - _root.levelmoney;
_root.levelscore = 0;
_root.levelmoney = 0;
cleanUp();
gotoAndStop ("notenough");
}
function nextLevel() {
_root.levelscore = 0;
_root.levelmoney = 0;
level++;
cleanUp();
if (level == 10) {
_root.startsec = 75;
}
if (level == 11) {
gotoAndStop ("gamewin");
} else {
gotoAndStop ("levelwin");
}
}
function gameOver() {
_root.levelscore = 0;
_root.levelmoney = 0;
cleanUp();
level = undefined;
lives = undefined;
restarted = undefined;
gotoAndStop ("gameover");
}
stop();
if ((_root.restarted == false) || (_root.restarted == undefined)) {
houses = new Array();
cats = new Array();
presents = new Array();
crows = new Array();
bgmusic = new Sound(this);
bgmusic.attachSound("dominant");
bgmusic.start(0, 999);
punch1 = new Sound(this);
punch2 = new Sound(this);
punch1.attachSound("punch1");
punch2.attachSound("punch2");
punch1.setVolume(50);
punch2.setVolume(50);
lasthouse = undefined;
}
if (level == undefined) {
levelscore = 0;
levelmoney = 0;
_root.restarted = false;
lives = 2;
level = 1;
money = 0;
hasjetpack = false;
curfuel = 30;
maxfuel = 30;
life = 30;
maxlife = 30;
spower = 1;
tpower = 1;
moneycap = 300;
startsec = 60;
score = 0;
}
if ((!_root.restarted) || (_root.restarted == undefined)) {
CreateLevel();
}
snowOn = 0;
onEnterFrame = function () {
if ((_root._currentframe != 2) && (_root._currentframe != 6)) {
snowOn = undefined;
delete onEnterFrame;
} else if (((Math.random() * 100) > 40) && (snowOn < 40)) {
snowOn++;
mc = attachMovie("snow", "snow" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
mc._x = Math.random() * Stage.width;
mc.speed = (Math.random() * 4) + 2;
mc.wind = ((Math.random() * 2) * (Math.round(Math.random() * 1.5) - 1)) + 0.5;
mc._alpha = (Math.random() * 42) + 14;
scale = (Math.random() * 0.7) + 0.5;
mc._xscale = mc._xscale * scale;
mc._yscale = mc._yscale * scale;
mc.onEnterFrame = function () {
this._y = this._y + this.speed;
this._x = this._x + this.wind;
if ((((this._x > Stage.width) || (this._x < 0)) || (this._y > Stage.height)) || ((_root._currentframe != 2) && (_root._currentframe != 6))) {
_root.snowOn--;
this.removeMovieClip();
}
};
}
};
Frame 3
stop();
Frame 4
stop();
frame.txt.text = _root.score;
snowOn = 0;
onEnterFrame = function () {
if (_root._currentframe != 4) {
snowOn = undefined;
delete onEnterFrame;
} else if (((Math.random() * 100) > 40) && (snowOn < 40)) {
snowOn++;
mc = attachMovie("snow", "snow" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
mc._x = Math.random() * Stage.width;
mc.speed = (Math.random() * 4) + 2;
mc.wind = ((Math.random() * 2) * (Math.round(Math.random() * 1.5) - 1)) + 0.5;
mc._alpha = (Math.random() * 42) + 14;
scale = (Math.random() * 0.7) + 0.5;
mc._xscale = mc._xscale * scale;
mc._yscale = mc._yscale * scale;
mc.onEnterFrame = function () {
this._y = this._y + this.speed;
this._x = this._x + this.wind;
if ((((this._x > Stage.width) || (this._x < 0)) || (this._y > Stage.height)) || (_root._currentframe != 4)) {
_root.snowOn--;
this.removeMovieClip();
}
};
}
};
Frame 5
stop();
Frame 6
stop();
Frame 7
function Buy() {
if (selected == 0) {
_root.enough.play();
} else if (selected == 1) {
if ((_root.money >= speed) && (_root.spower < 3)) {
_root.money = _root.money - speed;
_root.spower++;
speed = _root.spower * 50;
} else {
_root.enough.play();
}
} else if (selected == 2) {
if ((_root.money >= jetpack) && (!_root.hasjetpack)) {
_root.money = _root.money - jetpack;
_root.hasjetpack = true;
} else {
_root.enough.play();
}
} else if (selected == 3) {
if ((_root.money >= fuel) && (_root.curfuel != _root.maxfuel)) {
_root.money = _root.money - fuel;
_root.curfuel = _root.maxfuel;
} else {
_root.enough.play();
}
} else if (selected == 4) {
if ((_root.money >= lifeup) && (_root.lives < 5)) {
_root.money = _root.money - lifeup;
_root.lives++;
} else {
_root.enough.play();
}
} else if (selected == 5) {
if ((_root.money >= moneyupgrade) && (_root.moneycap < 600)) {
_root.money = _root.money - moneyupgrade;
_root.moneycap = _root.moneycap + 100;
} else {
_root.enough.play();
}
} else if (selected == 6) {
if ((_root.money >= tackle) && (_root.tpower < 3)) {
_root.money = _root.money - tackle;
_root.tpower++;
tackle = _root.tpower * 50;
} else {
_root.enough.play();
}
} else if (selected == 7) {
if ((_root.money >= maxhealthup) && (_root.maxhealth < 200)) {
_root.money = _root.money - maxhealthup;
_root.maxlife = _root.maxlife + 30;
} else {
_root.enough.play();
}
}
}
stop();
tackle = _root.tpower * 50;
speed = _root.spower * 50;
moneyupgrade = 100;
lifeup = 50;
maxhealthup = 100;
jetpack = 250;
fuel = 30;
selected = 0;
onEnterFrame = function () {
notenough.moneytxt.text = "$: " + _root.money;
notenough.t1.text = "$: " + speed;
notenough.t2.text = "$: " + jetpack;
notenough.t3.text = "$: " + fuel;
notenough.t4.text = "$: " + lifeup;
notenough.t5.text = "$: " + moneyupgrade;
notenough.t6.text = "$: " + tackle;
notenough.t7.text = "$: " + maxhealthup;
};
stop();
Frame 8
stop();
txt.text = _root.score;
Frame 9
stop();
Symbol 18 MovieClip [edd] Frame 1
head.setMask(mask);
onEnterFrame = function () {
if (this.num < _root.lives) {
this.mask._y = -40;
} else if (this.num == _root.lives) {
this.mask._y = -102 + (62 * (_root.life / _root.maxlife));
} else {
this.mask._y = -102;
}
};
Symbol 22 MovieClip Frame 1
this.done = false;
Symbol 29 MovieClip [houses] Frame 1
stop();
_root.master.props.push(this);
_root.master.houses.push(this);
this.startx = this._x + _root.master.worldx;
rand = Math.round((Math.random() * 4) + 1);
if (rand != 1) {
}
Symbol 29 MovieClip [houses] Frame 2
stop();
Symbol 29 MovieClip [houses] Frame 3
stop();
Symbol 29 MovieClip [houses] Frame 4
stop();
Symbol 84 MovieClip Frame 3
present = new Sound(_root);
present.attachSound("presentgive");
present.start(0, 0);
Symbol 84 MovieClip Frame 17
this._parent.dropping = false;
Symbol 104 MovieClip Frame 14
this._parent.hit = false;
Symbol 124 MovieClip Frame 10
this._parent.tackling = false;
Symbol 148 MovieClip [player] Frame 1
stop();
Symbol 148 MovieClip [player] Frame 2
stop();
Symbol 148 MovieClip [player] Frame 3
stop();
Symbol 148 MovieClip [player] Frame 4
stop();
Symbol 148 MovieClip [player] Frame 5
stop();
Symbol 148 MovieClip [player] Frame 6
stop();
Symbol 148 MovieClip [player] Frame 7
stop();
Symbol 149 MovieClip [master] Frame 1
props = new Array();
houses = new Array();
enemies = new Array();
money = new Array();
presents = new Array();
madeHouses = new Array();
spare = 2;
goal = _root.level * 5;
given = 0;
giftsleft = (_root.level * 5) + spare;
gtext = "";
min = 0;
sec = _root.startsec;
time = "0:00";
checkRate = 30;
checkCounter = checkRate;
startTime = getTimer();
checkCounter--;
secs = "00";
fps = 30;
movespeed = 9;
worldx = 0;
onEnterFrame = function () {
_root.moneytxt.txt.text = "$" + _root.money;
if (houses[houses.length - 1]._x > -800) {
_root.makeHouse();
}
if (houses[0]._x > 1600) {
houses[0].cat.removeMovieClip();
houses[0].removeMovieClip();
houses.splice(0, 1);
}
if (worldx > (((houses[1]._x + houses[1]._width) + houses[1].startx) + 440)) {
worldx = ((houses[1]._x + houses[1]._width) + houses[1].startx) + 440;
_root.wrongway.play();
}
if (checkCounter == 0) {
fps = Math.floor(checkRate / ((getTimer() - startTime) / 1000));
startTime = getTimer();
checkCounter = checkRate;
}
sec = sec - (1 / fps);
if (giftsleft == 0) {
if (given >= (goal * 0.8)) {
_root.nextLevel();
} else {
_root.notEnoughDeliveries();
}
}
if ((Math.round(sec) == 0) && (min == 0)) {
if (given >= (goal * 0.8)) {
_root.nextLevel();
} else {
_root.notEnoughDeliveries();
}
} else {
if (sec == 0) {
sec = 60;
min--;
}
if (sec < 10) {
secs = "0" + Math.round(sec);
} else {
secs = Math.round(sec);
}
time = (min + ":") + secs;
_root.timer.txt.text = time;
if (giftsleft < 10) {
gtext = "0" + giftsleft;
} else {
gtext = giftsleft;
}
_root.gifts.txt.text = gtext;
i = 0;
while (i < props.length) {
props[i]._x = props[i].startx - worldx;
i++;
}
}
};
Symbol 185 MovieClip Frame 10
this._parent.hit = false;
Symbol 203 MovieClip Frame 19
onEnterFrame = function () {
this._parent.startx = this._parent.startx + (this._parent.dir * 31.4285714285714);
};
Symbol 203 MovieClip Frame 26
delete onEnterFrame;
this._parent.hitting = false;
Symbol 209 MovieClip Frame 1
fallsound = new Sound(_root);
fallsound.attachSound("fall");
fallsound.start(0, 0);
Symbol 209 MovieClip Frame 6
this.stop();
sc = 100 + (50 * _root.level);
_root.score = _root.score + sc;
_root.levelscore = _root.levelscore + sc;
if ((Math.random() * 100) > 50) {
_root.spewPresent(this._parent.houseOn._x + (this._parent.houseOn._width / 2), this._parent.houseOn._y + this._parent.houseOn.hit._y);
}
_root.spewMoney(this._parent.houseOn._x + (this._parent.houseOn._width / 2), this._parent.houseOn._y + this._parent.houseOn.hit._y);
Symbol 210 MovieClip [enemycat] Frame 1
function resetValues(who) {
who.running = false;
who.hit = false;
who.hitting = false;
who.xvel = 0;
who.yvel = 0;
who.onGround = false;
rand = Math.random();
if (rand > 0.5) {
who.dir = 1;
} else {
who.dir = -1;
}
who.houseOn = null;
who.speed = 5;
who.gravity = 2;
who.dealthit = false;
who.wait = 0;
who.limit = 24;
who.move = false;
who.hitdir = 1;
who.patrolling = false;
}
this._xscale = this._xscale * 0.45;
this._yscale = this._yscale * 0.45;
resetValues(this);
onEnterFrame = function () {
this.xvel = 0;
if (this.houseOn == null) {
i = 0;
while (i < _root.master.houses.length) {
if (this.hitTest(_root.master.houses[i])) {
this.houseOn = _root.master.houses[i];
break;
}
i++;
}
}
this.onGround = false;
if (this.hitTest(this.houseOn.hit)) {
if (this.houseOn.hit.hitTest(this._x, this._y, false) && (this._y >= this.houseOn._y)) {
this.onGround = true;
}
}
if ((!this.hit) && (!this.onGround)) {
if ((this._x + 35) > ((this.houseOn._x + this.houseOn.hit._x) + this.houseOn.hit._width)) {
this.startx = ((this.houseOn.startx + this.houseOn.hit._x) + this.houseOn.hit._width) - 30;
this._y = this.houseOn._y + this.houseOn.hit._y;
this.onGround = true;
delete this.guy.onEnterFrame;
this.hitting = false;
} else if (this._x < (this.houseOn._x + this.houseOn.hit._x)) {
this.startx = (this.houseOn.startx + this.houseOn.hit._x) + 30;
this._y = this.houseOn._y + this.houseOn.hit._y;
delete this.guy.onEnterFrame;
this.hitting = false;
} else if (((this._x + 35) > (this.houseOn._x + this.houseOn.hit._x)) && (this._x < ((this.houseOn._x + this.houseOn.hit._x) + this.houseOn.hit._width))) {
this.onGround = true;
}
}
if (!this.onGround) {
this.gotoAndStop("fall");
this.yvel = this.yvel + this.gravity;
this._y = this._y + this.yvel;
} else {
if (_root.player.houseOn == this.houseOn) {
if (Math.abs(this._x - _root.player._x) > 20) {
this.move = true;
if (_root.player._x > this._x) {
this.dir = 1;
} else {
this.dir = -1;
}
} else {
this.move = false;
}
this.running = this.move;
outofrange = _root.player._y > (_root.player.houseOn._y + _root.player.houseOn.hit._y);
if (outofrange) {
this.running = false;
}
if ((_root.player.onGround && (!_root.player.onChimney)) && (!outofrange)) {
this.wait++;
if (Math.abs(this._x - _root.player._x) < 350) {
if ((this.wait > this.limit) && (!this.hitting)) {
this.wait = 0;
this.dealthit = false;
this.running = false;
this.hitting = true;
}
}
}
} else {
delete this.guy.onEnterFrame;
this.hitting = false;
this.running = false;
this.patrolling = true;
}
if (this.hit) {
this.startx = this.startx + ((-this.hitdir) * ((this.speed * 3) + (_root.tpower * 6)));
delete this.guy.onEnterFrame;
this.hitting = false;
this.gotoAndStop("gothit");
} else if (this.hitting) {
this.xvel = 0;
this.gotoAndStop("hit");
if (this.hitTest(_root.player) && (!this.dealthit)) {
_root.life = _root.life - 4;
this.dealthit = true;
rand = Math.round(Math.random() + 1);
_root["punch" + rand].start(0, 0);
delete this.guy.onEnterFrame;
_root.dropPresent();
this.hitting = false;
_root.player.hit = true;
_root.player.hitdir = this.dir;
}
} else if ((this.running && (!_root.player.onChimney)) && (this.move)) {
this.gotoAndStop("run");
this.xvel = this.speed * this.dir;
this.startx = this.startx + this.xvel;
} else if (this.patrolling) {
this.gotoAndStop("run");
this.xvel = this.speed * this.dir;
this.startx = this.startx + this.xvel;
if (this._x > (((this.houseOn._x + this.houseOn.hit._width) + this.houseOn.hit._x) - 60)) {
this.dir = -1;
} else if (this._x < ((this.houseOn._x + this.houseOn.hit._x) + 60)) {
this.dir = 1;
}
} else {
this.gotoAndStop("idle");
}
}
this._xscale = (-this.dir) * Math.abs(this._xscale);
};
this.startx = this._x;
this.starty = this._y;
_root.master.enemies.push(this);
_root.master.props.push(this);
Symbol 210 MovieClip [enemycat] Frame 2
stop();
Symbol 210 MovieClip [enemycat] Frame 3
stop();
Symbol 210 MovieClip [enemycat] Frame 4
stop();
Symbol 210 MovieClip [enemycat] Frame 5
stop();
Symbol 210 MovieClip [enemycat] Frame 6
this._parent.removeMovieClip();
Symbol 213 MovieClip [leveltell] Frame 1
filter = new flash.filters.GlowFilter(0, 0.1, 16, 16, 0, 3, false, false);
this.filters = new Array(filter);
starty = this._y;
speed = 1;
onEnterFrame = function () {
if (this._alpha > 0) {
this._y = this._y - speed;
this._alpha = this._alpha - (100 / (starty / speed));
} else {
this.removeMovieClip();
}
};
Symbol 218 MovieClip [wrongway] Frame 1
stop();
Symbol 220 MovieClip [money] Frame 1
if (Math.random() > 0.4) {
xvel = 1;
} else {
xvel = -1;
}
yvel = -((Math.random() * 5) + 5);
gravity = 0.8;
speed = 3;
_root.master.props.push(this);
_root.master.money.push(this);
this.startx = this._x + _root.master.worldx;
onEnterFrame = function () {
this.startx = this.startx + (this.xvel * speed);
this._y = this._y + this.yvel;
this.yvel = this.yvel + gravity;
if (this._y > this.starty) {
this.yvel = this.yvel * -0.8;
}
};
Symbol 224 MovieClip [moneytxt] Frame 1
onEnterFrame = function () {
this.scoretxt.text = _root.score;
};
Symbol 238 MovieClip Frame 1
sound = new Sound(_root);
sound.attachSound("bird");
sound.start(0, 0);
Symbol 238 MovieClip Frame 33
this._parent.ready = true;
Symbol 250 MovieClip Frame 12
this._parent.pecking = false;
Symbol 260 MovieClip Frame 1
sound = new Sound(_root);
sound.attachSound("bird");
sound.start(0, 0);
Symbol 260 MovieClip Frame 13
_root.spewMoney(this._parent.houseOn._x + (this._parent.houseOn._width / 2), (this._parent.houseOn._y + this._parent.houseOn.hit._y) - 10);
sc = 50 + (20 * _root.level);
_root.score = _root.score + sc;
_root.levelscore = _root.levelscore + sc;
this._parent.removeMovieClip();
Symbol 261 MovieClip [crow] Frame 1
stop();
pecking = false;
dead = false;
wait = 0;
limit = 24;
dealthit = false;
ready = false;
onEnterFrame = function () {
if (this.ready) {
if (_root.player.houseOn == this.houseOn) {
inrange = ((_root.player.jumping || (_root.player.onChimney)) && (Math.abs(_root.player._x - this._x) < 100)) && (_root.player.yvel <= 0);
if (inrange) {
this.wait++;
if (this.wait > this.limit) {
this.dealthit = false;
this.wait = 0;
this.pecking = true;
}
}
}
}
if (!this.ready) {
if (_root.player.houseOn == this.houseOn) {
this.gotoAndStop("circle");
}
} else if (this.dead) {
this.gotoAndStop("dead");
} else if (this.pecking) {
this.gotoAndStop("peck");
if (!this.dealthit) {
if (this.hitTest(_root.player)) {
_root.life = _root.life - 6;
this.dealthit = true;
_root.dropPresent();
}
}
} else {
this.gotoAndStop("idle");
}
};
this.startx = this._x;
this.starty = this._y;
_root.master.props.push(this);
Symbol 261 MovieClip [crow] Frame 2
stop();
Symbol 261 MovieClip [crow] Frame 3
stop();
Symbol 261 MovieClip [crow] Frame 4
stop();
Symbol 261 MovieClip [crow] Frame 5
stop();
Symbol 269 Button
on (release) {
stopAllSounds();
_root.gotoAndStop("game");
}
Symbol 273 Button
on (release) {
_root.gotoAndStop("instructions");
}
Symbol 277 Button
on (release) {
getURL ("http://www.freegamesjungle.com", "_blank");
}
Symbol 292 Button
on (release) {
getURL ("http://www.freegamesjungle.com", "_blank");
}
Symbol 298 MovieClip Frame 1
this._visible = false;
fuel.setMask(mask);
onEnterFrame = function () {
if (_root.curfuel < 0) {
_root.curfuel = 0;
}
mask._y = 4.5 + (57.3 - (57.3 * (_root.curfuel / _root.maxfuel)));
};
Symbol 312 Button
on (release) {
_root.gotoAndStop("workshop");
}
Symbol 330 Button
on (release) {
_root.gotoAndStop("main");
}
Symbol 342 Button
on (release) {
_root.gotoAndStop("main");
}
Symbol 345 Button
on (release) {
_root.restarted = false;
_root.gotoAndStop("game");
}
Symbol 355 MovieClip Frame 1
deadcat = new Sound(this);
deadcat.attachSound("deadcat");
deadcat.start(0, 0);
deadcat.onSoundComplete = function () {
bgmusic = new Sound(_root);
bgmusic.attachSound("dominant");
bgmusic.start(0, 999);
};
onEnterFrame = function () {
i = 0;
while (i < _root.master.houses.length) {
_root.master.houses[i]._y = _root.master.houses[i]._y + 10;
_root.master.houses[i].crow._y = _root.master.houses[i].crow._y + 10;
_root.master.houses[i].cat._y = _root.master.houses[i].cat._y + 10;
i++;
}
i = 0;
while (i < _root.master.money.length) {
_root.master.money[i]._y = _root.master.money[i]._y + 10;
_root.master.money[i].starty = _root.master.money[i].starty + 10;
i++;
}
i = 0;
while (i < _root.master.presents.length) {
_root.master.presents[i]._y = _root.master.presents[i]._y + 10;
_root.master.presents[i].starty = _root.master.presents[i].starty + 10;
i++;
}
_root.player._y = _root.player._y + 10;
};
Symbol 355 MovieClip Frame 40
_root.cleanUp();
delete onEnterFrame;
Symbol 355 MovieClip Frame 109
_root.CreateLevel();
_root.gotoAndStop("game");
Symbol 368 Button
on (release) {
_root.selected = 1;
_root.Buy();
}
Symbol 370 Button
on (release) {
_root.selected = 2;
_root.Buy();
}
Symbol 372 Button
on (release) {
_root.selected = 3;
_root.Buy();
}
Symbol 374 Button
on (release) {
_root.selected = 4;
_root.Buy();
}
Symbol 376 Button
on (release) {
_root.selected = 5;
_root.Buy();
}
Symbol 378 Button
on (release) {
_root.selected = 6;
_root.Buy();
}
Symbol 380 Button
on (release) {
_root.selected = 7;
_root.Buy();
}
Symbol 383 Button
on (release) {
_root.restarted = false;
delete _root.onEnterFrame;
_root.gotoAndStop("game");
}
Symbol 391 MovieClip Frame 1
stop();
Symbol 406 Button
on (release) {
nextFrame();
gotoAndPlay;
}
Symbol 416 Button
on (release) {
stopAllSounds();
_root.gotoAndStop("game");
}
Symbol 417 MovieClip Frame 1
stop();