Frame 1
Stage.showMenu = false;
stop();
LOADED = 0;
onEnterFrame = function () {
LOADED = _root.getBytesLoaded() / _root.getBytesTotal();
wantX = LOADED * 380;
baby._x = baby._x + ((wantX - baby._x) * 0.25);
baby._rotation = baby._x * 4;
};
Frame 2
_root.WIDTH = 400;
_root.HEIGHT = 300;
_root.FPS = 24;
Input = new Object();
Input.DEPTH = 10;
Input.INSTANCE_NAME = "INSTANCE_input";
Input.INSTANCE = 0;
Cam = new Object();
Cam.DEPTH = 11;
Cam.INSTANCE_NAME = "INSTANCE_cam";
Cam.INSTANCE = 0;
Ground = new Object();
Ground.DEPTH = 1000;
Ground.INSTANCE_NAME = "INSTANCE_ground";
Ground.INSTANCE = 0;
Britney = new Object();
Britney.DEPTH = 10000;
Britney.IDENTIFIER = "ID_britney";
Britney.INSTANCE_NAME = "INSTANCE_britney";
Britney.INSTANCE = 0;
Helicopter = new Object();
Helicopter.DEPTH = 10001;
Helicopter.IDENTIFIER = "ID_helicopter";
Helicopter.INSTANCE_NAME = "INSTANCE_helicopter";
Helicopter.INSTANCE = 0;
Trex = new Object();
Trex.DEPTH = 10002;
Trex.IDENTIFIER = "ID_trex";
Trex.INSTANCE_NAME = "INSTANCE_trex";
Trex.INSTANCE = 0;
Baby = new Object();
Baby.DEPTH = 30001;
Baby.IDENTIFIER = "ID_baby";
Baby.INSTANCE_NAME = "INSTANCE_baby";
Baby.INSTANCE = 0;
HUD = new Object();
HUD.DEPTH = 99999 /* 0x01869F */;
HUD.IDENTIFIER = "ID_HUD";
HUD.INSTANCE_NAME = "INSTANCE_hud";
HUD.INSTANCE = 0;
Daipers = new Object();
Daipers.DEPTH_INITIAL = 19000;
Daipers.DEPTH_MAX = 19999;
Daipers.INSTANCE_NAME = "INSTANCE_daiper";
Daipers.IDENTIFIER = "ID_daiper";
Daipers.INSTANCES = new Array();
Baddy1 = new Object();
Baddy1.DEPTH_INITIAL = 18000;
Baddy1.DEPTH_MAX = 18999;
Baddy1.INSTANCE_NAME = "INSTANCE_baddy1_";
Baddy1.IDENTIFIER = "ID_baddy1";
Baddy1.INSTANCES = new Array();
Baddy2 = new Object();
Baddy2.DEPTH_INITIAL = 17000;
Baddy2.DEPTH_MAX = 17999;
Baddy2.INSTANCE_NAME = "INSTANCE_baddy2_";
Baddy2.IDENTIFIER = "ID_baddy2";
Baddy2.INSTANCES = new Array();
Truck = new Object();
Truck.DEPTH_INITIAL = 16000;
Truck.DEPTH_MAX = 16999;
Truck.INSTANCE_NAME = "INSTANCE_truck";
Truck.IDENTIFIER = "ID_truck";
Truck.INSTANCES = new Array();
Missile = new Object();
Missile.DEPTH_INITIAL = 15000;
Missile.DEPTH_MAX = 15999;
Missile.INSTANCE_NAME = "INSTANCE_missile";
Missile.IDENTIFIER = "ID_missile";
Missile.INSTANCES = new Array();
Mine = new Object();
Mine.DEPTH_INITIAL = 14000;
Mine.DEPTH_MAX = 14999;
Mine.INSTANCE_NAME = "INSTANCE_mine";
Mine.IDENTIFIER = "ID_mine";
Mine.INSTANCES = new Array();
Particle = new Object();
Particle.DEPTH_INITIAL = 20000;
Particle.DEPTH_MAX = 20999;
Particle.INSTANCE_NAME = "INSTANCE_particle";
Particle.IDENTIFIER = "ID_particle";
Particle.INSTANCES = new Array();
_root.createEmptyMovieClip("Music", 2);
MC_Position = function (PTR, X, Y) {
PTR._x = X;
PTR._y = Y;
};
MC_Displace = function (PTR, DX, DY) {
PTR._x = PTR._x + DX;
PTR._y = PTR._y + DY;
};
MC_Blur = function (MC, X, Y) {
MC.filters = [new flash.filters.BlurFilter(Math.abs(X / 2), Math.abs(Y / 2), 1)];
};
Input.Init = function () {
this.KEY_UP = 38;
this.KEY_RIGHT = 39;
this.KEY_DOWN = 40;
this.KEY_LEFT = 37;
this.KEY_ACTION1 = 83;
this.KEY_ACTION2 = 68;
this.KEY_ACTION3 = 65;
this.PRESS_LEFT = false;
this.PRESS_RIGHT = false;
this.PRESS_UP = false;
this.PRESS_DOWN = false;
this.PRESS_ACTION1 = false;
this.PRESS_ACTION2 = false;
this.PRESS_ACTION3 = false;
this.PRESS_LEFT_RESETABLE = false;
this.PRESS_RIGHT_RESETABLE = false;
this.PRESS_UP_RESETABLE = false;
this.PRESS_DOWN_RESETABLE = false;
this.PRESS_ACTION1_RESETABLE = false;
this.PRESS_ACTION2_RESETABLE = false;
this.PRESS_ACTION3_RESETABLE = false;
this.HOLD_LEFT = false;
this.HOLD_RIGHT = false;
this.HOLD_UP = false;
this.HOLD_DOWN = false;
this.HOLD_ACTION1 = false;
this.HOLD_ACTION2 = false;
this.HOLD_ACTION3 = false;
_root.createEmptyMovieClip(this.INSTANCE_NAME, this.DEPTH);
this.INSTANCE = _root[this.INSTANCE_NAME];
this.INSTANCE.onEnterFrame = function () {
Input.Update();
};
};
Input.Update = function () {
if (Key.isDown(this.KEY_ACTION1)) {
this.HOLD_ACTION1 = true;
} else {
this.HOLD_ACTION1 = false;
}
if (Key.isDown(this.KEY_ACTION2)) {
this.HOLD_ACTION2 = true;
} else {
this.HOLD_ACTION2 = false;
}
if (Key.isDown(this.KEY_ACTION3)) {
this.HOLD_ACTION3 = true;
} else {
this.HOLD_ACTION3 = false;
}
if (Key.isDown(this.KEY_DOWN)) {
this.HOLD_DOWN = true;
} else {
this.HOLD_DOWN = false;
}
if (Key.isDown(this.KEY_UP)) {
this.HOLD_UP = true;
} else {
this.HOLD_UP = false;
}
if (Key.isDown(this.KEY_LEFT)) {
this.HOLD_LEFT = true;
} else {
this.HOLD_LEFT = false;
}
if (Key.isDown(this.KEY_RIGHT)) {
this.HOLD_RIGHT = true;
} else {
this.HOLD_RIGHT = false;
}
if (this.HOLD_ACTION1 && (this.PRESS_ACTION1_RESETABLE)) {
this.PRESS_ACTION1 = true;
this.PRESS_ACTION1_RESETABLE = false;
} else {
this.PRESS_ACTION1 = false;
}
if (!this.HOLD_ACTION1) {
this.PRESS_ACTION1_RESETABLE = true;
}
if (this.HOLD_ACTION2 && (this.PRESS_ACTION2_RESETABLE)) {
this.PRESS_ACTION2 = true;
this.PRESS_ACTION2_RESETABLE = false;
} else {
this.PRESS_ACTION2 = false;
}
if (!this.HOLD_ACTION2) {
this.PRESS_ACTION2_RESETABLE = true;
}
if (this.HOLD_ACTION3 && (this.PRESS_ACTION3_RESETABLE)) {
this.PRESS_ACTION3 = true;
this.PRESS_ACTION3_RESETABLE = false;
} else {
this.PRESS_ACTION3 = false;
}
if (!this.HOLD_ACTION3) {
this.PRESS_ACTION3_RESETABLE = true;
}
if (this.HOLD_UP && (this.PRESS_UP_RESETABLE)) {
this.PRESS_UP = true;
this.PRESS_UP_RESETABLE = false;
} else {
this.PRESS_UP = false;
}
if (!this.HOLD_UP) {
this.PRESS_UP_RESETABLE = true;
}
if (this.HOLD_DOWN && (this.PRESS_DOWN_RESETABLE)) {
this.PRESS_DOWN = true;
this.PRESS_DOWN_RESETABLE = false;
} else {
this.PRESS_DOWN = false;
}
if (!this.HOLD_DOWN) {
this.PRESS_DOWN_RESETABLE = true;
}
if (this.HOLD_LEFT && (this.PRESS_LEFT_RESETABLE)) {
this.PRESS_LEFT = true;
this.PRESS_LEFT_RESETABLE = false;
} else {
this.PRESS_LEFT = false;
}
if (!this.HOLD_LEFT) {
this.PRESS_LEFT_RESETABLE = true;
}
if (this.HOLD_RIGHT && (this.PRESS_RIGHT_RESETABLE)) {
this.PRESS_RIGHT = true;
this.PRESS_RIGHT_RESETABLE = false;
} else {
this.PRESS_RIGHT = false;
}
if (!this.HOLD_RIGHT) {
this.PRESS_RIGHT_RESETABLE = true;
}
};
Input.Remove = function () {
if (this.INSTANCE != 0) {
this.INSTANCE.removeMovieClip();
this.INSTANCE = 0;
}
};
Cam.Init = function () {
_root.createEmptyMovieClip(this.INSTANCE_NAME, this.DEPTH);
_root.attachMovie("ID_BG", "BG", this.DEPTH + 1);
this.INSTANCE = _root[this.INSTANCE_NAME];
this.focus = 0;
this.enable = true;
this.INSTANCE.onEnterFrame = function () {
Cam.Update();
};
};
Cam.Update = function () {
if (this.enable) {
if (this.focus == 0) {
_x = int(_x * 0.5);
} else {
this.wantX = (-this.focus._x) + (WIDTH / 2);
this.wantX = this.wantX - (this.focus._xscale * 0.5);
this.dX = this.wantX - _x;
_x = (_x + int(this.dX * 0.1));
if (_x > 0) {
_x = 0;
}
if (_x < (WIDTH - Ground.Width)) {
_x = (WIDTH - Ground.Width);
}
}
percent = (-_x) / (Ground.Width - WIDTH);
BG._x = (-_x) - (WIDTH * percent);
if (popup) {
popup._x = -_x;
}
if (transition) {
transition._x = -_x;
}
if (HUD.INSTANCE != 0) {
HUD.INSTANCE._x = -_x;
}
}
};
Cam.Target = function (MC) {
this.focus = MC;
};
Cam.Remove = function () {
if (this.INSTANCE != 0) {
this.INSTANCE.removeMovieClip();
this.INSTANCE = 0;
}
};
Transition = function () {
Music.End();
_root.attachMovie("ID_fadeOut", "transition", 100000);
transition._x = -_x;
};
FadeIn = function () {
To();
Music.Begin();
_root.attachMovie("ID_fadeIn", "transition", 100000);
transition._x = -_x;
};
Ground.Init = function () {
this.WobbleMagnitude = 2.5;
this.WobbleSpeed = 0.3;
this.dX = 20;
this.GroundColor = 10053205 /* 0x996655 */;
this.GrassColor = 5946989 /* 0x5ABE6D */;
this.animating = false;
this.Width = 0;
Ground.grounds = new Array();
tempMaps = new Array();
tempMaps[0] = new Array(275, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 275);
tempMaps[1] = new Array(275, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 275);
tempMaps[2] = new Array(275, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 275);
tempMaps[3] = new Array(275, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 275);
tempMaps[4] = new Array(275, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 275);
tempMaps[5] = new Array(250, 250, 250, 250, 250, 265, 265, 265, 265, 265, 265, 265, 265, 265, 250, 250, 250, 250, 250, 250, 275, 275, 275, 275, 275, 275, 275, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 275);
tempMaps[6] = new Array(250, 250, 250, 250, 250, 265, 265, 265, 265, 265, 265, 265, 265, 265, 250, 250, 250, 250, 250, 250, 275, 275, 275, 275, 275, 275, 275, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 275, 275, 275, 275, 275, 275, 275, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 275);
tempMaps[7] = new Array(250, 250, 250, 250, 250, 265, 265, 265, 265, 265, 265, 265, 265, 265, 250, 250, 250, 250, 250, 250, 275, 275, 275, 275, 275, 275, 275, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 275, 275, 275, 275, 275, 275, 275, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 275);
tempMaps[8] = new Array(275, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 275, 275, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 275, 275, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 275, 275, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 275);
tempMaps[9] = new Array(275, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 275);
i = 0;
while (i < tempMaps.length) {
this.grounds[i] = new Array();
j = 0;
while (j < tempMaps[i].length) {
this.grounds[i][j] = new Object();
this.grounds[i][j].Y = tempMaps[i][j];
this.grounds[i][j].theta = random(628) * 0.01;
this.grounds[i][j]._y = (Y = this.grounds[i][j].Y + (Math.sin(this.grounds[i][j].theta) * this.WobbleMagnitude));
j++;
}
i++;
}
delete tempMaps;
_root.createEmptyMovieClip(this.INSTANCE_NAME, this.DEPTH);
this.INSTANCE = _root[this.INSTANCE_NAME];
};
Ground.Select = function (INDEX) {
this.selectedMap = INDEX;
this.CurrentMap = this.grounds[INDEX];
this.Redraw();
this.Width = (this.CurrentMap.length - 1) * this.dX;
};
Ground.Redraw = function () {
this.INSTANCE.clear();
this.INSTANCE.beginFill(this.GroundColor, 100);
this.INSTANCE.moveTo(0, _root.HEIGHT);
i = 0;
while (i < this.CurrentMap.length) {
this.INSTANCE.lineTo(i * this.dX, this.CurrentMap[i]._y);
i++;
}
i--;
this.INSTANCE.lineTo(i * this.dX, _root.HEIGHT);
this.INSTANCE.lineTo(0, _root.HEIGHT);
this.INSTANCE.beginFill(this.GrassColor, 100);
this.INSTANCE.moveTo(0, this.CurrentMap[0]._y + 10);
i = 0;
while (i < this.CurrentMap.length) {
this.INSTANCE.lineTo(i * this.dX, this.CurrentMap[i]._y);
i++;
}
i = this.CurrentMap.length - 1;
while (i > 0) {
this.INSTANCE.lineTo(i * this.dX, (this.CurrentMap[i]._y + 10) + ((i % 2) * 10));
i--;
}
};
Ground.Step = function () {
i = 0;
while (i < this.CurrentMap.length) {
this.CurrentMap[i].theta = this.CurrentMap[i].theta + this.WobbleSpeed;
this.CurrentMap[i]._y = this.CurrentMap[i].Y + (Math.sin(this.CurrentMap[i].theta) * this.WobbleMagnitude);
i++;
}
this.Redraw();
MC_Blur(this.INSTANCE, random(5), random(5));
};
Ground.RedrawFull = function () {
if (Baby.INSTANCE.state == "ground") {
Baby.INSTANCE.state = "air";
}
i = 0;
while (i < this.CurrentMap.length) {
if (this.CurrentMap[i].Y > HEIGHT) {
this.CurrentMap[i].Y = HEIGHT;
}
this.CurrentMap[i]._y = this.CurrentMap[i].Y + (Math.sin(this.CurrentMap[i].theta) * this.WobbleMagnitude);
i++;
}
this.Redraw();
};
Ground.BeginAnimation = function () {
this.animating = true;
this.INSTANCE.onEnterFrame = function () {
Ground.Step();
};
};
Ground.EndAnimation = function () {
this.animating = false;
this.INSTANCE.onEnterFrame = null;
this.INSTANCE.filters = 0;
};
Ground.HeightAt = function (X) {
if (X < 0) {
return(this.CurrentMap[0]._y);
}
if (X >= ((this.CurrentMap.length - 1) * this.dX)) {
return(this.CurrentMap[this.CurrentMap.length - 1]._y);
}
i = int(X / this.dX);
t = (X % this.dX) / this.dX;
Y0 = this.CurrentMap[i]._y;
Y1 = this.CurrentMap[i + 1]._y;
return(Y0 + (t * (Y1 - Y0)));
};
Ground.AngleAt = function (X) {
if ((X < 0) || (X >= ((this.CurrentMap.length - 1) * this.dX))) {
return(0);
}
i = int(X / this.dX);
Y0 = this.CurrentMap[i]._y;
Y1 = this.CurrentMap[i + 1]._y;
dY = Y1 - Y0;
return(Math.atan2(dY, this.dX));
};
Ground.SlopeAt = function (X) {
if ((X < 0) || (X >= ((this.CurrentMap.length - 1) * this.dX))) {
return(0);
}
i = int(X / this.dX);
Y0 = this.CurrentMap[i]._y;
Y1 = this.CurrentMap[i + 1]._y;
dY = Y0 - Y1;
return(dY / this.dX);
};
Ground.SlopeInverseAt = function (X) {
if ((X < 0) || (X >= ((this.CurrentMap.length - 1) * this.dX))) {
return(0);
}
i = int(X / this.dX);
Y0 = this.CurrentMap[i]._y;
Y1 = this.CurrentMap[i + 1]._y;
dY = Y0 - Y1;
return(this.dX / dY);
};
Ground.Remove = function () {
if (this.INSTANCE != 0) {
this.animating = false;
this.Width = 0;
this.INSTANCE.removeMovieClip();
this.INSTANCE = 0;
}
};
Britney.Special = 0;
Britney.Spawn = function (X, Y) {
_root.attachMovie(this.IDENTIFIER, this.INSTANCE_NAME, this.DEPTH);
this.INSTANCE = _root[this.INSTANCE_NAME];
MC_Position(this.INSTANCE, X, Y);
this.INSTANCE.state = "air";
this.INSTANCE.xAccel = 2;
this.INSTANCE.throwStrength = 35;
this.INSTANCE.jumpSpeed = 15;
this.INSTANCE.gravity = 1.5;
this.INSTANCE.xSpeedMax = 6;
this.INSTANCE.xSpeed = 0;
this.INSTANCE.ySpeed = 0;
this.INSTANCE.wantR = 0;
this.INSTANCE.onEnterFrame = this.FSM;
this.INSTANCE.SpecialMusic = new Sound(this.INSTANCE);
this.INSTANCE.SpecialMusic.attachSound("Special.mp3");
this.INSTANCE.Walk = this.Walk;
this.INSTANCE.SnapToGround = this.SnapToGround;
this.INSTANCE.Jump = this.Jump;
this.INSTANCE.Fall = this.Fall;
this.INSTANCE.SlideHalfSpeed = this.SlideHalfSpeed;
this.INSTANCE.Land = this.Land;
this.INSTANCE.HandleBaby = this.HandleBaby;
this.INSTANCE.ThrowDaiper = this.ThrowDaiper;
this.INSTANCE.AnimateOnce = this.AnimateOnce;
this.INSTANCE.SpecialState = this.SpecialState;
this.INSTANCE.SpecialCounter = 0;
this.Drunk = false;
};
Britney.FSM = function () {
switch (this.state) {
case "stand" :
case "walk" :
this.Walk();
this.SnapToGround();
this.Jump();
this.HandleBaby();
this.ThrowDaiper();
this.SpecialState();
break;
case "air" :
this.Fall();
this.SlideHalfSpeed();
this.Land();
this.HandleBaby();
this.ThrowDaiper();
this.SpecialState();
break;
case "hurt" :
Particle.Spawn((this._x + random(40)) - 20, (this._y - random(20)) - 50, "blood");
this.AnimateOnce("air");
}
if (Britney.Drunk && (random(3) == 0)) {
Particle.Spawn(this._x, this._y - 50, "bubble");
}
if (Britney.Drunk) {
this.glow._visible = true;
} else {
this.glow._visible = false;
}
MC_Blur(this, this.xSpeed, this.ySpeed);
this._rotation = this._rotation + ((this.wantR - this._rotation) * 0.2);
this.gotoAndStop(this.state);
if (this._x < 0) {
this._x = 0;
}
if (this._x > Ground.Width) {
if (Baby.INSTANCE.holder == this) {
this.onEnterFrame = null;
PassLevel();
} else {
this._x = Ground.Width;
}
}
};
Britney.Walk = function () {
this.state = "stand";
if (Input.HOLD_RIGHT) {
this.xSpeed = this.xSpeed + this.xAccel;
this.state = "walk";
this._xscale = 100;
} else if ((!Input.HOLD_RIGHT) && (this.xSpeed > 0)) {
this.xSpeed = this.xSpeed - this.xAccel;
}
if (Input.HOLD_LEFT) {
this.xSpeed = this.xSpeed - this.xAccel;
this.state = "walk";
this._xscale = -100;
} else if ((!Input.HOLD_LEFT) && (this.xSpeed < 0)) {
this.xSpeed = this.xSpeed + this.xAccel;
}
if (this.xSpeed > this.xSpeedMax) {
this.xSpeed = this.xSpeedMax;
} else if (this.xSpeed < (-this.xSpeedMax)) {
this.xSpeed = -this.xSpeedMax;
}
this._x = this._x + this.xSpeed;
};
Britney.SnapToGround = function () {
this.ySpeed = Ground.HeightAt(this._x) - this._y;
this._y = this._y + this.ySpeed;
this.wantR = (Ground.AngleAt(this._x) * 140) / Math.PI;
};
Britney.Jump = function () {
if (Input.PRESS_ACTION3) {
this.state = "air";
this.ySpeed = -this.jumpSpeed;
}
};
Britney.Fall = function () {
this.ySpeed = this.ySpeed + this.gravity;
this._y = this._y + this.ySpeed;
};
Britney.SlideHalfSpeed = function () {
if (Input.HOLD_RIGHT) {
this.xSpeed = this.xSpeed + (this.xAccel / 2);
this._xscale = 100;
}
if (Input.HOLD_LEFT) {
this.xSpeed = this.xSpeed - (this.xAccel / 2);
this._xscale = -100;
}
if (this.xSpeed > this.xSpeedMax) {
this.xSpeed = this.xSpeedMax;
} else if (this.xSpeed < (-this.xSpeedMax)) {
this.xSpeed = -this.xSpeedMax;
}
this._x = this._x + this.xSpeed;
this.wantR = this.xSpeed * 2;
};
Britney.Land = function () {
if ((this.ySpeed > 0) && (this._y > Ground.HeightAt(this._x))) {
this._y = Ground.HeightAt(this._x);
this.xSpeed = 0;
this.ySpeed = 0;
this.state = "stand";
}
};
Britney.HandleBaby = function () {
if (Input.PRESS_ACTION1) {
if (Baby.INSTANCE.holder == this) {
if (!Britney.Drunk) {
Baby.INSTANCE.state = "air";
Baby.INSTANCE.holder = 0;
Baby.INSTANCE.ySpeed = this.throwStrength + this.ySpeed;
Baby.INSTANCE.xSpeed = this.xSpeed * 2;
}
} else if ((Baby.INSTANCE.holder == 0) && (this.hitTest(Baby.INSTANCE))) {
Baby.INSTANCE.state = "held";
Baby.INSTANCE.holder = this;
}
}
};
Britney.ThrowDaiper = function () {
if ((Input.PRESS_ACTION2 && ((Baby.INSTANCE.holder != this) || (Britney.Drunk))) || (Input.PRESS_ACTION1 && (Britney.Drunk))) {
if (Input.HOLD_UP) {
Daipers.Spawn(this._x, this._y - 20, (10 * this._xscale) / 100, -7);
} else if (Input.HOLD_DOWN) {
Daipers.Spawn(this._x, this._y - 20, (10 * this._xscale) / 100, 10);
} else {
Daipers.Spawn(this._x, this._y - 20, (14 * this._xscale) / 100, -2);
}
}
};
Britney.Remove = function () {
if (this.INSTANCE != 0) {
this.INSTANCE.SpecialMusic.stop();
this.INSTANCE.removeMovieClip();
this.INSTANCE = 0;
}
};
Britney.AnimateOnce = function (str) {
if ((this.sprite._currentframe > 0) && (this.sprite._currentframe == this.sprite._totalframes)) {
this.state = str;
}
};
Britney.HurtMe = function () {
if ((!Britney.Drunk) && (Baby.INSTANCE.holder == this.INSTANCE)) {
this.INSTANCE.state = "hurt";
Baby.INSTANCE.holder = 0;
Baby.INSTANCE.ySpeed = -5 - random(10);
Baby.INSTANCE.xSpeed = random(10) - 5;
this.INSTANCE.xSpeed = 0;
}
};
Britney.SpecialState = function () {
if (Britney.Drunk) {
this.SpecialCounter--;
if (this.SpecialCounter <= 0) {
Britney.EndSpecial();
}
BG.play();
}
};
Britney.BeginSpecial = function () {
this.INSTANCE.SpecialCounter = 100;
this.Drunk = true;
Ground.BeginAnimation();
this.INSTANCE.state = "air";
Baby.INSTANCE.state = "held";
Baby.INSTANCE.holder = _root.Britney.INSTANCE;
};
Britney.EndSpecial = function () {
Music.Begin();
this.Drunk = false;
this.INSTANCE.SpecialCounter = 0;
Ground.EndAnimation();
BG.gotoAndStop(1);
};
Britney.StartMusic = function () {
Britney.INSTANCE.SpecialMusic.stop();
Britney.INSTANCE.SpecialMusic.setVolume(100);
Britney.INSTANCE.SpecialMusic.start(0, 1);
};
Baby.Spawn = function (X, Y) {
_root.attachMovie(this.IDENTIFIER, this.INSTANCE_NAME, this.DEPTH);
this.INSTANCE = _root[this.INSTANCE_NAME];
MC_Position(this.INSTANCE, X, Y);
this.INSTANCE.bounceRatio = 0.5;
this.INSTANCE.gravity = 1;
this.INSTANCE.xSpeed = 0;
this.INSTANCE.ySpeed = 0;
this.INSTANCE.wantR = 0;
this.INSTANCE.holder = Britney.INSTANCE;
this.INSTANCE.state = "held";
this.INSTANCE.onEnterFrame = this.FSM;
this.INSTANCE.Follow = this.Follow;
this.INSTANCE.Air = this.Air;
this.INSTANCE.Bounce = this.Bounce;
};
Baby.FSM = function () {
switch (this.state) {
case "held" :
if (this.holder == 0) {
this.state = "air";
break;
}
this.Follow(this.holder);
break;
case "air" :
this.Air();
this.Bounce();
break;
case "ground" :
if (random(20) == 0) {
Helicopter.Spawn();
}
this.xSpeed = 0;
this.ySpeed = 0;
}
if (this.wantR > 180) {
this.wantR = 180;
}
if (this.wantR < -180) {
this.wantR = -180;
}
this._rotation = this._rotation + ((this.wantR - this._rotation) * 0.4);
MC_Blur(this, this.xSpeed, this.ySpeed);
this.gotoAndStop(this.state);
};
Baby.Follow = function (MC) {
this.xSpeed = (MC._x - this._x) * 0.5;
this.wantR = MC._rotation + (this.xSpeed * 2);
this.ySpeed = ((MC._y - 20) - this._y) * 0.5;
MC_Displace(this, this.xSpeed, this.ySpeed);
};
Baby.Air = function () {
this.wantR = this.wantR + this.xSpeed;
MC_Displace(this, this.xSpeed, this.ySpeed);
this.ySpeed = this.ySpeed + this.gravity;
if ((this.xSpeed < 0) && (this._x < 0)) {
this.xSpeed = this.xSpeed * -1;
this._x = 0;
} else if ((this.xSpeed > 0) && (this._x > Ground.Width)) {
this.xSpeed = this.xSpeed * -1;
this._x = Ground.Width;
}
};
Baby.Bounce = function () {
if ((this.ySpeed > 0) && ((this._y + 10) > Ground.HeightAt(this._x))) {
if (this.ySpeed < 10) {
this.state = "ground";
}
this._y = Ground.HeightAt(this._x) - 10;
this.ySpeed = this.ySpeed * (-this.bounceRatio);
this.xSpeed = this.xSpeed * this.bounceRatio;
}
};
Baby.Remove = function () {
if (this.INSTANCE != 0) {
this.INSTANCE.removeMovieClip();
this.INSTANCE = 0;
}
};
Daipers.Init = function () {
this.MaxInstances = 10;
this.rangeTimer = 60;
this.gravity = 0.3;
this.bounceRatio = 0.3;
i = 0;
while (i < this.MaxInstances) {
this.INSTANCES[i] = 0;
i++;
}
};
Daipers.Spawn = function (X, Y, XS, YS) {
D_i = 0;
while (D_i < this.MaxInstances) {
if (this.INSTANCES[D_i] == 0) {
_root.attachMovie(this.IDENTIFIER, this.INSTANCE_NAME + D_i, this.DEPTH_INITIAL + D_i);
this.INSTANCES[D_i] = _root[this.INSTANCE_NAME + D_i];
MC_Position(this.INSTANCES[D_i], X, Y);
this.INSTANCES[D_i].xSpeed = XS;
this.INSTANCES[D_i].ySpeed = YS;
this.INSTANCES[D_i].gravity = this.gravity;
this.INSTANCES[D_i].arrayIndex = D_i;
this.INSTANCES[D_i].rangeTimer = this.rangeTimer;
this.INSTANCES[D_i].bounceRatio = this.bounceRatio;
this.INSTANCES[D_i].state = "air";
this.INSTANCES[D_i].onEnterFrame = this.FSM;
this.INSTANCES[D_i].Range = this.Range;
this.INSTANCES[D_i].Bounce = this.Bounce;
this.INSTANCES[D_i].Hit = this.Hit;
return(undefined);
}
D_i++;
}
};
Daipers.RemoveDaiper = function (arrayIndex) {
this.INSTANCES[arrayIndex].removeMovieClip();
this.INSTANCES[arrayIndex] = 0;
};
Daipers.FSM = function () {
switch (this.state) {
case "air" :
MC_Displace(this, this.xSpeed, this.ySpeed);
this.Range();
this.Bounce();
this.ySpeed = this.ySpeed + this.gravity;
this._rotation = (Math.atan2(this.ySpeed, this.xSpeed) * 180) / Math.PI;
break;
case "ground" :
MC_Displace(this, this.xSpeed, this.ySpeed);
this.Range();
this.Bounce();
this.ySpeed = this.ySpeed + this.gravity;
break;
case "fade" :
this._alpha = this._alpha - 2;
MC_Displace(this, this.xSpeed, this.ySpeed);
if (this._alpha <= 5) {
Daipers.RemoveDaiper(this.arrayIndex);
}
case "bounceAway" :
this._alpha = this._alpha * 0.5;
this.ySpeed = this.ySpeed + this.gravity;
MC_Displace(this, this.xSpeed, this.ySpeed);
if (this._alpha <= 5) {
Daipers.RemoveDaiper(this.arrayIndex);
}
this._rotation = this._rotation + this.xSpeed;
}
MC_Blur(this, this.xSpeed, this.ySpeed);
};
Daipers.Range = function () {
this.rangeTimer--;
if (this.rangeTimer < 0) {
this.state = "fade";
}
};
Daipers.Bounce = function () {
if (this._y > Ground.HeightAt(this._x)) {
this.rangeTimer = this.rangeTimer - 2;
if (this.rangeTimer > 0) {
this.state = "ground";
}
this.ySpeed = 0;
this.xSpeed = this.xSpeed * this.bounceRatio;
this._y = Ground.HeightAt(this._x);
}
};
Daipers.Hit = function () {
this.xSpeed = this.xSpeed * -0.5;
this.ySpeed = -4;
this.state = "bounceAway";
};
Daipers.HitTest = function (MC) {
D_i = 0;
while (D_i < this.MaxInstances) {
if (((this.INSTANCES[D_i] != 0) && (this.INSTANCES[D_i].state == "air")) && (this.INSTANCES[D_i].hitTest(MC))) {
return(this.INSTANCES[D_i]);
}
D_i++;
}
return(null);
};
Daipers.RemoveAll = function () {
i = 0;
while (i < this.MaxInstances) {
if (this.INSTANCES[i] != 0) {
Daipers.RemoveDaiper(i);
}
i++;
}
};
Daipers.Init();
Baddy1.Init = function () {
this.MaxInstances = 15;
this.walkSpeed = 2;
this.jumpSpeed = 10;
this.HP = 3;
i = 0;
while (i < this.MaxInstances) {
this.INSTANCES[i] = 0;
i++;
}
};
Baddy1.Spawn = function (X, Y) {
B_i = 0;
while (B_i < this.MaxInstances) {
if (this.INSTANCES[B_i] == 0) {
_root.attachMovie(this.IDENTIFIER, this.INSTANCE_NAME + B_i, this.DEPTH_INITIAL + B_i);
this.INSTANCES[B_i] = _root[this.INSTANCE_NAME + B_i];
MC_Position(this.INSTANCES[B_i], X, Y);
this.INSTANCES[B_i].arrayIndex = B_i;
this.INSTANCES[B_i].walkSpeed = this.walkSpeed + (random(20) * 0.1);
this.INSTANCES[B_i].jumpSpeed = this.jumpSpeed;
this.INSTANCES[B_i].accel = 0.5 + (random(10) * 0.1);
this.INSTANCES[B_i].HP = this.HP;
if (X > Britney.INSTANCE._x) {
this.INSTANCES[B_i].xSpeed = -this.walkSpeed;
} else {
this.INSTANCES[B_i].xSpeed = this.walkSpeed;
}
this.INSTANCES[B_i].ySpeed = 0;
this.INSTANCES[B_i].wantR = 0;
this.INSTANCES[B_i].state = "chaseBritney";
this.INSTANCES[B_i].onEnterFrame = this.FSM;
this.INSTANCES[B_i].ChaseBritney = this.ChaseBritney;
this.INSTANCES[B_i].LookForBaby = this.LookForBaby;
this.INSTANCES[B_i].AnimateOnce = this.AnimateOnce;
this.INSTANCES[B_i].HitBritney = this.HitBritney;
this.INSTANCES[B_i].ChaseBaby = this.ChaseBaby;
this.INSTANCES[B_i].DaiperHit = this.DaiperHit;
this.INSTANCES[B_i].SlideAway = this.SlideAway;
this.INSTANCES[B_i].ThrowBaby = this.ThrowBaby;
this.INSTANCES[B_i].FadeAway = this.FadeAway;
this.INSTANCES[B_i].GrabBaby = this.GrabBaby;
this.INSTANCES[B_i].Stomp = this.Stomp;
this.INSTANCES[B_i].Fall = this.Fall;
this.INSTANCES[B_i].Die = this.Die;
this.INSTANCES[B_i].Hit = this.Hit;
return(undefined);
}
B_i++;
}
};
Baddy1.Remove = function (arrayIndex) {
this.INSTANCES[arrayIndex].removeMovieClip();
this.INSTANCES[arrayIndex] = 0;
};
Baddy1.FSM = function () {
switch (this.state) {
case "idle" :
this.LookForBaby();
this.DaiperHit();
break;
case "chaseBritney" :
this.ChaseBritney();
this.LookForBaby();
this.DaiperHit();
this.HitBritney();
break;
case "chaseBaby" :
this.ChaseBaby();
this.LookForBaby();
this.DaiperHit();
this.GrabBaby();
this.HitBritney();
break;
case "hold" :
this.DaiperHit();
this.ThrowBaby();
this.HitBritney();
break;
case "hit" :
this.AnimateOnce("chaseBritney");
this.SlideAway();
break;
case "stomp" :
this.FadeAway();
break;
case "dead" :
if (random(3) == 0) {
Particle.Spawn((this._x + random(40)) - 20, (this._y - random(20)) - 50, "blood");
}
this.Fall();
this.FadeAway();
}
this._rotation = this._rotation + ((this.wantR - this._rotation) * 0.4);
this.gotoAndStop(this.state);
MC_Blur(this, this.xSpeed, this.ySpeed);
if (this.xSpeed < 0) {
this._xscale = -100;
} else if (this.xSpeed > 0) {
this._xscale = 100;
}
};
Baddy1.ChaseBritney = function () {
this.ySpeed = Ground.HeightAt(this._x) - this._y;
MC_Displace(this, this.xSpeed, this.ySpeed);
if ((this._x < Britney.INSTANCE._x) && (this.xSpeed < this.walkSpeed)) {
this.xSpeed = this.xSpeed + this.accel;
} else if ((this._x > Britney.INSTANCE._x) && (this.xSpeed > (-this.walkSpeed))) {
this.xSpeed = this.xSpeed - this.accel;
}
this.wantR = (Ground.AngleAt(this._x) * 90) / Math.PI;
};
Baddy1.GrabBaby = function () {
if (((Baby.INSTANCE.holder == 0) && (Math.abs(Baby.INSTANCE.ySpeed) < 6)) && (Baby.INSTANCE.hitTest(this.hitBox))) {
Baby.INSTANCE.holder = this;
Baby.INSTANCE.state = "held";
this.state = "hold";
Helicopter.Spawn();
}
};
Baddy1.ThrowBaby = function () {
if (Math.abs(Helicopter.INSTANCE._x - this._x) < 75) {
Baby.INSTANCE.holder = 0;
Baby.INSTANCE.ySpeed = -17;
Baby.INSTANCE.xSpeed = random(10) - 5;
Baby.INSTANCE.state = "air";
this.state = "chaseBritney";
}
};
Baddy1.ChaseBaby = function () {
this.ySpeed = Ground.HeightAt(this._x) - this._y;
MC_Displace(this, this.xSpeed, this.ySpeed);
if ((this._x < Baby.INSTANCE._x) && (this.xSpeed < this.walkSpeed)) {
this.xSpeed = this.xSpeed + 0.5;
} else if ((this._x > Baby.INSTANCE._x) && (this.xSpeed > (-this.walkSpeed))) {
this.xSpeed = this.xSpeed - 0.5;
}
this.wantR = (Ground.AngleAt(this._x) * 90) / Math.PI;
};
Baddy1.HitBritney = function () {
if (this.hitBox.hitTest(Britney.INSTANCE.hitBox)) {
if (Britney.Drunk) {
this.state = "dead";
} else {
Britney.HurtMe();
}
if (this._x > Britney.INSTANCE._x) {
Britney.INSTANCE._x--;
Britney.INSTANCE.xSpeed = Britney.INSTANCE.xSpeed - 3;
this._x++;
this.xSpeed++;
} else {
Britney.INSTANCE._x++;
Britney.INSTANCE.xSpeed = Britney.INSTANCE.xSpeed + 3;
this._x--;
this.xSpeed--;
}
}
};
Baddy1.Stomp = function () {
if ((this.hitBox.hitTest(Britney.INSTANCE.hitBox) && (Britney.INSTANCE.state == "air")) && (Britney.INSTANCE.ySpeed > 0)) {
this.state = "stomp";
Britney.INSTANCE.ySpeed = -Britney.INSTANCE.jumpSpeed;
}
};
Baddy1.DaiperHit = function () {
hit = Daipers.HitTest(this.hitBox);
if (hit != null) {
this.Hit(hit.xSpeed);
hit.Hit();
}
};
Baddy1.Hit = function (dir) {
if (dir > 0) {
this.xSpeed = 3;
} else {
this.xSpeed = -3;
}
this.state = "hit";
this.HP--;
if (this.HP <= 0) {
this.Die();
}
if (Baby.INSTANCE.holder == this) {
Baby.INSTANCE.state = "air";
Baby.INSTANCE.holder = 0;
Baby.INSTANCE.ySpeed = -10;
Baby.INSTANCE.xSpeed = Baby.INSTANCE.xSpeed * 2;
}
};
Baddy1.SlideAway = function () {
this._x = this._x + this.xSpeed;
this._y = Ground.HeightAt(this._x);
this.xSpeed = this.xSpeed * 0.5;
};
Baddy1.Die = function () {
Britney.Special = Britney.Special + 15;
this.state = "dead";
this.ySpeed = -this.jumpSpeed;
};
Baddy1.FadeAway = function () {
this._alpha = this._alpha - 2;
if (this._alpha <= 0) {
Baddy1.Remove(this.arrayIndex);
}
};
Baddy1.AnimateOnce = function (str) {
if (this.sprite._currentframe == this.sprite._totalframes) {
this.state = str;
}
};
Baddy1.Fall = function () {
this.ySpeed++;
MC_Displace(this, this.xSpeed, this.ySpeed);
this.wantR = this.wantR + this.xSpeed;
};
Baddy1.LookForBaby = function () {
babyFree = Baby.INSTANCE.holder == 0;
britneyCloser = ((!((Baby.INSTANCE._x < this._x) && (Britney.INSTANCE._x > this._x))) && (!((Baby.INSTANCE._x > this._x) && (Britney.INSTANCE._x < this._x)))) && (Math.abs(this._x - Britney.INSTANCE._x) < Math.abs(this._x - Baby.INSTANCE._x));
if ((!babyFree) || (britneyCloser)) {
this.state = "chaseBritney";
} else {
this.state = "chaseBaby";
}
if (Math.abs(this._x - Britney.INSTANCE._x) > (WIDTH * 0.75)) {
this.state = "idle";
this.ySpeed = 0;
}
};
Baddy1.RemoveAll = function () {
i = 0;
while (i < this.MaxInstances) {
if (this.INSTANCES[i] != 0) {
Baddy1.Remove(i);
}
i++;
}
};
Baddy1.Init();
Baddy2.Init = function () {
this.MaxInstances = 15;
this.walkSpeed = 2;
this.jumpSpeed = 12;
this.accel = 0.5;
this.HP = 3;
i = 0;
while (i < this.MaxInstances) {
this.INSTANCES[i] = 0;
i++;
}
};
Baddy2.Spawn = function (X, Y) {
B_i = 0;
while (B_i < this.MaxInstances) {
if (this.INSTANCES[B_i] == 0) {
_root.attachMovie(this.IDENTIFIER, this.INSTANCE_NAME + B_i, this.DEPTH_INITIAL + B_i);
this.INSTANCES[B_i] = _root[this.INSTANCE_NAME + B_i];
MC_Position(this.INSTANCES[B_i], X, Y);
this.INSTANCES[B_i].arrayIndex = B_i;
this.INSTANCES[B_i].walkSpeed = this.walkSpeed + (random(20) * 0.1);
this.INSTANCES[B_i].jumpSpeed = this.jumpSpeed;
this.INSTANCES[B_i].accel = this.accel + (random(10) * 0.1);
this.INSTANCES[B_i].HP = this.HP;
this.INSTANCES[B_i].xSpeed = 0;
this.INSTANCES[B_i].ySpeed = 0;
this.INSTANCES[B_i].wantR = 0;
this.INSTANCES[B_i].state = "chaseBritney";
this.INSTANCES[B_i].onEnterFrame = this.FSM;
this.INSTANCES[B_i].ChaseBritney = this.ChaseBritney;
this.INSTANCES[B_i].LookForBaby = this.LookForBaby;
this.INSTANCES[B_i].AnimateOnce = this.AnimateOnce;
this.INSTANCES[B_i].HitBritney = this.HitBritney;
this.INSTANCES[B_i].ChaseBaby = this.ChaseBaby;
this.INSTANCES[B_i].DaiperHit = this.DaiperHit;
this.INSTANCES[B_i].SlideAway = this.SlideAway;
this.INSTANCES[B_i].ThrowBaby = this.ThrowBaby;
this.INSTANCES[B_i].FadeAway = this.FadeAway;
this.INSTANCES[B_i].GrabBaby = this.GrabBaby;
this.INSTANCES[B_i].Bounce = this.Bounce;
this.INSTANCES[B_i].Stomp = this.Stomp;
this.INSTANCES[B_i].Fall = this.Fall;
this.INSTANCES[B_i].Die = this.Die;
this.INSTANCES[B_i].Hit = this.Hit;
return(undefined);
}
B_i++;
}
};
Baddy2.Remove = function (arrayIndex) {
this.INSTANCES[arrayIndex].removeMovieClip();
this.INSTANCES[arrayIndex] = 0;
};
Baddy2.RemoveAll = function () {
B_i = 0;
while (B_i < this.MaxInstances) {
if (this.INSTANCES[B_i] != 0) {
Baddy2.Remove(B_i);
}
B_i++;
}
};
Baddy2.FSM = function () {
switch (this.state) {
case "idle" :
this.LookForBaby();
this.DaiperHit();
this.Bounce();
break;
case "chaseBritney" :
this.ChaseBritney();
this.HitBritney();
this.LookForBaby();
this.DaiperHit();
this.Bounce();
break;
case "chaseBaby" :
this.ChaseBaby();
this.LookForBaby();
this.DaiperHit();
this.GrabBaby();
this.Bounce();
this.HitBritney();
break;
case "hold" :
this.HitBritney();
this.DaiperHit();
this.ThrowBaby();
this.Bounce();
break;
case "hit" :
this.AnimateOnce("chaseBritney");
break;
case "stomp" :
this.FadeAway();
break;
case "dead" :
if (random(3) == 0) {
Particle.Spawn((this._x + random(40)) - 20, (this._y - random(20)) - 50, "blood");
}
this.Fall();
this.FadeAway();
}
this._rotation = this._rotation + ((this.wantR - this._rotation) * 0.4);
this.gotoAndStop(this.state);
MC_Blur(this, this.xSpeed, this.ySpeed);
if (this.xSpeed < 0) {
this._xscale = -100;
} else if (this.xSpeed > 0) {
this._xscale = 100;
}
};
Baddy2.ChaseBritney = function () {
this._x = this._x + this.xSpeed;
if ((this._x < Britney.INSTANCE._x) && (this.xSpeed < this.walkSpeed)) {
this.xSpeed = this.xSpeed + this.accel;
} else if ((this._x > Britney.INSTANCE._x) && (this.xSpeed > (-this.walkSpeed))) {
this.xSpeed = this.xSpeed - this.accel;
}
this.wantR = (Ground.AngleAt(this._x) * 90) / Math.PI;
};
Baddy2.GrabBaby = function () {
if (((Baby.INSTANCE.holder == 0) && (Math.abs(Baby.INSTANCE.ySpeed) < 6)) && (Baby.INSTANCE.hitTest(this.hitBox))) {
Baby.INSTANCE.holder = this;
Baby.INSTANCE.state = "held";
this.state = "hold";
Helicopter.Spawn();
}
};
Baddy2.ThrowBaby = function () {
if ((Math.abs(Helicopter.INSTANCE._x - this._x) < 100) && (this.ySpeed == 0)) {
Baby.INSTANCE.holder = 0;
Baby.INSTANCE.ySpeed = -14;
Baby.INSTANCE.xSpeed = random(10) - 5;
Baby.INSTANCE.state = "air";
this.state = "chaseBritney";
}
};
Baddy2.ChaseBaby = function () {
this._x = this._x + this.xSpeed;
if ((this._x < Baby.INSTANCE._x) && (this.xSpeed < this.walkSpeed)) {
this.xSpeed = this.xSpeed + 0.5;
} else if ((this._x > Baby.INSTANCE._x) && (this.xSpeed > (-this.walkSpeed))) {
this.xSpeed = this.xSpeed - 0.5;
}
this.wantR = (Ground.AngleAt(this._x) * 90) / Math.PI;
};
Baddy2.HitBritney = function () {
if (this.hitBox.hitTest(Britney.INSTANCE.hitBox)) {
if (Britney.Drunk) {
this.state = "dead";
} else {
Britney.HurtMe();
}
if (this._x > Britney.INSTANCE._x) {
Britney.INSTANCE._x--;
Britney.INSTANCE.xSpeed = Britney.INSTANCE.xSpeed - 3;
this._x++;
this.xSpeed++;
} else {
Britney.INSTANCE._x++;
Britney.INSTANCE.xSpeed = Britney.INSTANCE.xSpeed + 3;
this._x--;
this.xSpeed--;
}
}
};
Baddy2.Stomp = function () {
if ((this.hitBox.hitTest(Britney.INSTANCE.hitBox) && (Britney.INSTANCE.state == "air")) && (Britney.INSTANCE.ySpeed > 0)) {
this.state = "stomp";
Britney.INSTANCE.ySpeed = -Britney.INSTANCE.jumpSpeed;
}
};
Baddy2.DaiperHit = function () {
hit = Daipers.HitTest(this.hitBox);
if (hit != null) {
this.Hit();
hit.Hit();
}
};
Baddy2.Hit = function () {
this.state = "hit";
this.HP--;
if (this.HP <= 0) {
this.Die();
}
if (Baby.INSTANCE.holder == this) {
Baby.INSTANCE.state = "air";
Baby.INSTANCE.holder = 0;
Baby.INSTANCE.ySpeed = -10;
Baby.INSTANCE.xSpeed = Baby.INSTANCE.xSpeed * 2;
}
};
Baddy2.SlideAway = function () {
this._x = this._x + this.xSpeed;
};
Baddy2.Die = function () {
this.state = "dead";
this.ySpeed = -this.jumpSpeed;
Britney.Special = Britney.Special + 20;
};
Baddy2.FadeAway = function () {
this._alpha = this._alpha - 2;
if (this._alpha <= 0) {
Baddy2.Remove(this.arrayIndex);
}
};
Baddy2.AnimateOnce = function (str) {
if (this.sprite._currentframe == this.sprite._totalframes) {
this.state = str;
}
};
Baddy2.Fall = function () {
this.ySpeed++;
MC_Displace(this, this.xSpeed, this.ySpeed);
this.wantR = this.wantR + this.xSpeed;
};
Baddy2.LookForBaby = function () {
babyFree = Baby.INSTANCE.holder == 0;
britneyCloser = ((!((Baby.INSTANCE._x < this._x) && (Britney.INSTANCE._x > this._x))) && (!((Baby.INSTANCE._x > this._x) && (Britney.INSTANCE._x < this._x)))) && (Math.abs(this._x - Britney.INSTANCE._x) < Math.abs(this._x - Baby.INSTANCE._x));
if ((!babyFree) || (britneyCloser)) {
this.state = "chaseBritney";
} else {
this.state = "chaseBaby";
}
if (Math.abs(this._x - Britney.INSTANCE._x) > (WIDTH * 0.75)) {
this.state = "idle";
}
};
Baddy2.Bounce = function () {
this.ySpeed++;
this._y = this._y + this.ySpeed;
if (this._y > Ground.HeightAt(this._x)) {
this._y = Ground.HeightAt(this._x);
this.ySpeed = -this.jumpSpeed;
}
};
Baddy2.Init();
Helicopter.Spawn = function () {
if (this.INSTANCE == 0) {
_root.attachMovie(this.IDENTIFIER, this.INSTANCE_NAME, this.DEPTH);
this.INSTANCE = _root[this.INSTANCE_NAME];
MC_Position(this.INSTANCE, (-_x) - this.INSTANCE._width, 40);
this.INSTANCE.Y = this.INSTANCE._y;
this.INSTANCE.state = "catch";
this.INSTANCE.maxSpeed = 8;
this.INSTANCE.theta = 0;
this.INSTANCE.xSpeed = this.INSTANCE.maxSpeed;
this.INSTANCE.onEnterFrame = this.FSM;
this.INSTANCE.FollowBaby = this.FollowBaby;
this.INSTANCE.RunAway = this.RunAway;
this.INSTANCE.CatchBaby = this.CatchBaby;
this.INSTANCE.DaiperHit = this.DaiperHit;
this.INSTANCE.dropTimerReset = 40;
this.INSTANCE.dropTimer = 0;
} else if (Baby.INSTANCE.holder != this.INSTANCE) {
this.INSTANCE.state = "catch";
}
};
Helicopter.FSM = function () {
switch (this.state) {
case "catch" :
this.FollowBaby();
this.CatchBaby();
this.DaiperHit();
if (Baby.INSTANCE.holder == this) {
this.state = "run";
}
break;
case "run" :
this.RunAway();
this.DaiperHit();
}
this._y = this.Y + (Math.sin(this.theta) * 4);
this.theta = this.theta + 0.5;
};
Helicopter.FollowBaby = function () {
if (Math.abs(this._x - Baby.INSTANCE._x) > 25) {
if ((Baby.INSTANCE._x > this._x) && (this.xSpeed < this.maxSpeed)) {
this.xSpeed++;
} else if ((Baby.INSTANCE._x < this._x) && (this.xSpeed > (-this.maxSpeed))) {
this.xSpeed--;
}
} else {
this.xSpeed = this.xSpeed * 0.9;
if (Baby.INSTANCE.state == "ground") {
if (this.dropTimer < 0) {
Baddy2.Spawn(this._x, this._y);
this.dropTimer = this.dropTimerReset;
} else {
this.dropTimer--;
}
}
}
MC_Displace(this, this.xSpeed, 0);
this._rotation = this.xSpeed * 3;
if (this.xSpeed > 0) {
this._xscale = -100;
} else {
this._xscale = 100;
}
if ((Britney.INSTANCE != 0) && (Baby.INSTANCE.holder == Britney.INSTANCE)) {
this.state = "run";
}
};
Helicopter.DaiperHit = function () {
hit = Daipers.HitTest(this.hitBox);
if (hit != null) {
if (Baby.INSTANCE.holder == this) {
Baby.INSTANCE.holder = 0;
Baby.INSTANCE.state = "air";
this.state = "run";
}
hit.Hit();
}
};
Helicopter.RunAway = function () {
if (this._xscale < 0) {
if (this.xSpeed < this.maxSpeed) {
this.xSpeed++;
}
} else if (this.xSpeed > (-this.maxSpeed)) {
this.xSpeed--;
}
MC_Displace(this, this.xSpeed, 0);
this._rotation = this.xSpeed * 3;
if (((this._x + _x) < (-this._width)) || ((this._x + _x) > (WIDTH + this._width))) {
Helicopter.Remove();
}
};
Helicopter.CatchBaby = function () {
if ((Baby.INSTANCE.holder == 0) && (this.hitBox.hitTest(Baby.INSTANCE))) {
Baby.INSTANCE.holder = this;
Baby.INSTANCE.state = "held";
this.state = "run";
}
};
Helicopter.Remove = function () {
if (this.INSTANCE != 0) {
if (Baby.INSTANCE.holder == this.INSTANCE) {
if (level == 0) {
this.INSTANCE.removeMovieClip();
this.INSTANCE = 0;
Baby.Remove();
Baby.Spawn(200, -10);
} else {
this.INSTANCE.removeMovieClip();
this.INSTANCE = 0;
FailLevel();
}
} else {
this.INSTANCE.removeMovieClip();
this.INSTANCE = 0;
}
}
};
HUD.Init = function () {
_root.attachMovie(this.IDENTIFIER, this.INSTANCE_NAME, this.DEPTH);
this.INSTANCE = _root[this.INSTANCE_NAME];
this.INSTANCE.specialBar.stop();
this.INSTANCE.specialBar.onEnterFrame = function () {
if (Britney.Special < 1) {
this.gotoAndStop(1);
} else if (Britney.Special > this._currentframe) {
this.nextFrame();
}
if (Britney.Special >= 100) {
_root.Music.End();
HUD.INSTANCE.attachMovie("ID_specialAnimation", "Anim", 1);
Cam.enable = false;
Britney.Special = 0;
Britney.StartMusic();
}
};
};
HUD.Remove = function () {
this.INSTANCE.removeMovieClip();
this.INSTANCE = 0;
};
Truck.Init = function () {
this.MaxInstances = 15;
i = 0;
while (i < this.MaxInstances) {
this.INSTANCES[i] = 0;
i++;
}
};
Truck.Spawn = function (X) {
T_i = 0;
while (T_i < this.MaxInstances) {
if (this.INSTANCES[T_i] == 0) {
_root.attachMovie(this.IDENTIFIER, this.INSTANCE_NAME + T_i, this.DEPTH_INITIAL + T_i);
this.INSTANCES[T_i] = _root[this.INSTANCE_NAME + T_i];
this.INSTANCES[T_i].arrayIndex = T_i;
this.INSTANCES[T_i]._x = X;
this.INSTANCES[T_i]._y = Ground.HeightAt(X);
this.INSTANCES[T_i].xSpeed = 0;
this.INSTANCES[T_i].xSpeedMax = 7;
this.INSTANCES[T_i].accel = 1;
this.INSTANCES[T_i].HP = 4;
this.INSTANCES[T_i].missileTimerReset = 30;
this.INSTANCES[T_i].missileTimer = 0;
this.INSTANCES[T_i].state = "idle";
this.INSTANCES[T_i].onEnterFrame = this.FSM;
this.INSTANCES[T_i].RunFromBritney = this.RunFromBritney;
break;
}
T_i++;
}
};
Truck.Remove(INDEX);
this.INSTANCES[INDEX].removeMovieClip();
this.INSTANCES[INDEX] = 0;
Truck.RemoveAll = function () {
T_i = 0;
while (T_i < this.MaxInstances) {
if (this.INSTANCES[T_i] != 0) {
Truck.Remove(T_i);
}
T_i++;
}
};
Truck.FSM = function () {
switch (this.state) {
case "idle" :
this.RunFromBritney();
daiper = Daipers.HitTest(this.hitBox);
if (daiper != null) {
daiper.Hit();
this.state = "hurt";
this.HP--;
this.xSpeed = this.xSpeedMax / 2;
this.missileTimer = 0;
}
if (Math.abs(this._x - Britney.INSTANCE._x) < 350) {
this.missileTimer--;
if (this.missileTimer <= 0) {
this.missileTimer = this.missileTimerReset;
Missile.Spawn(this._x, this._y - 20);
}
}
if (Britney.Drunk && (this.hitBox.hitTest(Britney.INSTANCE.hitBox))) {
this.state = "dead";
}
break;
case "hurt" :
if (this.sprite._currentframe == this.sprite._totalframes) {
this.state = "idle";
}
if (this.HP <= 0) {
Britney.Special = Britney.Special + 25;
this.state = "dead";
}
this._x = this._x + this.xSpeed;
if (this.xSpeed > 0) {
this.xSpeed = this.xSpeed - this.accel;
}
break;
case "dead" :
if (this.sprite._currentframe == this.sprite._totalframes) {
this.sprite.gotoAndStop(this.sprite._totalframes);
this._alpha = this._alpha - 2;
if (this._alpha <= 0) {
Truck.Remove(this.arrayIndex);
}
}
break;
default :
trace(((this._name + ": Unknown state '") + this.state) + "' encountered!");
this.state = "idle";
}
this.gotoAndStop(this.state);
};
Truck.RunFromBritney = function () {
if ((this._x - Britney.INSTANCE._x) < 120) {
this.xSpeed = this.xSpeed + this.accel;
} else if (this.xSpeed > 0) {
this.xSpeed = this.xSpeed - this.accel;
}
if (this.xSpeed > this.xSpeedMax) {
this.xSpeed = this.xSpeedMax;
}
this._x = this._x + this.xSpeed;
this.ySpeed = Ground.HeightAt(this._x) - this._y;
this.y = this.y + this.ySpeed;
this.wantR = (Ground.AngleAt(this._x) * 150) / Math.PI;
this._rotation = this._rotation + ((this.wantR - this._rotation) * 0.4);
};
Truck.Init();
Missile.Init = function () {
this.MaxInstances = 15;
i = 0;
while (i < this.MaxInstances) {
this.INSTANCES[i] = 0;
i++;
}
};
Missile.Spawn = function (X, Y) {
M_i = 0;
while (M_i < this.MaxInstances) {
if (this.INSTANCES[M_i] == 0) {
_root.attachMovie(this.IDENTIFIER, this.INSTANCE_NAME + M_i, this.DEPTH_INITIAL + M_i);
this.INSTANCES[M_i] = _root[this.INSTANCE_NAME + M_i];
this.INSTANCES[M_i].arrayIndex = M_i;
this.INSTANCES[M_i].state = "up";
this.INSTANCES[M_i]._x = X;
this.INSTANCES[M_i]._y = Y;
this.INSTANCES[M_i].speed = 10;
this.INSTANCES[M_i].onEnterFrame = this.FSM;
break;
}
M_i++;
}
};
Missile.Remove = function (I) {
this.INSTANCES[I].removeMovieClip();
this.INSTANCES[I] = 0;
};
Missile.RemoveAll = function () {
M_i = 0;
while (M_i < this.MaxInstances) {
if (this.INSTANCES[M_i] != 0) {
Missile.Remove(M_i);
}
M_i++;
}
};
Missile.FSM = function () {
switch (this.state) {
case "up" :
this._y = this._y - this.speed;
if (this._y <= -100) {
this.state = "down";
this._x = Britney.INSTANCE._x + (Britney.INSTANCE.xSpeed * 5);
this._yscale = -100;
this.GROUND = Ground.HeightAt(this._x);
}
break;
case "down" :
this._y = this._y + this.speed;
if (this._y > this.GROUND) {
ij = 0;
while (ij < 5) {
Particle.Spawn(this._x, Ground.HeightAt(this._x) + random(15), "dirt");
ij++;
}
I = Math.round(this._x / _root.Ground.dX);
Ground.CurrentMap[I].Y = Ground.CurrentMap[I].Y + 5;
Ground.RedrawFull();
Missile.Remove(this.arrayIndex);
}
if (this.hitTest(Britney.INSTANCE.hitBox)) {
if (!Britney.Drunk) {
Britney.HurtMe();
Britney.INSTANCE.state = "hurt";
Helicopter.Spawn();
}
Missile.Remove(this.arrayIndex);
}
break;
default :
trace(((this._name + ": Unknown state '") + this.state) + "' encountered!");
this.state = "up";
}
MC_Blur(this, 0, this.ySpeed);
this.gotoAndStop(this.state);
};
Missile.Init();
Mine.Init = function () {
this.MaxInstances = 15;
i = 0;
while (i < this.MaxInstances) {
this.INSTANCES[i] = 0;
i++;
}
};
Mine.Spawn = function (X) {
M_i = 0;
while (M_i < this.MaxInstances) {
if (this.INSTANCES[M_i] == 0) {
_root.attachMovie(this.IDENTIFIER, this.INSTANCE_NAME + M_i, this.DEPTH_INITIAL + M_i);
this.INSTANCES[M_i] = _root[this.INSTANCE_NAME + M_i];
this.INSTANCES[M_i].arrayIndex = M_i;
this.INSTANCES[M_i].state = "idle";
this.INSTANCES[M_i]._x = X;
this.INSTANCES[M_i]._y = Ground.HeightAt(X);
this.INSTANCES[M_i]._rotation = (Ground.AngleAt(X) * 180) / Math.PI;
this.INSTANCES[M_i].onEnterFrame = this.FSM;
break;
}
M_i++;
}
};
Mine.Remove = function (INDEX) {
ij = 0;
while (ij < 10) {
Particle.Spawn(this.INSTANCES[INDEX]._x, Ground.HeightAt(this.INSTANCES[INDEX]._x) + random(15), "dirt");
ij++;
}
I = int(this.INSTANCES[INDEX]._x / _root.Ground.dX);
Ground.CurrentMap[I].Y = Ground.CurrentMap[I].Y + 10;
Ground.CurrentMap[I + 1].Y = Ground.CurrentMap[I + 1].Y + 10;
Ground.RedrawFull();
this.INSTANCES[INDEX].removeMovieClip();
this.INSTANCES[INDEX] = 0;
};
Mine.RemoveAll = function () {
M_i = 0;
while (M_i < this.MaxInstances) {
if (this.INSTANCES[M_i] != 0) {
Mine.Remove(M_i);
}
M_i++;
}
};
Mine.FSM = function () {
switch (this.state) {
case "idle" :
this._y = Ground.HeightAt(this._x);
this._rotation = (Ground.AngleAt(this._x) * 180) / Math.PI;
if (this.hitTest(Britney.INSTANCE.hitBox)) {
if (!Britney.Drunk) {
Britney.HurtMe();
Britney.INSTANCE.state = "hurt";
Helicopter.Spawn();
}
Mine.Remove(this.arrayIndex);
}
break;
default :
trace(((this._name + ": Unknown state '") + this.state) + "' encountered!");
this.state = "idle";
}
this.gotoAndStop(this.state);
};
Mine.Init();
Trex.Spawn = function (X) {
_root.attachMovie(this.IDENTIFIER, this.INSTANCE_NAME, this.DEPTH);
this.INSTANCE = _root[this.INSTANCE_NAME];
MC_Position(this.INSTANCE, X, Ground.HeightAt(X));
this.INSTANCE.state = "idle";
this.INSTANCE.idleTimerReset = 40;
this.INSTANCE.HP = 5;
this.INSTANCE.idleTimer = this.INSTANCE.idleTimerReset;
this.INSTANCE.onEnterFrame = this.FSM;
this.INSTANCE.DeflectDaipers = this.DeflectDaipers;
this.INSTANCE.PushBritney = this.PushBritney;
};
Trex.FSM = function () {
switch (this.state) {
case "idle" :
this.DeflectDaipers();
this.PushBritney();
if (Math.abs(this._x - Britney.INSTANCE._x) < 400) {
this.idleTimer--;
if (this.idleTimer <= 0) {
S = random(5);
switch (S) {
case 0 :
this.state = "bite";
break;
case 1 :
this.state = "charge";
break;
case 2 :
this.state = "summon";
break;
case 3 :
this.state = "taunt";
break;
case 4 :
this.state = "taunt";
break;
case 5 :
this.state = "taunt";
}
this.idleTimer = this.idleTimerReset;
}
}
this._y = Ground.HeightAt(this._x);
break;
case "bite" :
this.DeflectDaipers();
if (this.hitTest(Britney.INSTANCE)) {
Britney.HurtMe();
Britney.INSTANCE.state = "hurt";
}
if (this.sprite._currentframe == this.sprite._totalframes) {
this.state = "idle";
}
if (Britney.INSTANCE._x > this._x) {
Britney.INSTANCE._x = this._x;
}
break;
case "charge" :
this.DeflectDaipers();
if (this.sprite._currentframe == 19) {
Missile.Spawn(this._x - 30, this._y - 130);
}
if (this.sprite._currentframe == 22) {
Missile.Spawn(this._x - 40, this._y - 120);
}
if (this.sprite._currentframe == 26) {
Missile.Spawn(this._x - 30, this._y - 110);
}
if (this.sprite._currentframe == this.sprite._totalframes) {
this.state = "idle";
}
if (Britney.INSTANCE._x > this._x) {
Britney.INSTANCE._x = this._x;
}
break;
case "hurt" :
if (this.sprite._currentframe == this.sprite._totalframes) {
this.state = "idle";
}
if (this.HP <= 1) {
_root.FinishGame();
}
break;
case "summon" :
this.DeflectDaipers();
if (this.sprite._currentframe == 15) {
Baddy2.Spawn(random(WIDTH - 200) + 200, 0);
}
if (this.sprite._currentframe == this.sprite._totalframes) {
this.state = "idle";
}
break;
case "taunt" :
daiper = Daipers.HitTest(this.hitBox);
if (daiper != null) {
daiper.Hit();
this.HP--;
this.state = "hurt";
}
if (this.sprite._currentframe == this.sprite._totalframes) {
this.state = "idle";
}
break;
default :
trace(((this._name + ": Unexpected state '") + this.state) + "' ! ");
this.state = "idle";
}
if (Baby.INSTANCE._x > this._x) {
Baby.INSTANCE._x = this._x;
if (Baby.INSTANCE.xSpeed > 0) {
Baby.INSTANCE.xSpeed = Baby.INSTANCE.xSpeed * -1;
}
}
this.gotoAndStop(this.state);
};
Trex.Remove = function () {
if (this.INSTANCE != 0) {
this.INSTANCE.removeMovieClip();
this.INSTANCE = 0;
}
};
Trex.DeflectDaipers = function () {
daiper = Daipers.HitTest(this.hitBox);
if (daiper != null) {
daiper.Hit();
}
};
Trex.PushBritney = function () {
if (this.hitBox.hitTest(Britney.INSTANCE.hitBox)) {
Britney.HurtMe();
Britney.INSTANCE._x = Britney.INSTANCE._x - 3;
if (Britney.INSTANCE.xSpeed > 0) {
Britney.INSTANCE.xSpeed = 0;
}
if (Britney.INSTANCE._x > this._x) {
Britney.INSTANCE._x = this._x;
}
}
};
Particle.Init = function () {
this.MaxInstances = 50;
i = 0;
while (i < this.MaxInstances) {
this.INSTANCES[i] = 0;
i++;
}
};
Particle.Spawn = function (X, Y, T) {
P_i = 0;
while (P_i < this.MaxInstances) {
if (this.INSTANCES[P_i] == 0) {
_root.attachMovie(this.IDENTIFIER, this.INSTANCE_NAME + P_i, this.DEPTH_INITIAL + P_i);
this.INSTANCES[P_i] = _root[this.INSTANCE_NAME + P_i];
this.INSTANCES[P_i].arrayIndex = P_i;
MC_Position(this.INSTANCES[P_i], (X + random(10)) - 5, (Y + random(10)) - 5);
this.INSTANCES[P_i].state = T;
this.INSTANCES[P_i].gotoAndStop(T);
this.INSTANCES[P_i]._xscale = (this.INSTANCES[P_i]._yscale = 50 + random(75));
if (T == "dirt") {
this.INSTANCES[P_i].xSpeed = random(10) - 5;
this.INSTANCES[P_i].ySpeed = -random(10);
MC_Blur(this.INSTANCES[P_i], this.INSTANCES[P_i].xSpeed * 2, this.INSTANCES[P_i].ySpeed * 2);
} else if (T == "blood") {
this.INSTANCES[P_i].xSpeed = random(6) - 3;
this.INSTANCES[P_i].ySpeed = random(6) - 4;
MC_Blur(this.INSTANCES[P_i], this.INSTANCES[P_i].xSpeed * 2, this.INSTANCES[P_i].ySpeed * 2);
} else if (T == "bubble") {
this.INSTANCES[P_i].X = X;
this.INSTANCES[P_i].theta = random(10) * 0.1;
}
this.INSTANCES[P_i].onEnterFrame = this.FSM;
break;
}
P_i++;
}
};
Particle.Remove = function (INDEX) {
this.INSTANCES[INDEX].removeMovieClip();
this.INSTANCES[INDEX] = 0;
};
Particle.RemoveAll = function () {
P_i = 0;
while (P_i < this.MaxInstances) {
if (this.INSTANCES[P_i] != 0) {
Particle.Remove(P_i);
}
P_i++;
}
};
Particle.FSM = function () {
switch (this.state) {
case "dirt" :
if ((this.ySpeed > 0) && (this._y > Ground.HeightAt(this._x))) {
Particle.Remove(this.arrayIndex);
}
this.ySpeed++;
MC_Displace(this, this.xSpeed, this.ySpeed);
MC_Blur(this, this.xSpeed * 2, this.ySpeed * 2);
break;
case "blood" :
this._alpha = this._alpha - 5;
if (this._alpha < 0) {
Particle.Remove(this.arrayIndex);
}
this.ySpeed = this.ySpeed + 0.5;
MC_Displace(this, this.xSpeed, this.ySpeed);
MC_Blur(this, this.xSpeed * 2, this.ySpeed * 2);
break;
case "bubble" :
this._alpha = this._alpha - 5;
if (this._alpha < 0) {
Particle.Remove(this.arrayIndex);
}
this._x = this.X + (Math.sin(this.theta) * 3);
this._y--;
this.theta = this.theta + 0.5;
break;
default :
trace(((this._name + ": Unknown state '") + this.state) + "' encountered!");
this.state = "idle";
}
this.gotoAndStop(this.state);
};
Particle.Init();
TitleScreen = function () {
Ground.Init();
_root.attachMovie("ID_title", "_title", 99999);
Ground.Select(0);
Baddy1.Spawn(0, 0);
Baddy1.Spawn(400, 0);
Baby.Spawn(200, -10);
level = 0;
};
FinishGame = function () {
ClearAll();
_root.gotoAndStop("ending");
};
nextLevel = function () {
level++;
Transition();
LoadLevel();
};
LoadLevel = function () {
switch (level) {
case 1 :
To = function () {
Britney.Special = 0;
ClearAll();
LevelStartup();
Popup("Use the arrow keys.\n Carry your baby to the end in order to win.");
};
return;
case 2 :
To = function () {
ClearAll();
LevelStartup();
Popup("'A' jumps. \n'S' throws/catches your baby.");
};
return;
case 3 :
To = function () {
ClearAll();
LevelStartup();
Popup("While you aren't holding your baby, you can throw diapers with 'D'.");
};
return;
case 4 :
To = function () {
ClearAll();
LevelStartup();
Popup("If you aren't careful, child protective services will take your baby!");
Baddy1.Spawn(300, 0);
};
return;
case 5 :
To = function () {
ClearAll();
LevelStartup();
Baddy1.Spawn(300, 0);
Baddy1.Spawn(400, 0);
Baddy1.Spawn(600, 0);
Baddy2.Spawn(700, 0);
Baddy2.Spawn(800, 0);
};
return;
case 6 :
To = function () {
ClearAll();
LevelStartup();
Truck.Spawn(300);
Baddy2.Spawn(400, 0);
Baddy2.Spawn(600, 0);
Baddy2.Spawn(700, 0);
Baddy1.Spawn(800, 0);
Baddy2.Spawn(900, 0);
Baddy1.Spawn(950, 0);
Baddy2.Spawn(1000, 0);
Baddy1.Spawn(1050, 0);
Baddy1.Spawn(1150, 0);
};
return;
case 7 :
To = function () {
ClearAll();
LevelStartup();
Mine.Spawn(200);
Mine.Spawn(300);
Truck.Spawn(350);
Mine.Spawn(400);
Mine.Spawn(500);
Mine.Spawn(900);
Mine.Spawn(950);
Mine.Spawn(1000);
Baddy1.Spawn(600, 0);
Baddy1.Spawn(650, 0);
Baddy1.Spawn(700, 0);
Baddy1.Spawn(750, 0);
Baddy2.Spawn(800, 0);
Baddy2.Spawn(800, 0);
Baddy2.Spawn(900, 0);
Baddy1.Spawn(950, 0);
Baddy2.Spawn(1000, 0);
Baddy1.Spawn(1050, 0);
Baddy1.Spawn(1150, 0);
};
return;
case 8 :
To = function () {
ClearAll();
LevelStartup();
Baddy1.Spawn(400, 0);
Baddy1.Spawn(600, 0);
Baddy2.Spawn(650, 0);
Baddy1.Spawn(700, 0);
Baddy2.Spawn(750, 0);
Baddy1.Spawn(800, 0);
Mine.Spawn(850);
Baddy1.Spawn(900, 0);
Baddy2.Spawn(1000, 0);
Mine.Spawn(1000);
Baddy1.Spawn(1100, 0);
Baddy1.Spawn(1200, 0);
Truck.Spawn(1000);
Baddy1.Spawn(1400, 0);
Baddy1.Spawn(1500, 0);
};
return;
case 9 :
To = function () {
ClearAll();
LevelStartup();
Trex.Spawn(350);
};
return;
default :
To = function () {
gotoAndStop ("title");
ClearAll();
TitleScreen();
};
}
};
LevelStartup = function () {
Ground.Init();
Input.Init();
Cam.Init();
HUD.Init();
Ground.Select(level);
Britney.Spawn(10, 200);
Cam.Target(Britney.INSTANCE);
Baby.Spawn(0, 0);
};
FailLevel = function () {
Transition();
LoadLevel();
};
PassLevel = function () {
nextLevel();
};
ClearAll = function () {
_x = 0;
_root.BG.removeMovieClip();
_title.removeMovieClip();
popup.removeMovieClip();
Cam.Remove();
HUD.Remove();
Baby.Remove();
Input.Remove();
Ground.Remove();
Britney.Remove();
Helicopter.Remove();
Trex.Remove();
Baddy1.RemoveAll();
Baddy2.RemoveAll();
Truck.RemoveAll();
Daipers.RemoveAll();
Mine.RemoveAll();
Missile.RemoveAll();
Particle.RemoveAll();
};
Popup = function (field_) {
_root.attachMovie("ID_popup", "popup", 99999);
popup.field = field_;
};
stop();
ClearAll();
Frame 3
ClearAll();
Frame 4
stop();
Frame 5
ClearAll();
Music.sound = new Sound(Music);
Music.sound.stop();
Music.sound.attachSound("bgm");
Music.sound.start(0, 999999);
Music.sound.setVolume(0);
Music.Volume = 61;
Music.Begin = function () {
Music.onEnterFrame = function () {
if (this.sound.getVolume() < this.Volume) {
this.sound.setVolume(this.sound.getVolume() + 4);
if (Britney.INSTANCE.SpecialMusic.getVolume() > 0) {
Britney.INSTANCE.SpecialMusic.setVolume(Britney.INSTANCE.SpecialMusic.getVolume() - 5);
}
}
if (this.sound.getVolume() > this.Volume) {
this.sound.setVolume(this.sound.getVolume() - 4);
}
};
};
Music.End = function () {
Music.onEnterFrame = function () {
if (this.sound.getVolume() > 0) {
this.sound.setVolume(this.sound.getVolume() - 4);
}
};
};
Music.Begin();
stop();
To = function () {
play();
};
FadeIn();
Frame 6
stop();
ClearAll();
TitleScreen();
Frame 7
stop();
Frame 8
Music.End();
ClearAll();
Frame 9
Music.End();
ClearAll();
Symbol 3 Button
on (release) {
_root.Music.Begin();
}
Symbol 4 Button
on (release) {
_root.Music.End();
}
Symbol 5 Button
on (release) {
_quality = "Low";
}
Symbol 6 Button
on (release) {
_quality = "Medium";
}
Symbol 7 Button
on (release) {
_quality = "High";
}
Symbol 8 Button
on (release) {
_root.attachMovie("ID_title", "_title", 99999);
}
Symbol 18 MovieClip Frame 1
onEnterFrame = function () {
LOADED = Math.round(_root.LOADED * 100);
};
Symbol 26 Button
on (release) {
_root.onEnterFrame = null;
_root.play();
}
Symbol 27 MovieClip Frame 1
onEnterFrame = function () {
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
gotoAndStop (2);
onEnterFrame = null;
}
};
stop();
Symbol 33 Button
on (release) {
getURL ("http://www.armorgames.com", "blank");
}
Symbol 39 Button
on (release) {
getURL ("http://www.armorgames.com", "blank");
}
Symbol 45 MovieClip Frame 81
_root.play();
Symbol 48 MovieClip Frame 1
_alpha = 0;
Symbol 96 MovieClip [ID_BG] Frame 1
stop();
Symbol 102 MovieClip Frame 1
stop();
Symbol 111 MovieClip [ID_fadeOut] Frame 25
_root.FadeIn();
Symbol 112 MovieClip [ID_fadeIn] Frame 19
this.removeMovieClip();
Symbol 114 Button
on (release) {
_root.Transition();
_root.To = function () {
_root.gotoAndStop("game");
_root.level = 1;
_root.LoadLevel();
_root.To();
};
}
Symbol 115 Button
on (release) {
_root.attachMovie("ID_options", "_title", 99999);
}
Symbol 116 Button
on (release) {
getURL ("http://www.armorgames.com", "blank");
}
Symbol 182 MovieClip [ID_specialAnimation] Frame 1
_root.Britney.INSTANCE.state = "specialInit";
_root.Baby.INSTANCE.state = "held";
_root.Baby.INSTANCE.holder = _root.Britney.INSTANCE;
Symbol 182 MovieClip [ID_specialAnimation] Frame 55
_root.Cam.enable = true;
_root.Britney.BeginSpecial();
this.removeMovieClip();
Symbol 194 MovieClip Frame 1
onEnterFrame = function () {
this.gotoAndStop(_parent.HP);
};
Symbol 239 Button
on (release) {
_root.play();
}
Symbol 282 MovieClip Frame 1
theta = 0;
onEnterFrame = function () {
_rotation = (Math.sin(theta) * 3);
theta = theta + 0.2;
};
Symbol 298 MovieClip Frame 1
theta = 0;
onEnterFrame = function () {
_rotation = (Math.sin(theta) * 3);
theta = theta + 0.2;
};
Symbol 300 MovieClip Frame 1
Symbol 300 MovieClip Frame 553
_root.play();
Symbol 365 MovieClip Frame 1
gotoAndStop(random(6) + 2);
Symbol 451 MovieClip Frame 621
_root.gotoAndStop("credits");
Symbol 454 Button
on (release) {
getURL ("http://www.armorgames.com", "blank");
}
Symbol 459 Button
on (release) {
_root.gotoAndStop("title");
_root.Music.Begin();
}
Symbol 460 MovieClip Frame 2
_root.Music.sound.stop();
_root.Music.sound.start(0, 99999);
_root.Music.Begin();
Symbol 460 MovieClip Frame 298
stop();