Frame 2
if (((this._url.indexOf("http://www.addictinggames.com") != 0) and (this._url.indexOf("http://agstage.shockwave.com") != 0)) and (this._url.indexOf("http://farm.addictinggames.com") != 0)) {
MochiAd.showPreGameAd({id:"029f84031e82eb3d", res:"600x300"});
} else {
stop();
this.createTextField("my_txt", 1, 0, 190, 600, 20);
my_txt.multiline = true;
my_txt.wordWrap = true;
var my_fmt = new TextFormat();
my_fmt.color = 16777215 /* 0xFFFFFF */;
my_fmt.align = "center";
my_fmt.bold = true;
my_fmt.font = "Arial";
my_txt.text = "Loading...";
my_txt.setTextFormat(my_fmt);
this.onEnterFrame = function () {
if (this.getBytesLoaded() >= this.getBytesTotal()) {
my_txt.removeTextField();
delete onEnterFrame;
gotoAndStop (2);
}
};
}
_root.kongregateServices.connect();
Frame 4
stop();
Frame 5
function CalcAngle(Xfrom, Yfrom, Xto, Yto) {
if ((Xfrom == Xto) and (Yfrom == Yto)) {
Angle = 0;
} else {
XDis = Math.abs(Xto - Xfrom);
YDis = Math.abs(Yto - Yfrom);
Angle = Math.atan(YDis / XDis);
if (Xto > Xfrom) {
if (Yto < Yfrom) {
Angle = halfPI - Angle;
} else {
Angle = halfPI + Angle;
}
} else if (Yto > Yfrom) {
Angle = (Math.PI + halfPI) - Angle;
} else {
Angle = (Math.PI + halfPI) + Angle;
}
if (Angle < 0) {
Angle = Angle + (Math.PI*2);
}
}
return(Angle);
}
function CalcDistance(Xfrom, Yfrom, Xto, Yto) {
xDistance = Math.abs(Xto - Xfrom);
yDistance = Math.abs(Yto - Yfrom);
LineDistance = Math.sqrt(Math.pow(xDistance, 2) + Math.pow(yDistance, 2));
return(LineDistance);
}
function NumberFormat(Num, Separator) {
NumberString = Num.toString();
SplitArray = new Array();
ss = NumberString.length - 3;
while (ss >= 0) {
SplitArray.unshift(NumberString.substr(ss, 3));
ss = ss - 3;
}
if ((ss < 0) and (ss > -3)) {
SplitArray.unshift(NumberString.substr(0, ss + 3));
}
NumberString = SplitArray.join(Separator);
return(NumberString);
}
function itemHandler(obj, item) {
getURL ("http://www.sugar-free-games.com", "_BLANK");
}
function SwitchFX() {
FXOn = !FXOn;
}
function SwitchMusic() {
MusicOn = !MusicOn;
if (MusicOn) {
Music.start(0, 1000000000);
} else {
Music.stop();
}
}
function MuteAll() {
FXOn = false;
MusicOn = false;
Music.stop();
}
function SwitchAQC() {
AQC = !AQC;
}
function TimeFormat(Time) {
var _local3;
var _local1;
var _local2;
_local3 = Math.floor(Time / 60);
_local1 = Time % 60;
if (_local1 < 10) {
_local1 = "0" + _local1;
}
_local2 = (_local3 + ":") + _local1;
return(_local2);
}
halfPI = (Math.PI/2);
dblPI = (Math.PI*2);
Rad2Deg = 360 / dblPI;
var Saved = SharedObject.getLocal("LevelData");
if (Saved.data.LastLevel == undefined) {
Saved.data.LastLevel = [undefined, 0, 0];
}
FXOn = true;
MusicOn = true;
AQC = true;
QualityNames = [undefined, "LOW", "MEDIUM", "HIGH"];
var showItem = true;
var my_cm = new ContextMenu();
my_cm.customItems.push(new ContextMenuItem("Resume", function () {
}));
my_cm.customItems.push(new ContextMenuItem("", SwitchFX));
my_cm.customItems.push(new ContextMenuItem("", SwitchMusic));
my_cm.customItems.push(new ContextMenuItem("Mute All Sounds", MuteAll));
my_cm.customItems.push(new ContextMenuItem("Disable Automatic Quality Control", SwitchAQC));
my_cm.customItems.push(new ContextMenuItem("End Game", function () {
Lives = 1;
gotoAndStop ("Life Lost");
}, true));
my_cm.customItems.push(new ContextMenuItem("Exit to Main Menu", function () {
gotoAndStop ("Main Menu");
}, false));
my_cm.customItems.push(new ContextMenuItem("More Games at Sugar-Free-Games.com", itemHandler, true));
my_cm.onSelect = function () {
RightClickMenu = true;
Cursor._visible = false;
Mouse.show();
DisplayMessage("PAUSED");
PausedBlack._visible = true;
my_cm.customItems[5].enabled = (my_cm.customItems[6].enabled = InTheGame);
if (FXOn) {
my_cm.customItems[1].caption = "Disable Sound Effects";
} else {
my_cm.customItems[1].caption = "Enable Sound Effects";
}
if (MusicOn) {
my_cm.customItems[2].caption = "Disable Music";
} else {
my_cm.customItems[2].caption = "Enable Music";
}
if (AQC) {
my_cm.builtInItems.quality = false;
my_cm.customItems[4].caption = "Disable Automatic Quality Control";
} else {
my_cm.builtInItems.quality = true;
my_cm.customItems[4].caption = "Enable Automatic Quality Control";
}
};
my_cm.hideBuiltInItems();
this.menu = my_cm;
FootHeight = new Array();
i = 0;
while (i <= 6) {
Kat1 = (i * 2) - 6;
Gipo = 6;
Kat2 = Math.sqrt(Math.pow(Gipo, 2) - Math.pow(Kat1, 2));
FootHeight[i] = Kat2;
i++;
}
FootRotation = new Array();
i = 0;
while (i <= 8) {
if (i < 4) {
FootRotation[i] = i * 5;
}
if ((i >= 4) and (i < 6)) {
FootRotation[i] = 15 - ((i - 3) * 20);
}
if (i > 6) {
FootRotation[i] = -25 + ((i - 6) * 12.5);
}
i++;
}
MListener = new Object();
MListener.onMouseDown = function () {
MDown = true;
if ((!RightClickMenu) and (!FinishedLevel)) {
if (Ammo > 0) {
Shoot(Chars[0]);
} else {
DisplayMessage("Out of Ammo");
if (InTheGame and FXOn) {
if (Mode == 1) {
BoyNoAmmo.start();
} else {
GirlNoAmmo.start();
}
}
}
}
if (RightClickMenu) {
RightClickMenu = false;
if (InTheGame) {
Mouse.hide();
Cursor._visible = true;
PausedBlack._visible = false;
Message.gotoAndPlay("Fade Down");
}
}
};
MListener.onMouseUp = function () {
MDown = false;
};
MListener.onMouseMove = function () {
if ((RightClickMenu and (!FinishedLevel)) and InTheGame) {
RightClickMenu = false;
Mouse.hide();
Cursor._visible = true;
PausedBlack._visible = false;
Message.gotoAndPlay("Fade Down");
}
};
Mouse.addListener(MListener);
CharTypes = [undefined, {Speed:3, LegLength:20, BodyHeight:8, WpnDistance:10, Gun:1, BodyAndHead:19, HalfWidth:4, Gender:1, MaxDamage:5, FireRate:40, Reaction:20, Accuracy:0.2, JumpPower:12, ScoreValue:10, BodyType:1, LegType:1, RArmType:1, LArmType:1, HeadType:1, FootType:1}, {Speed:3, LegLength:20, BodyHeight:8, WpnDistance:10, Gun:2, BodyAndHead:19, HalfWidth:3, SkirtLength:9, SkirtColor:35071, SkirtWidth:2, SkirtHeight:2, SkirtKlin:0.3, Gender:0, MaxDamage:5, FireRate:40, Reaction:20, Accuracy:0.2, JumpPower:12, ScoreValue:10, BodyType:2, LegType:2, RArmType:2, LArmType:2, HeadType:2, FootType:2}, {Speed:4, LegLength:24, BodyHeight:13, WpnDistance:13, Gun:2, BodyAndHead:25, HalfWidth:3, SkirtLength:12, SkirtColor:16764159, SkirtWidth:2, SkirtHeight:2, SkirtKlin:0.1, Gender:0, MaxDamage:100, FireRate:15, Reaction:10, Accuracy:0.1, JumpPower:15, ScoreValue:200, BodyType:3, LegType:3, RArmType:3, LArmType:3, HeadType:3, FootType:3}, {Speed:4, LegLength:24, BodyHeight:13, WpnDistance:13, Gun:1, BodyAndHead:25, HalfWidth:4, Gender:1, MaxDamage:100, FireRate:15, Reaction:10, Accuracy:0.1, JumpPower:15, ScoreValue:200, BodyType:4, LegType:4, RArmType:4, LArmType:4, HeadType:4, FootType:4}, {Speed:4, LegLength:20, BodyHeight:8, WpnDistance:10, Gun:1, BodyAndHead:19, HalfWidth:3, Gender:1, MaxDamage:10, FireRate:30, Reaction:15, Accuracy:0.18, JumpPower:10, ScoreValue:15, BodyType:5, LegType:5, RArmType:5, LArmType:5, HeadType:5, FootType:4}, {Speed:4, LegLength:20, BodyHeight:8, WpnDistance:10, Gun:2, BodyAndHead:19, HalfWidth:4, Gender:0, MaxDamage:10, FireRate:30, Reaction:15, Accuracy:0.18, JumpPower:10, ScoreValue:15, BodyType:6, LegType:6, RArmType:6, LArmType:6, HeadType:6, FootType:2}, {Speed:4, LegLength:24, BodyHeight:13, WpnDistance:13, Gun:3, BodyAndHead:25, HalfWidth:4, Gender:0, MaxDamage:200, FireRate:15, Reaction:10, Accuracy:0.1, JumpPower:15, ScoreValue:300, BodyType:7, LegType:7, RArmType:7, LArmType:7, HeadType:7, FootType:5}, {Speed:4, LegLength:24, BodyHeight:13, WpnDistance:13, Gun:4, BodyAndHead:25, HalfWidth:4, Gender:1, MaxDamage:200, FireRate:15, Reaction:10, Accuracy:0.1, JumpPower:15, ScoreValue:300, BodyType:8, LegType:8, RArmType:8, LArmType:8, HeadType:8, FootType:5}, {Speed:3, LegLength:20, BodyHeight:8, WpnDistance:10, Gun:3, BodyAndHead:19, HalfWidth:3, Gender:0, MaxDamage:10, FireRate:30, Reaction:10, Accuracy:0.08, JumpPower:15, ScoreValue:20, BodyType:9, LegType:9, RArmType:2, LArmType:2, HeadType:9, FootType:6}, {Speed:3, LegLength:20, BodyHeight:8, WpnDistance:10, Gun:4, BodyAndHead:19, HalfWidth:3, Gender:1, MaxDamage:10, FireRate:30, Reaction:10, Accuracy:0.08, JumpPower:15, ScoreValue:20, BodyType:10, LegType:10, RArmType:9, LArmType:9, HeadType:10, FootType:7}, {Speed:6, LegLength:16, BodyHeight:8, WpnDistance:10, Gun:3, BodyAndHead:19, HalfWidth:3, SkirtLength:5, SkirtColor:68, SkirtWidth:2, SkirtHeight:2, SkirtKlin:0.01, Gender:0, MaxDamage:200, FireRate:10, Reaction:10, Accuracy:0.1, JumpPower:15, ScoreValue:400, BodyType:11, LegType:11, RArmType:2, LArmType:2, HeadType:11, FootType:8}, {Speed:6, LegLength:16, BodyHeight:8, WpnDistance:10, Gun:4, BodyAndHead:19, HalfWidth:3, Gender:1, MaxDamage:200, FireRate:10, Reaction:10, Accuracy:0.1, JumpPower:15, ScoreValue:400, BodyType:12, LegType:12, RArmType:10, LArmType:10, HeadType:12, FootType:5}, {Speed:3, LegLength:20, BodyHeight:8, WpnDistance:10, Gun:3, BodyAndHead:19, HalfWidth:3, Gender:0, MaxDamage:15, FireRate:10, Reaction:10, Accuracy:0.06, JumpPower:12, ScoreValue:25, BodyType:13, LegType:13, RArmType:11, LArmType:11, HeadType:13, FootType:9}, {Speed:3, LegLength:20, BodyHeight:8, WpnDistance:10, Gun:4, BodyAndHead:19, HalfWidth:3, Gender:1, MaxDamage:15, FireRate:10, Reaction:10, Accuracy:0.06, JumpPower:12, ScoreValue:25, BodyType:14, LegType:14, RArmType:12, LArmType:12, HeadType:14, FootType:10}, {Speed:4, LegLength:24, BodyHeight:13, WpnDistance:13, Gun:5, BodyAndHead:25, HalfWidth:4, Gender:0, MaxDamage:300, FireRate:10, Reaction:10, Accuracy:0.06, JumpPower:15, ScoreValue:500, BodyType:15, LegType:15, RArmType:13, LArmType:13, HeadType:15, FootType:11}, {Speed:4, LegLength:24, BodyHeight:13, WpnDistance:13, Gun:6, BodyAndHead:25, HalfWidth:4, Gender:1, MaxDamage:300, FireRate:10, Reaction:10, Accuracy:0.06, JumpPower:15, ScoreValue:500, BodyType:16, LegType:16, RArmType:14, LArmType:14, HeadType:16, FootType:12}, {Speed:8, LegLength:20, BodyHeight:8, WpnDistance:10, Gun:3, BodyAndHead:19, HalfWidth:3, SkirtLength:8, SkirtColor:0, SkirtWidth:2, SkirtHeight:2, SkirtKlin:0.4, Gender:0, MaxDamage:20, FireRate:10, Reaction:10, Accuracy:0.16, JumpPower:15, ScoreValue:30, BodyType:17, LegType:17, RArmType:15, LArmType:15, HeadType:17, FootType:13}, {Speed:8, LegLength:20, BodyHeight:8, WpnDistance:10, Gun:4, BodyAndHead:19, HalfWidth:3, Gender:1, MaxDamage:20, FireRate:10, Reaction:10, Accuracy:0.16, JumpPower:15, ScoreValue:30, BodyType:18, LegType:18, RArmType:16, LArmType:16, HeadType:18, FootType:14}, {Speed:3, LegLength:20, BodyHeight:8, WpnDistance:10, Gun:3, BodyAndHead:19, HalfWidth:3, Gender:0, MaxDamage:500, FireRate:8, Reaction:5, Accuracy:0.06, JumpPower:15, ScoreValue:600, BodyType:19, LegType:19, RArmType:17, LArmType:17, HeadType:19, FootType:15}, {Speed:3, LegLength:20, BodyHeight:8, WpnDistance:10, Gun:4, BodyAndHead:19, HalfWidth:3, Gender:1, MaxDamage:500, FireRate:8, Reaction:5, Accuracy:0.06, JumpPower:15, ScoreValue:600, BodyType:20, LegType:20, RArmType:18, LArmType:18, HeadType:20, FootType:5}, {Speed:6, LegLength:14, BodyHeight:6, WpnDistance:10, Gun:4, BodyAndHead:17, HalfWidth:3, Gender:1, MaxDamage:25, FireRate:15, Reaction:15, Accuracy:0.14, JumpPower:10, ScoreValue:35, BodyType:21, LegType:21, RArmType:19, LArmType:19, HeadType:21, FootType:15}, {Speed:6, LegLength:14, BodyHeight:6, WpnDistance:10, Gun:3, BodyAndHead:17, HalfWidth:3, Gender:0, MaxDamage:25, FireRate:15, Reaction:15, Accuracy:0.14, JumpPower:10, ScoreValue:35, BodyType:22, LegType:22, RArmType:20, LArmType:20, HeadType:22, FootType:8}, {Speed:6, LegLength:40, BodyHeight:25, WpnDistance:20, Gun:5, BodyAndHead:45, HalfWidth:6, Gender:0, MaxDamage:800, FireRate:20, Reaction:3, Accuracy:0.06, JumpPower:10, ScoreValue:5000, BodyType:23, LegType:23, RArmType:21, LArmType:21, HeadType:23, FootType:16}, {Speed:6, LegLength:40, BodyHeight:25, WpnDistance:20, Gun:6, BodyAndHead:45, HalfWidth:6, Gender:1, MaxDamage:800, FireRate:20, Reaction:3, Accuracy:0.06, JumpPower:10, ScoreValue:5000, BodyType:24, LegType:24, RArmType:22, LArmType:22, HeadType:25, FootType:17}];
Guns = [undefined, {ShotType:1, RoundType:1, Damage:5}, {ShotType:2, RoundType:2, Damage:5}, {ShotType:3, RoundType:4, Damage:10}, {ShotType:1, RoundType:1, Damage:10}, {ShotType:4, RoundType:4, Damage:10}, {ShotType:5, RoundType:1, Damage:10}];
RoundPars = [undefined, {Weight:1, BounceSpeed:10}, {Weight:0.5, BounceSpeed:5}, {Weight:0.5, BounceSpeed:5}, {Weight:0.5, BounceSpeed:5}];
BGTypes = [undefined, [1, 5], [12, 19], [6, 11], [20, 22]];
BGBaseWidths = [undefined, 0, 0, 0, 0, 0, 12, 1, 1, 2, 3, 30, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 17];
BGColors = [undefined, [undefined, 2101248, 7356416], [undefined, 49152, 7385232, 47104, 45056, 43008]];
PowerUpNames = [undefined, [undefined, undefined, "+20 Ammo", "Reduce Cootification", "Speed-Up", "Higher Jumping", "Anti-Cooties Protection", "Weapon Upgrade", "Extra Life"], [undefined, undefined, "20 Stars", "Healing", "Super Speed", "Super Jump", "Shield", "New Magic Wand", "Extra Life"]];
PowerUpWidths = [undefined, 20, 15, 15, 15, 15, 15, 15, 15];
PowerUpFrequency = [undefined, 500, 400, 200, 100, 80, 50];
PowerUpTypes = [undefined, [2, 3], [2, 2, 3], [2, 2, 2, 2, 2, 3, 3, 4], [2, 2, 2, 3, 3, 4, 5], [2, 2, 2, 3, 3, 4, 5, 6], [2, 2, 2, 3, 3, 4, 5, 6]];
LevelEnemies = [undefined, [undefined, [2], [2, 6], [6, 9], [9, 13], [13, 17], [17, 22]], [undefined, [1], [1, 5], [5, 10], [10, 14], [14, 18], [18, 21]]];
Bosses = [undefined, [undefined, 3, 7, 11, 15, 19, 23], [undefined, 4, 8, 12, 16, 20, 24]];
EnemyFrequency = [undefined, 48, 46, 45, 44, 43, 42];
LevelLengths = [undefined, 5000, 7000, 9000, 11000, 13000, 15000];
UpgradesPerLevel = [undefined, 0, 0, 1, 1, 2, 2];
GunUpgrades = [undefined, [1, 4, 6], [2, 3, 5]];
Music = new Sound(this);
Frame 6
GirlNoAmmo = new Sound(this);
GirlNoAmmo.attachSound("GIRLNOAMMO");
BoyNoAmmo = new Sound(this);
BoyNoAmmo.attachSound("BOYNOAMMO");
EatPowerUp = new Sound(this);
EatPowerUp.attachSound("POWERUP");
Punch = new Sound(this);
Punch.attachSound("PUNCH");
FaultSnd = new Sound(this);
FaultSnd.attachSound("FAULT");
Click = new Sound(this);
Click.attachSound("CLICK");
Dress = new Sound(this);
Dress.attachSound("DRESS");
KissSnd = new Sound(this);
KissSnd.attachSound("KISS");
ExplosionSnd = new Sound(this);
ExplosionSnd.attachSound("EXPLOSION");
stop();
ContinueButt.Txt = "CONTINUE";
ContinueButt.onPress = function () {
gotoAndStop ("GenderSelect");
};
Frame 8
InTheGame = false;
this._quality = "HIGH";
Mouse.show();
CurrLevel = 1;
Score = 0;
Lives = 3;
DroppedExtraLife = false;
if (Mode == 1) {
M.gotoAndStop(1);
}
if (Mode == 2) {
M.gotoAndStop(4);
}
Music.stop();
Frame 10
function AddChar(x, Type, Boss) {
var _local1;
var _local2;
var _local4;
_local1 = Chars.length;
_local2 = 0;
while (GA["LA" + _local2] instanceof MovieClip) {
_local2++;
}
duplicateMovieClip (GA.LArmSample, "LA" + _local2, GA.getNextHighestDepth());
duplicateMovieClip (GA.LegSample, "L1" + _local2, GA.getNextHighestDepth());
duplicateMovieClip (GA.FootSample, "F1" + _local2, GA.getNextHighestDepth());
duplicateMovieClip (GA.BodySample, "B" + _local2, GA.getNextHighestDepth());
duplicateMovieClip (GA.LegSample, "L2" + _local2, GA.getNextHighestDepth());
duplicateMovieClip (GA.FootSample, "F2" + _local2, GA.getNextHighestDepth());
if (CharTypes[Type].SkirtLength > 0) {
duplicateMovieClip (GA.LegSample, "S1" + _local2, GA.getNextHighestDepth());
duplicateMovieClip (GA.LegSample, "S2" + _local2, GA.getNextHighestDepth());
GA.createEmptyMovieClip("S3" + _local2, GA.getNextHighestDepth());
GA.createEmptyMovieClip("SMask1" + _local2, GA.getNextHighestDepth());
GA.createEmptyMovieClip("SMask2" + _local2, GA.getNextHighestDepth());
}
duplicateMovieClip (GA.RArmSample, "RA" + _local2, GA.getNextHighestDepth());
Chars[_local1] = {LArm:GA["LA" + _local2], RArm:GA["RA" + _local2], Body:GA["B" + _local2], Foot1:GA["F1" + _local2], Foot2:GA["F2" + _local2], Leg1:GA["L1" + _local2], Leg2:GA["L2" + _local2]};
for (_local4 in CharTypes[Type]) {
Chars[_local1][_local4] = CharTypes[Type][_local4];
}
Chars[_local1].BodyRotation = 0;
Chars[_local1].Hit = false;
Chars[_local1].DuckingRotation = 0;
Chars[_local1].Jumping = false;
Chars[_local1].JumpingPhase = 0;
Chars[_local1].BodyShift = 0;
Chars[_local1].DuckingShift = 0;
Chars[_local1].Boss = Boss;
if (_local1 == 0) {
Chars[_local1].Direction = 2;
} else {
Chars[_local1].Direction = 1;
Chars[_local1].Move = 1;
}
Chars[_local1].LArm._x = (Chars[_local1].RArm._x = (Chars[_local1].Leg1._x = (Chars[_local1].Leg2._x = (Chars[_local1].Foot1._x = (Chars[_local1].Foot2._x = (Chars[_local1].Body._x = (Chars[_local1].ArmX = (Chars[_local1].x = Math.round(x)))))))));
Chars[_local1].Foot1._y = (Chars[_local1].Foot2._y = Field[x] - 1);
Chars[_local1].Body._y = (Chars[_local1].Leg1._y = (Chars[_local1].Leg2._y = (Chars[_local1].y = Field[Math.round(x)] - Chars[_local1].LegLength)));
Chars[_local1].LArm._y = (Chars[_local1].RArm._y = (Chars[_local1].ArmY = (Field[x] - Chars[_local1].LegLength) - Chars[_local1].BodyHeight));
Chars[_local1].GlobalPhase = 3;
Chars[_local1].Diff2 = 0;
Chars[_local1].Diff1 = FootHeight[3];
Chars[_local1].AimingAngle = Math.PI;
Chars[_local1].Arm1._rotation = (Chars[_local1].Arm2._rotation = 180);
Chars[_local1].Killed = false;
Chars[_local1].AimingAngle = 4.71238898038469;
Chars[_local1].Body.gotoAndStop(Chars[_local1].BodyType);
Chars[_local1].Body.Head.gotoAndStop(Chars[_local1].HeadType);
Chars[_local1].Leg1.UpperLeg.gotoAndStop(Chars[_local1].LegType);
Chars[_local1].Leg2.UpperLeg.gotoAndStop(Chars[_local1].LegType);
Chars[_local1].Foot1.gotoAndStop(Chars[_local1].FootType);
Chars[_local1].Foot2.gotoAndStop(Chars[_local1].FootType);
Chars[_local1].RArm.gotoAndStop(Chars[_local1].RArmType);
Chars[_local1].LArm.gotoAndStop(Chars[_local1].LArmType);
Chars[_local1].RArm.Inside.Gun.gotoAndStop(Chars[_local1].Gun);
Chars[_local1].SuperSpeed = (((((Type == 11) or (Type == 12)) or (Type == 17)) or (Type == 18)) or (Type == 21)) or (Type == 22);
Chars[_local1].Damage = 0;
Chars[_local1].Shot = new Sound(Chars[_local1].Body);
if (Chars[_local1].Gender == 1) {
Chars[_local1].Shot.attachSound("BOYSHOT");
} else {
Chars[_local1].Shot.attachSound("GIRLSHOT");
}
if (Chars[_local1].SkirtLength > 0) {
Chars[_local1].PreviousGlobal = new Array();
Chars[_local1].PreviousLocal = new Array();
Chars[_local1].Skirt1 = GA["S1" + _local2];
Chars[_local1].Skirt2 = GA["S2" + _local2];
Chars[_local1].Skirt1.UpperLeg.gotoAndStop(Chars[_local1].LegType);
Chars[_local1].Skirt2.UpperLeg.gotoAndStop(Chars[_local1].LegType);
Chars[_local1].Skirt3 = GA["S3" + _local2];
Chars[_local1].SkirtMask1 = GA["SMask1" + _local2];
Chars[_local1].SkirtMask2 = GA["SMask2" + _local2];
Chars[_local1].Skirt1.setMask(Chars[_local1].SkirtMask1);
Chars[_local1].Skirt2.setMask(Chars[_local1].SkirtMask2);
Chars[_local1].S1Col = new Color(Chars[_local1].Skirt1);
Chars[_local1].S2Col = new Color(Chars[_local1].Skirt2);
Chars[_local1].S1Col.setRGB(Chars[_local1].SkirtColor);
Chars[_local1].S2Col.setRGB(Chars[_local1].SkirtColor);
Chars[_local1].Skirt1.UpperLeg.LowerLeg._visible = false;
Chars[_local1].Skirt2.UpperLeg.LowerLeg._visible = false;
Chars[_local1].Skirt3._x = (Chars[_local1].Skirt2._x = (Chars[_local1].Skirt1._x = Chars[_local1].x));
Chars[_local1].Skirt3._y = (Chars[_local1].Skirt2._y = (Chars[_local1].Skirt1._y = Chars[_local1].y));
Chars[_local1].OriginalSkirtRotations = [Math.PI + Chars[_local1].SkirtKlin, Math.PI - Chars[_local1].SkirtKlin];
Chars[_local1].SkirtRotations = [Chars[_local1].OriginalSkirtRotations[0], Chars[_local1].OriginalSkirtRotations[1]];
Chars[_local1].SkirtPoints = [{x:-Chars[_local1].SkirtWidth, y:-2}, {x:Chars[_local1].SkirtWidth, y:-3}];
Chars[_local1].SkirtPoints[2] = {x:Chars[_local1].SkirtPoints[1].x + (Math.sin(Chars[_local1].SkirtRotations[0]) * Chars[_local1].SkirtLength), y:Chars[_local1].SkirtPoints[1].y - (Math.cos(Chars[_local1].SkirtRotations[0]) * Chars[_local1].SkirtLength)};
Chars[_local1].SkirtPoints[3] = {x:Chars[_local1].SkirtPoints[0].x + (Math.sin(Chars[_local1].SkirtRotations[1]) * Chars[_local1].SkirtLength), y:Chars[_local1].SkirtPoints[0].y - (Math.cos(Chars[_local1].SkirtRotations[1]) * Chars[_local1].SkirtLength)};
Chars[_local1].PreviousGlobal[2] = {x:Chars[_local1].SkirtPoints[2].x + Chars[_local1].x, y:Chars[_local1].SkirtPoints[2].y + Chars[_local1].y};
Chars[_local1].PreviousGlobal[3] = {x:Chars[_local1].SkirtPoints[3].x + Chars[_local1].x, y:Chars[_local1].SkirtPoints[3].y + Chars[_local1].y};
}
}
function Shoot(Char) {
var _local26;
var _local25;
var _local21;
var _local20;
var _local3;
var _local4;
var _local6;
var _local13;
var _local7;
var _local8;
var _local11;
var _local1;
var _local15;
var _local9;
var _local5;
var _local14;
var _local12;
var _local10;
var _local22;
var _local17;
var _local16 = 3;
var _local23;
var _local24;
if (FXOn) {
_local23 = Math.round((500 - Math.abs(Char.x - Chars[0].x)) / 5);
if (_local23 > 100) {
_local23 = 100;
}
if (_local23 < 0) {
_local23 = 0;
}
Char.Shot.setVolume(_local23);
_local24 = Math.round((Char.x - Chars[0].x) / 2);
if (_local24 < -100) {
_local24 = -100;
}
if (_local24 > 100) {
_local24 = 100;
}
Char.Shot.setPan(_local24);
Char.Shot.start();
}
if (Char == Chars[0]) {
Ammo--;
UpdateAmmo();
}
Char.RArm.Inside.gotoAndPlay(2);
if (((((Guns[Char.Gun].ShotType == 1) or (Guns[Char.Gun].ShotType == 2)) or (Guns[Char.Gun].ShotType == 3)) or (Guns[Char.Gun].ShotType == 4)) or (Guns[Char.Gun].ShotType == 5)) {
if ((Guns[Char.Gun].ShotType == 4) or (Guns[Char.Gun].ShotType == 5)) {
_local22 = 3;
} else {
_local22 = 1;
}
_local17 = 1;
while (_local17 <= _local22) {
if ((Guns[Char.Gun].ShotType == 4) or (Guns[Char.Gun].ShotType == 5)) {
_local6 = Char.AimingAngle + ((_local17 - Math.ceil(_local22 / 2)) * 0.1);
} else {
_local6 = Char.AimingAngle;
}
_local3 = Char.ArmX + (Math.sin(_local6) * Char.WpnDistance);
_local4 = Char.ArmY - (Math.cos(_local6) * Char.WpnDistance);
_local3 = Char.ArmX + (Math.sin(_local6) * Char.WpnDistance);
_local4 = Char.ArmY - (Math.cos(_local6) * Char.WpnDistance);
_local21 = Math.sin(_local6) * _local16;
_local20 = -(Math.cos(_local6) * _local16);
_local11 = 0;
_local12 = new Array();
while (true) {
_local15 = false;
for (_local1 in Chars) {
if (((!Chars[_local1].Killed) and (Chars[_local1] != Char)) and (Chars[_local1].Gender != Char.Gender)) {
if (((Math.abs(_local3 - Chars[_local1].x) <= Chars[_local1].HalfWidth) and (_local4 >= Chars[_local1].Top)) and (_local4 <= Chars[_local1].Bottom)) {
Chars[_local1].Hit = true;
_local14 = _local4 - Chars[_local1].y;
if (_local14 < (-Chars[_local1].BodyHeight)) {
_local9 = 0.7;
_local5 = 5;
_local10 = Guns[Char.Gun].Damage;
} else if (_local14 < ((Chars[_local1].Bottom - Chars[_local1].y) / 2)) {
_local9 = -0.5;
_local5 = 10;
_local10 = Guns[Char.Gun].Damage * 0.8;
} else {
_local9 = -0.2;
_local5 = 15;
_local10 = Guns[Char.Gun].Damage * 0.5;
}
if (_local6 < Math.PI) {
_local7 = halfPI;
Chars[_local1].BodyRotation = Chars[_local1].BodyRotation + _local9;
Chars[_local1].BodyRotation = Math.min(1, Chars[_local1].BodyRotation);
Chars[_local1].x = Chars[_local1].x + _local5;
Chars[_local1].Foot1._x = Chars[_local1].Foot1._x + _local5;
Chars[_local1].Foot2._x = Chars[_local1].Foot2._x + _local5;
} else {
_local7 = Math.PI + halfPI;
Chars[_local1].BodyRotation = Chars[_local1].BodyRotation - _local9;
Chars[_local1].BodyRotation = Math.max(-1, Chars[_local1].BodyRotation);
Chars[_local1].x = Chars[_local1].x - _local5;
Chars[_local1].Foot1._x = Chars[_local1].Foot1._x - _local5;
Chars[_local1].Foot2._x = Chars[_local1].Foot2._x - _local5;
}
Chars[_local1].Body._y = (Chars[_local1].y = Math.min(Chars[_local1].y, Field[Chars[_local1].x] - 5));
Chars[_local1].Foot1._y = Math.min(Chars[_local1].Foot1._y, Field[Math.round(Chars[_local1].Foot1._x)]);
Chars[_local1].Foot2._y = Math.min(Chars[_local1].Foot2._y, Field[Math.round(Chars[_local1].Foot2._x)]);
_local8 = (_local7 - (_local6 - _local7)) - Math.PI;
AddTrace(_local3, _local4, _local6, Guns[Char.Gun].RoundType, _local11);
if ((((Guns[Char.Gun].ShotType == 1) or (Guns[Char.Gun].ShotType == 3)) or (Guns[Char.Gun].ShotType == 4)) or (Guns[Char.Gun].ShotType == 5)) {
if ((Mode == 1) and ((Guns[Char.Gun].ShotType == 1) or (Guns[Char.Gun].ShotType == 5))) {
AddFountain(_local3, _local4, 5, 3, 10, _local8 - 0.5, _local8 + 0.5);
}
AddRound(_local3, _local4, RoundPars[Guns[Char.Gun].RoundType].BounceSpeed, _local8, Guns[Char.Gun].RoundType, 100, 100);
}
if (Guns[Char.Gun].ShotType == 2) {
AddPointTrace(_local12, Guns[Char.Gun].RoundType);
AddFountain(_local3, _local4, RoundPars[Guns[Char.Gun].RoundType].BounceSpeed, Guns[Char.Gun].RoundType, 10, 0, dblPI);
}
if ((_local1 == 0) and Shield) {
_local10 = _local10 / 2;
}
Chars[_local1].Damage = Chars[_local1].Damage + _local10;
if (_local1 == 0) {
UpdateDamage();
}
if (Chars[_local1].Damage >= Chars[_local1].MaxDamage) {
if (Char == Chars[0]) {
Score = Score + Chars[_local1].ScoreValue;
BonusTime = BonusTime + Math.round(Chars[_local1].ScoreValue / Math.pow(CurrLevel + 1, 2));
UpdateScore();
}
if (Chars[_local1].Boss) {
if (CurrLevel == 6) {
ExplodingBoss = Chars[_local1];
GamePassed = true;
EndGamePhase = 1;
} else {
PausedBlack._visible = true;
FinishedLevel = true;
Mouse.show();
Cursor._visible = false;
EndLevel.Inside.gotoAndStop(Mode);
EndLevel.gotoAndPlay(2);
DroppedExtraLife = false;
}
} else {
if (Chars[_local1].Gender == 0) {
Chars[_local1].Killed = true;
Chars[_local1].KilledCounter = 0;
Chars[_local1].Move = 0;
Chars[_local1].Ducking = false;
Chars[_local1].FromBack = ((Char.x < Chars[_local1].x) and (Chars[_local1].Direction == 2)) or ((Char.x > Chars[_local1].x) and (Chars[_local1].Direction == 1));
}
if (Chars[_local1].Gender == 1) {
Chars[_local1].Body.removeMovieClip();
Chars[_local1].LArm.removeMovieClip();
Chars[_local1].RArm.removeMovieClip();
Chars[_local1].Foot1.removeMovieClip();
Chars[_local1].Foot2.removeMovieClip();
Chars[_local1].Leg1.removeMovieClip();
Chars[_local1].Leg2.removeMovieClip();
AddPowerUp(1, Chars[_local1].x, Chars[_local1].y, -3);
if (_local1 == 0) {
PowerUps[PowerUps.length - 1].You = true;
YouAreDead = true;
}
Chars.splice(_local1, 1);
}
}
}
_local15 = true;
break;
}
}
}
if (_local15) {
break;
}
if (Field[Math.round(_local3)] <= _local4) {
_local13 = Math.round(_local3);
_local7 = CalcAngle(_local13 - 1, Field[_local13 - 1], _local13 + 1, Field[_local13 + 1]) + halfPI;
_local8 = (_local7 - (_local6 - _local7)) - Math.PI;
AddTrace(_local3, _local4, _local6, Guns[Char.Gun].RoundType, _local11);
if ((((Guns[Char.Gun].ShotType == 1) or (Guns[Char.Gun].ShotType == 3)) or (Guns[Char.Gun].ShotType == 4)) or (Guns[Char.Gun].ShotType == 5)) {
AddRound(_local3, _local4, RoundPars[Guns[Char.Gun].RoundType].BounceSpeed, _local8, Guns[Char.Gun].RoundType, 100, 100);
}
if (Guns[Char.Gun].ShotType == 2) {
AddPointTrace(_local12, Guns[Char.Gun].RoundType);
AddFountain(_local3, _local4, RoundPars[Guns[Char.Gun].RoundType].BounceSpeed, Guns[Char.Gun].RoundType, 10, 0, dblPI);
}
break;
}
if (((((_local3 >= FieldLength) or ((Field[Chars[0].x] - _local4) >= 200)) or (_local3 < 0)) or ((_local3 + GA._x) > 650)) or (_local3 < ((-GA._x) - 50))) {
AddTrace(_local3, _local4, _local6, Guns[Char.Gun].RoundType, _local11);
if (Guns[Char.Gun].ShotType == 2) {
AddPointTrace(_local12, Guns[Char.Gun].RoundType);
}
break;
}
_local3 = _local3 + _local21;
_local4 = _local4 + _local20;
_local11 = _local11 + _local16;
if (Guns[Char.Gun].ShotType == 2) {
if ((_local11 % 15) == 0) {
_local12.push({x:_local3, y:_local4});
}
}
}
_local17++;
}
if ((Guns[Char.Gun].ShotType == 1) or (Guns[Char.Gun].ShotType == 5)) {
if (_local6 > Math.PI) {
Char.BodyRotation = Char.BodyRotation + 0.2;
if (Char.BodyRotation > 1) {
Char.BodyRotation = 1;
}
} else {
Char.BodyRotation = Char.BodyRotation - 0.2;
if (Char.BodyRotation < -1) {
Char.BodyRotation = -1;
}
}
}
if (((Guns[Char.Gun].ShotType == 2) or (Guns[Char.Gun].ShotType == 3)) or (Guns[Char.Gun].ShotType == 4)) {
Char.RArm.Inside.Gun.Inside.gotoAndPlay(2);
}
} else {
AddRound(Char);
}
}
function AddPointTrace(Points, RType) {
var _local1;
var _local3;
_local3 = (100 / Points.length) - 1;
_local1 = 1;
while (_local1 <= Points.length) {
AddRound(Points[Points.length - _local1].x, Points[Points.length - _local1].y, 0, 0, RType, 100 - (_local1 * _local3), 100 - (_local1 * _local3));
_local1++;
}
}
function AddFountain(x, y, RSpeed, RType, Pieces, MinAngle, MaxAngle) {
var _local1;
var _local3;
var _local9 = Math.round(Pieces / 2);
var _local4 = MaxAngle - MinAngle;
_local3 = (Pieces - _local9) + random(Pieces);
_local1 = 1;
while (_local1 <= _local3) {
AddRound(x, y, (RSpeed / 2) + random(RSpeed), MinAngle + (Math.random() * _local4), RType, 100 - random(50), 100);
_local1++;
}
}
function AddRound(x, y, Speed, Angle, Type, Scale, Alpha) {
var _local2;
var _local1;
_local2 = Rounds.length;
_local1 = 1;
while (GA["R" + _local1] instanceof MovieClip) {
_local1++;
}
GA.RoundSample.duplicateMovieClip("R" + _local1, GA.getNextHighestDepth());
Rounds[_local2] = {Symbol:GA["R" + _local1], x:x, y:y, XSpeed:Math.sin(Angle) * Speed, YSpeed:-(Math.cos(Angle) * Speed)};
Rounds[_local2].Symbol._x = x;
Rounds[_local2].Symbol._y = y;
Rounds[_local2].Type = Type;
Rounds[_local2].Symbol.gotoAndStop(Type);
Rounds[_local2].Symbol._xscale = (Rounds[_local2].Symbol._yscale = Scale);
Rounds[_local2].Symbol._alpha = Alpha;
Rounds[_local2].Symbol._rotation = Angle * Rad2Deg;
}
function AddTrace(x, y, Angle, Type, Dist) {
var _local2;
var _local1;
_local2 = Traces.length;
_local1 = 1;
while (GA["T" + _local1] instanceof MovieClip) {
_local1++;
}
GA.TraceSample.duplicateMovieClip("T" + _local1, GA.getNextHighestDepth());
Traces[_local2] = {Symbol:GA["T" + _local1]};
Traces[_local2].Symbol._yscale = Dist;
Traces[_local2].Symbol._x = x;
Traces[_local2].Symbol._y = y;
Traces[_local2].Symbol.gotoAndStop(Type);
Traces[_local2].Counter = 1;
Traces[_local2].Symbol._rotation = Angle * Rad2Deg;
}
function DrawBlood(x, Width) {
var _local2 = CalcAngle(x - 1, Field[x - 1], x + 1, Field[x + 1]);
var _local4;
var _local3;
_local4 = (Math.sin(_local2) * Width) / 2;
_local3 = -((Math.cos(_local2) * Width) / 2);
if (BGMode == 1) {
GA.Ground.beginFill(11141120);
} else {
GA.Ground.beginFill(16711680);
}
GA.Ground.moveTo(x - _local4, Field[x] - _local3);
GA.Ground.lineTo(x + _local4, Field[x] + _local3);
GA.Ground.lineTo(x, (Field[x] + 1) + ((Math.random() * Width) * 10));
GA.Ground.endFill();
}
function AddPowerUp(Type, x, y, Speed) {
var _local1;
var _local2;
_local1 = PowerUps.length;
_local2 = 1;
while (GA["PU" + _local2] instanceof MovieClip) {
_local2++;
}
GA.PowerUpSample.duplicateMovieClip("PU" + _local2, GA.getNextHighestDepth());
PowerUps[_local1] = {Symbol:GA["PU" + _local2]};
PowerUps[_local1].Symbol._x = (PowerUps[_local1].x = x);
PowerUps[_local1].Symbol._y = (PowerUps[_local1].y = y);
if (Type == 1) {
PowerUps[_local1].Symbol.gotoAndStop(Type);
} else {
PowerUps[_local1].Symbol.gotoAndStop(Type + ((Mode - 1) * 10));
}
PowerUps[_local1].Acceleration = 1;
PowerUps[_local1].Width = PowerUpWidths[Type];
PowerUps[_local1].Rotation = halfPI;
PowerUps[_local1].Type = Type;
PowerUps[_local1].Corners = new Array();
PowerUps[_local1].Corners[0] = {x:PowerUps[_local1].x - PowerUps[_local1].Width, y:PowerUps[_local1].y, Speed:Speed};
PowerUps[_local1].Corners[1] = {x:PowerUps[_local1].x + PowerUps[_local1].Width, y:PowerUps[_local1].y, Speed:Speed};
if (Type == 1) {
Corpses.push([PowerUps[_local1].Symbol]);
ClearCorpses();
}
}
function UpdateDamage() {
DamageBar.gotoAndStop(Math.round((Chars[0].Damage / Chars[0].MaxDamage) * 100) + 1);
}
function UpdateScore() {
ScoreText = "SCORE: " + Score;
}
function UpdateAmmo() {
AmmoText = "x " + Ammo;
}
function UpdateLives() {
LivesText = "X " + Lives;
}
function DisplayMessage(MessageText) {
Message.Inside.TheText = MessageText;
Message.gotoAndPlay(2);
}
function CollectPowerUp(Type) {
if (FXOn) {
EatPowerUp.start();
}
switch (Type) {
case 2 :
Ammo = Ammo + 20;
UpdateAmmo();
break;
case 3 :
Chars[0].Damage = Chars[0].Damage - 20;
if (Chars[0].Damage < 0) {
Chars[0].Damage = 0;
}
UpdateDamage();
break;
case 4 :
Chars[0].Speed = 6;
Chars[0].SuperSpeed = true;
Chars[0].SuperSpeedCounter = 0;
SuperSpeedSign._visible = true;
break;
case 5 :
Chars[0].JumpPower = 18;
SuperJump = true;
SuperJumpCounter = 0;
SuperJumpSign._visible = true;
break;
case 6 :
Shield = true;
ShieldCounter = 0;
ShieldSign._visible = true;
break;
case 7 :
CurrGun++;
Chars[0].Gun = GunUpgrades[Mode][CurrGun];
Chars[0].RArm.Inside.Gun.gotoAndStop(GunUpgrades[Mode][CurrGun]);
GIcon.Inside.gotoAndStop(GunUpgrades[Mode][CurrGun]);
GIcon.gotoAndPlay(2);
for (i in LandedPowerUps) {
if (LandedPowerUps[i].Type == 7) {
LandedPowerUps[i].Symbol.Gun.gotoAndStop(GunUpgrades[Mode][CurrGun + 1]);
}
}
break;
case 8 :
Lives++;
UpdateLives();
}
DisplayMessage(PowerUpNames[Mode][Type]);
}
function ClearCorpses() {
var _local1;
var _local2;
if (Mode == 1) {
_local2 = 20;
}
if (Mode == 2) {
_local2 = 50;
}
while (Corpses.length > _local2) {
for (_local1 in Corpses[0]) {
Corpses[0][_local1].removeMovieClip();
}
Corpses.shift();
}
}
function Die() {
RightClickMenu = true;
PausedBlack._visible = true;
PBColor = new Color(PausedBlack);
PBColor.setTransform({aa:0, ab:0});
FinishedLevel = true;
Cursor._visible = false;
Mouse.show();
DieSequence = true;
GACounter = 50;
}
function PassLevel() {
if ((CurrLevel + 1) > Saved.data.LastLevel[Mode]) {
Saved.data.LastLevel[Mode] = CurrLevel + 1;
Saved.flush();
}
SkipCycle = true;
this.gotoAndStop("BonusGame" + Mode);
}
InTheGame = true;
SkipCycle = false;
TimeArray = new Array();
BonusTime = 0;
Mouse.hide();
CurrQuality = 3;
PausedBlack._visible = false;
for (i in GA) {
if (GA[i] instanceof MovieClip) {
GA[i]._visible = false;
}
}
Sky.onRollOver = function () {
if (!FinishedLevel) {
Cursor._visible = true;
}
};
Sky.onRollOut = function () {
Cursor._visible = false;
};
Sky.useHandCursor = false;
RightClickMenu = false;
if (Mode == 1) {
Music.attachSound("MUSICBOYS");
DamageText = "COOTIFICATION:";
}
if (Mode == 2) {
Music.attachSound("MUSICGIRLS");
DamageText = "PAIN:";
}
if (CurrLevel < 6) {
BGMode = Mode;
} else if (Mode == 1) {
BGMode = 2;
} else {
BGMode = 1;
}
Cursor.gotoAndStop(Mode);
AmmoSymbol.gotoAndStop(Mode);
Music.start(0, 1000000);
FieldLength = LevelLengths[CurrLevel];
Field = new Array();
Rounds = new Array();
Traces = new Array();
PowerUps = new Array();
LandedPowerUps = new Array();
BossTime = false;
CharHistory = new Array();
Corpses = new Array();
LivesSymbol.gotoAndStop(Mode);
PowerUpsDuration = 500;
FinishedLevel = false;
YouAreDead = false;
DieSequence = false;
GamePassed = false;
SuperJumpSign._visible = false;
SuperSpeedSign._visible = false;
ShieldSign._visible = false;
SuperSpeedSign.gotoAndStop(Mode);
SuperJumpSign.gotoAndStop(Mode);
ShieldSign.gotoAndStop(Mode);
Ammo = 100;
CurrGun = 0;
Sky.gotoAndStop(BGMode);
MDown = false;
Chars = new Array();
GA.BodySample.gotoAndStop(1);
GA.BodySample.Inside.gotoAndStop(1);
FirstTime = true;
GA.createEmptyMovieClip("BackMountains", GA.getNextHighestDepth());
CurrHeight = 100 + random(100);
CurrAccend = 0.001 - (Math.random() * 0.002);
CurrTemp = 0.01 - (Math.random() * 0.02);
GA.BackMountains.moveTo(0, CurrHeight - 50);
GA.BackMountains.beginFill(BGColors[BGMode][2]);
i = 1;
while (i <= ((FieldLength / 2) + 300)) {
CurrHeight = CurrHeight + CurrAccend;
CurrAccend = CurrAccend + CurrTemp;
if ((random(2) == 0) or (((CurrHeight >= -200) and (CurrHeight <= 300)) and PrevForced)) {
CurrTemp = 0.06 - (Math.random() * 0.1);
PrevForced = false;
}
if ((CurrHeight < -100) and (CurrTemp < 0)) {
OverHeight = -100 - CurrHeight;
CurrTemp = (0.02 + (Math.random() * 0.01)) * Math.sqrt(OverHeight);
PrevForced = true;
}
if ((CurrHeight > 300) and (CurrTemp > 0)) {
OverHeight = CurrHeight - 300;
CurrTemp = (-0.02 - (Math.random() * 0.01)) * Math.sqrt(OverHeight);
PrevForced = true;
}
if (CurrTemp > 0.1) {
CurrTemp = 0.01;
}
if (CurrTemp < -0.1) {
CurrTemp = -0.01;
}
if (CurrAccend > 0.5) {
CurrAccend = 0.5;
}
if (CurrAccend < -0.5) {
CurrAccend = -0.5;
}
if ((i % 10) == 0) {
GA.BackMountains.lineTo(i, CurrHeight - 50);
}
i++;
}
GA.BackMountains.lineTo(i, 1200);
GA.BackMountains.lineTo(0, 1200);
GA.BackMountains.endFill();
CurrHeight = 100 + random(200);
CurrAccend = 0.001 - (Math.random() * 0.002);
CurrTemp = 0.01 - (Math.random() * 0.02);
Field[0] = CurrHeight;
i = 1;
while (i <= FieldLength) {
CurrHeight = CurrHeight + CurrAccend;
CurrAccend = CurrAccend + CurrTemp;
if ((random(10) == 0) or (((CurrHeight >= -200) and (CurrHeight <= 600)) and PrevForced)) {
CurrTemp = 0.05 - (Math.random() * 0.1);
PrevForced = false;
}
if ((CurrHeight < -200) and (CurrTemp < 0)) {
OverHeight = -200 - CurrHeight;
CurrTemp = (0.02 + (Math.random() * 0.01)) * Math.sqrt(OverHeight);
PrevForced = true;
}
if ((CurrHeight > 600) and (CurrTemp > 0)) {
OverHeight = CurrHeight - 600;
CurrTemp = (-0.02 - (Math.random() * 0.01)) * Math.sqrt(OverHeight);
PrevForced = true;
}
if (CurrTemp > 0.1) {
CurrTemp = 0.01;
}
if (CurrTemp < -0.1) {
CurrTemp = -0.01;
}
if (CurrAccend > 0.5) {
CurrAccend = 0.5;
}
if (CurrAccend < -0.5) {
CurrAccend = -0.5;
}
Field[i] = CurrHeight;
i++;
}
i = FieldLength + 1;
while (i <= (FieldLength + 20)) {
Field[i] = Field[FieldLength];
i++;
}
i = 0;
PlaceX = 1;
while (PlaceX <= FieldLength) {
if (random(1000) == 0) {
GA.BGSample.duplicateMovieClip("BBG" + i, GA.getNextHighestDepth());
Type = random((BGTypes[BGMode + 2][1] - BGTypes[BGMode + 2][0]) + 1) + BGTypes[BGMode + 2][0];
PlaceX = PlaceX + BGBaseWidths[Type];
Rot = CalcAngle(PlaceX - 1, Field[PlaceX - 1], PlaceX + 1, Field[PlaceX + 1]) - halfPI;
GA["BBG" + i].gotoAndStop(Type);
GA["BBG" + i]._x = PlaceX;
LowestY = -Infinity;
x = PlaceX - BGBaseWidths[Type];
while (x <= (PlaceX + BGBaseWidths[Type])) {
if (Field[x] > LowestY) {
LowestY = Field[x];
}
x++;
}
GA["BBG" + i]._y = LowestY;
if (random(2) == 0) {
GA["BBG" + i]._xscale = -GA["BBG" + i]._xscale;
}
PlaceX = PlaceX + BGBaseWidths[Type];
i++;
}
PlaceX++;
}
i = 1;
while (i <= (FieldLength / 50)) {
PlaceX = random(FieldLength);
Rot = CalcAngle(PlaceX - 1, Field[PlaceX - 1], PlaceX + 1, Field[PlaceX + 1]) - halfPI;
GA.BGSample.duplicateMovieClip("BG" + i, GA.getNextHighestDepth());
Type = random((BGTypes[BGMode][1] - BGTypes[BGMode][0]) + 1) + BGTypes[BGMode][0];
GA["BG" + i].gotoAndStop(Type);
GA["BG" + i]._x = PlaceX;
GA["BG" + i]._xscale = (GA["BG" + i]._yscale = 50 + random(100));
GA["BG" + i]._y = Field[PlaceX];
GA["BG" + i]._rotation = Rot * Rad2Deg;
if (random(2) == 0) {
GA["BG" + i]._xscale = -GA["BG" + i]._xscale;
}
i++;
}
GA.BGSample.duplicateMovieClip("ThisWay", GA.getNextHighestDepth());
GA.ThisWay._x = 200;
GA.ThisWay._y = Field[GA.ThisWay._x];
GA.ThisWay.gotoAndStop(21 + (BGMode * 2));
GA.BGSample.duplicateMovieClip("Boss", GA.getNextHighestDepth());
GA.Boss._x = FieldLength - 600;
GA.Boss._y = Field[GA.Boss._x];
GA.Boss.gotoAndStop(22 + (BGMode * 2));
GA.createEmptyMovieClip("Ground", GA.getNextHighestDepth());
GA.Ground.moveTo(0, CurrHeight);
GA.Ground.beginFill(BGColors[BGMode][1]);
x = 10;
while (x <= FieldLength) {
GA.Ground.lineTo(x, Field[x]);
x = x + 10;
}
GA.Ground.lineTo(FieldLength, 1200);
GA.Ground.lineTo(0, 1200);
GA.Ground.endFill();
if (BGMode == 2) {
GA.Ground.beginFill(BGColors[BGMode][3]);
GA.Ground.moveTo(0, Field[0]);
x = 10;
while (x <= FieldLength) {
GA.Ground.lineTo(x, Field[x] + 60);
x = x + 10;
}
GA.Ground.lineTo(FieldLength, (Field[FieldLength] + 140) + random(5));
x = FieldLength - 10;
while (x >= 0) {
GA.Ground.lineTo(x, (Field[x] + 140) + random(5));
x = x - 10;
}
GA.Ground.endFill();
GA.Ground.beginFill(BGColors[BGMode][4]);
GA.Ground.moveTo(0, Field[0]);
x = 10;
while (x <= FieldLength) {
GA.Ground.lineTo(x, Field[x] + 20);
x = x + 10;
}
GA.Ground.lineTo(FieldLength, (Field[FieldLength] + 60) + random(10));
x = FieldLength - 10;
while (x >= 0) {
GA.Ground.lineTo(x, (Field[x] + 60) + random(10));
x = x - 10;
}
GA.Ground.endFill();
GA.Ground.beginFill(BGColors[BGMode][5]);
GA.Ground.moveTo(0, Field[0]);
x = 10;
while (x <= FieldLength) {
GA.Ground.lineTo(x, Field[x]);
x = x + 10;
}
GA.Ground.lineTo(FieldLength, (Field[FieldLength] + 20) + random(20));
x = FieldLength - 10;
while (x >= 0) {
GA.Ground.lineTo(x, (Field[x] + 20) + random(20));
x = x - 10;
}
GA.Ground.endFill();
}
AddChar(320, Mode);
Chars[0].MaxDamage = 150;
Chars[0].SuperSpeed = (SuperJump = (Shield = false));
UpdateDamage();
UpdateScore();
UpdateAmmo();
UpdateLives();
if (UpgradesPerLevel[CurrLevel] > 0) {
OnePart = Math.round(FieldLength / (UpgradesPerLevel[CurrLevel] + 1));
i = 1;
while (i <= UpgradesPerLevel[CurrLevel]) {
AddPowerUp(7, i * OnePart, Field[i * OnePart] - 10, 0);
PowerUps[PowerUps.length - 1].Symbol.Gun.gotoAndStop(GunUpgrades[Mode][CurrGun + 1]);
i++;
}
}
Frame 11
Time = new Date();
if (AQC and (!FirstTime)) {
TimeDiff = Time - PrevTime;
TimeArray.push(TimeDiff);
TotalTime = 0;
for (i in TimeArray) {
TotalTime = TotalTime + TimeArray[i];
}
AvTime = TotalTime / TimeArray.length;
while (TimeArray.length > 25) {
TimeArray.shift();
}
if ((AvTime > 55) and (CurrQuality > 1)) {
CurrQuality--;
this._quality = QualityNames[CurrQuality];
}
if ((AvTime < 50) and (CurrQuality < 3)) {
CurrQuality++;
this._quality = QualityNames[CurrQuality];
}
}
PrevTime = Time;
if ((!RightClickMenu) and (!FinishedLevel)) {
Cursor._x = _xmouse;
Cursor._y = _ymouse;
if (FirstTime) {
if (CurrLevel == 1) {
DisplayMessage("Right-Click for Options (Control-Click on Mac)");
} else {
DisplayMessage("LEVEL " + CurrLevel);
}
}
Chars[0].Move = 0;
if ((!Chars[ch].Killed) and (!YouAreDead)) {
if (Key.isDown(37) or Key.isDown(65)) {
Chars[0].Move = 1;
}
if (Key.isDown(39) or Key.isDown(68)) {
Chars[0].Move = 2;
}
if (Key.isDown(38) or Key.isDown(87)) {
Chars[0].Jumping = true;
if (Chars[0].JumpingPhase == 2) {
Chars[0].JumpingPhase = 0;
}
}
Chars[0].Ducking = Key.isDown(40) or Key.isDown(83);
Chars[0].AimingAngle = CalcAngle(Chars[0].ArmX, Chars[0].ArmY, GA._xmouse, GA._ymouse);
}
TotalOnScreen = 0;
for (ch in Chars) {
Chars[ch].OnScreen = ((Chars[ch].x + GA._x) < (630 + Chars[ch].HalfWidth)) and (Chars[ch].x > (((-GA._x) - Chars[ch].HalfWidth) - 30));
if ((ch != 0) and Chars[ch].OnScreen) {
TotalOnScreen++;
}
if (Chars[ch].Move > 0) {
Chars[ch].Direction = Chars[ch].Move;
}
Chars[ch].RealSpeed = Chars[ch].Speed;
if (Chars[ch].Ducking and ((!Chars[ch].Jumping) or (Chars[ch].JumpingPhase != 1))) {
Chars[ch].RealSpeed = Chars[ch].Speed - 2;
}
if (Chars[ch].Move == 1) {
Chars[ch].x = Chars[ch].x - Chars[ch].RealSpeed;
if (Chars[ch].SuperSpeed) {
Chars[ch].GlobalPhase = Chars[ch].GlobalPhase - 2;
} else {
Chars[ch].GlobalPhase--;
}
if (Chars[ch].GlobalPhase < 0) {
Chars[ch].GlobalPhase = Chars[ch].GlobalPhase + 13;
}
Chars[ch].Foot1._xscale = (Chars[ch].Foot2._xscale = (Chars[ch].Body._xscale = (Chars[ch].Leg1._xscale = (Chars[ch].Leg2._xscale = -100))));
}
if (Chars[ch].Move == 2) {
Chars[ch].x = Chars[ch].x + Chars[ch].RealSpeed;
if (Chars[ch].SuperSpeed) {
Chars[ch].GlobalPhase = Chars[ch].GlobalPhase + 2;
} else {
Chars[ch].GlobalPhase++;
}
if (Chars[ch].GlobalPhase >= 12) {
Chars[ch].GlobalPhase = Chars[ch].GlobalPhase - 12;
}
Chars[ch].Foot1._xscale = (Chars[ch].Foot2._xscale = (Chars[ch].Body._xscale = (Chars[ch].Leg1._xscale = (Chars[ch].Leg2._xscale = 100))));
}
Chars[ch].x = Math.round(Chars[ch].x);
if (ch == 0) {
if (Chars[ch].x < 20) {
Chars[ch].x = 20;
}
if (Chars[ch].x > (FieldLength - 20)) {
Chars[ch].x = FieldLength - 20;
}
} else {
if (Chars[ch].x < 0) {
Chars[ch].x = 0;
Chars[ch].Move = 2;
}
if (Chars[ch].x > FieldLength) {
Chars[ch].x = FieldLength;
Chars[ch].Move = 1;
}
}
if (Chars[ch].OnScreen or Chars[ch].Killed) {
if ((((((((((Chars[ch].Move > 0) or (FootHeight[Math.round(Chars[ch].Foot1Phase)] > Chars[ch].Diff1)) or (FootHeight[Math.round(Chars[ch].Foot2Phase)] > Chars[ch].Diff2)) or Chars[ch].Jumping) or Chars[ch].Ducking) or (Chars[ch].DuckingShift > 0)) or Chars[ch].Hit) or (Chars[ch].BodyRotation != 0)) or Chars[ch].Killed) or (!Chars[ch].PrevOnScreen)) {
if (Chars[ch].Move == 0) {
if (FootHeight[Math.round(Chars[ch].Foot1Phase)] > Chars[ch].Diff1) {
Chars[ch].Diff1++;
if ((Chars[ch].Diff1 > FootHeight[Math.round(Chars[ch].Foot1Phase)]) or (Chars[ch].Foot1Phase > 8)) {
Chars[ch].Diff1 = FootHeight[Math.round(Chars[ch].Foot1Phase)];
}
}
if (FootHeight[Math.round(Chars[ch].Foot2Phase)] > Chars[ch].Diff2) {
Chars[ch].Diff2++;
if ((Chars[ch].Diff2 > FootHeight[Math.round(Chars[ch].Foot2Phase)]) or (Chars[ch].Foot2Phase > 8)) {
Chars[ch].Diff2 = FootHeight[Math.round(Chars[ch].Foot2Phase)];
}
}
} else {
if (Chars[ch].Diff1 > 0) {
Chars[ch].Diff1 = Chars[ch].Diff1 - 2;
if (Chars[ch].Diff1 < 0) {
Chars[ch].Diff1 = 0;
}
}
if (Chars[ch].Diff2 > 0) {
Chars[ch].Diff2 = Chars[ch].Diff2 - 2;
if (Chars[ch].Diff2 < 0) {
Chars[ch].Diff2 = 0;
}
}
}
Chars[ch].Body._x = Chars[ch].x;
if (((!Chars[ch].Jumping) or (Chars[ch].JumpingPhase != 1)) and (!Chars[ch].Killed)) {
Chars[ch].Foot1Phase = Chars[ch].GlobalPhase;
Chars[ch].Foot2Phase = Chars[ch].GlobalPhase + 6;
if (Chars[ch].SuperSpeed) {
Div = 2;
} else {
Div = 1;
}
if (Chars[ch].Foot2Phase >= 12) {
Chars[ch].Foot2Phase = Chars[ch].Foot2Phase - 12;
}
if (Chars[ch].Foot1Phase <= 6) {
Chars[ch].Foot1._x = (Chars[ch].x - ((Chars[ch].RealSpeed * 3) / Div)) + ((Chars[ch].RealSpeed * Chars[ch].Foot1Phase) / Div);
Chars[ch].Foot1._y = ((Field[Chars[ch].Foot1._x] - FootHeight[Math.round(Chars[ch].Foot1Phase)]) + Chars[ch].Diff1) - 1;
FootAng = CalcAngle(Chars[ch].Foot1._x - 1, Field[Chars[ch].Foot1._x - 1], Chars[ch].Foot1._x + 1, Field[Chars[ch].Foot1._x + 1]);
} else {
Chars[ch].Foot1._y = (Field[Chars[ch].Foot1._x] + Chars[ch].Diff1) - 1;
}
if (Chars[ch].Foot2Phase <= 6) {
Chars[ch].Foot2._x = (Chars[ch].x - ((Chars[ch].RealSpeed * 3) / Div)) + ((Chars[ch].RealSpeed * Chars[ch].Foot2Phase) / Div);
Chars[ch].Foot2._y = ((Field[Chars[ch].Foot2._x] - FootHeight[Math.round(Chars[ch].Foot2Phase)]) + Chars[ch].Diff2) - 1;
FootAng = CalcAngle(Chars[ch].Foot2._x - 1, Field[Chars[ch].Foot2._x - 1], Chars[ch].Foot2._x + 1, Field[Chars[ch].Foot2._x + 1]);
} else {
Chars[ch].Foot2._y = (Field[Chars[ch].Foot2._x] + Chars[ch].Diff2) - 1;
}
}
if (Chars[ch].Jumping) {
switch (Chars[ch].JumpingPhase) {
case 0 :
Chars[ch].BodyShift = Chars[ch].BodyShift + 4;
if (Chars[ch].BodyShift >= 4) {
Chars[ch].JumpingPhase = 1;
Chars[ch].Acceleration = Chars[ch].JumpPower;
Chars[ch].Foot1Shift = Chars[ch].Foot1._x - Chars[ch].x;
Chars[ch].Foot2Shift = Chars[ch].Foot2._x - Chars[ch].x;
}
break;
case 1 :
Chars[ch].Acceleration--;
Chars[ch].BodyShift = 0;
Chars[ch].Foot1._y = Chars[ch].Foot1._y - Chars[ch].Acceleration;
Chars[ch].Foot2._y = Chars[ch].Foot2._y - Chars[ch].Acceleration;
if (Chars[ch].Acceleration > 0) {
if (Chars[ch].Foot1Shift >= 0) {
Chars[ch].Foot1Shift = Chars[ch].Foot1Shift + 2;
} else {
Chars[ch].Foot1Shift = Chars[ch].Foot1Shift - 2;
}
if (Chars[ch].Foot2Shift > 0) {
Chars[ch].Foot2Shift = Chars[ch].Foot2Shift + 2;
} else {
Chars[ch].Foot2Shift = Chars[ch].Foot2Shift - 2;
}
Chars[ch].Foot1Shift = Math.min(Math.max(Chars[ch].Foot1Shift, -10), 10);
Chars[ch].Foot2Shift = Math.min(Math.max(Chars[ch].Foot2Shift, -10), 10);
} else {
Chars[ch].Foot1Shift = Chars[ch].Foot1Shift * 0.7;
Chars[ch].Foot2Shift = Chars[ch].Foot2Shift * 0.7;
}
Chars[ch].Foot1._x = Math.round(Chars[ch].x + Chars[ch].Foot1Shift);
Chars[ch].Foot2._x = Math.round(Chars[ch].x + Chars[ch].Foot2Shift);
if (Chars[ch].Foot1._y >= Field[Chars[ch].Foot1._x]) {
Chars[ch].Foot1._y = Field[Chars[ch].Foot1._x];
Chars[ch].Foot1OnTheGround = true;
} else {
Chars[ch].Foot1OnTheGround = false;
}
if (Chars[ch].Foot2._y > Field[Chars[ch].Foot2._x]) {
Chars[ch].Foot2._y = Field[Chars[ch].Foot2._x];
Chars[ch].Foot2OnTheGround = true;
} else {
Chars[ch].Foot2OnTheGround = false;
}
if (Chars[ch].Foot1OnTheGround and Chars[ch].Foot2OnTheGround) {
if (!Chars[ch].Killed) {
Chars[ch].JumpingPhase = 2;
Chars[ch].BodyShift = 2;
Chars[ch].Acceleration = 2;
Chars[ch].GlobalPhase = 3;
Chars[ch].Diff2 = 0;
Chars[ch].Diff1 = FootHeight[3];
} else {
Chars[ch].Jumping = false;
}
}
break;
case 2 :
Chars[ch].BodyShift = Chars[ch].BodyShift + Chars[ch].Acceleration;
if ((Chars[ch].BodyShift + Chars[ch].DuckingShift) > (Chars[ch].LegLength - 10)) {
Chars[ch].BodyShift = (Chars[ch].LegLength - Chars[ch].DuckingShift) - 10;
}
Chars[ch].Acceleration = Chars[ch].Acceleration - 0.5;
if (Chars[ch].BodyShift > 0) {
break;
}
Chars[ch].Jumping = false;
Chars[ch].JumpingPhase = 0;
}
}
if (Chars[ch].Ducking) {
if ((Chars[ch].BodyShift + Chars[ch].DuckingShift) < ((Chars[ch].LegLength - FootHeight[3]) / 1.5)) {
Chars[ch].DuckingShift = Chars[ch].DuckingShift + 2;
}
if ((Chars[ch].Direction == 2) and (Chars[ch].DuckingRotation < 0.6)) {
Chars[ch].DuckingRotation = Chars[ch].DuckingRotation + 0.2;
}
if ((Chars[ch].Direction == 1) and (Chars[ch].DuckingRotation > -0.6)) {
Chars[ch].DuckingRotation = Chars[ch].DuckingRotation - 0.2;
}
} else {
Chars[ch].DuckingRotation = 0;
if (Chars[ch].DuckingShift > 0) {
Chars[ch].DuckingShift = Chars[ch].DuckingShift - 2;
}
if (Chars[ch].DuckingShift < 0) {
Chars[ch].DuckingShift = 0;
}
}
if (Chars[ch].Killed) {
Chars[ch].BodyShift = Chars[ch].BodyShift + 2;
if (((Chars[ch].Direction == 2) and (!Chars[ch].FromBack)) or ((Chars[ch].Direction == 1) and Chars[ch].FromBack)) {
DesiredFoot = Chars[ch].x + (Chars[ch].LegLength * 0.9);
DesiredAngle = CalcAngle(Chars[ch].x, Field[Chars[ch].x], Chars[ch].x - Chars[ch].BodyHeight, Field[Chars[ch].x - Chars[ch].BodyHeight]);
GlobalHeadAngle = CalcAngle(Chars[ch].x, Field[Math.round(Chars[ch].x)], Chars[ch].x - Chars[ch].BodyAndHead, Field[Chars[ch].x - Chars[ch].BodyAndHead]);
if (Chars[ch].FromBack) {
AddRot = -0.5;
} else {
AddRot = 0.5;
}
DesiredHeadAngle = Math.round((((GlobalHeadAngle - Chars[ch].BodyRotation) + AddRot) + halfPI) * Rad2Deg);
DesiredFeetAngle = -80;
}
if (((Chars[ch].Direction == 1) and (!Chars[ch].FromBack)) or ((Chars[ch].Direction == 2) and Chars[ch].FromBack)) {
DesiredFoot = Chars[ch].x - (Chars[ch].LegLength * 0.9);
DesiredAngle = CalcAngle(Chars[ch].x, Field[Chars[ch].x], Chars[ch].x + Chars[ch].BodyHeight, Field[Chars[ch].x + Chars[ch].BodyHeight]);
GlobalHeadAngle = CalcAngle(Chars[ch].x, Field[Math.round(Chars[ch].x)], Chars[ch].x + Chars[ch].BodyAndHead, Field[Chars[ch].x + Chars[ch].BodyAndHead]);
if (Chars[ch].FromBack) {
AddRot = -0.5;
} else {
AddRot = 0.5;
}
DesiredHeadAngle = Math.round((((GlobalHeadAngle - Chars[ch].BodyRotation) + AddRot) + halfPI) * Rad2Deg);
DesiredFeetAngle = 80;
}
if (DesiredHeadAngle > 180) {
DesiredHeadAngle = -(360 - DesiredHeadAngle);
}
if (DesiredAngle > Math.PI) {
DesiredAngle = -(dblPI - DesiredAngle);
}
Chars[ch].Body.Head._xscale = 100;
if (Chars[ch].Body.Head._rotation < DesiredHeadAngle) {
Chars[ch].Body.Head._rotation = Chars[ch].Body.Head._rotation + 10;
if (Chars[ch].Body.Head._rotation > DesiredHeadAngle) {
Chars[ch].Body.Head._rotation = DesiredHeadAngle;
}
}
if (Chars[ch].Body.Head._rotation > DesiredHeadAngle) {
Chars[ch].Body.Head._rotation = Chars[ch].Body.Head._rotation - 10;
if (Chars[ch].Body.Head._rotation < DesiredHeadAngle) {
Chars[ch].Body.Head._rotation = DesiredHeadAngle;
}
}
if (Chars[ch].Foot1._rotation > DesiredFeetAngle) {
Chars[ch].Foot1._rotation = Chars[ch].Foot1._rotation - 5;
if (Chars[ch].Foot1._rotation < DesiredFeetAngle) {
Chars[ch].Foot1._rotation = DesiredFeetAngle;
}
}
if (Chars[ch].Foot1._rotation < DesiredFeetAngle) {
Chars[ch].Foot1._rotation = Chars[ch].Foot1._rotation + 5;
if (Chars[ch].Foot1._rotation > DesiredFeetAngle) {
Chars[ch].Foot1._rotation = DesiredFeetAngle;
}
}
if (Chars[ch].Foot2._rotation > DesiredFeetAngle) {
Chars[ch].Foot2._rotation = Chars[ch].Foot2._rotation - 5;
if (Chars[ch].Foot2._rotation < DesiredFeetAngle) {
Chars[ch].Foot2._rotation = DesiredFeetAngle;
}
}
if (Chars[ch].Foot2._rotation < DesiredFeetAngle) {
Chars[ch].Foot2._rotation = Chars[ch].Foot2._rotation + 5;
if (Chars[ch].Foot2._rotation > DesiredFeetAngle) {
Chars[ch].Foot2._rotation = DesiredFeetAngle;
}
}
if (Chars[ch].Foot1._x < DesiredFoot) {
Chars[ch].Foot1._x = Chars[ch].Foot1._x + 2;
if (Chars[ch].Foot1._x > DesiredFoot) {
Chars[ch].Foot1._x = DesiredFoot;
}
}
if (Chars[ch].Foot1._x > DesiredFoot) {
Chars[ch].Foot1._x = Chars[ch].Foot1._x - 2;
if (Chars[ch].Foot1._x < DesiredFoot) {
Chars[ch].Foot1._x = DesiredFoot;
}
}
if (Chars[ch].Foot2._x < DesiredFoot) {
Chars[ch].Foot2._x = Chars[ch].Foot2._x + 2;
if (Chars[ch].Foot2._x > DesiredFoot) {
Chars[ch].Foot2._x = DesiredFoot;
}
}
if (Chars[ch].Foot2._x > DesiredFoot) {
Chars[ch].Foot2._x = Chars[ch].Foot2._x - 2;
if (Chars[ch].Foot2._x < DesiredFoot) {
Chars[ch].Foot2._x = DesiredFoot;
}
}
if (Chars[ch].FromBack) {
AddFoot = -3;
} else {
AddFoot = 0;
}
if (Chars[ch].Foot1._y >= (Math.round(Field[Chars[ch].Foot1._x]) + AddFoot)) {
Chars[ch].Foot1._y = Math.round(Field[Chars[ch].Foot1._x]) + AddFoot;
} else {
Chars[ch].Foot1._y = Chars[ch].Foot1._y + 2;
}
if (Chars[ch].Foot2._y >= (Math.round(Field[Chars[ch].Foot2._x]) + AddFoot)) {
Chars[ch].Foot2._y = Math.round(Field[Chars[ch].Foot2._x]) + AddFoot;
} else {
Chars[ch].Foot2._y = Chars[ch].Foot2._y + 2;
}
if (Chars[ch].FromBack) {
AddAim = 10;
} else {
AddAim = -10;
}
Chars[ch].AimingAngle = CalcAngle(Chars[ch].ArmX, Chars[ch].ArmY, Chars[ch].Foot1._x, Chars[ch].Foot1._y + AddAim);
Chars[ch].LArm._rotation = CalcAngle(Chars[ch].ArmX, Chars[ch].ArmY, Chars[ch].Foot1._x, Chars[ch].Foot1._y) * Rad2Deg;
if (Chars[ch].BodyRotation < DesiredAngle) {
Chars[ch].BodyRotation = Chars[ch].BodyRotation + 0.15;
if (Chars[ch].BodyRotation > DesiredAngle) {
Chars[ch].BodyRotation = DesiredAngle;
}
}
if (Chars[ch].BodyRotation > DesiredAngle) {
Chars[ch].BodyRotation = Chars[ch].BodyRotation - 0.15;
if (Chars[ch].BodyRotation < DesiredAngle) {
Chars[ch].BodyRotation = DesiredAngle;
}
}
}
Gipo = Chars[ch].LegLength;
Kat = Chars[ch].Foot1._x - Chars[ch].x;
BHeight1 = Chars[ch].Foot1._y - Math.sqrt(Math.pow(Gipo, 2) - Math.pow(Kat, 2));
Kat = Chars[ch].Foot2._x - Chars[ch].x;
BHeight2 = Chars[ch].Foot2._y - Math.sqrt(Math.pow(Gipo, 2) - Math.pow(Kat, 2));
Chars[ch].y = (Math.max(BHeight1, BHeight2) + Chars[ch].BodyShift) + Chars[ch].DuckingShift;
if ((!Chars[ch].Killed) and (Chars[ch].y >= (Chars[ch].Foot1._y + 5))) {
Chars[ch].y = Chars[ch].Foot1._y + 5;
}
if ((!Chars[ch].Killed) and (Chars[ch].y >= (Chars[ch].Foot2._y + 5))) {
Chars[ch].y = Chars[ch].Foot2._y + 5;
}
if (Chars[ch].y > Field[Chars[ch].x]) {
Chars[ch].y = Field[Chars[ch].x];
}
Chars[ch].Body._y = Chars[ch].y;
Chars[ch].Body._rotation = Chars[ch].BodyRotation * Rad2Deg;
if (!Chars[ch].Killed) {
if (Chars[ch].BodyRotation > Chars[ch].DuckingRotation) {
Chars[ch].BodyRotation = Chars[ch].BodyRotation - 0.1;
}
if (Chars[ch].BodyRotation < Chars[ch].DuckingRotation) {
Chars[ch].BodyRotation = Chars[ch].BodyRotation + 0.1;
}
if (Math.abs(Chars[ch].BodyRotation - Chars[ch].DuckingRotation) < 0.1) {
Chars[ch].Hit = false;
Chars[ch].BodyRotation = Chars[ch].DuckingRotation;
}
}
Chars[ch].ArmX = Chars[ch].x + (Math.sin(Chars[ch].BodyRotation) * Chars[ch].BodyHeight);
Chars[ch].ArmY = Chars[ch].y - (Math.cos(Chars[ch].BodyRotation) * Chars[ch].BodyHeight);
Chars[ch].LArm._x = Chars[ch].ArmX;
Chars[ch].LArm._y = Chars[ch].ArmY;
Chars[ch].RArm._x = Chars[ch].ArmX;
Chars[ch].RArm._y = Chars[ch].ArmY;
Chars[ch].Top = Chars[ch].y - (Math.cos(Chars[ch].BodyRotation) * Chars[ch].BodyAndHead);
Chars[ch].Bottom = Math.max(Chars[ch].Foot1._y, Chars[ch].Foot2._y);
Chars[ch].Leg1._x = (Chars[ch].Leg2._x = Chars[ch].x);
Chars[ch].Leg1._y = (Chars[ch].Leg2._y = Chars[ch].y);
LegDir = CalcAngle(Chars[ch].x, Chars[ch].y, Chars[ch].Foot1._x, Chars[ch].Foot1._y);
Chars[ch].Leg1._rotation = (LegDir * Rad2Deg) + 180;
DisToLeg = CalcDistance(Chars[ch].x, Chars[ch].y, Chars[ch].Foot1._x, Chars[ch].Foot1._y);
if (DisToLeg >= Chars[ch].LegLength) {
BendAngle = 0;
} else if (DisToLeg <= 0) {
BendAngle = 90;
} else {
BendAngle = Math.acos(DisToLeg / Chars[ch].LegLength);
BendAngle = BendAngle * Rad2Deg;
}
Chars[ch].Leg1.UpperLeg._rotation = -BendAngle;
Chars[ch].Leg1.UpperLeg.LowerLeg._rotation = BendAngle - Chars[ch].Leg1.UpperLeg._rotation;
LegDir = CalcAngle(Chars[ch].x, Chars[ch].y, Chars[ch].Foot2._x, Chars[ch].Foot2._y);
Chars[ch].Leg2._rotation = (LegDir * Rad2Deg) + 180;
DisToLeg = CalcDistance(Chars[ch].x, Chars[ch].y, Chars[ch].Foot2._x, Chars[ch].Foot2._y);
if (DisToLeg >= Chars[ch].LegLength) {
BendAngle = 0;
} else if (DisToLeg <= 0) {
BendAngle = 90;
} else {
BendAngle = Math.acos(DisToLeg / Chars[ch].LegLength);
BendAngle = BendAngle * Rad2Deg;
}
Chars[ch].Leg2.UpperLeg._rotation = -BendAngle;
Chars[ch].Leg2.UpperLeg.LowerLeg._rotation = BendAngle - Chars[ch].Leg2.UpperLeg._rotation;
}
if (Chars[ch].SkirtLength > 0) {
Chars[ch].SkirtMask1._x = (Chars[ch].SkirtMask2._x = (Chars[ch].Skirt3._x = (Chars[ch].Skirt1._x = (Chars[ch].Skirt2._x = Chars[ch].x))));
Chars[ch].SkirtMask1._y = (Chars[ch].SkirtMask2._y = (Chars[ch].Skirt3._y = (Chars[ch].Skirt1._y = (Chars[ch].Skirt2._y = Chars[ch].y))));
if (Chars[ch].Direction == 2) {
Mult = 1;
} else {
Mult = -1;
}
Chars[ch].Skirt1._rotation = Chars[ch].Leg1._rotation + (Chars[ch].Leg1.UpperLeg._rotation * Mult);
Chars[ch].Skirt2._rotation = Chars[ch].Leg2._rotation + (Chars[ch].Leg2.UpperLeg._rotation * Mult);
i = 2;
while (i <= 3) {
Chars[ch].PreviousLocal[i] = {x:Chars[ch].PreviousGlobal[i].x - Chars[ch].x, y:Chars[ch].PreviousGlobal[i].y - Chars[ch].y};
i++;
}
Chars[ch].SkirtPoints[0] = {x:-(Math.sin(Chars[ch].BodyRotation + halfPI) * Chars[ch].SkirtWidth), y:0 + (Math.cos(Chars[ch].BodyRotation + halfPI) * Chars[ch].SkirtWidth)};
Chars[ch].SkirtPoints[1] = {x:-Chars[ch].SkirtPoints[0].x, y:-Chars[ch].SkirtPoints[0].y};
ShiftX = Math.sin(Chars[ch].BodyRotation) * Chars[ch].SkirtHeight;
ShiftY = Math.cos(Chars[ch].BodyRotation) * Chars[ch].SkirtHeight;
Chars[ch].SkirtPoints[0].x = Chars[ch].SkirtPoints[0].x + ShiftX;
Chars[ch].SkirtPoints[0].y = Chars[ch].SkirtPoints[0].y - ShiftY;
Chars[ch].SkirtPoints[1].x = Chars[ch].SkirtPoints[1].x + ShiftX;
Chars[ch].SkirtPoints[1].y = Chars[ch].SkirtPoints[1].y - ShiftY;
Chars[ch].SkirtRotations[0] = CalcAngle(Chars[ch].SkirtPoints[0].x, Chars[ch].SkirtPoints[0].y, Chars[ch].PreviousLocal[3].x, Chars[ch].PreviousLocal[3].y);
Chars[ch].SkirtRotations[1] = CalcAngle(Chars[ch].SkirtPoints[1].x, Chars[ch].SkirtPoints[1].y, Chars[ch].PreviousLocal[2].x, Chars[ch].PreviousLocal[2].y);
i = 0;
while (i <= 1) {
RotDiff = Chars[ch].SkirtRotations[i] - Chars[ch].OriginalSkirtRotations[i];
RotDiff = RotDiff * 0.5;
Chars[ch].SkirtRotations[i] = Chars[ch].OriginalSkirtRotations[i] + RotDiff;
i++;
}
MinRot = Math.min(Chars[ch].Skirt1._rotation, Chars[ch].Skirt2._rotation);
MaxRot = Math.max(Chars[ch].Skirt1._rotation, Chars[ch].Skirt2._rotation);
MinRot = MinRot + 180;
MaxRot = MaxRot + 180;
MinRot = MinRot / Rad2Deg;
MaxRot = MaxRot / Rad2Deg;
Chars[ch].SkirtRotations[0] = Math.max(Chars[ch].SkirtRotations[0], MaxRot);
Chars[ch].SkirtRotations[1] = Math.min(Chars[ch].SkirtRotations[1], MinRot);
Chars[ch].SkirtPoints[2] = {x:Chars[ch].SkirtPoints[1].x + (Math.sin(Chars[ch].SkirtRotations[1]) * Chars[ch].SkirtLength), y:Chars[ch].SkirtPoints[1].y - (Math.cos(Chars[ch].SkirtRotations[1]) * Chars[ch].SkirtLength)};
Chars[ch].SkirtPoints[3] = {x:Chars[ch].SkirtPoints[0].x + (Math.sin(Chars[ch].SkirtRotations[0]) * Chars[ch].SkirtLength), y:Chars[ch].SkirtPoints[0].y - (Math.cos(Chars[ch].SkirtRotations[0]) * Chars[ch].SkirtLength)};
if ((Chars[ch].y + Chars[ch].SkirtPoints[2].y) > Field[Math.round(Chars[ch].SkirtPoints[2].x + Chars[ch].x)]) {
Chars[ch].SkirtPoints[2].x = Chars[ch].SkirtPoints[3].x;
Chars[ch].SkirtPoints[2].y = Field[Math.round(Chars[ch].SkirtPoints[2].x + Chars[ch].x)] - Chars[ch].y;
}
if ((Chars[ch].y + Chars[ch].SkirtPoints[3].y) > Field[Math.round(Chars[ch].SkirtPoints[3].x + Chars[ch].x)]) {
Chars[ch].SkirtPoints[3].x = Chars[ch].SkirtPoints[2].x;
Chars[ch].SkirtPoints[3].y = Field[Math.round(Chars[ch].SkirtPoints[3].x + Chars[ch].x)] - Chars[ch].y;
}
i = 2;
while (i <= 3) {
Chars[ch].PreviousGlobal[i] = {x:Chars[ch].SkirtPoints[i].x + Chars[ch].x, y:Chars[ch].SkirtPoints[i].y + Chars[ch].y};
i++;
}
MaskPoints = new Array();
MaskPoints[0] = {x:Chars[ch].LegLength * Math.sin(Chars[ch].BodyRotation - 1), y:-(Chars[ch].LegLength * Math.cos(Chars[ch].BodyRotation - 1))};
MaskPoints[1] = {x:Chars[ch].LegLength * Math.sin(Chars[ch].BodyRotation + 1), y:-(Chars[ch].LegLength * Math.cos(Chars[ch].BodyRotation + 1))};
MaskPoints[2] = {x:MaskPoints[1].x + (Chars[ch].LegLength * Math.sin(Chars[ch].BodyRotation + Math.PI)), y:MaskPoints[1].y - (Chars[ch].LegLength * Math.cos(Chars[ch].BodyRotation + Math.PI))};
MaskPoints[5] = {x:MaskPoints[0].x + (Chars[ch].LegLength * Math.sin(Chars[ch].BodyRotation + Math.PI)), y:MaskPoints[0].y - (Chars[ch].LegLength * Math.cos(Chars[ch].BodyRotation + Math.PI))};
MaskPoints[3] = Chars[ch].SkirtPoints[2];
MaskPoints[4] = Chars[ch].SkirtPoints[3];
m = 1;
while (m <= 2) {
Chars[ch]["SkirtMask" + m].clear();
Chars[ch]["SkirtMask" + m].beginFill(255);
Chars[ch]["SkirtMask" + m].moveTo(MaskPoints[0].x, MaskPoints[0].y);
i = 1;
while (i < MaskPoints.length) {
Chars[ch]["SkirtMask" + m].lineTo(MaskPoints[i].x, MaskPoints[i].y);
i++;
}
Chars[ch]["SkirtMask" + m].endFill();
m++;
}
Chars[ch].Skirt3.clear();
Chars[ch].Skirt3.beginFill(Chars[ch].SkirtColor);
Chars[ch].Skirt3.moveTo(Chars[ch].SkirtPoints[0].x, Chars[ch].SkirtPoints[0].y);
i = 1;
while (i < Chars[ch].SkirtPoints.length) {
Chars[ch].Skirt3.lineTo(Chars[ch].SkirtPoints[i].x, Chars[ch].SkirtPoints[i].y);
i++;
}
Chars[ch].endFill;
}
if (Chars[ch].Jumping and (Chars[ch].JumpingPhase == 1)) {
if ((Chars[ch].Foot1._y - Chars[ch].Body._y) < Chars[ch].LegLength) {
Chars[ch].Foot1._y++;
}
if ((Chars[ch].Foot1._y - Chars[ch].Body._y) > Chars[ch].LegLength) {
Chars[ch].Foot1._y = Chars[ch].Body._y + Chars[ch].LegLength;
}
if ((Chars[ch].Foot2._y - Chars[ch].Body._y) < Chars[ch].LegLength) {
Chars[ch].Foot2._y++;
}
if ((Chars[ch].Foot2._y - Chars[ch].Body._y) > Chars[ch].LegLength) {
Chars[ch].Foot2._y = Chars[ch].Body._y + Chars[ch].LegLength;
}
if (Chars[ch].Direction == 2) {
FootRot = 2;
} else {
FootRot = -2;
}
Chars[ch].Foot1._rotation = Chars[ch].Leg1._rotation + ((12 - Math.abs(Chars[ch].Acceleration)) * FootRot);
Chars[ch].Foot2._rotation = Chars[ch].Leg2._rotation + ((12 - Math.abs(Chars[ch].Acceleration)) * FootRot);
} else if (!Chars[ch].Killed) {
FootAng = CalcAngle(Chars[ch].Foot1._x - 1, Field[Chars[ch].Foot1._x - 1], Chars[ch].Foot1._x + 1, Field[Chars[ch].Foot1._x + 1]);
Chars[ch].Foot1._rotation = (FootAng - halfPI) * Rad2Deg;
FootAng = CalcAngle(Chars[ch].Foot2._x - 1, Field[Chars[ch].Foot2._x - 1], Chars[ch].Foot2._x + 1, Field[Chars[ch].Foot2._x + 1]);
Chars[ch].Foot2._rotation = (FootAng - halfPI) * Rad2Deg;
}
if (Chars[ch].AimingAngle != undefined) {
if (Chars[ch].Direction == 2) {
if (Chars[ch].RArm.getDepth() < Chars[ch].LArm.getDepth()) {
Chars[ch].RArm.swapDepths(Chars[ch].LArm);
}
if (!Chars[ch].Killed) {
LArmAngle = 180 - Chars[ch].Leg1._rotation;
}
if ((Chars[ch].AimingAngle > Chars[ch].BodyRotation) and (Chars[ch].AimingAngle < (Chars[ch].BodyRotation + Math.PI))) {
TurnAngle = (Chars[ch].AimingAngle - Chars[ch].BodyRotation) * Rad2Deg;
Chars[ch].Body.Head._xscale = 100;
if (!Chars[ch].Killed) {
Chars[ch].Body.Head._rotation = TurnAngle;
}
Chars[ch].RArm._xscale = 100;
Chars[ch].LArm._xscale = 100;
} else {
TurnAngle = ((Chars[ch].AimingAngle - Chars[ch].BodyRotation) * Rad2Deg) + 180;
if (!Chars[ch].Killed) {
Chars[ch].Body.Head._rotation = TurnAngle - 180;
Chars[ch].Body.Head._xscale = -100;
}
Chars[ch].RArm._xscale = -100;
Chars[ch].LArm._xscale = 100;
}
}
if (Chars[ch].Direction == 1) {
if (Chars[ch].RArm.getDepth() > Chars[ch].LArm.getDepth()) {
Chars[ch].RArm.swapDepths(Chars[ch].LArm);
}
if (!Chars[ch].Killed) {
LArmAngle = 180 - Chars[ch].Leg2._rotation;
}
if ((Chars[ch].AimingAngle < Chars[ch].BodyRotation) or (Chars[ch].AimingAngle > (Chars[ch].BodyRotation + Math.PI))) {
TurnAngle = 360 - ((Chars[ch].AimingAngle - Chars[ch].BodyRotation) * Rad2Deg);
Chars[ch].Body.Head._xscale = 100;
if (!Chars[ch].Killed) {
Chars[ch].Body.Head._rotation = TurnAngle;
}
Chars[ch].RArm._xscale = -100;
Chars[ch].LArm._xscale = -100;
} else {
TurnAngle = (360 - ((Chars[ch].AimingAngle - Chars[ch].BodyRotation) * Rad2Deg)) + 180;
if (!Chars[ch].Killed) {
Chars[ch].Body.Head._rotation = TurnAngle - 180;
Chars[ch].Body.Head._xscale = -100;
}
Chars[ch].RArm._xscale = 100;
Chars[ch].LArm._xscale = -100;
}
}
Chars[ch].RArm._rotation = Chars[ch].AimingAngle * Rad2Deg;
if (!Chars[ch].Killed) {
LArmAngle = Math.min(Math.max(LArmAngle, 150), 210);
Chars[ch].LArm._rotation = LArmAngle;
}
}
} else {
Chars[ch].Body._x = Chars[ch].x;
Chars[ch].LArm._x = Chars[ch].x;
Chars[ch].RArm._x = Chars[ch].x;
Chars[ch].Leg1._x = Chars[ch].x;
Chars[ch].Leg2._x = Chars[ch].x;
Chars[ch].Foot1._x = Chars[ch].x;
Chars[ch].Foot2._x = Chars[ch].x;
if (Chars[ch].SkirtLength > 0) {
Chars[ch].Skirt1._x = Chars[ch].x;
Chars[ch].Skirt2._x = Chars[ch].x;
Chars[ch].Skirt3._x = Chars[ch].x;
Chars[ch].SkirtMask1._x = Chars[ch].x;
Chars[ch].SkirtMask2._x = Chars[ch].x;
}
}
if ((!Chars[ch].Killed) and (ch != 0)) {
if (random(50) == 0) {
Chars[ch].Move = random(3);
}
if (random(100) == 0) {
Chars[ch].Jumping = true;
}
if (random(100) == 0) {
Chars[ch].Ducking = !Chars[ch].Ducking;
}
if (((random(Chars[ch].FireRate) == 0) or ((Chars[ch].Jumping and (Chars[ch].JumpingPhase == 1)) and (Chars[ch].Acceleration == 0))) and Chars[ch].OnScreen) {
HistEl = Math.min(Chars[ch].Reaction, CharHistory.length - 1);
Chars[ch].AimingAngle = (CalcAngle(Chars[ch].ArmX, Chars[ch].ArmY, CharHistory[HistEl].x, CharHistory[HistEl].y) - Chars[ch].Accuracy) + ((Math.random() * Chars[ch].Accuracy) * 2);
Shoot(Chars[ch]);
}
if (Chars[ch].Boss) {
if ((Chars[ch].x > (Chars[0].x + 50)) and (Chars[ch].Move == 2)) {
Chars[ch].Move = 1;
}
if ((Chars[ch].x < (Chars[0].x - 50)) and (Chars[ch].Move == 1)) {
Chars[ch].Move = 2;
}
if (CurrLevel == 6) {
if ((Chars[ch].x <= (FieldLength - 320)) and (Chars[ch].Move == 1)) {
Chars[ch].Move = 0;
}
Chars[ch].Ducking = false;
Chars[ch].Jumping = false;
}
}
}
Chars[ch].PrevOnScreen = Chars[ch].OnScreen;
if (Chars[ch].Killed) {
Chars[ch].KilledCounter++;
}
if ((((((Chars[ch].Killed and (Chars[ch].Foot1._x == DesiredFoot)) and (Chars[ch].Foot2._x == DesiredFoot)) and (Chars[ch].BodyRotation == DesiredAngle)) and (Chars[ch].y == Field[Chars[ch].x])) and (Chars[ch].Body.Head._rotation == DesiredHeadAngle)) or (Chars[ch].KilledCounter > 40)) {
NE = Corpses.length;
Corpses[NE] = new Array();
Corpses[NE].push(Chars[ch].Body);
Corpses[NE].push(Chars[ch].LArm);
Corpses[NE].push(Chars[ch].RArm);
Corpses[NE].push(Chars[ch].Foot1);
Corpses[NE].push(Chars[ch].Foot2);
Corpses[NE].push(Chars[ch].Leg1);
Corpses[NE].push(Chars[ch].Leg2);
if (Chars[ch].SkirtLength > 0) {
Corpses[NE].push(Chars[ch].Skirt1);
Corpses[NE].push(Chars[ch].Skirt2);
Corpses[NE].push(Chars[ch].Skirt3);
Corpses[NE].push(Chars[ch].SkirtMask1);
Corpses[NE].push(Chars[ch].SkirtMask2);
}
ClearCorpses();
if (ch == 0) {
DeadX = Chars[0].x;
DeadY = Chars[0].y;
Die();
}
Chars.splice(ch, 1);
}
}
CharHistory.unshift({x:Chars[0].x, y:Chars[0].y});
while (CharHistory.length > 20) {
CharHistory.pop();
}
if (random(PowerUpFrequency[CurrLevel]) == 0) {
PUPos = (Chars[0].x - 200) + random(400);
if (PUPos < 30) {
PUPos = 30;
}
if (PUPos > (FieldLength - 30)) {
PUPos = FieldLength - 30;
}
AddPowerUp(PowerUpTypes[CurrLevel][random(PowerUpTypes[CurrLevel].length)], PUPos, Field[Chars[0].x] - 200, 0);
}
if ((!DroppedExtraLife) and (random(Math.round((FieldLength - Chars[0].x) - 20)) == 0)) {
PUPos = (Chars[0].x - 200) + random(400);
if (PUPos < 30) {
PUPos = 30;
}
if (PUPos > (FieldLength - 30)) {
PUPos = FieldLength - 30;
}
AddPowerUp(8, PUPos, Field[Chars[0].x] - 200, 0);
DroppedExtraLife = true;
}
if (!BossTime) {
CurrFreq = EnemyFrequency[CurrLevel] * (FieldLength / Chars[0].x);
CurrFreq = Math.min(EnemyFrequency[CurrLevel] * 3, CurrFreq);
if ((Chars[0].Move == 0) or (Chars[0].Move == 1)) {
CurrFreq = CurrFreq * 3;
}
if (Chars[0].Move == 2) {
CurrFreq = CurrFreq / (Chars[0].RealSpeed / 3);
}
CurrFreq = Math.round(CurrFreq);
if (((random(CurrFreq) == 0) or FirstTime) and (TotalOnScreen < 5)) {
EnType = LevelEnemies[Mode][CurrLevel][random(LevelEnemies[Mode][CurrLevel].length)];
AddChar(Math.round(620 - GA._x), EnType, false);
}
if (Chars[0].x >= (FieldLength - 600)) {
BossTime = true;
DisplayMessage("BOSS!!!");
AddChar(FieldLength, Bosses[Mode][CurrLevel], true);
}
}
if ((BossTime and (CurrLevel == 5)) and (random(100) == 0)) {
if (Mode == 2) {
AddChar(FieldLength, 21, false);
}
if (Mode == 1) {
AddChar(FieldLength, 22, false);
}
}
if ((BossTime and (CurrLevel == 6)) and (random(200) == 0)) {
AddChar(FieldLength, Bosses[Mode][random(5) + 1], false);
}
for (r in Rounds) {
Rounds[r].x = Rounds[r].x + Rounds[r].XSpeed;
Rounds[r].y = Rounds[r].y + Rounds[r].YSpeed;
if (((Rounds[r].y >= Field[Math.round(Rounds[r].x)]) or (Rounds[r].x < 0)) or (Rounds[r].x >= FieldLength)) {
if ((Rounds[r].Type == 3) and (BGMode == 1)) {
DrawBlood(Math.round(Rounds[r].x), Rounds[r].Symbol._xscale / 75);
}
Rounds[r].Symbol.removeMovieClip();
Rounds.splice(r, 1);
} else {
Rounds[r].Symbol._x = Rounds[r].x;
Rounds[r].Symbol._y = Rounds[r].y;
Rounds[r].YSpeed = Rounds[r].YSpeed + RoundPars[Rounds[r].Type].Weight;
}
}
for (t in Traces) {
if (Traces[t].Counter >= 2) {
Traces[t].Symbol.removeMovieClip();
Traces.splice(t, 1);
}
Traces[t].Counter++;
}
for (p in PowerUps) {
XDis = (Math.sin(PowerUps[p].Rotation) * PowerUps[p].Width) / 2;
PowerUps[p].Corners[0].x = PowerUps[p].x - XDis;
PowerUps[p].Corners[1].x = PowerUps[p].x + XDis;
i = 0;
while (i <= 1) {
PowerUps[p].Corners[i].y = PowerUps[p].Corners[i].y + PowerUps[p].Corners[i].Speed;
if (PowerUps[p].Corners[i].y >= Field[Math.round(PowerUps[p].Corners[i].x)]) {
PowerUps[p].Corners[i].y = Field[Math.round(PowerUps[p].Corners[i].x)];
if (PowerUps[p].Corners[i].Speed > 2) {
PowerUps[p].Corners[i].Speed = -(PowerUps[p].Corners[i].Speed * 0.5);
} else {
PowerUps[p].Corners[i].Speed = 0;
PowerUps[p].Corners[i].Done = true;
}
}
PowerUps[p].Corners[i].Speed = PowerUps[p].Corners[i].Speed + PowerUps[p].Acceleration;
i++;
}
PowerUps[p].Rotation = CalcAngle(PowerUps[p].Corners[0].x, PowerUps[p].Corners[0].y, PowerUps[p].Corners[1].x, PowerUps[p].Corners[1].y);
PowerUps[p].y = PowerUps[p].Corners[0].y - ((Math.cos(PowerUps[p].Rotation) * PowerUps[p].Width) / 2);
PowerUps[p].Symbol._y = PowerUps[p].y;
PowerUps[p].Symbol._x = PowerUps[p].x;
PowerUps[p].Symbol._rotation = (PowerUps[p].Rotation * Rad2Deg) - 90;
if (((PowerUps[p].Type != 1) and ((Field[PowerUps[p].x] - PowerUps[p].y) < 20)) and (!PowerUps[p].Landed)) {
LandedPowerUps.push({x:PowerUps[p].x, Width:PowerUps[p].Width, Type:PowerUps[p].Type, Symbol:PowerUps[p].Symbol});
PowerUps[p].Landed = true;
}
}
for (p in LandedPowerUps) {
if ((Math.abs(Chars[0].x - LandedPowerUps[p].x) <= (LandedPowerUps[p].Width / 2)) and (((Field[Chars[0].x] - Chars[0].y) - Chars[0].LegLength) <= LandedPowerUps[p].Width)) {
LandedPowerUps[p].Symbol.removeMovieClip();
CollectPowerUp(LandedPowerUps[p].Type);
LandedPowerUps.splice(p, 1);
}
}
for (p in PowerUps) {
if ((PowerUps[p].Corners[0].Done and PowerUps[p].Corners[1].Done) or (!(PowerUps[p].Symbol instanceof MovieClip))) {
if (PowerUps[p].You) {
DeadX = PowerUps[p].Symbol._x;
DeadY = PowerUps[p].Symbol._y - 10;
Die();
}
PowerUps.splice(p, 1);
}
}
if (Chars[0].SuperSpeed) {
Chars[0].SuperSpeedCounter++;
if (Chars[0].SuperSpeedCounter >= PowerUpsDuration) {
Chars[0].SuperSpeed = false;
Chars[0].Speed = 3;
SuperSpeedSign._visible = false;
}
}
if (SuperJump) {
SuperJumpCounter++;
if (SuperJumpCounter >= PowerUpsDuration) {
SuperJump = false;
Chars[0].JumpPower = 12;
SuperJumpSign._visible = false;
}
}
if (Shield) {
ShieldCounter++;
if (ShieldCounter >= PowerUpsDuration) {
Shield = false;
ShieldSign._visible = false;
}
}
if (((((Chars[0].Move > 0) or Chars[0].Jumping) or FirstTime) or Chars[0].Hit) and (!YouAreDead)) {
FirstTime = false;
GA._x = 300 - Chars[0].x;
GA._y = (150 - Field[Chars[0].x]) + 50;
if (GA._x > -20) {
GA._x = -20;
}
if (GA._x < (-(FieldLength - 620))) {
GA._x = -(FieldLength - 620);
}
GA.BackMountains._x = -(GA._x / 2);
GA.BackMountains._y = -(GA._y / 2);
}
}
if (DieSequence) {
GACounter--;
GA._xscale = GA._xscale + 10;
GA._yscale = GA._xscale;
GA._x = 300 - ((DeadX * GA._xscale) / 100);
GA._y = (150 - ((DeadY * GA._yscale) / 100)) + GACounter;
if (GA._x > -20) {
GA._x = -20;
}
if (GA._x < ((-((FieldLength * GA._xscale) / 100)) + 620)) {
GA._x = (-((FieldLength * GA._xscale) / 100)) + 620;
}
PBColor.setTransform({aa:100 - (GACounter * 2), ab:255 - (GACounter * 5.1)});
if (GACounter == 0) {
this._quality = "HIGH";
gotoAndStop ("Life Lost");
}
GA.BackMountains._x = -(GA._x / 2);
GA.BackMountains._y = -(GA._y / 2);
}
if (GamePassed) {
switch (EndGamePhase) {
case 1 :
FinishedLevel = true;
Cursor._visible = false;
Mouse.show();
for (c in Chars) {
if ((!Chars[c].OnScreen) and (Chars[c] != ExplodingBoss)) {
for (el in Chars[c]) {
if (Chars[c][el] instanceof MovieClip) {
Chars[c][el].removeMovieClip();
}
}
}
}
MoveToX = 300 - ExplodingBoss.x;
MoveToY = 150 - ExplodingBoss.y;
XSpeed = (MoveToX - GA._x) / 50;
YSpeed = (MoveToY - GA._y) / 50;
EGCounter = 50;
EndGamePhase = 2;
break;
case 2 :
GA._x = GA._x + XSpeed;
if (GA._x < ((-FieldLength) + 620)) {
GA._x = (-FieldLength) + 620;
}
if (GA._x > 0) {
GA._x = 0;
}
GA._y = GA._y + YSpeed;
GA.BackMountains._x = -(GA._x / 2);
GA.BackMountains._y = -(GA._y / 2);
EGCounter--;
if (EGCounter <= 0) {
EndGamePhase = 3;
if (FXOn) {
ExplosionSnd.start();
}
}
break;
case 3 :
for (r in Rounds) {
Rounds[r].Symbol._visible = false;
}
for (t in Traces) {
Traces[t].Symbol._visible = false;
}
if (Mode == 1) {
Step = 4;
}
if (Mode == 2) {
Step = 10;
}
Explosion = new Array();
for (el in ExplodingBoss) {
if (ExplodingBoss[el] instanceof MovieClip) {
x = 0;
while (x <= ExplodingBoss[el]._width) {
y = 0;
while (y <= ExplodingBoss[el]._height) {
if (((el == "Body") or (el == "LArm")) or (el == "RArm")) {
Pnt = {x:x, y:-y};
} else {
Pnt = {x:x, y:y};
}
ExplodingBoss[el].localToGlobal(Pnt);
GA.globalToLocal(Pnt);
NE = Explosion.length;
if (Mode == 1) {
GA.RoundSample.duplicateMovieClip((((("EG" + el) + "x") + x) + "x") + y, GA.getNextHighestDepth());
GA[(((("EG" + el) + "x") + x) + "x") + y].gotoAndStop(3);
GA[(((("EG" + el) + "x") + x) + "x") + y]._xscale = (GA[(((("EG" + el) + "x") + x) + "x") + y]._yscale = 80 + random(100));
}
if (Mode == 2) {
GA.PowerUpSample.duplicateMovieClip((((("EG" + el) + "x") + x) + "x") + y, GA.getNextHighestDepth());
GA[(((("EG" + el) + "x") + x) + "x") + y].gotoAndStop(1);
GA[(((("EG" + el) + "x") + x) + "x") + y]._xscale = (GA[(((("EG" + el) + "x") + x) + "x") + y]._yscale = 40 + random(60));
}
Explosion[NE] = new Object();
Explosion[NE].Symbol = GA[(((("EG" + el) + "x") + x) + "x") + y];
Explosion[NE].Symbol._x = Pnt.x;
Explosion[NE].Symbol._y = Pnt.y;
ExpAngle = CalcAngle(ExplodingBoss.x, ExplodingBoss.y, Explosion[NE].Symbol._x, Explosion[NE].Symbol._y);
MoveSpeed = 10 + random(20);
Explosion[NE].XSpeed = Math.sin(ExpAngle) * MoveSpeed;
Explosion[NE].YSpeed = Math.cos(ExpAngle) * MoveSpeed;
Explosion[NE].AngleSpeed = random(20) - 10;
Explosion[NE].ScaleGrow = 1 + (Math.random() * 0.05);
y = y + Step;
}
x = x + Step;
}
}
}
for (el in ExplodingBoss) {
if (ExplodingBoss[el] instanceof MovieClip) {
ExplodingBoss[el].removeMovieClip();
}
}
EndGamePhase = 4;
break;
case 4 :
for (ex in Explosion) {
Explosion[ex].Symbol._x = Explosion[ex].Symbol._x + Explosion[ex].XSpeed;
Explosion[ex].Symbol._y = Explosion[ex].Symbol._y + ((Explosion[ex].YSpeed * Explosion[ex].Symbol._yscale) / 100);
Explosion[ex].Symbol._rotation = Explosion[ex].Symbol._rotation + Explosion[ex].AngleSpeed;
Explosion[ex].Symbol._xscale = Explosion[ex].Symbol._xscale * Explosion[ex].ScaleGrow;
Explosion[ex].Symbol._yscale = Explosion[ex].Symbol._xscale;
Explosion[ex].YSpeed = Explosion[ex].YSpeed + 0.5;
Explosion[ex].XSpeed = Explosion[ex].XSpeed * 0.95;
if (Explosion[ex].Symbol._y > (((-GA._y) + 300) + ((50 * Explosion[ex].Symbol._yscale) / 100))) {
Explosion[ex].Symbol.removeMovieClip();
Explosion.splice(ex, 1);
if (Explosion.length == 0) {
this._quality = "HIGH";
gotoAndStop ("Game Passed");
}
}
}
}
}
Frame 12
if (!SkipCycle) {
gotoAndPlay ("Game");
}
Frame 14
stop();
InTheGame = false;
this._quality = "HIGH";
PermittedFaults = Math.round(BonusTime / 10);
FaultsText = PermittedFaults;
PlayButt.Txt = "START";
PlayButt.onPress = function () {
gotoAndPlay ("Game1Init");
};
Music.stop();
Frame 15
function AddKey(Pos) {
var _local2;
var _local1;
_local2 = Keys.length;
_local1 = 0;
while (KeyLayer["K" + _local1] instanceof MovieClip) {
_local1++;
}
KeyLayer.KeySample.duplicateMovieClip("K" + _local1, KeyLayer.getNextHighestDepth());
Keys[_local2] = {Symbol:KeyLayer["K" + _local1]};
if (Pos == 0) {
Keys[_local2].Symbol._x = 39;
} else {
Keys[_local2].Symbol._x = 561;
}
Keys[_local2].Pos = Pos;
Keys[_local2].Symbol._y = (Keys[_local2].y = TopLimit);
Keys[_local2].Value = 65 + random(26);
Keys[_local2].Symbol.Letter = chr(Keys[_local2].Value);
}
function UpdateFaults() {
FaultsText = ((" FAULTS: " + Faults) + "/") + PermittedFaults;
if (Faults >= PermittedFaults) {
Score = Score + BonusScore;
gotoAndStop ("Game1End");
}
}
function UpdateBonus() {
ScoreText = "BONUS: " + BonusScore;
}
KeyLayer.KeySample._visible = false;
TopLimit = 0;
BottomLimit = 300;
HitLine = 250;
Speed = [2, 2];
Frequency = [100, 100];
Keys = new Array();
WasDown = new Array();
Boss.gotoAndStop(CurrLevel);
Boss.Inside.Face.gotoAndStop(1);
NextPhase = 1;
PhaseStep = 2;
Faults = 0;
BonusScore = 0;
KeyListener = new Object();
KeyListener.onKeyDown = function () {
var _local2 = Key.getCode();
var _local1;
for (_local1 in Keys) {
if ((((Keys[_local1].Value == _local2) and (Keys[_local1].y >= (HitLine - 28))) and (Keys[_local1].y <= (HitLine + 28))) and (!WasDown[_local2])) {
if (FXOn) {
Punch.start();
}
if (Keys[_local1].Pos == 1) {
RightFist.gotoAndPlay(1);
} else {
LeftFist.gotoAndPlay(1);
}
NextPhase--;
if (NextPhase <= 0) {
Boss.Inside.Face.nextFrame();
NextPhase = PhaseStep;
PhaseStep++;
}
Boss.Inside.gotoAndPlay(1);
Distance = Math.abs(HitLine - Keys[_local1].y);
EarnScore = 1 + Math.round((((30 - Distance) / 30) * Math.pow(CurrLevel, 2)) * Speed[Keys[_local1].Pos]);
BonusScore = BonusScore + EarnScore;
UpdateBonus();
FS.gotoAndPlay(2);
FS.Inside.gotoAndStop(2);
FS.Inside.ScoreText = EarnScore + " Points";
Frequency[Keys[_local1].Pos] = Frequency[Keys[_local1].Pos] * (1 - (0.02 * CurrLevel));
Speed[Keys[_local1].Pos] = Speed[Keys[_local1].Pos] * (1 + (0.01 * CurrLevel));
Keys[_local1].Symbol.removeMovieClip();
Keys.splice(_local1, 1);
break;
}
}
WasDown[_local2] = true;
};
KeyListener.onKeyUp = function () {
WasDown[Key.getCode()] = false;
};
Key.addListener(KeyListener);
AddKey(1);
UpdateFaults();
UpdateBonus();
Frame 16
for (k in Keys) {
Keys[k].y = Keys[k].y + Speed[Keys[k].Pos];
Keys[k].Symbol._y = Keys[k].y;
if (Keys[k].y >= BottomLimit) {
if (FXOn) {
FaultSnd.start();
}
Keys[k].Symbol.removeMovieClip();
Keys.splice(k, 1);
Faults++;
UpdateFaults();
FS.gotoAndPlay(2);
FS.Inside.gotoAndStop(1);
}
}
p = 0;
while (p <= 1) {
UpperY = Infinity;
for (k in Keys) {
if ((Keys[k].Pos == p) and (Keys[k].y < UpperY)) {
UpperY = Keys[k].y;
}
}
if ((random(Math.round(Frequency[p])) == 0) and (UpperY > (TopLimit + 33))) {
AddKey(p);
}
p++;
}
if (Key.isDown()) {
trace("--------");
}
Frame 17
gotoAndPlay ("Game1Cycle");
Frame 18
gotoAndStop ("Game1End");
Frame 19
BonusText = BonusScore;
NewScoreText = Score;
NextLevelButt.Txt = "NEXT LEVEL";
NextLevelButt.onPress = function () {
CurrLevel++;
gotoAndPlay ("Init");
};
_root.kongregateStats.submit("Score", TotalScore);
Frame 21
stop();
this._quality = "HIGH";
InTheGame = false;
TimeText = TimeFormat(BonusTime);
StartButton.Txt = "START";
StartButton.onRelease = function () {
gotoAndPlay ("Game2Init");
};
Music.stop();
Instance of Symbol 75 MovieClip "StartButton" in Frame 21
/* no clip actions */
Frame 22
function PlaceNewPiece(Cat, Type, x, y) {
var _local2;
var _local3;
_local2 = Pieces.length;
_local3 = 0;
while (Pic["P" + _local3] instanceof MovieClip) {
_local3++;
}
Pic[CatNames[Cat]].duplicateMovieClip("P" + _local3, Pic.getNextHighestDepth());
Pieces[_local2] = new Object();
Pieces[_local2].Symbol = Pic["P" + _local3];
if ((x == undefined) or (y == undefined)) {
x = PlaceArea.x + random(PlaceArea.Width);
y = PlaceArea.y + random(PlaceArea.Height);
}
Pieces[_local2].Symbol._x = (Pieces[_local2].x = x);
Pieces[_local2].Symbol._y = (Pieces[_local2].y = y);
Pieces[_local2].Symbol._rotation = random(90) - 45;
Pieces[_local2].Symbol._xscale = (Pieces[_local2].Symbol._yscale = 90);
Pieces[_local2].Symbol.gotoAndStop(Type);
Pieces[_local2].Cat = Cat;
Pieces[_local2].Moving = false;
Pieces[_local2].Type = Type;
Pieces[_local2].Symbol.ParentObject = Pieces[_local2];
Pieces[_local2].Symbol.onPress = function () {
if (!this.ParentObject.Moving) {
if (FXOn) {
Click.start();
}
BringToFront(this);
this._xscale = (this._yscale = 100);
this._rotation = 0;
this.startDrag();
}
};
Pieces[_local2].Symbol.onRelease = (Pieces[_local2].Symbol.onReleaseOutside = function () {
this.stopDrag();
ReleasePiece(this.ParentObject);
});
return(Pieces[_local2]);
}
function BringToFront(Symbol) {
var _local1;
var _local2 = -Infinity;
for (_local1 in Pic) {
if (Pic[_local1].getDepth() > _local2) {
_local2 = Pic[_local1].getDepth();
}
}
if (_local2 > Symbol.getDepth()) {
Symbol.swapDepths(_local2 + 1);
}
}
function ReleasePiece(Obj, DontPlace) {
var _local3;
var _local2;
var _local12;
var _local11;
var _local4;
var _local5 = false;
var _local7;
var _local6;
var _local9;
var _local8 = false;
if (((((Obj.Symbol._x >= PlaceArea.x) and (Obj.Symbol._x <= (PlaceArea.x + PlaceArea.Width))) and (Obj.Symbol._y >= PlaceArea.y)) and (Obj.Symbol._y <= (PlaceArea.y + PlaceArea.Height))) and (!DontPlace)) {
Obj.Symbol._xscale = (Obj.Symbol._yscale = 90);
Obj.Symbol._rotation = random(90) - 45;
} else {
if (((((Obj.Symbol._x >= (Pic[CatNames[Obj.Cat]]._x - 20)) and (Obj.Symbol._x <= (Pic[CatNames[Obj.Cat]]._x + 20))) and (Obj.Symbol._y >= (Pic[CatNames[Obj.Cat]]._y - 20))) and (Obj.Symbol._y <= (Pic[CatNames[Obj.Cat]]._y + 20))) and (!DontPlace)) {
_local8 = true;
_local11 = CurrCloth[Obj.Cat];
if (FXOn) {
Dress.start();
}
if (CurrCloth[Obj.Cat] == 0) {
CurrCloth[Obj.Cat] = Obj.Type;
Obj.Symbol.removeMovieClip();
for (_local4 in Pieces) {
if (Pieces[_local4] == Obj) {
Pieces.splice(_local4, 1);
_local5 = true;
break;
}
}
} else {
CurrCloth[Obj.Cat] = Obj.Type;
Obj.Type = _local11;
Obj.Symbol.gotoAndStop(Obj.Type);
}
UpdateCloth();
}
if (!_local5) {
MovingPieces.push(Obj);
if (DontPlace or _local8) {
_local3 = PlaceArea.x + random(PlaceArea.Width);
_local2 = PlaceArea.y + random(PlaceArea.Height);
} else {
_local9 = CalcAngle(Obj.Symbol._x, Obj.Symbol._y, PlaceArea.x + (PlaceArea.Width / 2), PlaceArea.y + (PlaceArea.Height / 2));
_local7 = Math.sin(_local9) * 10;
_local6 = -(Math.cos(_local9) * 10);
_local3 = Obj.Symbol._x;
_local2 = Obj.Symbol._y;
while ((((_local3 < PlaceArea.x) or (_local3 > (PlaceArea.x + PlaceArea.Width))) or (_local2 < PlaceArea.y)) or (_local2 > (PlaceArea.y + PlaceArea.Height))) {
_local3 = _local3 + _local7;
_local2 = _local2 + _local6;
}
}
_local12 = random(90) - 45;
Obj.MoveX = (_local3 - Obj.Symbol._x) / 10;
Obj.MoveY = (_local2 - Obj.Symbol._y) / 10;
Obj.RotStep = _local12 / 10;
Obj.Moving = true;
Obj.Counter = 10;
}
}
}
function UpdateCloth() {
var _local3;
var _local2;
var _local6;
var _local5;
var _local7;
var _local4;
for (_local3 in CurrCloth) {
if (CurrCloth[_local3] > 0) {
Pic[CatNames[_local3]]._visible = true;
Pic[CatNames[_local3]].gotoAndStop(CurrCloth[_local3]);
} else {
Pic[CatNames[_local3]]._visible = false;
}
}
Pic.Jacket.Back._visible = false;
Pic.Shoes.Back._visible = false;
if ((Pic.Shoes.Mask instanceof MovieClip) and Pic.Shoes._visible) {
Pic.Pants.setMask(Pic.Shoes.Mask);
} else {
Pic.Pants.setMask(null);
}
if (BossesDressUp[CurrLevel].ShirtOut[CurrCloth[1]] and (Pic.Shirt.getDepth() < Pic.Pants.getDepth())) {
Pic.Shirt.swapDepths(Pic.Pants);
}
if ((!BossesDressUp[CurrLevel].ShirtOut[CurrCloth[1]]) and (Pic.Shirt.getDepth() > Pic.Pants.getDepth())) {
Pic.Shirt.swapDepths(Pic.Pants);
}
Cuteness = (Elegance = (Style = 0));
for (_local3 in BossesDressUp[CurrLevel].Combos) {
_local6 = 0;
_local5 = 0;
for (_local2 in CatNames) {
if (BossesDressUp[CurrLevel].Combos[_local3].Structure[_local2] != undefined) {
_local6++;
if (CurrCloth[_local2] == BossesDressUp[CurrLevel].Combos[_local3].Structure[_local2]) {
_local5++;
}
}
}
if (_local5 >= 2) {
_local7 = Math.pow(_local5 / _local6, 2) * 10;
for (_local2 in BossesDressUp[CurrLevel].Combos[_local3].Results) {
_local4 = BossesDressUp[CurrLevel].Combos[_local3].Results[_local2] * _local7;
if (_local4 > this[_local2]) {
this[_local2] = _local4;
}
}
}
}
if (Shaved) {
Cuteness = Cuteness * 1.2;
Elegance = Elegance * 1.2;
}
if (BrushedHair) {
Cuteness = Cuteness * 1.3;
Elegance = Elegance * 1.3;
}
if (Kissed) {
Cuteness = Cuteness * 1.5;
}
Cuteness = Math.round(Cuteness);
Elegance = Math.round(Elegance);
Style = Math.round(Style);
CutnessText = Cuteness;
StyleText = Style;
EleganceText = Elegance;
TotalScoreText = (Cuteness + Style) + Elegance;
}
function Game2Done() {
BonusTime = 0;
gotoAndStop ("Game2End");
Score = Score + ((RemainingTime * CurrLevel) + ((((Cuteness + Elegance) + Style) * CurrLevel) * 3));
}
Pic.gotoAndStop(CurrLevel);
PlaceArea = {x:184, y:-104, Width:141, Height:208};
Pieces = new Array();
MovingPieces = new Array();
Razor._visible = false;
RazorOn = false;
Hairbrush._visible = false;
HairbrushOn = false;
Kiss._visible = false;
KissOn = false;
Pic.Hair.gotoAndStop(1);
Pic.Face.gotoAndStop(1);
Shaved = false;
BrushedHair = false;
Kissed = false;
CatNames = ["Hat", "Shirt", "Pants", "Socks", "Shoes", "Tie", "Jacket"];
BossesDressUp = [undefined, {Initial:[1, 1, 1, 1, 1, 0, 0], Combos:[{Structure:[1, 1, 1, 1, 1, 0], Results:{Cuteness:5}}, {Structure:[2, 2, 2, 2, 2, 0], Results:{Cuteness:10}}, {Structure:[3, 3, 3, 3, 3, 0], Results:{Style:10, Elegance:2}}, {Structure:[0, 1, 4, 3, 4, 2], Results:{Elegance:10}}, {Structure:[0, 1, 4, 3, 4, 1], Results:{Cuteness:7, Elegance:9}}, {Structure:[0, 1, 1, 1, 1, 1], Results:{Cuteness:6, Elegance:3}}]}, {Initial:[1, 1, 1, 0, 1, 0, 1], Combos:[{Structure:[0, 4, 4, 2, 4, 0, 0], Results:{Style:10}}, {Structure:[0, 2, 2, 0, 2, 0, 0], Results:{Cuteness:3, Style:5}}, {Structure:[0, 2, 2, 2, 4, 0, 0], Results:{Cuteness:5, Style:2}}, {Structure:[0, 3, 3, 1, 3, 1, 2], Results:{Elegance:10}}, {Structure:[0, 4, 3, 1, 3, 0, 0], Results:{Elegance:7, Style:3}}], ShirtOut:[undefined, true, true, true]}, {Initial:[1, 1, 1, 1, 1, 0, 0], Combos:[{Structure:[0, 2, 2, 2, 1, 1, 0], Results:{Cuteness:9, Elegance:3}}, {Structure:[2, 3, 3, 4, 1, 2, 1], Results:{Cuteness:8, Elegance:5, Style:2}}, {Structure:[3, 3, 3, 3, 2, 3, 1], Results:{Elegance:10, Style:2}}, {Structure:[4, 4, 4, 4, 3, 0, 0], Results:{Style:8, Cuteness:2}}], ShirtOut:[undefined, true, false, false, true]}, {Initial:[1, 1, 1, 1, 1, 0, 0], Combos:[{Structure:[2, 2, 3, 2, 2], Results:{Cuteness:5, Style:7}}, {Structure:[0, 4, 3, 2, 3], Results:{Elegance:3, Style:10}}, {Structure:[0, 3, 4, 2, 3], Results:{Elegance:10, Style:2}}], ShirtOut:[undefined, false, true, false, true]}, {Initial:[1, 1, 1, 1, 1, 0, 0], Combos:[{Structure:[undefined, 3, 2, 2, 2, 0, 0], Results:{Cuteness:8, Elegance:2}}, {Structure:[undefined, 2, 3, 2, 3, 0, 1], Results:{Style:10}}, {Structure:[undefined, 4, 4, 3, 4, 1, 2], Results:{Elegance:10}}], ShirtOut:[undefined, true, false, true, false]}];
CurrCloth = new Array();
for (i in CatNames) {
if (Pic[CatNames[i]] instanceof MovieClip) {
fr = 1;
while (fr <= Pic[CatNames[i]]._totalframes) {
if (fr != BossesDressUp[CurrLevel].Initial[i]) {
PlaceNewPiece(i, fr);
}
fr++;
}
CurrCloth[i] = BossesDressUp[CurrLevel].Initial[i];
Pic[CatNames[i]].Cat = i;
Pic[CatNames[i]].onPress = function () {
if (FXOn) {
Click.start();
}
NewPiece = PlaceNewPiece(this.Cat, CurrCloth[this.Cat], this._x, this._y);
BringToFront(NewPiece.Symbol);
NewPiece.Symbol._xscale = (NewPiece.Symbol._yscale = 100);
NewPiece.Symbol._rotation = 0;
CurrCloth[this.Cat] = 0;
ReleasePiece(NewPiece, true);
UpdateCloth();
};
}
}
UpdateCloth();
StartTime = new Date();
Pic.Beard.onRollOver = function () {
RazorOn = true;
Razor._visible = true;
Razor._x = _xmouse;
Razor._y = _ymouse;
Mouse.hide();
};
Pic.Beard.onRollOut = (Pic.Beard.onReleaseOutside = function () {
RazorOn = false;
Razor._visible = false;
Mouse.show();
});
Pic.Beard.onPress = function () {
Shaved = true;
this._visible = false;
this.onRollOut();
UpdateCloth();
};
Pic.Hair.onRollOver = function () {
HairbrushOn = true;
Hairbrush._visible = true;
Hairbrush._x = _xmouse;
Hairbrush._y = _ymouse;
Mouse.hide();
};
Pic.Hair.onRollOut = (Pic.Beard.onReleaseOutside = function () {
HairbrushOn = false;
Hairbrush._visible = false;
Mouse.show();
});
Pic.Hair.onPress = function () {
BrushedHair = true;
this.enabled = false;
this.gotoAndStop(2);
this.onRollOut();
UpdateCloth();
};
Pic.Face.onRollOver = function () {
KissOn = true;
Kiss._visible = true;
Kiss._x = _xmouse;
Kiss._y = _ymouse;
Mouse.hide();
};
Pic.Face.onRollOut = (Pic.Beard.onReleaseOutside = function () {
KissOn = false;
Kiss._visible = false;
Mouse.show();
});
Pic.Face.onPress = function () {
if (FXOn) {
KissSnd.start();
}
Kissed = true;
this.enabled = false;
this.gotoAndStop(2);
this.onRollOut();
UpdateCloth();
};
Frame 23
for (p in MovingPieces) {
MovingPieces[p].Symbol._x = MovingPieces[p].Symbol._x + MovingPieces[p].MoveX;
MovingPieces[p].Symbol._y = MovingPieces[p].Symbol._y + MovingPieces[p].MoveY;
MovingPieces[p].Symbol._rotation = MovingPieces[p].Symbol._rotation + MovingPieces[p].RotStep;
MovingPieces[p].Symbol._xscale--;
MovingPieces[p].Symbol._yscale = MovingPieces[p].Symbol._xscale;
MovingPieces[p].Counter--;
if (MovingPieces[p].Counter == 0) {
MovingPieces[p].Moving = false;
MovingPieces.splice(p, 1);
}
}
CurrTime = new Date();
RemainingTime = Math.round(BonusTime - ((CurrTime - StartTime) / 1000));
TimeText = TimeFormat(RemainingTime);
if (RemainingTime <= 0) {
Game2Done();
}
if (RazorOn) {
Razor._x = _xmouse;
Razor._y = _ymouse;
}
if (HairbrushOn) {
Hairbrush._x = _xmouse;
Hairbrush._y = _ymouse;
}
if (KissOn) {
Kiss._x = _xmouse;
Kiss._y = _ymouse;
}
if (Key.isDown(32)) {
if (!SpaceDown) {
Res = "";
i = 0;
while (i < CurrCloth.length) {
Res = Res + CurrCloth[i];
if (i < (CurrCloth.length - 1)) {
Res = Res + "-";
}
i++;
}
trace(Res);
}
SpaceDown = true;
} else {
SpaceDown = false;
}
Frame 24
gotoAndPlay ("Game2Cycle");
Frame 25
gotoAndStop ("Game2End");
Frame 26
Mouse.show();
BonusText = (((Cuteness + Elegance) + Style) * CurrLevel) * 3;
TimeBonusText = RemainingTime * CurrLevel;
YourScoreText = Score;
NextButton.Txt = "NEXT LEVEL";
NextButton.onRelease = function () {
CurrLevel++;
gotoAndPlay ("Init");
};
_root.kongregateStats.submit("Score", TotalScore);
Instance of Symbol 75 MovieClip "NextButton" in Frame 26
/* no clip actions */
Frame 27
gotoAndStop ("Game2End");
Frame 28
gotoAndStop ("Life Lost");
Frame 29
Lives--;
InTheGame = false;
this._quality = "HIGH";
Mouse.show();
if (Lives > 0) {
LLS.gotoAndStop(Mode);
LLS.LivesLeft = Lives;
} else {
gotoAndStop ("Game Over");
}
Music.stop();
Frame 30
gotoAndStop ("Life Lost");
Frame 31
Music.stop();
InTheGame = false;
this._quality = "HIGH";
GP.gotoAndStop(Mode);
Score = Score + (Lives * 5000);
Lives = 0;
_root.kongregateStats.submit("Score", Score);
Frame 32
gotoAndStop ("Game Over");
Frame 33
GO.gotoAndStop(Mode);
_root.kongregateStats.submit("Score", TotalScore);
Music.stop();
Frame 34
gotoAndStop ("Game Over");
Frame 35
gotoAndStop ("Submit Score");
Frame 36
BG.gotoAndStop(Mode);
Frame 37
gotoAndStop ("Submit Score");
Symbol 874 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.1");
}
static function showPreGameAd(options) {
var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local27);
var clip = options.clip;
var _local23 = 11000;
var _local26 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local7._x = 10;
_local7._y = _local13 - 20;
var _local22 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local7.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local7.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local22);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local6 = _local7.createEmptyMovieClip("_outline", 3);
_local6.lineStyle(0, _local24, 100);
_local6.moveTo(0, 0);
_local6.lineTo(_local4 - 20, 0);
_local6.lineTo(_local4 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
chk.ad_msec = _local23;
chk.ad_timeout = _local26;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showTimedAd(options) {
showInterLevelAd(options);
}
static function showPreloaderAd(options) {
showPreGameAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function _loadCommunicator(options) {
var _local26 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local26);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
_allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local25 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local25);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb_arg) {
var _local8 = parseInt(cb_arg);
var _local4 = this._callbacks[_local8];
if (!_local4) {
return(undefined);
}
delete this._callbacks[_local8];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}
static function fetchHighScores(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}
static function sendHighScore(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local9 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local4);
}
}
Symbol 12 Button
on (press) {
getURL ("http://www.sugar-free-games.com", "_SELF");
}
Symbol 20 MovieClip Frame 100
_parent.gotoAndPlay("Intermediate");
Symbol 45 Button
on (release) {
Mode = 1;
gotoAndStop ("Main Menu");
}
Symbol 46 Button
on (release) {
Mode = 2;
gotoAndStop ("Main Menu");
}
Symbol 75 MovieClip Frame 1
ColorChange.gotoAndStop(1);
this.onRollOut = (this.onReleaseOutside = function () {
ColorChange.gotoAndStop(1);
});
this.onRollOver = function () {
ColorChange.gotoAndStop(2);
};
this.onPress = function () {
ColorChange.gotoAndStop(3);
};
Symbol 95 MovieClip Frame 1
stop();
Symbol 97 MovieClip Frame 1
stop();
Symbol 102 MovieClip Frame 1
stop();
Symbol 133 MovieClip Frame 1
Butt1.Txt = "START";
Butt1.onRelease = function () {
gotoAndStop (2);
};
Butt2.Txt = "LEVEL SELCET";
Butt2.onRelease = function () {
gotoAndStop (3);
};
Butt3.Txt = "CHANGE SEX";
Butt3.onRelease = function () {
_parent.gotoAndStop("GenderSelect");
};
Butt4.Txt = "MORE GAMES";
Butt4.onRelease = function () {
getURL ("http://www.sugar-free-games.com", "_blank");
};
Butt5.Txt = "TOP SCORE";
Butt5.onRelease = function () {
getURL ("http://www.sugar-free-games.com/boysvsgirls.php", "_blank");
};
Butt6.Txt = "DOWNLOAD";
Butt6.onRelease = function () {
getURL ("http://www.sugar-free-games.com/showgame.php?game=1669", "_blank");
};
Symbol 133 MovieClip Frame 2
Key1.Letter = "A";
Key3.Letter = "D";
Key5.Letter = "W";
Key7.Letter = "S";
Butt1.Txt = "MAIN MENU";
Butt2.Txt = "PLAY";
Butt3.Txt = "MORE >";
Butt1.onRelease = function () {
gotoAndStop (1);
};
Butt2.onRelease = function () {
_parent.gotoAndPlay("Init");
};
Butt3.onRelease = function () {
gotoAndStop (7);
};
Symbol 133 MovieClip Frame 3
Butt7.Txt = "BACK";
Butt7.onRelease = function () {
gotoAndStop (1);
};
B1.Txt = "LEVEL 1";
B1.onRelease = function () {
gotoAndStop (2);
};
i = 2;
while (i <= 6) {
this["B" + i].Txt = "LEVEL " + i;
if (i > _parent.Saved.data.LastLevel[_parent.Mode]) {
this["B" + i]._alpha = 40;
this["B" + i].enabled = false;
} else {
this["B" + i]._alpha = 100;
this["B" + i].enabled = true;
this["B" + i].Val = i;
this["B" + i].onRelease = function () {
_parent.CurrLevel = this.Val;
_parent.gotoAndPlay("Init");
};
}
i++;
}
Symbol 133 MovieClip Frame 4
Butt1.Txt = "START";
Butt1.onRelease = function () {
gotoAndStop (5);
};
Butt2.Txt = "LEVEL SELCET";
Butt2.onRelease = function () {
gotoAndStop (6);
};
Butt3.Txt = "CHANGE SEX";
Butt3.onRelease = function () {
_parent.gotoAndStop("GenderSelect");
};
Butt4.Txt = "MORE GAMES";
Butt4.onRelease = function () {
getURL ("http://www.sugar-free-games.com", "_blank");
};
Butt5.Txt = "TOP SCORE";
Butt5.onRelease = function () {
getURL ("http://www.sugar-free-games.com/boysvsgirls.php", "_blank");
};
Butt6.Txt = "DOWNLOAD";
Butt6.onRelease = function () {
getURL ("http://www.sugar-free-games.com/showgame.php?game=1669", "_blank");
};
Symbol 133 MovieClip Frame 5
Key1.Letter = "A";
Key3.Letter = "D";
Key5.Letter = "W";
Key7.Letter = "S";
Butt1.Txt = "MAIN MENU";
Butt2.Txt = "PLAY";
Butt3.Txt = "MORE >";
Butt1.onRelease = function () {
gotoAndStop (4);
};
Butt2.onRelease = function () {
_parent.gotoAndPlay("Init");
};
Butt3.onRelease = function () {
gotoAndStop (8);
};
Symbol 133 MovieClip Frame 6
Butt7.Txt = "BACK";
Butt7.onRelease = function () {
gotoAndStop (4);
};
B1.Txt = "LEVEL 1";
B1.onRelease = function () {
gotoAndStop (5);
};
i = 2;
while (i <= 6) {
this["B" + i].Txt = "LEVEL " + i;
if (i > _parent.Saved.data.LastLevel[_parent.Mode]) {
this["B" + i]._alpha = 40;
this["B" + i].enabled = false;
} else {
this["B" + i]._alpha = 100;
this["B" + i].enabled = true;
this["B" + i].Val = i;
this["B" + i].onRelease = function () {
_parent.CurrLevel = this.Val;
_parent.gotoAndPlay("Init");
};
}
i++;
}
Symbol 133 MovieClip Frame 7
i = 1;
while (i <= 7) {
this["p" + i].gotoAndStop(i + 1);
this["t" + i] = "- " + _parent.PowerUpNames[1][i + 1];
if (i == 6) {
this["p" + i].Gun.gotoAndStop(4);
}
i++;
}
Butt1.Txt = "MAIN MENU";
Butt2.Txt = "PLAY";
Butt3.Txt = "< BACK";
Butt1.onRelease = function () {
gotoAndStop (1);
};
Butt2.onRelease = function () {
_parent.gotoAndPlay("Init");
};
Butt3.onRelease = function () {
gotoAndStop (2);
};
Symbol 133 MovieClip Frame 8
i = 1;
while (i <= 7) {
this["p" + i].gotoAndStop(i + 11);
this["t" + i] = "- " + _parent.PowerUpNames[2][i + 1];
if (i == 6) {
this["p" + i].Gun.gotoAndStop(3);
}
i++;
}
Butt1.Txt = "MAIN MENU";
Butt2.Txt = "PLAY";
Butt3.Txt = "< BACK";
Butt1.onRelease = function () {
gotoAndStop (4);
};
Butt2.onRelease = function () {
_parent.gotoAndPlay("Init");
};
Butt3.onRelease = function () {
gotoAndStop (5);
};
Symbol 319 MovieClip Frame 1
stop();
Symbol 329 MovieClip Frame 1
stop();
Symbol 335 MovieClip Frame 1
stop();
Symbol 345 MovieClip Frame 1
stop();
Symbol 351 MovieClip Frame 1
stop();
Symbol 357 MovieClip Frame 1
stop();
Symbol 365 MovieClip Frame 1
stop();
Symbol 373 MovieClip Frame 1
stop();
Symbol 381 MovieClip Frame 1
stop();
Symbol 389 MovieClip Frame 1
stop();
Symbol 395 MovieClip Frame 1
stop();
Symbol 397 MovieClip Frame 1
stop();
Symbol 405 MovieClip Frame 1
stop();
Symbol 478 MovieClip Frame 1
stop();
Symbol 478 MovieClip Frame 10
if (_parent.RightClickMenu) {
stop();
}
Symbol 479 MovieClip Frame 1
stop();
Symbol 485 MovieClip Frame 1
stop();
Symbol 485 MovieClip Frame 40
_parent.PassLevel();
Symbol 515 MovieClip Frame 1
stop();
Symbol 534 MovieClip Frame 1
stop();
Symbol 552 MovieClip Frame 1
stop();
Symbol 577 MovieClip Frame 1
stop();
Symbol 595 MovieClip Frame 1
stop();
Symbol 602 MovieClip Frame 1
stop();
Symbol 608 MovieClip Frame 1
stop();
Symbol 618 MovieClip Frame 1
stop();
Symbol 641 Button
on (release) {
Game2Done();
}
Symbol 682 MovieClip Frame 1
Mask._visible = false;
Symbol 780 MovieClip Frame 1
Mask._visible = false;
Symbol 832 MovieClip Frame 1
Butt1.Txt = "TRY AGAIN";
Butt1.onRelease = function () {
_parent.gotoAndPlay("Init");
};
Symbol 832 MovieClip Frame 2
Butt1.Txt = "TRY AGAIN";
Butt1.onRelease = function () {
_parent.gotoAndPlay("Init");
};
Symbol 837 MovieClip Frame 1
B1.Txt = "SUBMIT SCORE";
B1.onRelease = function () {
_parent.gotoAndStop("Submit Score");
};
B2.Txt = "MAIN MENU";
B2.onRelease = function () {
_parent.gotoAndStop("Main Menu");
};
Symbol 837 MovieClip Frame 2
B1.Txt = "SUBMIT SCORE";
B1.onRelease = function () {
_parent.gotoAndStop("Submit Score");
};
B2.Txt = "MAIN MENU";
B2.onRelease = function () {
_parent.gotoAndStop("Main Menu");
};
Symbol 843 MovieClip Frame 1
Butt1.Txt = "SUBMIT SCORE";
Butt1.onRelease = function () {
_parent.gotoAndStop("Submit Score");
};
Symbol 843 MovieClip Frame 2
Butt1.Txt = "SUBMIT SCORE";
Butt1.onRelease = function () {
_parent.gotoAndStop("Submit Score");
};
Symbol 853 Button
on (press) {
if (UserName.length > 0) {
_parent.Saved.data.LastSubmitted = UserScore;
_parent.Saved.flush();
Masks = new Array("sdfgjhUHiuhfre89456", "dgtgihUHiu48hUH94h0hff0OPHu985hf(", "afdjrhfKJHuhru85486ujh8hh4iufdbjjkcns", "jfhv vfhdjhvutr85heaiuh88hiuchrs", "srcjhrue8(9iuefh00)984r8yh", "dfvthu/79877yrggbKJHByu8754943t8", "crijioOI885hIUH8fy935hIUH984fh4lqerhuf85(/y9f5h");
Data = new Array();
Data[0] = random(Masks.length);
Data[1] = random(Masks[Data[0]].length);
Data[2] = UserName.length;
ScoreSt = UserScore.toString();
Data[3] = ScoreSt.length;
i = 0;
while (i < Data[2]) {
Data[5 + i] = ord(UserName.charAt(i));
i++;
}
i = 0;
while (i < Data[3]) {
Data[(5 + Data[2]) + i] = ord(ScoreSt.charAt(i));
i++;
}
CheckSum = 0;
i = 5;
while (i < Data.length) {
CheckSum = CheckSum + Data[i];
i++;
}
Data[4] = CheckSum % 100;
COS = Data[1];
i = 2;
while (i < Data.length) {
MaskCo = ord(Masks[Data[0]].charAt(COS)) % 40;
if (MaskCo == 0) {
MaskCo = 40;
}
Data[i] = Data[i] + ord(Masks[Data[0]].charAt(COS));
Data[i] = Data[i] * MaskCo;
COS++;
if (COS >= Masks[Data[0]].length) {
COS = 0;
}
i++;
}
Output = Data.join("x");
Dt.res = Output;
Dt.g = _parent.Mode;
SendData = true;
RName = UserName;
RScore = UserScore;
gotoAndStop (4);
} else {
Nm.gotoAndPlay(2);
}
}
Symbol 856 MovieClip Frame 1
stop();
Symbol 857 Button
on (press) {
_parent.gotoAndStop("Main Menu");
}
Symbol 872 Button
on (press) {
SendData = true;
}
Symbol 873 MovieClip Frame 1
Ind = ScoreInd;
Par = _parent.Score;
ScoreText = _parent.Score;
UserScore = _parent.Score;
Selection.setFocus("UserName");
_parent.Score = 0;
stop();
Instance of Symbol 864 MovieClip "Dt" in Symbol 873 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.SendData) {
getURL ("http://www.sugar-free-games.com/boysvsgirls.php", "_blank", "POST");
_parent.SendData = false;
}
}
Symbol 873 MovieClip Frame 2
gotoAndStop (1);
Symbol 873 MovieClip Frame 3
gotoAndStop (4);
Symbol 873 MovieClip Frame 4
RName = "Name: " + RName;
RScore = "Score: " + RScore;
stop();
Symbol 873 MovieClip Frame 5
gotoAndStop (4);