Frame 1
stopAllSounds();
txtPercent = Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
txtPercentage = txtPercent + "% loaded";
loader.gotoAndStop(txtPercent);
Frame 2
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
gotoAndStop (3);
} else {
gotoAndPlay (1);
}
Frame 3
stopAllSounds();
intro = true;
_root.stattracking = true;
_root.cutscenes = true;
if (_root.stattracking == true) {
com.utilities.StatTracker.submitStat("/flashgames/breakfastclub/sessionstart");
}
_root.timechecker = function () {
_root.gameTIMER = (getTimer() / 1000) / 60;
if (_root.stattracking == true) {
if ((_root.gameTIMER > 2) && (_root.TWOminutes != true)) {
com.utilities.StatTracker.submitStat("/flashgames/breakfastclub/02minutes");
_root.TWOminutes = true;
} else if ((_root.gameTIMER > 5) && (_root.FIVEminutes != true)) {
com.utilities.StatTracker.submitStat("/flashgames/breakfastclub/05minutes");
_root.FIVEminutes = true;
} else if ((_root.gameTIMER > 10) && (_root.TENminutes != true)) {
com.utilities.StatTracker.submitStat("/flashgames/breakfastclub/10minutes");
_root.TENminutes = true;
}
}
};
mouseTIMERMAX = 10;
basketball = false;
Mouse.show();
_root.kRIGHTconfig = 39;
_root.kLEFTconfig = 37;
_root.kUPconfig = 38;
_root.kDOWNconfig = 40;
_root.kJUMPconfig = 32;
_root.kTHROWconfig = 70;
_root.kPAUSEconfig = 80;
_root.kSTARTconfig = 32;
_root.kRIGHT = _root.kRIGHTconfig;
_root.kLEFT = _root.kLEFTconfig;
_root.kUP = _root.kUPconfig;
_root.kDOWN = _root.kDOWNconfig;
_root.kJUMP = _root.kJUMPconfig;
_root.kTHROW = _root.kTHROWconfig;
_root.kPAUSE = _root.kPAUSEconfig;
_root.kSTART = _root.kSTARTconfig;
_root.PAUSE = false;
_root.kSKIPLEVEL = 36;
_root.GAMEattachDEPTH = 5000;
_root.attachDEPTH = _root.GAMEattachDEPTH;
_root.LevelNames = [];
_root.gameTIME = 0;
_root.GAMEplayer1points = 0;
_root.GAMEtotalpoints = 0;
_root.leveldeaths = 0;
_root.gamedeaths = 0;
_root.savedData = SharedObject.getLocal("BreakfastClubData");
if (_root.savedData.data.levelMAX == undefined) {
_root.savedData.data.levelMAX = 1;
_root.savedData.flush();
}
var soundManager_mc;
trace(_root.attachDEPTH);
var soundManagerMCthing = _root.attachMovie("ManagerSymbol", "soundManagerMC", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
soundManagerMCthing._visible = false;
var theSoundManager_mc = (new com.managers.SoundManager(soundManagerMCthing));
_root.soundManager_mc = theSoundManager_mc;
_root.soundManager_mc.addSound("Beep_Error06.wavsound");
_root.soundManager_mc.setSoundVolume("Beep_Error06.wavsound", 50);
_root.soundManager_mc.addSound("Cartoon_OpenMagicBag2.wav");
_root.soundManager_mc.setSoundVolume("Cartoon_OpenMagicBag2.wav", 50);
_root.soundManager_mc.addSound("Pickup_Key10.wav");
_root.soundManager_mc.setSoundVolume("Pickup_Key10.wav", 50);
_root.soundManager_mc.addSound("Pickup_bombs.wav");
_root.soundManager_mc.setSoundVolume("Pickup_bombs.wav", 50);
_root.soundManager_mc.addSound("Cartoon_BombFall_Whistle1.wav");
_root.soundManager_mc.setSoundVolume("Cartoon_BombFall_Whistle1.wav", 25);
_root.soundManager_mc.addSound("jump2.wav");
_root.soundManager_mc.setSoundVolume("jump2.wav", 50);
_root.soundManager_mc.addSound("jump 1");
_root.soundManager_mc.setSoundVolume("jump 1", 50);
_root.soundManager_mc.addSound("bender_2xjump.aiff");
_root.soundManager_mc.setSoundVolume("bender_2xjump.aiff", 50);
_root.soundManager_mc.addSound("throw 1");
_root.soundManager_mc.setSoundVolume("throw 1", 50);
_root.soundManager_mc.addSound("bender_throw2.aiff");
_root.soundManager_mc.setSoundVolume("bender_throw2.aiff", 50);
_root.soundManager_mc.addSound("bender_pickup.aiff");
_root.soundManager_mc.setSoundVolume("bender_pickup.aiff", 50);
_root.soundManager_mc.addSound("dogGrowl");
_root.soundManager_mc.setSoundVolume("dogGrowl", 30);
_root.soundManager_mc.addSound("dogBark");
_root.soundManager_mc.setSoundVolume("dogBark", 30);
_root.soundManager_mc.addSound("BreakfastCinematic.wav");
_root.soundManager_mc.addSound("BreakfastEnding.wav");
_root.soundManager_mc.addSound("BreakfastIntroCinematic.wav");
_root.soundManager_mc.addSound("BreakfastInGame1.wav");
_root.soundManager_mc.addSound("BreakfastInGame2.wav");
_root.soundManager_mc.addSound("BreakfastInGame3.wav");
_root.soundManager_mc.addSound("BreakfastInGame4.wav");
_root.soundManager_mc.addSound("BreakfastBoss.wav");
_root.soundManager_mc.addSound("Explo_Small_Bomb3.wav");
_root.soundManager_mc.setSoundVolume("Explo_Small_Bomb3.wav", 30);
_root.soundManager_mc.addSound("explosion.wav");
_root.soundManager_mc.setSoundVolume("explosion.wav", 50);
_root.soundManager_mc.addSound("B12sFire_Shot.wav");
_root.soundManager_mc.setSoundVolume("B12sFire_Shot.wav", 30);
_root.soundManager_mc.addSound("get cigs.wav");
_root.soundManager_mc.setSoundVolume("jump2.wav", 50);
_root.soundManager_mc.addSound("Claws_RatScurry_Loop.wav");
_root.soundManager_mc.addSound("GiantBeetle_Death2.wav");
_root.soundManager_mc.addSound("GiantMantis_Death.wav");
_root.soundManager_mc.addSound("GiantMantis_Roar3.wav");
_root.soundManager_mc.addSound("GiantMantis_Spit.wav");
_root.soundManager_mc.addSound("Hit_SlimeSplat8.wav");
_root.soundManager_mc.playSound("BreakfastEnding.wav", 0, 9999999999);
stop();
Frame 4
if (_root.go != true) {
gotoAndStop (3);
} else {
_root.go = false;
}
Frame 5
if (intro != true) {
stopAllSounds();
_root.soundManager_mc.playSound("BreakfastEnding.wav", 0, 9999999999);
}
intro = false;
Mouse.show();
_root.rockbonus = 0;
_root.leveldeaths = 0;
_root.gamedeaths = 0;
_root.levelselect = true;
_root.cutscene1 = false;
_root.cutscene2 = false;
_root.cutscene3 = false;
_root.cutscene4 = false;
_root.cutscene5 = false;
stop();
Instance of Symbol 240 MovieClip "First" in Frame 5
onClipEvent (load) {
this.textvalue = "I";
this.linkvalue = "Level 0A Start";
this.gotoAndStop("1-1");
_root.LevelNames[_root.LevelNames.length] = "0A";
if ((_root.savedData.data.levelMAX < 1) && (!Key.isDown(_root.kSKIPLEVEL))) {
_visible = false;
} else if (Key.isDown(_root.kSKIPLEVEL)) {
_root.cheats = true;
_root.devinfo = true;
}
}
Instance of Symbol 240 MovieClip in Frame 5
onClipEvent (load) {
this.textvalue = "II";
this.linkvalue = "Level 0B Start";
this.gotoAndStop("1-2");
_root.LevelNames[_root.LevelNames.length] = "0B";
if ((_root.savedData.data.levelMAX < 2) && (!Key.isDown(_root.kSKIPLEVEL))) {
_visible = false;
}
}
Instance of Symbol 240 MovieClip in Frame 5
onClipEvent (load) {
this.textvalue = "III";
this.linkvalue = "Level 1 Start";
this.gotoAndStop("2-1");
_root.LevelNames[_root.LevelNames.length] = "1";
if ((_root.savedData.data.levelMAX < 3) && (!Key.isDown(_root.kSKIPLEVEL))) {
_visible = false;
}
}
Instance of Symbol 240 MovieClip in Frame 5
onClipEvent (load) {
this.textvalue = "IV";
this.linkvalue = "Level 2 Start";
this.gotoAndStop("2-2");
_root.LevelNames[_root.LevelNames.length] = "2";
if ((_root.savedData.data.levelMAX < 4) && (!Key.isDown(_root.kSKIPLEVEL))) {
_visible = false;
}
}
Instance of Symbol 240 MovieClip in Frame 5
onClipEvent (load) {
this.textvalue = "V";
this.linkvalue = "Level 2-2 Start";
this.gotoAndStop("3-1");
_root.LevelNames[_root.LevelNames.length] = "2-2";
if ((_root.savedData.data.levelMAX < 5) && (!Key.isDown(_root.kSKIPLEVEL))) {
_visible = false;
}
}
Instance of Symbol 240 MovieClip in Frame 5
onClipEvent (load) {
this.textvalue = "VI";
this.linkvalue = "Level 3 Start";
this.gotoAndStop("3-2");
_root.LevelNames[_root.LevelNames.length] = "3";
if ((_root.savedData.data.levelMAX < 6) && (!Key.isDown(_root.kSKIPLEVEL))) {
_visible = false;
}
}
Instance of Symbol 240 MovieClip in Frame 5
onClipEvent (load) {
this.textvalue = "VII";
this.linkvalue = "Level 4 Start";
this.gotoAndStop("4-1");
_root.LevelNames[_root.LevelNames.length] = "4";
if ((_root.savedData.data.levelMAX < 7) && (!Key.isDown(_root.kSKIPLEVEL))) {
_visible = false;
}
}
Instance of Symbol 240 MovieClip in Frame 5
onClipEvent (load) {
this.textvalue = "VIII";
this.linkvalue = "Level 5 Start";
this.gotoAndStop("4-2");
_root.LevelNames[_root.LevelNames.length] = "5";
if ((_root.savedData.data.levelMAX < 8) && (!Key.isDown(_root.kSKIPLEVEL))) {
_visible = false;
}
}
Instance of Symbol 240 MovieClip in Frame 5
onClipEvent (load) {
this.textvalue = "FINAL";
this.linkvalue = "Level 6 Start";
this.gotoAndStop("5-1");
_root.LevelNames[_root.LevelNames.length] = "6";
if ((_root.savedData.data.levelMAX < 9) && (!Key.isDown(_root.kSKIPLEVEL))) {
_visible = false;
}
}
Frame 6
if (_root.go != true) {
gotoAndStop (5);
} else {
_root.go = false;
}
Frame 7
stopAllSounds();
_root.cutscene1 = true;
_root.go = false;
stop();
Frame 8
if (_root.go != true) {
gotoAndStop (7);
} else {
_root.go = false;
}
Frame 9
if ((_root.cutscene1 != true) && (_root.cutscenes == true)) {
_root.gotoAndPlay("cutscene1");
}
Mouse.show();
stopAllSounds();
_root.level = "Level 0A";
_root.kRIGHT = _root.kRIGHTconfig;
_root.kLEFT = _root.kLEFTconfig;
_root.kUP = _root.kUPconfig;
_root.kDOWN = _root.kDOWNconfig;
_root.kJUMP = _root.kJUMPconfig;
_root.kTHROW = _root.kTHROWconfig;
_root.kPAUSE = _root.kPAUSEconfig;
_root.kSTART = _root.kSTARTconfig;
_root.pauseTIME = 0;
if (_root.died == true) {
_root.leveldeaths = _root.leveldeaths + 1;
}
if (_root.stattracking == true) {
if (_root.died == false) {
StatTracker.submitStat("/flashgames/breakfastclub/level1start");
} else {
StatTracker.submitStat("/flashgames/breakfastclub/level1died");
}
}
stop();
Frame 10
if (_root.go != true) {
gotoAndStop (9);
} else {
_root.go = false;
}
Frame 11
stopAllSounds();
_root.soundManager_mc.playSound("BreakfastInGame1.wav", 0, 9999999999);
if ((_root.savedData.data.levelMAX > 1) && (_root.stattracking == true)) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl1replay");
}
onMouseMove = function () {
mouseTIMERstart = getTimer() / 1000;
Mouse.show();
};
onEnterFrame = function () {
_root.timechecker();
mouseTIMER = (getTimer() / 1000) - mouseTIMERstart;
if (mouseTIMER >= mouseTIMERMAX) {
Mouse.hide();
}
};
_root.attachDEPTH = _root.GAMEattachDEPTH;
_root.WorldString = undefined;
if (_root.WorldString != undefined) {
SoftCOLOR = 65535;
SoftALPHA = 50;
TiledCOLOR = 16711935 /* 0xFF00FF */;
TiledALPHA = 50;
HardCOLOR = 16711680 /* 0xFF0000 */;
HardALPHA = 50;
WaterCOLOR = 255;
WaterALPHA = 50;
SpringCOLOR = 16776960 /* 0xFFFF00 */;
SpringALPHA = 50;
_root.World.createEmptyMovieClip("SoftBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.SoftBoundary.objects = 0;
_root.WorldArray[0] = [];
_root.World.createEmptyMovieClip("TiledBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.TiledBoundary.objects = 0;
_root.WorldArray[1] = [];
_root.World.createEmptyMovieClip("HardBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.SoftBoundary.objects = 0;
_root.WorldArray[2] = [];
_root.World.createEmptyMovieClip("WaterBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.WaterBoundary.objects = 0;
_root.WorldArray[3] = [];
_root.World.createEmptyMovieClip("SpringBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.SpringBoundary.objects = 0;
_root.WorldArray[4] = [];
_root.World.createEmptyMovieClip("Art", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.Art.objects = 0;
_root.WorldArray[5] = [];
_root.WorldArray = _root.WorldString.split(">>>>");
boundaryelements = 0;
while (boundaryelements < _root.WorldArray.length) {
_root.WorldArray[boundaryelements] = _root.WorldArray[boundaryelements].split("|");
objectelements = 0;
while (objectelements < _root.WorldArray[boundaryelements].length) {
_root.WorldArray[boundaryelements][objectelements] = _root.WorldArray[boundaryelements][objectelements].split("/");
anchorelements = 0;
while (anchorelements < _root.WorldArray[boundaryelements][objectelements].length) {
_root.WorldArray[boundaryelements][objectelements][anchorelements] = _root.WorldArray[boundaryelements][objectelements][anchorelements].split(",");
anchorelements++;
}
objectelements++;
}
boundaryelements++;
}
boundaryload = 0;
while (boundaryload < _root.WorldArray.length) {
if (boundaryload == 0) {
boundary = "Soft";
boundaryCOLOR = _root.SoftCOLOR;
boundaryALPHA = _root.SoftALPHA;
} else if (boundaryload == 1) {
boundary = "Tile";
boundaryCOLOR = _root.TileCOLOR;
boundaryALPHA = _root.TileALPHA;
} else if (boundaryload == 2) {
boundary = "Hard";
boundaryCOLOR = _root.HardCOLOR;
boundaryALPHA = _root.HardALPHA;
} else if (boundaryload == 3) {
boundary = "Water";
boundaryCOLOR = _root.WaterCOLOR;
boundaryALPHA = _root.WaterALPHA;
} else if (boundaryload == 4) {
boundary = "Spring";
boundaryCOLOR = _root.SpringCOLOR;
boundaryALPHA = _root.SpringALPHA;
} else if (boundaryload == 5) {
boundary = "Art";
boundaryCOLOR = _root.ArtCOLOR;
boundaryALPHA = _root.ArtALPHA;
}
_root.World.createEmptyMovieClip(boundary + "Boundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
objectload = 0;
while (objectload < _root.WorldArray[boundaryload].length) {
_root.World[boundary + "Boundary"].objects = objectload + 1;
_root.World[boundary + "Boundary"].createEmptyMovieClip("Object" + (objectload + 1), _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
anchorload = 0;
while (anchorload < _root.WorldArray[boundaryload][objectload].length) {
if ((anchorload == 0) && (_root.WorldArray[boundaryload][objectload][anchorload][0] != "Art")) {
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].lineStyle(1, 0, 100);
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].beginFill(boundaryCOLOR, boundaryALPHA);
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].moveTo(_root.WorldArray[boundaryload][objectload][anchorload][1], _root.WorldArray[boundaryload][objectload][anchorload][2]);
} else if (_root.WorldArray[boundaryload][objectload][anchorload][0] != "Art") {
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].lineTo(_root.WorldArray[boundaryload][objectload][anchorload][1], _root.WorldArray[boundaryload][objectload][anchorload][2]);
} else if (_root.WorldArray[boundaryload][objectload][anchorload][0] == "Art") {
anchorload++;
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].removeMovieClip();
_root.World[boundary + "Boundary"].attachMovie(_root.WorldArray[boundaryload][objectload][anchorload][0], _root.WorldArray[boundaryload][objectload][anchorload][0] + (objectload + 1), _root.attachDEPTH, {_x:_root.WorldArray[boundaryload][objectload][anchorload][1], _y:_root.WorldArray[boundaryload][objectload][anchorload][2]});
break;
}
anchorload++;
}
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].endFill();
objectload++;
}
boundaryload++;
}
}
stop();
Instance of Symbol 499 MovieClip in Frame 11
onClipEvent (load) {
_name = "World";
framerateDEFAULT = 24;
framerateMAX = 120;
framerateMIN = 12;
DEGtoRAD = (Math.PI/180);
bubbleDEPTH = 1000;
this.bottomlesspit = 5000;
this.Player1.points = 0;
this.points = 0;
this.badguyDISTANCEMAX = 300;
this.bomberCHANCE = Infinity;
this.bombers = 0;
this.Goombas = 0;
this.KoopaTroopas = 0;
this.AttackDogs = 0;
this.Barrels = 0;
this.BarrelsFilled = 0;
digitMODE = "constant";
charALIVE = true;
charBLINK = true;
charBLINKTIME = 1;
charBLINKTIMER = 0;
Player1.rocksloaded = 0;
Player1.rocksthrown = 0;
Player1.rocksloadedMAX = 3;
rocksMAX = 6;
dHEIGHT = 0.5;
uHEIGHT = 0.5;
rWIDTH = 0.5;
rHEIGHT = 0;
urWIDTH = 0.3;
urHEIGHT = 0.25;
lWIDTH = 0.5;
lHEIGHT = 0;
ulWIDTH = 0.3;
ulHEIGHT = 0.25;
offsetX = 0;
offsetY = 0;
charACTION = true;
initWIDTH = Player1.sensor._width;
initHEIGHT = Player1.sensor._height;
initHYP = Math.sqrt(Math.pow(initWIDTH, 2) + Math.pow(initHEIGHT, 2));
initANGLE1 = Math.asin(initHEIGHT / initHYP);
initANGLE2 = Math.asin(initWIDTH / initHYP);
slopesensorRATIO = 3;
floorpushes = 100;
speedXMAX = 25;
speedYMAX = 25;
speedMAXdivisor = 1;
speedXMIN = 0.05;
speedYMIN = 0.05;
slidespeedMIN = 0.05;
jumpTHRESHOLD = 2;
airjumpsMAX = 1;
duckjumpRATIO = 2;
throwTIME = 2.5;
throwANGLEup = 65;
throwANGLEforward = 75;
throwANGLEdown = 120;
nosedivebounceTIME = 0.25;
swimcollideMAX = 7;
duckpaddleFALLSPEED = 7.5;
duckpaddleRATIO = 3;
faceX = 1;
faceY = 1;
digitARCLENGTH = 22.5;
engineloops = 4;
speedmultiUNIVERSAL = 1;
speedmultiX = speedmultiUNIVERSAL;
speedmultiY = speedmultiUNIVERSAL;
speedmultiROT = speedmultiUNIVERSAL;
movedragX = 1.175;
movedragY = 1.175;
slidedragX = 1.01;
slidedragY = 1.01;
waterdragX = 2.5;
waterdragY = 2.5;
swimdragX = 1.004;
swimdragY = 1.004;
watergroundfriction = 1.05;
throwdrag = 2.5;
swimspindrag = 1.1;
airspindrag = 1.1;
windrateX = 0 * speedmultiX;
windrateY = 0 * speedmultiY;
watercurrentrateX = 0 * speedmultiX;
watercurrentrateY = 0 * speedmultiY;
gravityrateX = 0 * speedmultiX;
gravityrateY = 0.25 * speedmultiY;
gspeedX = 0 * speedmultiX;
gspeedY = 0 * speedmultiY;
windX = 0 * speedmultiX;
windY = 0 * speedmultiY;
windspeedX = 0 * speedmultiX;
windspeedY = 0 * speedmultiY;
environment = "falling";
environmentchecker = "air";
moverate = 0.6 * speedmultiUNIVERSAL;
sliderate = 0.75 * speedmultiUNIVERSAL;
sliderampBOOST = 0.8 * speedmultiUNIVERSAL;
sliderampTHRESHOLD = 13;
swimspeedMAXTRANSFER = 15 * speedmultiUNIVERSAL;
jumprateX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
jumprateY = (40 * gravityrateY) / Math.sqrt(speedmultiY);
walljumpTIME = 20;
nosedivejumprateX = jumprateX * 1.4;
nosedivejumprateY = jumprateY * 1.4;
springrateX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
springrateY = (50 * gravityrateY) / Math.sqrt(speedmultiY);
nosediveBOUNCEXrate = 0.5;
nosediveBOUNCEYrate = (24 * gravityrateY) / Math.sqrt(speedmultiY);
nosediveBOUNCEspinrate = 17 * speedmultiROT;
swimrateX = (1 * gravityrateY) / Math.sqrt(speedmultiY);
swimrateY = (1 * gravityrateY) / Math.sqrt(speedmultiY);
throwrate = (40 * gravityrateY) / Math.sqrt(speedmultiY);
swimspinrate = 0.5 * speedmultiROT;
airspinrate = 0.75 * speedmultiROT;
watergroundboostX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
watergroundboostY = (0 * gravityrateY) / Math.sqrt(speedmultiY);
moveX = 0 * speedmultiX;
moveY = 0 * speedmultiY;
movespeedX = 0 * speedmultiX;
movespeedY = 0 * speedmultiY;
jumpX = 0 * speedmultiX;
jumpY = 0 * speedmultiY;
walljumpTIMER = 0;
airjumpCOUNT = 0;
jumpspeedX = 0 * speedmultiX;
jumpspeedY = 0 * speedmultiY;
swimX = 0 * speedmultiX;
swimY = 0 * speedmultiY;
swimX2 = 0 * speedmultiX;
swimY2 = 0 * speedmultiY;
swimI = 0 * speedmultiUNIVERSAL;
swimspeedX = 0 * speedmultiX;
swimspeedY = 0 * speedmultiY;
speedX = 0 * speedmultiX;
speedY = 0 * speedmultiY;
swimspin = 0 * speedmultiROT;
swimspinspeed = 0 * speedmultiROT;
airspin = 0 * speedmultiROT;
airspinspeed = 0 * speedmultiROT;
camera._visible = false;
stagehalfWIDTH = 275;
stagehalfHEIGHT = 200;
stageWIDTH = 550;
stageHEIGHT = 400;
camLOOSENESS = 50;
camMOVEXLEAD = 30;
camMOVEYLEAD = -30;
camWATERXLEAD = 5;
camWATERYLEAD = 5;
zoomMIN = 125;
zoomMAX = 250;
zoomMINmanual = zoomMIN;
zoomMAXmanual = zoomMAX;
camera._xscale = zoomMIN;
camera._yscale = zoomMIN;
zoomINCREMENT = 0.25 * speedmultiX;
zoomINCREMENTmanual = 1;
zoomLEAD = 90;
safezoneDISTANCE = 100;
startTime = getTimer();
numFrames = 0;
recentSetting = 5;
recentNumFrames = 0;
recentStartTime = startTime;
charX = Player1._x;
charY = Player1._y;
charROT = Player1._rotation;
charsensorX = Player1.sensor._x;
charsensorY = Player1.sensor._y;
charsensorWIDTH = Player1.sensor._width;
charsensorHEIGHT = Player1.sensor._height;
camX = camera._x;
camY = camera._y;
camROT = camera._rotation;
camXSCALE = camera._xscale;
camYSCALE = camera._yscale;
camWIDTHinit = camera._width;
camHEIGHTinit = camera._height;
camWIDTH = camera._width;
camHEIGHT = camera._height;
worldX = _x;
worldY = _y;
worldROT = _rotation;
worldXSCALE = _xscale;
worldYSCALE = _yscale;
}
onClipEvent (enterFrame) {
_root.player1points = this.Player1.points;
_root.totalpoints = this.points;
numFrames++;
now = getTimer();
elapsedSeconds = (now - startTime) / 1000;
actualFPS = numFrames / elapsedSeconds;
recentNumFrames++;
if (recentNumFrames == recentSetting) {
recentElapsedSeconds = (now - recentStartTime) / 1000;
recentFPSoutput = recentNumFrames / recentElapsedSeconds;
recentStartTime = now;
recentNumFrames = 0;
}
if (((recentFPSoutput >= framerateMIN) && (recentFPSoutput <= framerateMAX)) && (elapsedSeconds >= 1)) {
engineloops = framerateMAX / Math.ceil(recentFPSoutput);
} else if (elapsedSeconds < 1) {
engineloops = framerateMAX / framerateDEFAULT;
}
if ((Key.isDown(_root.kPAUSE) && (_root.PAUSE == false)) && (this.pausearmed == true)) {
_root.PAUSE = true;
this.pausearmed = false;
_root.pauseSTART = getTimer() / 1000;
} else if (((Key.isDown(_root.kPAUSE) && (_root.PAUSE == true)) && (this.pausearmed == true)) && (_root.textbubble == undefined)) {
_root.PAUSE = false;
this.pausearmed = false;
_root.pauseEND = getTimer() / 1000;
_root.pauseTIME = _root.pauseTIME + (_root.pauseEND - _root.pauseSTART);
}
if (!Key.isDown(_root.kPAUSE)) {
this.pausearmed = true;
}
if (_root.PAUSE == true) {
engineloops = 0;
}
worldXinit = _x;
worldYinit = _y;
worldROTinit = _rotation;
worldXSCALEinit = _xscale;
worldYSCALEinit = _yscale;
if (charALIVE == false) {
_root.kRIGHT = undefined;
_root.kLEFT = undefined;
_root.kUP = undefined;
_root.kDOWN = undefined;
_root.kJUMP = undefined;
_root.kTHROW = undefined;
_root.died = true;
_root.levelselect = false;
}
if ((charBLINK == true) && (charBLINKTIMER < charBLINKTIME)) {
if (Player1._visible == true) {
Player1._visible = false;
} else {
Player1._visible = true;
}
charBLINKTIMER = charBLINKTIMER + ((1 / this.framerateMAX) * this.engineloops);
} else {
Player1._visible = true;
charBLINKTIMER = 0;
charBLINK = false;
}
if ((random(bomberCHANCE) == 0) && (_root.PAUSE == false)) {
if (random(2) == 0) {
bomberDIRX = 1;
} else {
bomberDIRX = -1;
}
bomberDIRY = -1;
bombers = bombers + 1;
this.attachMovie("Bomber 1", "Bomber" + bombers, _root.attachDEPTH, {_x:this.camera._x + (((this.camera._width / 2) + this.badguyDISTANCEMAX) * bomberDIRX), _y:this.camera._y + (random(this.camera._width / 2) * bomberDIRY), flyDIR:bomberDIRX});
_root.attachDEPTH = _root.attachDEPTH + 1;
}
frameloops = 1;
while (frameloops <= engineloops) {
if (environmentchecker != "bellyslide") {
charWIDTH = Math.abs(Math.cos(initANGLE1 - ((Math.abs(charROT) + 180) * DEGtoRAD)) * initHYP);
charHEIGHT = Math.abs(Math.cos(initANGLE2 - ((Math.abs(charROT) + 180) * DEGtoRAD)) * initHYP);
} else {
charWIDTH = initWIDTH;
charHEIGHT = initWIDTH;
}
slopesensorDISTANCE = charWIDTH / slopesensorRATIO;
if (((speedY >= 0) && (SoftBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true))) || ((speedY >= 0) && (HardBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)))) {
TOUCHground = true;
if (((speedY >= 0) && (SoftBoundary.DigitBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true))) || ((speedY >= 0) && (HardBoundary.DigitBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)))) {
TOUCHdigit = true;
} else {
TOUCHdigit = false;
}
} else {
TOUCHground = false;
TOUCHdigit = false;
}
if (HardBoundary.hitTest((((((charsensorX + charX) + offsetX) + (charWIDTH * 0.5)) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.25)) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHwallright = true;
} else {
TOUCHwallright = false;
}
if (HardBoundary.hitTest((((((charsensorX + charX) + offsetX) - (charWIDTH * 0.5)) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.25)) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHwallleft = true;
} else {
TOUCHwallleft = false;
}
if (HardBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) - (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHceiling = true;
} else {
TOUCHceiling = false;
}
if (Water.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, ((((charsensorY + charY) + offsetY) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHwater = true;
} else {
TOUCHwater = false;
}
if (Spring.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true) && (speedY >= 0)) {
TOUCHspring = true;
} else {
TOUCHspring = false;
}
if (charY > bottomlesspit) {
charALIVE = false;
}
if (((_root.World.charBLINK == false) && (_root.DeathBoundaryPresent == true)) && (this.DeathBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, ((((charsensorY + charY) + offsetY) * worldYSCALEinit) / 100) + worldYinit, true))) {
if (this.Player1.rocksloaded > 0) {
this.throwANGLEdamaged = random(90) - 45;
this.throwratedamaged = 8;
this.Player1.rocksthrown = this.Player1.rocksthrown + 1;
this.attachMovie("Rock 1", "rock" + this.Player1.rocksthrown, 100 + this.Player1.rocksthrown, {_x:this.charsensorX + this.charX, _y:(this.charsensorY + this.charY) - ((this.charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEdamaged * DEGtoRAD) * throwratedamaged) * this.faceX) + this.speedX, throwspeedY:(Math.cos(throwANGLEdamaged * DEGtoRAD) * throwratedamaged) - this.speedY, weapon:false});
this.oldrock = this.Player1.rocksthrown - this.rocksMAX;
this["rock" + this.oldrock].removeMovieClip();
this.Player1.rocksloaded = this.Player1.rocksloaded - 1;
this.charBLINK = true;
_root.soundManager_mc.playSound("jump2.wav", 0, 1);
} else {
this.charALIVE = false;
}
}
if ((((environmentchecker == "air") && (TOUCHwater == true)) && (Math.abs(speedY) < duckpaddleFALLSPEED)) || (environment == "duckpaddle")) {
environment = "duckpaddle";
} else if (((((TOUCHwater == true) && (TOUCHground == true)) || ((TOUCHwater == true) && (TOUCHceiling == true))) || ((TOUCHwater == true) && (TOUCHwallleft == true))) || ((TOUCHwater == true) && (TOUCHwallright == true))) {
environment = "watergrounded";
} else if ((TOUCHwater == true) && (speedY < 0)) {
environment = "swimmingupward";
} else if (((TOUCHwater == true) && (TOUCHground == false)) && (speedY >= 0)) {
environment = "swimmingdownward";
} else if ((TOUCHspring == true) && (speedY >= 0)) {
environment = "sprung";
} else if ((TOUCHground == true) && (speedY >= 0)) {
environment = "grounded";
} else if (speedY < 0) {
environment = "flying";
} else if (((((TOUCHwallright == true) && (Key.isDown(_root.kRIGHT))) && (TOUCHground == false)) && (speedY >= 0)) || ((((TOUCHwallleft == true) && Key.isDown(_root.kLEFT)) && (TOUCHground == false)) && (speedY >= 0))) {
environment = "wallslide";
} else if ((TOUCHground == false) && (speedY >= 0)) {
environment = "falling";
}
if (((Player1.rocksloaded > 0) && (throwarmed == true)) && (Key.isDown(_root.kTHROW))) {
_root.soundManager_mc.stopSound("throw 1", 0, 1);
_root.soundManager_mc.playSound("throw 1", 0, 1);
Player1.rocksthrown = Player1.rocksthrown + 1;
if (environment != "wallslide") {
if (Key.isDown(_root.kUP)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:charsensorX + charX, _y:(charsensorY + charY) - ((charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEup * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEup * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else if (Key.isDown(_root.kDOWN)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * faceX), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEdown * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEdown * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * faceX), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEforward * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEforward * DEGtoRAD) * throwrate) - speedY, weapon:true});
}
} else if (Key.isDown(_root.kUP)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:charsensorX + charX, _y:(charsensorY + charY) - ((charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEup * DEGtoRAD) * throwrate) * (-faceX)) + speedX, throwspeedY:(Math.cos(throwANGLEup * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else if (Key.isDown(_root.kDOWN)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * (-faceX)), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEdown * DEGtoRAD) * throwrate) * (-faceX)) + speedX, throwspeedY:(Math.cos(throwANGLEdown * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * (-faceX)), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEforward * DEGtoRAD) * throwrate) * (-faceX)) + speedX, throwspeedY:(Math.cos(throwANGLEforward * DEGtoRAD) * throwrate) - speedY, weapon:true});
}
oldrock = Player1.rocksthrown - this.rocksMAX;
this["rock" + oldrock].removeMovieClip();
Player1.rocksloaded = Player1.rocksloaded - 1;
throwarmed = false;
} else if (!Key.isDown(_root.kTHROW)) {
throwarmed = true;
} else {
throwarmed = false;
}
if (environment == "grounded") {
if ((environmentchecker != "bellyslide") && (environmentchecker != "nosedivebounce")) {
movementhyp = moverate / Math.pow(Math.pow(dr - dl, 2) + Math.pow(slopesensorDISTANCE, 2), 0.5);
if (Key.isDown(_root.kRIGHT) && (TOUCHwallright == false)) {
moveX = movementhyp * slopesensorDISTANCE;
moveY = movementhyp * (-Math.abs(dr - dl));
faceX = 1;
} else if (Key.isDown(_root.kLEFT) && (TOUCHwallleft == false)) {
moveX = movementhyp * (-slopesensorDISTANCE);
moveY = movementhyp * (-Math.abs(dr - dl));
faceX = -1;
} else {
moveX = 0;
moveY = 0;
}
}
if (Key.isDown(_root.kJUMP) && (jumparmed == true)) {
jumpX = 0;
jumpY = jumprateY;
gspeedX = 0;
gspeedY = 0;
moveY = 0;
movespeedY = 0;
jumparmed = false;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
} else if ((environment == "wallslide") || (environmentchecker == "wallsliding")) {
if (Key.isDown(_root.kRIGHT)) {
faceX = 1;
} else if (Key.isDown(_root.kLEFT)) {
faceX = -1;
}
if (Key.isDown(_root.kJUMP) && (jumparmed == true)) {
jumpX = 0;
jumpY = jumprateY * 1.2;
gspeedX = 0;
gspeedY = 0;
if (Key.isDown(_root.kRIGHT)) {
moveX = -moverate;
} else if (Key.isDown(_root.kLEFT)) {
moveX = moverate;
}
moveY = 0;
movespeedY = 0;
jumparmed = false;
walljumpTIMER = walljumpTIME;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
} else if ((environment == "flying") || (environment == "falling")) {
if (walljumpTIMER <= 0) {
if (environmentchecker != "bellyslide") {
if (Key.isDown(_root.kRIGHT) && (TOUCHwallright == false)) {
moveX = moverate;
faceX = 1;
} else if (Key.isDown(_root.kLEFT) && (TOUCHwallleft == false)) {
moveX = -moverate;
faceX = -1;
} else {
moveX = 0;
}
} else {
moveX = 0;
}
walljumpTIMER = 0;
} else {
walljumpTIMER = walljumpTIMER - 1;
}
if (((Key.isDown(_root.kJUMP) && (jumparmed == true)) && (airjumpCOUNT > 0)) && (walljumpTIMER <= 0)) {
jumpspeedX = 0;
jumpspeedY = jumprateY;
gspeedX = 0;
gspeedY = 0;
moveY = 0;
movespeedY = 0;
jumparmed = false;
airjumpCOUNT = airjumpCOUNT - 1;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
if (environmentchecker == "ground") {
jumpassists = 0;
}
if (((((((jumpassists == 0) && (Key.isDown(_root.kJUMP))) && (gspeedY <= jumpTHRESHOLD)) && ((dr + dl) > -2)) && (walljumpTIMER <= 0)) && (TOUCHwallleft == false)) && (TOUCHwallright == false)) {
airjumpCOUNT = airjumpsMAX;
jumpassists = jumpassists + 1;
}
} else if ((((environment == "duckpaddle") || (environment == "swimmingupward")) || (environment == "swimmingdownward")) || (environment == "watergrounded")) {
if ((Key.isDown(_root.kRIGHT) && (Key.isDown(_root.kUP))) && (environment != "duckpaddle")) {
if ((charROT > -135) && (charROT <= 45)) {
if ((45 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-135 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((45 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-135 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if (Key.isDown(_root.kRIGHT) && (Key.isDown(_root.kDOWN))) {
if ((charROT > -45) && (charROT <= 135)) {
if ((135 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-45 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((135 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-45 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((Key.isDown(_root.kLEFT) && (Key.isDown(_root.kUP))) && (environment != "duckpaddle")) {
if ((charROT >= -45) && (charROT < 135)) {
if ((-45 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (135 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((-45 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (135 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kLEFT) && (Key.isDown(_root.kDOWN))) {
if ((charROT >= -135) && (charROT < 45)) {
if ((-135 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (45 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((-135 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (45 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kRIGHT)) {
if (environment == "duckpaddle") {
faceX = 1;
} else if ((charROT >= -90) && (charROT < 90)) {
if ((90 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-90 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((90 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-90 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if (Key.isDown(_root.kLEFT)) {
if (environment == "duckpaddle") {
faceX = -1;
} else if ((charROT > -90) && (charROT <= 90)) {
if ((90 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (-90 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((90 > (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (-90 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kUP) && (environment != "duckpaddle")) {
if (faceX > 0) {
if ((0 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-180 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 0;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((0 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (180 > (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 0;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kDOWN)) {
if (environment == "duckpaddle") {
swimX2 = swimX2 / duckpaddleRATIO;
swimY2 = swimY2 / duckpaddleRATIO;
environment = "swimmingdownward";
}
if (faceX < 0) {
if ((0 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (-180 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 180;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((0 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (180 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 180;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else {
swimspin = 0;
}
if ((swimspeedX > 0) && (environment != "duckpaddle")) {
faceX = 1;
} else if ((swimspeedX < 0) && (environment != "duckpaddle")) {
faceX = -1;
}
if (Key.isDown(_root.kJUMP) && (swimarmed == true)) {
if ((Key.isDown(_root.kUP) && (environment == "duckpaddle")) && (duckjumparmed == true)) {
while (Water.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((charY + offsetY) * worldYSCALEinit) / 100) + worldYinit, true)) {
charY = charY - 1;
}
jumpX = jumprateX;
jumpY = jumprateY;
environment = "duckjump";
environmentchecker = "duckjump";
duckjumparmed = false;
swimarmed = false;
} else if ((((environment == "duckpaddle") && (speedX == 0)) || (((environment == "duckpaddle") && (speedX > 0)) && (TOUCHwallright == false))) || (((environment == "duckpaddle") && (speedX < 0)) && (TOUCHwallleft == false))) {
if (((speedY == 0) || ((speedY > 0) && (TOUCHground == false))) || ((speedY < 0) && (TOUCHceiling == false))) {
swimX = swimrateX / duckpaddleRATIO;
swimY = swimrateY / duckpaddleRATIO;
swimarmed = false;
}
} else if (((speedX == 0) || ((speedX > 0) && (TOUCHwallright == false))) || ((speedX < 0) && (TOUCHwallleft == false))) {
if (((speedY == 0) || ((speedY > 0) && (TOUCHground == false))) || ((speedY < 0) && (TOUCHceiling == false))) {
swimX = swimrateX;
swimY = swimrateY;
swimarmed = false;
}
}
} else {
swimX = 0;
swimY = 0;
}
if (!Key.isDown(_root.kJUMP)) {
swimarmed = true;
duckjumparmed = true;
}
}
if (environment == "duckpaddle") {
charROT = 90 * faceX;
if (airspinspeed != 0) {
swimspinspeed = swimspinspeed + airspinspeed;
airspinspeed = 0;
}
airspin = 0;
if ((charROT > 100) || (charROT < -100)) {
if ((environmentchecker != "water") && (environmentchecker != "duckpaddle")) {
swimI = swimI + (Math.abs(movespeedX) / 3);
}
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
gspeedX = 0;
gspeedY = 0;
gravityX = 0;
gravityY = 0;
windX = watercurrentrateX;
windY = 0;
if ((environmentchecker != "water") && (environmentchecker != "duckpaddle")) {
swimY = 0;
swimY2 = 0;
}
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
environmentchecker = "duckpaddle";
} else if ((environment == "swimmingupward") || (environment == "swimmingdownward")) {
if (airspinspeed != 0) {
swimspinspeed = swimspinspeed + airspinspeed;
airspinspeed = 0;
}
airspin = 0;
if ((charROT > 100) || (charROT < -100)) {
if (environmentchecker != "water") {
swimI = swimI + ((Math.abs(movespeedX) / 3) + (gspeedY / 3));
gspeedY = 0;
}
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = gravityrateX;
gravityY = gravityrateY;
windX = watercurrentrateX;
windY = watercurrentrateY;
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
swimY2 = swimY2 / swimdragY;
swimI = swimI / swimdragY;
gspeedX = gspeedX / waterdragX;
gspeedY = gspeedY / waterdragY;
environmentchecker = "water";
} else if (environment == "watergrounded") {
if (((Math.abs(swimX2) >= swimcollideMAX) || (Math.abs(swimY2) >= swimcollideMAX)) || (Math.abs(swimI) >= swimcollideMAX)) {
swimX2 = Math.min(swimX2, swimcollideMAX);
swimY2 = Math.min(swimY2, swimcollideMAX);
swimI = Math.min(swimI, swimcollideMAX);
} else if (((Math.abs(swimX2) >= 0.25) || (Math.abs(swimY2) >= 0.25)) || (Math.abs(swimI) >= 0.25)) {
swimX2 = swimX2 / watergroundfriction;
swimY2 = swimY2 / watergroundfriction;
swimI = swimI / watergroundfriction;
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
windX = 0;
windY = 0;
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
swimY2 = swimY2 / swimdragY;
movespeedX = movespeedX / waterdragX;
movespeedY = movespeedY / waterdragY;
environmentchecker = "waterground";
} else if ((environment == "flying") || (environment == "falling")) {
charROT = 0;
if ((dr == -1) && (dl == -1)) {
moveY = 0;
movespeedY = 0;
}
if (swimspinspeed != 0) {
airspinspeed = airspinspeed + swimspinspeed;
swimspinspeed = 0;
}
swimspin = 0;
if (((swimX2 != 0) || (swimY2 != 0)) || (swimI != 0)) {
if (environmentchecker == "duckjump") {
swimX2 = swimX2 / duckjumpRATIO;
swimI = swimI / duckjumpRATIO;
}
jumpspeedX = jumpspeedX + (Math.sin(charROT * DEGtoRAD) * swimX2);
if (environmentchecker != "duckjump") {
jumpspeedY = jumpspeedY + Math.min(Math.cos(charROT * DEGtoRAD) * (swimX2 + swimI), swimspeedMAXTRANSFER);
}
}
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
gravityX = gravityrateX;
gravityY = gravityrateY;
windX = windrateX;
windY = windrateY;
if (environment == "flying") {
jumpX = 0;
jumpY = 0;
}
airspinspeed = airspinspeed / airspindrag;
if (environmentchecker != "bellyslide") {
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
} else {
movespeedX = movespeedX / slidedragX;
movespeedY = movespeedY / slidedragY;
}
if (environmentchecker == "nosedivebounce") {
airspin = 0;
if (Math.abs(charROT) < 5) {
charROT = 0;
environmentchecker = ((gspeedY > (jumpspeedY * 2)) ? "air" : "nosedivebounce");
}
}
if (((((environmentchecker == "water") && (Key.isDown(_root.kRIGHT))) && (!Key.isDown(_root.kUP))) && (!Key.isDown(_root.kDOWN))) || ((((environmentchecker == "water") && (Key.isDown(_root.kLEFT))) && (!Key.isDown(_root.kUP))) && (!Key.isDown(_root.kDOWN)))) {
environmentchecker = "porpoising";
} else if (((environmentchecker != "porpoising") && (environmentchecker != "bellyslide")) && (environmentchecker != "nosedivebounce")) {
environmentchecker = "air";
}
} else if (environment == "wallslide") {
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 1;
swimspin = 0;
swimspinspeed = 0;
airspin = 0;
airspinspeed = 0;
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
environmentchecker = "wallsliding";
} else if (environment == "grounded") {
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
swimspin = 0;
swimspinspeed = 0;
airspin = 0;
airspinspeed = 0;
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
if (environmentchecker != "bellyslide") {
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
bellyslideTIME = 0;
} else {
if ((dr - dl) != 0) {
moveX = (((sliderate * slopesensorDISTANCE) / Math.sqrt(Math.pow(dl - dr, 2) + Math.pow(slopesensorDISTANCE, 2))) * (dl - dr)) / Math.abs(dl - dr);
moveY = (sliderate * (-Math.abs(dr - dl))) / Math.sqrt(Math.pow(dr - dl, 2) + Math.pow(slopesensorDISTANCE, 2));
} else {
moveX = 0;
moveY = 0;
}
movespeedX = movespeedX / slidedragX;
movespeedY = movespeedY / slidedragY;
}
if (((((charROT < 89) && (charROT > -89)) && (environmentchecker != "bellyslide")) || ((((environmentchecker == "bellyslide") && (Math.abs(movespeedX) <= slidespeedMIN)) && (Math.abs(dr - dl) <= 0)) && (bellyslideTIME > 100))) || (((environmentchecker == "bellyslide") && (charROT < 30)) && (charROT > -30))) {
charY = charY - ((initHEIGHT - charHEIGHT) / 2);
charROT = 0;
environmentchecker = "ground";
} else if (((charROT < 165) && (charROT > -165)) || (((environmentchecker == "bellyslide") && (charROT < 30)) && (charROT > -30))) {
charY = charY - ((initWIDTH - charHEIGHT) / 2);
charWIDTH = initWIDTH;
charHEIGHT = initWIDTH;
if (environmentchecker != "bellyslide") {
charROT = ((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD);
} else if (charROT != (((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD))) {
slopeDIFFERENCE = (((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD)) - charROT;
charROT = charROT + (slopeDIFFERENCE / 2);
}
bellyslideTIME = bellyslideTIME + 1;
environmentchecker = "bellyslide";
if ((((jumpspeedY == 0) && ((oldslopeANGLE * slopeANGLE) <= 0)) && (oldslopeANGLE != 0)) || (((jumpspeedY == 0) && ((oldslopeANGLE * slopeANGLE) <= 0)) && (slopeANGLE != 0))) {
if (((oldslopeANGLE > 0) && (speedX > 0)) || ((oldslopeANGLE < 0) && (speedX < 0))) {
moveY = 0;
movespeedY = 0;
gspeedY = 0;
rampjumpY = (sliderampBOOST * Math.abs(speedX)) * Math.cos(oldslopeANGLE * DEGtoRAD);
jumpY = ((rampjumpY > 0) ? rampjumpY : 0);
} else {
moveY = 0;
movespeedY = 0;
}
}
} else {
charY = charY - ((initHEIGHT - charHEIGHT) / 2);
charROT = 180;
if (environmentchecker != "nosedivebounce") {
nosedivebounceSTART = getTimer() / 1000;
environmentchecker = "nosedivebounce";
}
if (Key.isDown(_root.kJUMP) && (jumparmed == true)) {
airspin = airspin + (nosediveBOUNCEspinrate * faceX);
jumpX = nosedivejumprateX * faceX;
jumpY = nosedivejumprateY;
environmentchecker = "nosedivebounce";
moveY = 0;
movespeedY = 0;
jumparmed = false;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
nosedivebounceTIMER = (getTimer() / 1000) - nosedivebounceSTART;
if (nosedivebounceTIMER >= nosedivebounceTIME) {
airspin = airspin + (nosediveBOUNCEspinrate * faceX);
jumpX = nosediveBOUNCEXrate * faceX;
jumpY = nosediveBOUNCEYrate;
}
}
} else if (environment == "sprung") {
swimX2 = 0;
swimY2 = 0;
swimI = 0;
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
if (TOUCHwater == false) {
jumpX = springrateX;
jumpY = springrateY;
swimX = 0;
swimY = 0;
} else {
swimX = springrateX;
swimY = springrateY;
jumpX = 0;
jumpY = 0;
}
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
environmentchecker = "sprung";
}
movespeedX = movespeedX + moveX;
jumpspeedX = jumpspeedX + jumpX;
swimX2 = swimX2 + swimX;
if ((charROT == 180) || (charROT == -180)) {
swimspeedX = 0;
} else {
swimspeedX = Math.sin(charROT * DEGtoRAD) * (swimX2 + swimI);
}
gspeedX = gspeedX + gravityX;
windspeedX = windX;
movespeedY = movespeedY + moveY;
jumpspeedY = jumpspeedY + jumpY;
swimY2 = swimY2 + swimY;
swimspeedY = Math.cos(charROT * DEGtoRAD) * (swimY2 + swimI);
gspeedY = gspeedY + gravityY;
windspeedY = windY;
if (Math.abs(movespeedX) < 0.1) {
movespeedX = 0;
}
if (Math.abs(movespeedY) < 0.1) {
movespeedY = 0;
}
speedX = (((movespeedX + jumpspeedX) + swimspeedX) - gspeedX) + windspeedX;
speedY = ((((-movespeedY) - jumpspeedY) - swimspeedY) + gspeedY) - windspeedY;
if (speedX > speedXMAX) {
speedX = speedX - (speedX - speedXMAX);
} else if (speedX < (-speedXMAX)) {
speedX = speedX + (speedXMAX - speedX);
}
if (speedY > speedYMAX) {
speedY = speedY - (speedY - speedYMAX);
} else if (speedY < (-speedYMAX)) {
speedY = speedY + (speedYMAX - speedY);
}
if (Math.abs(speedX) < speedMINX) {
speedX = 0;
}
if (Math.abs(speedY) < speedMINY) {
speedY = 0;
}
charX = charX + speedX;
charY = charY + speedY;
swimspinspeed = swimspinspeed + swimspin;
airspinspeed = airspinspeed + airspin;
speedROT = swimspinspeed + airspinspeed;
charROT = charROT + speedROT;
if (charROT > 180) {
charROT = charROT - 360;
} else if (charROT < -180) {
charROT = charROT + 360;
}
if (((speedX == 0) && (speedY == 0)) && (speedROT == 0)) {
charACTION = false;
} else {
charACTION = true;
}
if (charACTION == true) {
if (speedY > 0) {
d = 1;
while (d <= floorpushes) {
if (((!SoftBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true)) && (!HardBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true))) && (!Spring.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true))) {
charY = charY - (d - 1);
break;
}
d++;
}
} else if (speedY < 0) {
u = 1;
while (u <= floorpushes) {
if (!HardBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) - (charHEIGHT * uHEIGHT)) + u) * worldYSCALEinit) / 100) + worldYinit, true)) {
charY = charY + (u - 1);
break;
}
movespeedY = 0;
jumpspeedY = 0;
gspeedY = 0;
u++;
}
}
if ((speedX > 0) || ((environment == "wallslide") && (TOUCHwallright == true))) {
r = 1;
while (r <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) + (charWIDTH * rWIDTH)) - r) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) + (charHEIGHT * rHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX - (r - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
r++;
}
if (environmentchecker != "bellysliding") {
ur = 1;
while (ur <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) + (charWIDTH * urWIDTH)) - ur) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) - (charHEIGHT * urHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX - (ur - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
ur++;
}
}
}
if ((speedX < 0) || ((environment == "wallslide") && (TOUCHwallleft == true))) {
l = 1;
while (l <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) - (charWIDTH * lWIDTH)) + l) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) + (charHEIGHT * lHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX + (l - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
l++;
}
if (environmentchecker != "bellysliding") {
ul = 1;
while (ul <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) - (charWIDTH * ulWIDTH)) + ul) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) - (charHEIGHT * ulHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX + (ul - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
ul++;
}
}
}
}
oldslopeANGLE = slopeANGLE;
if ((((charACTION == true) && (oldTOUCHdigit == false)) && (digitMODE == "constant")) || ((charACTION == true) && (digitMODE != "constant"))) {
dr = 0;
while (dr <= floorpushes) {
if ((!SoftBoundary.hitTest(((((charX + offsetX) + (slopesensorDISTANCE / 2)) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dr) * worldYSCALEinit) / 100) + worldYinit, true)) && (!HardBoundary.hitTest(((((charX + offsetX) + slopesensorDISTANCE) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dr) * worldYSCALEinit) / 100) + worldYinit, true))) {
dr = dr - 1;
break;
}
dr++;
}
dl = 0;
while (dl <= floorpushes) {
if ((!SoftBoundary.hitTest(((((charX + offsetX) - (slopesensorDISTANCE / 2)) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dl) * worldYSCALEinit) / 100) + worldYinit, true)) && (!HardBoundary.hitTest(((((charX + offsetX) - slopesensorDISTANCE) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dl) * worldYSCALEinit) / 100) + worldYinit, true))) {
dl = dl - 1;
break;
}
dl++;
}
slopeANGLE = Math.atan((dr - dl) / slopesensorDISTANCE) / DEGtoRAD;
if ((TOUCHdigit == true) && (digitMODE == "restricted")) {
slopeANGLE = Math.round(slopeANGLE / digitARCLENGTH) * digitARCLENGTH;
if (slopeANGLE > 0) {
dr = Math.abs((Math.tan(slopeANGLE * DEGtoRAD) * slopesensorDISTANCE) / 2);
dl = -dr;
} else {
dr = -Math.abs((Math.tan(slopeANGLE * DEGtoRAD) * slopesensorDISTANCE) / 2);
dl = -dr;
}
}
}
if ((((TOUCHground == true) && (TOUCHdigit == false)) || ((jumpspeedY < gspeedY) && (jumpspeedY > 0))) || ((jumpspeedY == 0) && (gspeedY > jumpTHRESHOLD))) {
oldTOUCHdigit = false;
} else {
oldTOUCHdigit = true;
}
totalspeed = Math.pow(Math.pow(speedX, 2) + Math.pow(speedY, 2), 0.5);
if ((Key.isDown(17) && ((camXSCALE + zoomINCREMENTmanual) <= zoomMAXmanual)) && ((camYSCALE + zoomINCREMENTmanual) <= zoomMAXmanual)) {
camXSCALE = camXSCALE + zoomINCREMENTmanual;
camYSCALE = camYSCALE + zoomINCREMENTmanual;
zoomMIN = zoomMIN + zoomINCREMENTmanual;
} else if ((Key.isDown(16) && ((camXSCALE - zoomINCREMENTmanual) >= zoomMINmanual)) && ((camYSCALE - zoomINCREMENTmanual) >= zoomMINmanual)) {
camXSCALE = camXSCALE - zoomINCREMENTmanual;
camYSCALE = camYSCALE - zoomINCREMENTmanual;
zoomMIN = zoomMIN - zoomINCREMENTmanual;
} else {
if (((((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) <= (camX - (camWIDTH / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX)) || ((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) >= (camX + (camWIDTH / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camXSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) <= (camY - (camHEIGHT / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) >= (camY + (camHEIGHT / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) {
camXSCALE = camXSCALE + zoomINCREMENT;
camYSCALE = camYSCALE + zoomINCREMENT;
} else if (((((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) >= (camX - (camWIDTH / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camYSCALE - zoomINCREMENT) >= zoomMIN)) || ((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) <= (camX + (camWIDTH / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camXSCALE - zoomINCREMENT) >= zoomMIN))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) >= (camY - (camHEIGHT / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camYSCALE - zoomINCREMENT) >= zoomMIN))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) <= (camY + (camHEIGHT / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camYSCALE - zoomINCREMENT) >= zoomMIN))) {
camXSCALE = camXSCALE - zoomINCREMENT;
camYSCALE = camYSCALE - zoomINCREMENT;
}
if (((((((!Key.isDown(16)) && (charX <= ((camX - (camWIDTH / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX)) || ((((!Key.isDown(16)) && (charX >= ((camX + (camWIDTH / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camXSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && (charY <= ((camY - (camHEIGHT / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && (charY >= ((camY + (camHEIGHT / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) {
camXSCALE = camXSCALE + zoomINCREMENT;
camYSCALE = camYSCALE + zoomINCREMENT;
zoomMIN = zoomMIN + zoomINCREMENTmanual;
}
}
if ((TOUCHwater == false) && (environmentchecker != "bellyslide")) {
camspeedX = ((charX + (speedX * ((camLOOSENESS + camMOVEXLEAD) / (worldXSCALE / 100)))) - camX) / (camLOOSENESS / (worldXSCALE / 100));
if ((Math.abs(speedX) >= moverate) || (Math.abs(speedY) >= moverate)) {
camX = camX + ((Math.abs(camspeedX) > 1) ? (camspeedX) : 0);
}
} else {
camspeedX = ((charX + (speedX * ((camLOOSENESS + camWATERXLEAD) / (worldXSCALE / 100)))) - camX) / (camLOOSENESS / (worldXSCALE / 100));
if ((Math.abs(speedX) >= moverate) || (Math.abs(speedY) >= moverate)) {
camX = camX + ((Math.abs(camspeedX) > 1) ? (camspeedX) : 0);
}
}
if (((TOUCHwater == false) && (Math.abs(speedY) < 10)) && (environmentchecker != "bellyslide")) {
camspeedY = ((charY + (speedY * ((camLOOSENESS + camMOVEYLEAD) / (worldYSCALE / 100)))) - camY) / (camLOOSENESS / (worldYSCALE / 100));
camY = camY + camspeedY;
} else {
camspeedY = ((charY + (speedY * ((camLOOSENESS + camWATERYLEAD) / (worldYSCALE / 100)))) - camY) / (camLOOSENESS / (worldYSCALE / 100));
camY = camY + camspeedY;
}
if (Math.abs(camX - charX) > ((camWIDTH * 3) / 8)) {
camX = charX + ((((camWIDTH * 3) / 8) * (camX - charX)) / Math.abs(camX - charX));
}
if (Math.abs(camY - charY) > ((camHEIGHT * 3) / 8)) {
camY = charY + ((((camHEIGHT * 3) / 8) * (camY - charY)) / Math.abs(camY - charY));
}
camWIDTH = (camWIDTHinit * camXSCALE) / 100;
camHEIGHT = (camHEIGHTinit * camYSCALE) / 100;
if (!Key.isDown(46)) {
scaleX = stageWIDTH / camWIDTH;
scaleY = stageHEIGHT / camHEIGHT;
worldX = stagehalfWIDTH - (camX * scaleX);
worldY = stagehalfHEIGHT - (camY * scaleY);
worldXSCALE = 100 * scaleX;
worldYSCALE = 100 * scaleY;
camROT = 0;
worldROT = -camROT;
}
frameloops++;
}
Player1._x = charX;
Player1._y = charY;
Player1._rotation = charROT;
Player1.sensor._x = charsensorX;
Player1.sensor._y = charsensorY;
Player1.sensor._width = charsensorWIDTH;
Player1.sensor._height = charsensorHEIGHT;
if (faceX > 0) {
Player1._xscale = 100;
} else if (faceX < 0) {
Player1._xscale = -100;
}
camera._x = camX;
camera._y = camY;
camera._rotation = camROT;
camera._xscale = camXSCALE;
camera._yscale = camYSCALE;
camera._width = camWIDTH;
camera._height = camHEIGHT;
_x = worldX;
_y = worldY;
_rotation = worldROT;
_xscale = worldXSCALE;
_yscale = worldYSCALE;
}
Frame 12
if (_root.go != true) {
gotoAndStop (11);
} else {
_root.go = false;
}
Frame 13
_root.cutscene1 = false;
Mouse.show();
stopAllSounds();
_root.soundManager_mc.playSound("BreakfastEnding.wav", 0, 9999999999);
_root.died = false;
_root.levelCOMPLETE = getTimer() / 1000;
_root.levelTIME = Math.round(((_root.levelCOMPLETE + _root.levelDEADTIME) - (_root.levelSTART + _root.pauseTIME)) * 10000) / 10000;
_root.levelDEADTIME = 0;
_root.levelTIMESTR = _root.levelTIME + " sec";
_root.pointratio = Math.round((_root.player1points / _root.totalpoints) * 10000) / 100;
_root.gameTIME = _root.gameTIME + _root.levelTIME;
_root.GAMEplayer1points = _root.GAMEplayer1points + _root.player1points;
_root.gamedeaths = _root.gamedeaths + _root.leveldeaths;
if (_root.cheats != true) {
_root.topdeaths.text = "---";
if (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] != undefined) {
_root.topdeaths.text = _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"];
}
if ((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] == undefined) || (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] > _root.leveldeaths)) {
_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] = _root.leveldeaths;
} else {
_root.newdeathsrecord.text = "";
}
_root.toptime.text = "---";
if (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] != undefined) {
_root.toptime.text = _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"];
}
if ((((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] == undefined) && (_root.leveldeaths <= _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"])) || ((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] > _root.levelTIME) && (_root.leveldeaths <= _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"]))) || (_root.newdeathsrecord.text != "")) {
_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] = _root.levelTIME;
} else {
_root.newtimerecord.text = "";
}
_root.leveldeaths = 0;
_root.toppoints.text = "---";
_root.topratio.text = "---";
if (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] != undefined) {
_root.toppoints.text = _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"];
_root.topratio.text = Math.round((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] / _root.totalpoints) * 10000) / 100;
}
if ((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] == undefined) || (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] < _root.player1points)) {
_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] = _root.player1points;
} else {
_root.newcoinrecord.text = "";
_root.newratiorecord.text = "";
}
_root.savedData.data[("LVL" + _root.level.substr(6)) + "totalpoints"] = _root.totalpoints;
if (_root.savedData.data.levelMAX == 1) {
_root.savedData.data.levelMAX = 2;
}
_root.savedData.flush();
}
if (_root.stattracking == true) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl1complete");
if (_root.pointratio >= 100) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl1coins100percent");
} else if (_root.pointratio >= 50) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl1coins050percent");
}
}
stop();
Instance of Symbol 240 MovieClip in Frame 13
onClipEvent (load) {
this.textvalue = "Menu";
this.linkvalue = "Game Start";
this.gotoAndStop("Menu");
}
Frame 14
if (_root.go != true) {
gotoAndStop (13);
} else {
_root.go = false;
}
Frame 15
stop();
Frame 16
if (_root.go != true) {
gotoAndStop (15);
} else {
_root.go = false;
}
Frame 17
Mouse.show();
stopAllSounds();
_root.level = "Level 0B";
_root.kRIGHT = _root.kRIGHTconfig;
_root.kLEFT = _root.kLEFTconfig;
_root.kUP = _root.kUPconfig;
_root.kDOWN = _root.kDOWNconfig;
_root.kJUMP = _root.kJUMPconfig;
_root.kTHROW = _root.kTHROWconfig;
_root.kPAUSE = _root.kPAUSEconfig;
_root.kSTART = _root.kSTARTconfig;
_root.pauseTIME = 0;
if (_root.died == true) {
_root.leveldeaths = _root.leveldeaths + 1;
}
if (_root.stattracking == true) {
if (_root.died == false) {
StatTracker.submitStat("/flashgames/breakfastclub/level2start");
} else {
StatTracker.submitStat("/flashgames/breakfastclub/level2died");
}
}
stop();
Frame 18
if (_root.go != true) {
gotoAndStop (17);
} else {
_root.go = false;
}
Frame 19
stopAllSounds();
_root.soundManager_mc.playSound("BreakfastInGame1.wav", 0, 9999999999);
if ((_root.savedData.data.levelMAX > 2) && (_root.stattracking == true)) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl2replay");
}
onMouseMove = function () {
mouseTIMERstart = getTimer() / 1000;
Mouse.show();
};
onEnterFrame = function () {
_root.timechecker();
mouseTIMER = (getTimer() / 1000) - mouseTIMERstart;
if (mouseTIMER >= mouseTIMERMAX) {
Mouse.hide();
}
};
_root.attachDEPTH = _root.GAMEattachDEPTH;
_root.WorldString = undefined;
if (_root.WorldString != undefined) {
SoftCOLOR = 65535;
SoftALPHA = 50;
TiledCOLOR = 16711935 /* 0xFF00FF */;
TiledALPHA = 50;
HardCOLOR = 16711680 /* 0xFF0000 */;
HardALPHA = 50;
WaterCOLOR = 255;
WaterALPHA = 50;
SpringCOLOR = 16776960 /* 0xFFFF00 */;
SpringALPHA = 50;
_root.World.createEmptyMovieClip("SoftBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.SoftBoundary.objects = 0;
_root.WorldArray[0] = [];
_root.World.createEmptyMovieClip("TiledBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.TiledBoundary.objects = 0;
_root.WorldArray[1] = [];
_root.World.createEmptyMovieClip("HardBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.SoftBoundary.objects = 0;
_root.WorldArray[2] = [];
_root.World.createEmptyMovieClip("WaterBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.WaterBoundary.objects = 0;
_root.WorldArray[3] = [];
_root.World.createEmptyMovieClip("SpringBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.SpringBoundary.objects = 0;
_root.WorldArray[4] = [];
_root.World.createEmptyMovieClip("Art", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.Art.objects = 0;
_root.WorldArray[5] = [];
_root.WorldArray = _root.WorldString.split(">>>>");
boundaryelements = 0;
while (boundaryelements < _root.WorldArray.length) {
_root.WorldArray[boundaryelements] = _root.WorldArray[boundaryelements].split("|");
objectelements = 0;
while (objectelements < _root.WorldArray[boundaryelements].length) {
_root.WorldArray[boundaryelements][objectelements] = _root.WorldArray[boundaryelements][objectelements].split("/");
anchorelements = 0;
while (anchorelements < _root.WorldArray[boundaryelements][objectelements].length) {
_root.WorldArray[boundaryelements][objectelements][anchorelements] = _root.WorldArray[boundaryelements][objectelements][anchorelements].split(",");
anchorelements++;
}
objectelements++;
}
boundaryelements++;
}
boundaryload = 0;
while (boundaryload < _root.WorldArray.length) {
if (boundaryload == 0) {
boundary = "Soft";
boundaryCOLOR = _root.SoftCOLOR;
boundaryALPHA = _root.SoftALPHA;
} else if (boundaryload == 1) {
boundary = "Tile";
boundaryCOLOR = _root.TileCOLOR;
boundaryALPHA = _root.TileALPHA;
} else if (boundaryload == 2) {
boundary = "Hard";
boundaryCOLOR = _root.HardCOLOR;
boundaryALPHA = _root.HardALPHA;
} else if (boundaryload == 3) {
boundary = "Water";
boundaryCOLOR = _root.WaterCOLOR;
boundaryALPHA = _root.WaterALPHA;
} else if (boundaryload == 4) {
boundary = "Spring";
boundaryCOLOR = _root.SpringCOLOR;
boundaryALPHA = _root.SpringALPHA;
} else if (boundaryload == 5) {
boundary = "Art";
boundaryCOLOR = _root.ArtCOLOR;
boundaryALPHA = _root.ArtALPHA;
}
_root.World.createEmptyMovieClip(boundary + "Boundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
objectload = 0;
while (objectload < _root.WorldArray[boundaryload].length) {
_root.World[boundary + "Boundary"].objects = objectload + 1;
_root.World[boundary + "Boundary"].createEmptyMovieClip("Object" + (objectload + 1), _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
anchorload = 0;
while (anchorload < _root.WorldArray[boundaryload][objectload].length) {
if ((anchorload == 0) && (_root.WorldArray[boundaryload][objectload][anchorload][0] != "Art")) {
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].lineStyle(1, 0, 100);
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].beginFill(boundaryCOLOR, boundaryALPHA);
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].moveTo(_root.WorldArray[boundaryload][objectload][anchorload][1], _root.WorldArray[boundaryload][objectload][anchorload][2]);
} else if (_root.WorldArray[boundaryload][objectload][anchorload][0] != "Art") {
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].lineTo(_root.WorldArray[boundaryload][objectload][anchorload][1], _root.WorldArray[boundaryload][objectload][anchorload][2]);
} else if (_root.WorldArray[boundaryload][objectload][anchorload][0] == "Art") {
anchorload++;
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].removeMovieClip();
_root.World[boundary + "Boundary"].attachMovie(_root.WorldArray[boundaryload][objectload][anchorload][0], _root.WorldArray[boundaryload][objectload][anchorload][0] + (objectload + 1), _root.attachDEPTH, {_x:_root.WorldArray[boundaryload][objectload][anchorload][1], _y:_root.WorldArray[boundaryload][objectload][anchorload][2]});
break;
}
anchorload++;
}
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].endFill();
objectload++;
}
boundaryload++;
}
}
stop();
Instance of Symbol 542 MovieClip in Frame 19
onClipEvent (load) {
_name = "World";
framerateDEFAULT = 24;
framerateMAX = 120;
framerateMIN = 12;
DEGtoRAD = (Math.PI/180);
bubbleDEPTH = 1000;
this.bottomlesspit = 5000;
this.Player1.points = 0;
this.points = 0;
this.badguyDISTANCEMAX = 150;
this.bomberCHANCE = 432;
this.bombers = 0;
this.Goombas = 0;
this.KoopaTroopas = 0;
this.AttackDogs = 0;
this.Barrels = 0;
this.BarrelsFilled = 0;
digitMODE = "constant";
charALIVE = true;
charBLINK = true;
charBLINKTIME = 1;
charBLINKTIMER = 0;
Player1.rocksloaded = 0;
Player1.rocksthrown = 0;
Player1.rocksloadedMAX = 3;
rocksMAX = 6;
dHEIGHT = 0.5;
uHEIGHT = 0.5;
rWIDTH = 0.5;
rHEIGHT = 0;
urWIDTH = 0.3;
urHEIGHT = 0.25;
lWIDTH = 0.5;
lHEIGHT = 0;
ulWIDTH = 0.3;
ulHEIGHT = 0.25;
offsetX = 0;
offsetY = 0;
charACTION = true;
initWIDTH = Player1.sensor._width;
initHEIGHT = Player1.sensor._height;
initHYP = Math.sqrt(Math.pow(initWIDTH, 2) + Math.pow(initHEIGHT, 2));
initANGLE1 = Math.asin(initHEIGHT / initHYP);
initANGLE2 = Math.asin(initWIDTH / initHYP);
slopesensorRATIO = 3;
floorpushes = 100;
speedXMAX = 25;
speedYMAX = 25;
speedMAXdivisor = 1;
speedXMIN = 0.05;
speedYMIN = 0.05;
slidespeedMIN = 0.05;
jumpTHRESHOLD = 2;
airjumpsMAX = 1;
duckjumpRATIO = 2;
throwTIME = 2.5;
throwANGLEup = 65;
throwANGLEforward = 75;
throwANGLEdown = 120;
nosedivebounceTIME = 0.25;
swimcollideMAX = 7;
duckpaddleFALLSPEED = 7.5;
duckpaddleRATIO = 3;
faceX = 1;
faceY = 1;
digitARCLENGTH = 22.5;
engineloops = 4;
speedmultiUNIVERSAL = 1;
speedmultiX = speedmultiUNIVERSAL;
speedmultiY = speedmultiUNIVERSAL;
speedmultiROT = speedmultiUNIVERSAL;
movedragX = 1.175;
movedragY = 1.175;
slidedragX = 1.01;
slidedragY = 1.01;
waterdragX = 2.5;
waterdragY = 2.5;
swimdragX = 1.004;
swimdragY = 1.004;
watergroundfriction = 1.05;
throwdrag = 2.5;
swimspindrag = 1.1;
airspindrag = 1.1;
windrateX = 0 * speedmultiX;
windrateY = 0 * speedmultiY;
watercurrentrateX = 0 * speedmultiX;
watercurrentrateY = 0 * speedmultiY;
gravityrateX = 0 * speedmultiX;
gravityrateY = 0.25 * speedmultiY;
gspeedX = 0 * speedmultiX;
gspeedY = 0 * speedmultiY;
windX = 0 * speedmultiX;
windY = 0 * speedmultiY;
windspeedX = 0 * speedmultiX;
windspeedY = 0 * speedmultiY;
environment = "falling";
environmentchecker = "air";
moverate = 0.6 * speedmultiUNIVERSAL;
sliderate = 0.75 * speedmultiUNIVERSAL;
sliderampBOOST = 0.8 * speedmultiUNIVERSAL;
sliderampTHRESHOLD = 13;
swimspeedMAXTRANSFER = 15 * speedmultiUNIVERSAL;
jumprateX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
jumprateY = (40 * gravityrateY) / Math.sqrt(speedmultiY);
walljumpTIME = 20;
nosedivejumprateX = jumprateX * 1.4;
nosedivejumprateY = jumprateY * 1.4;
springrateX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
springrateY = (50 * gravityrateY) / Math.sqrt(speedmultiY);
nosediveBOUNCEXrate = 0.5;
nosediveBOUNCEYrate = (24 * gravityrateY) / Math.sqrt(speedmultiY);
nosediveBOUNCEspinrate = 17 * speedmultiROT;
swimrateX = (1 * gravityrateY) / Math.sqrt(speedmultiY);
swimrateY = (1 * gravityrateY) / Math.sqrt(speedmultiY);
throwrate = (40 * gravityrateY) / Math.sqrt(speedmultiY);
swimspinrate = 0.5 * speedmultiROT;
airspinrate = 0.75 * speedmultiROT;
watergroundboostX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
watergroundboostY = (0 * gravityrateY) / Math.sqrt(speedmultiY);
moveX = 0 * speedmultiX;
moveY = 0 * speedmultiY;
movespeedX = 0 * speedmultiX;
movespeedY = 0 * speedmultiY;
jumpX = 0 * speedmultiX;
jumpY = 0 * speedmultiY;
walljumpTIMER = 0;
airjumpCOUNT = 0;
jumpspeedX = 0 * speedmultiX;
jumpspeedY = 0 * speedmultiY;
swimX = 0 * speedmultiX;
swimY = 0 * speedmultiY;
swimX2 = 0 * speedmultiX;
swimY2 = 0 * speedmultiY;
swimI = 0 * speedmultiUNIVERSAL;
swimspeedX = 0 * speedmultiX;
swimspeedY = 0 * speedmultiY;
speedX = 0 * speedmultiX;
speedY = 0 * speedmultiY;
swimspin = 0 * speedmultiROT;
swimspinspeed = 0 * speedmultiROT;
airspin = 0 * speedmultiROT;
airspinspeed = 0 * speedmultiROT;
camera._visible = false;
stagehalfWIDTH = 275;
stagehalfHEIGHT = 200;
stageWIDTH = 550;
stageHEIGHT = 400;
camLOOSENESS = 50;
camMOVEXLEAD = 30;
camMOVEYLEAD = -30;
camWATERXLEAD = 5;
camWATERYLEAD = 5;
zoomMIN = 125;
zoomMAX = 250;
zoomMINmanual = zoomMIN;
zoomMAXmanual = zoomMAX;
camera._xscale = zoomMIN;
camera._yscale = zoomMIN;
zoomINCREMENT = 0.25 * speedmultiX;
zoomINCREMENTmanual = 1;
zoomLEAD = 90;
safezoneDISTANCE = 100;
startTime = getTimer();
numFrames = 0;
recentSetting = 5;
recentNumFrames = 0;
recentStartTime = startTime;
charX = Player1._x;
charY = Player1._y;
charROT = Player1._rotation;
charsensorX = Player1.sensor._x;
charsensorY = Player1.sensor._y;
charsensorWIDTH = Player1.sensor._width;
charsensorHEIGHT = Player1.sensor._height;
camX = camera._x;
camY = camera._y;
camROT = camera._rotation;
camXSCALE = camera._xscale;
camYSCALE = camera._yscale;
camWIDTHinit = camera._width;
camHEIGHTinit = camera._height;
camWIDTH = camera._width;
camHEIGHT = camera._height;
worldX = _x;
worldY = _y;
worldROT = _rotation;
worldXSCALE = _xscale;
worldYSCALE = _yscale;
}
onClipEvent (enterFrame) {
_root.player1points = this.Player1.points;
_root.totalpoints = this.points;
numFrames++;
now = getTimer();
elapsedSeconds = (now - startTime) / 1000;
actualFPS = numFrames / elapsedSeconds;
recentNumFrames++;
if (recentNumFrames == recentSetting) {
recentElapsedSeconds = (now - recentStartTime) / 1000;
recentFPSoutput = recentNumFrames / recentElapsedSeconds;
recentStartTime = now;
recentNumFrames = 0;
}
if (((recentFPSoutput >= framerateMIN) && (recentFPSoutput <= framerateMAX)) && (elapsedSeconds >= 1)) {
engineloops = framerateMAX / Math.ceil(recentFPSoutput);
} else if (elapsedSeconds < 1) {
engineloops = framerateMAX / framerateDEFAULT;
}
if ((Key.isDown(_root.kPAUSE) && (_root.PAUSE == false)) && (this.pausearmed == true)) {
_root.PAUSE = true;
this.pausearmed = false;
_root.pauseSTART = getTimer() / 1000;
} else if (((Key.isDown(_root.kPAUSE) && (_root.PAUSE == true)) && (this.pausearmed == true)) && (_root.textbubble == undefined)) {
_root.PAUSE = false;
this.pausearmed = false;
_root.pauseEND = getTimer() / 1000;
_root.pauseTIME = _root.pauseTIME + (_root.pauseEND - _root.pauseSTART);
}
if (!Key.isDown(_root.kPAUSE)) {
this.pausearmed = true;
}
if (_root.PAUSE == true) {
engineloops = 0;
}
worldXinit = _x;
worldYinit = _y;
worldROTinit = _rotation;
worldXSCALEinit = _xscale;
worldYSCALEinit = _yscale;
if (charALIVE == false) {
_root.kRIGHT = undefined;
_root.kLEFT = undefined;
_root.kUP = undefined;
_root.kDOWN = undefined;
_root.kJUMP = undefined;
_root.kTHROW = undefined;
_root.died = true;
_root.levelselect = false;
}
if ((charBLINK == true) && (charBLINKTIMER < charBLINKTIME)) {
if (Player1._visible == true) {
Player1._visible = false;
} else {
Player1._visible = true;
}
charBLINKTIMER = charBLINKTIMER + ((1 / this.framerateMAX) * this.engineloops);
} else {
Player1._visible = true;
charBLINKTIMER = 0;
charBLINK = false;
}
if ((random(bomberCHANCE) == 0) && (_root.PAUSE == false)) {
if (random(2) == 0) {
bomberDIRX = 1;
} else {
bomberDIRX = -1;
}
bomberDIRY = -1;
bombers = bombers + 1;
this.attachMovie("Bomber 1", "Bomber" + bombers, _root.attachDEPTH, {_x:this.camera._x + (((this.camera._width / 2) + this.badguyDISTANCEMAX) * bomberDIRX), _y:this.camera._y + (random(this.camera._width / 2) * bomberDIRY), flyDIR:bomberDIRX});
_root.attachDEPTH = _root.attachDEPTH + 1;
}
frameloops = 1;
while (frameloops <= engineloops) {
if (environmentchecker != "bellyslide") {
charWIDTH = Math.abs(Math.cos(initANGLE1 - ((Math.abs(charROT) + 180) * DEGtoRAD)) * initHYP);
charHEIGHT = Math.abs(Math.cos(initANGLE2 - ((Math.abs(charROT) + 180) * DEGtoRAD)) * initHYP);
} else {
charWIDTH = initWIDTH;
charHEIGHT = initWIDTH;
}
slopesensorDISTANCE = charWIDTH / slopesensorRATIO;
if (((speedY >= 0) && (SoftBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true))) || ((speedY >= 0) && (HardBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)))) {
TOUCHground = true;
if (((speedY >= 0) && (SoftBoundary.DigitBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true))) || ((speedY >= 0) && (HardBoundary.DigitBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)))) {
TOUCHdigit = true;
} else {
TOUCHdigit = false;
}
} else {
TOUCHground = false;
TOUCHdigit = false;
}
if (HardBoundary.hitTest((((((charsensorX + charX) + offsetX) + (charWIDTH * 0.5)) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.25)) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHwallright = true;
} else {
TOUCHwallright = false;
}
if (HardBoundary.hitTest((((((charsensorX + charX) + offsetX) - (charWIDTH * 0.5)) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.25)) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHwallleft = true;
} else {
TOUCHwallleft = false;
}
if (HardBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) - (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHceiling = true;
} else {
TOUCHceiling = false;
}
if (Water.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, ((((charsensorY + charY) + offsetY) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHwater = true;
} else {
TOUCHwater = false;
}
if (Spring.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true) && (speedY >= 0)) {
TOUCHspring = true;
} else {
TOUCHspring = false;
}
if (charY > bottomlesspit) {
charALIVE = false;
}
if (((_root.World.charBLINK == false) && (_root.DeathBoundaryPresent == true)) && (this.DeathBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, ((((charsensorY + charY) + offsetY) * worldYSCALEinit) / 100) + worldYinit, true))) {
if (this.Player1.rocksloaded > 0) {
this.throwANGLEdamaged = random(90) - 45;
this.throwratedamaged = 8;
this.Player1.rocksthrown = this.Player1.rocksthrown + 1;
this.attachMovie("Rock 1", "rock" + this.Player1.rocksthrown, 100 + this.Player1.rocksthrown, {_x:this.charsensorX + this.charX, _y:(this.charsensorY + this.charY) - ((this.charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEdamaged * DEGtoRAD) * throwratedamaged) * this.faceX) + this.speedX, throwspeedY:(Math.cos(throwANGLEdamaged * DEGtoRAD) * throwratedamaged) - this.speedY, weapon:false});
this.oldrock = this.Player1.rocksthrown - this.rocksMAX;
this["rock" + this.oldrock].removeMovieClip();
this.Player1.rocksloaded = this.Player1.rocksloaded - 1;
this.charBLINK = true;
_root.soundManager_mc.playSound("jump2.wav", 0, 1);
} else {
this.charALIVE = false;
}
}
if ((((environmentchecker == "air") && (TOUCHwater == true)) && (Math.abs(speedY) < duckpaddleFALLSPEED)) || (environment == "duckpaddle")) {
environment = "duckpaddle";
} else if (((((TOUCHwater == true) && (TOUCHground == true)) || ((TOUCHwater == true) && (TOUCHceiling == true))) || ((TOUCHwater == true) && (TOUCHwallleft == true))) || ((TOUCHwater == true) && (TOUCHwallright == true))) {
environment = "watergrounded";
} else if ((TOUCHwater == true) && (speedY < 0)) {
environment = "swimmingupward";
} else if (((TOUCHwater == true) && (TOUCHground == false)) && (speedY >= 0)) {
environment = "swimmingdownward";
} else if ((TOUCHspring == true) && (speedY >= 0)) {
environment = "sprung";
} else if ((TOUCHground == true) && (speedY >= 0)) {
environment = "grounded";
} else if (speedY < 0) {
environment = "flying";
} else if (((((TOUCHwallright == true) && (Key.isDown(_root.kRIGHT))) && (TOUCHground == false)) && (speedY >= 0)) || ((((TOUCHwallleft == true) && Key.isDown(_root.kLEFT)) && (TOUCHground == false)) && (speedY >= 0))) {
environment = "wallslide";
} else if ((TOUCHground == false) && (speedY >= 0)) {
environment = "falling";
}
if (((Player1.rocksloaded > 0) && (throwarmed == true)) && (Key.isDown(_root.kTHROW))) {
_root.soundManager_mc.stopSound("throw 1", 0, 1);
_root.soundManager_mc.playSound("throw 1", 0, 1);
Player1.rocksthrown = Player1.rocksthrown + 1;
if (environment != "wallslide") {
if (Key.isDown(_root.kUP)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:charsensorX + charX, _y:(charsensorY + charY) - ((charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEup * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEup * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else if (Key.isDown(_root.kDOWN)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * faceX), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEdown * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEdown * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * faceX), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEforward * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEforward * DEGtoRAD) * throwrate) - speedY, weapon:true});
}
} else if (Key.isDown(_root.kUP)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:charsensorX + charX, _y:(charsensorY + charY) - ((charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEup * DEGtoRAD) * throwrate) * (-faceX)) + speedX, throwspeedY:(Math.cos(throwANGLEup * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else if (Key.isDown(_root.kDOWN)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * (-faceX)), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEdown * DEGtoRAD) * throwrate) * (-faceX)) + speedX, throwspeedY:(Math.cos(throwANGLEdown * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * (-faceX)), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEforward * DEGtoRAD) * throwrate) * (-faceX)) + speedX, throwspeedY:(Math.cos(throwANGLEforward * DEGtoRAD) * throwrate) - speedY, weapon:true});
}
oldrock = Player1.rocksthrown - this.rocksMAX;
this["rock" + oldrock].removeMovieClip();
Player1.rocksloaded = Player1.rocksloaded - 1;
throwarmed = false;
} else if (!Key.isDown(_root.kTHROW)) {
throwarmed = true;
} else {
throwarmed = false;
}
if (environment == "grounded") {
if ((environmentchecker != "bellyslide") && (environmentchecker != "nosedivebounce")) {
movementhyp = moverate / Math.pow(Math.pow(dr - dl, 2) + Math.pow(slopesensorDISTANCE, 2), 0.5);
if (Key.isDown(_root.kRIGHT) && (TOUCHwallright == false)) {
moveX = movementhyp * slopesensorDISTANCE;
moveY = movementhyp * (-Math.abs(dr - dl));
faceX = 1;
} else if (Key.isDown(_root.kLEFT) && (TOUCHwallleft == false)) {
moveX = movementhyp * (-slopesensorDISTANCE);
moveY = movementhyp * (-Math.abs(dr - dl));
faceX = -1;
} else {
moveX = 0;
moveY = 0;
}
}
if (Key.isDown(_root.kJUMP) && (jumparmed == true)) {
jumpX = 0;
jumpY = jumprateY;
gspeedX = 0;
gspeedY = 0;
moveY = 0;
movespeedY = 0;
jumparmed = false;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
} else if ((environment == "wallslide") || (environmentchecker == "wallsliding")) {
if (Key.isDown(_root.kRIGHT)) {
faceX = 1;
} else if (Key.isDown(_root.kLEFT)) {
faceX = -1;
}
if (Key.isDown(_root.kJUMP) && (jumparmed == true)) {
jumpX = 0;
jumpY = jumprateY * 1.2;
gspeedX = 0;
gspeedY = 0;
if (Key.isDown(_root.kRIGHT)) {
moveX = -moverate;
} else if (Key.isDown(_root.kLEFT)) {
moveX = moverate;
}
moveY = 0;
movespeedY = 0;
jumparmed = false;
walljumpTIMER = walljumpTIME;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
} else if ((environment == "flying") || (environment == "falling")) {
if (walljumpTIMER <= 0) {
if (environmentchecker != "bellyslide") {
if (Key.isDown(_root.kRIGHT) && (TOUCHwallright == false)) {
moveX = moverate;
faceX = 1;
} else if (Key.isDown(_root.kLEFT) && (TOUCHwallleft == false)) {
moveX = -moverate;
faceX = -1;
} else {
moveX = 0;
}
} else {
moveX = 0;
}
walljumpTIMER = 0;
} else {
walljumpTIMER = walljumpTIMER - 1;
}
if (((Key.isDown(_root.kJUMP) && (jumparmed == true)) && (airjumpCOUNT > 0)) && (walljumpTIMER <= 0)) {
jumpspeedX = 0;
jumpspeedY = jumprateY;
gspeedX = 0;
gspeedY = 0;
moveY = 0;
movespeedY = 0;
jumparmed = false;
airjumpCOUNT = airjumpCOUNT - 1;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
if (environmentchecker == "ground") {
jumpassists = 0;
}
if (((((((jumpassists == 0) && (Key.isDown(_root.kJUMP))) && (gspeedY <= jumpTHRESHOLD)) && ((dr + dl) > -2)) && (walljumpTIMER <= 0)) && (TOUCHwallleft == false)) && (TOUCHwallright == false)) {
airjumpCOUNT = airjumpsMAX;
jumpassists = jumpassists + 1;
}
} else if ((((environment == "duckpaddle") || (environment == "swimmingupward")) || (environment == "swimmingdownward")) || (environment == "watergrounded")) {
if ((Key.isDown(_root.kRIGHT) && (Key.isDown(_root.kUP))) && (environment != "duckpaddle")) {
if ((charROT > -135) && (charROT <= 45)) {
if ((45 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-135 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((45 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-135 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if (Key.isDown(_root.kRIGHT) && (Key.isDown(_root.kDOWN))) {
if ((charROT > -45) && (charROT <= 135)) {
if ((135 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-45 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((135 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-45 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((Key.isDown(_root.kLEFT) && (Key.isDown(_root.kUP))) && (environment != "duckpaddle")) {
if ((charROT >= -45) && (charROT < 135)) {
if ((-45 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (135 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((-45 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (135 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kLEFT) && (Key.isDown(_root.kDOWN))) {
if ((charROT >= -135) && (charROT < 45)) {
if ((-135 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (45 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((-135 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (45 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kRIGHT)) {
if (environment == "duckpaddle") {
faceX = 1;
} else if ((charROT >= -90) && (charROT < 90)) {
if ((90 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-90 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((90 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-90 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if (Key.isDown(_root.kLEFT)) {
if (environment == "duckpaddle") {
faceX = -1;
} else if ((charROT > -90) && (charROT <= 90)) {
if ((90 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (-90 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((90 > (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (-90 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kUP) && (environment != "duckpaddle")) {
if (faceX > 0) {
if ((0 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-180 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 0;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((0 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (180 > (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 0;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kDOWN)) {
if (environment == "duckpaddle") {
swimX2 = swimX2 / duckpaddleRATIO;
swimY2 = swimY2 / duckpaddleRATIO;
environment = "swimmingdownward";
}
if (faceX < 0) {
if ((0 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (-180 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 180;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((0 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (180 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 180;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else {
swimspin = 0;
}
if ((swimspeedX > 0) && (environment != "duckpaddle")) {
faceX = 1;
} else if ((swimspeedX < 0) && (environment != "duckpaddle")) {
faceX = -1;
}
if (Key.isDown(_root.kJUMP) && (swimarmed == true)) {
if ((Key.isDown(_root.kUP) && (environment == "duckpaddle")) && (duckjumparmed == true)) {
while (Water.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((charY + offsetY) * worldYSCALEinit) / 100) + worldYinit, true)) {
charY = charY - 1;
}
jumpX = jumprateX;
jumpY = jumprateY;
environment = "duckjump";
environmentchecker = "duckjump";
duckjumparmed = false;
swimarmed = false;
} else if ((((environment == "duckpaddle") && (speedX == 0)) || (((environment == "duckpaddle") && (speedX > 0)) && (TOUCHwallright == false))) || (((environment == "duckpaddle") && (speedX < 0)) && (TOUCHwallleft == false))) {
if (((speedY == 0) || ((speedY > 0) && (TOUCHground == false))) || ((speedY < 0) && (TOUCHceiling == false))) {
swimX = swimrateX / duckpaddleRATIO;
swimY = swimrateY / duckpaddleRATIO;
swimarmed = false;
}
} else if (((speedX == 0) || ((speedX > 0) && (TOUCHwallright == false))) || ((speedX < 0) && (TOUCHwallleft == false))) {
if (((speedY == 0) || ((speedY > 0) && (TOUCHground == false))) || ((speedY < 0) && (TOUCHceiling == false))) {
swimX = swimrateX;
swimY = swimrateY;
swimarmed = false;
}
}
} else {
swimX = 0;
swimY = 0;
}
if (!Key.isDown(_root.kJUMP)) {
swimarmed = true;
duckjumparmed = true;
}
}
if (environment == "duckpaddle") {
charROT = 90 * faceX;
if (airspinspeed != 0) {
swimspinspeed = swimspinspeed + airspinspeed;
airspinspeed = 0;
}
airspin = 0;
if ((charROT > 100) || (charROT < -100)) {
if ((environmentchecker != "water") && (environmentchecker != "duckpaddle")) {
swimI = swimI + (Math.abs(movespeedX) / 3);
}
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
gspeedX = 0;
gspeedY = 0;
gravityX = 0;
gravityY = 0;
windX = watercurrentrateX;
windY = 0;
if ((environmentchecker != "water") && (environmentchecker != "duckpaddle")) {
swimY = 0;
swimY2 = 0;
}
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
environmentchecker = "duckpaddle";
} else if ((environment == "swimmingupward") || (environment == "swimmingdownward")) {
if (airspinspeed != 0) {
swimspinspeed = swimspinspeed + airspinspeed;
airspinspeed = 0;
}
airspin = 0;
if ((charROT > 100) || (charROT < -100)) {
if (environmentchecker != "water") {
swimI = swimI + ((Math.abs(movespeedX) / 3) + (gspeedY / 3));
gspeedY = 0;
}
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = gravityrateX;
gravityY = gravityrateY;
windX = watercurrentrateX;
windY = watercurrentrateY;
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
swimY2 = swimY2 / swimdragY;
swimI = swimI / swimdragY;
gspeedX = gspeedX / waterdragX;
gspeedY = gspeedY / waterdragY;
environmentchecker = "water";
} else if (environment == "watergrounded") {
if (((Math.abs(swimX2) >= swimcollideMAX) || (Math.abs(swimY2) >= swimcollideMAX)) || (Math.abs(swimI) >= swimcollideMAX)) {
swimX2 = Math.min(swimX2, swimcollideMAX);
swimY2 = Math.min(swimY2, swimcollideMAX);
swimI = Math.min(swimI, swimcollideMAX);
} else if (((Math.abs(swimX2) >= 0.25) || (Math.abs(swimY2) >= 0.25)) || (Math.abs(swimI) >= 0.25)) {
swimX2 = swimX2 / watergroundfriction;
swimY2 = swimY2 / watergroundfriction;
swimI = swimI / watergroundfriction;
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
windX = 0;
windY = 0;
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
swimY2 = swimY2 / swimdragY;
movespeedX = movespeedX / waterdragX;
movespeedY = movespeedY / waterdragY;
environmentchecker = "waterground";
} else if ((environment == "flying") || (environment == "falling")) {
charROT = 0;
if ((dr == -1) && (dl == -1)) {
moveY = 0;
movespeedY = 0;
}
if (swimspinspeed != 0) {
airspinspeed = airspinspeed + swimspinspeed;
swimspinspeed = 0;
}
swimspin = 0;
if (((swimX2 != 0) || (swimY2 != 0)) || (swimI != 0)) {
if (environmentchecker == "duckjump") {
swimX2 = swimX2 / duckjumpRATIO;
swimI = swimI / duckjumpRATIO;
}
jumpspeedX = jumpspeedX + (Math.sin(charROT * DEGtoRAD) * swimX2);
if (environmentchecker != "duckjump") {
jumpspeedY = jumpspeedY + Math.min(Math.cos(charROT * DEGtoRAD) * (swimX2 + swimI), swimspeedMAXTRANSFER);
}
}
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
gravityX = gravityrateX;
gravityY = gravityrateY;
windX = windrateX;
windY = windrateY;
if (environment == "flying") {
jumpX = 0;
jumpY = 0;
}
airspinspeed = airspinspeed / airspindrag;
if (environmentchecker != "bellyslide") {
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
} else {
movespeedX = movespeedX / slidedragX;
movespeedY = movespeedY / slidedragY;
}
if (environmentchecker == "nosedivebounce") {
airspin = 0;
if (Math.abs(charROT) < 5) {
charROT = 0;
environmentchecker = ((gspeedY > (jumpspeedY * 2)) ? "air" : "nosedivebounce");
}
}
if (((((environmentchecker == "water") && (Key.isDown(_root.kRIGHT))) && (!Key.isDown(_root.kUP))) && (!Key.isDown(_root.kDOWN))) || ((((environmentchecker == "water") && (Key.isDown(_root.kLEFT))) && (!Key.isDown(_root.kUP))) && (!Key.isDown(_root.kDOWN)))) {
environmentchecker = "porpoising";
} else if (((environmentchecker != "porpoising") && (environmentchecker != "bellyslide")) && (environmentchecker != "nosedivebounce")) {
environmentchecker = "air";
}
} else if (environment == "wallslide") {
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 1;
swimspin = 0;
swimspinspeed = 0;
airspin = 0;
airspinspeed = 0;
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
environmentchecker = "wallsliding";
} else if (environment == "grounded") {
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
swimspin = 0;
swimspinspeed = 0;
airspin = 0;
airspinspeed = 0;
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
if (environmentchecker != "bellyslide") {
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
bellyslideTIME = 0;
} else {
if ((dr - dl) != 0) {
moveX = (((sliderate * slopesensorDISTANCE) / Math.sqrt(Math.pow(dl - dr, 2) + Math.pow(slopesensorDISTANCE, 2))) * (dl - dr)) / Math.abs(dl - dr);
moveY = (sliderate * (-Math.abs(dr - dl))) / Math.sqrt(Math.pow(dr - dl, 2) + Math.pow(slopesensorDISTANCE, 2));
} else {
moveX = 0;
moveY = 0;
}
movespeedX = movespeedX / slidedragX;
movespeedY = movespeedY / slidedragY;
}
if (((((charROT < 89) && (charROT > -89)) && (environmentchecker != "bellyslide")) || ((((environmentchecker == "bellyslide") && (Math.abs(movespeedX) <= slidespeedMIN)) && (Math.abs(dr - dl) <= 0)) && (bellyslideTIME > 100))) || (((environmentchecker == "bellyslide") && (charROT < 30)) && (charROT > -30))) {
charY = charY - ((initHEIGHT - charHEIGHT) / 2);
charROT = 0;
environmentchecker = "ground";
} else if (((charROT < 165) && (charROT > -165)) || (((environmentchecker == "bellyslide") && (charROT < 30)) && (charROT > -30))) {
charY = charY - ((initWIDTH - charHEIGHT) / 2);
charWIDTH = initWIDTH;
charHEIGHT = initWIDTH;
if (environmentchecker != "bellyslide") {
charROT = ((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD);
} else if (charROT != (((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD))) {
slopeDIFFERENCE = (((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD)) - charROT;
charROT = charROT + (slopeDIFFERENCE / 2);
}
bellyslideTIME = bellyslideTIME + 1;
environmentchecker = "bellyslide";
if ((((jumpspeedY == 0) && ((oldslopeANGLE * slopeANGLE) <= 0)) && (oldslopeANGLE != 0)) || (((jumpspeedY == 0) && ((oldslopeANGLE * slopeANGLE) <= 0)) && (slopeANGLE != 0))) {
if (((oldslopeANGLE > 0) && (speedX > 0)) || ((oldslopeANGLE < 0) && (speedX < 0))) {
moveY = 0;
movespeedY = 0;
gspeedY = 0;
rampjumpY = (sliderampBOOST * Math.abs(speedX)) * Math.cos(oldslopeANGLE * DEGtoRAD);
jumpY = ((rampjumpY > 0) ? rampjumpY : 0);
} else {
moveY = 0;
movespeedY = 0;
}
}
} else {
charY = charY - ((initHEIGHT - charHEIGHT) / 2);
charROT = 180;
if (environmentchecker != "nosedivebounce") {
nosedivebounceSTART = getTimer() / 1000;
environmentchecker = "nosedivebounce";
}
if (Key.isDown(_root.kJUMP) && (jumparmed == true)) {
airspin = airspin + (nosediveBOUNCEspinrate * faceX);
jumpX = nosedivejumprateX * faceX;
jumpY = nosedivejumprateY;
environmentchecker = "nosedivebounce";
moveY = 0;
movespeedY = 0;
jumparmed = false;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
nosedivebounceTIMER = (getTimer() / 1000) - nosedivebounceSTART;
if (nosedivebounceTIMER >= nosedivebounceTIME) {
airspin = airspin + (nosediveBOUNCEspinrate * faceX);
jumpX = nosediveBOUNCEXrate * faceX;
jumpY = nosediveBOUNCEYrate;
}
}
} else if (environment == "sprung") {
swimX2 = 0;
swimY2 = 0;
swimI = 0;
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
if (TOUCHwater == false) {
jumpX = springrateX;
jumpY = springrateY;
swimX = 0;
swimY = 0;
} else {
swimX = springrateX;
swimY = springrateY;
jumpX = 0;
jumpY = 0;
}
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
environmentchecker = "sprung";
}
movespeedX = movespeedX + moveX;
jumpspeedX = jumpspeedX + jumpX;
swimX2 = swimX2 + swimX;
if ((charROT == 180) || (charROT == -180)) {
swimspeedX = 0;
} else {
swimspeedX = Math.sin(charROT * DEGtoRAD) * (swimX2 + swimI);
}
gspeedX = gspeedX + gravityX;
windspeedX = windX;
movespeedY = movespeedY + moveY;
jumpspeedY = jumpspeedY + jumpY;
swimY2 = swimY2 + swimY;
swimspeedY = Math.cos(charROT * DEGtoRAD) * (swimY2 + swimI);
gspeedY = gspeedY + gravityY;
windspeedY = windY;
if (Math.abs(movespeedX) < 0.1) {
movespeedX = 0;
}
if (Math.abs(movespeedY) < 0.1) {
movespeedY = 0;
}
speedX = (((movespeedX + jumpspeedX) + swimspeedX) - gspeedX) + windspeedX;
speedY = ((((-movespeedY) - jumpspeedY) - swimspeedY) + gspeedY) - windspeedY;
if (speedX > speedXMAX) {
speedX = speedX - (speedX - speedXMAX);
} else if (speedX < (-speedXMAX)) {
speedX = speedX + (speedXMAX - speedX);
}
if (speedY > speedYMAX) {
speedY = speedY - (speedY - speedYMAX);
} else if (speedY < (-speedYMAX)) {
speedY = speedY + (speedYMAX - speedY);
}
if (Math.abs(speedX) < speedMINX) {
speedX = 0;
}
if (Math.abs(speedY) < speedMINY) {
speedY = 0;
}
charX = charX + speedX;
charY = charY + speedY;
swimspinspeed = swimspinspeed + swimspin;
airspinspeed = airspinspeed + airspin;
speedROT = swimspinspeed + airspinspeed;
charROT = charROT + speedROT;
if (charROT > 180) {
charROT = charROT - 360;
} else if (charROT < -180) {
charROT = charROT + 360;
}
if (((speedX == 0) && (speedY == 0)) && (speedROT == 0)) {
charACTION = false;
} else {
charACTION = true;
}
if (charACTION == true) {
if (speedY > 0) {
d = 1;
while (d <= floorpushes) {
if (((!SoftBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true)) && (!HardBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true))) && (!Spring.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true))) {
charY = charY - (d - 1);
break;
}
d++;
}
} else if (speedY < 0) {
u = 1;
while (u <= floorpushes) {
if (!HardBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) - (charHEIGHT * uHEIGHT)) + u) * worldYSCALEinit) / 100) + worldYinit, true)) {
charY = charY + (u - 1);
break;
}
movespeedY = 0;
jumpspeedY = 0;
gspeedY = 0;
u++;
}
}
if ((speedX > 0) || ((environment == "wallslide") && (TOUCHwallright == true))) {
r = 1;
while (r <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) + (charWIDTH * rWIDTH)) - r) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) + (charHEIGHT * rHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX - (r - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
r++;
}
if (environmentchecker != "bellysliding") {
ur = 1;
while (ur <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) + (charWIDTH * urWIDTH)) - ur) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) - (charHEIGHT * urHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX - (ur - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
ur++;
}
}
}
if ((speedX < 0) || ((environment == "wallslide") && (TOUCHwallleft == true))) {
l = 1;
while (l <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) - (charWIDTH * lWIDTH)) + l) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) + (charHEIGHT * lHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX + (l - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
l++;
}
if (environmentchecker != "bellysliding") {
ul = 1;
while (ul <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) - (charWIDTH * ulWIDTH)) + ul) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) - (charHEIGHT * ulHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX + (ul - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
ul++;
}
}
}
}
oldslopeANGLE = slopeANGLE;
if ((((charACTION == true) && (oldTOUCHdigit == false)) && (digitMODE == "constant")) || ((charACTION == true) && (digitMODE != "constant"))) {
dr = 0;
while (dr <= floorpushes) {
if ((!SoftBoundary.hitTest(((((charX + offsetX) + (slopesensorDISTANCE / 2)) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dr) * worldYSCALEinit) / 100) + worldYinit, true)) && (!HardBoundary.hitTest(((((charX + offsetX) + slopesensorDISTANCE) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dr) * worldYSCALEinit) / 100) + worldYinit, true))) {
dr = dr - 1;
break;
}
dr++;
}
dl = 0;
while (dl <= floorpushes) {
if ((!SoftBoundary.hitTest(((((charX + offsetX) - (slopesensorDISTANCE / 2)) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dl) * worldYSCALEinit) / 100) + worldYinit, true)) && (!HardBoundary.hitTest(((((charX + offsetX) - slopesensorDISTANCE) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dl) * worldYSCALEinit) / 100) + worldYinit, true))) {
dl = dl - 1;
break;
}
dl++;
}
slopeANGLE = Math.atan((dr - dl) / slopesensorDISTANCE) / DEGtoRAD;
if ((TOUCHdigit == true) && (digitMODE == "restricted")) {
slopeANGLE = Math.round(slopeANGLE / digitARCLENGTH) * digitARCLENGTH;
if (slopeANGLE > 0) {
dr = Math.abs((Math.tan(slopeANGLE * DEGtoRAD) * slopesensorDISTANCE) / 2);
dl = -dr;
} else {
dr = -Math.abs((Math.tan(slopeANGLE * DEGtoRAD) * slopesensorDISTANCE) / 2);
dl = -dr;
}
}
}
if ((((TOUCHground == true) && (TOUCHdigit == false)) || ((jumpspeedY < gspeedY) && (jumpspeedY > 0))) || ((jumpspeedY == 0) && (gspeedY > jumpTHRESHOLD))) {
oldTOUCHdigit = false;
} else {
oldTOUCHdigit = true;
}
totalspeed = Math.pow(Math.pow(speedX, 2) + Math.pow(speedY, 2), 0.5);
if ((Key.isDown(17) && ((camXSCALE + zoomINCREMENTmanual) <= zoomMAXmanual)) && ((camYSCALE + zoomINCREMENTmanual) <= zoomMAXmanual)) {
camXSCALE = camXSCALE + zoomINCREMENTmanual;
camYSCALE = camYSCALE + zoomINCREMENTmanual;
zoomMIN = zoomMIN + zoomINCREMENTmanual;
} else if ((Key.isDown(16) && ((camXSCALE - zoomINCREMENTmanual) >= zoomMINmanual)) && ((camYSCALE - zoomINCREMENTmanual) >= zoomMINmanual)) {
camXSCALE = camXSCALE - zoomINCREMENTmanual;
camYSCALE = camYSCALE - zoomINCREMENTmanual;
zoomMIN = zoomMIN - zoomINCREMENTmanual;
} else {
if (((((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) <= (camX - (camWIDTH / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX)) || ((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) >= (camX + (camWIDTH / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camXSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) <= (camY - (camHEIGHT / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) >= (camY + (camHEIGHT / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) {
camXSCALE = camXSCALE + zoomINCREMENT;
camYSCALE = camYSCALE + zoomINCREMENT;
} else if (((((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) >= (camX - (camWIDTH / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camYSCALE - zoomINCREMENT) >= zoomMIN)) || ((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) <= (camX + (camWIDTH / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camXSCALE - zoomINCREMENT) >= zoomMIN))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) >= (camY - (camHEIGHT / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camYSCALE - zoomINCREMENT) >= zoomMIN))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) <= (camY + (camHEIGHT / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camYSCALE - zoomINCREMENT) >= zoomMIN))) {
camXSCALE = camXSCALE - zoomINCREMENT;
camYSCALE = camYSCALE - zoomINCREMENT;
}
if (((((((!Key.isDown(16)) && (charX <= ((camX - (camWIDTH / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX)) || ((((!Key.isDown(16)) && (charX >= ((camX + (camWIDTH / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camXSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && (charY <= ((camY - (camHEIGHT / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && (charY >= ((camY + (camHEIGHT / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) {
camXSCALE = camXSCALE + zoomINCREMENT;
camYSCALE = camYSCALE + zoomINCREMENT;
zoomMIN = zoomMIN + zoomINCREMENTmanual;
}
}
if ((TOUCHwater == false) && (environmentchecker != "bellyslide")) {
camspeedX = ((charX + (speedX * ((camLOOSENESS + camMOVEXLEAD) / (worldXSCALE / 100)))) - camX) / (camLOOSENESS / (worldXSCALE / 100));
if ((Math.abs(speedX) >= moverate) || (Math.abs(speedY) >= moverate)) {
camX = camX + ((Math.abs(camspeedX) > 1) ? (camspeedX) : 0);
}
} else {
camspeedX = ((charX + (speedX * ((camLOOSENESS + camWATERXLEAD) / (worldXSCALE / 100)))) - camX) / (camLOOSENESS / (worldXSCALE / 100));
if ((Math.abs(speedX) >= moverate) || (Math.abs(speedY) >= moverate)) {
camX = camX + ((Math.abs(camspeedX) > 1) ? (camspeedX) : 0);
}
}
if (((TOUCHwater == false) && (Math.abs(speedY) < 10)) && (environmentchecker != "bellyslide")) {
camspeedY = ((charY + (speedY * ((camLOOSENESS + camMOVEYLEAD) / (worldYSCALE / 100)))) - camY) / (camLOOSENESS / (worldYSCALE / 100));
camY = camY + camspeedY;
} else {
camspeedY = ((charY + (speedY * ((camLOOSENESS + camWATERYLEAD) / (worldYSCALE / 100)))) - camY) / (camLOOSENESS / (worldYSCALE / 100));
camY = camY + camspeedY;
}
if (Math.abs(camX - charX) > ((camWIDTH * 3) / 8)) {
camX = charX + ((((camWIDTH * 3) / 8) * (camX - charX)) / Math.abs(camX - charX));
}
if (Math.abs(camY - charY) > ((camHEIGHT * 3) / 8)) {
camY = charY + ((((camHEIGHT * 3) / 8) * (camY - charY)) / Math.abs(camY - charY));
}
camWIDTH = (camWIDTHinit * camXSCALE) / 100;
camHEIGHT = (camHEIGHTinit * camYSCALE) / 100;
if (!Key.isDown(46)) {
scaleX = stageWIDTH / camWIDTH;
scaleY = stageHEIGHT / camHEIGHT;
worldX = stagehalfWIDTH - (camX * scaleX);
worldY = stagehalfHEIGHT - (camY * scaleY);
worldXSCALE = 100 * scaleX;
worldYSCALE = 100 * scaleY;
camROT = 0;
worldROT = -camROT;
}
frameloops++;
}
Player1._x = charX;
Player1._y = charY;
Player1._rotation = charROT;
Player1.sensor._x = charsensorX;
Player1.sensor._y = charsensorY;
Player1.sensor._width = charsensorWIDTH;
Player1.sensor._height = charsensorHEIGHT;
if (faceX > 0) {
Player1._xscale = 100;
} else if (faceX < 0) {
Player1._xscale = -100;
}
camera._x = camX;
camera._y = camY;
camera._rotation = camROT;
camera._xscale = camXSCALE;
camera._yscale = camYSCALE;
camera._width = camWIDTH;
camera._height = camHEIGHT;
_x = worldX;
_y = worldY;
_rotation = worldROT;
_xscale = worldXSCALE;
_yscale = worldYSCALE;
}
Frame 20
if (_root.go != true) {
gotoAndStop (19);
} else {
_root.go = false;
}
Frame 21
Mouse.show();
stopAllSounds();
_root.soundManager_mc.playSound("BreakfastEnding.wav", 0, 9999999999);
_root.died = false;
_root.levelCOMPLETE = getTimer() / 1000;
_root.levelTIME = Math.round(((_root.levelCOMPLETE + _root.levelDEADTIME) - (_root.levelSTART + _root.pauseTIME)) * 10000) / 10000;
_root.levelDEADTIME = 0;
_root.levelTIMESTR = _root.levelTIME + " sec";
_root.pointratio = Math.round((_root.player1points / _root.totalpoints) * 10000) / 100;
_root.gameTIME = _root.gameTIME + _root.levelTIME;
_root.GAMEplayer1points = _root.GAMEplayer1points + _root.player1points;
_root.gamedeaths = _root.gamedeaths + _root.leveldeaths;
if (_root.cheats != true) {
_root.topdeaths.text = "---";
if (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] != undefined) {
_root.topdeaths.text = _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"];
}
if ((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] == undefined) || (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] > _root.leveldeaths)) {
_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] = _root.leveldeaths;
} else {
_root.newdeathsrecord.text = "";
}
_root.toptime.text = "---";
if (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] != undefined) {
_root.toptime.text = _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"];
}
if ((((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] == undefined) && (_root.leveldeaths <= _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"])) || ((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] > _root.levelTIME) && (_root.leveldeaths <= _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"]))) || (_root.newdeathsrecord.text != "")) {
_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] = _root.levelTIME;
} else {
_root.newtimerecord.text = "";
}
_root.leveldeaths = 0;
_root.toppoints.text = "---";
_root.topratio.text = "---";
if (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] != undefined) {
_root.toppoints.text = _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"];
_root.topratio.text = Math.round((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] / _root.totalpoints) * 10000) / 100;
}
if ((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] == undefined) || (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] < _root.player1points)) {
_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] = _root.player1points;
} else {
_root.newcoinrecord.text = "";
_root.newratiorecord.text = "";
}
_root.savedData.data[("LVL" + _root.level.substr(6)) + "totalpoints"] = _root.totalpoints;
if (_root.savedData.data.levelMAX == 2) {
_root.savedData.data.levelMAX = 3;
}
_root.savedData.flush();
}
if (_root.stattracking == true) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl2complete");
if (_root.pointratio >= 100) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl2coins100percent");
} else if (_root.pointratio >= 50) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl2coins050percent");
}
}
stop();
Instance of Symbol 240 MovieClip in Frame 21
onClipEvent (load) {
this.textvalue = "Menu";
this.linkvalue = "Game Start";
this.gotoAndStop("Menu");
}
Frame 22
if (_root.go != true) {
gotoAndStop (21);
} else {
_root.go = false;
}
Frame 23
stop();
Frame 24
if (_root.go != true) {
gotoAndStop (23);
} else {
_root.go = false;
}
Frame 25
stopAllSounds();
_root.cutscene2 = true;
_root.go = false;
stop();
Frame 26
if (_root.go != true) {
gotoAndStop (25);
} else {
_root.go = false;
}
Frame 27
if ((_root.cutscene2 != true) && (_root.cutscenes == true)) {
_root.gotoAndPlay("cutscene2");
}
Mouse.show();
stopAllSounds();
_root.level = "Level 1";
_root.kRIGHT = _root.kRIGHTconfig;
_root.kLEFT = _root.kLEFTconfig;
_root.kUP = _root.kUPconfig;
_root.kDOWN = _root.kDOWNconfig;
_root.kJUMP = _root.kJUMPconfig;
_root.kTHROW = _root.kTHROWconfig;
_root.kPAUSE = _root.kPAUSEconfig;
_root.kSTART = _root.kSTARTconfig;
_root.pauseTIME = 0;
if (_root.died == true) {
_root.leveldeaths = _root.leveldeaths + 1;
}
if (_root.stattracking == true) {
if (_root.died == false) {
StatTracker.submitStat("/flashgames/breakfastclub/level3start");
} else {
StatTracker.submitStat("/flashgames/breakfastclub/level3died");
}
}
stop();
Frame 28
if (_root.go != true) {
gotoAndStop (27);
} else {
_root.go = false;
}
Frame 29
stopAllSounds();
_root.soundManager_mc.playSound("BreakfastInGame2.wav", 0, 9999999999);
if ((_root.savedData.data.levelMAX > 3) && (_root.stattracking == true)) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl3replay");
}
onMouseMove = function () {
mouseTIMERstart = getTimer() / 1000;
Mouse.show();
};
onEnterFrame = function () {
_root.timechecker();
mouseTIMER = (getTimer() / 1000) - mouseTIMERstart;
if (mouseTIMER >= mouseTIMERMAX) {
Mouse.hide();
}
};
_root.attachDEPTH = _root.GAMEattachDEPTH;
_root.WorldString = undefined;
if (_root.WorldString != undefined) {
SoftCOLOR = 65535;
SoftALPHA = 50;
TiledCOLOR = 16711935 /* 0xFF00FF */;
TiledALPHA = 50;
HardCOLOR = 16711680 /* 0xFF0000 */;
HardALPHA = 50;
WaterCOLOR = 255;
WaterALPHA = 50;
SpringCOLOR = 16776960 /* 0xFFFF00 */;
SpringALPHA = 50;
_root.World.createEmptyMovieClip("SoftBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.SoftBoundary.objects = 0;
_root.WorldArray[0] = [];
_root.World.createEmptyMovieClip("TiledBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.TiledBoundary.objects = 0;
_root.WorldArray[1] = [];
_root.World.createEmptyMovieClip("HardBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.SoftBoundary.objects = 0;
_root.WorldArray[2] = [];
_root.World.createEmptyMovieClip("WaterBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.WaterBoundary.objects = 0;
_root.WorldArray[3] = [];
_root.World.createEmptyMovieClip("SpringBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.SpringBoundary.objects = 0;
_root.WorldArray[4] = [];
_root.World.createEmptyMovieClip("Art", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.Art.objects = 0;
_root.WorldArray[5] = [];
_root.WorldArray = _root.WorldString.split(">>>>");
boundaryelements = 0;
while (boundaryelements < _root.WorldArray.length) {
_root.WorldArray[boundaryelements] = _root.WorldArray[boundaryelements].split("|");
objectelements = 0;
while (objectelements < _root.WorldArray[boundaryelements].length) {
_root.WorldArray[boundaryelements][objectelements] = _root.WorldArray[boundaryelements][objectelements].split("/");
anchorelements = 0;
while (anchorelements < _root.WorldArray[boundaryelements][objectelements].length) {
_root.WorldArray[boundaryelements][objectelements][anchorelements] = _root.WorldArray[boundaryelements][objectelements][anchorelements].split(",");
anchorelements++;
}
objectelements++;
}
boundaryelements++;
}
boundaryload = 0;
while (boundaryload < _root.WorldArray.length) {
if (boundaryload == 0) {
boundary = "Soft";
boundaryCOLOR = _root.SoftCOLOR;
boundaryALPHA = _root.SoftALPHA;
} else if (boundaryload == 1) {
boundary = "Tile";
boundaryCOLOR = _root.TileCOLOR;
boundaryALPHA = _root.TileALPHA;
} else if (boundaryload == 2) {
boundary = "Hard";
boundaryCOLOR = _root.HardCOLOR;
boundaryALPHA = _root.HardALPHA;
} else if (boundaryload == 3) {
boundary = "Water";
boundaryCOLOR = _root.WaterCOLOR;
boundaryALPHA = _root.WaterALPHA;
} else if (boundaryload == 4) {
boundary = "Spring";
boundaryCOLOR = _root.SpringCOLOR;
boundaryALPHA = _root.SpringALPHA;
} else if (boundaryload == 5) {
boundary = "Art";
boundaryCOLOR = _root.ArtCOLOR;
boundaryALPHA = _root.ArtALPHA;
}
_root.World.createEmptyMovieClip(boundary + "Boundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
objectload = 0;
while (objectload < _root.WorldArray[boundaryload].length) {
_root.World[boundary + "Boundary"].objects = objectload + 1;
_root.World[boundary + "Boundary"].createEmptyMovieClip("Object" + (objectload + 1), _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
anchorload = 0;
while (anchorload < _root.WorldArray[boundaryload][objectload].length) {
if ((anchorload == 0) && (_root.WorldArray[boundaryload][objectload][anchorload][0] != "Art")) {
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].lineStyle(1, 0, 100);
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].beginFill(boundaryCOLOR, boundaryALPHA);
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].moveTo(_root.WorldArray[boundaryload][objectload][anchorload][1], _root.WorldArray[boundaryload][objectload][anchorload][2]);
} else if (_root.WorldArray[boundaryload][objectload][anchorload][0] != "Art") {
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].lineTo(_root.WorldArray[boundaryload][objectload][anchorload][1], _root.WorldArray[boundaryload][objectload][anchorload][2]);
} else if (_root.WorldArray[boundaryload][objectload][anchorload][0] == "Art") {
anchorload++;
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].removeMovieClip();
_root.World[boundary + "Boundary"].attachMovie(_root.WorldArray[boundaryload][objectload][anchorload][0], _root.WorldArray[boundaryload][objectload][anchorload][0] + (objectload + 1), _root.attachDEPTH, {_x:_root.WorldArray[boundaryload][objectload][anchorload][1], _y:_root.WorldArray[boundaryload][objectload][anchorload][2]});
break;
}
anchorload++;
}
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].endFill();
objectload++;
}
boundaryload++;
}
}
stop();
Instance of Symbol 623 MovieClip "World" in Frame 29
onClipEvent (load) {
_name = "World";
framerateDEFAULT = 24;
framerateMAX = 120;
framerateMIN = 12;
DEGtoRAD = (Math.PI/180);
bubbleDEPTH = 1000;
this.bottomlesspit = 5000;
this.Player1.points = 0;
this.points = 0;
this.badguyDISTANCEMAX = 150;
this.bomberCHANCE = 432;
this.bombers = 0;
this.Goombas = 0;
this.KoopaTroopas = 0;
this.AttackDogs = 0;
this.Barrels = 0;
this.BarrelsFilled = 0;
digitMODE = "constant";
charALIVE = true;
charBLINK = true;
charBLINKTIME = 1;
charBLINKTIMER = 0;
Player1.rocksloaded = 0;
Player1.rocksthrown = 0;
Player1.rocksloadedMAX = 3;
rocksMAX = 6;
dHEIGHT = 0.5;
uHEIGHT = 0.5;
rWIDTH = 0.5;
rHEIGHT = 0;
urWIDTH = 0.3;
urHEIGHT = 0.25;
lWIDTH = 0.5;
lHEIGHT = 0;
ulWIDTH = 0.3;
ulHEIGHT = 0.25;
offsetX = 0;
offsetY = 0;
charACTION = true;
initWIDTH = Player1.sensor._width;
initHEIGHT = Player1.sensor._height;
initHYP = Math.sqrt(Math.pow(initWIDTH, 2) + Math.pow(initHEIGHT, 2));
initANGLE1 = Math.asin(initHEIGHT / initHYP);
initANGLE2 = Math.asin(initWIDTH / initHYP);
slopesensorRATIO = 3;
floorpushes = 100;
speedXMAX = 25;
speedYMAX = 25;
speedMAXdivisor = 1;
speedXMIN = 0.05;
speedYMIN = 0.05;
slidespeedMIN = 0.05;
jumpTHRESHOLD = 2;
airjumpsMAX = 1;
duckjumpRATIO = 2;
throwTIME = 2.5;
throwANGLEup = 65;
throwANGLEforward = 75;
throwANGLEdown = 120;
nosedivebounceTIME = 0.25;
swimcollideMAX = 7;
duckpaddleFALLSPEED = 7.5;
duckpaddleRATIO = 3;
faceX = 1;
faceY = 1;
digitARCLENGTH = 22.5;
engineloops = 4;
speedmultiUNIVERSAL = 1;
speedmultiX = speedmultiUNIVERSAL;
speedmultiY = speedmultiUNIVERSAL;
speedmultiROT = speedmultiUNIVERSAL;
movedragX = 1.175;
movedragY = 1.175;
slidedragX = 1.01;
slidedragY = 1.01;
waterdragX = 2.5;
waterdragY = 2.5;
swimdragX = 1.004;
swimdragY = 1.004;
watergroundfriction = 1.05;
throwdrag = 2.5;
swimspindrag = 1.1;
airspindrag = 1.1;
windrateX = 0 * speedmultiX;
windrateY = 0 * speedmultiY;
watercurrentrateX = 0 * speedmultiX;
watercurrentrateY = 0 * speedmultiY;
gravityrateX = 0 * speedmultiX;
gravityrateY = 0.25 * speedmultiY;
gspeedX = 0 * speedmultiX;
gspeedY = 0 * speedmultiY;
windX = 0 * speedmultiX;
windY = 0 * speedmultiY;
windspeedX = 0 * speedmultiX;
windspeedY = 0 * speedmultiY;
environment = "falling";
environmentchecker = "air";
moverate = 0.6 * speedmultiUNIVERSAL;
sliderate = 0.75 * speedmultiUNIVERSAL;
sliderampBOOST = 0.8 * speedmultiUNIVERSAL;
sliderampTHRESHOLD = 13;
swimspeedMAXTRANSFER = 15 * speedmultiUNIVERSAL;
jumprateX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
jumprateY = (40 * gravityrateY) / Math.sqrt(speedmultiY);
walljumpTIME = 20;
nosedivejumprateX = jumprateX * 1.4;
nosedivejumprateY = jumprateY * 1.4;
springrateX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
springrateY = (50 * gravityrateY) / Math.sqrt(speedmultiY);
nosediveBOUNCEXrate = 0.5;
nosediveBOUNCEYrate = (24 * gravityrateY) / Math.sqrt(speedmultiY);
nosediveBOUNCEspinrate = 17 * speedmultiROT;
swimrateX = (1 * gravityrateY) / Math.sqrt(speedmultiY);
swimrateY = (1 * gravityrateY) / Math.sqrt(speedmultiY);
throwrate = (40 * gravityrateY) / Math.sqrt(speedmultiY);
swimspinrate = 0.5 * speedmultiROT;
airspinrate = 0.75 * speedmultiROT;
watergroundboostX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
watergroundboostY = (0 * gravityrateY) / Math.sqrt(speedmultiY);
moveX = 0 * speedmultiX;
moveY = 0 * speedmultiY;
movespeedX = 0 * speedmultiX;
movespeedY = 0 * speedmultiY;
jumpX = 0 * speedmultiX;
jumpY = 0 * speedmultiY;
walljumpTIMER = 0;
airjumpCOUNT = 0;
jumpspeedX = 0 * speedmultiX;
jumpspeedY = 0 * speedmultiY;
swimX = 0 * speedmultiX;
swimY = 0 * speedmultiY;
swimX2 = 0 * speedmultiX;
swimY2 = 0 * speedmultiY;
swimI = 0 * speedmultiUNIVERSAL;
swimspeedX = 0 * speedmultiX;
swimspeedY = 0 * speedmultiY;
speedX = 0 * speedmultiX;
speedY = 0 * speedmultiY;
swimspin = 0 * speedmultiROT;
swimspinspeed = 0 * speedmultiROT;
airspin = 0 * speedmultiROT;
airspinspeed = 0 * speedmultiROT;
camera._visible = false;
stagehalfWIDTH = 275;
stagehalfHEIGHT = 200;
stageWIDTH = 550;
stageHEIGHT = 400;
camLOOSENESS = 50;
camMOVEXLEAD = 30;
camMOVEYLEAD = -30;
camWATERXLEAD = 5;
camWATERYLEAD = 5;
zoomMIN = 125;
zoomMAX = 250;
zoomMINmanual = zoomMIN;
zoomMAXmanual = zoomMAX;
camera._xscale = zoomMIN;
camera._yscale = zoomMIN;
zoomINCREMENT = 0.25 * speedmultiX;
zoomINCREMENTmanual = 1;
zoomLEAD = 90;
safezoneDISTANCE = 100;
startTime = getTimer();
numFrames = 0;
recentSetting = 5;
recentNumFrames = 0;
recentStartTime = startTime;
charX = Player1._x;
charY = Player1._y;
charROT = Player1._rotation;
charsensorX = Player1.sensor._x;
charsensorY = Player1.sensor._y;
charsensorWIDTH = Player1.sensor._width;
charsensorHEIGHT = Player1.sensor._height;
camX = camera._x;
camY = camera._y;
camROT = camera._rotation;
camXSCALE = camera._xscale;
camYSCALE = camera._yscale;
camWIDTHinit = camera._width;
camHEIGHTinit = camera._height;
camWIDTH = camera._width;
camHEIGHT = camera._height;
worldX = _x;
worldY = _y;
worldROT = _rotation;
worldXSCALE = _xscale;
worldYSCALE = _yscale;
}
onClipEvent (enterFrame) {
_root.player1points = this.Player1.points;
_root.totalpoints = this.points;
numFrames++;
now = getTimer();
elapsedSeconds = (now - startTime) / 1000;
actualFPS = numFrames / elapsedSeconds;
recentNumFrames++;
if (recentNumFrames == recentSetting) {
recentElapsedSeconds = (now - recentStartTime) / 1000;
recentFPSoutput = recentNumFrames / recentElapsedSeconds;
recentStartTime = now;
recentNumFrames = 0;
}
if (((recentFPSoutput >= framerateMIN) && (recentFPSoutput <= framerateMAX)) && (elapsedSeconds >= 1)) {
engineloops = framerateMAX / Math.ceil(recentFPSoutput);
} else if (elapsedSeconds < 1) {
engineloops = framerateMAX / framerateDEFAULT;
}
if ((Key.isDown(_root.kPAUSE) && (_root.PAUSE == false)) && (this.pausearmed == true)) {
_root.PAUSE = true;
this.pausearmed = false;
_root.pauseSTART = getTimer() / 1000;
} else if (((Key.isDown(_root.kPAUSE) && (_root.PAUSE == true)) && (this.pausearmed == true)) && (_root.textbubble == undefined)) {
_root.PAUSE = false;
this.pausearmed = false;
_root.pauseEND = getTimer() / 1000;
_root.pauseTIME = _root.pauseTIME + (_root.pauseEND - _root.pauseSTART);
}
if (!Key.isDown(_root.kPAUSE)) {
this.pausearmed = true;
}
if (_root.PAUSE == true) {
engineloops = 0;
}
worldXinit = _x;
worldYinit = _y;
worldROTinit = _rotation;
worldXSCALEinit = _xscale;
worldYSCALEinit = _yscale;
if (charALIVE == false) {
_root.kRIGHT = undefined;
_root.kLEFT = undefined;
_root.kUP = undefined;
_root.kDOWN = undefined;
_root.kJUMP = undefined;
_root.kTHROW = undefined;
_root.died = true;
_root.levelselect = false;
}
if ((charBLINK == true) && (charBLINKTIMER < charBLINKTIME)) {
if (Player1._visible == true) {
Player1._visible = false;
} else {
Player1._visible = true;
}
charBLINKTIMER = charBLINKTIMER + ((1 / this.framerateMAX) * this.engineloops);
} else {
Player1._visible = true;
charBLINKTIMER = 0;
charBLINK = false;
}
if ((random(bomberCHANCE) == 0) && (_root.PAUSE == false)) {
if (random(2) == 0) {
bomberDIRX = 1;
} else {
bomberDIRX = -1;
}
bomberDIRY = -1;
bombers = bombers + 1;
this.attachMovie("Bomber 1", "Bomber" + bombers, _root.attachDEPTH, {_x:this.camera._x + (((this.camera._width / 2) + this.badguyDISTANCEMAX) * bomberDIRX), _y:this.camera._y + (random(this.camera._width / 2) * bomberDIRY), flyDIR:bomberDIRX});
_root.attachDEPTH = _root.attachDEPTH + 1;
}
frameloops = 1;
while (frameloops <= engineloops) {
if (environmentchecker != "bellyslide") {
charWIDTH = Math.abs(Math.cos(initANGLE1 - ((Math.abs(charROT) + 180) * DEGtoRAD)) * initHYP);
charHEIGHT = Math.abs(Math.cos(initANGLE2 - ((Math.abs(charROT) + 180) * DEGtoRAD)) * initHYP);
} else {
charWIDTH = initWIDTH;
charHEIGHT = initWIDTH;
}
slopesensorDISTANCE = charWIDTH / slopesensorRATIO;
if (((speedY >= 0) && (SoftBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true))) || ((speedY >= 0) && (HardBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)))) {
TOUCHground = true;
if (((speedY >= 0) && (SoftBoundary.DigitBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true))) || ((speedY >= 0) && (HardBoundary.DigitBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)))) {
TOUCHdigit = true;
} else {
TOUCHdigit = false;
}
} else {
TOUCHground = false;
TOUCHdigit = false;
}
if (HardBoundary.hitTest((((((charsensorX + charX) + offsetX) + (charWIDTH * 0.5)) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.25)) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHwallright = true;
} else {
TOUCHwallright = false;
}
if (HardBoundary.hitTest((((((charsensorX + charX) + offsetX) - (charWIDTH * 0.5)) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.25)) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHwallleft = true;
} else {
TOUCHwallleft = false;
}
if (HardBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) - (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHceiling = true;
} else {
TOUCHceiling = false;
}
if (Water.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, ((((charsensorY + charY) + offsetY) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHwater = true;
} else {
TOUCHwater = false;
}
if (Spring.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true) && (speedY >= 0)) {
TOUCHspring = true;
} else {
TOUCHspring = false;
}
if (charY > bottomlesspit) {
charALIVE = false;
}
if (((_root.World.charBLINK == false) && (_root.DeathBoundaryPresent == true)) && (this.DeathBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, ((((charsensorY + charY) + offsetY) * worldYSCALEinit) / 100) + worldYinit, true))) {
if (this.Player1.rocksloaded > 0) {
this.throwANGLEdamaged = random(90) - 45;
this.throwratedamaged = 8;
this.Player1.rocksthrown = this.Player1.rocksthrown + 1;
this.attachMovie("Rock 1", "rock" + this.Player1.rocksthrown, 100 + this.Player1.rocksthrown, {_x:this.charsensorX + this.charX, _y:(this.charsensorY + this.charY) - ((this.charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEdamaged * DEGtoRAD) * throwratedamaged) * this.faceX) + this.speedX, throwspeedY:(Math.cos(throwANGLEdamaged * DEGtoRAD) * throwratedamaged) - this.speedY, weapon:false});
this.oldrock = this.Player1.rocksthrown - this.rocksMAX;
this["rock" + this.oldrock].removeMovieClip();
this.Player1.rocksloaded = this.Player1.rocksloaded - 1;
this.charBLINK = true;
_root.soundManager_mc.playSound("jump2.wav", 0, 1);
} else {
this.charALIVE = false;
}
}
if ((((environmentchecker == "air") && (TOUCHwater == true)) && (Math.abs(speedY) < duckpaddleFALLSPEED)) || (environment == "duckpaddle")) {
environment = "duckpaddle";
} else if (((((TOUCHwater == true) && (TOUCHground == true)) || ((TOUCHwater == true) && (TOUCHceiling == true))) || ((TOUCHwater == true) && (TOUCHwallleft == true))) || ((TOUCHwater == true) && (TOUCHwallright == true))) {
environment = "watergrounded";
} else if ((TOUCHwater == true) && (speedY < 0)) {
environment = "swimmingupward";
} else if (((TOUCHwater == true) && (TOUCHground == false)) && (speedY >= 0)) {
environment = "swimmingdownward";
} else if ((TOUCHspring == true) && (speedY >= 0)) {
environment = "sprung";
} else if ((TOUCHground == true) && (speedY >= 0)) {
environment = "grounded";
} else if (speedY < 0) {
environment = "flying";
} else if (((((TOUCHwallright == true) && (Key.isDown(_root.kRIGHT))) && (TOUCHground == false)) && (speedY >= 0)) || ((((TOUCHwallleft == true) && Key.isDown(_root.kLEFT)) && (TOUCHground == false)) && (speedY >= 0))) {
environment = "wallslide";
} else if ((TOUCHground == false) && (speedY >= 0)) {
environment = "falling";
}
if (((Player1.rocksloaded > 0) && (throwarmed == true)) && (Key.isDown(_root.kTHROW))) {
_root.soundManager_mc.stopSound("throw 1", 0, 1);
_root.soundManager_mc.playSound("throw 1", 0, 1);
Player1.rocksthrown = Player1.rocksthrown + 1;
if (environment != "wallslide") {
if (Key.isDown(_root.kUP)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:charsensorX + charX, _y:(charsensorY + charY) - ((charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEup * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEup * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else if (Key.isDown(_root.kDOWN)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * faceX), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEdown * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEdown * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * faceX), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEforward * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEforward * DEGtoRAD) * throwrate) - speedY, weapon:true});
}
} else if (Key.isDown(_root.kUP)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:charsensorX + charX, _y:(charsensorY + charY) - ((charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEup * DEGtoRAD) * throwrate) * (-faceX)) + speedX, throwspeedY:(Math.cos(throwANGLEup * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else if (Key.isDown(_root.kDOWN)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * (-faceX)), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEdown * DEGtoRAD) * throwrate) * (-faceX)) + speedX, throwspeedY:(Math.cos(throwANGLEdown * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * (-faceX)), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEforward * DEGtoRAD) * throwrate) * (-faceX)) + speedX, throwspeedY:(Math.cos(throwANGLEforward * DEGtoRAD) * throwrate) - speedY, weapon:true});
}
oldrock = Player1.rocksthrown - this.rocksMAX;
this["rock" + oldrock].removeMovieClip();
Player1.rocksloaded = Player1.rocksloaded - 1;
throwarmed = false;
} else if (!Key.isDown(_root.kTHROW)) {
throwarmed = true;
} else {
throwarmed = false;
}
if (environment == "grounded") {
if ((environmentchecker != "bellyslide") && (environmentchecker != "nosedivebounce")) {
movementhyp = moverate / Math.pow(Math.pow(dr - dl, 2) + Math.pow(slopesensorDISTANCE, 2), 0.5);
if (Key.isDown(_root.kRIGHT) && (TOUCHwallright == false)) {
moveX = movementhyp * slopesensorDISTANCE;
moveY = movementhyp * (-Math.abs(dr - dl));
faceX = 1;
} else if (Key.isDown(_root.kLEFT) && (TOUCHwallleft == false)) {
moveX = movementhyp * (-slopesensorDISTANCE);
moveY = movementhyp * (-Math.abs(dr - dl));
faceX = -1;
} else {
moveX = 0;
moveY = 0;
}
}
if (Key.isDown(_root.kJUMP) && (jumparmed == true)) {
jumpX = 0;
jumpY = jumprateY;
gspeedX = 0;
gspeedY = 0;
moveY = 0;
movespeedY = 0;
jumparmed = false;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
} else if ((environment == "wallslide") || (environmentchecker == "wallsliding")) {
if (Key.isDown(_root.kRIGHT)) {
faceX = 1;
} else if (Key.isDown(_root.kLEFT)) {
faceX = -1;
}
if (Key.isDown(_root.kJUMP) && (jumparmed == true)) {
jumpX = 0;
jumpY = jumprateY * 1.2;
gspeedX = 0;
gspeedY = 0;
if (Key.isDown(_root.kRIGHT)) {
moveX = -moverate;
} else if (Key.isDown(_root.kLEFT)) {
moveX = moverate;
}
moveY = 0;
movespeedY = 0;
jumparmed = false;
walljumpTIMER = walljumpTIME;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
} else if ((environment == "flying") || (environment == "falling")) {
if (walljumpTIMER <= 0) {
if (environmentchecker != "bellyslide") {
if (Key.isDown(_root.kRIGHT) && (TOUCHwallright == false)) {
moveX = moverate;
faceX = 1;
} else if (Key.isDown(_root.kLEFT) && (TOUCHwallleft == false)) {
moveX = -moverate;
faceX = -1;
} else {
moveX = 0;
}
} else {
moveX = 0;
}
walljumpTIMER = 0;
} else {
walljumpTIMER = walljumpTIMER - 1;
}
if (((Key.isDown(_root.kJUMP) && (jumparmed == true)) && (airjumpCOUNT > 0)) && (walljumpTIMER <= 0)) {
jumpspeedX = 0;
jumpspeedY = jumprateY;
gspeedX = 0;
gspeedY = 0;
moveY = 0;
movespeedY = 0;
jumparmed = false;
airjumpCOUNT = airjumpCOUNT - 1;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
if (environmentchecker == "ground") {
jumpassists = 0;
}
if (((((((jumpassists == 0) && (Key.isDown(_root.kJUMP))) && (gspeedY <= jumpTHRESHOLD)) && ((dr + dl) > -2)) && (walljumpTIMER <= 0)) && (TOUCHwallleft == false)) && (TOUCHwallright == false)) {
airjumpCOUNT = airjumpsMAX;
jumpassists = jumpassists + 1;
}
} else if ((((environment == "duckpaddle") || (environment == "swimmingupward")) || (environment == "swimmingdownward")) || (environment == "watergrounded")) {
if ((Key.isDown(_root.kRIGHT) && (Key.isDown(_root.kUP))) && (environment != "duckpaddle")) {
if ((charROT > -135) && (charROT <= 45)) {
if ((45 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-135 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((45 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-135 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if (Key.isDown(_root.kRIGHT) && (Key.isDown(_root.kDOWN))) {
if ((charROT > -45) && (charROT <= 135)) {
if ((135 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-45 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((135 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-45 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((Key.isDown(_root.kLEFT) && (Key.isDown(_root.kUP))) && (environment != "duckpaddle")) {
if ((charROT >= -45) && (charROT < 135)) {
if ((-45 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (135 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((-45 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (135 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kLEFT) && (Key.isDown(_root.kDOWN))) {
if ((charROT >= -135) && (charROT < 45)) {
if ((-135 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (45 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((-135 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (45 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kRIGHT)) {
if (environment == "duckpaddle") {
faceX = 1;
} else if ((charROT >= -90) && (charROT < 90)) {
if ((90 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-90 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((90 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-90 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if (Key.isDown(_root.kLEFT)) {
if (environment == "duckpaddle") {
faceX = -1;
} else if ((charROT > -90) && (charROT <= 90)) {
if ((90 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (-90 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((90 > (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (-90 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kUP) && (environment != "duckpaddle")) {
if (faceX > 0) {
if ((0 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-180 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 0;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((0 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (180 > (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 0;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kDOWN)) {
if (environment == "duckpaddle") {
swimX2 = swimX2 / duckpaddleRATIO;
swimY2 = swimY2 / duckpaddleRATIO;
environment = "swimmingdownward";
}
if (faceX < 0) {
if ((0 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (-180 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 180;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((0 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (180 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 180;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else {
swimspin = 0;
}
if ((swimspeedX > 0) && (environment != "duckpaddle")) {
faceX = 1;
} else if ((swimspeedX < 0) && (environment != "duckpaddle")) {
faceX = -1;
}
if (Key.isDown(_root.kJUMP) && (swimarmed == true)) {
if ((Key.isDown(_root.kUP) && (environment == "duckpaddle")) && (duckjumparmed == true)) {
while (Water.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((charY + offsetY) * worldYSCALEinit) / 100) + worldYinit, true)) {
charY = charY - 1;
}
jumpX = jumprateX;
jumpY = jumprateY;
environment = "duckjump";
environmentchecker = "duckjump";
duckjumparmed = false;
swimarmed = false;
} else if ((((environment == "duckpaddle") && (speedX == 0)) || (((environment == "duckpaddle") && (speedX > 0)) && (TOUCHwallright == false))) || (((environment == "duckpaddle") && (speedX < 0)) && (TOUCHwallleft == false))) {
if (((speedY == 0) || ((speedY > 0) && (TOUCHground == false))) || ((speedY < 0) && (TOUCHceiling == false))) {
swimX = swimrateX / duckpaddleRATIO;
swimY = swimrateY / duckpaddleRATIO;
swimarmed = false;
}
} else if (((speedX == 0) || ((speedX > 0) && (TOUCHwallright == false))) || ((speedX < 0) && (TOUCHwallleft == false))) {
if (((speedY == 0) || ((speedY > 0) && (TOUCHground == false))) || ((speedY < 0) && (TOUCHceiling == false))) {
swimX = swimrateX;
swimY = swimrateY;
swimarmed = false;
}
}
} else {
swimX = 0;
swimY = 0;
}
if (!Key.isDown(_root.kJUMP)) {
swimarmed = true;
duckjumparmed = true;
}
}
if (environment == "duckpaddle") {
charROT = 90 * faceX;
if (airspinspeed != 0) {
swimspinspeed = swimspinspeed + airspinspeed;
airspinspeed = 0;
}
airspin = 0;
if ((charROT > 100) || (charROT < -100)) {
if ((environmentchecker != "water") && (environmentchecker != "duckpaddle")) {
swimI = swimI + (Math.abs(movespeedX) / 3);
}
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
gspeedX = 0;
gspeedY = 0;
gravityX = 0;
gravityY = 0;
windX = watercurrentrateX;
windY = 0;
if ((environmentchecker != "water") && (environmentchecker != "duckpaddle")) {
swimY = 0;
swimY2 = 0;
}
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
environmentchecker = "duckpaddle";
} else if ((environment == "swimmingupward") || (environment == "swimmingdownward")) {
if (airspinspeed != 0) {
swimspinspeed = swimspinspeed + airspinspeed;
airspinspeed = 0;
}
airspin = 0;
if ((charROT > 100) || (charROT < -100)) {
if (environmentchecker != "water") {
swimI = swimI + ((Math.abs(movespeedX) / 3) + (gspeedY / 3));
gspeedY = 0;
}
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = gravityrateX;
gravityY = gravityrateY;
windX = watercurrentrateX;
windY = watercurrentrateY;
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
swimY2 = swimY2 / swimdragY;
swimI = swimI / swimdragY;
gspeedX = gspeedX / waterdragX;
gspeedY = gspeedY / waterdragY;
environmentchecker = "water";
} else if (environment == "watergrounded") {
if (((Math.abs(swimX2) >= swimcollideMAX) || (Math.abs(swimY2) >= swimcollideMAX)) || (Math.abs(swimI) >= swimcollideMAX)) {
swimX2 = Math.min(swimX2, swimcollideMAX);
swimY2 = Math.min(swimY2, swimcollideMAX);
swimI = Math.min(swimI, swimcollideMAX);
} else if (((Math.abs(swimX2) >= 0.25) || (Math.abs(swimY2) >= 0.25)) || (Math.abs(swimI) >= 0.25)) {
swimX2 = swimX2 / watergroundfriction;
swimY2 = swimY2 / watergroundfriction;
swimI = swimI / watergroundfriction;
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
windX = 0;
windY = 0;
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
swimY2 = swimY2 / swimdragY;
movespeedX = movespeedX / waterdragX;
movespeedY = movespeedY / waterdragY;
environmentchecker = "waterground";
} else if ((environment == "flying") || (environment == "falling")) {
charROT = 0;
if ((dr == -1) && (dl == -1)) {
moveY = 0;
movespeedY = 0;
}
if (swimspinspeed != 0) {
airspinspeed = airspinspeed + swimspinspeed;
swimspinspeed = 0;
}
swimspin = 0;
if (((swimX2 != 0) || (swimY2 != 0)) || (swimI != 0)) {
if (environmentchecker == "duckjump") {
swimX2 = swimX2 / duckjumpRATIO;
swimI = swimI / duckjumpRATIO;
}
jumpspeedX = jumpspeedX + (Math.sin(charROT * DEGtoRAD) * swimX2);
if (environmentchecker != "duckjump") {
jumpspeedY = jumpspeedY + Math.min(Math.cos(charROT * DEGtoRAD) * (swimX2 + swimI), swimspeedMAXTRANSFER);
}
}
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
gravityX = gravityrateX;
gravityY = gravityrateY;
windX = windrateX;
windY = windrateY;
if (environment == "flying") {
jumpX = 0;
jumpY = 0;
}
airspinspeed = airspinspeed / airspindrag;
if (environmentchecker != "bellyslide") {
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
} else {
movespeedX = movespeedX / slidedragX;
movespeedY = movespeedY / slidedragY;
}
if (environmentchecker == "nosedivebounce") {
airspin = 0;
if (Math.abs(charROT) < 5) {
charROT = 0;
environmentchecker = ((gspeedY > (jumpspeedY * 2)) ? "air" : "nosedivebounce");
}
}
if (((((environmentchecker == "water") && (Key.isDown(_root.kRIGHT))) && (!Key.isDown(_root.kUP))) && (!Key.isDown(_root.kDOWN))) || ((((environmentchecker == "water") && (Key.isDown(_root.kLEFT))) && (!Key.isDown(_root.kUP))) && (!Key.isDown(_root.kDOWN)))) {
environmentchecker = "porpoising";
} else if (((environmentchecker != "porpoising") && (environmentchecker != "bellyslide")) && (environmentchecker != "nosedivebounce")) {
environmentchecker = "air";
}
} else if (environment == "wallslide") {
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 1;
swimspin = 0;
swimspinspeed = 0;
airspin = 0;
airspinspeed = 0;
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
environmentchecker = "wallsliding";
} else if (environment == "grounded") {
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
swimspin = 0;
swimspinspeed = 0;
airspin = 0;
airspinspeed = 0;
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
if (environmentchecker != "bellyslide") {
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
bellyslideTIME = 0;
} else {
if ((dr - dl) != 0) {
moveX = (((sliderate * slopesensorDISTANCE) / Math.sqrt(Math.pow(dl - dr, 2) + Math.pow(slopesensorDISTANCE, 2))) * (dl - dr)) / Math.abs(dl - dr);
moveY = (sliderate * (-Math.abs(dr - dl))) / Math.sqrt(Math.pow(dr - dl, 2) + Math.pow(slopesensorDISTANCE, 2));
} else {
moveX = 0;
moveY = 0;
}
movespeedX = movespeedX / slidedragX;
movespeedY = movespeedY / slidedragY;
}
if (((((charROT < 89) && (charROT > -89)) && (environmentchecker != "bellyslide")) || ((((environmentchecker == "bellyslide") && (Math.abs(movespeedX) <= slidespeedMIN)) && (Math.abs(dr - dl) <= 0)) && (bellyslideTIME > 100))) || (((environmentchecker == "bellyslide") && (charROT < 30)) && (charROT > -30))) {
charY = charY - ((initHEIGHT - charHEIGHT) / 2);
charROT = 0;
environmentchecker = "ground";
} else if (((charROT < 165) && (charROT > -165)) || (((environmentchecker == "bellyslide") && (charROT < 30)) && (charROT > -30))) {
charY = charY - ((initWIDTH - charHEIGHT) / 2);
charWIDTH = initWIDTH;
charHEIGHT = initWIDTH;
if (environmentchecker != "bellyslide") {
charROT = ((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD);
} else if (charROT != (((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD))) {
slopeDIFFERENCE = (((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD)) - charROT;
charROT = charROT + (slopeDIFFERENCE / 2);
}
bellyslideTIME = bellyslideTIME + 1;
environmentchecker = "bellyslide";
if ((((jumpspeedY == 0) && ((oldslopeANGLE * slopeANGLE) <= 0)) && (oldslopeANGLE != 0)) || (((jumpspeedY == 0) && ((oldslopeANGLE * slopeANGLE) <= 0)) && (slopeANGLE != 0))) {
if (((oldslopeANGLE > 0) && (speedX > 0)) || ((oldslopeANGLE < 0) && (speedX < 0))) {
moveY = 0;
movespeedY = 0;
gspeedY = 0;
rampjumpY = (sliderampBOOST * Math.abs(speedX)) * Math.cos(oldslopeANGLE * DEGtoRAD);
jumpY = ((rampjumpY > 0) ? rampjumpY : 0);
} else {
moveY = 0;
movespeedY = 0;
}
}
} else {
charY = charY - ((initHEIGHT - charHEIGHT) / 2);
charROT = 180;
if (environmentchecker != "nosedivebounce") {
nosedivebounceSTART = getTimer() / 1000;
environmentchecker = "nosedivebounce";
}
if (Key.isDown(_root.kJUMP) && (jumparmed == true)) {
airspin = airspin + (nosediveBOUNCEspinrate * faceX);
jumpX = nosedivejumprateX * faceX;
jumpY = nosedivejumprateY;
environmentchecker = "nosedivebounce";
moveY = 0;
movespeedY = 0;
jumparmed = false;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
nosedivebounceTIMER = (getTimer() / 1000) - nosedivebounceSTART;
if (nosedivebounceTIMER >= nosedivebounceTIME) {
airspin = airspin + (nosediveBOUNCEspinrate * faceX);
jumpX = nosediveBOUNCEXrate * faceX;
jumpY = nosediveBOUNCEYrate;
}
}
} else if (environment == "sprung") {
swimX2 = 0;
swimY2 = 0;
swimI = 0;
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
if (TOUCHwater == false) {
jumpX = springrateX;
jumpY = springrateY;
swimX = 0;
swimY = 0;
} else {
swimX = springrateX;
swimY = springrateY;
jumpX = 0;
jumpY = 0;
}
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
environmentchecker = "sprung";
}
movespeedX = movespeedX + moveX;
jumpspeedX = jumpspeedX + jumpX;
swimX2 = swimX2 + swimX;
if ((charROT == 180) || (charROT == -180)) {
swimspeedX = 0;
} else {
swimspeedX = Math.sin(charROT * DEGtoRAD) * (swimX2 + swimI);
}
gspeedX = gspeedX + gravityX;
windspeedX = windX;
movespeedY = movespeedY + moveY;
jumpspeedY = jumpspeedY + jumpY;
swimY2 = swimY2 + swimY;
swimspeedY = Math.cos(charROT * DEGtoRAD) * (swimY2 + swimI);
gspeedY = gspeedY + gravityY;
windspeedY = windY;
if (Math.abs(movespeedX) < 0.1) {
movespeedX = 0;
}
if (Math.abs(movespeedY) < 0.1) {
movespeedY = 0;
}
speedX = (((movespeedX + jumpspeedX) + swimspeedX) - gspeedX) + windspeedX;
speedY = ((((-movespeedY) - jumpspeedY) - swimspeedY) + gspeedY) - windspeedY;
if (speedX > speedXMAX) {
speedX = speedX - (speedX - speedXMAX);
} else if (speedX < (-speedXMAX)) {
speedX = speedX + (speedXMAX - speedX);
}
if (speedY > speedYMAX) {
speedY = speedY - (speedY - speedYMAX);
} else if (speedY < (-speedYMAX)) {
speedY = speedY + (speedYMAX - speedY);
}
if (Math.abs(speedX) < speedMINX) {
speedX = 0;
}
if (Math.abs(speedY) < speedMINY) {
speedY = 0;
}
charX = charX + speedX;
charY = charY + speedY;
swimspinspeed = swimspinspeed + swimspin;
airspinspeed = airspinspeed + airspin;
speedROT = swimspinspeed + airspinspeed;
charROT = charROT + speedROT;
if (charROT > 180) {
charROT = charROT - 360;
} else if (charROT < -180) {
charROT = charROT + 360;
}
if (((speedX == 0) && (speedY == 0)) && (speedROT == 0)) {
charACTION = false;
} else {
charACTION = true;
}
if (charACTION == true) {
if (speedY > 0) {
d = 1;
while (d <= floorpushes) {
if (((!SoftBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true)) && (!HardBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true))) && (!Spring.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true))) {
charY = charY - (d - 1);
break;
}
d++;
}
} else if (speedY < 0) {
u = 1;
while (u <= floorpushes) {
if (!HardBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) - (charHEIGHT * uHEIGHT)) + u) * worldYSCALEinit) / 100) + worldYinit, true)) {
charY = charY + (u - 1);
break;
}
movespeedY = 0;
jumpspeedY = 0;
gspeedY = 0;
u++;
}
}
if ((speedX > 0) || ((environment == "wallslide") && (TOUCHwallright == true))) {
r = 1;
while (r <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) + (charWIDTH * rWIDTH)) - r) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) + (charHEIGHT * rHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX - (r - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
r++;
}
if (environmentchecker != "bellysliding") {
ur = 1;
while (ur <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) + (charWIDTH * urWIDTH)) - ur) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) - (charHEIGHT * urHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX - (ur - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
ur++;
}
}
}
if ((speedX < 0) || ((environment == "wallslide") && (TOUCHwallleft == true))) {
l = 1;
while (l <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) - (charWIDTH * lWIDTH)) + l) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) + (charHEIGHT * lHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX + (l - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
l++;
}
if (environmentchecker != "bellysliding") {
ul = 1;
while (ul <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) - (charWIDTH * ulWIDTH)) + ul) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) - (charHEIGHT * ulHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX + (ul - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
ul++;
}
}
}
}
oldslopeANGLE = slopeANGLE;
if ((((charACTION == true) && (oldTOUCHdigit == false)) && (digitMODE == "constant")) || ((charACTION == true) && (digitMODE != "constant"))) {
dr = 0;
while (dr <= floorpushes) {
if ((!SoftBoundary.hitTest(((((charX + offsetX) + (slopesensorDISTANCE / 2)) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dr) * worldYSCALEinit) / 100) + worldYinit, true)) && (!HardBoundary.hitTest(((((charX + offsetX) + slopesensorDISTANCE) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dr) * worldYSCALEinit) / 100) + worldYinit, true))) {
dr = dr - 1;
break;
}
dr++;
}
dl = 0;
while (dl <= floorpushes) {
if ((!SoftBoundary.hitTest(((((charX + offsetX) - (slopesensorDISTANCE / 2)) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dl) * worldYSCALEinit) / 100) + worldYinit, true)) && (!HardBoundary.hitTest(((((charX + offsetX) - slopesensorDISTANCE) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dl) * worldYSCALEinit) / 100) + worldYinit, true))) {
dl = dl - 1;
break;
}
dl++;
}
slopeANGLE = Math.atan((dr - dl) / slopesensorDISTANCE) / DEGtoRAD;
if ((TOUCHdigit == true) && (digitMODE == "restricted")) {
slopeANGLE = Math.round(slopeANGLE / digitARCLENGTH) * digitARCLENGTH;
if (slopeANGLE > 0) {
dr = Math.abs((Math.tan(slopeANGLE * DEGtoRAD) * slopesensorDISTANCE) / 2);
dl = -dr;
} else {
dr = -Math.abs((Math.tan(slopeANGLE * DEGtoRAD) * slopesensorDISTANCE) / 2);
dl = -dr;
}
}
}
if ((((TOUCHground == true) && (TOUCHdigit == false)) || ((jumpspeedY < gspeedY) && (jumpspeedY > 0))) || ((jumpspeedY == 0) && (gspeedY > jumpTHRESHOLD))) {
oldTOUCHdigit = false;
} else {
oldTOUCHdigit = true;
}
totalspeed = Math.pow(Math.pow(speedX, 2) + Math.pow(speedY, 2), 0.5);
if ((Key.isDown(17) && ((camXSCALE + zoomINCREMENTmanual) <= zoomMAXmanual)) && ((camYSCALE + zoomINCREMENTmanual) <= zoomMAXmanual)) {
camXSCALE = camXSCALE + zoomINCREMENTmanual;
camYSCALE = camYSCALE + zoomINCREMENTmanual;
zoomMIN = zoomMIN + zoomINCREMENTmanual;
} else if ((Key.isDown(16) && ((camXSCALE - zoomINCREMENTmanual) >= zoomMINmanual)) && ((camYSCALE - zoomINCREMENTmanual) >= zoomMINmanual)) {
camXSCALE = camXSCALE - zoomINCREMENTmanual;
camYSCALE = camYSCALE - zoomINCREMENTmanual;
zoomMIN = zoomMIN - zoomINCREMENTmanual;
} else {
if (((((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) <= (camX - (camWIDTH / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX)) || ((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) >= (camX + (camWIDTH / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camXSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) <= (camY - (camHEIGHT / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) >= (camY + (camHEIGHT / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) {
camXSCALE = camXSCALE + zoomINCREMENT;
camYSCALE = camYSCALE + zoomINCREMENT;
} else if (((((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) >= (camX - (camWIDTH / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camYSCALE - zoomINCREMENT) >= zoomMIN)) || ((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) <= (camX + (camWIDTH / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camXSCALE - zoomINCREMENT) >= zoomMIN))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) >= (camY - (camHEIGHT / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camYSCALE - zoomINCREMENT) >= zoomMIN))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) <= (camY + (camHEIGHT / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camYSCALE - zoomINCREMENT) >= zoomMIN))) {
camXSCALE = camXSCALE - zoomINCREMENT;
camYSCALE = camYSCALE - zoomINCREMENT;
}
if (((((((!Key.isDown(16)) && (charX <= ((camX - (camWIDTH / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX)) || ((((!Key.isDown(16)) && (charX >= ((camX + (camWIDTH / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camXSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && (charY <= ((camY - (camHEIGHT / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && (charY >= ((camY + (camHEIGHT / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) {
camXSCALE = camXSCALE + zoomINCREMENT;
camYSCALE = camYSCALE + zoomINCREMENT;
zoomMIN = zoomMIN + zoomINCREMENTmanual;
}
}
if ((TOUCHwater == false) && (environmentchecker != "bellyslide")) {
camspeedX = ((charX + (speedX * ((camLOOSENESS + camMOVEXLEAD) / (worldXSCALE / 100)))) - camX) / (camLOOSENESS / (worldXSCALE / 100));
if ((Math.abs(speedX) >= moverate) || (Math.abs(speedY) >= moverate)) {
camX = camX + ((Math.abs(camspeedX) > 1) ? (camspeedX) : 0);
}
} else {
camspeedX = ((charX + (speedX * ((camLOOSENESS + camWATERXLEAD) / (worldXSCALE / 100)))) - camX) / (camLOOSENESS / (worldXSCALE / 100));
if ((Math.abs(speedX) >= moverate) || (Math.abs(speedY) >= moverate)) {
camX = camX + ((Math.abs(camspeedX) > 1) ? (camspeedX) : 0);
}
}
if (((TOUCHwater == false) && (Math.abs(speedY) < 10)) && (environmentchecker != "bellyslide")) {
camspeedY = ((charY + (speedY * ((camLOOSENESS + camMOVEYLEAD) / (worldYSCALE / 100)))) - camY) / (camLOOSENESS / (worldYSCALE / 100));
camY = camY + camspeedY;
} else {
camspeedY = ((charY + (speedY * ((camLOOSENESS + camWATERYLEAD) / (worldYSCALE / 100)))) - camY) / (camLOOSENESS / (worldYSCALE / 100));
camY = camY + camspeedY;
}
if (Math.abs(camX - charX) > ((camWIDTH * 3) / 8)) {
camX = charX + ((((camWIDTH * 3) / 8) * (camX - charX)) / Math.abs(camX - charX));
}
if (Math.abs(camY - charY) > ((camHEIGHT * 3) / 8)) {
camY = charY + ((((camHEIGHT * 3) / 8) * (camY - charY)) / Math.abs(camY - charY));
}
camWIDTH = (camWIDTHinit * camXSCALE) / 100;
camHEIGHT = (camHEIGHTinit * camYSCALE) / 100;
if (!Key.isDown(46)) {
scaleX = stageWIDTH / camWIDTH;
scaleY = stageHEIGHT / camHEIGHT;
worldX = stagehalfWIDTH - (camX * scaleX);
worldY = stagehalfHEIGHT - (camY * scaleY);
worldXSCALE = 100 * scaleX;
worldYSCALE = 100 * scaleY;
camROT = 0;
worldROT = -camROT;
}
frameloops++;
}
Player1._x = charX;
Player1._y = charY;
Player1._rotation = charROT;
Player1.sensor._x = charsensorX;
Player1.sensor._y = charsensorY;
Player1.sensor._width = charsensorWIDTH;
Player1.sensor._height = charsensorHEIGHT;
if (faceX > 0) {
Player1._xscale = 100;
} else if (faceX < 0) {
Player1._xscale = -100;
}
camera._x = camX;
camera._y = camY;
camera._rotation = camROT;
camera._xscale = camXSCALE;
camera._yscale = camYSCALE;
camera._width = camWIDTH;
camera._height = camHEIGHT;
_x = worldX;
_y = worldY;
_rotation = worldROT;
_xscale = worldXSCALE;
_yscale = worldYSCALE;
}
Frame 30
if (_root.go != true) {
gotoAndStop (29);
} else {
_root.go = false;
}
Frame 31
_root.cutscene2 = false;
Mouse.show();
stopAllSounds();
_root.soundManager_mc.playSound("BreakfastEnding.wav", 0, 9999999999);
_root.died = false;
_root.levelCOMPLETE = getTimer() / 1000;
_root.levelTIME = Math.round(((_root.levelCOMPLETE + _root.levelDEADTIME) - (_root.levelSTART + _root.pauseTIME)) * 10000) / 10000;
_root.levelDEADTIME = 0;
_root.levelTIMESTR = _root.levelTIME + " sec";
_root.pointratio = Math.round((_root.player1points / _root.totalpoints) * 10000) / 100;
_root.gameTIME = _root.gameTIME + _root.levelTIME;
_root.GAMEplayer1points = _root.GAMEplayer1points + _root.player1points;
_root.gamedeaths = _root.gamedeaths + _root.leveldeaths;
if (_root.cheats != true) {
_root.topdeaths.text = "---";
if (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] != undefined) {
_root.topdeaths.text = _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"];
}
if ((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] == undefined) || (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] > _root.leveldeaths)) {
_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] = _root.leveldeaths;
} else {
_root.newdeathsrecord.text = "";
}
_root.toptime.text = "---";
if (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] != undefined) {
_root.toptime.text = _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"];
}
if ((((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] == undefined) && (_root.leveldeaths <= _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"])) || ((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] > _root.levelTIME) && (_root.leveldeaths <= _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"]))) || (_root.newdeathsrecord.text != "")) {
_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] = _root.levelTIME;
} else {
_root.newtimerecord.text = "";
}
_root.leveldeaths = 0;
_root.toppoints.text = "---";
_root.topratio.text = "---";
if (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] != undefined) {
_root.toppoints.text = _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"];
_root.topratio.text = Math.round((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] / _root.totalpoints) * 10000) / 100;
}
if ((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] == undefined) || (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] < _root.player1points)) {
_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] = _root.player1points;
} else {
_root.newcoinrecord.text = "";
_root.newratiorecord.text = "";
}
_root.savedData.data[("LVL" + _root.level.substr(6)) + "totalpoints"] = _root.totalpoints;
if (_root.savedData.data.levelMAX == 3) {
_root.savedData.data.levelMAX = 4;
}
_root.savedData.flush();
}
if (_root.stattracking == true) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl3complete");
if (_root.pointratio >= 100) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl3coins100percent");
} else if (_root.pointratio >= 50) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl3coins050percent");
}
}
stop();
Instance of Symbol 240 MovieClip in Frame 31
onClipEvent (load) {
this.textvalue = "Menu";
this.linkvalue = "Game Start";
this.gotoAndStop("Menu");
}
Frame 32
if (_root.go != true) {
gotoAndStop (31);
} else {
_root.go = false;
}
Frame 33
Mouse.show();
stopAllSounds();
_root.level = "Level 2";
_root.kRIGHT = _root.kRIGHTconfig;
_root.kLEFT = _root.kLEFTconfig;
_root.kUP = _root.kUPconfig;
_root.kDOWN = _root.kDOWNconfig;
_root.kJUMP = _root.kJUMPconfig;
_root.kTHROW = _root.kTHROWconfig;
_root.kPAUSE = _root.kPAUSEconfig;
_root.kSTART = _root.kSTARTconfig;
_root.pauseTIME = 0;
if (_root.died == true) {
_root.leveldeaths = _root.leveldeaths + 1;
}
if (_root.stattracking == true) {
if (_root.died == false) {
StatTracker.submitStat("/flashgames/breakfastclub/level4start");
} else {
StatTracker.submitStat("/flashgames/breakfastclub/level4died");
}
}
stop();
Frame 34
if (_root.go != true) {
gotoAndStop (33);
} else {
_root.go = false;
}
Frame 35
stopAllSounds();
_root.soundManager_mc.playSound("BreakfastInGame2.wav", 0, 9999999999);
if ((_root.savedData.data.levelMAX > 4) && (_root.stattracking == true)) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl4replay");
}
onMouseMove = function () {
mouseTIMERstart = getTimer() / 1000;
Mouse.show();
};
onEnterFrame = function () {
_root.timechecker();
mouseTIMER = (getTimer() / 1000) - mouseTIMERstart;
if (mouseTIMER >= mouseTIMERMAX) {
Mouse.hide();
}
};
_root.attachDEPTH = _root.GAMEattachDEPTH;
_root.WorldString = undefined;
if (_root.WorldString != undefined) {
SoftCOLOR = 65535;
SoftALPHA = 50;
TiledCOLOR = 16711935 /* 0xFF00FF */;
TiledALPHA = 50;
HardCOLOR = 16711680 /* 0xFF0000 */;
HardALPHA = 50;
WaterCOLOR = 255;
WaterALPHA = 50;
SpringCOLOR = 16776960 /* 0xFFFF00 */;
SpringALPHA = 50;
_root.World.createEmptyMovieClip("SoftBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.SoftBoundary.objects = 0;
_root.WorldArray[0] = [];
_root.World.createEmptyMovieClip("TiledBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.TiledBoundary.objects = 0;
_root.WorldArray[1] = [];
_root.World.createEmptyMovieClip("HardBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.SoftBoundary.objects = 0;
_root.WorldArray[2] = [];
_root.World.createEmptyMovieClip("WaterBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.WaterBoundary.objects = 0;
_root.WorldArray[3] = [];
_root.World.createEmptyMovieClip("SpringBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.SpringBoundary.objects = 0;
_root.WorldArray[4] = [];
_root.World.createEmptyMovieClip("Art", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.Art.objects = 0;
_root.WorldArray[5] = [];
_root.WorldArray = _root.WorldString.split(">>>>");
boundaryelements = 0;
while (boundaryelements < _root.WorldArray.length) {
_root.WorldArray[boundaryelements] = _root.WorldArray[boundaryelements].split("|");
objectelements = 0;
while (objectelements < _root.WorldArray[boundaryelements].length) {
_root.WorldArray[boundaryelements][objectelements] = _root.WorldArray[boundaryelements][objectelements].split("/");
anchorelements = 0;
while (anchorelements < _root.WorldArray[boundaryelements][objectelements].length) {
_root.WorldArray[boundaryelements][objectelements][anchorelements] = _root.WorldArray[boundaryelements][objectelements][anchorelements].split(",");
anchorelements++;
}
objectelements++;
}
boundaryelements++;
}
boundaryload = 0;
while (boundaryload < _root.WorldArray.length) {
if (boundaryload == 0) {
boundary = "Soft";
boundaryCOLOR = _root.SoftCOLOR;
boundaryALPHA = _root.SoftALPHA;
} else if (boundaryload == 1) {
boundary = "Tile";
boundaryCOLOR = _root.TileCOLOR;
boundaryALPHA = _root.TileALPHA;
} else if (boundaryload == 2) {
boundary = "Hard";
boundaryCOLOR = _root.HardCOLOR;
boundaryALPHA = _root.HardALPHA;
} else if (boundaryload == 3) {
boundary = "Water";
boundaryCOLOR = _root.WaterCOLOR;
boundaryALPHA = _root.WaterALPHA;
} else if (boundaryload == 4) {
boundary = "Spring";
boundaryCOLOR = _root.SpringCOLOR;
boundaryALPHA = _root.SpringALPHA;
} else if (boundaryload == 5) {
boundary = "Art";
boundaryCOLOR = _root.ArtCOLOR;
boundaryALPHA = _root.ArtALPHA;
}
_root.World.createEmptyMovieClip(boundary + "Boundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
objectload = 0;
while (objectload < _root.WorldArray[boundaryload].length) {
_root.World[boundary + "Boundary"].objects = objectload + 1;
_root.World[boundary + "Boundary"].createEmptyMovieClip("Object" + (objectload + 1), _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
anchorload = 0;
while (anchorload < _root.WorldArray[boundaryload][objectload].length) {
if ((anchorload == 0) && (_root.WorldArray[boundaryload][objectload][anchorload][0] != "Art")) {
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].lineStyle(1, 0, 100);
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].beginFill(boundaryCOLOR, boundaryALPHA);
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].moveTo(_root.WorldArray[boundaryload][objectload][anchorload][1], _root.WorldArray[boundaryload][objectload][anchorload][2]);
} else if (_root.WorldArray[boundaryload][objectload][anchorload][0] != "Art") {
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].lineTo(_root.WorldArray[boundaryload][objectload][anchorload][1], _root.WorldArray[boundaryload][objectload][anchorload][2]);
} else if (_root.WorldArray[boundaryload][objectload][anchorload][0] == "Art") {
anchorload++;
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].removeMovieClip();
_root.World[boundary + "Boundary"].attachMovie(_root.WorldArray[boundaryload][objectload][anchorload][0], _root.WorldArray[boundaryload][objectload][anchorload][0] + (objectload + 1), _root.attachDEPTH, {_x:_root.WorldArray[boundaryload][objectload][anchorload][1], _y:_root.WorldArray[boundaryload][objectload][anchorload][2]});
break;
}
anchorload++;
}
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].endFill();
objectload++;
}
boundaryload++;
}
}
stop();
Instance of Symbol 659 MovieClip "World" in Frame 35
onClipEvent (load) {
_name = "World";
framerateDEFAULT = 24;
framerateMAX = 120;
framerateMIN = 12;
DEGtoRAD = (Math.PI/180);
bubbleDEPTH = 1000;
this.bottomlesspit = 5000;
this.Player1.points = 0;
this.points = 0;
this.badguyDISTANCEMAX = 150;
this.bomberCHANCE = 432;
this.bombers = 0;
this.Goombas = 0;
this.KoopaTroopas = 0;
this.AttackDogs = 0;
this.Barrels = 0;
this.BarrelsFilled = 0;
digitMODE = "constant";
charALIVE = true;
charBLINK = true;
charBLINKTIME = 1;
charBLINKTIMER = 0;
Player1.rocksloaded = 0;
Player1.rocksthrown = 0;
Player1.rocksloadedMAX = 3;
rocksMAX = 6;
dHEIGHT = 0.5;
uHEIGHT = 0.5;
rWIDTH = 0.5;
rHEIGHT = 0;
urWIDTH = 0.3;
urHEIGHT = 0.25;
lWIDTH = 0.5;
lHEIGHT = 0;
ulWIDTH = 0.3;
ulHEIGHT = 0.25;
offsetX = 0;
offsetY = 0;
charACTION = true;
initWIDTH = Player1.sensor._width;
initHEIGHT = Player1.sensor._height;
initHYP = Math.sqrt(Math.pow(initWIDTH, 2) + Math.pow(initHEIGHT, 2));
initANGLE1 = Math.asin(initHEIGHT / initHYP);
initANGLE2 = Math.asin(initWIDTH / initHYP);
slopesensorRATIO = 3;
floorpushes = 100;
speedXMAX = 25;
speedYMAX = 25;
speedMAXdivisor = 1;
speedXMIN = 0.05;
speedYMIN = 0.05;
slidespeedMIN = 0.05;
jumpTHRESHOLD = 2;
airjumpsMAX = 1;
duckjumpRATIO = 2;
throwTIME = 2.5;
throwANGLEup = 65;
throwANGLEforward = 75;
throwANGLEdown = 120;
nosedivebounceTIME = 0.25;
swimcollideMAX = 7;
duckpaddleFALLSPEED = 7.5;
duckpaddleRATIO = 3;
faceX = 1;
faceY = 1;
digitARCLENGTH = 22.5;
engineloops = 4;
speedmultiUNIVERSAL = 1;
speedmultiX = speedmultiUNIVERSAL;
speedmultiY = speedmultiUNIVERSAL;
speedmultiROT = speedmultiUNIVERSAL;
movedragX = 1.175;
movedragY = 1.175;
slidedragX = 1.01;
slidedragY = 1.01;
waterdragX = 2.5;
waterdragY = 2.5;
swimdragX = 1.004;
swimdragY = 1.004;
watergroundfriction = 1.05;
throwdrag = 2.5;
swimspindrag = 1.1;
airspindrag = 1.1;
windrateX = 0 * speedmultiX;
windrateY = 0 * speedmultiY;
watercurrentrateX = 0 * speedmultiX;
watercurrentrateY = 0 * speedmultiY;
gravityrateX = 0 * speedmultiX;
gravityrateY = 0.25 * speedmultiY;
gspeedX = 0 * speedmultiX;
gspeedY = 0 * speedmultiY;
windX = 0 * speedmultiX;
windY = 0 * speedmultiY;
windspeedX = 0 * speedmultiX;
windspeedY = 0 * speedmultiY;
environment = "falling";
environmentchecker = "air";
moverate = 0.6 * speedmultiUNIVERSAL;
sliderate = 0.75 * speedmultiUNIVERSAL;
sliderampBOOST = 0.8 * speedmultiUNIVERSAL;
sliderampTHRESHOLD = 13;
swimspeedMAXTRANSFER = 15 * speedmultiUNIVERSAL;
jumprateX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
jumprateY = (40 * gravityrateY) / Math.sqrt(speedmultiY);
walljumpTIME = 20;
nosedivejumprateX = jumprateX * 1.4;
nosedivejumprateY = jumprateY * 1.4;
springrateX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
springrateY = (50 * gravityrateY) / Math.sqrt(speedmultiY);
nosediveBOUNCEXrate = 0.5;
nosediveBOUNCEYrate = (24 * gravityrateY) / Math.sqrt(speedmultiY);
nosediveBOUNCEspinrate = 17 * speedmultiROT;
swimrateX = (1 * gravityrateY) / Math.sqrt(speedmultiY);
swimrateY = (1 * gravityrateY) / Math.sqrt(speedmultiY);
throwrate = (40 * gravityrateY) / Math.sqrt(speedmultiY);
swimspinrate = 0.5 * speedmultiROT;
airspinrate = 0.75 * speedmultiROT;
watergroundboostX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
watergroundboostY = (0 * gravityrateY) / Math.sqrt(speedmultiY);
moveX = 0 * speedmultiX;
moveY = 0 * speedmultiY;
movespeedX = 0 * speedmultiX;
movespeedY = 0 * speedmultiY;
jumpX = 0 * speedmultiX;
jumpY = 0 * speedmultiY;
walljumpTIMER = 0;
airjumpCOUNT = 0;
jumpspeedX = 0 * speedmultiX;
jumpspeedY = 0 * speedmultiY;
swimX = 0 * speedmultiX;
swimY = 0 * speedmultiY;
swimX2 = 0 * speedmultiX;
swimY2 = 0 * speedmultiY;
swimI = 0 * speedmultiUNIVERSAL;
swimspeedX = 0 * speedmultiX;
swimspeedY = 0 * speedmultiY;
speedX = 0 * speedmultiX;
speedY = 0 * speedmultiY;
swimspin = 0 * speedmultiROT;
swimspinspeed = 0 * speedmultiROT;
airspin = 0 * speedmultiROT;
airspinspeed = 0 * speedmultiROT;
camera._visible = false;
stagehalfWIDTH = 275;
stagehalfHEIGHT = 200;
stageWIDTH = 550;
stageHEIGHT = 400;
camLOOSENESS = 50;
camMOVEXLEAD = 30;
camMOVEYLEAD = -30;
camWATERXLEAD = 5;
camWATERYLEAD = 5;
zoomMIN = 125;
zoomMAX = 250;
zoomMINmanual = zoomMIN;
zoomMAXmanual = zoomMAX;
camera._xscale = zoomMIN;
camera._yscale = zoomMIN;
zoomINCREMENT = 0.25 * speedmultiX;
zoomINCREMENTmanual = 1;
zoomLEAD = 90;
safezoneDISTANCE = 100;
startTime = getTimer();
numFrames = 0;
recentSetting = 5;
recentNumFrames = 0;
recentStartTime = startTime;
charX = Player1._x;
charY = Player1._y;
charROT = Player1._rotation;
charsensorX = Player1.sensor._x;
charsensorY = Player1.sensor._y;
charsensorWIDTH = Player1.sensor._width;
charsensorHEIGHT = Player1.sensor._height;
camX = camera._x;
camY = camera._y;
camROT = camera._rotation;
camXSCALE = camera._xscale;
camYSCALE = camera._yscale;
camWIDTHinit = camera._width;
camHEIGHTinit = camera._height;
camWIDTH = camera._width;
camHEIGHT = camera._height;
worldX = _x;
worldY = _y;
worldROT = _rotation;
worldXSCALE = _xscale;
worldYSCALE = _yscale;
}
onClipEvent (enterFrame) {
_root.player1points = this.Player1.points;
_root.totalpoints = this.points;
numFrames++;
now = getTimer();
elapsedSeconds = (now - startTime) / 1000;
actualFPS = numFrames / elapsedSeconds;
recentNumFrames++;
if (recentNumFrames == recentSetting) {
recentElapsedSeconds = (now - recentStartTime) / 1000;
recentFPSoutput = recentNumFrames / recentElapsedSeconds;
recentStartTime = now;
recentNumFrames = 0;
}
if (((recentFPSoutput >= framerateMIN) && (recentFPSoutput <= framerateMAX)) && (elapsedSeconds >= 1)) {
engineloops = framerateMAX / Math.ceil(recentFPSoutput);
} else if (elapsedSeconds < 1) {
engineloops = framerateMAX / framerateDEFAULT;
}
if ((Key.isDown(_root.kPAUSE) && (_root.PAUSE == false)) && (this.pausearmed == true)) {
_root.PAUSE = true;
this.pausearmed = false;
_root.pauseSTART = getTimer() / 1000;
} else if (((Key.isDown(_root.kPAUSE) && (_root.PAUSE == true)) && (this.pausearmed == true)) && (_root.textbubble == undefined)) {
_root.PAUSE = false;
this.pausearmed = false;
_root.pauseEND = getTimer() / 1000;
_root.pauseTIME = _root.pauseTIME + (_root.pauseEND - _root.pauseSTART);
}
if (!Key.isDown(_root.kPAUSE)) {
this.pausearmed = true;
}
if (_root.PAUSE == true) {
engineloops = 0;
}
worldXinit = _x;
worldYinit = _y;
worldROTinit = _rotation;
worldXSCALEinit = _xscale;
worldYSCALEinit = _yscale;
if (charALIVE == false) {
_root.kRIGHT = undefined;
_root.kLEFT = undefined;
_root.kUP = undefined;
_root.kDOWN = undefined;
_root.kJUMP = undefined;
_root.kTHROW = undefined;
_root.died = true;
_root.levelselect = false;
}
if ((charBLINK == true) && (charBLINKTIMER < charBLINKTIME)) {
if (Player1._visible == true) {
Player1._visible = false;
} else {
Player1._visible = true;
}
charBLINKTIMER = charBLINKTIMER + ((1 / this.framerateMAX) * this.engineloops);
} else {
Player1._visible = true;
charBLINKTIMER = 0;
charBLINK = false;
}
if ((random(bomberCHANCE) == 0) && (_root.PAUSE == false)) {
if (random(2) == 0) {
bomberDIRX = 1;
} else {
bomberDIRX = -1;
}
bomberDIRY = -1;
bombers = bombers + 1;
this.attachMovie("Bomber 1", "Bomber" + bombers, _root.attachDEPTH, {_x:this.camera._x + (((this.camera._width / 2) + this.badguyDISTANCEMAX) * bomberDIRX), _y:this.camera._y + (random(this.camera._width / 2) * bomberDIRY), flyDIR:bomberDIRX});
_root.attachDEPTH = _root.attachDEPTH + 1;
}
frameloops = 1;
while (frameloops <= engineloops) {
if (environmentchecker != "bellyslide") {
charWIDTH = Math.abs(Math.cos(initANGLE1 - ((Math.abs(charROT) + 180) * DEGtoRAD)) * initHYP);
charHEIGHT = Math.abs(Math.cos(initANGLE2 - ((Math.abs(charROT) + 180) * DEGtoRAD)) * initHYP);
} else {
charWIDTH = initWIDTH;
charHEIGHT = initWIDTH;
}
slopesensorDISTANCE = charWIDTH / slopesensorRATIO;
if (((speedY >= 0) && (SoftBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true))) || ((speedY >= 0) && (HardBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)))) {
TOUCHground = true;
if (((speedY >= 0) && (SoftBoundary.DigitBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true))) || ((speedY >= 0) && (HardBoundary.DigitBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)))) {
TOUCHdigit = true;
} else {
TOUCHdigit = false;
}
} else {
TOUCHground = false;
TOUCHdigit = false;
}
if (HardBoundary.hitTest((((((charsensorX + charX) + offsetX) + (charWIDTH * 0.5)) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.25)) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHwallright = true;
} else {
TOUCHwallright = false;
}
if (HardBoundary.hitTest((((((charsensorX + charX) + offsetX) - (charWIDTH * 0.5)) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.25)) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHwallleft = true;
} else {
TOUCHwallleft = false;
}
if (HardBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) - (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHceiling = true;
} else {
TOUCHceiling = false;
}
if (Water.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, ((((charsensorY + charY) + offsetY) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHwater = true;
} else {
TOUCHwater = false;
}
if (Spring.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true) && (speedY >= 0)) {
TOUCHspring = true;
} else {
TOUCHspring = false;
}
if (charY > bottomlesspit) {
charALIVE = false;
}
if (((_root.World.charBLINK == false) && (_root.DeathBoundaryPresent == true)) && (this.DeathBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, ((((charsensorY + charY) + offsetY) * worldYSCALEinit) / 100) + worldYinit, true))) {
if (this.Player1.rocksloaded > 0) {
this.throwANGLEdamaged = random(90) - 45;
this.throwratedamaged = 8;
this.Player1.rocksthrown = this.Player1.rocksthrown + 1;
this.attachMovie("Rock 1", "rock" + this.Player1.rocksthrown, 100 + this.Player1.rocksthrown, {_x:this.charsensorX + this.charX, _y:(this.charsensorY + this.charY) - ((this.charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEdamaged * DEGtoRAD) * throwratedamaged) * this.faceX) + this.speedX, throwspeedY:(Math.cos(throwANGLEdamaged * DEGtoRAD) * throwratedamaged) - this.speedY, weapon:false});
this.oldrock = this.Player1.rocksthrown - this.rocksMAX;
this["rock" + this.oldrock].removeMovieClip();
this.Player1.rocksloaded = this.Player1.rocksloaded - 1;
this.charBLINK = true;
_root.soundManager_mc.playSound("jump2.wav", 0, 1);
} else {
this.charALIVE = false;
}
}
if ((((environmentchecker == "air") && (TOUCHwater == true)) && (Math.abs(speedY) < duckpaddleFALLSPEED)) || (environment == "duckpaddle")) {
environment = "duckpaddle";
} else if (((((TOUCHwater == true) && (TOUCHground == true)) || ((TOUCHwater == true) && (TOUCHceiling == true))) || ((TOUCHwater == true) && (TOUCHwallleft == true))) || ((TOUCHwater == true) && (TOUCHwallright == true))) {
environment = "watergrounded";
} else if ((TOUCHwater == true) && (speedY < 0)) {
environment = "swimmingupward";
} else if (((TOUCHwater == true) && (TOUCHground == false)) && (speedY >= 0)) {
environment = "swimmingdownward";
} else if ((TOUCHspring == true) && (speedY >= 0)) {
environment = "sprung";
} else if ((TOUCHground == true) && (speedY >= 0)) {
environment = "grounded";
} else if (speedY < 0) {
environment = "flying";
} else if (((((TOUCHwallright == true) && (Key.isDown(_root.kRIGHT))) && (TOUCHground == false)) && (speedY >= 0)) || ((((TOUCHwallleft == true) && Key.isDown(_root.kLEFT)) && (TOUCHground == false)) && (speedY >= 0))) {
environment = "wallslide";
} else if ((TOUCHground == false) && (speedY >= 0)) {
environment = "falling";
}
if (((Player1.rocksloaded > 0) && (throwarmed == true)) && (Key.isDown(_root.kTHROW))) {
_root.soundManager_mc.stopSound("throw 1", 0, 1);
_root.soundManager_mc.playSound("throw 1", 0, 1);
Player1.rocksthrown = Player1.rocksthrown + 1;
if (environment != "wallslide") {
if (Key.isDown(_root.kUP)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:charsensorX + charX, _y:(charsensorY + charY) - ((charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEup * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEup * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else if (Key.isDown(_root.kDOWN)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * faceX), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEdown * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEdown * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * faceX), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEforward * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEforward * DEGtoRAD) * throwrate) - speedY, weapon:true});
}
} else if (Key.isDown(_root.kUP)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:charsensorX + charX, _y:(charsensorY + charY) - ((charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEup * DEGtoRAD) * throwrate) * (-faceX)) + speedX, throwspeedY:(Math.cos(throwANGLEup * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else if (Key.isDown(_root.kDOWN)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * (-faceX)), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEdown * DEGtoRAD) * throwrate) * (-faceX)) + speedX, throwspeedY:(Math.cos(throwANGLEdown * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * (-faceX)), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEforward * DEGtoRAD) * throwrate) * (-faceX)) + speedX, throwspeedY:(Math.cos(throwANGLEforward * DEGtoRAD) * throwrate) - speedY, weapon:true});
}
oldrock = Player1.rocksthrown - this.rocksMAX;
this["rock" + oldrock].removeMovieClip();
Player1.rocksloaded = Player1.rocksloaded - 1;
throwarmed = false;
} else if (!Key.isDown(_root.kTHROW)) {
throwarmed = true;
} else {
throwarmed = false;
}
if (environment == "grounded") {
if ((environmentchecker != "bellyslide") && (environmentchecker != "nosedivebounce")) {
movementhyp = moverate / Math.pow(Math.pow(dr - dl, 2) + Math.pow(slopesensorDISTANCE, 2), 0.5);
if (Key.isDown(_root.kRIGHT) && (TOUCHwallright == false)) {
moveX = movementhyp * slopesensorDISTANCE;
moveY = movementhyp * (-Math.abs(dr - dl));
faceX = 1;
} else if (Key.isDown(_root.kLEFT) && (TOUCHwallleft == false)) {
moveX = movementhyp * (-slopesensorDISTANCE);
moveY = movementhyp * (-Math.abs(dr - dl));
faceX = -1;
} else {
moveX = 0;
moveY = 0;
}
}
if (Key.isDown(_root.kJUMP) && (jumparmed == true)) {
jumpX = 0;
jumpY = jumprateY;
gspeedX = 0;
gspeedY = 0;
moveY = 0;
movespeedY = 0;
jumparmed = false;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
} else if ((environment == "wallslide") || (environmentchecker == "wallsliding")) {
if (Key.isDown(_root.kRIGHT)) {
faceX = 1;
} else if (Key.isDown(_root.kLEFT)) {
faceX = -1;
}
if (Key.isDown(_root.kJUMP) && (jumparmed == true)) {
jumpX = 0;
jumpY = jumprateY * 1.2;
gspeedX = 0;
gspeedY = 0;
if (Key.isDown(_root.kRIGHT)) {
moveX = -moverate;
} else if (Key.isDown(_root.kLEFT)) {
moveX = moverate;
}
moveY = 0;
movespeedY = 0;
jumparmed = false;
walljumpTIMER = walljumpTIME;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
} else if ((environment == "flying") || (environment == "falling")) {
if (walljumpTIMER <= 0) {
if (environmentchecker != "bellyslide") {
if (Key.isDown(_root.kRIGHT) && (TOUCHwallright == false)) {
moveX = moverate;
faceX = 1;
} else if (Key.isDown(_root.kLEFT) && (TOUCHwallleft == false)) {
moveX = -moverate;
faceX = -1;
} else {
moveX = 0;
}
} else {
moveX = 0;
}
walljumpTIMER = 0;
} else {
walljumpTIMER = walljumpTIMER - 1;
}
if (((Key.isDown(_root.kJUMP) && (jumparmed == true)) && (airjumpCOUNT > 0)) && (walljumpTIMER <= 0)) {
jumpspeedX = 0;
jumpspeedY = jumprateY;
gspeedX = 0;
gspeedY = 0;
moveY = 0;
movespeedY = 0;
jumparmed = false;
airjumpCOUNT = airjumpCOUNT - 1;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
if (environmentchecker == "ground") {
jumpassists = 0;
}
if (((((((jumpassists == 0) && (Key.isDown(_root.kJUMP))) && (gspeedY <= jumpTHRESHOLD)) && ((dr + dl) > -2)) && (walljumpTIMER <= 0)) && (TOUCHwallleft == false)) && (TOUCHwallright == false)) {
airjumpCOUNT = airjumpsMAX;
jumpassists = jumpassists + 1;
}
} else if ((((environment == "duckpaddle") || (environment == "swimmingupward")) || (environment == "swimmingdownward")) || (environment == "watergrounded")) {
if ((Key.isDown(_root.kRIGHT) && (Key.isDown(_root.kUP))) && (environment != "duckpaddle")) {
if ((charROT > -135) && (charROT <= 45)) {
if ((45 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-135 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((45 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-135 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if (Key.isDown(_root.kRIGHT) && (Key.isDown(_root.kDOWN))) {
if ((charROT > -45) && (charROT <= 135)) {
if ((135 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-45 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((135 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-45 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((Key.isDown(_root.kLEFT) && (Key.isDown(_root.kUP))) && (environment != "duckpaddle")) {
if ((charROT >= -45) && (charROT < 135)) {
if ((-45 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (135 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((-45 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (135 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kLEFT) && (Key.isDown(_root.kDOWN))) {
if ((charROT >= -135) && (charROT < 45)) {
if ((-135 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (45 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((-135 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (45 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kRIGHT)) {
if (environment == "duckpaddle") {
faceX = 1;
} else if ((charROT >= -90) && (charROT < 90)) {
if ((90 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-90 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((90 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-90 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if (Key.isDown(_root.kLEFT)) {
if (environment == "duckpaddle") {
faceX = -1;
} else if ((charROT > -90) && (charROT <= 90)) {
if ((90 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (-90 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((90 > (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (-90 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kUP) && (environment != "duckpaddle")) {
if (faceX > 0) {
if ((0 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-180 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 0;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((0 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (180 > (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 0;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kDOWN)) {
if (environment == "duckpaddle") {
swimX2 = swimX2 / duckpaddleRATIO;
swimY2 = swimY2 / duckpaddleRATIO;
environment = "swimmingdownward";
}
if (faceX < 0) {
if ((0 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (-180 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 180;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((0 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (180 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 180;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else {
swimspin = 0;
}
if ((swimspeedX > 0) && (environment != "duckpaddle")) {
faceX = 1;
} else if ((swimspeedX < 0) && (environment != "duckpaddle")) {
faceX = -1;
}
if (Key.isDown(_root.kJUMP) && (swimarmed == true)) {
if ((Key.isDown(_root.kUP) && (environment == "duckpaddle")) && (duckjumparmed == true)) {
while (Water.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((charY + offsetY) * worldYSCALEinit) / 100) + worldYinit, true)) {
charY = charY - 1;
}
jumpX = jumprateX;
jumpY = jumprateY;
environment = "duckjump";
environmentchecker = "duckjump";
duckjumparmed = false;
swimarmed = false;
} else if ((((environment == "duckpaddle") && (speedX == 0)) || (((environment == "duckpaddle") && (speedX > 0)) && (TOUCHwallright == false))) || (((environment == "duckpaddle") && (speedX < 0)) && (TOUCHwallleft == false))) {
if (((speedY == 0) || ((speedY > 0) && (TOUCHground == false))) || ((speedY < 0) && (TOUCHceiling == false))) {
swimX = swimrateX / duckpaddleRATIO;
swimY = swimrateY / duckpaddleRATIO;
swimarmed = false;
}
} else if (((speedX == 0) || ((speedX > 0) && (TOUCHwallright == false))) || ((speedX < 0) && (TOUCHwallleft == false))) {
if (((speedY == 0) || ((speedY > 0) && (TOUCHground == false))) || ((speedY < 0) && (TOUCHceiling == false))) {
swimX = swimrateX;
swimY = swimrateY;
swimarmed = false;
}
}
} else {
swimX = 0;
swimY = 0;
}
if (!Key.isDown(_root.kJUMP)) {
swimarmed = true;
duckjumparmed = true;
}
}
if (environment == "duckpaddle") {
charROT = 90 * faceX;
if (airspinspeed != 0) {
swimspinspeed = swimspinspeed + airspinspeed;
airspinspeed = 0;
}
airspin = 0;
if ((charROT > 100) || (charROT < -100)) {
if ((environmentchecker != "water") && (environmentchecker != "duckpaddle")) {
swimI = swimI + (Math.abs(movespeedX) / 3);
}
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
gspeedX = 0;
gspeedY = 0;
gravityX = 0;
gravityY = 0;
windX = watercurrentrateX;
windY = 0;
if ((environmentchecker != "water") && (environmentchecker != "duckpaddle")) {
swimY = 0;
swimY2 = 0;
}
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
environmentchecker = "duckpaddle";
} else if ((environment == "swimmingupward") || (environment == "swimmingdownward")) {
if (airspinspeed != 0) {
swimspinspeed = swimspinspeed + airspinspeed;
airspinspeed = 0;
}
airspin = 0;
if ((charROT > 100) || (charROT < -100)) {
if (environmentchecker != "water") {
swimI = swimI + ((Math.abs(movespeedX) / 3) + (gspeedY / 3));
gspeedY = 0;
}
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = gravityrateX;
gravityY = gravityrateY;
windX = watercurrentrateX;
windY = watercurrentrateY;
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
swimY2 = swimY2 / swimdragY;
swimI = swimI / swimdragY;
gspeedX = gspeedX / waterdragX;
gspeedY = gspeedY / waterdragY;
environmentchecker = "water";
} else if (environment == "watergrounded") {
if (((Math.abs(swimX2) >= swimcollideMAX) || (Math.abs(swimY2) >= swimcollideMAX)) || (Math.abs(swimI) >= swimcollideMAX)) {
swimX2 = Math.min(swimX2, swimcollideMAX);
swimY2 = Math.min(swimY2, swimcollideMAX);
swimI = Math.min(swimI, swimcollideMAX);
} else if (((Math.abs(swimX2) >= 0.25) || (Math.abs(swimY2) >= 0.25)) || (Math.abs(swimI) >= 0.25)) {
swimX2 = swimX2 / watergroundfriction;
swimY2 = swimY2 / watergroundfriction;
swimI = swimI / watergroundfriction;
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
windX = 0;
windY = 0;
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
swimY2 = swimY2 / swimdragY;
movespeedX = movespeedX / waterdragX;
movespeedY = movespeedY / waterdragY;
environmentchecker = "waterground";
} else if ((environment == "flying") || (environment == "falling")) {
charROT = 0;
if ((dr == -1) && (dl == -1)) {
moveY = 0;
movespeedY = 0;
}
if (swimspinspeed != 0) {
airspinspeed = airspinspeed + swimspinspeed;
swimspinspeed = 0;
}
swimspin = 0;
if (((swimX2 != 0) || (swimY2 != 0)) || (swimI != 0)) {
if (environmentchecker == "duckjump") {
swimX2 = swimX2 / duckjumpRATIO;
swimI = swimI / duckjumpRATIO;
}
jumpspeedX = jumpspeedX + (Math.sin(charROT * DEGtoRAD) * swimX2);
if (environmentchecker != "duckjump") {
jumpspeedY = jumpspeedY + Math.min(Math.cos(charROT * DEGtoRAD) * (swimX2 + swimI), swimspeedMAXTRANSFER);
}
}
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
gravityX = gravityrateX;
gravityY = gravityrateY;
windX = windrateX;
windY = windrateY;
if (environment == "flying") {
jumpX = 0;
jumpY = 0;
}
airspinspeed = airspinspeed / airspindrag;
if (environmentchecker != "bellyslide") {
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
} else {
movespeedX = movespeedX / slidedragX;
movespeedY = movespeedY / slidedragY;
}
if (environmentchecker == "nosedivebounce") {
airspin = 0;
if (Math.abs(charROT) < 5) {
charROT = 0;
environmentchecker = ((gspeedY > (jumpspeedY * 2)) ? "air" : "nosedivebounce");
}
}
if (((((environmentchecker == "water") && (Key.isDown(_root.kRIGHT))) && (!Key.isDown(_root.kUP))) && (!Key.isDown(_root.kDOWN))) || ((((environmentchecker == "water") && (Key.isDown(_root.kLEFT))) && (!Key.isDown(_root.kUP))) && (!Key.isDown(_root.kDOWN)))) {
environmentchecker = "porpoising";
} else if (((environmentchecker != "porpoising") && (environmentchecker != "bellyslide")) && (environmentchecker != "nosedivebounce")) {
environmentchecker = "air";
}
} else if (environment == "wallslide") {
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 1;
swimspin = 0;
swimspinspeed = 0;
airspin = 0;
airspinspeed = 0;
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
environmentchecker = "wallsliding";
} else if (environment == "grounded") {
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
swimspin = 0;
swimspinspeed = 0;
airspin = 0;
airspinspeed = 0;
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
if (environmentchecker != "bellyslide") {
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
bellyslideTIME = 0;
} else {
if ((dr - dl) != 0) {
moveX = (((sliderate * slopesensorDISTANCE) / Math.sqrt(Math.pow(dl - dr, 2) + Math.pow(slopesensorDISTANCE, 2))) * (dl - dr)) / Math.abs(dl - dr);
moveY = (sliderate * (-Math.abs(dr - dl))) / Math.sqrt(Math.pow(dr - dl, 2) + Math.pow(slopesensorDISTANCE, 2));
} else {
moveX = 0;
moveY = 0;
}
movespeedX = movespeedX / slidedragX;
movespeedY = movespeedY / slidedragY;
}
if (((((charROT < 89) && (charROT > -89)) && (environmentchecker != "bellyslide")) || ((((environmentchecker == "bellyslide") && (Math.abs(movespeedX) <= slidespeedMIN)) && (Math.abs(dr - dl) <= 0)) && (bellyslideTIME > 100))) || (((environmentchecker == "bellyslide") && (charROT < 30)) && (charROT > -30))) {
charY = charY - ((initHEIGHT - charHEIGHT) / 2);
charROT = 0;
environmentchecker = "ground";
} else if (((charROT < 165) && (charROT > -165)) || (((environmentchecker == "bellyslide") && (charROT < 30)) && (charROT > -30))) {
charY = charY - ((initWIDTH - charHEIGHT) / 2);
charWIDTH = initWIDTH;
charHEIGHT = initWIDTH;
if (environmentchecker != "bellyslide") {
charROT = ((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD);
} else if (charROT != (((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD))) {
slopeDIFFERENCE = (((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD)) - charROT;
charROT = charROT + (slopeDIFFERENCE / 2);
}
bellyslideTIME = bellyslideTIME + 1;
environmentchecker = "bellyslide";
if ((((jumpspeedY == 0) && ((oldslopeANGLE * slopeANGLE) <= 0)) && (oldslopeANGLE != 0)) || (((jumpspeedY == 0) && ((oldslopeANGLE * slopeANGLE) <= 0)) && (slopeANGLE != 0))) {
if (((oldslopeANGLE > 0) && (speedX > 0)) || ((oldslopeANGLE < 0) && (speedX < 0))) {
moveY = 0;
movespeedY = 0;
gspeedY = 0;
rampjumpY = (sliderampBOOST * Math.abs(speedX)) * Math.cos(oldslopeANGLE * DEGtoRAD);
jumpY = ((rampjumpY > 0) ? rampjumpY : 0);
} else {
moveY = 0;
movespeedY = 0;
}
}
} else {
charY = charY - ((initHEIGHT - charHEIGHT) / 2);
charROT = 180;
if (environmentchecker != "nosedivebounce") {
nosedivebounceSTART = getTimer() / 1000;
environmentchecker = "nosedivebounce";
}
if (Key.isDown(_root.kJUMP) && (jumparmed == true)) {
airspin = airspin + (nosediveBOUNCEspinrate * faceX);
jumpX = nosedivejumprateX * faceX;
jumpY = nosedivejumprateY;
environmentchecker = "nosedivebounce";
moveY = 0;
movespeedY = 0;
jumparmed = false;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
nosedivebounceTIMER = (getTimer() / 1000) - nosedivebounceSTART;
if (nosedivebounceTIMER >= nosedivebounceTIME) {
airspin = airspin + (nosediveBOUNCEspinrate * faceX);
jumpX = nosediveBOUNCEXrate * faceX;
jumpY = nosediveBOUNCEYrate;
}
}
} else if (environment == "sprung") {
swimX2 = 0;
swimY2 = 0;
swimI = 0;
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
if (TOUCHwater == false) {
jumpX = springrateX;
jumpY = springrateY;
swimX = 0;
swimY = 0;
} else {
swimX = springrateX;
swimY = springrateY;
jumpX = 0;
jumpY = 0;
}
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
environmentchecker = "sprung";
}
movespeedX = movespeedX + moveX;
jumpspeedX = jumpspeedX + jumpX;
swimX2 = swimX2 + swimX;
if ((charROT == 180) || (charROT == -180)) {
swimspeedX = 0;
} else {
swimspeedX = Math.sin(charROT * DEGtoRAD) * (swimX2 + swimI);
}
gspeedX = gspeedX + gravityX;
windspeedX = windX;
movespeedY = movespeedY + moveY;
jumpspeedY = jumpspeedY + jumpY;
swimY2 = swimY2 + swimY;
swimspeedY = Math.cos(charROT * DEGtoRAD) * (swimY2 + swimI);
gspeedY = gspeedY + gravityY;
windspeedY = windY;
if (Math.abs(movespeedX) < 0.1) {
movespeedX = 0;
}
if (Math.abs(movespeedY) < 0.1) {
movespeedY = 0;
}
speedX = (((movespeedX + jumpspeedX) + swimspeedX) - gspeedX) + windspeedX;
speedY = ((((-movespeedY) - jumpspeedY) - swimspeedY) + gspeedY) - windspeedY;
if (speedX > speedXMAX) {
speedX = speedX - (speedX - speedXMAX);
} else if (speedX < (-speedXMAX)) {
speedX = speedX + (speedXMAX - speedX);
}
if (speedY > speedYMAX) {
speedY = speedY - (speedY - speedYMAX);
} else if (speedY < (-speedYMAX)) {
speedY = speedY + (speedYMAX - speedY);
}
if (Math.abs(speedX) < speedMINX) {
speedX = 0;
}
if (Math.abs(speedY) < speedMINY) {
speedY = 0;
}
charX = charX + speedX;
charY = charY + speedY;
swimspinspeed = swimspinspeed + swimspin;
airspinspeed = airspinspeed + airspin;
speedROT = swimspinspeed + airspinspeed;
charROT = charROT + speedROT;
if (charROT > 180) {
charROT = charROT - 360;
} else if (charROT < -180) {
charROT = charROT + 360;
}
if (((speedX == 0) && (speedY == 0)) && (speedROT == 0)) {
charACTION = false;
} else {
charACTION = true;
}
if (charACTION == true) {
if (speedY > 0) {
d = 1;
while (d <= floorpushes) {
if (((!SoftBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true)) && (!HardBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true))) && (!Spring.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true))) {
charY = charY - (d - 1);
break;
}
d++;
}
} else if (speedY < 0) {
u = 1;
while (u <= floorpushes) {
if (!HardBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) - (charHEIGHT * uHEIGHT)) + u) * worldYSCALEinit) / 100) + worldYinit, true)) {
charY = charY + (u - 1);
break;
}
movespeedY = 0;
jumpspeedY = 0;
gspeedY = 0;
u++;
}
}
if ((speedX > 0) || ((environment == "wallslide") && (TOUCHwallright == true))) {
r = 1;
while (r <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) + (charWIDTH * rWIDTH)) - r) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) + (charHEIGHT * rHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX - (r - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
r++;
}
if (environmentchecker != "bellysliding") {
ur = 1;
while (ur <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) + (charWIDTH * urWIDTH)) - ur) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) - (charHEIGHT * urHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX - (ur - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
ur++;
}
}
}
if ((speedX < 0) || ((environment == "wallslide") && (TOUCHwallleft == true))) {
l = 1;
while (l <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) - (charWIDTH * lWIDTH)) + l) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) + (charHEIGHT * lHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX + (l - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
l++;
}
if (environmentchecker != "bellysliding") {
ul = 1;
while (ul <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) - (charWIDTH * ulWIDTH)) + ul) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) - (charHEIGHT * ulHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX + (ul - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
ul++;
}
}
}
}
oldslopeANGLE = slopeANGLE;
if ((((charACTION == true) && (oldTOUCHdigit == false)) && (digitMODE == "constant")) || ((charACTION == true) && (digitMODE != "constant"))) {
dr = 0;
while (dr <= floorpushes) {
if ((!SoftBoundary.hitTest(((((charX + offsetX) + (slopesensorDISTANCE / 2)) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dr) * worldYSCALEinit) / 100) + worldYinit, true)) && (!HardBoundary.hitTest(((((charX + offsetX) + slopesensorDISTANCE) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dr) * worldYSCALEinit) / 100) + worldYinit, true))) {
dr = dr - 1;
break;
}
dr++;
}
dl = 0;
while (dl <= floorpushes) {
if ((!SoftBoundary.hitTest(((((charX + offsetX) - (slopesensorDISTANCE / 2)) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dl) * worldYSCALEinit) / 100) + worldYinit, true)) && (!HardBoundary.hitTest(((((charX + offsetX) - slopesensorDISTANCE) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dl) * worldYSCALEinit) / 100) + worldYinit, true))) {
dl = dl - 1;
break;
}
dl++;
}
slopeANGLE = Math.atan((dr - dl) / slopesensorDISTANCE) / DEGtoRAD;
if ((TOUCHdigit == true) && (digitMODE == "restricted")) {
slopeANGLE = Math.round(slopeANGLE / digitARCLENGTH) * digitARCLENGTH;
if (slopeANGLE > 0) {
dr = Math.abs((Math.tan(slopeANGLE * DEGtoRAD) * slopesensorDISTANCE) / 2);
dl = -dr;
} else {
dr = -Math.abs((Math.tan(slopeANGLE * DEGtoRAD) * slopesensorDISTANCE) / 2);
dl = -dr;
}
}
}
if ((((TOUCHground == true) && (TOUCHdigit == false)) || ((jumpspeedY < gspeedY) && (jumpspeedY > 0))) || ((jumpspeedY == 0) && (gspeedY > jumpTHRESHOLD))) {
oldTOUCHdigit = false;
} else {
oldTOUCHdigit = true;
}
totalspeed = Math.pow(Math.pow(speedX, 2) + Math.pow(speedY, 2), 0.5);
if ((Key.isDown(17) && ((camXSCALE + zoomINCREMENTmanual) <= zoomMAXmanual)) && ((camYSCALE + zoomINCREMENTmanual) <= zoomMAXmanual)) {
camXSCALE = camXSCALE + zoomINCREMENTmanual;
camYSCALE = camYSCALE + zoomINCREMENTmanual;
zoomMIN = zoomMIN + zoomINCREMENTmanual;
} else if ((Key.isDown(16) && ((camXSCALE - zoomINCREMENTmanual) >= zoomMINmanual)) && ((camYSCALE - zoomINCREMENTmanual) >= zoomMINmanual)) {
camXSCALE = camXSCALE - zoomINCREMENTmanual;
camYSCALE = camYSCALE - zoomINCREMENTmanual;
zoomMIN = zoomMIN - zoomINCREMENTmanual;
} else {
if (((((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) <= (camX - (camWIDTH / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX)) || ((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) >= (camX + (camWIDTH / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camXSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) <= (camY - (camHEIGHT / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) >= (camY + (camHEIGHT / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) {
camXSCALE = camXSCALE + zoomINCREMENT;
camYSCALE = camYSCALE + zoomINCREMENT;
} else if (((((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) >= (camX - (camWIDTH / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camYSCALE - zoomINCREMENT) >= zoomMIN)) || ((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) <= (camX + (camWIDTH / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camXSCALE - zoomINCREMENT) >= zoomMIN))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) >= (camY - (camHEIGHT / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camYSCALE - zoomINCREMENT) >= zoomMIN))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) <= (camY + (camHEIGHT / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camYSCALE - zoomINCREMENT) >= zoomMIN))) {
camXSCALE = camXSCALE - zoomINCREMENT;
camYSCALE = camYSCALE - zoomINCREMENT;
}
if (((((((!Key.isDown(16)) && (charX <= ((camX - (camWIDTH / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX)) || ((((!Key.isDown(16)) && (charX >= ((camX + (camWIDTH / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camXSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && (charY <= ((camY - (camHEIGHT / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && (charY >= ((camY + (camHEIGHT / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) {
camXSCALE = camXSCALE + zoomINCREMENT;
camYSCALE = camYSCALE + zoomINCREMENT;
zoomMIN = zoomMIN + zoomINCREMENTmanual;
}
}
if ((TOUCHwater == false) && (environmentchecker != "bellyslide")) {
camspeedX = ((charX + (speedX * ((camLOOSENESS + camMOVEXLEAD) / (worldXSCALE / 100)))) - camX) / (camLOOSENESS / (worldXSCALE / 100));
if ((Math.abs(speedX) >= moverate) || (Math.abs(speedY) >= moverate)) {
camX = camX + ((Math.abs(camspeedX) > 1) ? (camspeedX) : 0);
}
} else {
camspeedX = ((charX + (speedX * ((camLOOSENESS + camWATERXLEAD) / (worldXSCALE / 100)))) - camX) / (camLOOSENESS / (worldXSCALE / 100));
if ((Math.abs(speedX) >= moverate) || (Math.abs(speedY) >= moverate)) {
camX = camX + ((Math.abs(camspeedX) > 1) ? (camspeedX) : 0);
}
}
if (((TOUCHwater == false) && (Math.abs(speedY) < 10)) && (environmentchecker != "bellyslide")) {
camspeedY = ((charY + (speedY * ((camLOOSENESS + camMOVEYLEAD) / (worldYSCALE / 100)))) - camY) / (camLOOSENESS / (worldYSCALE / 100));
camY = camY + camspeedY;
} else {
camspeedY = ((charY + (speedY * ((camLOOSENESS + camWATERYLEAD) / (worldYSCALE / 100)))) - camY) / (camLOOSENESS / (worldYSCALE / 100));
camY = camY + camspeedY;
}
if (Math.abs(camX - charX) > ((camWIDTH * 3) / 8)) {
camX = charX + ((((camWIDTH * 3) / 8) * (camX - charX)) / Math.abs(camX - charX));
}
if (Math.abs(camY - charY) > ((camHEIGHT * 3) / 8)) {
camY = charY + ((((camHEIGHT * 3) / 8) * (camY - charY)) / Math.abs(camY - charY));
}
camWIDTH = (camWIDTHinit * camXSCALE) / 100;
camHEIGHT = (camHEIGHTinit * camYSCALE) / 100;
if (!Key.isDown(46)) {
scaleX = stageWIDTH / camWIDTH;
scaleY = stageHEIGHT / camHEIGHT;
worldX = stagehalfWIDTH - (camX * scaleX);
worldY = stagehalfHEIGHT - (camY * scaleY);
worldXSCALE = 100 * scaleX;
worldYSCALE = 100 * scaleY;
camROT = 0;
worldROT = -camROT;
}
frameloops++;
}
Player1._x = charX;
Player1._y = charY;
Player1._rotation = charROT;
Player1.sensor._x = charsensorX;
Player1.sensor._y = charsensorY;
Player1.sensor._width = charsensorWIDTH;
Player1.sensor._height = charsensorHEIGHT;
if (faceX > 0) {
Player1._xscale = 100;
} else if (faceX < 0) {
Player1._xscale = -100;
}
camera._x = camX;
camera._y = camY;
camera._rotation = camROT;
camera._xscale = camXSCALE;
camera._yscale = camYSCALE;
camera._width = camWIDTH;
camera._height = camHEIGHT;
_x = worldX;
_y = worldY;
_rotation = worldROT;
_xscale = worldXSCALE;
_yscale = worldYSCALE;
}
Frame 36
if (_root.go != true) {
gotoAndStop (35);
} else {
_root.go = false;
}
Frame 37
Mouse.show();
stopAllSounds();
_root.soundManager_mc.playSound("BreakfastEnding.wav", 0, 9999999999);
_root.died = false;
_root.levelCOMPLETE = getTimer() / 1000;
_root.levelTIME = Math.round(((_root.levelCOMPLETE + _root.levelDEADTIME) - (_root.levelSTART + _root.pauseTIME)) * 10000) / 10000;
_root.levelDEADTIME = 0;
_root.levelTIMESTR = _root.levelTIME + " sec";
_root.pointratio = Math.round((_root.player1points / _root.totalpoints) * 10000) / 100;
_root.gameTIME = _root.gameTIME + _root.levelTIME;
_root.GAMEplayer1points = _root.GAMEplayer1points + _root.player1points;
_root.gamedeaths = _root.gamedeaths + _root.leveldeaths;
if (_root.cheats != true) {
_root.topdeaths.text = "---";
if (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] != undefined) {
_root.topdeaths.text = _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"];
}
if ((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] == undefined) || (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] > _root.leveldeaths)) {
_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] = _root.leveldeaths;
} else {
_root.newdeathsrecord.text = "";
}
_root.toptime.text = "---";
if (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] != undefined) {
_root.toptime.text = _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"];
}
if ((((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] == undefined) && (_root.leveldeaths <= _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"])) || ((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] > _root.levelTIME) && (_root.leveldeaths <= _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"]))) || (_root.newdeathsrecord.text != "")) {
_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] = _root.levelTIME;
} else {
_root.newtimerecord.text = "";
}
_root.leveldeaths = 0;
_root.toppoints.text = "---";
_root.topratio.text = "---";
if (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] != undefined) {
_root.toppoints.text = _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"];
_root.topratio.text = Math.round((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] / _root.totalpoints) * 10000) / 100;
}
if ((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] == undefined) || (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] < _root.player1points)) {
_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] = _root.player1points;
} else {
_root.newcoinrecord.text = "";
_root.newratiorecord.text = "";
}
_root.savedData.data[("LVL" + _root.level.substr(6)) + "totalpoints"] = _root.totalpoints;
if (_root.savedData.data.levelMAX == 4) {
_root.savedData.data.levelMAX = 5;
}
_root.savedData.flush();
}
if (_root.stattracking == true) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl4complete");
if (_root.pointratio >= 100) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl4coins100percent");
} else if (_root.pointratio >= 50) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl4coins050percent");
}
}
stop();
Instance of Symbol 240 MovieClip in Frame 37
onClipEvent (load) {
this.textvalue = "Menu";
this.linkvalue = "Game Start";
this.gotoAndStop("Menu");
}
Frame 38
if (_root.go != true) {
gotoAndStop (37);
} else {
_root.go = false;
}
Frame 39
stopAllSounds();
_root.cutscene3 = true;
_root.go = false;
stop();
Frame 40
if (_root.go != true) {
gotoAndStop (39);
} else {
_root.go = false;
}
Frame 41
if ((_root.cutscene3 != true) && (_root.cutscenes == true)) {
_root.gotoAndPlay("cutscene3");
}
Mouse.show();
stopAllSounds();
_root.level = "Level 2-2";
_root.kRIGHT = _root.kRIGHTconfig;
_root.kLEFT = _root.kLEFTconfig;
_root.kUP = _root.kUPconfig;
_root.kDOWN = _root.kDOWNconfig;
_root.kJUMP = _root.kJUMPconfig;
_root.kTHROW = _root.kTHROWconfig;
_root.kPAUSE = _root.kPAUSEconfig;
_root.kSTART = _root.kSTARTconfig;
basketball = true;
_root.pauseTIME = 0;
if (_root.died == true) {
_root.leveldeaths = _root.leveldeaths + 1;
}
if (_root.stattracking == true) {
if (_root.died == false) {
StatTracker.submitStat("/flashgames/breakfastclub/level5start");
} else {
StatTracker.submitStat("/flashgames/breakfastclub/level5died");
}
}
stop();
Frame 42
if (_root.go != true) {
gotoAndStop (41);
} else {
_root.go = false;
}
Frame 43
stop();
Frame 44
stopAllSounds();
_root.soundManager_mc.playSound("BreakfastInGame3.wav", 0, 9999999999);
if ((_root.savedData.data.levelMAX > 5) && (_root.stattracking == true)) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl5replay");
}
onMouseMove = function () {
mouseTIMERstart = getTimer() / 1000;
Mouse.show();
};
onEnterFrame = function () {
_root.timechecker();
mouseTIMER = (getTimer() / 1000) - mouseTIMERstart;
if (mouseTIMER >= mouseTIMERMAX) {
Mouse.hide();
}
};
_root.attachDEPTH = _root.GAMEattachDEPTH;
_root.WorldString = undefined;
if (_root.WorldString != undefined) {
SoftCOLOR = 65535;
SoftALPHA = 50;
TiledCOLOR = 16711935 /* 0xFF00FF */;
TiledALPHA = 50;
HardCOLOR = 16711680 /* 0xFF0000 */;
HardALPHA = 50;
WaterCOLOR = 255;
WaterALPHA = 50;
SpringCOLOR = 16776960 /* 0xFFFF00 */;
SpringALPHA = 50;
_root.World.createEmptyMovieClip("SoftBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.SoftBoundary.objects = 0;
_root.WorldArray[0] = [];
_root.World.createEmptyMovieClip("TiledBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.TiledBoundary.objects = 0;
_root.WorldArray[1] = [];
_root.World.createEmptyMovieClip("HardBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.SoftBoundary.objects = 0;
_root.WorldArray[2] = [];
_root.World.createEmptyMovieClip("WaterBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.WaterBoundary.objects = 0;
_root.WorldArray[3] = [];
_root.World.createEmptyMovieClip("SpringBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.SpringBoundary.objects = 0;
_root.WorldArray[4] = [];
_root.World.createEmptyMovieClip("Art", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.Art.objects = 0;
_root.WorldArray[5] = [];
_root.WorldArray = _root.WorldString.split(">>>>");
boundaryelements = 0;
while (boundaryelements < _root.WorldArray.length) {
_root.WorldArray[boundaryelements] = _root.WorldArray[boundaryelements].split("|");
objectelements = 0;
while (objectelements < _root.WorldArray[boundaryelements].length) {
_root.WorldArray[boundaryelements][objectelements] = _root.WorldArray[boundaryelements][objectelements].split("/");
anchorelements = 0;
while (anchorelements < _root.WorldArray[boundaryelements][objectelements].length) {
_root.WorldArray[boundaryelements][objectelements][anchorelements] = _root.WorldArray[boundaryelements][objectelements][anchorelements].split(",");
anchorelements++;
}
objectelements++;
}
boundaryelements++;
}
boundaryload = 0;
while (boundaryload < _root.WorldArray.length) {
if (boundaryload == 0) {
boundary = "Soft";
boundaryCOLOR = _root.SoftCOLOR;
boundaryALPHA = _root.SoftALPHA;
} else if (boundaryload == 1) {
boundary = "Tile";
boundaryCOLOR = _root.TileCOLOR;
boundaryALPHA = _root.TileALPHA;
} else if (boundaryload == 2) {
boundary = "Hard";
boundaryCOLOR = _root.HardCOLOR;
boundaryALPHA = _root.HardALPHA;
} else if (boundaryload == 3) {
boundary = "Water";
boundaryCOLOR = _root.WaterCOLOR;
boundaryALPHA = _root.WaterALPHA;
} else if (boundaryload == 4) {
boundary = "Spring";
boundaryCOLOR = _root.SpringCOLOR;
boundaryALPHA = _root.SpringALPHA;
} else if (boundaryload == 5) {
boundary = "Art";
boundaryCOLOR = _root.ArtCOLOR;
boundaryALPHA = _root.ArtALPHA;
}
_root.World.createEmptyMovieClip(boundary + "Boundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
objectload = 0;
while (objectload < _root.WorldArray[boundaryload].length) {
_root.World[boundary + "Boundary"].objects = objectload + 1;
_root.World[boundary + "Boundary"].createEmptyMovieClip("Object" + (objectload + 1), _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
anchorload = 0;
while (anchorload < _root.WorldArray[boundaryload][objectload].length) {
if ((anchorload == 0) && (_root.WorldArray[boundaryload][objectload][anchorload][0] != "Art")) {
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].lineStyle(1, 0, 100);
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].beginFill(boundaryCOLOR, boundaryALPHA);
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].moveTo(_root.WorldArray[boundaryload][objectload][anchorload][1], _root.WorldArray[boundaryload][objectload][anchorload][2]);
} else if (_root.WorldArray[boundaryload][objectload][anchorload][0] != "Art") {
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].lineTo(_root.WorldArray[boundaryload][objectload][anchorload][1], _root.WorldArray[boundaryload][objectload][anchorload][2]);
} else if (_root.WorldArray[boundaryload][objectload][anchorload][0] == "Art") {
anchorload++;
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].removeMovieClip();
_root.World[boundary + "Boundary"].attachMovie(_root.WorldArray[boundaryload][objectload][anchorload][0], _root.WorldArray[boundaryload][objectload][anchorload][0] + (objectload + 1), _root.attachDEPTH, {_x:_root.WorldArray[boundaryload][objectload][anchorload][1], _y:_root.WorldArray[boundaryload][objectload][anchorload][2]});
break;
}
anchorload++;
}
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].endFill();
objectload++;
}
boundaryload++;
}
}
stop();
Instance of Symbol 728 MovieClip "World" in Frame 44
onClipEvent (load) {
_name = "World";
framerateDEFAULT = 24;
framerateMAX = 120;
framerateMIN = 12;
DEGtoRAD = (Math.PI/180);
bubbleDEPTH = 1000;
this.bottomlesspit = 5000;
this.Player1.points = 0;
this.points = 0;
this.badguyDISTANCEMAX = 150;
this.bomberCHANCE = Infinity;
this.bombers = 0;
this.Goombas = 0;
this.KoopaTroopas = 0;
this.AttackDogs = 0;
this.Barrels = 0;
this.BarrelsFilled = 0;
digitMODE = "constant";
charALIVE = true;
charBLINK = true;
charBLINKTIME = 1;
charBLINKTIMER = 0;
Player1.rocksloaded = 0;
Player1.rocksthrown = 0;
Player1.rocksloadedMAX = 3;
rocksMAX = 6;
dHEIGHT = 0.5;
uHEIGHT = 0.5;
rWIDTH = 0.5;
rHEIGHT = 0;
urWIDTH = 0.3;
urHEIGHT = 0.25;
lWIDTH = 0.5;
lHEIGHT = 0;
ulWIDTH = 0.3;
ulHEIGHT = 0.25;
offsetX = 0;
offsetY = 0;
charACTION = true;
initWIDTH = Player1.sensor._width;
initHEIGHT = Player1.sensor._height;
initHYP = Math.sqrt(Math.pow(initWIDTH, 2) + Math.pow(initHEIGHT, 2));
initANGLE1 = Math.asin(initHEIGHT / initHYP);
initANGLE2 = Math.asin(initWIDTH / initHYP);
slopesensorRATIO = 3;
floorpushes = 100;
speedXMAX = 25;
speedYMAX = 25;
speedMAXdivisor = 1;
speedXMIN = 0.05;
speedYMIN = 0.05;
slidespeedMIN = 0.05;
jumpTHRESHOLD = 2;
airjumpsMAX = 1;
duckjumpRATIO = 2;
throwTIME = 2.5;
throwANGLEup = 65;
throwANGLEforward = 75;
throwANGLEdown = 120;
nosedivebounceTIME = 0.25;
swimcollideMAX = 7;
duckpaddleFALLSPEED = 7.5;
duckpaddleRATIO = 3;
faceX = 1;
faceY = 1;
digitARCLENGTH = 22.5;
engineloops = 4;
speedmultiUNIVERSAL = 1;
speedmultiX = speedmultiUNIVERSAL;
speedmultiY = speedmultiUNIVERSAL;
speedmultiROT = speedmultiUNIVERSAL;
movedragX = 1.175;
movedragY = 1.175;
slidedragX = 1.01;
slidedragY = 1.01;
waterdragX = 2.5;
waterdragY = 2.5;
swimdragX = 1.004;
swimdragY = 1.004;
watergroundfriction = 1.05;
throwdrag = 2.5;
swimspindrag = 1.1;
airspindrag = 1.1;
windrateX = 0 * speedmultiX;
windrateY = 0 * speedmultiY;
watercurrentrateX = 0 * speedmultiX;
watercurrentrateY = 0 * speedmultiY;
gravityrateX = 0 * speedmultiX;
gravityrateY = 0.25 * speedmultiY;
gspeedX = 0 * speedmultiX;
gspeedY = 0 * speedmultiY;
windX = 0 * speedmultiX;
windY = 0 * speedmultiY;
windspeedX = 0 * speedmultiX;
windspeedY = 0 * speedmultiY;
environment = "falling";
environmentchecker = "air";
moverate = 0.6 * speedmultiUNIVERSAL;
sliderate = 0.75 * speedmultiUNIVERSAL;
sliderampBOOST = 0.8 * speedmultiUNIVERSAL;
sliderampTHRESHOLD = 13;
swimspeedMAXTRANSFER = 15 * speedmultiUNIVERSAL;
jumprateX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
jumprateY = (40 * gravityrateY) / Math.sqrt(speedmultiY);
walljumpTIME = 20;
nosedivejumprateX = jumprateX * 1.4;
nosedivejumprateY = jumprateY * 1.4;
springrateX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
springrateY = (50 * gravityrateY) / Math.sqrt(speedmultiY);
nosediveBOUNCEXrate = 0.5;
nosediveBOUNCEYrate = (24 * gravityrateY) / Math.sqrt(speedmultiY);
nosediveBOUNCEspinrate = 17 * speedmultiROT;
swimrateX = (1 * gravityrateY) / Math.sqrt(speedmultiY);
swimrateY = (1 * gravityrateY) / Math.sqrt(speedmultiY);
throwrate = (40 * gravityrateY) / Math.sqrt(speedmultiY);
swimspinrate = 0.5 * speedmultiROT;
airspinrate = 0.75 * speedmultiROT;
watergroundboostX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
watergroundboostY = (0 * gravityrateY) / Math.sqrt(speedmultiY);
moveX = 0 * speedmultiX;
moveY = 0 * speedmultiY;
movespeedX = 0 * speedmultiX;
movespeedY = 0 * speedmultiY;
jumpX = 0 * speedmultiX;
jumpY = 0 * speedmultiY;
walljumpTIMER = 0;
airjumpCOUNT = 0;
jumpspeedX = 0 * speedmultiX;
jumpspeedY = 0 * speedmultiY;
swimX = 0 * speedmultiX;
swimY = 0 * speedmultiY;
swimX2 = 0 * speedmultiX;
swimY2 = 0 * speedmultiY;
swimI = 0 * speedmultiUNIVERSAL;
swimspeedX = 0 * speedmultiX;
swimspeedY = 0 * speedmultiY;
speedX = 0 * speedmultiX;
speedY = 0 * speedmultiY;
swimspin = 0 * speedmultiROT;
swimspinspeed = 0 * speedmultiROT;
airspin = 0 * speedmultiROT;
airspinspeed = 0 * speedmultiROT;
camera._visible = false;
stagehalfWIDTH = 275;
stagehalfHEIGHT = 200;
stageWIDTH = 550;
stageHEIGHT = 400;
camLOOSENESS = 50;
camMOVEXLEAD = 30;
camMOVEYLEAD = -30;
camWATERXLEAD = 5;
camWATERYLEAD = 5;
zoomMIN = 125;
zoomMAX = 250;
zoomMINmanual = zoomMIN;
zoomMAXmanual = zoomMAX;
camera._xscale = zoomMIN;
camera._yscale = zoomMIN;
zoomINCREMENT = 0.25 * speedmultiX;
zoomINCREMENTmanual = 1;
zoomLEAD = 90;
safezoneDISTANCE = 100;
startTime = getTimer();
numFrames = 0;
recentSetting = 5;
recentNumFrames = 0;
recentStartTime = startTime;
charX = Player1._x;
charY = Player1._y;
charROT = Player1._rotation;
charsensorX = Player1.sensor._x;
charsensorY = Player1.sensor._y;
charsensorWIDTH = Player1.sensor._width;
charsensorHEIGHT = Player1.sensor._height;
camX = camera._x;
camY = camera._y;
camROT = camera._rotation;
camXSCALE = camera._xscale;
camYSCALE = camera._yscale;
camWIDTHinit = camera._width;
camHEIGHTinit = camera._height;
camWIDTH = camera._width;
camHEIGHT = camera._height;
worldX = _x;
worldY = _y;
worldROT = _rotation;
worldXSCALE = _xscale;
worldYSCALE = _yscale;
}
onClipEvent (enterFrame) {
_root.player1points = this.Player1.points;
_root.totalpoints = this.points;
numFrames++;
now = getTimer();
elapsedSeconds = (now - startTime) / 1000;
actualFPS = numFrames / elapsedSeconds;
recentNumFrames++;
if (recentNumFrames == recentSetting) {
recentElapsedSeconds = (now - recentStartTime) / 1000;
recentFPSoutput = recentNumFrames / recentElapsedSeconds;
recentStartTime = now;
recentNumFrames = 0;
}
if (((recentFPSoutput >= framerateMIN) && (recentFPSoutput <= framerateMAX)) && (elapsedSeconds >= 1)) {
engineloops = framerateMAX / Math.ceil(recentFPSoutput);
} else if (elapsedSeconds < 1) {
engineloops = framerateMAX / framerateDEFAULT;
}
if ((Key.isDown(_root.kPAUSE) && (_root.PAUSE == false)) && (this.pausearmed == true)) {
_root.PAUSE = true;
this.pausearmed = false;
_root.pauseSTART = getTimer() / 1000;
} else if (((Key.isDown(_root.kPAUSE) && (_root.PAUSE == true)) && (this.pausearmed == true)) && (_root.textbubble == undefined)) {
_root.PAUSE = false;
this.pausearmed = false;
_root.pauseEND = getTimer() / 1000;
_root.pauseTIME = _root.pauseTIME + (_root.pauseEND - _root.pauseSTART);
}
if (!Key.isDown(_root.kPAUSE)) {
this.pausearmed = true;
}
if (_root.PAUSE == true) {
engineloops = 0;
}
worldXinit = _x;
worldYinit = _y;
worldROTinit = _rotation;
worldXSCALEinit = _xscale;
worldYSCALEinit = _yscale;
if (charALIVE == false) {
_root.kRIGHT = undefined;
_root.kLEFT = undefined;
_root.kUP = undefined;
_root.kDOWN = undefined;
_root.kJUMP = undefined;
_root.kTHROW = undefined;
_root.died = true;
_root.levelselect = false;
}
if ((charBLINK == true) && (charBLINKTIMER < charBLINKTIME)) {
if (Player1._visible == true) {
Player1._visible = false;
} else {
Player1._visible = true;
}
charBLINKTIMER = charBLINKTIMER + ((1 / this.framerateMAX) * this.engineloops);
} else {
Player1._visible = true;
charBLINKTIMER = 0;
charBLINK = false;
}
if ((random(bomberCHANCE) == 0) && (_root.PAUSE == false)) {
if (random(2) == 0) {
bomberDIRX = 1;
} else {
bomberDIRX = -1;
}
bomberDIRY = -1;
bombers = bombers + 1;
this.attachMovie("Bomber 1", "Bomber" + bombers, _root.attachDEPTH, {_x:this.camera._x + (((this.camera._width / 2) + this.badguyDISTANCEMAX) * bomberDIRX), _y:this.camera._y + (random(this.camera._width / 2) * bomberDIRY), flyDIR:bomberDIRX});
_root.attachDEPTH = _root.attachDEPTH + 1;
}
frameloops = 1;
while (frameloops <= engineloops) {
if (environmentchecker != "bellyslide") {
charWIDTH = Math.abs(Math.cos(initANGLE1 - ((Math.abs(charROT) + 180) * DEGtoRAD)) * initHYP);
charHEIGHT = Math.abs(Math.cos(initANGLE2 - ((Math.abs(charROT) + 180) * DEGtoRAD)) * initHYP);
} else {
charWIDTH = initWIDTH;
charHEIGHT = initWIDTH;
}
slopesensorDISTANCE = charWIDTH / slopesensorRATIO;
if (((speedY >= 0) && (SoftBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true))) || ((speedY >= 0) && (HardBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)))) {
TOUCHground = true;
if (((speedY >= 0) && (SoftBoundary.DigitBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true))) || ((speedY >= 0) && (HardBoundary.DigitBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)))) {
TOUCHdigit = true;
} else {
TOUCHdigit = false;
}
} else {
TOUCHground = false;
TOUCHdigit = false;
}
if (HardBoundary.hitTest((((((charsensorX + charX) + offsetX) + (charWIDTH * 0.5)) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.25)) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHwallright = true;
} else {
TOUCHwallright = false;
}
if (HardBoundary.hitTest((((((charsensorX + charX) + offsetX) - (charWIDTH * 0.5)) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.25)) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHwallleft = true;
} else {
TOUCHwallleft = false;
}
if (HardBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) - (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHceiling = true;
} else {
TOUCHceiling = false;
}
if (Water.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, ((((charsensorY + charY) + offsetY) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHwater = true;
} else {
TOUCHwater = false;
}
if (Spring.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true) && (speedY >= 0)) {
TOUCHspring = true;
} else {
TOUCHspring = false;
}
if (charY > bottomlesspit) {
charALIVE = false;
}
if (((_root.World.charBLINK == false) && (_root.DeathBoundaryPresent == true)) && (this.DeathBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, ((((charsensorY + charY) + offsetY) * worldYSCALEinit) / 100) + worldYinit, true))) {
if (this.Player1.rocksloaded > 0) {
this.throwANGLEdamaged = random(90) - 45;
this.throwratedamaged = 8;
this.Player1.rocksthrown = this.Player1.rocksthrown + 1;
this.attachMovie("Rock 1", "rock" + this.Player1.rocksthrown, 100 + this.Player1.rocksthrown, {_x:this.charsensorX + this.charX, _y:(this.charsensorY + this.charY) - ((this.charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEdamaged * DEGtoRAD) * throwratedamaged) * this.faceX) + this.speedX, throwspeedY:(Math.cos(throwANGLEdamaged * DEGtoRAD) * throwratedamaged) - this.speedY, weapon:false});
this.oldrock = this.Player1.rocksthrown - this.rocksMAX;
this["rock" + this.oldrock].removeMovieClip();
this.Player1.rocksloaded = this.Player1.rocksloaded - 1;
this.charBLINK = true;
_root.soundManager_mc.playSound("jump2.wav", 0, 1);
} else {
this.charALIVE = false;
}
}
if ((((environmentchecker == "air") && (TOUCHwater == true)) && (Math.abs(speedY) < duckpaddleFALLSPEED)) || (environment == "duckpaddle")) {
environment = "duckpaddle";
} else if (((((TOUCHwater == true) && (TOUCHground == true)) || ((TOUCHwater == true) && (TOUCHceiling == true))) || ((TOUCHwater == true) && (TOUCHwallleft == true))) || ((TOUCHwater == true) && (TOUCHwallright == true))) {
environment = "watergrounded";
} else if ((TOUCHwater == true) && (speedY < 0)) {
environment = "swimmingupward";
} else if (((TOUCHwater == true) && (TOUCHground == false)) && (speedY >= 0)) {
environment = "swimmingdownward";
} else if ((TOUCHspring == true) && (speedY >= 0)) {
environment = "sprung";
} else if ((TOUCHground == true) && (speedY >= 0)) {
environment = "grounded";
} else if (speedY < 0) {
environment = "flying";
} else if (((((TOUCHwallright == true) && (Key.isDown(_root.kRIGHT))) && (TOUCHground == false)) && (speedY >= 0)) || ((((TOUCHwallleft == true) && Key.isDown(_root.kLEFT)) && (TOUCHground == false)) && (speedY >= 0))) {
environment = "wallslide";
} else if ((TOUCHground == false) && (speedY >= 0)) {
environment = "falling";
}
if (((Player1.rocksloaded > 0) && (throwarmed == true)) && (Key.isDown(_root.kTHROW))) {
_root.soundManager_mc.stopSound("throw 1", 0, 1);
_root.soundManager_mc.playSound("throw 1", 0, 1);
Player1.rocksthrown = Player1.rocksthrown + 1;
if (environment != "wallslide") {
if (Key.isDown(_root.kUP)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:charsensorX + charX, _y:(charsensorY + charY) - ((charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEup * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEup * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else if (Key.isDown(_root.kDOWN)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * faceX), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEdown * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEdown * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * faceX), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEforward * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEforward * DEGtoRAD) * throwrate) - speedY, weapon:true});
}
} else if (Key.isDown(_root.kUP)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:charsensorX + charX, _y:(charsensorY + charY) - ((charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEup * DEGtoRAD) * throwrate) * (-faceX)) + speedX, throwspeedY:(Math.cos(throwANGLEup * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else if (Key.isDown(_root.kDOWN)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * (-faceX)), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEdown * DEGtoRAD) * throwrate) * (-faceX)) + speedX, throwspeedY:(Math.cos(throwANGLEdown * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * (-faceX)), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEforward * DEGtoRAD) * throwrate) * (-faceX)) + speedX, throwspeedY:(Math.cos(throwANGLEforward * DEGtoRAD) * throwrate) - speedY, weapon:true});
}
oldrock = Player1.rocksthrown - this.rocksMAX;
this["rock" + oldrock].removeMovieClip();
Player1.rocksloaded = Player1.rocksloaded - 1;
throwarmed = false;
} else if (!Key.isDown(_root.kTHROW)) {
throwarmed = true;
} else {
throwarmed = false;
}
if (environment == "grounded") {
if ((environmentchecker != "bellyslide") && (environmentchecker != "nosedivebounce")) {
movementhyp = moverate / Math.pow(Math.pow(dr - dl, 2) + Math.pow(slopesensorDISTANCE, 2), 0.5);
if (Key.isDown(_root.kRIGHT) && (TOUCHwallright == false)) {
moveX = movementhyp * slopesensorDISTANCE;
moveY = movementhyp * (-Math.abs(dr - dl));
faceX = 1;
} else if (Key.isDown(_root.kLEFT) && (TOUCHwallleft == false)) {
moveX = movementhyp * (-slopesensorDISTANCE);
moveY = movementhyp * (-Math.abs(dr - dl));
faceX = -1;
} else {
moveX = 0;
moveY = 0;
}
}
if (Key.isDown(_root.kJUMP) && (jumparmed == true)) {
jumpX = 0;
jumpY = jumprateY;
gspeedX = 0;
gspeedY = 0;
moveY = 0;
movespeedY = 0;
jumparmed = false;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
} else if ((environment == "wallslide") || (environmentchecker == "wallsliding")) {
if (Key.isDown(_root.kRIGHT)) {
faceX = 1;
} else if (Key.isDown(_root.kLEFT)) {
faceX = -1;
}
if (Key.isDown(_root.kJUMP) && (jumparmed == true)) {
jumpX = 0;
jumpY = jumprateY * 1.2;
gspeedX = 0;
gspeedY = 0;
if (Key.isDown(_root.kRIGHT)) {
moveX = -moverate;
} else if (Key.isDown(_root.kLEFT)) {
moveX = moverate;
}
moveY = 0;
movespeedY = 0;
jumparmed = false;
walljumpTIMER = walljumpTIME;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
} else if ((environment == "flying") || (environment == "falling")) {
if (walljumpTIMER <= 0) {
if (environmentchecker != "bellyslide") {
if (Key.isDown(_root.kRIGHT) && (TOUCHwallright == false)) {
moveX = moverate;
faceX = 1;
} else if (Key.isDown(_root.kLEFT) && (TOUCHwallleft == false)) {
moveX = -moverate;
faceX = -1;
} else {
moveX = 0;
}
} else {
moveX = 0;
}
walljumpTIMER = 0;
} else {
walljumpTIMER = walljumpTIMER - 1;
}
if (((Key.isDown(_root.kJUMP) && (jumparmed == true)) && (airjumpCOUNT > 0)) && (walljumpTIMER <= 0)) {
jumpspeedX = 0;
jumpspeedY = jumprateY;
gspeedX = 0;
gspeedY = 0;
moveY = 0;
movespeedY = 0;
jumparmed = false;
airjumpCOUNT = airjumpCOUNT - 1;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
if (environmentchecker == "ground") {
jumpassists = 0;
}
if (((((((jumpassists == 0) && (Key.isDown(_root.kJUMP))) && (gspeedY <= jumpTHRESHOLD)) && ((dr + dl) > -2)) && (walljumpTIMER <= 0)) && (TOUCHwallleft == false)) && (TOUCHwallright == false)) {
airjumpCOUNT = airjumpsMAX;
jumpassists = jumpassists + 1;
}
} else if ((((environment == "duckpaddle") || (environment == "swimmingupward")) || (environment == "swimmingdownward")) || (environment == "watergrounded")) {
if ((Key.isDown(_root.kRIGHT) && (Key.isDown(_root.kUP))) && (environment != "duckpaddle")) {
if ((charROT > -135) && (charROT <= 45)) {
if ((45 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-135 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((45 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-135 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if (Key.isDown(_root.kRIGHT) && (Key.isDown(_root.kDOWN))) {
if ((charROT > -45) && (charROT <= 135)) {
if ((135 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-45 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((135 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-45 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((Key.isDown(_root.kLEFT) && (Key.isDown(_root.kUP))) && (environment != "duckpaddle")) {
if ((charROT >= -45) && (charROT < 135)) {
if ((-45 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (135 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((-45 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (135 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kLEFT) && (Key.isDown(_root.kDOWN))) {
if ((charROT >= -135) && (charROT < 45)) {
if ((-135 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (45 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((-135 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (45 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kRIGHT)) {
if (environment == "duckpaddle") {
faceX = 1;
} else if ((charROT >= -90) && (charROT < 90)) {
if ((90 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-90 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((90 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-90 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if (Key.isDown(_root.kLEFT)) {
if (environment == "duckpaddle") {
faceX = -1;
} else if ((charROT > -90) && (charROT <= 90)) {
if ((90 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (-90 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((90 > (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (-90 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kUP) && (environment != "duckpaddle")) {
if (faceX > 0) {
if ((0 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-180 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 0;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((0 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (180 > (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 0;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kDOWN)) {
if (environment == "duckpaddle") {
swimX2 = swimX2 / duckpaddleRATIO;
swimY2 = swimY2 / duckpaddleRATIO;
environment = "swimmingdownward";
}
if (faceX < 0) {
if ((0 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (-180 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 180;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((0 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (180 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 180;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else {
swimspin = 0;
}
if ((swimspeedX > 0) && (environment != "duckpaddle")) {
faceX = 1;
} else if ((swimspeedX < 0) && (environment != "duckpaddle")) {
faceX = -1;
}
if (Key.isDown(_root.kJUMP) && (swimarmed == true)) {
if ((Key.isDown(_root.kUP) && (environment == "duckpaddle")) && (duckjumparmed == true)) {
while (Water.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((charY + offsetY) * worldYSCALEinit) / 100) + worldYinit, true)) {
charY = charY - 1;
}
jumpX = jumprateX;
jumpY = jumprateY;
environment = "duckjump";
environmentchecker = "duckjump";
duckjumparmed = false;
swimarmed = false;
} else if ((((environment == "duckpaddle") && (speedX == 0)) || (((environment == "duckpaddle") && (speedX > 0)) && (TOUCHwallright == false))) || (((environment == "duckpaddle") && (speedX < 0)) && (TOUCHwallleft == false))) {
if (((speedY == 0) || ((speedY > 0) && (TOUCHground == false))) || ((speedY < 0) && (TOUCHceiling == false))) {
swimX = swimrateX / duckpaddleRATIO;
swimY = swimrateY / duckpaddleRATIO;
swimarmed = false;
}
} else if (((speedX == 0) || ((speedX > 0) && (TOUCHwallright == false))) || ((speedX < 0) && (TOUCHwallleft == false))) {
if (((speedY == 0) || ((speedY > 0) && (TOUCHground == false))) || ((speedY < 0) && (TOUCHceiling == false))) {
swimX = swimrateX;
swimY = swimrateY;
swimarmed = false;
}
}
} else {
swimX = 0;
swimY = 0;
}
if (!Key.isDown(_root.kJUMP)) {
swimarmed = true;
duckjumparmed = true;
}
}
if (environment == "duckpaddle") {
charROT = 90 * faceX;
if (airspinspeed != 0) {
swimspinspeed = swimspinspeed + airspinspeed;
airspinspeed = 0;
}
airspin = 0;
if ((charROT > 100) || (charROT < -100)) {
if ((environmentchecker != "water") && (environmentchecker != "duckpaddle")) {
swimI = swimI + (Math.abs(movespeedX) / 3);
}
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
gspeedX = 0;
gspeedY = 0;
gravityX = 0;
gravityY = 0;
windX = watercurrentrateX;
windY = 0;
if ((environmentchecker != "water") && (environmentchecker != "duckpaddle")) {
swimY = 0;
swimY2 = 0;
}
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
environmentchecker = "duckpaddle";
} else if ((environment == "swimmingupward") || (environment == "swimmingdownward")) {
if (airspinspeed != 0) {
swimspinspeed = swimspinspeed + airspinspeed;
airspinspeed = 0;
}
airspin = 0;
if ((charROT > 100) || (charROT < -100)) {
if (environmentchecker != "water") {
swimI = swimI + ((Math.abs(movespeedX) / 3) + (gspeedY / 3));
gspeedY = 0;
}
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = gravityrateX;
gravityY = gravityrateY;
windX = watercurrentrateX;
windY = watercurrentrateY;
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
swimY2 = swimY2 / swimdragY;
swimI = swimI / swimdragY;
gspeedX = gspeedX / waterdragX;
gspeedY = gspeedY / waterdragY;
environmentchecker = "water";
} else if (environment == "watergrounded") {
if (((Math.abs(swimX2) >= swimcollideMAX) || (Math.abs(swimY2) >= swimcollideMAX)) || (Math.abs(swimI) >= swimcollideMAX)) {
swimX2 = Math.min(swimX2, swimcollideMAX);
swimY2 = Math.min(swimY2, swimcollideMAX);
swimI = Math.min(swimI, swimcollideMAX);
} else if (((Math.abs(swimX2) >= 0.25) || (Math.abs(swimY2) >= 0.25)) || (Math.abs(swimI) >= 0.25)) {
swimX2 = swimX2 / watergroundfriction;
swimY2 = swimY2 / watergroundfriction;
swimI = swimI / watergroundfriction;
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
windX = 0;
windY = 0;
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
swimY2 = swimY2 / swimdragY;
movespeedX = movespeedX / waterdragX;
movespeedY = movespeedY / waterdragY;
environmentchecker = "waterground";
} else if ((environment == "flying") || (environment == "falling")) {
charROT = 0;
if ((dr == -1) && (dl == -1)) {
moveY = 0;
movespeedY = 0;
}
if (swimspinspeed != 0) {
airspinspeed = airspinspeed + swimspinspeed;
swimspinspeed = 0;
}
swimspin = 0;
if (((swimX2 != 0) || (swimY2 != 0)) || (swimI != 0)) {
if (environmentchecker == "duckjump") {
swimX2 = swimX2 / duckjumpRATIO;
swimI = swimI / duckjumpRATIO;
}
jumpspeedX = jumpspeedX + (Math.sin(charROT * DEGtoRAD) * swimX2);
if (environmentchecker != "duckjump") {
jumpspeedY = jumpspeedY + Math.min(Math.cos(charROT * DEGtoRAD) * (swimX2 + swimI), swimspeedMAXTRANSFER);
}
}
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
gravityX = gravityrateX;
gravityY = gravityrateY;
windX = windrateX;
windY = windrateY;
if (environment == "flying") {
jumpX = 0;
jumpY = 0;
}
airspinspeed = airspinspeed / airspindrag;
if (environmentchecker != "bellyslide") {
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
} else {
movespeedX = movespeedX / slidedragX;
movespeedY = movespeedY / slidedragY;
}
if (environmentchecker == "nosedivebounce") {
airspin = 0;
if (Math.abs(charROT) < 5) {
charROT = 0;
environmentchecker = ((gspeedY > (jumpspeedY * 2)) ? "air" : "nosedivebounce");
}
}
if (((((environmentchecker == "water") && (Key.isDown(_root.kRIGHT))) && (!Key.isDown(_root.kUP))) && (!Key.isDown(_root.kDOWN))) || ((((environmentchecker == "water") && (Key.isDown(_root.kLEFT))) && (!Key.isDown(_root.kUP))) && (!Key.isDown(_root.kDOWN)))) {
environmentchecker = "porpoising";
} else if (((environmentchecker != "porpoising") && (environmentchecker != "bellyslide")) && (environmentchecker != "nosedivebounce")) {
environmentchecker = "air";
}
} else if (environment == "wallslide") {
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 1;
swimspin = 0;
swimspinspeed = 0;
airspin = 0;
airspinspeed = 0;
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
environmentchecker = "wallsliding";
} else if (environment == "grounded") {
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
swimspin = 0;
swimspinspeed = 0;
airspin = 0;
airspinspeed = 0;
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
if (environmentchecker != "bellyslide") {
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
bellyslideTIME = 0;
} else {
if ((dr - dl) != 0) {
moveX = (((sliderate * slopesensorDISTANCE) / Math.sqrt(Math.pow(dl - dr, 2) + Math.pow(slopesensorDISTANCE, 2))) * (dl - dr)) / Math.abs(dl - dr);
moveY = (sliderate * (-Math.abs(dr - dl))) / Math.sqrt(Math.pow(dr - dl, 2) + Math.pow(slopesensorDISTANCE, 2));
} else {
moveX = 0;
moveY = 0;
}
movespeedX = movespeedX / slidedragX;
movespeedY = movespeedY / slidedragY;
}
if (((((charROT < 89) && (charROT > -89)) && (environmentchecker != "bellyslide")) || ((((environmentchecker == "bellyslide") && (Math.abs(movespeedX) <= slidespeedMIN)) && (Math.abs(dr - dl) <= 0)) && (bellyslideTIME > 100))) || (((environmentchecker == "bellyslide") && (charROT < 30)) && (charROT > -30))) {
charY = charY - ((initHEIGHT - charHEIGHT) / 2);
charROT = 0;
environmentchecker = "ground";
} else if (((charROT < 165) && (charROT > -165)) || (((environmentchecker == "bellyslide") && (charROT < 30)) && (charROT > -30))) {
charY = charY - ((initWIDTH - charHEIGHT) / 2);
charWIDTH = initWIDTH;
charHEIGHT = initWIDTH;
if (environmentchecker != "bellyslide") {
charROT = ((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD);
} else if (charROT != (((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD))) {
slopeDIFFERENCE = (((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD)) - charROT;
charROT = charROT + (slopeDIFFERENCE / 2);
}
bellyslideTIME = bellyslideTIME + 1;
environmentchecker = "bellyslide";
if ((((jumpspeedY == 0) && ((oldslopeANGLE * slopeANGLE) <= 0)) && (oldslopeANGLE != 0)) || (((jumpspeedY == 0) && ((oldslopeANGLE * slopeANGLE) <= 0)) && (slopeANGLE != 0))) {
if (((oldslopeANGLE > 0) && (speedX > 0)) || ((oldslopeANGLE < 0) && (speedX < 0))) {
moveY = 0;
movespeedY = 0;
gspeedY = 0;
rampjumpY = (sliderampBOOST * Math.abs(speedX)) * Math.cos(oldslopeANGLE * DEGtoRAD);
jumpY = ((rampjumpY > 0) ? rampjumpY : 0);
} else {
moveY = 0;
movespeedY = 0;
}
}
} else {
charY = charY - ((initHEIGHT - charHEIGHT) / 2);
charROT = 180;
if (environmentchecker != "nosedivebounce") {
nosedivebounceSTART = getTimer() / 1000;
environmentchecker = "nosedivebounce";
}
if (Key.isDown(_root.kJUMP) && (jumparmed == true)) {
airspin = airspin + (nosediveBOUNCEspinrate * faceX);
jumpX = nosedivejumprateX * faceX;
jumpY = nosedivejumprateY;
environmentchecker = "nosedivebounce";
moveY = 0;
movespeedY = 0;
jumparmed = false;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
nosedivebounceTIMER = (getTimer() / 1000) - nosedivebounceSTART;
if (nosedivebounceTIMER >= nosedivebounceTIME) {
airspin = airspin + (nosediveBOUNCEspinrate * faceX);
jumpX = nosediveBOUNCEXrate * faceX;
jumpY = nosediveBOUNCEYrate;
}
}
} else if (environment == "sprung") {
swimX2 = 0;
swimY2 = 0;
swimI = 0;
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
if (TOUCHwater == false) {
jumpX = springrateX;
jumpY = springrateY;
swimX = 0;
swimY = 0;
} else {
swimX = springrateX;
swimY = springrateY;
jumpX = 0;
jumpY = 0;
}
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
environmentchecker = "sprung";
}
movespeedX = movespeedX + moveX;
jumpspeedX = jumpspeedX + jumpX;
swimX2 = swimX2 + swimX;
if ((charROT == 180) || (charROT == -180)) {
swimspeedX = 0;
} else {
swimspeedX = Math.sin(charROT * DEGtoRAD) * (swimX2 + swimI);
}
gspeedX = gspeedX + gravityX;
windspeedX = windX;
movespeedY = movespeedY + moveY;
jumpspeedY = jumpspeedY + jumpY;
swimY2 = swimY2 + swimY;
swimspeedY = Math.cos(charROT * DEGtoRAD) * (swimY2 + swimI);
gspeedY = gspeedY + gravityY;
windspeedY = windY;
if (Math.abs(movespeedX) < 0.1) {
movespeedX = 0;
}
if (Math.abs(movespeedY) < 0.1) {
movespeedY = 0;
}
speedX = (((movespeedX + jumpspeedX) + swimspeedX) - gspeedX) + windspeedX;
speedY = ((((-movespeedY) - jumpspeedY) - swimspeedY) + gspeedY) - windspeedY;
if (speedX > speedXMAX) {
speedX = speedX - (speedX - speedXMAX);
} else if (speedX < (-speedXMAX)) {
speedX = speedX + (speedXMAX - speedX);
}
if (speedY > speedYMAX) {
speedY = speedY - (speedY - speedYMAX);
} else if (speedY < (-speedYMAX)) {
speedY = speedY + (speedYMAX - speedY);
}
if (Math.abs(speedX) < speedMINX) {
speedX = 0;
}
if (Math.abs(speedY) < speedMINY) {
speedY = 0;
}
charX = charX + speedX;
charY = charY + speedY;
swimspinspeed = swimspinspeed + swimspin;
airspinspeed = airspinspeed + airspin;
speedROT = swimspinspeed + airspinspeed;
charROT = charROT + speedROT;
if (charROT > 180) {
charROT = charROT - 360;
} else if (charROT < -180) {
charROT = charROT + 360;
}
if (((speedX == 0) && (speedY == 0)) && (speedROT == 0)) {
charACTION = false;
} else {
charACTION = true;
}
if (charACTION == true) {
if (speedY > 0) {
d = 1;
while (d <= floorpushes) {
if (((!SoftBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true)) && (!HardBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true))) && (!Spring.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true))) {
charY = charY - (d - 1);
break;
}
d++;
}
} else if (speedY < 0) {
u = 1;
while (u <= floorpushes) {
if (!HardBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) - (charHEIGHT * uHEIGHT)) + u) * worldYSCALEinit) / 100) + worldYinit, true)) {
charY = charY + (u - 1);
break;
}
movespeedY = 0;
jumpspeedY = 0;
gspeedY = 0;
u++;
}
}
if ((speedX > 0) || ((environment == "wallslide") && (TOUCHwallright == true))) {
r = 1;
while (r <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) + (charWIDTH * rWIDTH)) - r) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) + (charHEIGHT * rHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX - (r - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
r++;
}
if (environmentchecker != "bellysliding") {
ur = 1;
while (ur <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) + (charWIDTH * urWIDTH)) - ur) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) - (charHEIGHT * urHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX - (ur - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
ur++;
}
}
}
if ((speedX < 0) || ((environment == "wallslide") && (TOUCHwallleft == true))) {
l = 1;
while (l <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) - (charWIDTH * lWIDTH)) + l) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) + (charHEIGHT * lHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX + (l - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
l++;
}
if (environmentchecker != "bellysliding") {
ul = 1;
while (ul <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) - (charWIDTH * ulWIDTH)) + ul) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) - (charHEIGHT * ulHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX + (ul - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
ul++;
}
}
}
}
oldslopeANGLE = slopeANGLE;
if ((((charACTION == true) && (oldTOUCHdigit == false)) && (digitMODE == "constant")) || ((charACTION == true) && (digitMODE != "constant"))) {
dr = 0;
while (dr <= floorpushes) {
if ((!SoftBoundary.hitTest(((((charX + offsetX) + (slopesensorDISTANCE / 2)) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dr) * worldYSCALEinit) / 100) + worldYinit, true)) && (!HardBoundary.hitTest(((((charX + offsetX) + slopesensorDISTANCE) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dr) * worldYSCALEinit) / 100) + worldYinit, true))) {
dr = dr - 1;
break;
}
dr++;
}
dl = 0;
while (dl <= floorpushes) {
if ((!SoftBoundary.hitTest(((((charX + offsetX) - (slopesensorDISTANCE / 2)) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dl) * worldYSCALEinit) / 100) + worldYinit, true)) && (!HardBoundary.hitTest(((((charX + offsetX) - slopesensorDISTANCE) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dl) * worldYSCALEinit) / 100) + worldYinit, true))) {
dl = dl - 1;
break;
}
dl++;
}
slopeANGLE = Math.atan((dr - dl) / slopesensorDISTANCE) / DEGtoRAD;
if ((TOUCHdigit == true) && (digitMODE == "restricted")) {
slopeANGLE = Math.round(slopeANGLE / digitARCLENGTH) * digitARCLENGTH;
if (slopeANGLE > 0) {
dr = Math.abs((Math.tan(slopeANGLE * DEGtoRAD) * slopesensorDISTANCE) / 2);
dl = -dr;
} else {
dr = -Math.abs((Math.tan(slopeANGLE * DEGtoRAD) * slopesensorDISTANCE) / 2);
dl = -dr;
}
}
}
if ((((TOUCHground == true) && (TOUCHdigit == false)) || ((jumpspeedY < gspeedY) && (jumpspeedY > 0))) || ((jumpspeedY == 0) && (gspeedY > jumpTHRESHOLD))) {
oldTOUCHdigit = false;
} else {
oldTOUCHdigit = true;
}
totalspeed = Math.pow(Math.pow(speedX, 2) + Math.pow(speedY, 2), 0.5);
if ((Key.isDown(17) && ((camXSCALE + zoomINCREMENTmanual) <= zoomMAXmanual)) && ((camYSCALE + zoomINCREMENTmanual) <= zoomMAXmanual)) {
camXSCALE = camXSCALE + zoomINCREMENTmanual;
camYSCALE = camYSCALE + zoomINCREMENTmanual;
zoomMIN = zoomMIN + zoomINCREMENTmanual;
} else if ((Key.isDown(16) && ((camXSCALE - zoomINCREMENTmanual) >= zoomMINmanual)) && ((camYSCALE - zoomINCREMENTmanual) >= zoomMINmanual)) {
camXSCALE = camXSCALE - zoomINCREMENTmanual;
camYSCALE = camYSCALE - zoomINCREMENTmanual;
zoomMIN = zoomMIN - zoomINCREMENTmanual;
} else {
if (((((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) <= (camX - (camWIDTH / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX)) || ((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) >= (camX + (camWIDTH / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camXSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) <= (camY - (camHEIGHT / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) >= (camY + (camHEIGHT / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) {
camXSCALE = camXSCALE + zoomINCREMENT;
camYSCALE = camYSCALE + zoomINCREMENT;
} else if (((((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) >= (camX - (camWIDTH / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camYSCALE - zoomINCREMENT) >= zoomMIN)) || ((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) <= (camX + (camWIDTH / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camXSCALE - zoomINCREMENT) >= zoomMIN))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) >= (camY - (camHEIGHT / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camYSCALE - zoomINCREMENT) >= zoomMIN))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) <= (camY + (camHEIGHT / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camYSCALE - zoomINCREMENT) >= zoomMIN))) {
camXSCALE = camXSCALE - zoomINCREMENT;
camYSCALE = camYSCALE - zoomINCREMENT;
}
if (((((((!Key.isDown(16)) && (charX <= ((camX - (camWIDTH / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX)) || ((((!Key.isDown(16)) && (charX >= ((camX + (camWIDTH / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camXSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && (charY <= ((camY - (camHEIGHT / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && (charY >= ((camY + (camHEIGHT / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) {
camXSCALE = camXSCALE + zoomINCREMENT;
camYSCALE = camYSCALE + zoomINCREMENT;
zoomMIN = zoomMIN + zoomINCREMENTmanual;
}
}
if ((TOUCHwater == false) && (environmentchecker != "bellyslide")) {
camspeedX = ((charX + (speedX * ((camLOOSENESS + camMOVEXLEAD) / (worldXSCALE / 100)))) - camX) / (camLOOSENESS / (worldXSCALE / 100));
if ((Math.abs(speedX) >= moverate) || (Math.abs(speedY) >= moverate)) {
camX = camX + ((Math.abs(camspeedX) > 1) ? (camspeedX) : 0);
}
} else {
camspeedX = ((charX + (speedX * ((camLOOSENESS + camWATERXLEAD) / (worldXSCALE / 100)))) - camX) / (camLOOSENESS / (worldXSCALE / 100));
if ((Math.abs(speedX) >= moverate) || (Math.abs(speedY) >= moverate)) {
camX = camX + ((Math.abs(camspeedX) > 1) ? (camspeedX) : 0);
}
}
if (((TOUCHwater == false) && (Math.abs(speedY) < 10)) && (environmentchecker != "bellyslide")) {
camspeedY = ((charY + (speedY * ((camLOOSENESS + camMOVEYLEAD) / (worldYSCALE / 100)))) - camY) / (camLOOSENESS / (worldYSCALE / 100));
camY = camY + camspeedY;
} else {
camspeedY = ((charY + (speedY * ((camLOOSENESS + camWATERYLEAD) / (worldYSCALE / 100)))) - camY) / (camLOOSENESS / (worldYSCALE / 100));
camY = camY + camspeedY;
}
if (Math.abs(camX - charX) > ((camWIDTH * 3) / 8)) {
camX = charX + ((((camWIDTH * 3) / 8) * (camX - charX)) / Math.abs(camX - charX));
}
if (Math.abs(camY - charY) > ((camHEIGHT * 3) / 8)) {
camY = charY + ((((camHEIGHT * 3) / 8) * (camY - charY)) / Math.abs(camY - charY));
}
camWIDTH = (camWIDTHinit * camXSCALE) / 100;
camHEIGHT = (camHEIGHTinit * camYSCALE) / 100;
if (!Key.isDown(46)) {
scaleX = stageWIDTH / camWIDTH;
scaleY = stageHEIGHT / camHEIGHT;
worldX = stagehalfWIDTH - (camX * scaleX);
worldY = stagehalfHEIGHT - (camY * scaleY);
worldXSCALE = 100 * scaleX;
worldYSCALE = 100 * scaleY;
camROT = 0;
worldROT = -camROT;
}
frameloops++;
}
Player1._x = charX;
Player1._y = charY;
Player1._rotation = charROT;
Player1.sensor._x = charsensorX;
Player1.sensor._y = charsensorY;
Player1.sensor._width = charsensorWIDTH;
Player1.sensor._height = charsensorHEIGHT;
if (faceX > 0) {
Player1._xscale = 100;
} else if (faceX < 0) {
Player1._xscale = -100;
}
camera._x = camX;
camera._y = camY;
camera._rotation = camROT;
camera._xscale = camXSCALE;
camera._yscale = camYSCALE;
camera._width = camWIDTH;
camera._height = camHEIGHT;
_x = worldX;
_y = worldY;
_rotation = worldROT;
_xscale = worldXSCALE;
_yscale = worldYSCALE;
}
Frame 45
if (_root.go != true) {
gotoAndStop (44);
} else {
_root.go = false;
}
Frame 46
_root.cutscene3 = false;
Mouse.show();
stopAllSounds();
_root.soundManager_mc.playSound("BreakfastEnding.wav", 0, 9999999999);
_root.died = false;
_root.levelCOMPLETE = getTimer() / 1000;
_root.levelTIME = Math.round(((_root.levelCOMPLETE + _root.levelDEADTIME) - (_root.levelSTART + _root.pauseTIME)) * 10000) / 10000;
_root.levelDEADTIME = 0;
_root.levelTIMESTR = _root.levelTIME + " sec";
_root.pointratio = Math.round((_root.player1points / _root.totalpoints) * 10000) / 100;
_root.gameTIME = _root.gameTIME + _root.levelTIME;
_root.GAMEplayer1points = _root.GAMEplayer1points + _root.player1points;
_root.gamedeaths = _root.gamedeaths + _root.leveldeaths;
if (_root.cheats != true) {
_root.topdeaths.text = "---";
if (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] != undefined) {
_root.topdeaths.text = _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"];
}
if ((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] == undefined) || (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] > _root.leveldeaths)) {
_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] = _root.leveldeaths;
} else {
_root.newdeathsrecord.text = "";
}
_root.toptime.text = "---";
if (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] != undefined) {
_root.toptime.text = _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"];
}
if ((((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] == undefined) && (_root.leveldeaths <= _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"])) || ((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] > _root.levelTIME) && (_root.leveldeaths <= _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"]))) || (_root.newdeathsrecord.text != "")) {
_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] = _root.levelTIME;
} else {
_root.newtimerecord.text = "";
}
_root.leveldeaths = 0;
_root.toppoints.text = "---";
_root.topratio.text = "---";
if (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] != undefined) {
_root.toppoints.text = _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"];
_root.topratio.text = Math.round((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] / _root.totalpoints) * 10000) / 100;
}
if ((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] == undefined) || (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] < _root.player1points)) {
_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] = _root.player1points;
} else {
_root.newcoinrecord.text = "";
_root.newratiorecord.text = "";
}
_root.savedData.data[("LVL" + _root.level.substr(6)) + "totalpoints"] = _root.totalpoints;
if (_root.savedData.data.levelMAX == 5) {
_root.savedData.data.levelMAX = 6;
}
_root.savedData.flush();
}
basketball = false;
if (_root.stattracking == true) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl5complete");
if (_root.pointratio >= 100) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl5coins100percent");
} else if (_root.pointratio >= 50) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl5coins050percent");
}
}
stop();
Instance of Symbol 240 MovieClip in Frame 46
onClipEvent (load) {
this.textvalue = "Menu";
this.linkvalue = "Game Start";
this.gotoAndStop("Menu");
}
Frame 47
if (_root.go != true) {
gotoAndStop (46);
} else {
_root.go = false;
}
Frame 48
Mouse.show();
stopAllSounds();
_root.level = "Level 3";
_root.kRIGHT = _root.kRIGHTconfig;
_root.kLEFT = _root.kLEFTconfig;
_root.kUP = _root.kUPconfig;
_root.kDOWN = _root.kDOWNconfig;
_root.kJUMP = _root.kJUMPconfig;
_root.kTHROW = _root.kTHROWconfig;
_root.kPAUSE = _root.kPAUSEconfig;
_root.kSTART = _root.kSTARTconfig;
_root.pauseTIME = 0;
if (_root.died == true) {
_root.leveldeaths = _root.leveldeaths + 1;
}
if (_root.stattracking == true) {
if (_root.died == false) {
StatTracker.submitStat("/flashgames/breakfastclub/level6start");
} else {
StatTracker.submitStat("/flashgames/breakfastclub/level6died");
}
}
stop();
Frame 49
if (_root.go != true) {
gotoAndStop (48);
} else {
_root.go = false;
}
Frame 50
stopAllSounds();
_root.soundManager_mc.playSound("BreakfastInGame3.wav", 0, 9999999999);
if ((_root.savedData.data.levelMAX > 6) && (_root.stattracking == true)) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl6replay");
}
onMouseMove = function () {
mouseTIMERstart = getTimer() / 1000;
Mouse.show();
};
onEnterFrame = function () {
_root.timechecker();
mouseTIMER = (getTimer() / 1000) - mouseTIMERstart;
if (mouseTIMER >= mouseTIMERMAX) {
Mouse.hide();
}
};
_root.attachDEPTH = _root.GAMEattachDEPTH;
_root.WorldString = undefined;
if (_root.WorldString != undefined) {
SoftCOLOR = 65535;
SoftALPHA = 50;
TiledCOLOR = 16711935 /* 0xFF00FF */;
TiledALPHA = 50;
HardCOLOR = 16711680 /* 0xFF0000 */;
HardALPHA = 50;
WaterCOLOR = 255;
WaterALPHA = 50;
SpringCOLOR = 16776960 /* 0xFFFF00 */;
SpringALPHA = 50;
_root.World.createEmptyMovieClip("SoftBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.SoftBoundary.objects = 0;
_root.WorldArray[0] = [];
_root.World.createEmptyMovieClip("TiledBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.TiledBoundary.objects = 0;
_root.WorldArray[1] = [];
_root.World.createEmptyMovieClip("HardBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.SoftBoundary.objects = 0;
_root.WorldArray[2] = [];
_root.World.createEmptyMovieClip("WaterBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.WaterBoundary.objects = 0;
_root.WorldArray[3] = [];
_root.World.createEmptyMovieClip("SpringBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.SpringBoundary.objects = 0;
_root.WorldArray[4] = [];
_root.World.createEmptyMovieClip("Art", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.Art.objects = 0;
_root.WorldArray[5] = [];
_root.WorldArray = _root.WorldString.split(">>>>");
boundaryelements = 0;
while (boundaryelements < _root.WorldArray.length) {
_root.WorldArray[boundaryelements] = _root.WorldArray[boundaryelements].split("|");
objectelements = 0;
while (objectelements < _root.WorldArray[boundaryelements].length) {
_root.WorldArray[boundaryelements][objectelements] = _root.WorldArray[boundaryelements][objectelements].split("/");
anchorelements = 0;
while (anchorelements < _root.WorldArray[boundaryelements][objectelements].length) {
_root.WorldArray[boundaryelements][objectelements][anchorelements] = _root.WorldArray[boundaryelements][objectelements][anchorelements].split(",");
anchorelements++;
}
objectelements++;
}
boundaryelements++;
}
boundaryload = 0;
while (boundaryload < _root.WorldArray.length) {
if (boundaryload == 0) {
boundary = "Soft";
boundaryCOLOR = _root.SoftCOLOR;
boundaryALPHA = _root.SoftALPHA;
} else if (boundaryload == 1) {
boundary = "Tile";
boundaryCOLOR = _root.TileCOLOR;
boundaryALPHA = _root.TileALPHA;
} else if (boundaryload == 2) {
boundary = "Hard";
boundaryCOLOR = _root.HardCOLOR;
boundaryALPHA = _root.HardALPHA;
} else if (boundaryload == 3) {
boundary = "Water";
boundaryCOLOR = _root.WaterCOLOR;
boundaryALPHA = _root.WaterALPHA;
} else if (boundaryload == 4) {
boundary = "Spring";
boundaryCOLOR = _root.SpringCOLOR;
boundaryALPHA = _root.SpringALPHA;
} else if (boundaryload == 5) {
boundary = "Art";
boundaryCOLOR = _root.ArtCOLOR;
boundaryALPHA = _root.ArtALPHA;
}
_root.World.createEmptyMovieClip(boundary + "Boundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
objectload = 0;
while (objectload < _root.WorldArray[boundaryload].length) {
_root.World[boundary + "Boundary"].objects = objectload + 1;
_root.World[boundary + "Boundary"].createEmptyMovieClip("Object" + (objectload + 1), _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
anchorload = 0;
while (anchorload < _root.WorldArray[boundaryload][objectload].length) {
if ((anchorload == 0) && (_root.WorldArray[boundaryload][objectload][anchorload][0] != "Art")) {
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].lineStyle(1, 0, 100);
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].beginFill(boundaryCOLOR, boundaryALPHA);
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].moveTo(_root.WorldArray[boundaryload][objectload][anchorload][1], _root.WorldArray[boundaryload][objectload][anchorload][2]);
} else if (_root.WorldArray[boundaryload][objectload][anchorload][0] != "Art") {
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].lineTo(_root.WorldArray[boundaryload][objectload][anchorload][1], _root.WorldArray[boundaryload][objectload][anchorload][2]);
} else if (_root.WorldArray[boundaryload][objectload][anchorload][0] == "Art") {
anchorload++;
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].removeMovieClip();
_root.World[boundary + "Boundary"].attachMovie(_root.WorldArray[boundaryload][objectload][anchorload][0], _root.WorldArray[boundaryload][objectload][anchorload][0] + (objectload + 1), _root.attachDEPTH, {_x:_root.WorldArray[boundaryload][objectload][anchorload][1], _y:_root.WorldArray[boundaryload][objectload][anchorload][2]});
break;
}
anchorload++;
}
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].endFill();
objectload++;
}
boundaryload++;
}
}
stop();
Instance of Symbol 772 MovieClip "World" in Frame 50
onClipEvent (load) {
_name = "World";
framerateDEFAULT = 24;
framerateMAX = 120;
framerateMIN = 12;
DEGtoRAD = (Math.PI/180);
bubbleDEPTH = 1000;
this.bottomlesspit = 5000;
this.Player1.points = 0;
this.points = 0;
this.badguyDISTANCEMAX = 150;
this.bomberCHANCE = 216;
this.bombers = 0;
this.Goombas = 0;
this.KoopaTroopas = 0;
this.AttackDogs = 0;
this.Barrels = 0;
this.BarrelsFilled = 0;
digitMODE = "constant";
charALIVE = true;
charBLINK = true;
charBLINKTIME = 1;
charBLINKTIMER = 0;
Player1.rocksloaded = 0;
Player1.rocksthrown = 0;
Player1.rocksloadedMAX = 3;
rocksMAX = 6;
dHEIGHT = 0.5;
uHEIGHT = 0.5;
rWIDTH = 0.5;
rHEIGHT = 0;
urWIDTH = 0.3;
urHEIGHT = 0.25;
lWIDTH = 0.5;
lHEIGHT = 0;
ulWIDTH = 0.3;
ulHEIGHT = 0.25;
offsetX = 0;
offsetY = 0;
charACTION = true;
initWIDTH = Player1.sensor._width;
initHEIGHT = Player1.sensor._height;
initHYP = Math.sqrt(Math.pow(initWIDTH, 2) + Math.pow(initHEIGHT, 2));
initANGLE1 = Math.asin(initHEIGHT / initHYP);
initANGLE2 = Math.asin(initWIDTH / initHYP);
slopesensorRATIO = 3;
floorpushes = 100;
speedXMAX = 25;
speedYMAX = 25;
speedMAXdivisor = 1;
speedXMIN = 0.05;
speedYMIN = 0.05;
slidespeedMIN = 0.05;
jumpTHRESHOLD = 2;
airjumpsMAX = 1;
duckjumpRATIO = 2;
throwTIME = 2.5;
throwANGLEup = 65;
throwANGLEforward = 75;
throwANGLEdown = 120;
nosedivebounceTIME = 0.25;
swimcollideMAX = 7;
duckpaddleFALLSPEED = 7.5;
duckpaddleRATIO = 3;
faceX = 1;
faceY = 1;
digitARCLENGTH = 22.5;
engineloops = 4;
speedmultiUNIVERSAL = 1;
speedmultiX = speedmultiUNIVERSAL;
speedmultiY = speedmultiUNIVERSAL;
speedmultiROT = speedmultiUNIVERSAL;
movedragX = 1.175;
movedragY = 1.175;
slidedragX = 1.01;
slidedragY = 1.01;
waterdragX = 2.5;
waterdragY = 2.5;
swimdragX = 1.004;
swimdragY = 1.004;
watergroundfriction = 1.05;
throwdrag = 2.5;
swimspindrag = 1.1;
airspindrag = 1.1;
windrateX = 0 * speedmultiX;
windrateY = 0 * speedmultiY;
watercurrentrateX = 0 * speedmultiX;
watercurrentrateY = 0 * speedmultiY;
gravityrateX = 0 * speedmultiX;
gravityrateY = 0.25 * speedmultiY;
gspeedX = 0 * speedmultiX;
gspeedY = 0 * speedmultiY;
windX = 0 * speedmultiX;
windY = 0 * speedmultiY;
windspeedX = 0 * speedmultiX;
windspeedY = 0 * speedmultiY;
environment = "falling";
environmentchecker = "air";
moverate = 0.6 * speedmultiUNIVERSAL;
sliderate = 0.75 * speedmultiUNIVERSAL;
sliderampBOOST = 0.8 * speedmultiUNIVERSAL;
sliderampTHRESHOLD = 13;
swimspeedMAXTRANSFER = 15 * speedmultiUNIVERSAL;
jumprateX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
jumprateY = (40 * gravityrateY) / Math.sqrt(speedmultiY);
walljumpTIME = 20;
nosedivejumprateX = jumprateX * 1.4;
nosedivejumprateY = jumprateY * 1.4;
springrateX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
springrateY = (50 * gravityrateY) / Math.sqrt(speedmultiY);
nosediveBOUNCEXrate = 0.5;
nosediveBOUNCEYrate = (24 * gravityrateY) / Math.sqrt(speedmultiY);
nosediveBOUNCEspinrate = 17 * speedmultiROT;
swimrateX = (1 * gravityrateY) / Math.sqrt(speedmultiY);
swimrateY = (1 * gravityrateY) / Math.sqrt(speedmultiY);
throwrate = (40 * gravityrateY) / Math.sqrt(speedmultiY);
swimspinrate = 0.5 * speedmultiROT;
airspinrate = 0.75 * speedmultiROT;
watergroundboostX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
watergroundboostY = (0 * gravityrateY) / Math.sqrt(speedmultiY);
moveX = 0 * speedmultiX;
moveY = 0 * speedmultiY;
movespeedX = 0 * speedmultiX;
movespeedY = 0 * speedmultiY;
jumpX = 0 * speedmultiX;
jumpY = 0 * speedmultiY;
walljumpTIMER = 0;
airjumpCOUNT = 0;
jumpspeedX = 0 * speedmultiX;
jumpspeedY = 0 * speedmultiY;
swimX = 0 * speedmultiX;
swimY = 0 * speedmultiY;
swimX2 = 0 * speedmultiX;
swimY2 = 0 * speedmultiY;
swimI = 0 * speedmultiUNIVERSAL;
swimspeedX = 0 * speedmultiX;
swimspeedY = 0 * speedmultiY;
speedX = 0 * speedmultiX;
speedY = 0 * speedmultiY;
swimspin = 0 * speedmultiROT;
swimspinspeed = 0 * speedmultiROT;
airspin = 0 * speedmultiROT;
airspinspeed = 0 * speedmultiROT;
camera._visible = false;
stagehalfWIDTH = 275;
stagehalfHEIGHT = 200;
stageWIDTH = 550;
stageHEIGHT = 400;
camLOOSENESS = 50;
camMOVEXLEAD = 30;
camMOVEYLEAD = -30;
camWATERXLEAD = 5;
camWATERYLEAD = 5;
zoomMIN = 125;
zoomMAX = 250;
zoomMINmanual = zoomMIN;
zoomMAXmanual = zoomMAX;
camera._xscale = zoomMIN;
camera._yscale = zoomMIN;
zoomINCREMENT = 0.25 * speedmultiX;
zoomINCREMENTmanual = 1;
zoomLEAD = 90;
safezoneDISTANCE = 100;
startTime = getTimer();
numFrames = 0;
recentSetting = 5;
recentNumFrames = 0;
recentStartTime = startTime;
charX = Player1._x;
charY = Player1._y;
charROT = Player1._rotation;
charsensorX = Player1.sensor._x;
charsensorY = Player1.sensor._y;
charsensorWIDTH = Player1.sensor._width;
charsensorHEIGHT = Player1.sensor._height;
camX = camera._x;
camY = camera._y;
camROT = camera._rotation;
camXSCALE = camera._xscale;
camYSCALE = camera._yscale;
camWIDTHinit = camera._width;
camHEIGHTinit = camera._height;
camWIDTH = camera._width;
camHEIGHT = camera._height;
worldX = _x;
worldY = _y;
worldROT = _rotation;
worldXSCALE = _xscale;
worldYSCALE = _yscale;
}
onClipEvent (enterFrame) {
_root.player1points = this.Player1.points;
_root.totalpoints = this.points;
numFrames++;
now = getTimer();
elapsedSeconds = (now - startTime) / 1000;
actualFPS = numFrames / elapsedSeconds;
recentNumFrames++;
if (recentNumFrames == recentSetting) {
recentElapsedSeconds = (now - recentStartTime) / 1000;
recentFPSoutput = recentNumFrames / recentElapsedSeconds;
recentStartTime = now;
recentNumFrames = 0;
}
if (((recentFPSoutput >= framerateMIN) && (recentFPSoutput <= framerateMAX)) && (elapsedSeconds >= 1)) {
engineloops = framerateMAX / Math.ceil(recentFPSoutput);
} else if (elapsedSeconds < 1) {
engineloops = framerateMAX / framerateDEFAULT;
}
if ((Key.isDown(_root.kPAUSE) && (_root.PAUSE == false)) && (this.pausearmed == true)) {
_root.PAUSE = true;
this.pausearmed = false;
_root.pauseSTART = getTimer() / 1000;
} else if (((Key.isDown(_root.kPAUSE) && (_root.PAUSE == true)) && (this.pausearmed == true)) && (_root.textbubble == undefined)) {
_root.PAUSE = false;
this.pausearmed = false;
_root.pauseEND = getTimer() / 1000;
_root.pauseTIME = _root.pauseTIME + (_root.pauseEND - _root.pauseSTART);
}
if (!Key.isDown(_root.kPAUSE)) {
this.pausearmed = true;
}
if (_root.PAUSE == true) {
engineloops = 0;
}
worldXinit = _x;
worldYinit = _y;
worldROTinit = _rotation;
worldXSCALEinit = _xscale;
worldYSCALEinit = _yscale;
if (charALIVE == false) {
_root.kRIGHT = undefined;
_root.kLEFT = undefined;
_root.kUP = undefined;
_root.kDOWN = undefined;
_root.kJUMP = undefined;
_root.kTHROW = undefined;
_root.died = true;
_root.levelselect = false;
}
if ((charBLINK == true) && (charBLINKTIMER < charBLINKTIME)) {
if (Player1._visible == true) {
Player1._visible = false;
} else {
Player1._visible = true;
}
charBLINKTIMER = charBLINKTIMER + ((1 / this.framerateMAX) * this.engineloops);
} else {
Player1._visible = true;
charBLINKTIMER = 0;
charBLINK = false;
}
if ((random(bomberCHANCE) == 0) && (_root.PAUSE == false)) {
if (random(2) == 0) {
bomberDIRX = 1;
} else {
bomberDIRX = -1;
}
bomberDIRY = -1;
bombers = bombers + 1;
this.attachMovie("Bomber 1", "Bomber" + bombers, _root.attachDEPTH, {_x:this.camera._x + (((this.camera._width / 2) + this.badguyDISTANCEMAX) * bomberDIRX), _y:this.camera._y + (random(this.camera._width / 2) * bomberDIRY), flyDIR:bomberDIRX});
_root.attachDEPTH = _root.attachDEPTH + 1;
}
frameloops = 1;
while (frameloops <= engineloops) {
if (environmentchecker != "bellyslide") {
charWIDTH = Math.abs(Math.cos(initANGLE1 - ((Math.abs(charROT) + 180) * DEGtoRAD)) * initHYP);
charHEIGHT = Math.abs(Math.cos(initANGLE2 - ((Math.abs(charROT) + 180) * DEGtoRAD)) * initHYP);
} else {
charWIDTH = initWIDTH;
charHEIGHT = initWIDTH;
}
slopesensorDISTANCE = charWIDTH / slopesensorRATIO;
if (((speedY >= 0) && (SoftBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true))) || ((speedY >= 0) && (HardBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)))) {
TOUCHground = true;
if (((speedY >= 0) && (SoftBoundary.DigitBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true))) || ((speedY >= 0) && (HardBoundary.DigitBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)))) {
TOUCHdigit = true;
} else {
TOUCHdigit = false;
}
} else {
TOUCHground = false;
TOUCHdigit = false;
}
if (HardBoundary.hitTest((((((charsensorX + charX) + offsetX) + (charWIDTH * 0.5)) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.25)) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHwallright = true;
} else {
TOUCHwallright = false;
}
if (HardBoundary.hitTest((((((charsensorX + charX) + offsetX) - (charWIDTH * 0.5)) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.25)) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHwallleft = true;
} else {
TOUCHwallleft = false;
}
if (HardBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) - (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHceiling = true;
} else {
TOUCHceiling = false;
}
if (Water.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, ((((charsensorY + charY) + offsetY) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHwater = true;
} else {
TOUCHwater = false;
}
if (Spring.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true) && (speedY >= 0)) {
TOUCHspring = true;
} else {
TOUCHspring = false;
}
if (charY > bottomlesspit) {
charALIVE = false;
}
if (((_root.World.charBLINK == false) && (_root.DeathBoundaryPresent == true)) && (this.DeathBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, ((((charsensorY + charY) + offsetY) * worldYSCALEinit) / 100) + worldYinit, true))) {
if (this.Player1.rocksloaded > 0) {
this.throwANGLEdamaged = random(90) - 45;
this.throwratedamaged = 8;
this.Player1.rocksthrown = this.Player1.rocksthrown + 1;
this.attachMovie("Rock 1", "rock" + this.Player1.rocksthrown, 100 + this.Player1.rocksthrown, {_x:this.charsensorX + this.charX, _y:(this.charsensorY + this.charY) - ((this.charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEdamaged * DEGtoRAD) * throwratedamaged) * this.faceX) + this.speedX, throwspeedY:(Math.cos(throwANGLEdamaged * DEGtoRAD) * throwratedamaged) - this.speedY, weapon:false});
this.oldrock = this.Player1.rocksthrown - this.rocksMAX;
this["rock" + this.oldrock].removeMovieClip();
this.Player1.rocksloaded = this.Player1.rocksloaded - 1;
this.charBLINK = true;
_root.soundManager_mc.playSound("jump2.wav", 0, 1);
} else {
this.charALIVE = false;
}
}
if ((((environmentchecker == "air") && (TOUCHwater == true)) && (Math.abs(speedY) < duckpaddleFALLSPEED)) || (environment == "duckpaddle")) {
environment = "duckpaddle";
} else if (((((TOUCHwater == true) && (TOUCHground == true)) || ((TOUCHwater == true) && (TOUCHceiling == true))) || ((TOUCHwater == true) && (TOUCHwallleft == true))) || ((TOUCHwater == true) && (TOUCHwallright == true))) {
environment = "watergrounded";
} else if ((TOUCHwater == true) && (speedY < 0)) {
environment = "swimmingupward";
} else if (((TOUCHwater == true) && (TOUCHground == false)) && (speedY >= 0)) {
environment = "swimmingdownward";
} else if ((TOUCHspring == true) && (speedY >= 0)) {
environment = "sprung";
} else if ((TOUCHground == true) && (speedY >= 0)) {
environment = "grounded";
} else if (speedY < 0) {
environment = "flying";
} else if (((((TOUCHwallright == true) && (Key.isDown(_root.kRIGHT))) && (TOUCHground == false)) && (speedY >= 0)) || ((((TOUCHwallleft == true) && Key.isDown(_root.kLEFT)) && (TOUCHground == false)) && (speedY >= 0))) {
environment = "wallslide";
} else if ((TOUCHground == false) && (speedY >= 0)) {
environment = "falling";
}
if (((Player1.rocksloaded > 0) && (throwarmed == true)) && (Key.isDown(_root.kTHROW))) {
_root.soundManager_mc.stopSound("throw 1", 0, 1);
_root.soundManager_mc.playSound("throw 1", 0, 1);
Player1.rocksthrown = Player1.rocksthrown + 1;
if (environment != "wallslide") {
if (Key.isDown(_root.kUP)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:charsensorX + charX, _y:(charsensorY + charY) - ((charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEup * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEup * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else if (Key.isDown(_root.kDOWN)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * faceX), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEdown * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEdown * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * faceX), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEforward * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEforward * DEGtoRAD) * throwrate) - speedY, weapon:true});
}
} else if (Key.isDown(_root.kUP)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:charsensorX + charX, _y:(charsensorY + charY) - ((charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEup * DEGtoRAD) * throwrate) * (-faceX)) + speedX, throwspeedY:(Math.cos(throwANGLEup * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else if (Key.isDown(_root.kDOWN)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * (-faceX)), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEdown * DEGtoRAD) * throwrate) * (-faceX)) + speedX, throwspeedY:(Math.cos(throwANGLEdown * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * (-faceX)), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEforward * DEGtoRAD) * throwrate) * (-faceX)) + speedX, throwspeedY:(Math.cos(throwANGLEforward * DEGtoRAD) * throwrate) - speedY, weapon:true});
}
oldrock = Player1.rocksthrown - rocksMAX;
this["rock" + oldrock].removeMovieClip();
Player1.rocksloaded = Player1.rocksloaded - 1;
throwarmed = false;
} else if (!Key.isDown(_root.kTHROW)) {
throwarmed = true;
} else {
throwarmed = false;
}
if (environment == "grounded") {
if ((environmentchecker != "bellyslide") && (environmentchecker != "nosedivebounce")) {
movementhyp = moverate / Math.pow(Math.pow(dr - dl, 2) + Math.pow(slopesensorDISTANCE, 2), 0.5);
if (Key.isDown(_root.kRIGHT) && (TOUCHwallright == false)) {
moveX = movementhyp * slopesensorDISTANCE;
moveY = movementhyp * (-Math.abs(dr - dl));
faceX = 1;
} else if (Key.isDown(_root.kLEFT) && (TOUCHwallleft == false)) {
moveX = movementhyp * (-slopesensorDISTANCE);
moveY = movementhyp * (-Math.abs(dr - dl));
faceX = -1;
} else {
moveX = 0;
moveY = 0;
}
}
if (Key.isDown(_root.kJUMP) && (jumparmed == true)) {
jumpX = 0;
jumpY = jumprateY;
gspeedX = 0;
gspeedY = 0;
moveY = 0;
movespeedY = 0;
jumparmed = false;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
} else if ((environment == "wallslide") || (environmentchecker == "wallsliding")) {
if (Key.isDown(_root.kRIGHT)) {
faceX = 1;
} else if (Key.isDown(_root.kLEFT)) {
faceX = -1;
}
if (Key.isDown(_root.kJUMP) && (jumparmed == true)) {
jumpX = 0;
jumpY = jumprateY * 1.2;
gspeedX = 0;
gspeedY = 0;
if (Key.isDown(_root.kRIGHT)) {
moveX = -moverate;
} else if (Key.isDown(_root.kLEFT)) {
moveX = moverate;
}
moveY = 0;
movespeedY = 0;
jumparmed = false;
walljumpTIMER = walljumpTIME;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
} else if ((environment == "flying") || (environment == "falling")) {
if (walljumpTIMER <= 0) {
if (environmentchecker != "bellyslide") {
if (Key.isDown(_root.kRIGHT) && (TOUCHwallright == false)) {
moveX = moverate;
faceX = 1;
} else if (Key.isDown(_root.kLEFT) && (TOUCHwallleft == false)) {
moveX = -moverate;
faceX = -1;
} else {
moveX = 0;
}
} else {
moveX = 0;
}
walljumpTIMER = 0;
} else {
walljumpTIMER = walljumpTIMER - 1;
}
if (((Key.isDown(_root.kJUMP) && (jumparmed == true)) && (airjumpCOUNT > 0)) && (walljumpTIMER <= 0)) {
jumpspeedX = 0;
jumpspeedY = jumprateY;
gspeedX = 0;
gspeedY = 0;
moveY = 0;
movespeedY = 0;
jumparmed = false;
airjumpCOUNT = airjumpCOUNT - 1;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
if (environmentchecker == "ground") {
jumpassists = 0;
}
if (((((((jumpassists == 0) && (Key.isDown(_root.kJUMP))) && (gspeedY <= jumpTHRESHOLD)) && ((dr + dl) > -2)) && (walljumpTIMER <= 0)) && (TOUCHwallleft == false)) && (TOUCHwallright == false)) {
airjumpCOUNT = airjumpsMAX;
jumpassists = jumpassists + 1;
}
} else if ((((environment == "duckpaddle") || (environment == "swimmingupward")) || (environment == "swimmingdownward")) || (environment == "watergrounded")) {
if ((Key.isDown(_root.kRIGHT) && (Key.isDown(_root.kUP))) && (environment != "duckpaddle")) {
if ((charROT > -135) && (charROT <= 45)) {
if ((45 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-135 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((45 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-135 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if (Key.isDown(_root.kRIGHT) && (Key.isDown(_root.kDOWN))) {
if ((charROT > -45) && (charROT <= 135)) {
if ((135 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-45 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((135 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-45 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((Key.isDown(_root.kLEFT) && (Key.isDown(_root.kUP))) && (environment != "duckpaddle")) {
if ((charROT >= -45) && (charROT < 135)) {
if ((-45 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (135 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((-45 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (135 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kLEFT) && (Key.isDown(_root.kDOWN))) {
if ((charROT >= -135) && (charROT < 45)) {
if ((-135 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (45 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((-135 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (45 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kRIGHT)) {
if (environment == "duckpaddle") {
faceX = 1;
} else if ((charROT >= -90) && (charROT < 90)) {
if ((90 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-90 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((90 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-90 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if (Key.isDown(_root.kLEFT)) {
if (environment == "duckpaddle") {
faceX = -1;
} else if ((charROT > -90) && (charROT <= 90)) {
if ((90 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (-90 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((90 > (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (-90 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kUP) && (environment != "duckpaddle")) {
if (faceX > 0) {
if ((0 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-180 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 0;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((0 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (180 > (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 0;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kDOWN)) {
if (environment == "duckpaddle") {
swimX2 = swimX2 / duckpaddleRATIO;
swimY2 = swimY2 / duckpaddleRATIO;
environment = "swimmingdownward";
}
if (faceX < 0) {
if ((0 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (-180 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 180;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((0 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (180 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 180;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else {
swimspin = 0;
}
if ((swimspeedX > 0) && (environment != "duckpaddle")) {
faceX = 1;
} else if ((swimspeedX < 0) && (environment != "duckpaddle")) {
faceX = -1;
}
if (Key.isDown(_root.kJUMP) && (swimarmed == true)) {
if ((Key.isDown(_root.kUP) && (environment == "duckpaddle")) && (duckjumparmed == true)) {
while (Water.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((charY + offsetY) * worldYSCALEinit) / 100) + worldYinit, true)) {
charY = charY - 1;
}
jumpX = jumprateX;
jumpY = jumprateY;
environment = "duckjump";
environmentchecker = "duckjump";
duckjumparmed = false;
swimarmed = false;
} else if ((((environment == "duckpaddle") && (speedX == 0)) || (((environment == "duckpaddle") && (speedX > 0)) && (TOUCHwallright == false))) || (((environment == "duckpaddle") && (speedX < 0)) && (TOUCHwallleft == false))) {
if (((speedY == 0) || ((speedY > 0) && (TOUCHground == false))) || ((speedY < 0) && (TOUCHceiling == false))) {
swimX = swimrateX / duckpaddleRATIO;
swimY = swimrateY / duckpaddleRATIO;
swimarmed = false;
}
} else if (((speedX == 0) || ((speedX > 0) && (TOUCHwallright == false))) || ((speedX < 0) && (TOUCHwallleft == false))) {
if (((speedY == 0) || ((speedY > 0) && (TOUCHground == false))) || ((speedY < 0) && (TOUCHceiling == false))) {
swimX = swimrateX;
swimY = swimrateY;
swimarmed = false;
}
}
} else {
swimX = 0;
swimY = 0;
}
if (!Key.isDown(_root.kJUMP)) {
swimarmed = true;
duckjumparmed = true;
}
}
if (environment == "duckpaddle") {
charROT = 90 * faceX;
if (airspinspeed != 0) {
swimspinspeed = swimspinspeed + airspinspeed;
airspinspeed = 0;
}
airspin = 0;
if ((charROT > 100) || (charROT < -100)) {
if ((environmentchecker != "water") && (environmentchecker != "duckpaddle")) {
swimI = swimI + (Math.abs(movespeedX) / 3);
}
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
gspeedX = 0;
gspeedY = 0;
gravityX = 0;
gravityY = 0;
windX = watercurrentrateX;
windY = 0;
if ((environmentchecker != "water") && (environmentchecker != "duckpaddle")) {
swimY = 0;
swimY2 = 0;
}
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
environmentchecker = "duckpaddle";
} else if ((environment == "swimmingupward") || (environment == "swimmingdownward")) {
if (airspinspeed != 0) {
swimspinspeed = swimspinspeed + airspinspeed;
airspinspeed = 0;
}
airspin = 0;
if ((charROT > 100) || (charROT < -100)) {
if (environmentchecker != "water") {
swimI = swimI + ((Math.abs(movespeedX) / 3) + (gspeedY / 3));
gspeedY = 0;
}
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = gravityrateX;
gravityY = gravityrateY;
windX = watercurrentrateX;
windY = watercurrentrateY;
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
swimY2 = swimY2 / swimdragY;
swimI = swimI / swimdragY;
gspeedX = gspeedX / waterdragX;
gspeedY = gspeedY / waterdragY;
environmentchecker = "water";
} else if (environment == "watergrounded") {
if (((Math.abs(swimX2) >= swimcollideMAX) || (Math.abs(swimY2) >= swimcollideMAX)) || (Math.abs(swimI) >= swimcollideMAX)) {
swimX2 = Math.min(swimX2, swimcollideMAX);
swimY2 = Math.min(swimY2, swimcollideMAX);
swimI = Math.min(swimI, swimcollideMAX);
} else if (((Math.abs(swimX2) >= 0.25) || (Math.abs(swimY2) >= 0.25)) || (Math.abs(swimI) >= 0.25)) {
swimX2 = swimX2 / watergroundfriction;
swimY2 = swimY2 / watergroundfriction;
swimI = swimI / watergroundfriction;
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
windX = 0;
windY = 0;
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
swimY2 = swimY2 / swimdragY;
movespeedX = movespeedX / waterdragX;
movespeedY = movespeedY / waterdragY;
environmentchecker = "waterground";
} else if ((environment == "flying") || (environment == "falling")) {
charROT = 0;
if ((dr == -1) && (dl == -1)) {
moveY = 0;
movespeedY = 0;
}
if (swimspinspeed != 0) {
airspinspeed = airspinspeed + swimspinspeed;
swimspinspeed = 0;
}
swimspin = 0;
if (((swimX2 != 0) || (swimY2 != 0)) || (swimI != 0)) {
if (environmentchecker == "duckjump") {
swimX2 = swimX2 / duckjumpRATIO;
swimI = swimI / duckjumpRATIO;
}
jumpspeedX = jumpspeedX + (Math.sin(charROT * DEGtoRAD) * swimX2);
if (environmentchecker != "duckjump") {
jumpspeedY = jumpspeedY + Math.min(Math.cos(charROT * DEGtoRAD) * (swimX2 + swimI), swimspeedMAXTRANSFER);
}
}
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
gravityX = gravityrateX;
gravityY = gravityrateY;
windX = windrateX;
windY = windrateY;
if (environment == "flying") {
jumpX = 0;
jumpY = 0;
}
airspinspeed = airspinspeed / airspindrag;
if (environmentchecker != "bellyslide") {
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
} else {
movespeedX = movespeedX / slidedragX;
movespeedY = movespeedY / slidedragY;
}
if (environmentchecker == "nosedivebounce") {
airspin = 0;
if (Math.abs(charROT) < 5) {
charROT = 0;
environmentchecker = ((gspeedY > (jumpspeedY * 2)) ? "air" : "nosedivebounce");
}
}
if (((((environmentchecker == "water") && (Key.isDown(_root.kRIGHT))) && (!Key.isDown(_root.kUP))) && (!Key.isDown(_root.kDOWN))) || ((((environmentchecker == "water") && (Key.isDown(_root.kLEFT))) && (!Key.isDown(_root.kUP))) && (!Key.isDown(_root.kDOWN)))) {
environmentchecker = "porpoising";
} else if (((environmentchecker != "porpoising") && (environmentchecker != "bellyslide")) && (environmentchecker != "nosedivebounce")) {
environmentchecker = "air";
}
} else if (environment == "wallslide") {
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 1;
swimspin = 0;
swimspinspeed = 0;
airspin = 0;
airspinspeed = 0;
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
environmentchecker = "wallsliding";
} else if (environment == "grounded") {
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
swimspin = 0;
swimspinspeed = 0;
airspin = 0;
airspinspeed = 0;
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
if (environmentchecker != "bellyslide") {
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
bellyslideTIME = 0;
} else {
if ((dr - dl) != 0) {
moveX = (((sliderate * slopesensorDISTANCE) / Math.sqrt(Math.pow(dl - dr, 2) + Math.pow(slopesensorDISTANCE, 2))) * (dl - dr)) / Math.abs(dl - dr);
moveY = (sliderate * (-Math.abs(dr - dl))) / Math.sqrt(Math.pow(dr - dl, 2) + Math.pow(slopesensorDISTANCE, 2));
} else {
moveX = 0;
moveY = 0;
}
movespeedX = movespeedX / slidedragX;
movespeedY = movespeedY / slidedragY;
}
if (((((charROT < 89) && (charROT > -89)) && (environmentchecker != "bellyslide")) || ((((environmentchecker == "bellyslide") && (Math.abs(movespeedX) <= slidespeedMIN)) && (Math.abs(dr - dl) <= 0)) && (bellyslideTIME > 100))) || (((environmentchecker == "bellyslide") && (charROT < 30)) && (charROT > -30))) {
charY = charY - ((initHEIGHT - charHEIGHT) / 2);
charROT = 0;
environmentchecker = "ground";
} else if (((charROT < 165) && (charROT > -165)) || (((environmentchecker == "bellyslide") && (charROT < 30)) && (charROT > -30))) {
charY = charY - ((initWIDTH - charHEIGHT) / 2);
charWIDTH = initWIDTH;
charHEIGHT = initWIDTH;
if (environmentchecker != "bellyslide") {
charROT = ((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD);
} else if (charROT != (((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD))) {
slopeDIFFERENCE = (((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD)) - charROT;
charROT = charROT + (slopeDIFFERENCE / 2);
}
bellyslideTIME = bellyslideTIME + 1;
environmentchecker = "bellyslide";
if ((((jumpspeedY == 0) && ((oldslopeANGLE * slopeANGLE) <= 0)) && (oldslopeANGLE != 0)) || (((jumpspeedY == 0) && ((oldslopeANGLE * slopeANGLE) <= 0)) && (slopeANGLE != 0))) {
if (((oldslopeANGLE > 0) && (speedX > 0)) || ((oldslopeANGLE < 0) && (speedX < 0))) {
moveY = 0;
movespeedY = 0;
gspeedY = 0;
rampjumpY = (sliderampBOOST * Math.abs(speedX)) * Math.cos(oldslopeANGLE * DEGtoRAD);
jumpY = ((rampjumpY > 0) ? rampjumpY : 0);
} else {
moveY = 0;
movespeedY = 0;
}
}
} else {
charY = charY - ((initHEIGHT - charHEIGHT) / 2);
charROT = 180;
if (environmentchecker != "nosedivebounce") {
nosedivebounceSTART = getTimer() / 1000;
environmentchecker = "nosedivebounce";
}
if (Key.isDown(_root.kJUMP) && (jumparmed == true)) {
airspin = airspin + (nosediveBOUNCEspinrate * faceX);
jumpX = nosedivejumprateX * faceX;
jumpY = nosedivejumprateY;
environmentchecker = "nosedivebounce";
moveY = 0;
movespeedY = 0;
jumparmed = false;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
nosedivebounceTIMER = (getTimer() / 1000) - nosedivebounceSTART;
if (nosedivebounceTIMER >= nosedivebounceTIME) {
airspin = airspin + (nosediveBOUNCEspinrate * faceX);
jumpX = nosediveBOUNCEXrate * faceX;
jumpY = nosediveBOUNCEYrate;
}
}
} else if (environment == "sprung") {
swimX2 = 0;
swimY2 = 0;
swimI = 0;
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
if (TOUCHwater == false) {
jumpX = springrateX;
jumpY = springrateY;
swimX = 0;
swimY = 0;
} else {
swimX = springrateX;
swimY = springrateY;
jumpX = 0;
jumpY = 0;
}
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
environmentchecker = "sprung";
}
movespeedX = movespeedX + moveX;
jumpspeedX = jumpspeedX + jumpX;
swimX2 = swimX2 + swimX;
if ((charROT == 180) || (charROT == -180)) {
swimspeedX = 0;
} else {
swimspeedX = Math.sin(charROT * DEGtoRAD) * (swimX2 + swimI);
}
gspeedX = gspeedX + gravityX;
windspeedX = windX;
movespeedY = movespeedY + moveY;
jumpspeedY = jumpspeedY + jumpY;
swimY2 = swimY2 + swimY;
swimspeedY = Math.cos(charROT * DEGtoRAD) * (swimY2 + swimI);
gspeedY = gspeedY + gravityY;
windspeedY = windY;
if (Math.abs(movespeedX) < 0.1) {
movespeedX = 0;
}
if (Math.abs(movespeedY) < 0.1) {
movespeedY = 0;
}
speedX = (((movespeedX + jumpspeedX) + swimspeedX) - gspeedX) + windspeedX;
speedY = ((((-movespeedY) - jumpspeedY) - swimspeedY) + gspeedY) - windspeedY;
if (speedX > speedXMAX) {
speedX = speedX - (speedX - speedXMAX);
} else if (speedX < (-speedXMAX)) {
speedX = speedX + (speedXMAX - speedX);
}
if (speedY > speedYMAX) {
speedY = speedY - (speedY - speedYMAX);
} else if (speedY < (-speedYMAX)) {
speedY = speedY + (speedYMAX - speedY);
}
if (Math.abs(speedX) < speedMINX) {
speedX = 0;
}
if (Math.abs(speedY) < speedMINY) {
speedY = 0;
}
charX = charX + speedX;
charY = charY + speedY;
swimspinspeed = swimspinspeed + swimspin;
airspinspeed = airspinspeed + airspin;
speedROT = swimspinspeed + airspinspeed;
charROT = charROT + speedROT;
if (charROT > 180) {
charROT = charROT - 360;
} else if (charROT < -180) {
charROT = charROT + 360;
}
if (((speedX == 0) && (speedY == 0)) && (speedROT == 0)) {
charACTION = false;
} else {
charACTION = true;
}
if (charACTION == true) {
if (speedY > 0) {
d = 1;
while (d <= floorpushes) {
if (((!SoftBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true)) && (!HardBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true))) && (!Spring.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true))) {
charY = charY - (d - 1);
break;
}
d++;
}
} else if (speedY < 0) {
u = 1;
while (u <= floorpushes) {
if (!HardBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) - (charHEIGHT * uHEIGHT)) + u) * worldYSCALEinit) / 100) + worldYinit, true)) {
charY = charY + (u - 1);
break;
}
movespeedY = 0;
jumpspeedY = 0;
gspeedY = 0;
u++;
}
}
if ((speedX > 0) || ((environment == "wallslide") && (TOUCHwallright == true))) {
r = 1;
while (r <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) + (charWIDTH * rWIDTH)) - r) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) + (charHEIGHT * rHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX - (r - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
r++;
}
if (environmentchecker != "bellysliding") {
ur = 1;
while (ur <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) + (charWIDTH * urWIDTH)) - ur) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) - (charHEIGHT * urHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX - (ur - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
ur++;
}
}
}
if ((speedX < 0) || ((environment == "wallslide") && (TOUCHwallleft == true))) {
l = 1;
while (l <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) - (charWIDTH * lWIDTH)) + l) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) + (charHEIGHT * lHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX + (l - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
l++;
}
if (environmentchecker != "bellysliding") {
ul = 1;
while (ul <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) - (charWIDTH * ulWIDTH)) + ul) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) - (charHEIGHT * ulHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX + (ul - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
ul++;
}
}
}
}
oldslopeANGLE = slopeANGLE;
if ((((charACTION == true) && (oldTOUCHdigit == false)) && (digitMODE == "constant")) || ((charACTION == true) && (digitMODE != "constant"))) {
dr = 0;
while (dr <= floorpushes) {
if ((!SoftBoundary.hitTest(((((charX + offsetX) + (slopesensorDISTANCE / 2)) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dr) * worldYSCALEinit) / 100) + worldYinit, true)) && (!HardBoundary.hitTest(((((charX + offsetX) + slopesensorDISTANCE) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dr) * worldYSCALEinit) / 100) + worldYinit, true))) {
dr = dr - 1;
break;
}
dr++;
}
dl = 0;
while (dl <= floorpushes) {
if ((!SoftBoundary.hitTest(((((charX + offsetX) - (slopesensorDISTANCE / 2)) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dl) * worldYSCALEinit) / 100) + worldYinit, true)) && (!HardBoundary.hitTest(((((charX + offsetX) - slopesensorDISTANCE) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dl) * worldYSCALEinit) / 100) + worldYinit, true))) {
dl = dl - 1;
break;
}
dl++;
}
slopeANGLE = Math.atan((dr - dl) / slopesensorDISTANCE) / DEGtoRAD;
if ((TOUCHdigit == true) && (digitMODE == "restricted")) {
slopeANGLE = Math.round(slopeANGLE / digitARCLENGTH) * digitARCLENGTH;
if (slopeANGLE > 0) {
dr = Math.abs((Math.tan(slopeANGLE * DEGtoRAD) * slopesensorDISTANCE) / 2);
dl = -dr;
} else {
dr = -Math.abs((Math.tan(slopeANGLE * DEGtoRAD) * slopesensorDISTANCE) / 2);
dl = -dr;
}
}
}
if ((((TOUCHground == true) && (TOUCHdigit == false)) || ((jumpspeedY < gspeedY) && (jumpspeedY > 0))) || ((jumpspeedY == 0) && (gspeedY > jumpTHRESHOLD))) {
oldTOUCHdigit = false;
} else {
oldTOUCHdigit = true;
}
totalspeed = Math.pow(Math.pow(speedX, 2) + Math.pow(speedY, 2), 0.5);
if ((Key.isDown(17) && ((camXSCALE + zoomINCREMENTmanual) <= zoomMAXmanual)) && ((camYSCALE + zoomINCREMENTmanual) <= zoomMAXmanual)) {
camXSCALE = camXSCALE + zoomINCREMENTmanual;
camYSCALE = camYSCALE + zoomINCREMENTmanual;
zoomMIN = zoomMIN + zoomINCREMENTmanual;
} else if ((Key.isDown(16) && ((camXSCALE - zoomINCREMENTmanual) >= zoomMINmanual)) && ((camYSCALE - zoomINCREMENTmanual) >= zoomMINmanual)) {
camXSCALE = camXSCALE - zoomINCREMENTmanual;
camYSCALE = camYSCALE - zoomINCREMENTmanual;
zoomMIN = zoomMIN - zoomINCREMENTmanual;
} else {
if (((((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) <= (camX - (camWIDTH / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX)) || ((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) >= (camX + (camWIDTH / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camXSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) <= (camY - (camHEIGHT / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) >= (camY + (camHEIGHT / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) {
camXSCALE = camXSCALE + zoomINCREMENT;
camYSCALE = camYSCALE + zoomINCREMENT;
} else if (((((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) >= (camX - (camWIDTH / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camYSCALE - zoomINCREMENT) >= zoomMIN)) || ((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) <= (camX + (camWIDTH / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camXSCALE - zoomINCREMENT) >= zoomMIN))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) >= (camY - (camHEIGHT / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camYSCALE - zoomINCREMENT) >= zoomMIN))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) <= (camY + (camHEIGHT / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camYSCALE - zoomINCREMENT) >= zoomMIN))) {
camXSCALE = camXSCALE - zoomINCREMENT;
camYSCALE = camYSCALE - zoomINCREMENT;
}
if (((((((!Key.isDown(16)) && (charX <= ((camX - (camWIDTH / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX)) || ((((!Key.isDown(16)) && (charX >= ((camX + (camWIDTH / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camXSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && (charY <= ((camY - (camHEIGHT / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && (charY >= ((camY + (camHEIGHT / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) {
camXSCALE = camXSCALE + zoomINCREMENT;
camYSCALE = camYSCALE + zoomINCREMENT;
zoomMIN = zoomMIN + zoomINCREMENTmanual;
}
}
if ((TOUCHwater == false) && (environmentchecker != "bellyslide")) {
camspeedX = ((charX + (speedX * ((camLOOSENESS + camMOVEXLEAD) / (worldXSCALE / 100)))) - camX) / (camLOOSENESS / (worldXSCALE / 100));
if ((Math.abs(speedX) >= moverate) || (Math.abs(speedY) >= moverate)) {
camX = camX + ((Math.abs(camspeedX) > 1) ? (camspeedX) : 0);
}
} else {
camspeedX = ((charX + (speedX * ((camLOOSENESS + camWATERXLEAD) / (worldXSCALE / 100)))) - camX) / (camLOOSENESS / (worldXSCALE / 100));
if ((Math.abs(speedX) >= moverate) || (Math.abs(speedY) >= moverate)) {
camX = camX + ((Math.abs(camspeedX) > 1) ? (camspeedX) : 0);
}
}
if (((TOUCHwater == false) && (Math.abs(speedY) < 10)) && (environmentchecker != "bellyslide")) {
camspeedY = ((charY + (speedY * ((camLOOSENESS + camMOVEYLEAD) / (worldYSCALE / 100)))) - camY) / (camLOOSENESS / (worldYSCALE / 100));
camY = camY + camspeedY;
} else {
camspeedY = ((charY + (speedY * ((camLOOSENESS + camWATERYLEAD) / (worldYSCALE / 100)))) - camY) / (camLOOSENESS / (worldYSCALE / 100));
camY = camY + camspeedY;
}
if (Math.abs(camX - charX) > ((camWIDTH * 3) / 8)) {
camX = charX + ((((camWIDTH * 3) / 8) * (camX - charX)) / Math.abs(camX - charX));
}
if (Math.abs(camY - charY) > ((camHEIGHT * 3) / 8)) {
camY = charY + ((((camHEIGHT * 3) / 8) * (camY - charY)) / Math.abs(camY - charY));
}
camWIDTH = (camWIDTHinit * camXSCALE) / 100;
camHEIGHT = (camHEIGHTinit * camYSCALE) / 100;
if (!Key.isDown(46)) {
scaleX = stageWIDTH / camWIDTH;
scaleY = stageHEIGHT / camHEIGHT;
worldX = stagehalfWIDTH - (camX * scaleX);
worldY = stagehalfHEIGHT - (camY * scaleY);
worldXSCALE = 100 * scaleX;
worldYSCALE = 100 * scaleY;
camROT = 0;
worldROT = -camROT;
}
frameloops++;
}
Player1._x = charX;
Player1._y = charY;
Player1._rotation = charROT;
Player1.sensor._x = charsensorX;
Player1.sensor._y = charsensorY;
Player1.sensor._width = charsensorWIDTH;
Player1.sensor._height = charsensorHEIGHT;
if (faceX > 0) {
Player1._xscale = 100;
} else if (faceX < 0) {
Player1._xscale = -100;
}
camera._x = camX;
camera._y = camY;
camera._rotation = camROT;
camera._xscale = camXSCALE;
camera._yscale = camYSCALE;
camera._width = camWIDTH;
camera._height = camHEIGHT;
_x = worldX;
_y = worldY;
_rotation = worldROT;
_xscale = worldXSCALE;
_yscale = worldYSCALE;
}
Frame 51
if (_root.go != true) {
gotoAndStop (50);
} else {
_root.go = false;
}
Frame 52
Mouse.show();
stopAllSounds();
_root.soundManager_mc.playSound("BreakfastEnding.wav", 0, 9999999999);
_root.died = false;
_root.levelCOMPLETE = getTimer() / 1000;
_root.levelTIME = Math.round(((_root.levelCOMPLETE + _root.levelDEADTIME) - (_root.levelSTART + _root.pauseTIME)) * 10000) / 10000;
_root.levelDEADTIME = 0;
_root.levelTIMESTR = _root.levelTIME + " sec";
_root.pointratio = Math.round((_root.player1points / _root.totalpoints) * 10000) / 100;
_root.gameTIME = _root.gameTIME + _root.levelTIME;
_root.GAMEplayer1points = _root.GAMEplayer1points + _root.player1points;
_root.gamedeaths = _root.gamedeaths + _root.leveldeaths;
if (_root.cheats != true) {
_root.topdeaths.text = "---";
if (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] != undefined) {
_root.topdeaths.text = _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"];
}
if ((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] == undefined) || (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] > _root.leveldeaths)) {
_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] = _root.leveldeaths;
} else {
_root.newdeathsrecord.text = "";
}
_root.toptime.text = "---";
if (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] != undefined) {
_root.toptime.text = _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"];
}
if ((((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] == undefined) && (_root.leveldeaths <= _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"])) || ((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] > _root.levelTIME) && (_root.leveldeaths <= _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"]))) || (_root.newdeathsrecord.text != "")) {
_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] = _root.levelTIME;
} else {
_root.newtimerecord.text = "";
}
_root.leveldeaths = 0;
_root.toppoints.text = "---";
_root.topratio.text = "---";
if (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] != undefined) {
_root.toppoints.text = _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"];
_root.topratio.text = Math.round((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] / _root.totalpoints) * 10000) / 100;
}
if ((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] == undefined) || (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] < _root.player1points)) {
_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] = _root.player1points;
} else {
_root.newcoinrecord.text = "";
_root.newratiorecord.text = "";
}
_root.savedData.data[("LVL" + _root.level.substr(6)) + "totalpoints"] = _root.totalpoints;
if (_root.savedData.data.levelMAX == 6) {
_root.savedData.data.levelMAX = 7;
}
_root.savedData.flush();
}
if (_root.stattracking == true) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl6complete");
if (_root.pointratio >= 100) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl6coins100percent");
} else if (_root.pointratio >= 50) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl6coins050percent");
}
}
stop();
Instance of Symbol 240 MovieClip in Frame 52
onClipEvent (load) {
this.textvalue = "Menu";
this.linkvalue = "Game Start";
this.gotoAndStop("Menu");
}
Frame 53
if (_root.go != true) {
gotoAndStop (52);
} else {
_root.go = false;
}
Frame 54
stopAllSounds();
_root.cutscene4 = true;
_root.go = false;
stop();
Frame 55
if (_root.go != true) {
gotoAndStop (54);
} else {
_root.go = false;
}
Frame 56
if ((_root.cutscene4 != true) && (_root.cutscenes == true)) {
_root.gotoAndPlay("cutscene4");
}
Mouse.show();
stopAllSounds();
_root.level = "Level 4";
_root.kRIGHT = _root.kRIGHTconfig;
_root.kLEFT = _root.kLEFTconfig;
_root.kUP = _root.kUPconfig;
_root.kDOWN = _root.kDOWNconfig;
_root.kJUMP = _root.kJUMPconfig;
_root.kTHROW = _root.kTHROWconfig;
_root.kPAUSE = _root.kPAUSEconfig;
_root.kSTART = _root.kSTARTconfig;
_root.pauseTIME = 0;
if (_root.died == true) {
_root.leveldeaths = _root.leveldeaths + 1;
}
if (_root.stattracking == true) {
if (_root.died == false) {
StatTracker.submitStat("/flashgames/breakfastclub/level7start");
} else {
StatTracker.submitStat("/flashgames/breakfastclub/level7died");
}
}
stop();
Frame 57
if (_root.go != true) {
gotoAndStop (56);
} else {
_root.go = false;
}
Frame 58
stopAllSounds();
_root.soundManager_mc.playSound("BreakfastInGame4.wav", 0, 9999999999);
if ((_root.savedData.data.levelMAX > 7) && (_root.stattracking == true)) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl7replay");
}
onMouseMove = function () {
mouseTIMERstart = getTimer() / 1000;
Mouse.show();
};
onEnterFrame = function () {
_root.timechecker();
mouseTIMER = (getTimer() / 1000) - mouseTIMERstart;
if (mouseTIMER >= mouseTIMERMAX) {
Mouse.hide();
}
};
_root.attachDEPTH = _root.GAMEattachDEPTH;
_root.WorldString = undefined;
if (_root.WorldString != undefined) {
SoftCOLOR = 65535;
SoftALPHA = 50;
TiledCOLOR = 16711935 /* 0xFF00FF */;
TiledALPHA = 50;
HardCOLOR = 16711680 /* 0xFF0000 */;
HardALPHA = 50;
WaterCOLOR = 255;
WaterALPHA = 50;
SpringCOLOR = 16776960 /* 0xFFFF00 */;
SpringALPHA = 50;
_root.World.createEmptyMovieClip("SoftBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.SoftBoundary.objects = 0;
_root.WorldArray[0] = [];
_root.World.createEmptyMovieClip("TiledBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.TiledBoundary.objects = 0;
_root.WorldArray[1] = [];
_root.World.createEmptyMovieClip("HardBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.SoftBoundary.objects = 0;
_root.WorldArray[2] = [];
_root.World.createEmptyMovieClip("WaterBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.WaterBoundary.objects = 0;
_root.WorldArray[3] = [];
_root.World.createEmptyMovieClip("SpringBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.SpringBoundary.objects = 0;
_root.WorldArray[4] = [];
_root.World.createEmptyMovieClip("Art", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.Art.objects = 0;
_root.WorldArray[5] = [];
_root.WorldArray = _root.WorldString.split(">>>>");
boundaryelements = 0;
while (boundaryelements < _root.WorldArray.length) {
_root.WorldArray[boundaryelements] = _root.WorldArray[boundaryelements].split("|");
objectelements = 0;
while (objectelements < _root.WorldArray[boundaryelements].length) {
_root.WorldArray[boundaryelements][objectelements] = _root.WorldArray[boundaryelements][objectelements].split("/");
anchorelements = 0;
while (anchorelements < _root.WorldArray[boundaryelements][objectelements].length) {
_root.WorldArray[boundaryelements][objectelements][anchorelements] = _root.WorldArray[boundaryelements][objectelements][anchorelements].split(",");
anchorelements++;
}
objectelements++;
}
boundaryelements++;
}
boundaryload = 0;
while (boundaryload < _root.WorldArray.length) {
if (boundaryload == 0) {
boundary = "Soft";
boundaryCOLOR = _root.SoftCOLOR;
boundaryALPHA = _root.SoftALPHA;
} else if (boundaryload == 1) {
boundary = "Tile";
boundaryCOLOR = _root.TileCOLOR;
boundaryALPHA = _root.TileALPHA;
} else if (boundaryload == 2) {
boundary = "Hard";
boundaryCOLOR = _root.HardCOLOR;
boundaryALPHA = _root.HardALPHA;
} else if (boundaryload == 3) {
boundary = "Water";
boundaryCOLOR = _root.WaterCOLOR;
boundaryALPHA = _root.WaterALPHA;
} else if (boundaryload == 4) {
boundary = "Spring";
boundaryCOLOR = _root.SpringCOLOR;
boundaryALPHA = _root.SpringALPHA;
} else if (boundaryload == 5) {
boundary = "Art";
boundaryCOLOR = _root.ArtCOLOR;
boundaryALPHA = _root.ArtALPHA;
}
_root.World.createEmptyMovieClip(boundary + "Boundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
objectload = 0;
while (objectload < _root.WorldArray[boundaryload].length) {
_root.World[boundary + "Boundary"].objects = objectload + 1;
_root.World[boundary + "Boundary"].createEmptyMovieClip("Object" + (objectload + 1), _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
anchorload = 0;
while (anchorload < _root.WorldArray[boundaryload][objectload].length) {
if ((anchorload == 0) && (_root.WorldArray[boundaryload][objectload][anchorload][0] != "Art")) {
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].lineStyle(1, 0, 100);
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].beginFill(boundaryCOLOR, boundaryALPHA);
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].moveTo(_root.WorldArray[boundaryload][objectload][anchorload][1], _root.WorldArray[boundaryload][objectload][anchorload][2]);
} else if (_root.WorldArray[boundaryload][objectload][anchorload][0] != "Art") {
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].lineTo(_root.WorldArray[boundaryload][objectload][anchorload][1], _root.WorldArray[boundaryload][objectload][anchorload][2]);
} else if (_root.WorldArray[boundaryload][objectload][anchorload][0] == "Art") {
anchorload++;
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].removeMovieClip();
_root.World[boundary + "Boundary"].attachMovie(_root.WorldArray[boundaryload][objectload][anchorload][0], _root.WorldArray[boundaryload][objectload][anchorload][0] + (objectload + 1), _root.attachDEPTH, {_x:_root.WorldArray[boundaryload][objectload][anchorload][1], _y:_root.WorldArray[boundaryload][objectload][anchorload][2]});
break;
}
anchorload++;
}
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].endFill();
objectload++;
}
boundaryload++;
}
}
stop();
Instance of Symbol 851 MovieClip "World" in Frame 58
onClipEvent (load) {
_name = "World";
framerateDEFAULT = 24;
framerateMAX = 120;
framerateMIN = 12;
DEGtoRAD = (Math.PI/180);
bubbleDEPTH = 1000;
this.bottomlesspit = 5000;
this.Player1.points = 0;
this.points = 0;
this.badguyDISTANCEMAX = 150;
this.bomberCHANCE = 216;
this.bombers = 0;
this.Goombas = 0;
this.KoopaTroopas = 0;
this.AttackDogs = 0;
this.Barrels = 0;
this.BarrelsFilled = 0;
digitMODE = "constant";
charALIVE = true;
charBLINK = true;
charBLINKTIME = 1;
charBLINKTIMER = 0;
Player1.rocksloaded = 0;
Player1.rocksthrown = 0;
Player1.rocksloadedMAX = 3;
rocksMAX = 6;
dHEIGHT = 0.5;
uHEIGHT = 0.5;
rWIDTH = 0.5;
rHEIGHT = 0;
urWIDTH = 0.3;
urHEIGHT = 0.25;
lWIDTH = 0.5;
lHEIGHT = 0;
ulWIDTH = 0.3;
ulHEIGHT = 0.25;
offsetX = 0;
offsetY = 0;
charACTION = true;
initWIDTH = Player1.sensor._width;
initHEIGHT = Player1.sensor._height;
initHYP = Math.sqrt(Math.pow(initWIDTH, 2) + Math.pow(initHEIGHT, 2));
initANGLE1 = Math.asin(initHEIGHT / initHYP);
initANGLE2 = Math.asin(initWIDTH / initHYP);
slopesensorRATIO = 3;
floorpushes = 100;
speedXMAX = 25;
speedYMAX = 25;
speedMAXdivisor = 1;
speedXMIN = 0.05;
speedYMIN = 0.05;
slidespeedMIN = 0.05;
jumpTHRESHOLD = 2;
airjumpsMAX = 1;
duckjumpRATIO = 2;
throwTIME = 2.5;
throwANGLEup = 65;
throwANGLEforward = 75;
throwANGLEdown = 120;
nosedivebounceTIME = 0.25;
swimcollideMAX = 7;
duckpaddleFALLSPEED = 7.5;
duckpaddleRATIO = 3;
faceX = 1;
faceY = 1;
digitARCLENGTH = 22.5;
engineloops = 4;
speedmultiUNIVERSAL = 1;
speedmultiX = speedmultiUNIVERSAL;
speedmultiY = speedmultiUNIVERSAL;
speedmultiROT = speedmultiUNIVERSAL;
movedragX = 1.175;
movedragY = 1.175;
slidedragX = 1.01;
slidedragY = 1.01;
waterdragX = 2.5;
waterdragY = 2.5;
swimdragX = 1.004;
swimdragY = 1.004;
watergroundfriction = 1.05;
throwdrag = 2.5;
swimspindrag = 1.1;
airspindrag = 1.1;
windrateX = 0 * speedmultiX;
windrateY = 0 * speedmultiY;
watercurrentrateX = 0 * speedmultiX;
watercurrentrateY = 0 * speedmultiY;
gravityrateX = 0 * speedmultiX;
gravityrateY = 0.25 * speedmultiY;
gspeedX = 0 * speedmultiX;
gspeedY = 0 * speedmultiY;
windX = 0 * speedmultiX;
windY = 0 * speedmultiY;
windspeedX = 0 * speedmultiX;
windspeedY = 0 * speedmultiY;
environment = "falling";
environmentchecker = "air";
moverate = 0.6 * speedmultiUNIVERSAL;
sliderate = 0.75 * speedmultiUNIVERSAL;
sliderampBOOST = 0.8 * speedmultiUNIVERSAL;
sliderampTHRESHOLD = 13;
swimspeedMAXTRANSFER = 15 * speedmultiUNIVERSAL;
jumprateX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
jumprateY = (40 * gravityrateY) / Math.sqrt(speedmultiY);
walljumpTIME = 20;
nosedivejumprateX = jumprateX * 1.4;
nosedivejumprateY = jumprateY * 1.4;
springrateX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
springrateY = (50 * gravityrateY) / Math.sqrt(speedmultiY);
nosediveBOUNCEXrate = 0.5;
nosediveBOUNCEYrate = (24 * gravityrateY) / Math.sqrt(speedmultiY);
nosediveBOUNCEspinrate = 17 * speedmultiROT;
swimrateX = (1 * gravityrateY) / Math.sqrt(speedmultiY);
swimrateY = (1 * gravityrateY) / Math.sqrt(speedmultiY);
throwrate = (40 * gravityrateY) / Math.sqrt(speedmultiY);
swimspinrate = 0.5 * speedmultiROT;
airspinrate = 0.75 * speedmultiROT;
watergroundboostX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
watergroundboostY = (0 * gravityrateY) / Math.sqrt(speedmultiY);
moveX = 0 * speedmultiX;
moveY = 0 * speedmultiY;
movespeedX = 0 * speedmultiX;
movespeedY = 0 * speedmultiY;
jumpX = 0 * speedmultiX;
jumpY = 0 * speedmultiY;
walljumpTIMER = 0;
airjumpCOUNT = 0;
jumpspeedX = 0 * speedmultiX;
jumpspeedY = 0 * speedmultiY;
swimX = 0 * speedmultiX;
swimY = 0 * speedmultiY;
swimX2 = 0 * speedmultiX;
swimY2 = 0 * speedmultiY;
swimI = 0 * speedmultiUNIVERSAL;
swimspeedX = 0 * speedmultiX;
swimspeedY = 0 * speedmultiY;
speedX = 0 * speedmultiX;
speedY = 0 * speedmultiY;
swimspin = 0 * speedmultiROT;
swimspinspeed = 0 * speedmultiROT;
airspin = 0 * speedmultiROT;
airspinspeed = 0 * speedmultiROT;
camera._visible = false;
stagehalfWIDTH = 275;
stagehalfHEIGHT = 200;
stageWIDTH = 550;
stageHEIGHT = 400;
camLOOSENESS = 50;
camMOVEXLEAD = 30;
camMOVEYLEAD = -30;
camWATERXLEAD = 5;
camWATERYLEAD = 5;
zoomMIN = 125;
zoomMAX = 250;
zoomMINmanual = zoomMIN;
zoomMAXmanual = zoomMAX;
camera._xscale = zoomMIN;
camera._yscale = zoomMIN;
zoomINCREMENT = 0.25 * speedmultiX;
zoomINCREMENTmanual = 1;
zoomLEAD = 90;
safezoneDISTANCE = 100;
startTime = getTimer();
numFrames = 0;
recentSetting = 5;
recentNumFrames = 0;
recentStartTime = startTime;
charX = Player1._x;
charY = Player1._y;
charROT = Player1._rotation;
charsensorX = Player1.sensor._x;
charsensorY = Player1.sensor._y;
charsensorWIDTH = Player1.sensor._width;
charsensorHEIGHT = Player1.sensor._height;
camX = camera._x;
camY = camera._y;
camROT = camera._rotation;
camXSCALE = camera._xscale;
camYSCALE = camera._yscale;
camWIDTHinit = camera._width;
camHEIGHTinit = camera._height;
camWIDTH = camera._width;
camHEIGHT = camera._height;
worldX = _x;
worldY = _y;
worldROT = _rotation;
worldXSCALE = _xscale;
worldYSCALE = _yscale;
}
onClipEvent (enterFrame) {
_root.player1points = this.Player1.points;
_root.totalpoints = this.points;
numFrames++;
now = getTimer();
elapsedSeconds = (now - startTime) / 1000;
actualFPS = numFrames / elapsedSeconds;
recentNumFrames++;
if (recentNumFrames == recentSetting) {
recentElapsedSeconds = (now - recentStartTime) / 1000;
recentFPSoutput = recentNumFrames / recentElapsedSeconds;
recentStartTime = now;
recentNumFrames = 0;
}
if (((recentFPSoutput >= framerateMIN) && (recentFPSoutput <= framerateMAX)) && (elapsedSeconds >= 1)) {
engineloops = framerateMAX / Math.ceil(recentFPSoutput);
} else if (elapsedSeconds < 1) {
engineloops = framerateMAX / framerateDEFAULT;
}
if ((Key.isDown(_root.kPAUSE) && (_root.PAUSE == false)) && (this.pausearmed == true)) {
_root.PAUSE = true;
this.pausearmed = false;
_root.pauseSTART = getTimer() / 1000;
} else if (((Key.isDown(_root.kPAUSE) && (_root.PAUSE == true)) && (this.pausearmed == true)) && (_root.textbubble == undefined)) {
_root.PAUSE = false;
this.pausearmed = false;
_root.pauseEND = getTimer() / 1000;
_root.pauseTIME = _root.pauseTIME + (_root.pauseEND - _root.pauseSTART);
}
if (!Key.isDown(_root.kPAUSE)) {
this.pausearmed = true;
}
if (_root.PAUSE == true) {
engineloops = 0;
}
worldXinit = _x;
worldYinit = _y;
worldROTinit = _rotation;
worldXSCALEinit = _xscale;
worldYSCALEinit = _yscale;
if (charALIVE == false) {
_root.kRIGHT = undefined;
_root.kLEFT = undefined;
_root.kUP = undefined;
_root.kDOWN = undefined;
_root.kJUMP = undefined;
_root.kTHROW = undefined;
_root.died = true;
_root.levelselect = false;
}
if ((charBLINK == true) && (charBLINKTIMER < charBLINKTIME)) {
if (Player1._visible == true) {
Player1._visible = false;
} else {
Player1._visible = true;
}
charBLINKTIMER = charBLINKTIMER + ((1 / this.framerateMAX) * this.engineloops);
} else {
Player1._visible = true;
charBLINKTIMER = 0;
charBLINK = false;
}
if ((random(bomberCHANCE) == 0) && (_root.PAUSE == false)) {
if (random(2) == 0) {
bomberDIRX = 1;
} else {
bomberDIRX = -1;
}
bomberDIRY = -1;
bombers = bombers + 1;
this.attachMovie("Bomber 1", "Bomber" + bombers, _root.attachDEPTH, {_x:this.camera._x + (((this.camera._width / 2) + this.badguyDISTANCEMAX) * bomberDIRX), _y:this.camera._y + (random(this.camera._width / 2) * bomberDIRY), flyDIR:bomberDIRX});
_root.attachDEPTH = _root.attachDEPTH + 1;
}
frameloops = 1;
while (frameloops <= engineloops) {
if (environmentchecker != "bellyslide") {
charWIDTH = Math.abs(Math.cos(initANGLE1 - ((Math.abs(charROT) + 180) * DEGtoRAD)) * initHYP);
charHEIGHT = Math.abs(Math.cos(initANGLE2 - ((Math.abs(charROT) + 180) * DEGtoRAD)) * initHYP);
} else {
charWIDTH = initWIDTH;
charHEIGHT = initWIDTH;
}
slopesensorDISTANCE = charWIDTH / slopesensorRATIO;
if (((speedY >= 0) && (SoftBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true))) || ((speedY >= 0) && (HardBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)))) {
TOUCHground = true;
if (((speedY >= 0) && (SoftBoundary.DigitBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true))) || ((speedY >= 0) && (HardBoundary.DigitBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)))) {
TOUCHdigit = true;
} else {
TOUCHdigit = false;
}
} else {
TOUCHground = false;
TOUCHdigit = false;
}
if (HardBoundary.hitTest((((((charsensorX + charX) + offsetX) + (charWIDTH * 0.5)) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.25)) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHwallright = true;
} else {
TOUCHwallright = false;
}
if (HardBoundary.hitTest((((((charsensorX + charX) + offsetX) - (charWIDTH * 0.5)) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.25)) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHwallleft = true;
} else {
TOUCHwallleft = false;
}
if (HardBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) - (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHceiling = true;
} else {
TOUCHceiling = false;
}
if (Water.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, ((((charsensorY + charY) + offsetY) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHwater = true;
} else {
TOUCHwater = false;
}
if (Spring.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true) && (speedY >= 0)) {
TOUCHspring = true;
} else {
TOUCHspring = false;
}
if (charY > bottomlesspit) {
charALIVE = false;
}
if (((_root.World.charBLINK == false) && (_root.DeathBoundaryPresent == true)) && (this.DeathBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, ((((charsensorY + charY) + offsetY) * worldYSCALEinit) / 100) + worldYinit, true))) {
if (this.Player1.rocksloaded > 0) {
this.throwANGLEdamaged = random(90) - 45;
this.throwratedamaged = 8;
this.Player1.rocksthrown = this.Player1.rocksthrown + 1;
this.attachMovie("Rock 1", "rock" + this.Player1.rocksthrown, 100 + this.Player1.rocksthrown, {_x:this.charsensorX + this.charX, _y:(this.charsensorY + this.charY) - ((this.charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEdamaged * DEGtoRAD) * throwratedamaged) * this.faceX) + this.speedX, throwspeedY:(Math.cos(throwANGLEdamaged * DEGtoRAD) * throwratedamaged) - this.speedY, weapon:false});
this.oldrock = this.Player1.rocksthrown - this.rocksMAX;
this["rock" + this.oldrock].removeMovieClip();
this.Player1.rocksloaded = this.Player1.rocksloaded - 1;
this.charBLINK = true;
_root.soundManager_mc.playSound("jump2.wav", 0, 1);
} else {
this.charALIVE = false;
}
}
if ((((environmentchecker == "air") && (TOUCHwater == true)) && (Math.abs(speedY) < duckpaddleFALLSPEED)) || (environment == "duckpaddle")) {
environment = "duckpaddle";
} else if (((((TOUCHwater == true) && (TOUCHground == true)) || ((TOUCHwater == true) && (TOUCHceiling == true))) || ((TOUCHwater == true) && (TOUCHwallleft == true))) || ((TOUCHwater == true) && (TOUCHwallright == true))) {
environment = "watergrounded";
} else if ((TOUCHwater == true) && (speedY < 0)) {
environment = "swimmingupward";
} else if (((TOUCHwater == true) && (TOUCHground == false)) && (speedY >= 0)) {
environment = "swimmingdownward";
} else if ((TOUCHspring == true) && (speedY >= 0)) {
environment = "sprung";
} else if ((TOUCHground == true) && (speedY >= 0)) {
environment = "grounded";
} else if (speedY < 0) {
environment = "flying";
} else if (((((TOUCHwallright == true) && (Key.isDown(_root.kRIGHT))) && (TOUCHground == false)) && (speedY >= 0)) || ((((TOUCHwallleft == true) && Key.isDown(_root.kLEFT)) && (TOUCHground == false)) && (speedY >= 0))) {
environment = "wallslide";
} else if ((TOUCHground == false) && (speedY >= 0)) {
environment = "falling";
}
if (((Player1.rocksloaded > 0) && (throwarmed == true)) && (Key.isDown(_root.kTHROW))) {
_root.soundManager_mc.stopSound("throw 1", 0, 1);
_root.soundManager_mc.playSound("throw 1", 0, 1);
Player1.rocksthrown = Player1.rocksthrown + 1;
if (environment != "wallslide") {
if (Key.isDown(_root.kUP)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:charsensorX + charX, _y:(charsensorY + charY) - ((charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEup * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEup * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else if (Key.isDown(_root.kDOWN)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * faceX), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEdown * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEdown * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * faceX), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEforward * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEforward * DEGtoRAD) * throwrate) - speedY, weapon:true});
}
} else if (Key.isDown(_root.kUP)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:charsensorX + charX, _y:(charsensorY + charY) - ((charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEup * DEGtoRAD) * throwrate) * (-faceX)) + speedX, throwspeedY:(Math.cos(throwANGLEup * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else if (Key.isDown(_root.kDOWN)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * (-faceX)), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEdown * DEGtoRAD) * throwrate) * (-faceX)) + speedX, throwspeedY:(Math.cos(throwANGLEdown * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * (-faceX)), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEforward * DEGtoRAD) * throwrate) * (-faceX)) + speedX, throwspeedY:(Math.cos(throwANGLEforward * DEGtoRAD) * throwrate) - speedY, weapon:true});
}
oldrock = Player1.rocksthrown - rocksMAX;
this["rock" + oldrock].removeMovieClip();
Player1.rocksloaded = Player1.rocksloaded - 1;
throwarmed = false;
} else if (!Key.isDown(_root.kTHROW)) {
throwarmed = true;
} else {
throwarmed = false;
}
if (environment == "grounded") {
if ((environmentchecker != "bellyslide") && (environmentchecker != "nosedivebounce")) {
movementhyp = moverate / Math.pow(Math.pow(dr - dl, 2) + Math.pow(slopesensorDISTANCE, 2), 0.5);
if (Key.isDown(_root.kRIGHT) && (TOUCHwallright == false)) {
moveX = movementhyp * slopesensorDISTANCE;
moveY = movementhyp * (-Math.abs(dr - dl));
faceX = 1;
} else if (Key.isDown(_root.kLEFT) && (TOUCHwallleft == false)) {
moveX = movementhyp * (-slopesensorDISTANCE);
moveY = movementhyp * (-Math.abs(dr - dl));
faceX = -1;
} else {
moveX = 0;
moveY = 0;
}
}
if (Key.isDown(_root.kJUMP) && (jumparmed == true)) {
jumpX = 0;
jumpY = jumprateY;
gspeedX = 0;
gspeedY = 0;
moveY = 0;
movespeedY = 0;
jumparmed = false;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
} else if ((environment == "wallslide") || (environmentchecker == "wallsliding")) {
if (Key.isDown(_root.kRIGHT)) {
faceX = 1;
} else if (Key.isDown(_root.kLEFT)) {
faceX = -1;
}
if (Key.isDown(_root.kJUMP) && (jumparmed == true)) {
jumpX = 0;
jumpY = jumprateY * 1.2;
gspeedX = 0;
gspeedY = 0;
if (Key.isDown(_root.kRIGHT)) {
moveX = -moverate;
} else if (Key.isDown(_root.kLEFT)) {
moveX = moverate;
}
moveY = 0;
movespeedY = 0;
jumparmed = false;
walljumpTIMER = walljumpTIME;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
} else if ((environment == "flying") || (environment == "falling")) {
if (walljumpTIMER <= 0) {
if (environmentchecker != "bellyslide") {
if (Key.isDown(_root.kRIGHT) && (TOUCHwallright == false)) {
moveX = moverate;
faceX = 1;
} else if (Key.isDown(_root.kLEFT) && (TOUCHwallleft == false)) {
moveX = -moverate;
faceX = -1;
} else {
moveX = 0;
}
} else {
moveX = 0;
}
walljumpTIMER = 0;
} else {
walljumpTIMER = walljumpTIMER - 1;
}
if (((Key.isDown(_root.kJUMP) && (jumparmed == true)) && (airjumpCOUNT > 0)) && (walljumpTIMER <= 0)) {
jumpspeedX = 0;
jumpspeedY = jumprateY;
gspeedX = 0;
gspeedY = 0;
moveY = 0;
movespeedY = 0;
jumparmed = false;
airjumpCOUNT = airjumpCOUNT - 1;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
if (environmentchecker == "ground") {
jumpassists = 0;
}
if (((((((jumpassists == 0) && (Key.isDown(_root.kJUMP))) && (gspeedY <= jumpTHRESHOLD)) && ((dr + dl) > -2)) && (walljumpTIMER <= 0)) && (TOUCHwallleft == false)) && (TOUCHwallright == false)) {
airjumpCOUNT = airjumpsMAX;
jumpassists = jumpassists + 1;
}
} else if ((((environment == "duckpaddle") || (environment == "swimmingupward")) || (environment == "swimmingdownward")) || (environment == "watergrounded")) {
if ((Key.isDown(_root.kRIGHT) && (Key.isDown(_root.kUP))) && (environment != "duckpaddle")) {
if ((charROT > -135) && (charROT <= 45)) {
if ((45 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-135 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((45 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-135 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if (Key.isDown(_root.kRIGHT) && (Key.isDown(_root.kDOWN))) {
if ((charROT > -45) && (charROT <= 135)) {
if ((135 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-45 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((135 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-45 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((Key.isDown(_root.kLEFT) && (Key.isDown(_root.kUP))) && (environment != "duckpaddle")) {
if ((charROT >= -45) && (charROT < 135)) {
if ((-45 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (135 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((-45 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (135 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kLEFT) && (Key.isDown(_root.kDOWN))) {
if ((charROT >= -135) && (charROT < 45)) {
if ((-135 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (45 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((-135 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (45 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kRIGHT)) {
if (environment == "duckpaddle") {
faceX = 1;
} else if ((charROT >= -90) && (charROT < 90)) {
if ((90 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-90 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((90 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-90 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if (Key.isDown(_root.kLEFT)) {
if (environment == "duckpaddle") {
faceX = -1;
} else if ((charROT > -90) && (charROT <= 90)) {
if ((90 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (-90 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((90 > (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (-90 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kUP) && (environment != "duckpaddle")) {
if (faceX > 0) {
if ((0 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-180 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 0;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((0 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (180 > (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 0;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kDOWN)) {
if (environment == "duckpaddle") {
swimX2 = swimX2 / duckpaddleRATIO;
swimY2 = swimY2 / duckpaddleRATIO;
environment = "swimmingdownward";
}
if (faceX < 0) {
if ((0 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (-180 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 180;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((0 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (180 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 180;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else {
swimspin = 0;
}
if ((swimspeedX > 0) && (environment != "duckpaddle")) {
faceX = 1;
} else if ((swimspeedX < 0) && (environment != "duckpaddle")) {
faceX = -1;
}
if (Key.isDown(_root.kJUMP) && (swimarmed == true)) {
if ((Key.isDown(_root.kUP) && (environment == "duckpaddle")) && (duckjumparmed == true)) {
while (Water.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((charY + offsetY) * worldYSCALEinit) / 100) + worldYinit, true)) {
charY = charY - 1;
}
jumpX = jumprateX;
jumpY = jumprateY;
environment = "duckjump";
environmentchecker = "duckjump";
duckjumparmed = false;
swimarmed = false;
} else if ((((environment == "duckpaddle") && (speedX == 0)) || (((environment == "duckpaddle") && (speedX > 0)) && (TOUCHwallright == false))) || (((environment == "duckpaddle") && (speedX < 0)) && (TOUCHwallleft == false))) {
if (((speedY == 0) || ((speedY > 0) && (TOUCHground == false))) || ((speedY < 0) && (TOUCHceiling == false))) {
swimX = swimrateX / duckpaddleRATIO;
swimY = swimrateY / duckpaddleRATIO;
swimarmed = false;
}
} else if (((speedX == 0) || ((speedX > 0) && (TOUCHwallright == false))) || ((speedX < 0) && (TOUCHwallleft == false))) {
if (((speedY == 0) || ((speedY > 0) && (TOUCHground == false))) || ((speedY < 0) && (TOUCHceiling == false))) {
swimX = swimrateX;
swimY = swimrateY;
swimarmed = false;
}
}
} else {
swimX = 0;
swimY = 0;
}
if (!Key.isDown(_root.kJUMP)) {
swimarmed = true;
duckjumparmed = true;
}
}
if (environment == "duckpaddle") {
charROT = 90 * faceX;
if (airspinspeed != 0) {
swimspinspeed = swimspinspeed + airspinspeed;
airspinspeed = 0;
}
airspin = 0;
if ((charROT > 100) || (charROT < -100)) {
if ((environmentchecker != "water") && (environmentchecker != "duckpaddle")) {
swimI = swimI + (Math.abs(movespeedX) / 3);
}
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
gspeedX = 0;
gspeedY = 0;
gravityX = 0;
gravityY = 0;
windX = watercurrentrateX;
windY = 0;
if ((environmentchecker != "water") && (environmentchecker != "duckpaddle")) {
swimY = 0;
swimY2 = 0;
}
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
environmentchecker = "duckpaddle";
} else if ((environment == "swimmingupward") || (environment == "swimmingdownward")) {
if (airspinspeed != 0) {
swimspinspeed = swimspinspeed + airspinspeed;
airspinspeed = 0;
}
airspin = 0;
if ((charROT > 100) || (charROT < -100)) {
if (environmentchecker != "water") {
swimI = swimI + ((Math.abs(movespeedX) / 3) + (gspeedY / 3));
gspeedY = 0;
}
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = gravityrateX;
gravityY = gravityrateY;
windX = watercurrentrateX;
windY = watercurrentrateY;
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
swimY2 = swimY2 / swimdragY;
swimI = swimI / swimdragY;
gspeedX = gspeedX / waterdragX;
gspeedY = gspeedY / waterdragY;
environmentchecker = "water";
} else if (environment == "watergrounded") {
if (((Math.abs(swimX2) >= swimcollideMAX) || (Math.abs(swimY2) >= swimcollideMAX)) || (Math.abs(swimI) >= swimcollideMAX)) {
swimX2 = Math.min(swimX2, swimcollideMAX);
swimY2 = Math.min(swimY2, swimcollideMAX);
swimI = Math.min(swimI, swimcollideMAX);
} else if (((Math.abs(swimX2) >= 0.25) || (Math.abs(swimY2) >= 0.25)) || (Math.abs(swimI) >= 0.25)) {
swimX2 = swimX2 / watergroundfriction;
swimY2 = swimY2 / watergroundfriction;
swimI = swimI / watergroundfriction;
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
windX = 0;
windY = 0;
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
swimY2 = swimY2 / swimdragY;
movespeedX = movespeedX / waterdragX;
movespeedY = movespeedY / waterdragY;
environmentchecker = "waterground";
} else if ((environment == "flying") || (environment == "falling")) {
charROT = 0;
if ((dr == -1) && (dl == -1)) {
moveY = 0;
movespeedY = 0;
}
if (swimspinspeed != 0) {
airspinspeed = airspinspeed + swimspinspeed;
swimspinspeed = 0;
}
swimspin = 0;
if (((swimX2 != 0) || (swimY2 != 0)) || (swimI != 0)) {
if (environmentchecker == "duckjump") {
swimX2 = swimX2 / duckjumpRATIO;
swimI = swimI / duckjumpRATIO;
}
jumpspeedX = jumpspeedX + (Math.sin(charROT * DEGtoRAD) * swimX2);
if (environmentchecker != "duckjump") {
jumpspeedY = jumpspeedY + Math.min(Math.cos(charROT * DEGtoRAD) * (swimX2 + swimI), swimspeedMAXTRANSFER);
}
}
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
gravityX = gravityrateX;
gravityY = gravityrateY;
windX = windrateX;
windY = windrateY;
if (environment == "flying") {
jumpX = 0;
jumpY = 0;
}
airspinspeed = airspinspeed / airspindrag;
if (environmentchecker != "bellyslide") {
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
} else {
movespeedX = movespeedX / slidedragX;
movespeedY = movespeedY / slidedragY;
}
if (environmentchecker == "nosedivebounce") {
airspin = 0;
if (Math.abs(charROT) < 5) {
charROT = 0;
environmentchecker = ((gspeedY > (jumpspeedY * 2)) ? "air" : "nosedivebounce");
}
}
if (((((environmentchecker == "water") && (Key.isDown(_root.kRIGHT))) && (!Key.isDown(_root.kUP))) && (!Key.isDown(_root.kDOWN))) || ((((environmentchecker == "water") && (Key.isDown(_root.kLEFT))) && (!Key.isDown(_root.kUP))) && (!Key.isDown(_root.kDOWN)))) {
environmentchecker = "porpoising";
} else if (((environmentchecker != "porpoising") && (environmentchecker != "bellyslide")) && (environmentchecker != "nosedivebounce")) {
environmentchecker = "air";
}
} else if (environment == "wallslide") {
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 1;
swimspin = 0;
swimspinspeed = 0;
airspin = 0;
airspinspeed = 0;
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
environmentchecker = "wallsliding";
} else if (environment == "grounded") {
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
swimspin = 0;
swimspinspeed = 0;
airspin = 0;
airspinspeed = 0;
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
if (environmentchecker != "bellyslide") {
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
bellyslideTIME = 0;
} else {
if ((dr - dl) != 0) {
moveX = (((sliderate * slopesensorDISTANCE) / Math.sqrt(Math.pow(dl - dr, 2) + Math.pow(slopesensorDISTANCE, 2))) * (dl - dr)) / Math.abs(dl - dr);
moveY = (sliderate * (-Math.abs(dr - dl))) / Math.sqrt(Math.pow(dr - dl, 2) + Math.pow(slopesensorDISTANCE, 2));
} else {
moveX = 0;
moveY = 0;
}
movespeedX = movespeedX / slidedragX;
movespeedY = movespeedY / slidedragY;
}
if (((((charROT < 89) && (charROT > -89)) && (environmentchecker != "bellyslide")) || ((((environmentchecker == "bellyslide") && (Math.abs(movespeedX) <= slidespeedMIN)) && (Math.abs(dr - dl) <= 0)) && (bellyslideTIME > 100))) || (((environmentchecker == "bellyslide") && (charROT < 30)) && (charROT > -30))) {
charY = charY - ((initHEIGHT - charHEIGHT) / 2);
charROT = 0;
environmentchecker = "ground";
} else if (((charROT < 165) && (charROT > -165)) || (((environmentchecker == "bellyslide") && (charROT < 30)) && (charROT > -30))) {
charY = charY - ((initWIDTH - charHEIGHT) / 2);
charWIDTH = initWIDTH;
charHEIGHT = initWIDTH;
if (environmentchecker != "bellyslide") {
charROT = ((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD);
} else if (charROT != (((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD))) {
slopeDIFFERENCE = (((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD)) - charROT;
charROT = charROT + (slopeDIFFERENCE / 2);
}
bellyslideTIME = bellyslideTIME + 1;
environmentchecker = "bellyslide";
if ((((jumpspeedY == 0) && ((oldslopeANGLE * slopeANGLE) <= 0)) && (oldslopeANGLE != 0)) || (((jumpspeedY == 0) && ((oldslopeANGLE * slopeANGLE) <= 0)) && (slopeANGLE != 0))) {
if (((oldslopeANGLE > 0) && (speedX > 0)) || ((oldslopeANGLE < 0) && (speedX < 0))) {
moveY = 0;
movespeedY = 0;
gspeedY = 0;
rampjumpY = (sliderampBOOST * Math.abs(speedX)) * Math.cos(oldslopeANGLE * DEGtoRAD);
jumpY = ((rampjumpY > 0) ? rampjumpY : 0);
} else {
moveY = 0;
movespeedY = 0;
}
}
} else {
charY = charY - ((initHEIGHT - charHEIGHT) / 2);
charROT = 180;
if (environmentchecker != "nosedivebounce") {
nosedivebounceSTART = getTimer() / 1000;
environmentchecker = "nosedivebounce";
}
if (Key.isDown(_root.kJUMP) && (jumparmed == true)) {
airspin = airspin + (nosediveBOUNCEspinrate * faceX);
jumpX = nosedivejumprateX * faceX;
jumpY = nosedivejumprateY;
environmentchecker = "nosedivebounce";
moveY = 0;
movespeedY = 0;
jumparmed = false;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
nosedivebounceTIMER = (getTimer() / 1000) - nosedivebounceSTART;
if (nosedivebounceTIMER >= nosedivebounceTIME) {
airspin = airspin + (nosediveBOUNCEspinrate * faceX);
jumpX = nosediveBOUNCEXrate * faceX;
jumpY = nosediveBOUNCEYrate;
}
}
} else if (environment == "sprung") {
swimX2 = 0;
swimY2 = 0;
swimI = 0;
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
if (TOUCHwater == false) {
jumpX = springrateX;
jumpY = springrateY;
swimX = 0;
swimY = 0;
} else {
swimX = springrateX;
swimY = springrateY;
jumpX = 0;
jumpY = 0;
}
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
environmentchecker = "sprung";
}
movespeedX = movespeedX + moveX;
jumpspeedX = jumpspeedX + jumpX;
swimX2 = swimX2 + swimX;
if ((charROT == 180) || (charROT == -180)) {
swimspeedX = 0;
} else {
swimspeedX = Math.sin(charROT * DEGtoRAD) * (swimX2 + swimI);
}
gspeedX = gspeedX + gravityX;
windspeedX = windX;
movespeedY = movespeedY + moveY;
jumpspeedY = jumpspeedY + jumpY;
swimY2 = swimY2 + swimY;
swimspeedY = Math.cos(charROT * DEGtoRAD) * (swimY2 + swimI);
gspeedY = gspeedY + gravityY;
windspeedY = windY;
if (Math.abs(movespeedX) < 0.1) {
movespeedX = 0;
}
if (Math.abs(movespeedY) < 0.1) {
movespeedY = 0;
}
speedX = (((movespeedX + jumpspeedX) + swimspeedX) - gspeedX) + windspeedX;
speedY = ((((-movespeedY) - jumpspeedY) - swimspeedY) + gspeedY) - windspeedY;
if (speedX > speedXMAX) {
speedX = speedX - (speedX - speedXMAX);
} else if (speedX < (-speedXMAX)) {
speedX = speedX + (speedXMAX - speedX);
}
if (speedY > speedYMAX) {
speedY = speedY - (speedY - speedYMAX);
} else if (speedY < (-speedYMAX)) {
speedY = speedY + (speedYMAX - speedY);
}
if (Math.abs(speedX) < speedMINX) {
speedX = 0;
}
if (Math.abs(speedY) < speedMINY) {
speedY = 0;
}
charX = charX + speedX;
charY = charY + speedY;
swimspinspeed = swimspinspeed + swimspin;
airspinspeed = airspinspeed + airspin;
speedROT = swimspinspeed + airspinspeed;
charROT = charROT + speedROT;
if (charROT > 180) {
charROT = charROT - 360;
} else if (charROT < -180) {
charROT = charROT + 360;
}
if (((speedX == 0) && (speedY == 0)) && (speedROT == 0)) {
charACTION = false;
} else {
charACTION = true;
}
if (charACTION == true) {
if (speedY > 0) {
d = 1;
while (d <= floorpushes) {
if (((!SoftBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true)) && (!HardBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true))) && (!Spring.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true))) {
charY = charY - (d - 1);
break;
}
d++;
}
} else if (speedY < 0) {
u = 1;
while (u <= floorpushes) {
if (!HardBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) - (charHEIGHT * uHEIGHT)) + u) * worldYSCALEinit) / 100) + worldYinit, true)) {
charY = charY + (u - 1);
break;
}
movespeedY = 0;
jumpspeedY = 0;
gspeedY = 0;
u++;
}
}
if ((speedX > 0) || ((environment == "wallslide") && (TOUCHwallright == true))) {
r = 1;
while (r <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) + (charWIDTH * rWIDTH)) - r) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) + (charHEIGHT * rHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX - (r - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
r++;
}
if (environmentchecker != "bellysliding") {
ur = 1;
while (ur <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) + (charWIDTH * urWIDTH)) - ur) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) - (charHEIGHT * urHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX - (ur - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
ur++;
}
}
}
if ((speedX < 0) || ((environment == "wallslide") && (TOUCHwallleft == true))) {
l = 1;
while (l <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) - (charWIDTH * lWIDTH)) + l) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) + (charHEIGHT * lHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX + (l - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
l++;
}
if (environmentchecker != "bellysliding") {
ul = 1;
while (ul <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) - (charWIDTH * ulWIDTH)) + ul) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) - (charHEIGHT * ulHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX + (ul - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
ul++;
}
}
}
}
oldslopeANGLE = slopeANGLE;
if ((((charACTION == true) && (oldTOUCHdigit == false)) && (digitMODE == "constant")) || ((charACTION == true) && (digitMODE != "constant"))) {
dr = 0;
while (dr <= floorpushes) {
if ((!SoftBoundary.hitTest(((((charX + offsetX) + (slopesensorDISTANCE / 2)) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dr) * worldYSCALEinit) / 100) + worldYinit, true)) && (!HardBoundary.hitTest(((((charX + offsetX) + slopesensorDISTANCE) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dr) * worldYSCALEinit) / 100) + worldYinit, true))) {
dr = dr - 1;
break;
}
dr++;
}
dl = 0;
while (dl <= floorpushes) {
if ((!SoftBoundary.hitTest(((((charX + offsetX) - (slopesensorDISTANCE / 2)) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dl) * worldYSCALEinit) / 100) + worldYinit, true)) && (!HardBoundary.hitTest(((((charX + offsetX) - slopesensorDISTANCE) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dl) * worldYSCALEinit) / 100) + worldYinit, true))) {
dl = dl - 1;
break;
}
dl++;
}
slopeANGLE = Math.atan((dr - dl) / slopesensorDISTANCE) / DEGtoRAD;
if ((TOUCHdigit == true) && (digitMODE == "restricted")) {
slopeANGLE = Math.round(slopeANGLE / digitARCLENGTH) * digitARCLENGTH;
if (slopeANGLE > 0) {
dr = Math.abs((Math.tan(slopeANGLE * DEGtoRAD) * slopesensorDISTANCE) / 2);
dl = -dr;
} else {
dr = -Math.abs((Math.tan(slopeANGLE * DEGtoRAD) * slopesensorDISTANCE) / 2);
dl = -dr;
}
}
}
if ((((TOUCHground == true) && (TOUCHdigit == false)) || ((jumpspeedY < gspeedY) && (jumpspeedY > 0))) || ((jumpspeedY == 0) && (gspeedY > jumpTHRESHOLD))) {
oldTOUCHdigit = false;
} else {
oldTOUCHdigit = true;
}
totalspeed = Math.pow(Math.pow(speedX, 2) + Math.pow(speedY, 2), 0.5);
if ((Key.isDown(17) && ((camXSCALE + zoomINCREMENTmanual) <= zoomMAXmanual)) && ((camYSCALE + zoomINCREMENTmanual) <= zoomMAXmanual)) {
camXSCALE = camXSCALE + zoomINCREMENTmanual;
camYSCALE = camYSCALE + zoomINCREMENTmanual;
zoomMIN = zoomMIN + zoomINCREMENTmanual;
} else if ((Key.isDown(16) && ((camXSCALE - zoomINCREMENTmanual) >= zoomMINmanual)) && ((camYSCALE - zoomINCREMENTmanual) >= zoomMINmanual)) {
camXSCALE = camXSCALE - zoomINCREMENTmanual;
camYSCALE = camYSCALE - zoomINCREMENTmanual;
zoomMIN = zoomMIN - zoomINCREMENTmanual;
} else {
if (((((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) <= (camX - (camWIDTH / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX)) || ((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) >= (camX + (camWIDTH / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camXSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) <= (camY - (camHEIGHT / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) >= (camY + (camHEIGHT / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) {
camXSCALE = camXSCALE + zoomINCREMENT;
camYSCALE = camYSCALE + zoomINCREMENT;
} else if (((((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) >= (camX - (camWIDTH / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camYSCALE - zoomINCREMENT) >= zoomMIN)) || ((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) <= (camX + (camWIDTH / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camXSCALE - zoomINCREMENT) >= zoomMIN))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) >= (camY - (camHEIGHT / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camYSCALE - zoomINCREMENT) >= zoomMIN))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) <= (camY + (camHEIGHT / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camYSCALE - zoomINCREMENT) >= zoomMIN))) {
camXSCALE = camXSCALE - zoomINCREMENT;
camYSCALE = camYSCALE - zoomINCREMENT;
}
if (((((((!Key.isDown(16)) && (charX <= ((camX - (camWIDTH / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX)) || ((((!Key.isDown(16)) && (charX >= ((camX + (camWIDTH / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camXSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && (charY <= ((camY - (camHEIGHT / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && (charY >= ((camY + (camHEIGHT / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) {
camXSCALE = camXSCALE + zoomINCREMENT;
camYSCALE = camYSCALE + zoomINCREMENT;
zoomMIN = zoomMIN + zoomINCREMENTmanual;
}
}
if ((TOUCHwater == false) && (environmentchecker != "bellyslide")) {
camspeedX = ((charX + (speedX * ((camLOOSENESS + camMOVEXLEAD) / (worldXSCALE / 100)))) - camX) / (camLOOSENESS / (worldXSCALE / 100));
if ((Math.abs(speedX) >= moverate) || (Math.abs(speedY) >= moverate)) {
camX = camX + ((Math.abs(camspeedX) > 1) ? (camspeedX) : 0);
}
} else {
camspeedX = ((charX + (speedX * ((camLOOSENESS + camWATERXLEAD) / (worldXSCALE / 100)))) - camX) / (camLOOSENESS / (worldXSCALE / 100));
if ((Math.abs(speedX) >= moverate) || (Math.abs(speedY) >= moverate)) {
camX = camX + ((Math.abs(camspeedX) > 1) ? (camspeedX) : 0);
}
}
if (((TOUCHwater == false) && (Math.abs(speedY) < 10)) && (environmentchecker != "bellyslide")) {
camspeedY = ((charY + (speedY * ((camLOOSENESS + camMOVEYLEAD) / (worldYSCALE / 100)))) - camY) / (camLOOSENESS / (worldYSCALE / 100));
camY = camY + camspeedY;
} else {
camspeedY = ((charY + (speedY * ((camLOOSENESS + camWATERYLEAD) / (worldYSCALE / 100)))) - camY) / (camLOOSENESS / (worldYSCALE / 100));
camY = camY + camspeedY;
}
if (Math.abs(camX - charX) > ((camWIDTH * 3) / 8)) {
camX = charX + ((((camWIDTH * 3) / 8) * (camX - charX)) / Math.abs(camX - charX));
}
if (Math.abs(camY - charY) > ((camHEIGHT * 3) / 8)) {
camY = charY + ((((camHEIGHT * 3) / 8) * (camY - charY)) / Math.abs(camY - charY));
}
camWIDTH = (camWIDTHinit * camXSCALE) / 100;
camHEIGHT = (camHEIGHTinit * camYSCALE) / 100;
if (!Key.isDown(46)) {
scaleX = stageWIDTH / camWIDTH;
scaleY = stageHEIGHT / camHEIGHT;
worldX = stagehalfWIDTH - (camX * scaleX);
worldY = stagehalfHEIGHT - (camY * scaleY);
worldXSCALE = 100 * scaleX;
worldYSCALE = 100 * scaleY;
camROT = 0;
worldROT = -camROT;
}
frameloops++;
}
Player1._x = charX;
Player1._y = charY;
Player1._rotation = charROT;
Player1.sensor._x = charsensorX;
Player1.sensor._y = charsensorY;
Player1.sensor._width = charsensorWIDTH;
Player1.sensor._height = charsensorHEIGHT;
if (faceX > 0) {
Player1._xscale = 100;
} else if (faceX < 0) {
Player1._xscale = -100;
}
camera._x = camX;
camera._y = camY;
camera._rotation = camROT;
camera._xscale = camXSCALE;
camera._yscale = camYSCALE;
camera._width = camWIDTH;
camera._height = camHEIGHT;
_x = worldX;
_y = worldY;
_rotation = worldROT;
_xscale = worldXSCALE;
_yscale = worldYSCALE;
}
Frame 59
if (_root.go != true) {
gotoAndStop (58);
} else {
_root.go = false;
}
Frame 60
_root.cutscene4 = false;
Mouse.show();
stopAllSounds();
_root.soundManager_mc.playSound("BreakfastEnding.wav", 0, 9999999999);
_root.died = false;
_root.levelCOMPLETE = getTimer() / 1000;
_root.levelTIME = Math.round(((_root.levelCOMPLETE + _root.levelDEADTIME) - (_root.levelSTART + _root.pauseTIME)) * 10000) / 10000;
_root.levelDEADTIME = 0;
_root.levelTIMESTR = _root.levelTIME + " sec";
_root.pointratio = Math.round((_root.player1points / _root.totalpoints) * 10000) / 100;
_root.gameTIME = _root.gameTIME + _root.levelTIME;
_root.GAMEplayer1points = _root.GAMEplayer1points + _root.player1points;
_root.gamedeaths = _root.gamedeaths + _root.leveldeaths;
if (_root.cheats != true) {
_root.topdeaths.text = "---";
if (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] != undefined) {
_root.topdeaths.text = _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"];
}
if ((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] == undefined) || (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] > _root.leveldeaths)) {
_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] = _root.leveldeaths;
} else {
_root.newdeathsrecord.text = "";
}
_root.toptime.text = "---";
if (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] != undefined) {
_root.toptime.text = _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"];
}
if ((((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] == undefined) && (_root.leveldeaths <= _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"])) || ((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] > _root.levelTIME) && (_root.leveldeaths <= _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"]))) || (_root.newdeathsrecord.text != "")) {
_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] = _root.levelTIME;
} else {
_root.newtimerecord.text = "";
}
_root.leveldeaths = 0;
_root.toppoints.text = "---";
_root.topratio.text = "---";
if (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] != undefined) {
_root.toppoints.text = _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"];
_root.topratio.text = Math.round((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] / _root.totalpoints) * 10000) / 100;
}
if ((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] == undefined) || (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] < _root.player1points)) {
_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] = _root.player1points;
} else {
_root.newcoinrecord.text = "";
_root.newratiorecord.text = "";
}
_root.savedData.data[("LVL" + _root.level.substr(6)) + "totalpoints"] = _root.totalpoints;
if (_root.savedData.data.levelMAX == 7) {
_root.savedData.data.levelMAX = 8;
}
_root.savedData.flush();
}
if (_root.stattracking == true) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl7complete");
if (_root.pointratio >= 100) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl7coins100percent");
} else if (_root.pointratio >= 50) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl7coins050percent");
}
}
stop();
Instance of Symbol 240 MovieClip in Frame 60
onClipEvent (load) {
this.textvalue = "Menu";
this.linkvalue = "Game Start";
this.gotoAndStop("Menu");
}
Frame 61
if (_root.go != true) {
gotoAndStop (60);
} else {
_root.go = false;
}
Frame 62
Mouse.show();
stopAllSounds();
_root.level = "Level 5";
_root.kRIGHT = _root.kRIGHTconfig;
_root.kLEFT = _root.kLEFTconfig;
_root.kUP = _root.kUPconfig;
_root.kDOWN = _root.kDOWNconfig;
_root.kJUMP = _root.kJUMPconfig;
_root.kTHROW = _root.kTHROWconfig;
_root.kPAUSE = _root.kPAUSEconfig;
_root.kSTART = _root.kSTARTconfig;
_root.pauseTIME = 0;
if (_root.died == true) {
_root.leveldeaths = _root.leveldeaths + 1;
}
if (_root.stattracking == true) {
if (_root.died == false) {
StatTracker.submitStat("/flashgames/breakfastclub/level8start");
} else {
StatTracker.submitStat("/flashgames/breakfastclub/level8died");
}
}
stop();
Frame 63
if (_root.go != true) {
gotoAndStop (62);
} else {
_root.go = false;
}
Frame 64
stopAllSounds();
_root.soundManager_mc.playSound("BreakfastInGame4.wav", 0, 9999999999);
if ((_root.savedData.data.levelMAX > 8) && (_root.stattracking == true)) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl8replay");
}
onMouseMove = function () {
mouseTIMERstart = getTimer() / 1000;
Mouse.show();
};
onEnterFrame = function () {
_root.timechecker();
mouseTIMER = (getTimer() / 1000) - mouseTIMERstart;
if (mouseTIMER >= mouseTIMERMAX) {
Mouse.hide();
}
};
_root.attachDEPTH = _root.GAMEattachDEPTH;
_root.WorldString = undefined;
if (_root.WorldString != undefined) {
SoftCOLOR = 65535;
SoftALPHA = 50;
TiledCOLOR = 16711935 /* 0xFF00FF */;
TiledALPHA = 50;
HardCOLOR = 16711680 /* 0xFF0000 */;
HardALPHA = 50;
WaterCOLOR = 255;
WaterALPHA = 50;
SpringCOLOR = 16776960 /* 0xFFFF00 */;
SpringALPHA = 50;
_root.World.createEmptyMovieClip("SoftBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.SoftBoundary.objects = 0;
_root.WorldArray[0] = [];
_root.World.createEmptyMovieClip("TiledBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.TiledBoundary.objects = 0;
_root.WorldArray[1] = [];
_root.World.createEmptyMovieClip("HardBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.SoftBoundary.objects = 0;
_root.WorldArray[2] = [];
_root.World.createEmptyMovieClip("WaterBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.WaterBoundary.objects = 0;
_root.WorldArray[3] = [];
_root.World.createEmptyMovieClip("SpringBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.SpringBoundary.objects = 0;
_root.WorldArray[4] = [];
_root.World.createEmptyMovieClip("Art", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.Art.objects = 0;
_root.WorldArray[5] = [];
_root.WorldArray = _root.WorldString.split(">>>>");
boundaryelements = 0;
while (boundaryelements < _root.WorldArray.length) {
_root.WorldArray[boundaryelements] = _root.WorldArray[boundaryelements].split("|");
objectelements = 0;
while (objectelements < _root.WorldArray[boundaryelements].length) {
_root.WorldArray[boundaryelements][objectelements] = _root.WorldArray[boundaryelements][objectelements].split("/");
anchorelements = 0;
while (anchorelements < _root.WorldArray[boundaryelements][objectelements].length) {
_root.WorldArray[boundaryelements][objectelements][anchorelements] = _root.WorldArray[boundaryelements][objectelements][anchorelements].split(",");
anchorelements++;
}
objectelements++;
}
boundaryelements++;
}
boundaryload = 0;
while (boundaryload < _root.WorldArray.length) {
if (boundaryload == 0) {
boundary = "Soft";
boundaryCOLOR = _root.SoftCOLOR;
boundaryALPHA = _root.SoftALPHA;
} else if (boundaryload == 1) {
boundary = "Tile";
boundaryCOLOR = _root.TileCOLOR;
boundaryALPHA = _root.TileALPHA;
} else if (boundaryload == 2) {
boundary = "Hard";
boundaryCOLOR = _root.HardCOLOR;
boundaryALPHA = _root.HardALPHA;
} else if (boundaryload == 3) {
boundary = "Water";
boundaryCOLOR = _root.WaterCOLOR;
boundaryALPHA = _root.WaterALPHA;
} else if (boundaryload == 4) {
boundary = "Spring";
boundaryCOLOR = _root.SpringCOLOR;
boundaryALPHA = _root.SpringALPHA;
} else if (boundaryload == 5) {
boundary = "Art";
boundaryCOLOR = _root.ArtCOLOR;
boundaryALPHA = _root.ArtALPHA;
}
_root.World.createEmptyMovieClip(boundary + "Boundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
objectload = 0;
while (objectload < _root.WorldArray[boundaryload].length) {
_root.World[boundary + "Boundary"].objects = objectload + 1;
_root.World[boundary + "Boundary"].createEmptyMovieClip("Object" + (objectload + 1), _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
anchorload = 0;
while (anchorload < _root.WorldArray[boundaryload][objectload].length) {
if ((anchorload == 0) && (_root.WorldArray[boundaryload][objectload][anchorload][0] != "Art")) {
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].lineStyle(1, 0, 100);
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].beginFill(boundaryCOLOR, boundaryALPHA);
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].moveTo(_root.WorldArray[boundaryload][objectload][anchorload][1], _root.WorldArray[boundaryload][objectload][anchorload][2]);
} else if (_root.WorldArray[boundaryload][objectload][anchorload][0] != "Art") {
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].lineTo(_root.WorldArray[boundaryload][objectload][anchorload][1], _root.WorldArray[boundaryload][objectload][anchorload][2]);
} else if (_root.WorldArray[boundaryload][objectload][anchorload][0] == "Art") {
anchorload++;
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].removeMovieClip();
_root.World[boundary + "Boundary"].attachMovie(_root.WorldArray[boundaryload][objectload][anchorload][0], _root.WorldArray[boundaryload][objectload][anchorload][0] + (objectload + 1), _root.attachDEPTH, {_x:_root.WorldArray[boundaryload][objectload][anchorload][1], _y:_root.WorldArray[boundaryload][objectload][anchorload][2]});
break;
}
anchorload++;
}
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].endFill();
objectload++;
}
boundaryload++;
}
}
stop();
Instance of Symbol 902 MovieClip "World" in Frame 64
onClipEvent (load) {
_name = "World";
framerateDEFAULT = 24;
framerateMAX = 120;
framerateMIN = 12;
DEGtoRAD = (Math.PI/180);
bubbleDEPTH = 1000;
this.bottomlesspit = 5000;
this.Player1.points = 0;
this.points = 0;
this.badguyDISTANCEMAX = 150;
this.bomberCHANCE = 216;
this.bombers = 0;
this.Goombas = 0;
this.KoopaTroopas = 0;
this.AttackDogs = 0;
this.Barrels = 0;
this.BarrelsFilled = 0;
digitMODE = "constant";
charALIVE = true;
charBLINK = true;
charBLINKTIME = 1;
charBLINKTIMER = 0;
Player1.rocksloaded = 0;
Player1.rocksthrown = 0;
Player1.rocksloadedMAX = 3;
rocksMAX = 6;
dHEIGHT = 0.5;
uHEIGHT = 0.5;
rWIDTH = 0.5;
rHEIGHT = 0;
urWIDTH = 0.3;
urHEIGHT = 0.25;
lWIDTH = 0.5;
lHEIGHT = 0;
ulWIDTH = 0.3;
ulHEIGHT = 0.25;
offsetX = 0;
offsetY = 0;
charACTION = true;
initWIDTH = Player1.sensor._width;
initHEIGHT = Player1.sensor._height;
initHYP = Math.sqrt(Math.pow(initWIDTH, 2) + Math.pow(initHEIGHT, 2));
initANGLE1 = Math.asin(initHEIGHT / initHYP);
initANGLE2 = Math.asin(initWIDTH / initHYP);
slopesensorRATIO = 3;
floorpushes = 100;
speedXMAX = 25;
speedYMAX = 25;
speedMAXdivisor = 1;
speedXMIN = 0.05;
speedYMIN = 0.05;
slidespeedMIN = 0.05;
jumpTHRESHOLD = 2;
airjumpsMAX = 1;
duckjumpRATIO = 2;
throwTIME = 2.5;
throwANGLEup = 65;
throwANGLEforward = 75;
throwANGLEdown = 120;
nosedivebounceTIME = 0.25;
swimcollideMAX = 7;
duckpaddleFALLSPEED = 7.5;
duckpaddleRATIO = 3;
faceX = 1;
faceY = 1;
digitARCLENGTH = 22.5;
engineloops = 4;
speedmultiUNIVERSAL = 1;
speedmultiX = speedmultiUNIVERSAL;
speedmultiY = speedmultiUNIVERSAL;
speedmultiROT = speedmultiUNIVERSAL;
movedragX = 1.175;
movedragY = 1.175;
slidedragX = 1.01;
slidedragY = 1.01;
waterdragX = 2.5;
waterdragY = 2.5;
swimdragX = 1.004;
swimdragY = 1.004;
watergroundfriction = 1.05;
throwdrag = 2.5;
swimspindrag = 1.1;
airspindrag = 1.1;
windrateX = 0 * speedmultiX;
windrateY = 0 * speedmultiY;
watercurrentrateX = 0 * speedmultiX;
watercurrentrateY = 0 * speedmultiY;
gravityrateX = 0 * speedmultiX;
gravityrateY = 0.25 * speedmultiY;
gspeedX = 0 * speedmultiX;
gspeedY = 0 * speedmultiY;
windX = 0 * speedmultiX;
windY = 0 * speedmultiY;
windspeedX = 0 * speedmultiX;
windspeedY = 0 * speedmultiY;
environment = "falling";
environmentchecker = "air";
moverate = 0.6 * speedmultiUNIVERSAL;
sliderate = 0.75 * speedmultiUNIVERSAL;
sliderampBOOST = 0.8 * speedmultiUNIVERSAL;
sliderampTHRESHOLD = 13;
swimspeedMAXTRANSFER = 15 * speedmultiUNIVERSAL;
jumprateX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
jumprateY = (40 * gravityrateY) / Math.sqrt(speedmultiY);
walljumpTIME = 20;
nosedivejumprateX = jumprateX * 1.4;
nosedivejumprateY = jumprateY * 1.4;
springrateX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
springrateY = (50 * gravityrateY) / Math.sqrt(speedmultiY);
nosediveBOUNCEXrate = 0.5;
nosediveBOUNCEYrate = (24 * gravityrateY) / Math.sqrt(speedmultiY);
nosediveBOUNCEspinrate = 17 * speedmultiROT;
swimrateX = (1 * gravityrateY) / Math.sqrt(speedmultiY);
swimrateY = (1 * gravityrateY) / Math.sqrt(speedmultiY);
throwrate = (40 * gravityrateY) / Math.sqrt(speedmultiY);
swimspinrate = 0.5 * speedmultiROT;
airspinrate = 0.75 * speedmultiROT;
watergroundboostX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
watergroundboostY = (0 * gravityrateY) / Math.sqrt(speedmultiY);
moveX = 0 * speedmultiX;
moveY = 0 * speedmultiY;
movespeedX = 0 * speedmultiX;
movespeedY = 0 * speedmultiY;
jumpX = 0 * speedmultiX;
jumpY = 0 * speedmultiY;
walljumpTIMER = 0;
airjumpCOUNT = 0;
jumpspeedX = 0 * speedmultiX;
jumpspeedY = 0 * speedmultiY;
swimX = 0 * speedmultiX;
swimY = 0 * speedmultiY;
swimX2 = 0 * speedmultiX;
swimY2 = 0 * speedmultiY;
swimI = 0 * speedmultiUNIVERSAL;
swimspeedX = 0 * speedmultiX;
swimspeedY = 0 * speedmultiY;
speedX = 0 * speedmultiX;
speedY = 0 * speedmultiY;
swimspin = 0 * speedmultiROT;
swimspinspeed = 0 * speedmultiROT;
airspin = 0 * speedmultiROT;
airspinspeed = 0 * speedmultiROT;
camera._visible = false;
stagehalfWIDTH = 275;
stagehalfHEIGHT = 200;
stageWIDTH = 550;
stageHEIGHT = 400;
camLOOSENESS = 50;
camMOVEXLEAD = 30;
camMOVEYLEAD = -30;
camWATERXLEAD = 5;
camWATERYLEAD = 5;
zoomMIN = 125;
zoomMAX = 250;
zoomMINmanual = zoomMIN;
zoomMAXmanual = zoomMAX;
camera._xscale = zoomMIN;
camera._yscale = zoomMIN;
zoomINCREMENT = 0.25 * speedmultiX;
zoomINCREMENTmanual = 1;
zoomLEAD = 90;
safezoneDISTANCE = 100;
startTime = getTimer();
numFrames = 0;
recentSetting = 5;
recentNumFrames = 0;
recentStartTime = startTime;
charX = Player1._x;
charY = Player1._y;
charROT = Player1._rotation;
charsensorX = Player1.sensor._x;
charsensorY = Player1.sensor._y;
charsensorWIDTH = Player1.sensor._width;
charsensorHEIGHT = Player1.sensor._height;
camX = camera._x;
camY = camera._y;
camROT = camera._rotation;
camXSCALE = camera._xscale;
camYSCALE = camera._yscale;
camWIDTHinit = camera._width;
camHEIGHTinit = camera._height;
camWIDTH = camera._width;
camHEIGHT = camera._height;
worldX = _x;
worldY = _y;
worldROT = _rotation;
worldXSCALE = _xscale;
worldYSCALE = _yscale;
}
onClipEvent (enterFrame) {
_root.player1points = this.Player1.points;
_root.totalpoints = this.points;
numFrames++;
now = getTimer();
elapsedSeconds = (now - startTime) / 1000;
actualFPS = numFrames / elapsedSeconds;
recentNumFrames++;
if (recentNumFrames == recentSetting) {
recentElapsedSeconds = (now - recentStartTime) / 1000;
recentFPSoutput = recentNumFrames / recentElapsedSeconds;
recentStartTime = now;
recentNumFrames = 0;
}
if (((recentFPSoutput >= framerateMIN) && (recentFPSoutput <= framerateMAX)) && (elapsedSeconds >= 1)) {
engineloops = framerateMAX / Math.ceil(recentFPSoutput);
} else if (elapsedSeconds < 1) {
engineloops = framerateMAX / framerateDEFAULT;
}
if ((Key.isDown(_root.kPAUSE) && (_root.PAUSE == false)) && (this.pausearmed == true)) {
_root.PAUSE = true;
this.pausearmed = false;
_root.pauseSTART = getTimer() / 1000;
} else if (((Key.isDown(_root.kPAUSE) && (_root.PAUSE == true)) && (this.pausearmed == true)) && (_root.textbubble == undefined)) {
_root.PAUSE = false;
this.pausearmed = false;
_root.pauseEND = getTimer() / 1000;
_root.pauseTIME = _root.pauseTIME + (_root.pauseEND - _root.pauseSTART);
}
if (!Key.isDown(_root.kPAUSE)) {
this.pausearmed = true;
}
if (_root.PAUSE == true) {
engineloops = 0;
}
worldXinit = _x;
worldYinit = _y;
worldROTinit = _rotation;
worldXSCALEinit = _xscale;
worldYSCALEinit = _yscale;
if (charALIVE == false) {
_root.kRIGHT = undefined;
_root.kLEFT = undefined;
_root.kUP = undefined;
_root.kDOWN = undefined;
_root.kJUMP = undefined;
_root.kTHROW = undefined;
_root.died = true;
_root.levelselect = false;
}
if ((charBLINK == true) && (charBLINKTIMER < charBLINKTIME)) {
if (Player1._visible == true) {
Player1._visible = false;
} else {
Player1._visible = true;
}
charBLINKTIMER = charBLINKTIMER + ((1 / this.framerateMAX) * this.engineloops);
} else {
Player1._visible = true;
charBLINKTIMER = 0;
charBLINK = false;
}
if ((random(bomberCHANCE) == 0) && (_root.PAUSE == false)) {
if (random(2) == 0) {
bomberDIRX = 1;
} else {
bomberDIRX = -1;
}
bomberDIRY = -1;
bombers = bombers + 1;
this.attachMovie("Bomber 1", "Bomber" + bombers, _root.attachDEPTH, {_x:this.camera._x + (((this.camera._width / 2) + this.badguyDISTANCEMAX) * bomberDIRX), _y:this.camera._y + (random(this.camera._width / 2) * bomberDIRY), flyDIR:bomberDIRX});
_root.attachDEPTH = _root.attachDEPTH + 1;
}
frameloops = 1;
while (frameloops <= engineloops) {
if (environmentchecker != "bellyslide") {
charWIDTH = Math.abs(Math.cos(initANGLE1 - ((Math.abs(charROT) + 180) * DEGtoRAD)) * initHYP);
charHEIGHT = Math.abs(Math.cos(initANGLE2 - ((Math.abs(charROT) + 180) * DEGtoRAD)) * initHYP);
} else {
charWIDTH = initWIDTH;
charHEIGHT = initWIDTH;
}
slopesensorDISTANCE = charWIDTH / slopesensorRATIO;
if (((speedY >= 0) && (SoftBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true))) || ((speedY >= 0) && (HardBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)))) {
TOUCHground = true;
if (((speedY >= 0) && (SoftBoundary.DigitBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true))) || ((speedY >= 0) && (HardBoundary.DigitBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)))) {
TOUCHdigit = true;
} else {
TOUCHdigit = false;
}
} else {
TOUCHground = false;
TOUCHdigit = false;
}
if (HardBoundary.hitTest((((((charsensorX + charX) + offsetX) + (charWIDTH * 0.5)) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.25)) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHwallright = true;
} else {
TOUCHwallright = false;
}
if (HardBoundary.hitTest((((((charsensorX + charX) + offsetX) - (charWIDTH * 0.5)) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.25)) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHwallleft = true;
} else {
TOUCHwallleft = false;
}
if (HardBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) - (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHceiling = true;
} else {
TOUCHceiling = false;
}
if (Water.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, ((((charsensorY + charY) + offsetY) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHwater = true;
} else {
TOUCHwater = false;
}
if (Spring.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true) && (speedY >= 0)) {
TOUCHspring = true;
} else {
TOUCHspring = false;
}
if (charY > bottomlesspit) {
charALIVE = false;
}
if (((_root.World.charBLINK == false) && (_root.DeathBoundaryPresent == true)) && (this.DeathBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, ((((charsensorY + charY) + offsetY) * worldYSCALEinit) / 100) + worldYinit, true))) {
if (this.Player1.rocksloaded > 0) {
this.throwANGLEdamaged = random(90) - 45;
this.throwratedamaged = 8;
this.Player1.rocksthrown = this.Player1.rocksthrown + 1;
this.attachMovie("Rock 1", "rock" + this.Player1.rocksthrown, 100 + this.Player1.rocksthrown, {_x:this.charsensorX + this.charX, _y:(this.charsensorY + this.charY) - ((this.charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEdamaged * DEGtoRAD) * throwratedamaged) * this.faceX) + this.speedX, throwspeedY:(Math.cos(throwANGLEdamaged * DEGtoRAD) * throwratedamaged) - this.speedY, weapon:false});
this.oldrock = this.Player1.rocksthrown - this.rocksMAX;
this["rock" + this.oldrock].removeMovieClip();
this.Player1.rocksloaded = this.Player1.rocksloaded - 1;
this.charBLINK = true;
_root.soundManager_mc.playSound("jump2.wav", 0, 1);
} else {
this.charALIVE = false;
}
}
if ((((environmentchecker == "air") && (TOUCHwater == true)) && (Math.abs(speedY) < duckpaddleFALLSPEED)) || (environment == "duckpaddle")) {
environment = "duckpaddle";
} else if (((((TOUCHwater == true) && (TOUCHground == true)) || ((TOUCHwater == true) && (TOUCHceiling == true))) || ((TOUCHwater == true) && (TOUCHwallleft == true))) || ((TOUCHwater == true) && (TOUCHwallright == true))) {
environment = "watergrounded";
} else if ((TOUCHwater == true) && (speedY < 0)) {
environment = "swimmingupward";
} else if (((TOUCHwater == true) && (TOUCHground == false)) && (speedY >= 0)) {
environment = "swimmingdownward";
} else if ((TOUCHspring == true) && (speedY >= 0)) {
environment = "sprung";
} else if ((TOUCHground == true) && (speedY >= 0)) {
environment = "grounded";
} else if (speedY < 0) {
environment = "flying";
} else if (((((TOUCHwallright == true) && (Key.isDown(_root.kRIGHT))) && (TOUCHground == false)) && (speedY >= 0)) || ((((TOUCHwallleft == true) && Key.isDown(_root.kLEFT)) && (TOUCHground == false)) && (speedY >= 0))) {
environment = "wallslide";
} else if ((TOUCHground == false) && (speedY >= 0)) {
environment = "falling";
}
if (((Player1.rocksloaded > 0) && (throwarmed == true)) && (Key.isDown(_root.kTHROW))) {
_root.soundManager_mc.stopSound("throw 1", 0, 1);
_root.soundManager_mc.playSound("throw 1", 0, 1);
Player1.rocksthrown = Player1.rocksthrown + 1;
if (environment != "wallslide") {
if (Key.isDown(_root.kUP)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:charsensorX + charX, _y:(charsensorY + charY) - ((charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEup * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEup * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else if (Key.isDown(_root.kDOWN)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * faceX), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEdown * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEdown * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * faceX), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEforward * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEforward * DEGtoRAD) * throwrate) - speedY, weapon:true});
}
} else if (Key.isDown(_root.kUP)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:charsensorX + charX, _y:(charsensorY + charY) - ((charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEup * DEGtoRAD) * throwrate) * (-faceX)) + speedX, throwspeedY:(Math.cos(throwANGLEup * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else if (Key.isDown(_root.kDOWN)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * (-faceX)), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEdown * DEGtoRAD) * throwrate) * (-faceX)) + speedX, throwspeedY:(Math.cos(throwANGLEdown * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * (-faceX)), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEforward * DEGtoRAD) * throwrate) * (-faceX)) + speedX, throwspeedY:(Math.cos(throwANGLEforward * DEGtoRAD) * throwrate) - speedY, weapon:true});
}
oldrock = Player1.rocksthrown - rocksMAX;
this["rock" + oldrock].removeMovieClip();
Player1.rocksloaded = Player1.rocksloaded - 1;
throwarmed = false;
} else if (!Key.isDown(_root.kTHROW)) {
throwarmed = true;
} else {
throwarmed = false;
}
if (environment == "grounded") {
if ((environmentchecker != "bellyslide") && (environmentchecker != "nosedivebounce")) {
movementhyp = moverate / Math.pow(Math.pow(dr - dl, 2) + Math.pow(slopesensorDISTANCE, 2), 0.5);
if (Key.isDown(_root.kRIGHT) && (TOUCHwallright == false)) {
moveX = movementhyp * slopesensorDISTANCE;
moveY = movementhyp * (-Math.abs(dr - dl));
faceX = 1;
} else if (Key.isDown(_root.kLEFT) && (TOUCHwallleft == false)) {
moveX = movementhyp * (-slopesensorDISTANCE);
moveY = movementhyp * (-Math.abs(dr - dl));
faceX = -1;
} else {
moveX = 0;
moveY = 0;
}
}
if (Key.isDown(_root.kJUMP) && (jumparmed == true)) {
jumpX = 0;
jumpY = jumprateY;
gspeedX = 0;
gspeedY = 0;
moveY = 0;
movespeedY = 0;
jumparmed = false;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
} else if ((environment == "wallslide") || (environmentchecker == "wallsliding")) {
if (Key.isDown(_root.kRIGHT)) {
faceX = 1;
} else if (Key.isDown(_root.kLEFT)) {
faceX = -1;
}
if (Key.isDown(_root.kJUMP) && (jumparmed == true)) {
jumpX = 0;
jumpY = jumprateY * 1.2;
gspeedX = 0;
gspeedY = 0;
if (Key.isDown(_root.kRIGHT)) {
moveX = -moverate;
} else if (Key.isDown(_root.kLEFT)) {
moveX = moverate;
}
moveY = 0;
movespeedY = 0;
jumparmed = false;
walljumpTIMER = walljumpTIME;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
} else if ((environment == "flying") || (environment == "falling")) {
if (walljumpTIMER <= 0) {
if (environmentchecker != "bellyslide") {
if (Key.isDown(_root.kRIGHT) && (TOUCHwallright == false)) {
moveX = moverate;
faceX = 1;
} else if (Key.isDown(_root.kLEFT) && (TOUCHwallleft == false)) {
moveX = -moverate;
faceX = -1;
} else {
moveX = 0;
}
} else {
moveX = 0;
}
walljumpTIMER = 0;
} else {
walljumpTIMER = walljumpTIMER - 1;
}
if (((Key.isDown(_root.kJUMP) && (jumparmed == true)) && (airjumpCOUNT > 0)) && (walljumpTIMER <= 0)) {
jumpspeedX = 0;
jumpspeedY = jumprateY;
gspeedX = 0;
gspeedY = 0;
moveY = 0;
movespeedY = 0;
jumparmed = false;
airjumpCOUNT = airjumpCOUNT - 1;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
if (environmentchecker == "ground") {
jumpassists = 0;
}
if (((((((jumpassists == 0) && (Key.isDown(_root.kJUMP))) && (gspeedY <= jumpTHRESHOLD)) && ((dr + dl) > -2)) && (walljumpTIMER <= 0)) && (TOUCHwallleft == false)) && (TOUCHwallright == false)) {
airjumpCOUNT = airjumpsMAX;
jumpassists = jumpassists + 1;
}
} else if ((((environment == "duckpaddle") || (environment == "swimmingupward")) || (environment == "swimmingdownward")) || (environment == "watergrounded")) {
if ((Key.isDown(_root.kRIGHT) && (Key.isDown(_root.kUP))) && (environment != "duckpaddle")) {
if ((charROT > -135) && (charROT <= 45)) {
if ((45 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-135 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((45 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-135 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if (Key.isDown(_root.kRIGHT) && (Key.isDown(_root.kDOWN))) {
if ((charROT > -45) && (charROT <= 135)) {
if ((135 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-45 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((135 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-45 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((Key.isDown(_root.kLEFT) && (Key.isDown(_root.kUP))) && (environment != "duckpaddle")) {
if ((charROT >= -45) && (charROT < 135)) {
if ((-45 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (135 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((-45 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (135 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kLEFT) && (Key.isDown(_root.kDOWN))) {
if ((charROT >= -135) && (charROT < 45)) {
if ((-135 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (45 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((-135 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (45 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kRIGHT)) {
if (environment == "duckpaddle") {
faceX = 1;
} else if ((charROT >= -90) && (charROT < 90)) {
if ((90 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-90 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((90 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-90 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if (Key.isDown(_root.kLEFT)) {
if (environment == "duckpaddle") {
faceX = -1;
} else if ((charROT > -90) && (charROT <= 90)) {
if ((90 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (-90 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((90 > (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (-90 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kUP) && (environment != "duckpaddle")) {
if (faceX > 0) {
if ((0 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-180 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 0;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((0 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (180 > (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 0;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kDOWN)) {
if (environment == "duckpaddle") {
swimX2 = swimX2 / duckpaddleRATIO;
swimY2 = swimY2 / duckpaddleRATIO;
environment = "swimmingdownward";
}
if (faceX < 0) {
if ((0 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (-180 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 180;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((0 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (180 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 180;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else {
swimspin = 0;
}
if ((swimspeedX > 0) && (environment != "duckpaddle")) {
faceX = 1;
} else if ((swimspeedX < 0) && (environment != "duckpaddle")) {
faceX = -1;
}
if (Key.isDown(_root.kJUMP) && (swimarmed == true)) {
if ((Key.isDown(_root.kUP) && (environment == "duckpaddle")) && (duckjumparmed == true)) {
while (Water.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((charY + offsetY) * worldYSCALEinit) / 100) + worldYinit, true)) {
charY = charY - 1;
}
jumpX = jumprateX;
jumpY = jumprateY;
environment = "duckjump";
environmentchecker = "duckjump";
duckjumparmed = false;
swimarmed = false;
} else if ((((environment == "duckpaddle") && (speedX == 0)) || (((environment == "duckpaddle") && (speedX > 0)) && (TOUCHwallright == false))) || (((environment == "duckpaddle") && (speedX < 0)) && (TOUCHwallleft == false))) {
if (((speedY == 0) || ((speedY > 0) && (TOUCHground == false))) || ((speedY < 0) && (TOUCHceiling == false))) {
swimX = swimrateX / duckpaddleRATIO;
swimY = swimrateY / duckpaddleRATIO;
swimarmed = false;
}
} else if (((speedX == 0) || ((speedX > 0) && (TOUCHwallright == false))) || ((speedX < 0) && (TOUCHwallleft == false))) {
if (((speedY == 0) || ((speedY > 0) && (TOUCHground == false))) || ((speedY < 0) && (TOUCHceiling == false))) {
swimX = swimrateX;
swimY = swimrateY;
swimarmed = false;
}
}
} else {
swimX = 0;
swimY = 0;
}
if (!Key.isDown(_root.kJUMP)) {
swimarmed = true;
duckjumparmed = true;
}
}
if (environment == "duckpaddle") {
charROT = 90 * faceX;
if (airspinspeed != 0) {
swimspinspeed = swimspinspeed + airspinspeed;
airspinspeed = 0;
}
airspin = 0;
if ((charROT > 100) || (charROT < -100)) {
if ((environmentchecker != "water") && (environmentchecker != "duckpaddle")) {
swimI = swimI + (Math.abs(movespeedX) / 3);
}
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
gspeedX = 0;
gspeedY = 0;
gravityX = 0;
gravityY = 0;
windX = watercurrentrateX;
windY = 0;
if ((environmentchecker != "water") && (environmentchecker != "duckpaddle")) {
swimY = 0;
swimY2 = 0;
}
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
environmentchecker = "duckpaddle";
} else if ((environment == "swimmingupward") || (environment == "swimmingdownward")) {
if (airspinspeed != 0) {
swimspinspeed = swimspinspeed + airspinspeed;
airspinspeed = 0;
}
airspin = 0;
if ((charROT > 100) || (charROT < -100)) {
if (environmentchecker != "water") {
swimI = swimI + ((Math.abs(movespeedX) / 3) + (gspeedY / 3));
gspeedY = 0;
}
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = gravityrateX;
gravityY = gravityrateY;
windX = watercurrentrateX;
windY = watercurrentrateY;
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
swimY2 = swimY2 / swimdragY;
swimI = swimI / swimdragY;
gspeedX = gspeedX / waterdragX;
gspeedY = gspeedY / waterdragY;
environmentchecker = "water";
} else if (environment == "watergrounded") {
if (((Math.abs(swimX2) >= swimcollideMAX) || (Math.abs(swimY2) >= swimcollideMAX)) || (Math.abs(swimI) >= swimcollideMAX)) {
swimX2 = Math.min(swimX2, swimcollideMAX);
swimY2 = Math.min(swimY2, swimcollideMAX);
swimI = Math.min(swimI, swimcollideMAX);
} else if (((Math.abs(swimX2) >= 0.25) || (Math.abs(swimY2) >= 0.25)) || (Math.abs(swimI) >= 0.25)) {
swimX2 = swimX2 / watergroundfriction;
swimY2 = swimY2 / watergroundfriction;
swimI = swimI / watergroundfriction;
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
windX = 0;
windY = 0;
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
swimY2 = swimY2 / swimdragY;
movespeedX = movespeedX / waterdragX;
movespeedY = movespeedY / waterdragY;
environmentchecker = "waterground";
} else if ((environment == "flying") || (environment == "falling")) {
charROT = 0;
if ((dr == -1) && (dl == -1)) {
moveY = 0;
movespeedY = 0;
}
if (swimspinspeed != 0) {
airspinspeed = airspinspeed + swimspinspeed;
swimspinspeed = 0;
}
swimspin = 0;
if (((swimX2 != 0) || (swimY2 != 0)) || (swimI != 0)) {
if (environmentchecker == "duckjump") {
swimX2 = swimX2 / duckjumpRATIO;
swimI = swimI / duckjumpRATIO;
}
jumpspeedX = jumpspeedX + (Math.sin(charROT * DEGtoRAD) * swimX2);
if (environmentchecker != "duckjump") {
jumpspeedY = jumpspeedY + Math.min(Math.cos(charROT * DEGtoRAD) * (swimX2 + swimI), swimspeedMAXTRANSFER);
}
}
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
gravityX = gravityrateX;
gravityY = gravityrateY;
windX = windrateX;
windY = windrateY;
if (environment == "flying") {
jumpX = 0;
jumpY = 0;
}
airspinspeed = airspinspeed / airspindrag;
if (environmentchecker != "bellyslide") {
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
} else {
movespeedX = movespeedX / slidedragX;
movespeedY = movespeedY / slidedragY;
}
if (environmentchecker == "nosedivebounce") {
airspin = 0;
if (Math.abs(charROT) < 5) {
charROT = 0;
environmentchecker = ((gspeedY > (jumpspeedY * 2)) ? "air" : "nosedivebounce");
}
}
if (((((environmentchecker == "water") && (Key.isDown(_root.kRIGHT))) && (!Key.isDown(_root.kUP))) && (!Key.isDown(_root.kDOWN))) || ((((environmentchecker == "water") && (Key.isDown(_root.kLEFT))) && (!Key.isDown(_root.kUP))) && (!Key.isDown(_root.kDOWN)))) {
environmentchecker = "porpoising";
} else if (((environmentchecker != "porpoising") && (environmentchecker != "bellyslide")) && (environmentchecker != "nosedivebounce")) {
environmentchecker = "air";
}
} else if (environment == "wallslide") {
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 1;
swimspin = 0;
swimspinspeed = 0;
airspin = 0;
airspinspeed = 0;
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
environmentchecker = "wallsliding";
} else if (environment == "grounded") {
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
swimspin = 0;
swimspinspeed = 0;
airspin = 0;
airspinspeed = 0;
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
if (environmentchecker != "bellyslide") {
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
bellyslideTIME = 0;
} else {
if ((dr - dl) != 0) {
moveX = (((sliderate * slopesensorDISTANCE) / Math.sqrt(Math.pow(dl - dr, 2) + Math.pow(slopesensorDISTANCE, 2))) * (dl - dr)) / Math.abs(dl - dr);
moveY = (sliderate * (-Math.abs(dr - dl))) / Math.sqrt(Math.pow(dr - dl, 2) + Math.pow(slopesensorDISTANCE, 2));
} else {
moveX = 0;
moveY = 0;
}
movespeedX = movespeedX / slidedragX;
movespeedY = movespeedY / slidedragY;
}
if (((((charROT < 89) && (charROT > -89)) && (environmentchecker != "bellyslide")) || ((((environmentchecker == "bellyslide") && (Math.abs(movespeedX) <= slidespeedMIN)) && (Math.abs(dr - dl) <= 0)) && (bellyslideTIME > 100))) || (((environmentchecker == "bellyslide") && (charROT < 30)) && (charROT > -30))) {
charY = charY - ((initHEIGHT - charHEIGHT) / 2);
charROT = 0;
environmentchecker = "ground";
} else if (((charROT < 165) && (charROT > -165)) || (((environmentchecker == "bellyslide") && (charROT < 30)) && (charROT > -30))) {
charY = charY - ((initWIDTH - charHEIGHT) / 2);
charWIDTH = initWIDTH;
charHEIGHT = initWIDTH;
if (environmentchecker != "bellyslide") {
charROT = ((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD);
} else if (charROT != (((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD))) {
slopeDIFFERENCE = (((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD)) - charROT;
charROT = charROT + (slopeDIFFERENCE / 2);
}
bellyslideTIME = bellyslideTIME + 1;
environmentchecker = "bellyslide";
if ((((jumpspeedY == 0) && ((oldslopeANGLE * slopeANGLE) <= 0)) && (oldslopeANGLE != 0)) || (((jumpspeedY == 0) && ((oldslopeANGLE * slopeANGLE) <= 0)) && (slopeANGLE != 0))) {
if (((oldslopeANGLE > 0) && (speedX > 0)) || ((oldslopeANGLE < 0) && (speedX < 0))) {
moveY = 0;
movespeedY = 0;
gspeedY = 0;
rampjumpY = (sliderampBOOST * Math.abs(speedX)) * Math.cos(oldslopeANGLE * DEGtoRAD);
jumpY = ((rampjumpY > 0) ? rampjumpY : 0);
} else {
moveY = 0;
movespeedY = 0;
}
}
} else {
charY = charY - ((initHEIGHT - charHEIGHT) / 2);
charROT = 180;
if (environmentchecker != "nosedivebounce") {
nosedivebounceSTART = getTimer() / 1000;
environmentchecker = "nosedivebounce";
}
if (Key.isDown(_root.kJUMP) && (jumparmed == true)) {
airspin = airspin + (nosediveBOUNCEspinrate * faceX);
jumpX = nosedivejumprateX * faceX;
jumpY = nosedivejumprateY;
environmentchecker = "nosedivebounce";
moveY = 0;
movespeedY = 0;
jumparmed = false;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
nosedivebounceTIMER = (getTimer() / 1000) - nosedivebounceSTART;
if (nosedivebounceTIMER >= nosedivebounceTIME) {
airspin = airspin + (nosediveBOUNCEspinrate * faceX);
jumpX = nosediveBOUNCEXrate * faceX;
jumpY = nosediveBOUNCEYrate;
}
}
} else if (environment == "sprung") {
swimX2 = 0;
swimY2 = 0;
swimI = 0;
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
if (TOUCHwater == false) {
jumpX = springrateX;
jumpY = springrateY;
swimX = 0;
swimY = 0;
} else {
swimX = springrateX;
swimY = springrateY;
jumpX = 0;
jumpY = 0;
}
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
environmentchecker = "sprung";
}
movespeedX = movespeedX + moveX;
jumpspeedX = jumpspeedX + jumpX;
swimX2 = swimX2 + swimX;
if ((charROT == 180) || (charROT == -180)) {
swimspeedX = 0;
} else {
swimspeedX = Math.sin(charROT * DEGtoRAD) * (swimX2 + swimI);
}
gspeedX = gspeedX + gravityX;
windspeedX = windX;
movespeedY = movespeedY + moveY;
jumpspeedY = jumpspeedY + jumpY;
swimY2 = swimY2 + swimY;
swimspeedY = Math.cos(charROT * DEGtoRAD) * (swimY2 + swimI);
gspeedY = gspeedY + gravityY;
windspeedY = windY;
if (Math.abs(movespeedX) < 0.1) {
movespeedX = 0;
}
if (Math.abs(movespeedY) < 0.1) {
movespeedY = 0;
}
speedX = (((movespeedX + jumpspeedX) + swimspeedX) - gspeedX) + windspeedX;
speedY = ((((-movespeedY) - jumpspeedY) - swimspeedY) + gspeedY) - windspeedY;
if (speedX > speedXMAX) {
speedX = speedX - (speedX - speedXMAX);
} else if (speedX < (-speedXMAX)) {
speedX = speedX + (speedXMAX - speedX);
}
if (speedY > speedYMAX) {
speedY = speedY - (speedY - speedYMAX);
} else if (speedY < (-speedYMAX)) {
speedY = speedY + (speedYMAX - speedY);
}
if (Math.abs(speedX) < speedMINX) {
speedX = 0;
}
if (Math.abs(speedY) < speedMINY) {
speedY = 0;
}
charX = charX + speedX;
charY = charY + speedY;
swimspinspeed = swimspinspeed + swimspin;
airspinspeed = airspinspeed + airspin;
speedROT = swimspinspeed + airspinspeed;
charROT = charROT + speedROT;
if (charROT > 180) {
charROT = charROT - 360;
} else if (charROT < -180) {
charROT = charROT + 360;
}
if (((speedX == 0) && (speedY == 0)) && (speedROT == 0)) {
charACTION = false;
} else {
charACTION = true;
}
if (charACTION == true) {
if (speedY > 0) {
d = 1;
while (d <= floorpushes) {
if (((!SoftBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true)) && (!HardBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true))) && (!Spring.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true))) {
charY = charY - (d - 1);
break;
}
d++;
}
} else if (speedY < 0) {
u = 1;
while (u <= floorpushes) {
if (!HardBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) - (charHEIGHT * uHEIGHT)) + u) * worldYSCALEinit) / 100) + worldYinit, true)) {
charY = charY + (u - 1);
break;
}
movespeedY = 0;
jumpspeedY = 0;
gspeedY = 0;
u++;
}
}
if ((speedX > 0) || ((environment == "wallslide") && (TOUCHwallright == true))) {
r = 1;
while (r <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) + (charWIDTH * rWIDTH)) - r) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) + (charHEIGHT * rHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX - (r - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
r++;
}
if (environmentchecker != "bellysliding") {
ur = 1;
while (ur <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) + (charWIDTH * urWIDTH)) - ur) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) - (charHEIGHT * urHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX - (ur - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
ur++;
}
}
}
if ((speedX < 0) || ((environment == "wallslide") && (TOUCHwallleft == true))) {
l = 1;
while (l <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) - (charWIDTH * lWIDTH)) + l) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) + (charHEIGHT * lHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX + (l - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
l++;
}
if (environmentchecker != "bellysliding") {
ul = 1;
while (ul <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) - (charWIDTH * ulWIDTH)) + ul) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) - (charHEIGHT * ulHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX + (ul - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
ul++;
}
}
}
}
oldslopeANGLE = slopeANGLE;
if ((((charACTION == true) && (oldTOUCHdigit == false)) && (digitMODE == "constant")) || ((charACTION == true) && (digitMODE != "constant"))) {
dr = 0;
while (dr <= floorpushes) {
if ((!SoftBoundary.hitTest(((((charX + offsetX) + (slopesensorDISTANCE / 2)) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dr) * worldYSCALEinit) / 100) + worldYinit, true)) && (!HardBoundary.hitTest(((((charX + offsetX) + slopesensorDISTANCE) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dr) * worldYSCALEinit) / 100) + worldYinit, true))) {
dr = dr - 1;
break;
}
dr++;
}
dl = 0;
while (dl <= floorpushes) {
if ((!SoftBoundary.hitTest(((((charX + offsetX) - (slopesensorDISTANCE / 2)) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dl) * worldYSCALEinit) / 100) + worldYinit, true)) && (!HardBoundary.hitTest(((((charX + offsetX) - slopesensorDISTANCE) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dl) * worldYSCALEinit) / 100) + worldYinit, true))) {
dl = dl - 1;
break;
}
dl++;
}
slopeANGLE = Math.atan((dr - dl) / slopesensorDISTANCE) / DEGtoRAD;
if ((TOUCHdigit == true) && (digitMODE == "restricted")) {
slopeANGLE = Math.round(slopeANGLE / digitARCLENGTH) * digitARCLENGTH;
if (slopeANGLE > 0) {
dr = Math.abs((Math.tan(slopeANGLE * DEGtoRAD) * slopesensorDISTANCE) / 2);
dl = -dr;
} else {
dr = -Math.abs((Math.tan(slopeANGLE * DEGtoRAD) * slopesensorDISTANCE) / 2);
dl = -dr;
}
}
}
if ((((TOUCHground == true) && (TOUCHdigit == false)) || ((jumpspeedY < gspeedY) && (jumpspeedY > 0))) || ((jumpspeedY == 0) && (gspeedY > jumpTHRESHOLD))) {
oldTOUCHdigit = false;
} else {
oldTOUCHdigit = true;
}
totalspeed = Math.pow(Math.pow(speedX, 2) + Math.pow(speedY, 2), 0.5);
if ((Key.isDown(17) && ((camXSCALE + zoomINCREMENTmanual) <= zoomMAXmanual)) && ((camYSCALE + zoomINCREMENTmanual) <= zoomMAXmanual)) {
camXSCALE = camXSCALE + zoomINCREMENTmanual;
camYSCALE = camYSCALE + zoomINCREMENTmanual;
zoomMIN = zoomMIN + zoomINCREMENTmanual;
} else if ((Key.isDown(16) && ((camXSCALE - zoomINCREMENTmanual) >= zoomMINmanual)) && ((camYSCALE - zoomINCREMENTmanual) >= zoomMINmanual)) {
camXSCALE = camXSCALE - zoomINCREMENTmanual;
camYSCALE = camYSCALE - zoomINCREMENTmanual;
zoomMIN = zoomMIN - zoomINCREMENTmanual;
} else {
if (((((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) <= (camX - (camWIDTH / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX)) || ((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) >= (camX + (camWIDTH / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camXSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) <= (camY - (camHEIGHT / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) >= (camY + (camHEIGHT / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) {
camXSCALE = camXSCALE + zoomINCREMENT;
camYSCALE = camYSCALE + zoomINCREMENT;
} else if (((((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) >= (camX - (camWIDTH / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camYSCALE - zoomINCREMENT) >= zoomMIN)) || ((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) <= (camX + (camWIDTH / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camXSCALE - zoomINCREMENT) >= zoomMIN))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) >= (camY - (camHEIGHT / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camYSCALE - zoomINCREMENT) >= zoomMIN))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) <= (camY + (camHEIGHT / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camYSCALE - zoomINCREMENT) >= zoomMIN))) {
camXSCALE = camXSCALE - zoomINCREMENT;
camYSCALE = camYSCALE - zoomINCREMENT;
}
if (((((((!Key.isDown(16)) && (charX <= ((camX - (camWIDTH / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX)) || ((((!Key.isDown(16)) && (charX >= ((camX + (camWIDTH / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camXSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && (charY <= ((camY - (camHEIGHT / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && (charY >= ((camY + (camHEIGHT / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) {
camXSCALE = camXSCALE + zoomINCREMENT;
camYSCALE = camYSCALE + zoomINCREMENT;
zoomMIN = zoomMIN + zoomINCREMENTmanual;
}
}
if ((TOUCHwater == false) && (environmentchecker != "bellyslide")) {
camspeedX = ((charX + (speedX * ((camLOOSENESS + camMOVEXLEAD) / (worldXSCALE / 100)))) - camX) / (camLOOSENESS / (worldXSCALE / 100));
if ((Math.abs(speedX) >= moverate) || (Math.abs(speedY) >= moverate)) {
camX = camX + ((Math.abs(camspeedX) > 1) ? (camspeedX) : 0);
}
} else {
camspeedX = ((charX + (speedX * ((camLOOSENESS + camWATERXLEAD) / (worldXSCALE / 100)))) - camX) / (camLOOSENESS / (worldXSCALE / 100));
if ((Math.abs(speedX) >= moverate) || (Math.abs(speedY) >= moverate)) {
camX = camX + ((Math.abs(camspeedX) > 1) ? (camspeedX) : 0);
}
}
if (((TOUCHwater == false) && (Math.abs(speedY) < 10)) && (environmentchecker != "bellyslide")) {
camspeedY = ((charY + (speedY * ((camLOOSENESS + camMOVEYLEAD) / (worldYSCALE / 100)))) - camY) / (camLOOSENESS / (worldYSCALE / 100));
camY = camY + camspeedY;
} else {
camspeedY = ((charY + (speedY * ((camLOOSENESS + camWATERYLEAD) / (worldYSCALE / 100)))) - camY) / (camLOOSENESS / (worldYSCALE / 100));
camY = camY + camspeedY;
}
if (Math.abs(camX - charX) > ((camWIDTH * 3) / 8)) {
camX = charX + ((((camWIDTH * 3) / 8) * (camX - charX)) / Math.abs(camX - charX));
}
if (Math.abs(camY - charY) > ((camHEIGHT * 3) / 8)) {
camY = charY + ((((camHEIGHT * 3) / 8) * (camY - charY)) / Math.abs(camY - charY));
}
camWIDTH = (camWIDTHinit * camXSCALE) / 100;
camHEIGHT = (camHEIGHTinit * camYSCALE) / 100;
if (!Key.isDown(46)) {
scaleX = stageWIDTH / camWIDTH;
scaleY = stageHEIGHT / camHEIGHT;
worldX = stagehalfWIDTH - (camX * scaleX);
worldY = stagehalfHEIGHT - (camY * scaleY);
worldXSCALE = 100 * scaleX;
worldYSCALE = 100 * scaleY;
camROT = 0;
worldROT = -camROT;
}
frameloops++;
}
Player1._x = charX;
Player1._y = charY;
Player1._rotation = charROT;
Player1.sensor._x = charsensorX;
Player1.sensor._y = charsensorY;
Player1.sensor._width = charsensorWIDTH;
Player1.sensor._height = charsensorHEIGHT;
if (faceX > 0) {
Player1._xscale = 100;
} else if (faceX < 0) {
Player1._xscale = -100;
}
camera._x = camX;
camera._y = camY;
camera._rotation = camROT;
camera._xscale = camXSCALE;
camera._yscale = camYSCALE;
camera._width = camWIDTH;
camera._height = camHEIGHT;
_x = worldX;
_y = worldY;
_rotation = worldROT;
_xscale = worldXSCALE;
_yscale = worldYSCALE;
}
Frame 65
if (_root.go != true) {
gotoAndStop (64);
} else {
_root.go = false;
}
Frame 66
Mouse.show();
stopAllSounds();
_root.soundManager_mc.playSound("BreakfastEnding.wav", 0, 9999999999);
_root.died = false;
_root.levelCOMPLETE = getTimer() / 1000;
_root.levelTIME = Math.round(((_root.levelCOMPLETE + _root.levelDEADTIME) - (_root.levelSTART + _root.pauseTIME)) * 10000) / 10000;
_root.levelDEADTIME = 0;
_root.levelTIMESTR = _root.levelTIME + " sec";
_root.pointratio = Math.round((_root.player1points / _root.totalpoints) * 10000) / 100;
_root.gameTIME = _root.gameTIME + _root.levelTIME;
_root.GAMEplayer1points = _root.GAMEplayer1points + _root.player1points;
_root.gamedeaths = _root.gamedeaths + _root.leveldeaths;
if (_root.cheats != true) {
_root.topdeaths.text = "---";
if (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] != undefined) {
_root.topdeaths.text = _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"];
}
if ((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] == undefined) || (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] > _root.leveldeaths)) {
_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] = _root.leveldeaths;
} else {
_root.newdeathsrecord.text = "";
}
_root.toptime.text = "---";
if (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] != undefined) {
_root.toptime.text = _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"];
}
if ((((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] == undefined) && (_root.leveldeaths <= _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"])) || ((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] > _root.levelTIME) && (_root.leveldeaths <= _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"]))) || (_root.newdeathsrecord.text != "")) {
_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] = _root.levelTIME;
} else {
_root.newtimerecord.text = "";
}
_root.leveldeaths = 0;
_root.toppoints.text = "---";
_root.topratio.text = "---";
if (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] != undefined) {
_root.toppoints.text = _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"];
_root.topratio.text = Math.round((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] / _root.totalpoints) * 10000) / 100;
}
if ((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] == undefined) || (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] < _root.player1points)) {
_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1points"] = _root.player1points;
} else {
_root.newcoinrecord.text = "";
_root.newratiorecord.text = "";
}
_root.savedData.data[("LVL" + _root.level.substr(6)) + "totalpoints"] = _root.totalpoints;
if (_root.savedData.data.levelMAX == 8) {
_root.savedData.data.levelMAX = 9;
}
_root.savedData.flush();
}
if (_root.stattracking == true) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl8complete");
if (_root.pointratio >= 100) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl8coins100percent");
} else if (_root.pointratio >= 50) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl8coins050percent");
}
}
stop();
Instance of Symbol 240 MovieClip in Frame 66
onClipEvent (load) {
this.textvalue = "Menu";
this.linkvalue = "Game Start";
this.gotoAndStop("Menu");
}
Frame 67
if (_root.go != true) {
gotoAndStop (66);
} else {
_root.go = false;
}
Frame 68
stopAllSounds();
_root.cutscene5 = true;
_root.go = false;
stop();
Frame 69
if (_root.go != true) {
gotoAndStop (68);
} else {
_root.go = false;
}
Frame 70
if ((_root.cutscene5 != true) && (_root.cutscenes == true)) {
_root.gotoAndPlay("cutscene5");
}
Mouse.show();
stopAllSounds();
_root.level = "Level 6";
_root.kRIGHT = _root.kRIGHTconfig;
_root.kLEFT = _root.kLEFTconfig;
_root.kUP = _root.kUPconfig;
_root.kDOWN = _root.kDOWNconfig;
_root.kJUMP = _root.kJUMPconfig;
_root.kTHROW = _root.kTHROWconfig;
_root.kPAUSE = _root.kPAUSEconfig;
_root.kSTART = _root.kSTARTconfig;
_root.pauseTIME = 0;
if (_root.died == true) {
_root.leveldeaths = _root.leveldeaths + 1;
}
if (_root.stattracking == true) {
if (_root.died == false) {
StatTracker.submitStat("/flashgames/breakfastclub/level9start");
} else {
StatTracker.submitStat("/flashgames/breakfastclub/level9died");
}
}
stop();
Frame 71
if (_root.go != true) {
gotoAndStop (70);
} else {
_root.go = false;
}
Frame 72
stopAllSounds();
_root.soundManager_mc.playSound("BreakfastBoss.wav", 0, 9999999999);
if ((_root.savedData.data.levelMAX > 9) && (_root.stattracking == true)) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl9replay");
}
onMouseMove = function () {
mouseTIMERstart = getTimer() / 1000;
Mouse.show();
};
onEnterFrame = function () {
_root.timechecker();
mouseTIMER = (getTimer() / 1000) - mouseTIMERstart;
if (mouseTIMER >= mouseTIMERMAX) {
Mouse.hide();
}
};
_root.attachDEPTH = _root.GAMEattachDEPTH;
_root.WorldString = undefined;
if (_root.WorldString != undefined) {
SoftCOLOR = 65535;
SoftALPHA = 50;
TiledCOLOR = 16711935 /* 0xFF00FF */;
TiledALPHA = 50;
HardCOLOR = 16711680 /* 0xFF0000 */;
HardALPHA = 50;
WaterCOLOR = 255;
WaterALPHA = 50;
SpringCOLOR = 16776960 /* 0xFFFF00 */;
SpringALPHA = 50;
_root.World.createEmptyMovieClip("SoftBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.SoftBoundary.objects = 0;
_root.WorldArray[0] = [];
_root.World.createEmptyMovieClip("TiledBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.TiledBoundary.objects = 0;
_root.WorldArray[1] = [];
_root.World.createEmptyMovieClip("HardBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.SoftBoundary.objects = 0;
_root.WorldArray[2] = [];
_root.World.createEmptyMovieClip("WaterBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.WaterBoundary.objects = 0;
_root.WorldArray[3] = [];
_root.World.createEmptyMovieClip("SpringBoundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.SpringBoundary.objects = 0;
_root.WorldArray[4] = [];
_root.World.createEmptyMovieClip("Art", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.Art.objects = 0;
_root.WorldArray[5] = [];
_root.WorldArray = _root.WorldString.split(">>>>");
boundaryelements = 0;
while (boundaryelements < _root.WorldArray.length) {
_root.WorldArray[boundaryelements] = _root.WorldArray[boundaryelements].split("|");
objectelements = 0;
while (objectelements < _root.WorldArray[boundaryelements].length) {
_root.WorldArray[boundaryelements][objectelements] = _root.WorldArray[boundaryelements][objectelements].split("/");
anchorelements = 0;
while (anchorelements < _root.WorldArray[boundaryelements][objectelements].length) {
_root.WorldArray[boundaryelements][objectelements][anchorelements] = _root.WorldArray[boundaryelements][objectelements][anchorelements].split(",");
anchorelements++;
}
objectelements++;
}
boundaryelements++;
}
boundaryload = 0;
while (boundaryload < _root.WorldArray.length) {
if (boundaryload == 0) {
boundary = "Soft";
boundaryCOLOR = _root.SoftCOLOR;
boundaryALPHA = _root.SoftALPHA;
} else if (boundaryload == 1) {
boundary = "Tile";
boundaryCOLOR = _root.TileCOLOR;
boundaryALPHA = _root.TileALPHA;
} else if (boundaryload == 2) {
boundary = "Hard";
boundaryCOLOR = _root.HardCOLOR;
boundaryALPHA = _root.HardALPHA;
} else if (boundaryload == 3) {
boundary = "Water";
boundaryCOLOR = _root.WaterCOLOR;
boundaryALPHA = _root.WaterALPHA;
} else if (boundaryload == 4) {
boundary = "Spring";
boundaryCOLOR = _root.SpringCOLOR;
boundaryALPHA = _root.SpringALPHA;
} else if (boundaryload == 5) {
boundary = "Art";
boundaryCOLOR = _root.ArtCOLOR;
boundaryALPHA = _root.ArtALPHA;
}
_root.World.createEmptyMovieClip(boundary + "Boundary", _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
objectload = 0;
while (objectload < _root.WorldArray[boundaryload].length) {
_root.World[boundary + "Boundary"].objects = objectload + 1;
_root.World[boundary + "Boundary"].createEmptyMovieClip("Object" + (objectload + 1), _root.attachDEPTH);
_root.attachDEPTH = _root.attachDEPTH + 1;
anchorload = 0;
while (anchorload < _root.WorldArray[boundaryload][objectload].length) {
if ((anchorload == 0) && (_root.WorldArray[boundaryload][objectload][anchorload][0] != "Art")) {
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].lineStyle(1, 0, 100);
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].beginFill(boundaryCOLOR, boundaryALPHA);
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].moveTo(_root.WorldArray[boundaryload][objectload][anchorload][1], _root.WorldArray[boundaryload][objectload][anchorload][2]);
} else if (_root.WorldArray[boundaryload][objectload][anchorload][0] != "Art") {
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].lineTo(_root.WorldArray[boundaryload][objectload][anchorload][1], _root.WorldArray[boundaryload][objectload][anchorload][2]);
} else if (_root.WorldArray[boundaryload][objectload][anchorload][0] == "Art") {
anchorload++;
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].removeMovieClip();
_root.World[boundary + "Boundary"].attachMovie(_root.WorldArray[boundaryload][objectload][anchorload][0], _root.WorldArray[boundaryload][objectload][anchorload][0] + (objectload + 1), _root.attachDEPTH, {_x:_root.WorldArray[boundaryload][objectload][anchorload][1], _y:_root.WorldArray[boundaryload][objectload][anchorload][2]});
break;
}
anchorload++;
}
_root.World[boundary + "Boundary"]["Object" + (objectload + 1)].endFill();
objectload++;
}
boundaryload++;
}
}
stop();
Instance of Symbol 1057 MovieClip "World" in Frame 72
onClipEvent (load) {
_name = "World";
framerateDEFAULT = 24;
framerateMAX = 120;
framerateMIN = 12;
DEGtoRAD = (Math.PI/180);
bubbleDEPTH = 1000;
this.bottomlesspit = 7000;
this.Player1.points = 0;
this.points = 0;
this.badguyDISTANCEMAX = 150;
this.bomberCHANCE = Infinity;
this.bombers = 0;
this.Goombas = 0;
this.KoopaTroopas = 0;
this.AttackDogs = 0;
this.Barrels = 0;
this.BarrelsFilled = 0;
digitMODE = "constant";
charALIVE = true;
charBLINK = true;
charBLINKTIME = 1;
charBLINKTIMER = 0;
Player1.rocksloaded = 0;
Player1.rocksthrown = 0;
Player1.rocksloadedMAX = 3;
rocksMAX = 6;
dHEIGHT = 0.5;
uHEIGHT = 0.5;
rWIDTH = 0.5;
rHEIGHT = 0;
urWIDTH = 0.3;
urHEIGHT = 0.25;
lWIDTH = 0.5;
lHEIGHT = 0;
ulWIDTH = 0.3;
ulHEIGHT = 0.25;
offsetX = 0;
offsetY = 0;
charACTION = true;
initWIDTH = Player1.sensor._width;
initHEIGHT = Player1.sensor._height;
initHYP = Math.sqrt(Math.pow(initWIDTH, 2) + Math.pow(initHEIGHT, 2));
initANGLE1 = Math.asin(initHEIGHT / initHYP);
initANGLE2 = Math.asin(initWIDTH / initHYP);
slopesensorRATIO = 3;
floorpushes = 100;
speedXMAX = 25;
speedYMAX = 25;
speedMAXdivisor = 1;
speedXMIN = 0.05;
speedYMIN = 0.05;
slidespeedMIN = 0.05;
jumpTHRESHOLD = 2;
airjumpsMAX = 1;
duckjumpRATIO = 2;
throwTIME = 2.5;
throwANGLEup = 65;
throwANGLEforward = 75;
throwANGLEdown = 120;
nosedivebounceTIME = 0.25;
swimcollideMAX = 7;
duckpaddleFALLSPEED = 7.5;
duckpaddleRATIO = 3;
faceX = 1;
faceY = 1;
digitARCLENGTH = 22.5;
engineloops = 4;
speedmultiUNIVERSAL = 1;
speedmultiX = speedmultiUNIVERSAL;
speedmultiY = speedmultiUNIVERSAL;
speedmultiROT = speedmultiUNIVERSAL;
movedragX = 1.175;
movedragY = 1.175;
slidedragX = 1.01;
slidedragY = 1.01;
waterdragX = 2.5;
waterdragY = 2.5;
swimdragX = 1.004;
swimdragY = 1.004;
watergroundfriction = 1.05;
throwdrag = 2.5;
swimspindrag = 1.1;
airspindrag = 1.1;
windrateX = 0 * speedmultiX;
windrateY = 0 * speedmultiY;
watercurrentrateX = 0 * speedmultiX;
watercurrentrateY = 0 * speedmultiY;
gravityrateX = 0 * speedmultiX;
gravityrateY = 0.25 * speedmultiY;
gspeedX = 0 * speedmultiX;
gspeedY = 0 * speedmultiY;
windX = 0 * speedmultiX;
windY = 0 * speedmultiY;
windspeedX = 0 * speedmultiX;
windspeedY = 0 * speedmultiY;
environment = "falling";
environmentchecker = "air";
moverate = 0.6 * speedmultiUNIVERSAL;
sliderate = 0.75 * speedmultiUNIVERSAL;
sliderampBOOST = 0.8 * speedmultiUNIVERSAL;
sliderampTHRESHOLD = 13;
swimspeedMAXTRANSFER = 15 * speedmultiUNIVERSAL;
jumprateX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
jumprateY = (40 * gravityrateY) / Math.sqrt(speedmultiY);
walljumpTIME = 20;
nosedivejumprateX = jumprateX * 1.4;
nosedivejumprateY = jumprateY * 1.4;
springrateX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
springrateY = (50 * gravityrateY) / Math.sqrt(speedmultiY);
nosediveBOUNCEXrate = 0.5;
nosediveBOUNCEYrate = (24 * gravityrateY) / Math.sqrt(speedmultiY);
nosediveBOUNCEspinrate = 17 * speedmultiROT;
swimrateX = (1 * gravityrateY) / Math.sqrt(speedmultiY);
swimrateY = (1 * gravityrateY) / Math.sqrt(speedmultiY);
throwrate = (40 * gravityrateY) / Math.sqrt(speedmultiY);
swimspinrate = 0.5 * speedmultiROT;
airspinrate = 0.75 * speedmultiROT;
watergroundboostX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
watergroundboostY = (0 * gravityrateY) / Math.sqrt(speedmultiY);
moveX = 0 * speedmultiX;
moveY = 0 * speedmultiY;
movespeedX = 0 * speedmultiX;
movespeedY = 0 * speedmultiY;
jumpX = 0 * speedmultiX;
jumpY = 0 * speedmultiY;
walljumpTIMER = 0;
airjumpCOUNT = 0;
jumpspeedX = 0 * speedmultiX;
jumpspeedY = 0 * speedmultiY;
swimX = 0 * speedmultiX;
swimY = 0 * speedmultiY;
swimX2 = 0 * speedmultiX;
swimY2 = 0 * speedmultiY;
swimI = 0 * speedmultiUNIVERSAL;
swimspeedX = 0 * speedmultiX;
swimspeedY = 0 * speedmultiY;
speedX = 0 * speedmultiX;
speedY = 0 * speedmultiY;
swimspin = 0 * speedmultiROT;
swimspinspeed = 0 * speedmultiROT;
airspin = 0 * speedmultiROT;
airspinspeed = 0 * speedmultiROT;
camera._visible = false;
stagehalfWIDTH = 275;
stagehalfHEIGHT = 200;
stageWIDTH = 550;
stageHEIGHT = 400;
camLOOSENESS = 50;
camMOVEXLEAD = 30;
camMOVEYLEAD = -30;
camWATERXLEAD = 5;
camWATERYLEAD = 5;
zoomMIN = 125;
zoomMAX = 250;
zoomMINmanual = zoomMIN;
zoomMAXmanual = zoomMAX;
camera._xscale = zoomMIN;
camera._yscale = zoomMIN;
zoomINCREMENT = 0.25 * speedmultiX;
zoomINCREMENTmanual = 1;
zoomLEAD = 90;
safezoneDISTANCE = 100;
startTime = getTimer();
numFrames = 0;
recentSetting = 5;
recentNumFrames = 0;
recentStartTime = startTime;
charX = Player1._x;
charY = Player1._y;
charROT = Player1._rotation;
charsensorX = Player1.sensor._x;
charsensorY = Player1.sensor._y;
charsensorWIDTH = Player1.sensor._width;
charsensorHEIGHT = Player1.sensor._height;
camX = camera._x;
camY = camera._y;
camROT = camera._rotation;
camXSCALE = camera._xscale;
camYSCALE = camera._yscale;
camWIDTHinit = camera._width;
camHEIGHTinit = camera._height;
camWIDTH = camera._width;
camHEIGHT = camera._height;
worldX = _x;
worldY = _y;
worldROT = _rotation;
worldXSCALE = _xscale;
worldYSCALE = _yscale;
}
onClipEvent (enterFrame) {
_root.player1points = this.Player1.points;
_root.totalpoints = this.points;
numFrames++;
now = getTimer();
elapsedSeconds = (now - startTime) / 1000;
actualFPS = numFrames / elapsedSeconds;
recentNumFrames++;
if (recentNumFrames == recentSetting) {
recentElapsedSeconds = (now - recentStartTime) / 1000;
recentFPSoutput = recentNumFrames / recentElapsedSeconds;
recentStartTime = now;
recentNumFrames = 0;
}
if (((recentFPSoutput >= framerateMIN) && (recentFPSoutput <= framerateMAX)) && (elapsedSeconds >= 1)) {
engineloops = framerateMAX / Math.ceil(recentFPSoutput);
} else if (elapsedSeconds < 1) {
engineloops = framerateMAX / framerateDEFAULT;
}
if ((Key.isDown(_root.kPAUSE) && (_root.PAUSE == false)) && (this.pausearmed == true)) {
_root.PAUSE = true;
this.pausearmed = false;
_root.pauseSTART = getTimer() / 1000;
} else if (((Key.isDown(_root.kPAUSE) && (_root.PAUSE == true)) && (this.pausearmed == true)) && (_root.textbubble == undefined)) {
_root.PAUSE = false;
this.pausearmed = false;
_root.pauseEND = getTimer() / 1000;
_root.pauseTIME = _root.pauseTIME + (_root.pauseEND - _root.pauseSTART);
}
if (!Key.isDown(_root.kPAUSE)) {
this.pausearmed = true;
}
if (_root.PAUSE == true) {
engineloops = 0;
}
worldXinit = _x;
worldYinit = _y;
worldROTinit = _rotation;
worldXSCALEinit = _xscale;
worldYSCALEinit = _yscale;
if (charALIVE == false) {
_root.kRIGHT = undefined;
_root.kLEFT = undefined;
_root.kUP = undefined;
_root.kDOWN = undefined;
_root.kJUMP = undefined;
_root.kTHROW = undefined;
_root.died = true;
_root.levelselect = false;
}
if ((charBLINK == true) && (charBLINKTIMER < charBLINKTIME)) {
if (Player1._visible == true) {
Player1._visible = false;
} else {
Player1._visible = true;
}
charBLINKTIMER = charBLINKTIMER + ((1 / this.framerateMAX) * this.engineloops);
} else {
Player1._visible = true;
charBLINKTIMER = 0;
charBLINK = false;
}
if ((random(bomberCHANCE) == 0) && (_root.PAUSE == false)) {
if (random(2) == 0) {
bomberDIRX = 1;
} else {
bomberDIRX = -1;
}
bomberDIRY = -1;
bombers = bombers + 1;
this.attachMovie("Bomber 1", "Bomber" + bombers, _root.attachDEPTH, {_x:this.camera._x + (((this.camera._width / 2) + this.badguyDISTANCEMAX) * bomberDIRX), _y:this.camera._y + (random(this.camera._width / 2) * bomberDIRY), flyDIR:bomberDIRX});
_root.attachDEPTH = _root.attachDEPTH + 1;
}
frameloops = 1;
while (frameloops <= engineloops) {
if (environmentchecker != "bellyslide") {
charWIDTH = Math.abs(Math.cos(initANGLE1 - ((Math.abs(charROT) + 180) * DEGtoRAD)) * initHYP);
charHEIGHT = Math.abs(Math.cos(initANGLE2 - ((Math.abs(charROT) + 180) * DEGtoRAD)) * initHYP);
} else {
charWIDTH = initWIDTH;
charHEIGHT = initWIDTH;
}
slopesensorDISTANCE = charWIDTH / slopesensorRATIO;
if (((speedY >= 0) && (SoftBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true))) || ((speedY >= 0) && (HardBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)))) {
TOUCHground = true;
if (((speedY >= 0) && (SoftBoundary.DigitBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true))) || ((speedY >= 0) && (HardBoundary.DigitBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)))) {
TOUCHdigit = true;
} else {
TOUCHdigit = false;
}
} else {
TOUCHground = false;
TOUCHdigit = false;
}
if (HardBoundary.hitTest((((((charsensorX + charX) + offsetX) + (charWIDTH * 0.5)) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.25)) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHwallright = true;
} else {
TOUCHwallright = false;
}
if (HardBoundary.hitTest((((((charsensorX + charX) + offsetX) - (charWIDTH * 0.5)) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.25)) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHwallleft = true;
} else {
TOUCHwallleft = false;
}
if (HardBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) - (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHceiling = true;
} else {
TOUCHceiling = false;
}
if (Water.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, ((((charsensorY + charY) + offsetY) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHwater = true;
} else {
TOUCHwater = false;
}
if (Spring.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true) && (speedY >= 0)) {
TOUCHspring = true;
} else {
TOUCHspring = false;
}
if (charY > bottomlesspit) {
charALIVE = false;
}
if (((_root.World.charBLINK == false) && (_root.DeathBoundaryPresent == true)) && (this.DeathBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, ((((charsensorY + charY) + offsetY) * worldYSCALEinit) / 100) + worldYinit, true))) {
if (this.Player1.rocksloaded > 0) {
this.throwANGLEdamaged = random(90) - 45;
this.throwratedamaged = 8;
this.Player1.rocksthrown = this.Player1.rocksthrown + 1;
this.attachMovie("Rock 1", "rock" + this.Player1.rocksthrown, 100 + this.Player1.rocksthrown, {_x:this.charsensorX + this.charX, _y:(this.charsensorY + this.charY) - ((this.charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEdamaged * DEGtoRAD) * throwratedamaged) * this.faceX) + this.speedX, throwspeedY:(Math.cos(throwANGLEdamaged * DEGtoRAD) * throwratedamaged) - this.speedY, weapon:false});
this.oldrock = this.Player1.rocksthrown - this.rocksMAX;
this["rock" + this.oldrock].removeMovieClip();
this.Player1.rocksloaded = this.Player1.rocksloaded - 1;
this.charBLINK = true;
_root.soundManager_mc.playSound("jump2.wav", 0, 1);
} else {
this.charALIVE = false;
}
}
if ((((environmentchecker == "air") && (TOUCHwater == true)) && (Math.abs(speedY) < duckpaddleFALLSPEED)) || (environment == "duckpaddle")) {
environment = "duckpaddle";
} else if (((((TOUCHwater == true) && (TOUCHground == true)) || ((TOUCHwater == true) && (TOUCHceiling == true))) || ((TOUCHwater == true) && (TOUCHwallleft == true))) || ((TOUCHwater == true) && (TOUCHwallright == true))) {
environment = "watergrounded";
} else if ((TOUCHwater == true) && (speedY < 0)) {
environment = "swimmingupward";
} else if (((TOUCHwater == true) && (TOUCHground == false)) && (speedY >= 0)) {
environment = "swimmingdownward";
} else if ((TOUCHspring == true) && (speedY >= 0)) {
environment = "sprung";
} else if ((TOUCHground == true) && (speedY >= 0)) {
environment = "grounded";
} else if (speedY < 0) {
environment = "flying";
} else if (((((TOUCHwallright == true) && (Key.isDown(_root.kRIGHT))) && (TOUCHground == false)) && (speedY >= 0)) || ((((TOUCHwallleft == true) && Key.isDown(_root.kLEFT)) && (TOUCHground == false)) && (speedY >= 0))) {
environment = "wallslide";
} else if ((TOUCHground == false) && (speedY >= 0)) {
environment = "falling";
}
if (((Player1.rocksloaded > 0) && (throwarmed == true)) && (Key.isDown(_root.kTHROW))) {
_root.soundManager_mc.stopSound("throw 1", 0, 1);
_root.soundManager_mc.playSound("throw 1", 0, 1);
Player1.rocksthrown = Player1.rocksthrown + 1;
if (environment != "wallslide") {
if (Key.isDown(_root.kUP)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:charsensorX + charX, _y:(charsensorY + charY) - ((charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEup * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEup * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else if (Key.isDown(_root.kDOWN)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * faceX), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEdown * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEdown * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * faceX), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEforward * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEforward * DEGtoRAD) * throwrate) - speedY, weapon:true});
}
} else if (Key.isDown(_root.kUP)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:charsensorX + charX, _y:(charsensorY + charY) - ((charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEup * DEGtoRAD) * throwrate) * (-faceX)) + speedX, throwspeedY:(Math.cos(throwANGLEup * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else if (Key.isDown(_root.kDOWN)) {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * (-faceX)), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEdown * DEGtoRAD) * throwrate) * (-faceX)) + speedX, throwspeedY:(Math.cos(throwANGLEdown * DEGtoRAD) * throwrate) - speedY, weapon:true});
} else {
attachMovie("Rock 1", "rock" + Player1.rocksthrown, 100 + Player1.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * (-faceX)), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEforward * DEGtoRAD) * throwrate) * (-faceX)) + speedX, throwspeedY:(Math.cos(throwANGLEforward * DEGtoRAD) * throwrate) - speedY, weapon:true});
}
oldrock = Player1.rocksthrown - rocksMAX;
this["rock" + oldrock].removeMovieClip();
Player1.rocksloaded = Player1.rocksloaded - 1;
throwarmed = false;
} else if (!Key.isDown(_root.kTHROW)) {
throwarmed = true;
} else {
throwarmed = false;
}
if (environment == "grounded") {
if ((environmentchecker != "bellyslide") && (environmentchecker != "nosedivebounce")) {
movementhyp = moverate / Math.pow(Math.pow(dr - dl, 2) + Math.pow(slopesensorDISTANCE, 2), 0.5);
if (Key.isDown(_root.kRIGHT) && (TOUCHwallright == false)) {
moveX = movementhyp * slopesensorDISTANCE;
moveY = movementhyp * (-Math.abs(dr - dl));
faceX = 1;
} else if (Key.isDown(_root.kLEFT) && (TOUCHwallleft == false)) {
moveX = movementhyp * (-slopesensorDISTANCE);
moveY = movementhyp * (-Math.abs(dr - dl));
faceX = -1;
} else {
moveX = 0;
moveY = 0;
}
}
if (Key.isDown(_root.kJUMP) && (jumparmed == true)) {
jumpX = 0;
jumpY = jumprateY;
gspeedX = 0;
gspeedY = 0;
moveY = 0;
movespeedY = 0;
jumparmed = false;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
} else if ((environment == "wallslide") || (environmentchecker == "wallsliding")) {
if (Key.isDown(_root.kRIGHT)) {
faceX = 1;
} else if (Key.isDown(_root.kLEFT)) {
faceX = -1;
}
if (Key.isDown(_root.kJUMP) && (jumparmed == true)) {
jumpX = 0;
jumpY = jumprateY * 1.2;
gspeedX = 0;
gspeedY = 0;
if (Key.isDown(_root.kRIGHT)) {
moveX = -moverate;
} else if (Key.isDown(_root.kLEFT)) {
moveX = moverate;
}
moveY = 0;
movespeedY = 0;
jumparmed = false;
walljumpTIMER = walljumpTIME;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
} else if ((environment == "flying") || (environment == "falling")) {
if (walljumpTIMER <= 0) {
if (environmentchecker != "bellyslide") {
if (Key.isDown(_root.kRIGHT) && (TOUCHwallright == false)) {
moveX = moverate;
faceX = 1;
} else if (Key.isDown(_root.kLEFT) && (TOUCHwallleft == false)) {
moveX = -moverate;
faceX = -1;
} else {
moveX = 0;
}
} else {
moveX = 0;
}
walljumpTIMER = 0;
} else {
walljumpTIMER = walljumpTIMER - 1;
}
if (((Key.isDown(_root.kJUMP) && (jumparmed == true)) && (airjumpCOUNT > 0)) && (walljumpTIMER <= 0)) {
jumpspeedX = 0;
jumpspeedY = jumprateY;
gspeedX = 0;
gspeedY = 0;
moveY = 0;
movespeedY = 0;
jumparmed = false;
airjumpCOUNT = airjumpCOUNT - 1;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
if (environmentchecker == "ground") {
jumpassists = 0;
}
if (((((((jumpassists == 0) && (Key.isDown(_root.kJUMP))) && (gspeedY <= jumpTHRESHOLD)) && ((dr + dl) > -2)) && (walljumpTIMER <= 0)) && (TOUCHwallleft == false)) && (TOUCHwallright == false)) {
airjumpCOUNT = airjumpsMAX;
jumpassists = jumpassists + 1;
}
} else if ((((environment == "duckpaddle") || (environment == "swimmingupward")) || (environment == "swimmingdownward")) || (environment == "watergrounded")) {
if ((Key.isDown(_root.kRIGHT) && (Key.isDown(_root.kUP))) && (environment != "duckpaddle")) {
if ((charROT > -135) && (charROT <= 45)) {
if ((45 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-135 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((45 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-135 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if (Key.isDown(_root.kRIGHT) && (Key.isDown(_root.kDOWN))) {
if ((charROT > -45) && (charROT <= 135)) {
if ((135 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-45 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((135 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-45 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((Key.isDown(_root.kLEFT) && (Key.isDown(_root.kUP))) && (environment != "duckpaddle")) {
if ((charROT >= -45) && (charROT < 135)) {
if ((-45 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (135 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((-45 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (135 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kLEFT) && (Key.isDown(_root.kDOWN))) {
if ((charROT >= -135) && (charROT < 45)) {
if ((-135 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (45 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((-135 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (45 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kRIGHT)) {
if (environment == "duckpaddle") {
faceX = 1;
} else if ((charROT >= -90) && (charROT < 90)) {
if ((90 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-90 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((90 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-90 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if (Key.isDown(_root.kLEFT)) {
if (environment == "duckpaddle") {
faceX = -1;
} else if ((charROT > -90) && (charROT <= 90)) {
if ((90 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (-90 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((90 > (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (-90 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kUP) && (environment != "duckpaddle")) {
if (faceX > 0) {
if ((0 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-180 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 0;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((0 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (180 > (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 0;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (Key.isDown(_root.kDOWN)) {
if (environment == "duckpaddle") {
swimX2 = swimX2 / duckpaddleRATIO;
swimY2 = swimY2 / duckpaddleRATIO;
environment = "swimmingdownward";
}
if (faceX < 0) {
if ((0 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (-180 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 180;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((0 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (180 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 180;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else {
swimspin = 0;
}
if ((swimspeedX > 0) && (environment != "duckpaddle")) {
faceX = 1;
} else if ((swimspeedX < 0) && (environment != "duckpaddle")) {
faceX = -1;
}
if (Key.isDown(_root.kJUMP) && (swimarmed == true)) {
if ((Key.isDown(_root.kUP) && (environment == "duckpaddle")) && (duckjumparmed == true)) {
while (Water.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((charY + offsetY) * worldYSCALEinit) / 100) + worldYinit, true)) {
charY = charY - 1;
}
jumpX = jumprateX;
jumpY = jumprateY;
environment = "duckjump";
environmentchecker = "duckjump";
duckjumparmed = false;
swimarmed = false;
} else if ((((environment == "duckpaddle") && (speedX == 0)) || (((environment == "duckpaddle") && (speedX > 0)) && (TOUCHwallright == false))) || (((environment == "duckpaddle") && (speedX < 0)) && (TOUCHwallleft == false))) {
if (((speedY == 0) || ((speedY > 0) && (TOUCHground == false))) || ((speedY < 0) && (TOUCHceiling == false))) {
swimX = swimrateX / duckpaddleRATIO;
swimY = swimrateY / duckpaddleRATIO;
swimarmed = false;
}
} else if (((speedX == 0) || ((speedX > 0) && (TOUCHwallright == false))) || ((speedX < 0) && (TOUCHwallleft == false))) {
if (((speedY == 0) || ((speedY > 0) && (TOUCHground == false))) || ((speedY < 0) && (TOUCHceiling == false))) {
swimX = swimrateX;
swimY = swimrateY;
swimarmed = false;
}
}
} else {
swimX = 0;
swimY = 0;
}
if (!Key.isDown(_root.kJUMP)) {
swimarmed = true;
duckjumparmed = true;
}
}
if (environment == "duckpaddle") {
charROT = 90 * faceX;
if (airspinspeed != 0) {
swimspinspeed = swimspinspeed + airspinspeed;
airspinspeed = 0;
}
airspin = 0;
if ((charROT > 100) || (charROT < -100)) {
if ((environmentchecker != "water") && (environmentchecker != "duckpaddle")) {
swimI = swimI + (Math.abs(movespeedX) / 3);
}
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
gspeedX = 0;
gspeedY = 0;
gravityX = 0;
gravityY = 0;
windX = watercurrentrateX;
windY = 0;
if ((environmentchecker != "water") && (environmentchecker != "duckpaddle")) {
swimY = 0;
swimY2 = 0;
}
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
environmentchecker = "duckpaddle";
} else if ((environment == "swimmingupward") || (environment == "swimmingdownward")) {
if (airspinspeed != 0) {
swimspinspeed = swimspinspeed + airspinspeed;
airspinspeed = 0;
}
airspin = 0;
if ((charROT > 100) || (charROT < -100)) {
if (environmentchecker != "water") {
swimI = swimI + ((Math.abs(movespeedX) / 3) + (gspeedY / 3));
gspeedY = 0;
}
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = gravityrateX;
gravityY = gravityrateY;
windX = watercurrentrateX;
windY = watercurrentrateY;
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
swimY2 = swimY2 / swimdragY;
swimI = swimI / swimdragY;
gspeedX = gspeedX / waterdragX;
gspeedY = gspeedY / waterdragY;
environmentchecker = "water";
} else if (environment == "watergrounded") {
if (((Math.abs(swimX2) >= swimcollideMAX) || (Math.abs(swimY2) >= swimcollideMAX)) || (Math.abs(swimI) >= swimcollideMAX)) {
swimX2 = Math.min(swimX2, swimcollideMAX);
swimY2 = Math.min(swimY2, swimcollideMAX);
swimI = Math.min(swimI, swimcollideMAX);
} else if (((Math.abs(swimX2) >= 0.25) || (Math.abs(swimY2) >= 0.25)) || (Math.abs(swimI) >= 0.25)) {
swimX2 = swimX2 / watergroundfriction;
swimY2 = swimY2 / watergroundfriction;
swimI = swimI / watergroundfriction;
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
windX = 0;
windY = 0;
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
swimY2 = swimY2 / swimdragY;
movespeedX = movespeedX / waterdragX;
movespeedY = movespeedY / waterdragY;
environmentchecker = "waterground";
} else if ((environment == "flying") || (environment == "falling")) {
charROT = 0;
if ((dr == -1) && (dl == -1)) {
moveY = 0;
movespeedY = 0;
}
if (swimspinspeed != 0) {
airspinspeed = airspinspeed + swimspinspeed;
swimspinspeed = 0;
}
swimspin = 0;
if (((swimX2 != 0) || (swimY2 != 0)) || (swimI != 0)) {
if (environmentchecker == "duckjump") {
swimX2 = swimX2 / duckjumpRATIO;
swimI = swimI / duckjumpRATIO;
}
jumpspeedX = jumpspeedX + (Math.sin(charROT * DEGtoRAD) * swimX2);
if (environmentchecker != "duckjump") {
jumpspeedY = jumpspeedY + Math.min(Math.cos(charROT * DEGtoRAD) * (swimX2 + swimI), swimspeedMAXTRANSFER);
}
}
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
gravityX = gravityrateX;
gravityY = gravityrateY;
windX = windrateX;
windY = windrateY;
if (environment == "flying") {
jumpX = 0;
jumpY = 0;
}
airspinspeed = airspinspeed / airspindrag;
if (environmentchecker != "bellyslide") {
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
} else {
movespeedX = movespeedX / slidedragX;
movespeedY = movespeedY / slidedragY;
}
if (environmentchecker == "nosedivebounce") {
airspin = 0;
if (Math.abs(charROT) < 5) {
charROT = 0;
environmentchecker = ((gspeedY > (jumpspeedY * 2)) ? "air" : "nosedivebounce");
}
}
if (((((environmentchecker == "water") && (Key.isDown(_root.kRIGHT))) && (!Key.isDown(_root.kUP))) && (!Key.isDown(_root.kDOWN))) || ((((environmentchecker == "water") && (Key.isDown(_root.kLEFT))) && (!Key.isDown(_root.kUP))) && (!Key.isDown(_root.kDOWN)))) {
environmentchecker = "porpoising";
} else if (((environmentchecker != "porpoising") && (environmentchecker != "bellyslide")) && (environmentchecker != "nosedivebounce")) {
environmentchecker = "air";
}
} else if (environment == "wallslide") {
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 1;
swimspin = 0;
swimspinspeed = 0;
airspin = 0;
airspinspeed = 0;
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
environmentchecker = "wallsliding";
} else if (environment == "grounded") {
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
swimspin = 0;
swimspinspeed = 0;
airspin = 0;
airspinspeed = 0;
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
if (environmentchecker != "bellyslide") {
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
bellyslideTIME = 0;
} else {
if ((dr - dl) != 0) {
moveX = (((sliderate * slopesensorDISTANCE) / Math.sqrt(Math.pow(dl - dr, 2) + Math.pow(slopesensorDISTANCE, 2))) * (dl - dr)) / Math.abs(dl - dr);
moveY = (sliderate * (-Math.abs(dr - dl))) / Math.sqrt(Math.pow(dr - dl, 2) + Math.pow(slopesensorDISTANCE, 2));
} else {
moveX = 0;
moveY = 0;
}
movespeedX = movespeedX / slidedragX;
movespeedY = movespeedY / slidedragY;
}
if (((((charROT < 89) && (charROT > -89)) && (environmentchecker != "bellyslide")) || ((((environmentchecker == "bellyslide") && (Math.abs(movespeedX) <= slidespeedMIN)) && (Math.abs(dr - dl) <= 0)) && (bellyslideTIME > 100))) || (((environmentchecker == "bellyslide") && (charROT < 30)) && (charROT > -30))) {
charY = charY - ((initHEIGHT - charHEIGHT) / 2);
charROT = 0;
environmentchecker = "ground";
} else if (((charROT < 165) && (charROT > -165)) || (((environmentchecker == "bellyslide") && (charROT < 30)) && (charROT > -30))) {
charY = charY - ((initWIDTH - charHEIGHT) / 2);
charWIDTH = initWIDTH;
charHEIGHT = initWIDTH;
if (environmentchecker != "bellyslide") {
charROT = ((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD);
} else if (charROT != (((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD))) {
slopeDIFFERENCE = (((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD)) - charROT;
charROT = charROT + (slopeDIFFERENCE / 2);
}
bellyslideTIME = bellyslideTIME + 1;
environmentchecker = "bellyslide";
if ((((jumpspeedY == 0) && ((oldslopeANGLE * slopeANGLE) <= 0)) && (oldslopeANGLE != 0)) || (((jumpspeedY == 0) && ((oldslopeANGLE * slopeANGLE) <= 0)) && (slopeANGLE != 0))) {
if (((oldslopeANGLE > 0) && (speedX > 0)) || ((oldslopeANGLE < 0) && (speedX < 0))) {
moveY = 0;
movespeedY = 0;
gspeedY = 0;
rampjumpY = (sliderampBOOST * Math.abs(speedX)) * Math.cos(oldslopeANGLE * DEGtoRAD);
jumpY = ((rampjumpY > 0) ? rampjumpY : 0);
} else {
moveY = 0;
movespeedY = 0;
}
}
} else {
charY = charY - ((initHEIGHT - charHEIGHT) / 2);
charROT = 180;
if (environmentchecker != "nosedivebounce") {
nosedivebounceSTART = getTimer() / 1000;
environmentchecker = "nosedivebounce";
}
if (Key.isDown(_root.kJUMP) && (jumparmed == true)) {
airspin = airspin + (nosediveBOUNCEspinrate * faceX);
jumpX = nosedivejumprateX * faceX;
jumpY = nosedivejumprateY;
environmentchecker = "nosedivebounce";
moveY = 0;
movespeedY = 0;
jumparmed = false;
} else {
jumpX = 0;
jumpY = 0;
if (!Key.isDown(_root.kJUMP)) {
jumparmed = true;
}
}
nosedivebounceTIMER = (getTimer() / 1000) - nosedivebounceSTART;
if (nosedivebounceTIMER >= nosedivebounceTIME) {
airspin = airspin + (nosediveBOUNCEspinrate * faceX);
jumpX = nosediveBOUNCEXrate * faceX;
jumpY = nosediveBOUNCEYrate;
}
}
} else if (environment == "sprung") {
swimX2 = 0;
swimY2 = 0;
swimI = 0;
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
if (TOUCHwater == false) {
jumpX = springrateX;
jumpY = springrateY;
swimX = 0;
swimY = 0;
} else {
swimX = springrateX;
swimY = springrateY;
jumpX = 0;
jumpY = 0;
}
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
environmentchecker = "sprung";
}
movespeedX = movespeedX + moveX;
jumpspeedX = jumpspeedX + jumpX;
swimX2 = swimX2 + swimX;
if ((charROT == 180) || (charROT == -180)) {
swimspeedX = 0;
} else {
swimspeedX = Math.sin(charROT * DEGtoRAD) * (swimX2 + swimI);
}
gspeedX = gspeedX + gravityX;
windspeedX = windX;
movespeedY = movespeedY + moveY;
jumpspeedY = jumpspeedY + jumpY;
swimY2 = swimY2 + swimY;
swimspeedY = Math.cos(charROT * DEGtoRAD) * (swimY2 + swimI);
gspeedY = gspeedY + gravityY;
windspeedY = windY;
if (Math.abs(movespeedX) < 0.1) {
movespeedX = 0;
}
if (Math.abs(movespeedY) < 0.1) {
movespeedY = 0;
}
speedX = (((movespeedX + jumpspeedX) + swimspeedX) - gspeedX) + windspeedX;
speedY = ((((-movespeedY) - jumpspeedY) - swimspeedY) + gspeedY) - windspeedY;
if (speedX > speedXMAX) {
speedX = speedX - (speedX - speedXMAX);
} else if (speedX < (-speedXMAX)) {
speedX = speedX + (speedXMAX - speedX);
}
if (speedY > speedYMAX) {
speedY = speedY - (speedY - speedYMAX);
} else if (speedY < (-speedYMAX)) {
speedY = speedY + (speedYMAX - speedY);
}
if (Math.abs(speedX) < speedMINX) {
speedX = 0;
}
if (Math.abs(speedY) < speedMINY) {
speedY = 0;
}
charX = charX + speedX;
charY = charY + speedY;
swimspinspeed = swimspinspeed + swimspin;
airspinspeed = airspinspeed + airspin;
speedROT = swimspinspeed + airspinspeed;
charROT = charROT + speedROT;
if (charROT > 180) {
charROT = charROT - 360;
} else if (charROT < -180) {
charROT = charROT + 360;
}
if (((speedX == 0) && (speedY == 0)) && (speedROT == 0)) {
charACTION = false;
} else {
charACTION = true;
}
if (charACTION == true) {
if (speedY > 0) {
d = 1;
while (d <= floorpushes) {
if (((!SoftBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true)) && (!HardBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true))) && (!Spring.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true))) {
charY = charY - (d - 1);
break;
}
d++;
}
} else if (speedY < 0) {
u = 1;
while (u <= floorpushes) {
if (!HardBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) - (charHEIGHT * uHEIGHT)) + u) * worldYSCALEinit) / 100) + worldYinit, true)) {
charY = charY + (u - 1);
break;
}
movespeedY = 0;
jumpspeedY = 0;
gspeedY = 0;
u++;
}
}
if ((speedX > 0) || ((environment == "wallslide") && (TOUCHwallright == true))) {
r = 1;
while (r <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) + (charWIDTH * rWIDTH)) - r) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) + (charHEIGHT * rHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX - (r - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
r++;
}
if (environmentchecker != "bellysliding") {
ur = 1;
while (ur <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) + (charWIDTH * urWIDTH)) - ur) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) - (charHEIGHT * urHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX - (ur - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
ur++;
}
}
}
if ((speedX < 0) || ((environment == "wallslide") && (TOUCHwallleft == true))) {
l = 1;
while (l <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) - (charWIDTH * lWIDTH)) + l) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) + (charHEIGHT * lHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX + (l - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
l++;
}
if (environmentchecker != "bellysliding") {
ul = 1;
while (ul <= floorpushes) {
if (!HardBoundary.hitTest((((((charX + offsetX) - (charWIDTH * ulWIDTH)) + ul) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) - (charHEIGHT * ulHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX + (ul - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
ul++;
}
}
}
}
oldslopeANGLE = slopeANGLE;
if ((((charACTION == true) && (oldTOUCHdigit == false)) && (digitMODE == "constant")) || ((charACTION == true) && (digitMODE != "constant"))) {
dr = 0;
while (dr <= floorpushes) {
if ((!SoftBoundary.hitTest(((((charX + offsetX) + (slopesensorDISTANCE / 2)) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dr) * worldYSCALEinit) / 100) + worldYinit, true)) && (!HardBoundary.hitTest(((((charX + offsetX) + slopesensorDISTANCE) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dr) * worldYSCALEinit) / 100) + worldYinit, true))) {
dr = dr - 1;
break;
}
dr++;
}
dl = 0;
while (dl <= floorpushes) {
if ((!SoftBoundary.hitTest(((((charX + offsetX) - (slopesensorDISTANCE / 2)) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dl) * worldYSCALEinit) / 100) + worldYinit, true)) && (!HardBoundary.hitTest(((((charX + offsetX) - slopesensorDISTANCE) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dl) * worldYSCALEinit) / 100) + worldYinit, true))) {
dl = dl - 1;
break;
}
dl++;
}
slopeANGLE = Math.atan((dr - dl) / slopesensorDISTANCE) / DEGtoRAD;
if ((TOUCHdigit == true) && (digitMODE == "restricted")) {
slopeANGLE = Math.round(slopeANGLE / digitARCLENGTH) * digitARCLENGTH;
if (slopeANGLE > 0) {
dr = Math.abs((Math.tan(slopeANGLE * DEGtoRAD) * slopesensorDISTANCE) / 2);
dl = -dr;
} else {
dr = -Math.abs((Math.tan(slopeANGLE * DEGtoRAD) * slopesensorDISTANCE) / 2);
dl = -dr;
}
}
}
if ((((TOUCHground == true) && (TOUCHdigit == false)) || ((jumpspeedY < gspeedY) && (jumpspeedY > 0))) || ((jumpspeedY == 0) && (gspeedY > jumpTHRESHOLD))) {
oldTOUCHdigit = false;
} else {
oldTOUCHdigit = true;
}
totalspeed = Math.pow(Math.pow(speedX, 2) + Math.pow(speedY, 2), 0.5);
if ((Key.isDown(17) && ((camXSCALE + zoomINCREMENTmanual) <= zoomMAXmanual)) && ((camYSCALE + zoomINCREMENTmanual) <= zoomMAXmanual)) {
camXSCALE = camXSCALE + zoomINCREMENTmanual;
camYSCALE = camYSCALE + zoomINCREMENTmanual;
zoomMIN = zoomMIN + zoomINCREMENTmanual;
} else if ((Key.isDown(16) && ((camXSCALE - zoomINCREMENTmanual) >= zoomMINmanual)) && ((camYSCALE - zoomINCREMENTmanual) >= zoomMINmanual)) {
camXSCALE = camXSCALE - zoomINCREMENTmanual;
camYSCALE = camYSCALE - zoomINCREMENTmanual;
zoomMIN = zoomMIN - zoomINCREMENTmanual;
} else {
if (((((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) <= (camX - (camWIDTH / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX)) || ((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) >= (camX + (camWIDTH / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camXSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) <= (camY - (camHEIGHT / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) >= (camY + (camHEIGHT / 2)))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) {
camXSCALE = camXSCALE + zoomINCREMENT;
camYSCALE = camYSCALE + zoomINCREMENT;
} else if (((((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) >= (camX - (camWIDTH / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camYSCALE - zoomINCREMENT) >= zoomMIN)) || ((((!Key.isDown(16)) && ((charX + (speedX * zoomLEAD)) <= (camX + (camWIDTH / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camXSCALE - zoomINCREMENT) >= zoomMIN))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) >= (camY - (camHEIGHT / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camYSCALE - zoomINCREMENT) >= zoomMIN))) || ((((!Key.isDown(16)) && ((charY + (speedY * zoomLEAD)) <= (camY + (camHEIGHT / 2)))) && ((camXSCALE - zoomINCREMENT) >= zoomMIN)) && ((camYSCALE - zoomINCREMENT) >= zoomMIN))) {
camXSCALE = camXSCALE - zoomINCREMENT;
camYSCALE = camYSCALE - zoomINCREMENT;
}
if (((((((!Key.isDown(16)) && (charX <= ((camX - (camWIDTH / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX)) || ((((!Key.isDown(16)) && (charX >= ((camX + (camWIDTH / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camXSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && (charY <= ((camY - (camHEIGHT / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) || ((((!Key.isDown(16)) && (charY >= ((camY + (camHEIGHT / 2)) + safezoneDISTANCE))) && ((camXSCALE + zoomINCREMENT) <= zoomMAX)) && ((camYSCALE + zoomINCREMENT) <= zoomMAX))) {
camXSCALE = camXSCALE + zoomINCREMENT;
camYSCALE = camYSCALE + zoomINCREMENT;
zoomMIN = zoomMIN + zoomINCREMENTmanual;
}
}
if ((TOUCHwater == false) && (environmentchecker != "bellyslide")) {
camspeedX = ((charX + (speedX * ((camLOOSENESS + camMOVEXLEAD) / (worldXSCALE / 100)))) - camX) / (camLOOSENESS / (worldXSCALE / 100));
if ((Math.abs(speedX) >= moverate) || (Math.abs(speedY) >= moverate)) {
camX = camX + ((Math.abs(camspeedX) > 1) ? (camspeedX) : 0);
}
} else {
camspeedX = ((charX + (speedX * ((camLOOSENESS + camWATERXLEAD) / (worldXSCALE / 100)))) - camX) / (camLOOSENESS / (worldXSCALE / 100));
if ((Math.abs(speedX) >= moverate) || (Math.abs(speedY) >= moverate)) {
camX = camX + ((Math.abs(camspeedX) > 1) ? (camspeedX) : 0);
}
}
if (((TOUCHwater == false) && (Math.abs(speedY) < 10)) && (environmentchecker != "bellyslide")) {
camspeedY = ((charY + (speedY * ((camLOOSENESS + camMOVEYLEAD) / (worldYSCALE / 100)))) - camY) / (camLOOSENESS / (worldYSCALE / 100));
camY = camY + camspeedY;
} else {
camspeedY = ((charY + (speedY * ((camLOOSENESS + camWATERYLEAD) / (worldYSCALE / 100)))) - camY) / (camLOOSENESS / (worldYSCALE / 100));
camY = camY + camspeedY;
}
if (Math.abs(camX - charX) > ((camWIDTH * 3) / 8)) {
camX = charX + ((((camWIDTH * 3) / 8) * (camX - charX)) / Math.abs(camX - charX));
}
if (Math.abs(camY - charY) > ((camHEIGHT * 3) / 8)) {
camY = charY + ((((camHEIGHT * 3) / 8) * (camY - charY)) / Math.abs(camY - charY));
}
camWIDTH = (camWIDTHinit * camXSCALE) / 100;
camHEIGHT = (camHEIGHTinit * camYSCALE) / 100;
if (!Key.isDown(46)) {
scaleX = stageWIDTH / camWIDTH;
scaleY = stageHEIGHT / camHEIGHT;
worldX = stagehalfWIDTH - (camX * scaleX);
worldY = stagehalfHEIGHT - (camY * scaleY);
worldXSCALE = 100 * scaleX;
worldYSCALE = 100 * scaleY;
camROT = 0;
worldROT = -camROT;
}
frameloops++;
}
Player1._x = charX;
Player1._y = charY;
Player1._rotation = charROT;
Player1.sensor._x = charsensorX;
Player1.sensor._y = charsensorY;
Player1.sensor._width = charsensorWIDTH;
Player1.sensor._height = charsensorHEIGHT;
if (faceX > 0) {
Player1._xscale = 100;
} else if (faceX < 0) {
Player1._xscale = -100;
}
camera._x = camX;
camera._y = camY;
camera._rotation = camROT;
camera._xscale = camXSCALE;
camera._yscale = camYSCALE;
camera._width = camWIDTH;
camera._height = camHEIGHT;
_x = worldX;
_y = worldY;
_rotation = worldROT;
_xscale = worldXSCALE;
_yscale = worldYSCALE;
}
Frame 73
if (_root.go != true) {
gotoAndStop (72);
} else {
_root.go = false;
}
Frame 74
_root.cutscene5 = false;
Mouse.show();
stopAllSounds();
_root.died = false;
_root.levelCOMPLETE = getTimer() / 1000;
_root.levelTIME = Math.round(((_root.levelCOMPLETE + _root.levelDEADTIME) - (_root.levelSTART + _root.pauseTIME)) * 10000) / 10000;
_root.levelDEADTIME = 0;
_root.levelTIMESTR = _root.levelTIME + " sec";
_root.pointratio = Math.round((_root.player1points / _root.totalpoints) * 10000) / 100;
_root.gameTIME = _root.gameTIME + _root.levelTIME;
_root.GAMEplayer1points = _root.GAMEplayer1points + _root.player1points;
_root.gamedeaths = _root.gamedeaths + _root.leveldeaths;
if (_root.cheats != true) {
_root.topdeaths.text = "---";
if (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] != undefined) {
_root.topdeaths.text = _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"];
}
if ((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] == undefined) || (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] > _root.leveldeaths)) {
_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"] = _root.leveldeaths;
} else {
_root.newdeathsrecord.text = "";
}
_root.toptime.text = "---";
if (_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] != undefined) {
_root.toptime.text = _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"];
}
if ((((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] == undefined) && (_root.leveldeaths <= _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"])) || ((_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] > _root.levelTIME) && (_root.leveldeaths <= _root.savedData.data[("LVL" + _root.level.substr(6)) + "player1deaths"]))) || (_root.newdeathsrecord.text != "")) {
_root.savedData.data[("LVL" + _root.level.substr(6)) + "player1time"] = _root.levelTIME;
} else {
_root.newtimerecord.text = "";
}
_root.leveldeaths = 0;
if (_root.savedData.data.levelMAX == 9) {
_root.savedData.data.levelMAX = 10;
}
_root.savedData.flush();
}
if (_root.stattracking == true) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl9complete");
if (_root.pointratio >= 100) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl9coins100percent");
} else if (_root.pointratio >= 50) {
StatTracker.submitStat("/flashgames/breakfastclub/lvl9coins050percent");
}
}
stop();
Instance of Symbol 240 MovieClip in Frame 74
onClipEvent (load) {
this.textvalue = "Menu";
this.linkvalue = "Game Start";
this.gotoAndStop("Menu");
}
Frame 75
if (_root.go != true) {
gotoAndStop (74);
} else {
_root.go = false;
}
Frame 76
stopAllSounds();
_root.go = false;
stop();
Frame 77
if (_root.go != true) {
gotoAndStop (76);
} else {
_root.go = false;
}
Frame 78
if (_root.cheats != true) {
_root.topdeaths.text = "---";
if (_root.savedData.data.player1gamedeaths != undefined) {
_root.topdeaths.text = _root.savedData.data.player1gamedeaths;
}
if (((_root.savedData.data.player1gamedeaths == undefined) && (_root.gamestartpoint == "First")) || ((_root.savedData.data.player1gamepoints < _root.gamedeaths) && (_root.gamestartpoint == "First"))) {
_root.savedData.data.player1gamedeaths = _root.gamedeaths;
} else {
_root.newdeathsrecord.text = "";
}
_root.toptime.text = "---";
if (_root.savedData.data.player1gametime != undefined) {
_root.toptime.text = _root.savedData.data.player1gametime;
}
if (((((_root.savedData.data.player1gametime == undefined) && (_root.savedData.data.player1gamepoints <= _root.gamedeaths)) && (_root.gamestartpoint == "First")) || (((_root.savedData.data.player1gametime > _root.gameTIME) && (_root.savedData.data.player1gamepoints <= _root.gamedeaths)) && (_root.gamestartpoint == "First"))) || (_root.newdeathsrecord.text != "")) {
_root.savedData.data.player1gametime = _root.gameTIME;
} else {
_root.newtimerecord.text = "";
}
_root.toppoints.text = "---";
_root.topratio.text = "---";
if (_root.savedData.data.player1gamepoints != undefined) {
_root.toppoints.text = _root.savedData.data.player1gamepoints;
_root.topratio.text = Math.round((_root.savedData.data.player1gamepoints / _root.totalpoints) * 10000) / 100;
}
if (((_root.savedData.data.player1gamepoints == undefined) && (_root.gamestartpoint == "First")) || ((_root.savedData.data.player1gamepoints < _root.GAMEplayer1points) && (_root.gamestartpoint == "First"))) {
_root.savedData.data.player1gamepoints = _root.GAMEplayer1points;
} else {
_root.newcoinrecord.text = "";
_root.newratiorecord.text = "";
}
_root.savedData.flush();
}
_root.GAMEtotalpoints = 0;
levelname = 0;
while (levelname < (_root.savedData.data.levelMAX - 1)) {
_root.GAMEtotalpoints = _root.GAMEtotalpoints + _root.savedData.data[("LVL" + _root.LevelNames[levelname]) + "totalpoints"];
levelname++;
}
_root.GAMEpointratio = Math.round((_root.GAMEplayer1points / _root.GAMEtotalpoints) * 10000) / 100;
_root.gameTIMESTR = _root.gameTIME + " sec";
if (_root.gamestartpoint == "First") {
_root.incomplete.text = "";
}
if (_root.stattracking == true) {
StatTracker.submitStat("/flashgames/breakfastclub/gamecomplete");
if (_root.GAMEpointratio >= 100) {
StatTracker.submitStat("/flashgames/breakfastclub/gamecoins100percent");
} else if (_root.GAMEpointratio >= 50) {
StatTracker.submitStat("/flashgames/breakfastclub/gamecoins050percent");
}
}
Frame 79
if (_root.go != true) {
gotoAndStop (78);
} else {
_root.go = false;
}
Symbol 1 MovieClip [camShaker] Frame 1
shakeLoop = 0;
force = 15;
onEnterFrame = function () {
gemPause();
};
Symbol 1 MovieClip [camShaker] Frame 2
if (_root.world.camera._x < ((_root.world.bgWidth - 250) - force)) {
_root.world.camera._x = _root.world.camera._x + force;
}
Symbol 1 MovieClip [camShaker] Frame 3
if (_root.world.camera._x < ((_root.world.bgWidth - 250) - force)) {
_root.world.camera._x = _root.world.camera._x + force;
}
Symbol 1 MovieClip [camShaker] Frame 4
if (_root.world.camera._x > (250 + force)) {
_root.world.camera._x = _root.world.camera._x - force;
}
Symbol 1 MovieClip [camShaker] Frame 5
if (_root.world.camera._x > (250 + force)) {
_root.world.camera._x = _root.world.camera._x - force;
}
Symbol 1 MovieClip [camShaker] Frame 6
if (_root.world.camera._x > (250 + force)) {
_root.world.camera._x = _root.world.camera._x - force;
}
Symbol 1 MovieClip [camShaker] Frame 7
if (_root.world.camera._x > (250 + force)) {
_root.world.camera._x = _root.world.camera._x - force;
}
Symbol 1 MovieClip [camShaker] Frame 8
if (_root.world.camera._x < ((_root.world.bgWidth - 250) - force)) {
_root.world.camera._x = _root.world.camera._x + force;
}
Symbol 1 MovieClip [camShaker] Frame 9
if (_root.world.camera._x < ((_root.world.bgWidth - 250) - force)) {
_root.world.camera._x = _root.world.camera._x + force;
}
Symbol 1 MovieClip [camShaker] Frame 10
shakeLoop = shakeLoop + 1;
if (shakeLoop > shakes) {
this.removeMovieClip();
} else {
gotoAndPlay (2);
}
Symbol 6 MovieClip Frame 1
_xscale = _parent._parent.bubbleSCALE;
_yscale = _parent._parent.bubbleSCALE;
Symbol 7 MovieClip [Bubble 1] Frame 1
onEnterFrame = function () {
if ((!_parent.Water.hitTest((((((bubble._x * _xscale) / 100) + _x) * _parent._xscale) / 100) + _parent._x, (((((bubble._y * _yscale) / 100) + _y) * _parent._yscale) / 100) + _parent._y, true)) || (_parent.Player1.sensor.bubbles > (parseFloat(_name.substr(6)) + _parent.Player1.sensor.bubblesMAX))) {
this.removeMovieClip();
}
};
Symbol 7 MovieClip [Bubble 1] Frame 60
removeMovieClip(this);
Symbol 14 MovieClip Frame 1
stop();
Symbol 1140 MovieClip [__Packages.com.managers.SoundManager] Frame 0
class com.managers.SoundManager extends MovieClip
{
var thisMC, sounds_array, globalSound_snd, theSoundClipMC, getNextHighestDepth, createEmptyMovieClip;
function SoundManager (aSoundRef) {
super();
thisMC = aSoundRef;
sounds_array = new Array();
}
function init() {
}
function addSound(aSoundLinkage_str) {
globalSound_snd = new Sound(this);
var _local6 = ("sndHolder_" + String(sounds_array.length)) + "_mc";
var _local4 = thisMC.getNextHighestDepth();
var _local5 = thisMC.createEmptyMovieClip(_local6, _local4);
theSoundClipMC = _local5;
var _local3 = MovieClip(theSoundClipMC);
var _local2 = new Sound(_local3);
_local2.attachSound(aSoundLinkage_str);
sounds_array.push(_local3);
var _local7 = new com.managers.SoundDataObject(aSoundLinkage_str, _local2);
sounds_array.push(_local7);
}
function getSound(aSoundLinkage_str) {
var _local2;
var _local6 = sounds_array.length;
_local2 = 0;
while (_local2 < _local6) {
var _local3 = sounds_array[_local2];
var _local5 = _local3.__get__name();
if (aSoundLinkage_str == _local5) {
var _local4 = _local3.__get__sound();
return(_local4);
}
_local2++;
}
}
function playSound(aSoundLinkage_str, aOffset_num, aLoopCount_num) {
stopSound(aSoundLinkage_str);
var _local2 = getSound(aSoundLinkage_str);
_local2.start(aOffset_num, aLoopCount_num);
}
function stopSound(aSoundLinkage_str) {
var _local2 = getSound(aSoundLinkage_str);
_local2.stop(aSoundLinkage_str);
}
function setSoundVolume(aSoundLinkage_str, aVolume_num) {
var _local2 = getSound(aSoundLinkage_str);
_local2.setVolume(aVolume_num);
}
function getSoundVolume(aSoundLinkage_str) {
var _local2 = getSound(aSoundLinkage_str);
return(_local2.getVolume());
}
function tweenSoundVolume(aSoundLinkage_str, aTargetVolume_num, aNumberOfFrames) {
var _local3 = getSoundVolume(aSoundLinkage_str);
if (_local3 == undefined) {
} else {
var _local4 = aTargetVolume_num;
var _local6 = Math.abs(_local3 - _local4);
if (_local6 < aNumberOfFrames) {
_local6 = aNumberOfFrames;
}
var _local5 = 1;
if (_local3 < _local4) {
_local5 = 1;
} else if (_local3 > _local4) {
_local5 = -1;
} else {
trace("tCurrentVolume == tTargetVolume");
}
var _local8 = _local6 / aNumberOfFrames;
if (_local8 < 1) {
_local8 = 1;
}
var _local13 = _local8 * _local5;
var _local12 = ("tweenHolder_" + aSoundLinkage_str) + "_mc";
var _local11 = getNextHighestDepth();
var _local14 = createEmptyMovieClip(_local12, _local11);
var _local2 = MovieClip(_local14);
_local2.ref = this;
_local2.targetVolume = _local4;
_local2.modNumber = _local5;
_local2.soundLinkage = aSoundLinkage_str;
_local2.changePerFrame = _local13;
_local2.onEnterFrame = function () {
var _local2 = this.ref.getSoundVolume(this.soundLinkage);
if (this.modNumber > 0) {
if (_local2 > this.targetVolume) {
this.onEnterFrame = null;
}
} else if (this.modNumber < 0) {
if (_local2 < this.targetVolume) {
this.onEnterFrame = null;
}
} else {
trace("this.modNumber == 0 in Sound Manager, something is broken");
}
var _local3 = _local2 + this.changePerFrame;
this.ref.setSoundVolume(aSoundLinkage_str, _local3);
};
}
}
function setGlobalVolume(aVolume_num) {
globalSound_snd.setVolume(aVolume_num);
}
}
Symbol 1141 MovieClip [__Packages.com.managers.SoundDataObject] Frame 0
class com.managers.SoundDataObject extends Object
{
var name_str, sound_snd;
function SoundDataObject (aSoundName_str, aSound_snd) {
super();
name_str = aSoundName_str;
sound_snd = aSound_snd;
}
function get sound() {
return(sound_snd);
}
function get name() {
return(name_str);
}
}
Symbol 1142 MovieClip [__Packages.com.utilities.StatTracker] Frame 0
class com.utilities.StatTracker
{
function StatTracker () {
}
function init() {
}
static function submitStat(aString) {
var _local1 = ("javascript:urchinTracker('/flashtracking" + aString) + "');";
trace("tUrchinString = " + _local1);
getURL (_local1);
}
}
Symbol 24 MovieClip Frame 1
_root.stop();
if (_root.died == true) {
_root.levelDEAD = getTimer() / 1000;
_root.levelDEADTIME = _root.levelDEADTIME + (_root.levelDEAD - _root.levelSTART);
} else {
_root.levelDEADTIME = 0;
}
onMouseDown = function () {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_root.soundManager_mc.playSound("Beep_Error06.wavsound", 0, 1);
if (_parent._parent._name == "World") {
_root.gotoAndPlay(_root.level + " Start");
} else {
_root.levelSTART = getTimer() / 1000;
_root.go = true;
_parent.play();
}
}
};
armed = false;
var buttonColor = new Color(this);
var mouseoverFlash = {ra:100, rb:100, ga:100, gb:100, ba:100, bb:100, aa:100, ab:0};
var normal = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
onEnterFrame = function () {
if (Key.isDown(_root.kSTART) && (armed == true)) {
_root.soundManager_mc.playSound("Beep_Error06.wavsound", 0, 1);
if (_parent._parent._name == "World") {
_root.gotoAndPlay(_root.level + " Start");
} else {
_root.levelSTART = getTimer() / 1000;
_root.go = true;
_parent.play();
}
} else if (!Key.isDown(_root.kSTART)) {
armed = true;
}
if ((((_parent._xmouse > (this._x - (this._width / 2))) && (_parent._xmouse < (this._x + (this._width / 2)))) && (_parent._ymouse > (this._y - (this._height / 2)))) && (_parent._ymouse < (this._y + (this._height / 2)))) {
buttonColor.setTransform(mouseoverFlash);
} else {
buttonColor.setTransform(normal);
}
};
Symbol 32 Button
on (release) {
stopAllSounds();
getURL ("http://www.liquidgeneration.com/Content/090307/breakfastclub_videogame.html", "_new");
}
Instance of Symbol 37 MovieClip in Symbol 38 MovieClip Frame 1
onClipEvent (load) {
if (_parent._parent._parent._name != "World") {
_parent._parent.stop();
_parent._parent.onEnterFrame = undefined;
_parent.stop();
stop();
}
}
Symbol 38 MovieClip Frame 48
stop();
Symbol 39 MovieClip [Rock 1] Frame 1
if (onEnterFrame == undefined) {
this.framerateMAX = _root.World.framerateMAX;
catchTIMER = 0;
rockTIMER = 0;
rockTIME = 10;
rockBLINKTIME = 2;
playerDISMAX = 1000;
bouncerate = 1.25;
deadspeed = 0.5;
gspeedX = 0;
gspeedY = 0;
onEnterFrame = function () {
this.engineloops = _root.World.engineloops;
rockTIMER = rockTIMER + ((1 / this.framerateMAX) * this.engineloops);
playerDIS = Math.sqrt(Math.pow(_parent.Player1._x - _x, 2) + Math.pow(_parent.Player1._y - _y, 2));
if ((rockTIME <= rockTIMER) || (playerDIS > playerDISMAX)) {
this.removeMovieClip();
} else if ((rockTIMER > (rockTIME - rockBLINKTIME)) && (_visible == true)) {
_visible = false;
} else if (rockTIMER > (rockTIME - rockBLINKTIME)) {
_visible = true;
}
if (catchTIMER > _parent.throwTIME) {
if ((Math.abs((_parent.Player1.sensor._x + _parent.Player1._x) - _x) <= (_parent.Player1.sensor._width / 2)) && (Math.abs((_parent.Player1.sensor._y + _parent.Player1._y) - _y) <= (_parent.Player1.sensor._height / 2))) {
if (_parent.Player1.rocksloaded < (_parent.Player1.rocksloadedMAX + Math.floor(_root.World.Player1.points / 100))) {
_parent.Player1.rocksloaded = _parent.Player1.rocksloaded + 1;
_parent.attachMovie("Rock Number", "rocknumber" + _parent.Player1.rocksloaded, 250, {_x:_x, _y:_y - 10, rocksloaded:_parent.Player1.rocksloaded});
}
this.removeMovieClip();
}
} else {
catchTIMER = catchTIMER + 1;
}
if (((speedX == undefined) || (speedY == undefined)) || (((Math.abs(speedX) < deadspeed) && (Math.abs(speedY) < deadspeed)) && (environment != "frozen"))) {
offsetX = 0;
offsetY = 0;
throwX = 0;
throwY = 0;
gravityX = 0;
gravityY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
speedX = 0;
speedY = 0;
environment = "frozen";
} else if ((((speedX != 0) && (speedY != 0)) || (throwspeedX != undefined)) || (throwspeedY != undefined)) {
frameloops = 1;
while (frameloops <= _parent.engineloops) {
charWIDTH = 20;
charHEIGHT = 20;
if ((_parent.SoftBoundary.hitTest((((_x + offsetX) * _parent._xscale) / 100) + _parent._x, ((((_y + offsetY) + (charHEIGHT * 0.5)) * _parent._yscale) / 100) + _parent._y, true) && (speedY >= 0)) || (_parent.HardBoundary.hitTest((((_x + offsetX) * _parent._xscale) / 100) + _parent._x, ((((_y + offsetY) + (charHEIGHT * 0.5)) * _parent._yscale) / 100) + _parent._y, true) && (speedY >= 0))) {
TOUCHground = true;
} else {
TOUCHground = false;
}
if (_parent.HardBoundary.hitTest(((((_x + offsetX) + (charWIDTH * 0.5)) * _parent._xscale) / 100) + _parent._x, ((((_y + offsetY) + (charHEIGHT * 0.25)) * _parent._yscale) / 100) + _parent._y, true)) {
TOUCHwallright = true;
throwspeedX = throwspeedX / (-bouncerate);
} else {
TOUCHwallright = false;
}
if (_parent.HardBoundary.hitTest(((((_x + offsetX) - (charWIDTH * 0.5)) * _parent._xscale) / 100) + _parent._x, ((((_y + offsetY) + (charHEIGHT * 0.25)) * _parent._yscale) / 100) + _parent._y, true)) {
TOUCHwallleft = true;
throwspeedX = throwspeedX / (-bouncerate);
} else {
TOUCHwallleft = false;
}
if (_parent.HardBoundary.hitTest((((_x + offsetX) * _parent._xscale) / 100) + _parent._x, ((((_y + offsetY) - (charHEIGHT * 0.5)) * _parent._yscale) / 100) + _parent._y, true)) {
TOUCHceiling = true;
throwspeedY = throwspeedY / (-bouncerate);
gspeedY = 0;
} else {
TOUCHceiling = false;
}
if (_parent.Water.hitTest((((_x + offsetX) * _parent._xscale) / 100) + _parent._x, (((_y + offsetY) * _parent._yscale) / 100) + _parent._y, true)) {
TOUCHwater = true;
} else {
TOUCHwater = false;
}
if (_parent.Spring.hitTest((((_x + offsetX) * _parent._xscale) / 100) + _parent._x, ((((_y + offsetY) + (charHEIGHT * 0.5)) * _parent._yscale) / 100) + _parent._y, true) && (speedY >= 0)) {
TOUCHspring = true;
} else {
TOUCHspring = false;
}
if (((((TOUCHwater == true) && (TOUCHground == true)) || ((TOUCHwater == true) && (TOUCHceiling == true))) || ((TOUCHwater == true) && (TOUCHwallleft == true))) || ((TOUCHwater == true) && (TOUCHwallright == true))) {
environment = "watergrounded";
} else if ((TOUCHwater == true) && (speedY < 0)) {
environment = "swimmingupward";
} else if (((TOUCHwater == true) && (TOUCHground == false)) && (speedY >= 0)) {
environment = "swimmingdownward";
} else if ((TOUCHspring == true) && (speedY >= 0)) {
environment = "sprung";
} else if ((TOUCHground == true) && (speedY >= 0)) {
environment = "grounded";
} else if (speedY < 0) {
environment = "flying";
} else if ((TOUCHground == false) && (speedY >= 0)) {
environment = "falling";
}
if (environment == "duckpaddle") {
throwspeedX = 0;
throwspeedY = 0;
throwX = 0;
throwY = 0;
gspeedX = 0;
gspeedY = 0;
gravityX = 0;
gravityY = 0;
windX = _parent.watercurrentrateX;
windY = 0;
environmentchecker = "duckpaddle";
} else if ((environment == "swimmingupward") || (environment == "swimmingdownward")) {
throwspeedY = 0;
throwX = 0;
throwY = 0;
gravityX = _parent.gravityrateX;
gravityY = _parent.gravityrateY;
windX = _parent.watercurrentrateX;
windY = _parent.watercurrentrateY;
throwspeedX = throwspeedX / 1.25;
gspeedX = gspeedX / 1.25;
gspeedY = gspeedY / 1.25;
environmentchecker = "water";
} else if (environment == "watergrounded") {
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
throwspeedX = 0;
throwspeedY = 0;
throwX = 0;
throwY = 0;
windX = 0;
windY = 0;
environmentchecker = "waterground";
} else if ((environment == "flying") || (environment == "falling")) {
gravityX = _parent.gravityrateX;
gravityY = _parent.gravityrateY;
windX = _parent.windrateX;
windY = _parent.windrateY;
throwX = 0;
throwY = 0;
environmentchecker = "air";
} else if (environment == "grounded") {
throwspeedX = throwspeedX / _parent.throwdrag;
throwspeedY = throwspeedY / _parent.throwdrag;
if (throwspeedY < 0) {
throwspeedY = ((-1 * throwspeedY) + gspeedY) / bouncerate;
}
if (Math.abs(throwspeedX) < deadspeed) {
throwspeedX = 0;
}
if (Math.abs(throwspeedY) < deadspeed) {
throwspeedY = 0;
}
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
environmentchecker = "ground";
} else if (environment == "sprung") {
throwspeedY = 0;
throwX = _parent.springrateX;
throwY = _parent.springrateY;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
environmentchecker = "sprung";
}
throwspeedX = throwspeedX + throwX;
gspeedX = gspeedX + gravityX;
windspeedX = windX;
throwspeedY = throwspeedY + throwY;
gspeedY = gspeedY + gravityY;
windspeedY = windY;
speedX = (throwspeedX - gspeedX) + windspeedX;
speedY = ((-throwspeedY) + gspeedY) - windspeedY;
if (speedX > _parent.speedXMAX) {
speedX = speedX - (speedX - _parent.speedXMAX);
} else if (speedX < (-_parent.speedXMAX)) {
speedX = speedX + (_parent.speedXMAX - speedX);
}
if (speedY > _parent.speedYMAX) {
speedY = speedY - (speedY - _parent.speedYMAX);
} else if (speedY < (-_parent.speedYMAX)) {
speedY = speedY + (_parent.speedYMAX - speedY);
}
_x = (_x + speedX);
_y = (_y + speedY);
if (speedY >= 0) {
d = 1;
while (d <= _parent.floorpushes) {
if (((!_parent.SoftBoundary.hitTest((((_x + offsetX) * _parent._xscale) / 100) + _parent._x, (((((_y + offsetY) + (charHEIGHT * 0.5)) - d) * _parent._yscale) / 100) + _parent._y, true)) && (!_parent.HardBoundary.hitTest((((_x + offsetX) * _parent._xscale) / 100) + _parent._x, (((((_y + offsetY) + (charHEIGHT * 0.5)) - d) * _parent._yscale) / 100) + _parent._y, true))) && (!_parent.Spring.hitTest((((_x + offsetX) * _parent._xscale) / 100) + _parent._x, (((((_y + offsetY) + (charHEIGHT * 0.5)) - d) * _parent._yscale) / 100) + _parent._y, true))) {
_y = (_y - (d - 1));
break;
}
d++;
}
} else if (speedY < 0) {
u = 1;
while (u <= _parent.floorpushes) {
if (!_parent.HardBoundary.hitTest((((_x + offsetX) * _parent._xscale) / 100) + _parent._x, (((((_y + offsetY) - (charHEIGHT * 0.5)) + u) * _parent._yscale) / 100) + _parent._y, true)) {
_y = (_y + (u - 1));
break;
}
gspeedY = 0;
windspeedY = 0;
speedY = 0;
u++;
}
}
if ((speedX >= 0) || (speedY != 0)) {
r = 1;
while (r <= _parent.floorpushes) {
if (!_parent.HardBoundary.hitTest((((((_x + offsetX) + (charWIDTH * 0.5)) - r) * _parent._xscale) / 100) + _parent._x, ((((_y + offsetY) + (charHEIGHT * 0.375)) * _parent._yscale) / 100) + _parent._y, true)) {
_x = (_x - (r - 1));
break;
}
gspeedX = 0;
windspeedX = 0;
speedX = 0;
r++;
}
ur = 1;
while (ur <= _parent.floorpushes) {
if (!_parent.HardBoundary.hitTest((((((_x + offsetX) + (charWIDTH * 0.3)) - ur) * _parent._xscale) / 100) + _parent._x, ((((_y + offsetY) - (charHEIGHT * 0.25)) * _parent._yscale) / 100) + _parent._y, true)) {
_x = (_x - (ur - 1));
break;
}
gspeedX = 0;
windspeedX = 0;
speedX = 0;
ur++;
}
}
if ((speedX <= 0) || (speedY != 0)) {
l = 1;
while (l <= _parent.floorpushes) {
if (!_parent.HardBoundary.hitTest((((((_x + offsetX) - (charWIDTH * 0.5)) + l) * _parent._xscale) / 100) + _parent._x, ((((_y + offsetY) + (charHEIGHT * 0.375)) * _parent._yscale) / 100) + _parent._y, true)) {
_x = (_x + (l - 1));
break;
}
gspeedX = 0;
windspeedX = 0;
speedX = 0;
l++;
}
ul = 1;
while (ul <= _parent.floorpushes) {
if (!_parent.HardBoundary.hitTest((((((_x + offsetX) - (charWIDTH * 0.3)) + ul) * _parent._xscale) / 100) + _parent._x, ((((_y + offsetY) - (charHEIGHT * 0.25)) * _parent._yscale) / 100) + _parent._y, true)) {
_x = (_x + (ul - 1));
break;
}
gspeedX = 0;
windspeedX = 0;
speedX = 0;
ul++;
}
}
this.totalspeed = Math.pow(Math.pow(speedX, 2) + Math.pow(speedY, 2), 0.5);
frameloops++;
}
}
};
}
Symbol 43 MovieClip [Rock Number] Frame 1
_root.soundManager_mc.playSound("Pickup_bombs.wav", 0, 1);
_root.soundManager_mc.playSound("bender_pickup.aiff", 0, 1);
Symbol 43 MovieClip [Rock Number] Frame 24
removeMovieClip(this);
Symbol 45 MovieClip [PlayerStart] Frame 1
if (_root.World.Player1._x != undefined) {
_root.World.charX = _x;
_root.World.charY = _y;
_root.World.Player1._x = _x;
_root.World.Player1._y = _y;
} else {
_root.World.attachMovie("Player1", "Player1", _root.attachDEPTH, {_x:_x, _y:_y});
_root.attachDEPTH = _root.attachDEPTH + 1;
}
if (_root.World.camera._x != undefined) {
_root.World.camera._x = _x;
_root.World.camera._y = _y;
_root.World.camX = _x;
_root.World.camY = _y;
} else {
_root.World.attachMovie("camFrame", "camera", _root.attachDEPTH, {_x:_x, _y:_y});
_root.attachDEPTH = _root.attachDEPTH + 1;
}
_visible = false;
removeMovieClip(this);
Symbol 79 MovieClip [Bomb 1] Frame 1
bombTIMER = 0;
bombTIME = 0;
bombTIME = 1.5;
framerateDEFAULT = _root.World.framerateDEFAULT;
framerateMAX = _root.World.framerateMAX;
playerDISMAX = 1000;
throwspeedX = this.bombFALLX;
throwspeedY = this.bombFALLY;
gspeedX = 0;
gspeedY = 0;
bouncerate = 1.25;
deadspeed = 0.1;
if (_parent.explosions == undefined) {
_parent.explosions = 0;
}
onEnterFrame = function () {
this.engineloops = _root.World.engineloops;
bombTIMER = bombTIMER + ((1 / this.framerateMAX) * this.engineloops);
playerDIS = Math.sqrt(Math.pow(_parent.Player1._x - _x, 2) + Math.pow(_parent.Player1._y - _y, 2));
if (bombTIME <= bombTIMER) {
_parent.explosions = _parent.explosions + 1;
_parent.attachMovie("Explosion 1", "Explosion" + _parent.explosions, _root.attachDEPTH, {_x:_x, _y:_y});
_root.attachDEPTH = _root.attachDEPTH + 1;
this.removeMovieClip();
}
if (((speedX == undefined) || (speedY == undefined)) || (((Math.abs(speedX) < deadspeed) && (Math.abs(speedY) < deadspeed)) && (environment != "frozen"))) {
offsetX = 0;
offsetY = 0;
throwX = 0;
throwY = 0;
gravityX = 0;
gravityY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
speedX = 0;
speedY = 0;
environment = "frozen";
} else if ((((speedX != 0) && (speedY != 0)) || (throwspeedX != undefined)) || (throwspeedY != undefined)) {
frameloops = 1;
while (frameloops <= _parent.engineloops) {
charWIDTH = 20;
charHEIGHT = 20;
if ((_parent.SoftBoundary.hitTest((((_x + offsetX) * _parent._xscale) / 100) + _parent._x, ((((_y + offsetY) + (charHEIGHT * 0.5)) * _parent._yscale) / 100) + _parent._y, true) && (speedY >= 0)) || (HardBoundary.hitTest((((_x + offsetX) * _parent._xscale) / 100) + _x, ((((_y + offsetY) + (charHEIGHT * 0.5)) * _parent._yscale) / 100) + _y, true) && (speedY >= 0))) {
TOUCHground = true;
} else {
TOUCHground = false;
}
if (_parent.HardBoundary.hitTest(((((_x + offsetX) + (charWIDTH * 0.5)) * _parent._xscale) / 100) + _parent._x, ((((_y + offsetY) + (charHEIGHT * 0.25)) * _parent._yscale) / 100) + _parent._y, true)) {
TOUCHwallright = true;
throwspeedX = throwspeedX / (-bouncerate);
} else {
TOUCHwallright = false;
}
if (_parent.HardBoundary.hitTest(((((_x + offsetX) - (charWIDTH * 0.5)) * _parent._xscale) / 100) + _parent._x, ((((_y + offsetY) + (charHEIGHT * 0.25)) * _parent._yscale) / 100) + _parent._y, true)) {
TOUCHwallleft = true;
throwspeedX = throwspeedX / (-bouncerate);
} else {
TOUCHwallleft = false;
}
if (_parent.HardBoundary.hitTest((((_x + offsetX) * _parent._xscale) / 100) + _parent._x, ((((_y + offsetY) - (charHEIGHT * 0.5)) * _parent._yscale) / 100) + _parent._y, true)) {
TOUCHceiling = true;
throwspeedY = throwspeedY / (-bouncerate);
} else {
TOUCHceiling = false;
}
if (_parent.Water.hitTest((((_x + offsetX) * _parent._xscale) / 100) + _parent._x, (((_y + offsetY) * _parent._yscale) / 100) + _parent._y, true)) {
TOUCHwater = true;
} else {
TOUCHwater = false;
}
if (_parent.Spring.hitTest((((_x + offsetX) * _parent._xscale) / 100) + _parent._x, ((((_y + offsetY) + (charHEIGHT * 0.5)) * _parent._yscale) / 100) + _parent._y, true) && (speedY >= 0)) {
TOUCHspring = true;
} else {
TOUCHspring = false;
}
if (((((TOUCHwater == true) && (TOUCHground == true)) || ((TOUCHwater == true) && (TOUCHceiling == true))) || ((TOUCHwater == true) && (TOUCHwallleft == true))) || ((TOUCHwater == true) && (TOUCHwallright == true))) {
environment = "watergrounded";
} else if ((TOUCHwater == true) && (speedY < 0)) {
environment = "swimmingupward";
} else if (((TOUCHwater == true) && (TOUCHground == false)) && (speedY >= 0)) {
environment = "swimmingdownward";
} else if ((TOUCHspring == true) && (speedY >= 0)) {
environment = "sprung";
} else if ((TOUCHground == true) && (speedY >= 0)) {
environment = "grounded";
} else if (speedY < 0) {
environment = "flying";
} else if ((TOUCHground == false) && (speedY >= 0)) {
environment = "falling";
}
if (environment == "duckpaddle") {
throwspeedX = 0;
throwspeedY = 0;
throwX = 0;
throwY = 0;
gspeedX = 0;
gspeedY = 0;
gravityX = 0;
gravityY = 0;
windX = _parent.watercurrentrateX;
windY = 0;
environmentchecker = "duckpaddle";
} else if ((environment == "swimmingupward") || (environment == "swimmingdownward")) {
throwspeedY = 0;
throwX = 0;
throwY = 0;
gravityX = _parent.gravityrateX;
gravityY = _parent.gravityrateY;
windX = _parent.watercurrentrateX;
windY = _parent.watercurrentrateY;
throwspeedX = throwspeedX / 1.25;
gspeedX = gspeedX / 1.25;
gspeedY = gspeedY / 1.25;
environmentchecker = "water";
} else if (environment == "watergrounded") {
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
throwspeedX = 0;
throwspeedY = 0;
throwX = 0;
throwY = 0;
windX = 0;
windY = 0;
environmentchecker = "waterground";
} else if ((environment == "flying") || (environment == "falling")) {
gravityX = _parent.gravityrateX;
gravityY = _parent.gravityrateY;
windX = _parent.windrateX;
windY = _parent.windrateY;
throwX = 0;
throwY = 0;
environmentchecker = "air";
} else if (environment == "grounded") {
throwspeedX = throwspeedX / _parent.throwdrag;
throwspeedY = throwspeedY / _parent.throwdrag;
if (throwspeedY < 0) {
throwspeedY = ((-1 * throwspeedY) + gspeedY) / bouncerate;
}
if (Math.abs(throwspeedX) < deadspeed) {
throwspeedX = 0;
}
if (Math.abs(throwspeedY) < deadspeed) {
throwspeedY = 0;
}
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
environmentchecker = "ground";
} else if (environment == "sprung") {
throwspeedY = 0;
throwX = _parent.springrateX;
throwY = _parent.springrateY;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
environmentchecker = "sprung";
}
throwspeedX = throwspeedX + throwX;
gspeedX = gspeedX + gravityX;
windspeedX = windX;
throwspeedY = throwspeedY + throwY;
gspeedY = gspeedY + gravityY;
windspeedY = windY;
speedX = (throwspeedX - gspeedX) + windspeedX;
speedY = ((-throwspeedY) + gspeedY) - windspeedY;
if (speedX > _parent.speedXMAX) {
speedX = speedX - (speedX - _parent.speedXMAX);
} else if (speedX < (-_parent.speedXMAX)) {
speedX = speedX + (_parent.speedXMAX - speedX);
}
if (speedY > _parent.speedYMAX) {
speedY = speedY - (speedY - _parent.speedYMAX);
} else if (speedY < (-_parent.speedYMAX)) {
speedY = speedY + (_parent.speedYMAX - speedY);
}
_x = (_x + speedX);
_y = (_y + speedY);
if (speedY >= 0) {
d = 1;
while (d <= _parent.floorpushes) {
if (((!_parent.SoftBoundary.hitTest((((_x + offsetX) * _parent._xscale) / 100) + _parent._x, (((((_y + offsetY) + (charHEIGHT * 0.5)) - d) * _parent._yscale) / 100) + _parent._y, true)) && (!_parent.HardBoundary.hitTest((((_x + offsetX) * _parent._xscale) / 100) + _parent._x, (((((_y + offsetY) + (charHEIGHT * 0.5)) - d) * _parent._yscale) / 100) + _parent._y, true))) && (!_parent.Spring.hitTest((((_x + offsetX) * _parent._xscale) / 100) + _parent._x, (((((_y + offsetY) + (charHEIGHT * 0.5)) - d) * _parent._yscale) / 100) + _parent._y, true))) {
_y = (_y - (d - 1));
break;
}
gspeedY = 0;
windspeedY = 0;
speedY = 0;
d++;
}
} else if (speedY < 0) {
u = 1;
while (u <= _parent.floorpushes) {
if (!_parent.HardBoundary.hitTest((((_x + offsetX) * _parent._xscale) / 100) + _parent._x, (((((_y + offsetY) - (charHEIGHT * 0.5)) + u) * _parent._yscale) / 100) + _parent._y, true)) {
_y = (_y + (u - 1));
break;
}
gspeedY = 0;
windspeedY = 0;
speedY = 0;
u++;
}
}
if ((speedX >= 0) || (speedY != 0)) {
r = 1;
while (r <= _parent.floorpushes) {
if (!_parent.HardBoundary.hitTest((((((_x + offsetX) + (charWIDTH * 0.5)) - r) * _parent._xscale) / 100) + _parent._x, ((((_y + offsetY) + (charHEIGHT * 0.375)) * _parent._yscale) / 100) + _parent._y, true)) {
_x = (_x - (r - 1));
break;
}
gspeedX = 0;
windspeedX = 0;
speedX = 0;
r++;
}
ur = 1;
while (ur <= _parent.floorpushes) {
if (!_parent.HardBoundary.hitTest((((((_x + offsetX) + (charWIDTH * 0.3)) - ur) * _parent._xscale) / 100) + _parent._x, ((((_y + offsetY) - (charHEIGHT * 0.25)) * _parent._yscale) / 100) + _parent._y, true)) {
_x = (_x - (ur - 1));
break;
}
gspeedX = 0;
windspeedX = 0;
speedX = 0;
ur++;
}
}
if ((speedX <= 0) || (speedY != 0)) {
l = 1;
while (l <= _parent.floorpushes) {
if (!_parent.HardBoundary.hitTest((((((_x + offsetX) - (charWIDTH * 0.5)) + l) * _parent._xscale) / 100) + _parent._x, ((((_y + offsetY) + (charHEIGHT * 0.375)) * _parent._yscale) / 100) + _parent._y, true)) {
_x = (_x + (l - 1));
break;
}
gspeedX = 0;
windspeedX = 0;
speedX = 0;
l++;
}
ul = 1;
while (ul <= _parent.floorpushes) {
if (!_parent.HardBoundary.hitTest((((((_x + offsetX) - (charWIDTH * 0.3)) + ul) * _parent._xscale) / 100) + _parent._x, ((((_y + offsetY) - (charHEIGHT * 0.25)) * _parent._yscale) / 100) + _parent._y, true)) {
_x = (_x + (ul - 1));
break;
}
gspeedX = 0;
windspeedX = 0;
speedX = 0;
ul++;
}
}
frameloops++;
}
}
};
Symbol 96 MovieClip [Explosion 1] Frame 1
DEGtoRAD = (Math.PI/180);
this.hitDISTANCE = (this._width / 2) + ((_parent.charWIDTH + _parent.charHEIGHT) / 4);
onEnterFrame = function () {
this.Player1X = _parent.Player1._x;
this.Player1Y = _parent.Player1._y;
this.PlayerHEIGHT = _parent.Player1._height;
this.Player1WIDTH = _parent.Player1._width;
this.Player1DISTANCE = Math.pow(Math.pow(this.Player1X - this._x, 2) + Math.pow(this.Player1Y - this._y, 2), 0.5);
if (((_parent.Player1.rocksloaded > 0) && (this.Player1DISTANCE < this.hitDISTANCE)) && (_root.World.charBLINK == false)) {
this.throwANGLEdamaged = random(90) - 45;
this.throwratedamaged = 8;
_parent.Player1.rocksthrown = _parent.Player1.rocksthrown + 1;
_parent.attachMovie("Rock 1", "rock" + _parent.Player1.rocksthrown, 100 + _parent.Player1.rocksthrown, {_x:_parent.charsensorX + _parent.charX, _y:(_parent.charsensorY + _parent.charY) - ((_parent.charHEIGHT / 2) + 1), throwspeedX:((Math.sin(this.throwANGLEdamaged * DEGtoRAD) * this.throwratedamaged) * _parent.faceX) + _parent.speedX, throwspeedY:(Math.cos(this.throwANGLEdamaged * DEGtoRAD) * this.throwratedamaged) - _parent.speedY, weapon:false});
_parent.oldrock = _parent.Player1.rocksthrown - _parent.rocksMAX;
_parent["rock" + _parent.oldrock].removeMovieClip();
_parent.Player1.rocksloaded = _parent.Player1.rocksloaded - 1;
if (_parent.Player1.rocksloaded > 0) {
this.throwANGLEdamaged = random(90) - 45;
this.throwratedamaged = 8;
_parent.Player1.rocksthrown = _parent.Player1.rocksthrown + 1;
_parent.attachMovie("Rock 1", "rock" + _parent.Player1.rocksthrown, 100 + _parent.Player1.rocksthrown, {_x:_parent.charsensorX + _parent.charX, _y:(_parent.charsensorY + _parent.charY) - ((_parent.charHEIGHT / 2) + 1), throwspeedX:((Math.sin(this.throwANGLEdamaged * DEGtoRAD) * this.throwratedamaged) * _parent.faceX) + _parent.speedX, throwspeedY:(Math.cos(this.throwANGLEdamaged * DEGtoRAD) * this.throwratedamaged) - _parent.speedY});
_parent.oldrock = _parent.Player1.rocksthrown - _parent.rocksMAX;
_parent["rock" + _parent.oldrock].removeMovieClip();
_parent.Player1.rocksloaded = _parent.Player1.rocksloaded - 1;
} else if ((this.Player1DISTANCE < this.hitDISTANCE) && (_root.World.charBLINK == false)) {
_root.World.charALIVE = false;
}
_root.World.charBLINK = true;
} else if ((this.Player1DISTANCE < this.hitDISTANCE) && (_root.World.charBLINK == false)) {
_root.World.charALIVE = false;
}
};
Instance of Symbol 81 MovieClip in Symbol 96 MovieClip [Explosion 1] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 96 MovieClip [Explosion 1] Frame 3
onEnterFrame = undefined;
_root.soundManager_mc.playSound("Explo_Small_Bomb3.wav", 0, 1);
Symbol 96 MovieClip [Explosion 1] Frame 17
removeMovieClip(this);
Symbol 103 MovieClip [Bomber 1] Frame 1
this.bombTIMER = 0;
this.bombINTERVAL = Math.round(_parent.framerateDEFAULT / 0.75);
this.speedX = 1;
this.bombFALLX = this.speedX;
this.bombFALLY = 2;
this.charALIVE = true;
this.vulnerableDISTANCE = _width;
if (this.flyDIR == undefined) {
this.flyDIR = 1;
}
if (this.flyDIR < 0) {
this._xscale = -100;
}
if (_parent.bombs == undefined) {
_parent.bombs = 0;
}
DEGtoRAD = (Math.PI/180);
this.hitDISTANCE = 50;
this.birth = getTimer() / 1000;
onEnterFrame = function () {
this.age = getTimer() / 1000;
this.engineloops = _root.World.engineloops;
if (this.charALIVE == true) {
this.Player1X = _parent.Player1._x;
this.Player1Y = _parent.Player1._y;
this.PlayerHEIGHT = _parent.Player1._height;
this.Player1WIDTH = _parent.Player1._width;
this.Player1DISTANCE = Math.pow(Math.pow(this.Player1X - this._x, 2) + Math.pow(this.Player1Y - this._y, 2), 0.5);
if (((_parent.Player1.rocksloaded > 0) && (this.Player1DISTANCE < this.hitDISTANCE)) && (_root.World.charBLINK == false)) {
this.throwANGLEdamaged = random(90) - 45;
this.throwratedamaged = 8;
_parent.Player1.rocksthrown = _parent.Player1.rocksthrown + 1;
_parent.attachMovie("Rock 1", "rock" + _parent.Player1.rocksthrown, 100 + _parent.Player1.rocksthrown, {_x:_parent.charsensorX + _parent.charX, _y:(_parent.charsensorY + _parent.charY) - ((_parent.charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEdamaged * DEGtoRAD) * throwratedamaged) * _parent.faceX) + _parent.speedX, throwspeedY:(Math.cos(throwANGLEdamaged * DEGtoRAD) * throwratedamaged) - _parent.speedY, weapon:false});
_parent.oldrock = _parent.Player1.rocksthrown - _parent.rocksMAX;
_parent["rock" + _parent.oldrock].removeMovieClip();
_parent.Player1.rocksloaded = _parent.Player1.rocksloaded - 1;
_root.World.charBLINK = true;
} else if ((this.Player1DISTANCE < this.hitDISTANCE) && (_root.World.charBLINK == false)) {
_root.World.charALIVE = false;
}
this._x = this._x - ((this.speedX * this.flyDIR) * this.engineloops);
this.bombTIMER = this.bombTIMER + (0.2 * this.engineloops);
if ((this.bombTIMER >= this.bombINTERVAL) && (!_root.World.HardBoundary.hitTest(((this._x * _root.World.worldXSCALEinit) / 100) + _root.World.worldXinit, ((this._y * _root.World.worldYSCALEinit) / 100) + _root.World.worldYinit, true))) {
this.bombTIMER = 0;
_parent.bombs = _parent.bombs + 1;
_parent.attachMovie("Bomb 1", "Bomb" + _parent.bombs, _root.attachDEPTH, {_x:_x, _y:_y, bombFALLX:this.bombFALLX, bombFALLY:this.bombFALLY});
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.soundManager_mc.playSound("Cartoon_BombFall_Whistle1.wav", 0, 1);
}
if (((Math.abs(_x - _parent.camera._x) > ((_parent.camera._width / 2) + _root.World.badguyDISTANCEMAX)) && ((this.age - this.birth) > 2)) || ((Math.abs(_y - _parent.camera._y) > (((_parent.camera._height / 2) + this._height) + _root.World.badguyDISTANCEMAX)) && ((this.age - this.birth) > 2))) {
this.removeMovieClip();
}
if (this.charALIVE == true) {
rockcheck = _parent.Player1.rocksthrown - _root.World.rocksMAX;
while (rockcheck <= _parent.Player1.rocksthrown) {
if (((_parent["rock" + rockcheck].weapon == true) && (_parent["rock" + rockcheck] != undefined)) && (_parent["rock" + rockcheck].totalspeed > 5)) {
this[("rock" + rockcheck) + "currentXDIS"] = _parent["rock" + rockcheck]._x - this._x;
this[("rock" + rockcheck) + "currentYDIS"] = _parent["rock" + rockcheck]._y - this._y;
this[("rock" + rockcheck) + "currentDIS"] = Math.pow(Math.pow((this[("rock" + rockcheck) + "currentXDIS"] + this[("rock" + rockcheck) + "oldXDIS"]) / 2, 2) + Math.pow((this[("rock" + rockcheck) + "currentYDIS"] + this[("rock" + rockcheck) + "oldYDIS"]) / 2, 2), 0.5);
this[("rock" + rockcheck) + "avgDIS"] = Math.pow(Math.pow(this[("rock" + rockcheck) + "currentXDIS"], 2) + Math.pow(this[("rock" + rockcheck) + "currentYDIS"], 2), 0.5);
if ((this[("rock" + rockcheck) + "currentDIS"] < vulnerableDISTANCE) || (this[("rock" + rockcheck) + "avgDIS"] < vulnerableDISTANCE)) {
this.charALIVE = false;
_root.soundManager_mc.playSound("explosion.wav", 0, 1);
_parent["rock" + rockcheck].removeMovieClip();
_parent.attachMovie("BomberExplosion", this._name + "EXPLOSION", _root.attachDEPTH, {_x:_x, _y:_y, _xscale:50, _yscale:50});
this.removeMovieClip();
}
this[("rock" + rockcheck) + "oldXDIS"] = this[("rock" + rockcheck) + "currentXDIS"];
this[("rock" + rockcheck) + "oldYDIS"] = this[("rock" + rockcheck) + "currentYDIS"];
this[("rock" + rockcheck) + "oldDIS"] = this[("rock" + rockcheck) + "currentDIS"];
}
rockcheck++;
}
}
}
};
Symbol 134 MovieClip [Attack Dog 1] Frame 1
framerateDEFAULT = _parent.framerateDEFAULT;
framerateMAX = _parent.framerateMAX;
framerateMIN = _parent.framerateMIN;
DEGtoRAD = (Math.PI/180);
bubbleDEPTH = _parent.bubbleDEPTH;
digitMODE = _parent.digitMODE;
this.charALIVE = true;
this.rocksloaded = 0;
_parent.rocksthrown = 0;
this.rocksloadedMAX = 3;
this.rocksMAX = _parent.rocksMAX;
dHEIGHT = 0.5;
uHEIGHT = 0.5;
rWIDTH = 0.5;
rHEIGHT = 0;
urWIDTH = 0.3;
urHEIGHT = 0.25;
lWIDTH = 0.5;
lHEIGHT = 0;
ulWIDTH = 0.3;
ulHEIGHT = 0.25;
offsetX = 0;
offsetY = 0;
charACTION = true;
initWIDTH = sensor._width;
initHEIGHT = sensor._height;
initHYP = Math.sqrt(Math.pow(initWIDTH, 2) + Math.pow(initHEIGHT, 2));
initANGLE1 = Math.asin(initHEIGHT / initHYP);
initANGLE2 = Math.asin(initWIDTH / initHYP);
slopesensorRATIO = 3;
floorpushes = 100;
speedXMAX = _parent.speedXMAX;
speedYMAX = _parent.speedYMAX;
speedMAXdivisor = _parent.speedMAXdivisor;
speedXMIN = _parent.speedXMIN;
speedYMIN = _parent.speedYMIN;
slidespeedMIN = _parent.slidespeedMIN;
jumpTHRESHOLD = _parent.jumpTHRESHOLD;
airjumpsMAX = 0;
duckjumpRATIO = 2;
throwTIME = 2.5;
throwANGLEup = 0;
throwANGLEforward = 45;
throwANGLEdown = 135;
nosedivebounceTIME = 0.25;
swimcollideMAX = 7;
duckpaddleFALLSPEED = _parent.duckpaddleFALLSPEED;
duckpaddleRATIO = _parent.duckpaddleRATIO;
faceX = 1;
faceY = 1;
if (initfaceXDIR != undefined) {
faceXDIR = initfaceXDIR;
} else {
faceXDIR = (this._x - _root.World.Player1._x) / Math.abs(this._x - _root.World.Player1._x);
}
if (initfaceYDIR != undefined) {
faceYDIR = initfaceYDIR;
} else {
faceYDIR = 1;
}
digitARCLENGTH = _parent.digitARCLENGTH;
engineloops = _parent.engineloops;
speedmultiUNIVERSAL = _parent.speedmultiUNIVERSAL;
speedmultiX = speedmultiUNIVERSAL;
speedmultiY = speedmultiUNIVERSAL;
speedmultiROT = speedmultiUNIVERSAL;
movedragX = 1.075;
movedragY = 1.075;
slidedragX = _parent.slidedragX;
slidedragY = _parent.slidedragY;
waterdragX = _parent.waterdragX;
waterdragY = _parent.waterdragY;
swimdragX = _parent.swimdragX;
swimdragY = _parent.swimdragY;
watergroundfriction = _parent.watergroundfriction;
throwdrag = _parent.throwdrag;
swimspindrag = _parent.swimspindrag;
airspindrag = _parent.airspindrag;
windrateX = _parent.windrateX;
windrateY = _parent.windrateY;
watercurrentrateX = _parent.watercurrentrateX;
watercurrentrateY = _parent.watercurrentrateY;
gravityrateX = _parent.gravityrateX;
gravityrateY = _parent.gravityrateY;
gspeedX = 0 * speedmultiX;
gspeedY = 0 * speedmultiY;
windX = 0 * speedmultiX;
windY = 0 * speedmultiY;
windspeedX = 0 * speedmultiX;
windspeedY = 0 * speedmultiY;
environment = "falling";
environmentchecker = "air";
moverate = 0.3 * speedmultiUNIVERSAL;
sliderate = 0.75 * speedmultiUNIVERSAL;
sliderampBOOST = 0.8 * speedmultiUNIVERSAL;
sliderampTHRESHOLD = 13;
swimspeedMAXTRANSFER = 15 * speedmultiUNIVERSAL;
jumprateX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
jumprateY = (25 * gravityrateY) / Math.sqrt(speedmultiY);
walljumpTIME = 20;
nosedivejumprateX = jumprateX * 1.4;
nosedivejumprateY = jumprateY * 1.4;
springrateX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
springrateY = (50 * gravityrateY) / Math.sqrt(speedmultiY);
nosediveBOUNCEXrate = 0.5;
nosediveBOUNCEYrate = (24 * gravityrateY) / Math.sqrt(speedmultiY);
nosediveBOUNCEspinrate = 17 * speedmultiROT;
swimrateX = (2 * gravityrateY) / Math.sqrt(speedmultiY);
swimrateY = (2 * gravityrateY) / Math.sqrt(speedmultiY);
throwrate = (40 * gravityrateY) / Math.sqrt(speedmultiY);
swimspinrate = 0.5 * speedmultiROT;
airspinrate = 0.75 * speedmultiROT;
watergroundboostX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
watergroundboostY = (0 * gravityrateY) / Math.sqrt(speedmultiY);
moveX = 0 * speedmultiX;
moveY = 0 * speedmultiY;
movespeedX = 0 * speedmultiX;
movespeedY = 0 * speedmultiY;
jumpX = 0 * speedmultiX;
jumpY = 0 * speedmultiY;
walljumpTIMER = 0;
airjumpCOUNT = 0;
jumpspeedX = 0 * speedmultiX;
jumpspeedY = 0 * speedmultiY;
swimX = 0 * speedmultiX;
swimY = 0 * speedmultiY;
swimX2 = 0 * speedmultiX;
swimY2 = 0 * speedmultiY;
swimI = 0 * speedmultiUNIVERSAL;
swimspeedX = 0 * speedmultiX;
swimspeedY = 0 * speedmultiY;
speedX = 0 * speedmultiX;
speedY = 0 * speedmultiY;
swimspin = 0 * speedmultiROT;
swimspinspeed = 0 * speedmultiROT;
airspin = 0 * speedmultiROT;
airspinspeed = 0 * speedmultiROT;
charX = this._x;
charY = this._y;
charROT = this._rotation;
charsensorX = this.sensor._x;
charsensorY = this.sensor._y;
charsensorWIDTH = this.sensor._width;
charsensorHEIGHT = this.sensor._height;
worldX = _parent._x;
worldY = _parent._y;
worldROT = _parent._rotation;
worldXSCALE = _parent._xscale;
worldYSCALE = _parent._yscale;
this.attackRANGE = 400;
this.jumpRANGE = 200;
this.hitDISTANCE = 50;
this.vulnerableDISTANCE = _width;
this.birth = getTimer() / 1000;
onEnterFrame = function () {
this.age = getTimer() / 1000;
if ((((this.pasted == true) && (Math.abs(_x - _parent.camera._x) > (((_parent.camera._width / 2) + _width) + _root.World.badguyDISTANCEMAX))) && ((this.age - this.birth) > 2)) || (((this.pasted == true) && (Math.abs(_y - _parent.camera._y) > (((_parent.camera._height / 2) + this._height) + _root.World.badguyDISTANCEMAX))) && ((this.age - this.birth) > 2))) {
_root.soundManager_mc.stopSound("dogBark", 0, 999999999);
_root.soundManager_mc.stopSound("dogGrowl", 0, 999999999);
this.removeMovieClip();
}
this.Player1X = _parent.Player1._x;
this.Player1Y = _parent.Player1._y;
this.PlayerHEIGHT = _parent.Player1._height;
this.Player1WIDTH = _parent.Player1._width;
this.Player1DISTANCE = Math.pow(Math.pow(this.Player1X - this._x, 2) + Math.pow(this.Player1Y - this._y, 2), 0.5);
if ((((_parent.Player1.rocksloaded > 0) && (this.Player1DISTANCE < this.hitDISTANCE)) && (_root.World.charBLINK == false)) && (this.charALIVE == true)) {
this.throwANGLEdamaged = random(90) - 45;
this.throwratedamaged = 8;
_parent.Player1.rocksthrown = _parent.Player1.rocksthrown + 1;
_parent.attachMovie("Rock 1", "rock" + _parent.Player1.rocksthrown, 100 + _parent.Player1.rocksthrown, {_x:_parent.charsensorX + _parent.charX, _y:(_parent.charsensorY + _parent.charY) - ((_parent.charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEdamaged * DEGtoRAD) * throwratedamaged) * _parent.faceX) + _parent.speedX, throwspeedY:(Math.cos(throwANGLEdamaged * DEGtoRAD) * throwratedamaged) - _parent.speedY, weapon:false});
_parent.oldrock = _parent.Player1.rocksthrown - _parent.rocksMAX;
_parent["rock" + _parent.oldrock].removeMovieClip();
_parent.Player1.rocksloaded = _parent.Player1.rocksloaded - 1;
_root.World.charBLINK = true;
} else if (((this.Player1DISTANCE < this.hitDISTANCE) && (_root.World.charBLINK == false)) && (this.charALIVE == true)) {
_root.World.charALIVE = false;
}
if (this.charALIVE == true) {
if ((this.Player1X < this._x) && (this.Player1DISTANCE < this.attackRANGE)) {
triggerLEFT = true;
} else {
triggerLEFT = false;
}
if ((this.Player1X > this._x) && (this.Player1DISTANCE < this.attackRANGE)) {
triggerRIGHT = true;
} else {
triggerRIGHT = false;
}
if (((environment == "swimmingupward") || (environment == "swimmingdownward")) || (((environment == "duckpaddle") && ((this.Player1Y + (this.PlayerHEIGHT / 2)) < (this._y + (this._height / 2)))) && (this.Player1DISTANCE < 200))) {
triggerUP = true;
} else {
triggerUP = false;
}
if (((((((((this.Player1Y + (this.PlayerHEIGHT / 2)) < (this._y + (this._height / 2))) && (this.Player1DISTANCE < this.jumpRANGE)) && ((slopeANGLE / Math.abs(slopeANGLE)) != ((this.Player1X - this._x) / Math.abs(this.Player1X - this._x)))) && (TOUCHwater == false)) && (jumparmed == true)) || ((environment == "swimmingupward") && (swimarmed == true))) || ((environment == "swimmingdownward") && (swimarmed == true))) || (((environment == "duckpaddle") && (this.Player1DISTANCE < this.attackRANGE)) && (swimarmed == true))) {
triggerJUMP = true;
} else {
triggerJUMP = false;
}
engineloops = _parent.engineloops;
} else {
triggerLEFT = false;
triggerRIGHT = false;
triggerUP = false;
triggerDOWN = false;
triggerJUMP = false;
engineloops = 0;
}
worldXinit = _parent._x;
worldYinit = _parent._y;
worldROTinit = _parent._rotation;
worldXSCALEinit = _parent._xscale;
worldYSCALEinit = _parent._yscale;
frameloops = 1;
while (frameloops <= _parent.engineloops) {
if (environmentchecker != "bellyslide") {
charWIDTH = Math.abs(Math.cos(initANGLE1 - ((Math.abs(charROT) + 180) * DEGtoRAD)) * initHYP);
charHEIGHT = Math.abs(Math.cos(initANGLE2 - ((Math.abs(charROT) + 180) * DEGtoRAD)) * initHYP);
} else {
charWIDTH = initWIDTH;
charHEIGHT = initWIDTH;
}
slopesensorDISTANCE = charWIDTH / slopesensorRATIO;
if (this.charALIVE == true) {
rockcheck = _parent.Player1.rocksthrown - _root.World.rocksMAX;
while (rockcheck <= _parent.Player1.rocksthrown) {
if (((_parent["rock" + rockcheck].weapon == true) && (_parent["rock" + rockcheck] != undefined)) && (_parent["rock" + rockcheck].totalspeed > 5)) {
this[("rock" + rockcheck) + "currentXDIS"] = _parent["rock" + rockcheck]._x - this._x;
this[("rock" + rockcheck) + "currentYDIS"] = _parent["rock" + rockcheck]._y - this._y;
this[("rock" + rockcheck) + "currentDIS"] = Math.pow(Math.pow((this[("rock" + rockcheck) + "currentXDIS"] + this[("rock" + rockcheck) + "oldXDIS"]) / 2, 2) + Math.pow((this[("rock" + rockcheck) + "currentYDIS"] + this[("rock" + rockcheck) + "oldYDIS"]) / 2, 2), 0.5);
this[("rock" + rockcheck) + "avgDIS"] = Math.pow(Math.pow(this[("rock" + rockcheck) + "currentXDIS"], 2) + Math.pow(this[("rock" + rockcheck) + "currentYDIS"], 2), 0.5);
if (((this[("rock" + rockcheck) + "currentDIS"] < vulnerableDISTANCE) && (_root.basketball == false)) || ((this[("rock" + rockcheck) + "avgDIS"] < vulnerableDISTANCE) && (_root.basketball == false))) {
this.charALIVE = false;
_parent.attachMovie("puffexplosion", "puffexplosion" + rockcheck, _root.attachDEPTH, {_x:_parent["rock" + rockcheck]._x, _y:_parent["rock" + rockcheck]._y, _xscale:50, _yscale:50});
_root.attachDEPTH = _root.attachDEPTH + 1;
_parent["rock" + rockcheck].removeMovieClip();
_root.soundManager_mc.playSound("B12sFire_Shot.wav", 0, 1);
}
this[("rock" + rockcheck) + "oldXDIS"] = this[("rock" + rockcheck) + "currentXDIS"];
this[("rock" + rockcheck) + "oldYDIS"] = this[("rock" + rockcheck) + "currentYDIS"];
this[("rock" + rockcheck) + "oldDIS"] = this[("rock" + rockcheck) + "currentDIS"];
}
rockcheck++;
}
}
if (((speedY >= 0) && (_parent.SoftBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true))) || ((speedY >= 0) && (_parent.HardBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)))) {
TOUCHground = true;
if (((speedY >= 0) && (_parent.SoftBoundary.DigitBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true))) || ((speedY >= 0) && (_parent.HardBoundary.DigitBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)))) {
TOUCHdigit = true;
} else {
TOUCHdigit = false;
}
} else {
TOUCHground = false;
TOUCHdigit = false;
}
if (_parent.HardBoundary.hitTest((((((charsensorX + charX) + offsetX) + (charWIDTH * 0.5)) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.25)) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHwallright = true;
} else {
TOUCHwallright = false;
}
if (_parent.HardBoundary.hitTest((((((charsensorX + charX) + offsetX) - (charWIDTH * 0.5)) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.25)) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHwallleft = true;
} else {
TOUCHwallleft = false;
}
if (_parent.HardBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) - (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHceiling = true;
} else {
TOUCHceiling = false;
}
if (_parent.Water.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, ((((charsensorY + charY) + offsetY) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHwater = true;
} else {
TOUCHwater = false;
}
if (_parent.Spring.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true) && (speedY >= 0)) {
TOUCHspring = true;
} else {
TOUCHspring = false;
}
if ((((environmentchecker == "air") && (TOUCHwater == true)) && (Math.abs(speedY) < duckpaddleFALLSPEED)) || (environment == "duckpaddle")) {
environment = "duckpaddle";
} else if (((((TOUCHwater == true) && (TOUCHground == true)) || ((TOUCHwater == true) && (TOUCHceiling == true))) || ((TOUCHwater == true) && (TOUCHwallleft == true))) || ((TOUCHwater == true) && (TOUCHwallright == true))) {
environment = "watergrounded";
} else if ((TOUCHwater == true) && (speedY < 0)) {
environment = "swimmingupward";
} else if (((TOUCHwater == true) && (TOUCHground == false)) && (speedY >= 0)) {
environment = "swimmingdownward";
} else if ((TOUCHspring == true) && (speedY >= 0)) {
environment = "sprung";
} else if ((TOUCHground == true) && (speedY >= 0)) {
environment = "grounded";
} else if (speedY < 0) {
environment = "flying";
} else if ((TOUCHground == false) && (speedY >= 0)) {
environment = "falling";
}
if (((this.rocksloaded > 0) && (throwarmed == true)) && (triggerTHROW == true)) {
_parent.rocksthrown = _parent.rocksthrown + 1;
if (triggerUP == true) {
_parent.attachMovie("Rock 1", "rock" + _parent.rocksthrown, 100 + _parent.rocksthrown, {_x:charsensorX + charX, _y:(charsensorY + charY) - ((charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEup * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEup * DEGtoRAD) * throwrate) - speedY});
} else if (triggerDOWN == true) {
_parent.attachMovie("Rock 1", "rock" + _parent.rocksthrown, 100 + _parent.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * faceX), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEdown * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEdown * DEGtoRAD) * throwrate) - speedY});
} else {
_parent.attachMovie("Rock 1", "rock" + _parent.rocksthrown, 100 + _parent.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * faceX), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEforward * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEforward * DEGtoRAD) * throwrate) - speedY});
}
oldrock = _parent.rocksthrown - rocksMAX;
_parent["rock" + oldrock].removeMovieClip();
this.rocksloaded = this.rocksloaded - 1;
throwarmed = false;
} else if ((!triggerTHROW) == true) {
throwarmed = true;
} else {
throwarmed = false;
}
if (environment == "grounded") {
if ((environmentchecker != "bellyslide") && (environmentchecker != "nosedivebounce")) {
movementhyp = moverate / Math.pow(Math.pow(dr - dl, 2) + Math.pow(slopesensorDISTANCE, 2), 0.5);
if ((triggerRIGHT == true) && (TOUCHwallright == false)) {
moveX = movementhyp * slopesensorDISTANCE;
moveY = movementhyp * (-Math.abs(dr - dl));
faceX = 1;
} else if ((triggerLEFT == true) && (TOUCHwallleft == false)) {
moveX = movementhyp * (-slopesensorDISTANCE);
moveY = movementhyp * (-Math.abs(dr - dl));
faceX = -1;
} else {
moveX = 0;
moveY = 0;
}
}
if ((triggerJUMP == true) && (jumparmed == true)) {
jumpX = 0;
jumpY = jumprateY;
gspeedX = 0;
gspeedY = 0;
moveY = 0;
movespeedY = 0;
jumparmed = false;
} else {
jumpX = 0;
jumpY = 0;
if ((!triggerJUMP) == true) {
jumparmed = true;
}
}
} else if ((environment == "wallslide") || (environmentchecker == "wallsliding")) {
if ((triggerJUMP == true) && (jumparmed == true)) {
jumpX = 0;
jumpY = jumprateY;
gspeedX = 0;
gspeedY = 0;
if (triggerRIGHT == true) {
moveX = -moverate;
} else if (triggerLEFT == true) {
moveX = moverate;
}
moveY = 0;
movespeedY = 0;
jumparmed = false;
walljumpTIMER = walljumpTIME;
} else {
jumpX = 0;
jumpY = 0;
if ((!triggerJUMP) == true) {
jumparmed = true;
}
}
} else if ((environment == "flying") || (environment == "falling")) {
if (walljumpTIMER <= 0) {
if (environmentchecker != "bellyslide") {
if ((triggerRIGHT == true) && (TOUCHwallright == false)) {
moveX = moverate;
faceX = 1;
} else if ((triggerLEFT == true) && (TOUCHwallleft == false)) {
moveX = -moverate;
faceX = -1;
} else {
moveX = 0;
}
} else {
moveX = 0;
}
walljumpTIMER = 0;
} else {
walljumpTIMER = walljumpTIMER - 1;
}
if (((triggerJUMP == true) && (jumparmed == true)) && (airjumpCOUNT > 0)) {
jumpspeedX = 0;
jumpspeedY = jumprateY;
gspeedX = 0;
gspeedY = 0;
moveY = 0;
movespeedY = 0;
jumparmed = false;
airjumpCOUNT = airjumpCOUNT - 1;
} else {
jumpX = 0;
jumpY = 0;
if ((!triggerJUMP) == true) {
jumparmed = true;
}
}
if (((((Key.isDown(_root.kJUMP) && (gspeedY <= jumpTHRESHOLD)) && ((dr + dl) == -2)) && (jumpspeedX == 0)) && (jumpspeedY == 0)) && (environment == "falling")) {
airjumpCOUNT = airjumpsMAX;
}
} else if ((((environment == "duckpaddle") || (environment == "swimmingupward")) || (environment == "swimmingdownward")) || (environment == "watergrounded")) {
if (((triggerRIGHT == true) && (triggerUP == true)) && (environment != "duckpaddle")) {
if ((charROT > -135) && (charROT <= 45)) {
if ((45 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-135 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((45 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-135 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((triggerRIGHT == true) && (triggerDOWN == true)) {
if ((charROT > -45) && (charROT <= 135)) {
if ((135 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-45 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((135 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-45 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if (((triggerLEFT == true) && (triggerUP == true)) && (environment != "duckpaddle")) {
if ((charROT >= -45) && (charROT < 135)) {
if ((-45 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (135 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((-45 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (135 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((triggerLEFT == true) && (triggerDOWN == true)) {
if ((charROT >= -135) && (charROT < 45)) {
if ((-135 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (45 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((-135 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (45 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (triggerRIGHT == true) {
if (environment == "duckpaddle") {
faceX = 1;
} else if ((charROT >= -90) && (charROT < 90)) {
if ((90 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-90 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((90 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-90 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if (triggerLEFT == true) {
if (environment == "duckpaddle") {
faceX = -1;
} else if ((charROT > -90) && (charROT <= 90)) {
if ((90 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (-90 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((90 > (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (-90 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((triggerUP == true) && (environment != "duckpaddle")) {
if (faceX > 0) {
if ((0 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-180 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 0;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((0 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (180 > (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 0;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (triggerDOWN == true) {
if (environment == "duckpaddle") {
swimX2 = swimX2 / duckpaddleRATIO;
swimY2 = swimY2 / duckpaddleRATIO;
environment = "swimmingdownward";
}
if (faceX < 0) {
if ((0 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (-180 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 180;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((0 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (180 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 180;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else {
swimspin = 0;
}
if ((swimspeedX > 0) && (environment != "duckpaddle")) {
faceX = 1;
} else if ((swimspeedX < 0) && (environment != "duckpaddle")) {
faceX = -1;
}
if ((triggerJUMP == true) && (swimarmed == true)) {
if (((triggerUP == true) && (environment == "duckpaddle")) && (duckjumparmed == true)) {
while (Water.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((charY + offsetY) * worldYSCALEinit) / 100) + worldYinit, true)) {
charY = charY - 1;
}
jumpX = jumprateX;
jumpY = jumprateY;
environment = "duckjump";
environmentchecker = "duckjump";
duckjumparmed = false;
swimarmed = false;
} else if ((((environment == "duckpaddle") && (speedX == 0)) || (((environment == "duckpaddle") && (speedX > 0)) && (TOUCHwallright == false))) || (((environment == "duckpaddle") && (speedX < 0)) && (TOUCHwallleft == false))) {
if (((speedY == 0) || ((speedY > 0) && (TOUCHground == false))) || ((speedY < 0) && (TOUCHceiling == false))) {
swimX = swimrateX / duckpaddleRATIO;
swimY = swimrateY / duckpaddleRATIO;
swimarmed = false;
}
} else if (((speedX == 0) || ((speedX > 0) && (TOUCHwallright == false))) || ((speedX < 0) && (TOUCHwallleft == false))) {
if (((speedY == 0) || ((speedY > 0) && (TOUCHground == false))) || ((speedY < 0) && (TOUCHceiling == false))) {
swimX = swimrateX;
swimY = swimrateY;
swimarmed = false;
}
}
} else {
swimX = 0;
swimY = 0;
}
if ((!triggerJUMP) == true) {
swimarmed = true;
duckjumparmed = true;
}
}
if (environment == "duckpaddle") {
charROT = 90 * faceX;
if (airspinspeed != 0) {
swimspinspeed = swimspinspeed + airspinspeed;
airspinspeed = 0;
}
airspin = 0;
if ((charROT > 100) || (charROT < -100)) {
if ((environmentchecker != "water") && (environmentchecker != "duckpaddle")) {
swimI = swimI + (Math.abs(movespeedX) / 3);
}
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
gspeedX = 0;
gspeedY = 0;
gravityX = 0;
gravityY = 0;
windX = watercurrentrateX;
windY = 0;
if ((environmentchecker != "water") && (environmentchecker != "duckpaddle")) {
swimY = 0;
swimY2 = 0;
}
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
environmentchecker = "duckpaddle";
} else if ((environment == "swimmingupward") || (environment == "swimmingdownward")) {
if (airspinspeed != 0) {
swimspinspeed = swimspinspeed + airspinspeed;
airspinspeed = 0;
}
airspin = 0;
if ((charROT > 100) || (charROT < -100)) {
if (environmentchecker != "water") {
swimI = swimI + ((Math.abs(movespeedX) / 3) + (gspeedY / 3));
gspeedY = 0;
}
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = gravityrateX;
gravityY = gravityrateY;
windX = watercurrentrateX;
windY = watercurrentrateY;
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
swimY2 = swimY2 / swimdragY;
swimI = swimI / swimdragY;
gspeedX = gspeedX / waterdragX;
gspeedY = gspeedY / waterdragY;
environmentchecker = "water";
} else if (environment == "watergrounded") {
if (((Math.abs(swimX2) >= swimcollideMAX) || (Math.abs(swimY2) >= swimcollideMAX)) || (Math.abs(swimI) >= swimcollideMAX)) {
swimX2 = Math.min(swimX2, swimcollideMAX);
swimY2 = Math.min(swimY2, swimcollideMAX);
swimI = Math.min(swimI, swimcollideMAX);
} else if (((Math.abs(swimX2) >= 0.25) || (Math.abs(swimY2) >= 0.25)) || (Math.abs(swimI) >= 0.25)) {
swimX2 = swimX2 / watergroundfriction;
swimY2 = swimY2 / watergroundfriction;
swimI = swimI / watergroundfriction;
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
windX = 0;
windY = 0;
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
swimY2 = swimY2 / swimdragY;
movespeedX = movespeedX / waterdragX;
movespeedY = movespeedY / waterdragY;
environmentchecker = "waterground";
} else if ((environment == "flying") || (environment == "falling")) {
charROT = 0;
if ((dr == -1) && (dl == -1)) {
moveY = 0;
movespeedY = 0;
}
if (swimspinspeed != 0) {
airspinspeed = airspinspeed + swimspinspeed;
swimspinspeed = 0;
}
swimspin = 0;
if (((swimX2 != 0) || (swimY2 != 0)) || (swimI != 0)) {
if (environmentchecker == "duckjump") {
swimX2 = swimX2 / duckjumpRATIO;
swimI = swimI / duckjumpRATIO;
}
jumpspeedX = jumpspeedX + (Math.sin(charROT * DEGtoRAD) * swimX2);
if (environmentchecker != "duckjump") {
jumpspeedY = jumpspeedY + Math.min(Math.cos(charROT * DEGtoRAD) * (swimX2 + swimI), swimspeedMAXTRANSFER);
}
}
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
gravityX = gravityrateX;
gravityY = gravityrateY;
windX = windrateX;
windY = windrateY;
if (environment == "flying") {
jumpX = 0;
jumpY = 0;
}
airspinspeed = airspinspeed / airspindrag;
if (environmentchecker != "bellyslide") {
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
} else {
movespeedX = movespeedX / slidedragX;
movespeedY = movespeedY / slidedragY;
}
if (environmentchecker == "nosedivebounce") {
airspin = 0;
if (Math.abs(charROT) < 5) {
charROT = 0;
environmentchecker = ((gspeedY > (jumpspeedY * 2)) ? "air" : "nosedivebounce");
}
}
if (((((environmentchecker == "water") && (triggerRIGHT == true)) && ((!triggerUP) == true)) && ((!triggerDOWN) == true)) || ((((environmentchecker == "water") && (triggerLEFT == true)) && ((!triggerUP) == true)) && ((!triggerDOWN) == true))) {
environmentchecker = "porpoising";
} else if (((environmentchecker != "porpoising") && (environmentchecker != "bellyslide")) && (environmentchecker != "nosedivebounce")) {
environmentchecker = "air";
}
} else if (environment == "wallslide") {
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 1;
swimspin = 0;
swimspinspeed = 0;
airspin = 0;
airspinspeed = 0;
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
environmentchecker = "wallsliding";
} else if (environment == "grounded") {
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
swimspin = 0;
swimspinspeed = 0;
airspin = 0;
airspinspeed = 0;
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
if (environmentchecker != "bellyslide") {
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
bellyslideTIME = 0;
} else {
if ((dr - dl) != 0) {
moveX = (((sliderate * slopesensorDISTANCE) / Math.sqrt(Math.pow(dl - dr, 2) + Math.pow(slopesensorDISTANCE, 2))) * (dl - dr)) / Math.abs(dl - dr);
moveY = (sliderate * (-Math.abs(dr - dl))) / Math.sqrt(Math.pow(dr - dl, 2) + Math.pow(slopesensorDISTANCE, 2));
} else {
moveX = 0;
moveY = 0;
}
movespeedX = movespeedX / slidedragX;
movespeedY = movespeedY / slidedragY;
}
if (((((charROT < 89) && (charROT > -89)) && (environmentchecker != "bellyslide")) || ((((environmentchecker == "bellyslide") && (Math.abs(movespeedX) <= slidespeedMIN)) && (Math.abs(dr - dl) <= 0)) && (bellyslideTIME > 100))) || (((environmentchecker == "bellyslide") && (charROT < 30)) && (charROT > -30))) {
charY = charY - ((initHEIGHT - charHEIGHT) / 2);
charROT = 0;
environmentchecker = "ground";
} else if (((charROT < 165) && (charROT > -165)) || (((environmentchecker == "bellyslide") && (charROT < 30)) && (charROT > -30))) {
charY = charY - ((initWIDTH - charHEIGHT) / 2);
charWIDTH = initWIDTH;
charHEIGHT = initWIDTH;
if (environmentchecker != "bellyslide") {
charROT = ((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD);
} else if (charROT != (((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD))) {
slopeDIFFERENCE = (((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD)) - charROT;
charROT = charROT + (slopeDIFFERENCE / 2);
}
bellyslideTIME = bellyslideTIME + 1;
environmentchecker = "bellyslide";
if ((((jumpspeedY == 0) && ((oldslopeANGLE * slopeANGLE) <= 0)) && (oldslopeANGLE != 0)) || (((jumpspeedY == 0) && ((oldslopeANGLE * slopeANGLE) <= 0)) && (slopeANGLE != 0))) {
if (((oldslopeANGLE > 0) && (speedX > 0)) || ((oldslopeANGLE < 0) && (speedX < 0))) {
moveY = 0;
movespeedY = 0;
gspeedY = 0;
rampjumpY = (sliderampBOOST * Math.abs(speedX)) * Math.cos(oldslopeANGLE * DEGtoRAD);
jumpY = ((rampjumpY > 0) ? rampjumpY : 0);
} else {
moveY = 0;
movespeedY = 0;
}
}
} else {
charY = charY - ((initHEIGHT - charHEIGHT) / 2);
charROT = 180;
if (environmentchecker != "nosedivebounce") {
nosedivebounceSTART = getTimer() / 1000;
environmentchecker = "nosedivebounce";
}
if ((triggerJUMP == true) && (jumparmed == true)) {
airspin = airspin + (nosediveBOUNCEspinrate * faceX);
jumpX = nosedivejumprateX * faceX;
jumpY = nosedivejumprateY;
environmentchecker = "nosedivebounce";
moveY = 0;
movespeedY = 0;
jumparmed = false;
} else {
jumpX = 0;
jumpY = 0;
if ((!triggerJUMP) == true) {
jumparmed = true;
}
}
nosedivebounceTIMER = (getTimer() / 1000) - nosedivebounceSTART;
if (nosedivebounceTIMER >= nosedivebounceTIME) {
airspin = airspin + (nosediveBOUNCEspinrate * faceX);
jumpX = nosediveBOUNCEXrate * faceX;
jumpY = nosediveBOUNCEYrate;
}
}
} else if (environment == "sprung") {
swimX2 = 0;
swimY2 = 0;
swimI = 0;
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
if (TOUCHwater == false) {
jumpX = springrateX;
jumpY = springrateY;
swimX = 0;
swimY = 0;
} else {
swimX = springrateX;
swimY = springrateY;
jumpX = 0;
jumpY = 0;
}
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
environmentchecker = "sprung";
}
movespeedX = movespeedX + moveX;
jumpspeedX = jumpspeedX + jumpX;
swimX2 = swimX2 + swimX;
if ((charROT == 180) || (charROT == -180)) {
swimspeedX = 0;
} else {
swimspeedX = Math.sin(charROT * DEGtoRAD) * (swimX2 + swimI);
}
gspeedX = gspeedX + gravityX;
windspeedX = windX;
movespeedY = movespeedY + moveY;
jumpspeedY = jumpspeedY + jumpY;
swimY2 = swimY2 + swimY;
swimspeedY = Math.cos(charROT * DEGtoRAD) * (swimY2 + swimI);
gspeedY = gspeedY + gravityY;
windspeedY = windY;
if (Math.abs(movespeedX) < 0.1) {
movespeedX = 0;
}
if (Math.abs(movespeedY) < 0.1) {
movespeedY = 0;
}
speedX = (((movespeedX + jumpspeedX) + swimspeedX) - gspeedX) + windspeedX;
speedY = ((((-movespeedY) - jumpspeedY) - swimspeedY) + gspeedY) - windspeedY;
if (speedX > speedXMAX) {
speedX = speedX - (speedX - speedXMAX);
} else if (speedX < (-speedXMAX)) {
speedX = speedX + (speedXMAX - speedX);
}
if (speedY > speedYMAX) {
speedY = speedY - (speedY - speedYMAX);
} else if (speedY < (-speedYMAX)) {
speedY = speedY + (speedYMAX - speedY);
}
if (Math.abs(speedX) < speedMINX) {
speedX = 0;
}
if (Math.abs(speedY) < speedMINY) {
speedY = 0;
}
charX = charX + speedX;
charY = charY + speedY;
swimspinspeed = swimspinspeed + swimspin;
airspinspeed = airspinspeed + airspin;
speedROT = swimspinspeed + airspinspeed;
charROT = charROT + speedROT;
if (charROT > 180) {
charROT = charROT - 360;
} else if (charROT < -180) {
charROT = charROT + 360;
}
if (((speedX == 0) && (speedY == 0)) && (speedROT == 0)) {
charACTION = false;
} else {
charACTION = true;
}
if (charACTION == true) {
if (speedY > 0) {
d = 1;
while (d <= floorpushes) {
if (((!_parent.SoftBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true)) && (!_parent.HardBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true))) && (!_parent.Spring.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true))) {
charY = charY - (d - 1);
break;
}
d++;
}
} else if (speedY < 0) {
u = 1;
while (u <= floorpushes) {
if (!_parent.HardBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) - (charHEIGHT * uHEIGHT)) + u) * worldYSCALEinit) / 100) + worldYinit, true)) {
charY = charY + (u - 1);
break;
}
movespeedY = 0;
jumpspeedY = 0;
gspeedY = 0;
u++;
}
}
if (speedX > 0) {
r = 1;
while (r <= floorpushes) {
if (!_parent.HardBoundary.hitTest((((((charX + offsetX) + (charWIDTH * rWIDTH)) - r) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) + (charHEIGHT * rHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX - (r - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
r++;
}
if (environmentchecker != "bellysliding") {
ur = 1;
while (ur <= floorpushes) {
if (!_parent.HardBoundary.hitTest((((((charX + offsetX) + (charWIDTH * urWIDTH)) - ur) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) - (charHEIGHT * urHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX - (ur - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
ur++;
}
}
}
if (speedX < 0) {
l = 1;
while (l <= floorpushes) {
if (!_parent.HardBoundary.hitTest((((((charX + offsetX) - (charWIDTH * lWIDTH)) + l) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) + (charHEIGHT * lHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX + (l - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
l++;
}
if (environmentchecker != "bellysliding") {
ul = 1;
while (ul <= floorpushes) {
if (!_parent.HardBoundary.hitTest((((((charX + offsetX) - (charWIDTH * ulWIDTH)) + ul) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) - (charHEIGHT * ulHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX + (ul - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
ul++;
}
}
}
}
oldslopeANGLE = slopeANGLE;
if ((((charACTION == true) && (oldTOUCHdigit == false)) && (digitMODE == "constant")) || ((charACTION == true) && (digitMODE != "constant"))) {
dr = 0;
while (dr <= floorpushes) {
if ((!_parent.SoftBoundary.hitTest(((((charX + offsetX) + (slopesensorDISTANCE / 2)) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dr) * worldYSCALEinit) / 100) + worldYinit, true)) && (!_parent.HardBoundary.hitTest(((((charX + offsetX) + slopesensorDISTANCE) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dr) * worldYSCALEinit) / 100) + worldYinit, true))) {
dr = dr - 1;
break;
}
dr++;
}
dl = 0;
while (dl <= floorpushes) {
if ((!_parent.SoftBoundary.hitTest(((((charX + offsetX) - (slopesensorDISTANCE / 2)) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dl) * worldYSCALEinit) / 100) + worldYinit, true)) && (!_parent.HardBoundary.hitTest(((((charX + offsetX) - slopesensorDISTANCE) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dl) * worldYSCALEinit) / 100) + worldYinit, true))) {
dl = dl - 1;
break;
}
dl++;
}
slopeANGLE = Math.atan((dr - dl) / slopesensorDISTANCE) / DEGtoRAD;
if ((TOUCHdigit == true) && (digitMODE == "restricted")) {
slopeANGLE = Math.round(slopeANGLE / digitARCLENGTH) * digitARCLENGTH;
if (slopeANGLE > 0) {
dr = Math.abs((Math.tan(slopeANGLE * DEGtoRAD) * slopesensorDISTANCE) / 2);
dl = -dr;
} else {
dr = -Math.abs((Math.tan(slopeANGLE * DEGtoRAD) * slopesensorDISTANCE) / 2);
dl = -dr;
}
}
}
if (TOUCHdigit == true) {
oldTOUCHdigit = true;
} else {
oldTOUCHdigit = false;
}
totalspeed = Math.pow(Math.pow(speedX, 2) + Math.pow(speedY, 2), 0.5);
frameloops++;
}
worldX = _parent._x;
worldY = _parent._y;
worldROT = _parent._rotation;
worldXSCALE = _parent._xscale;
worldYSCALE = _parent._yscale;
this._x = charX;
this._y = charY;
this._rotation = charROT;
this.sensor._x = charsensorX;
this.sensor._y = charsensorY;
this.sensor._width = charsensorWIDTH;
this.sensor._height = charsensorHEIGHT;
if (faceX > 0) {
this._xscale = 100;
} else if (faceX < 0) {
this._xscale = -100;
}
};
Instance of Symbol 81 MovieClip "sensor" in Symbol 134 MovieClip [Attack Dog 1] Frame 1
onClipEvent (load) {
_visible = false;
_parent.stop();
bubbles = 0;
bubbletime = 2;
bubbleSCALEMIN = 100;
bubbleSCALEMAX = 400;
bubblesMAX = 50;
bubbleLOOPS = 5;
bubbleSPEEDSPAWN = 5 * bubbleLOOPS;
}
onClipEvent (enterFrame) {
if (_parent.charALIVE == false) {
_parent.gotoAndStop("Dead");
} else if (_parent.environment == "duckpaddle") {
if (Key.isDown(_root.kJUMP)) {
_parent.gotoAndStop("SurfaceSwimming-Flapping");
} else {
_parent.gotoAndStop("SurfaceSwimming");
}
} else if (((_parent.environment == "swimmingupward") || (_parent.environment == "swimmingdownward")) || (_parent.environment == "watergrounded")) {
if ((bubbletimeSTART + bubbletime) > (getTimer() / 1000)) {
bubbleloop = 1;
while (bubbleloop < bubbleLOOPS) {
if (random(Math.max(0, bubbleSPEEDSPAWN - (_parent.totalspeed * bubbleLOOPS))) == 0) {
bubbles = bubbles + 1;
bubbleSCALE = random(bubbleSCALEMAX - bubbleSCALEMIN) + bubbleSCALEMIN;
_parent.attachMovie("Bubble 1", "bubble" + bubbles, _parent.bubbledepth + bubbles, {_x:((((_x + (((_height / 2) * _parent.faceX) * Math.sin(_parent._rotation * _parent.DEGtoRAD))) + ((random(_width) - (_width / 2)) * Math.cos(_parent._rotation * _parent.DEGtoRAD))) * _parent._xscale) / 100) + _parent._x, _y:((((_y - ((_height / 2) * Math.cos(_parent._rotation * _parent.DEGtoRAD))) - ((random(_width) - (_width / 2)) * Math.sin(_parent._rotation * _parent.DEGtoRAD))) * _parent._yscale) / 100) + _parent._y, _xscale:bubbleSCALE, _yscale:bubbleSCALE, bubbleSCALE:bubbleSCALE});
}
bubbleloop++;
}
}
if (Key.isDown(_root.kJUMP)) {
_parent.gotoAndStop("Swimming-Flapping");
} else if ((Math.abs(_parent.swimspeedX) > _parent.gspeedY) || (Math.abs(_parent.swimspeedY) > _parent.gspeedY)) {
_parent.gotoAndStop("Swimming");
} else {
_parent.gotoAndStop("Sinking");
}
} else if ((_parent.jumpspeedY >= _parent.gspeedY) && (_parent.jumpspeedY > 0)) {
if (_parent.airjumpCOUNT == _parent.airjumpsMAX) {
_parent.gotoAndStop("Flying");
} else {
_parent.gotoAndStop("DoubleJumping");
}
} else if (((_parent.jumpspeedY < _parent.gspeedY) && (_parent.jumpspeedY > 0)) || ((_parent.jumpspeedY == 0) && (_parent.gspeedY > _parent.jumpTHRESHOLD))) {
_parent.gotoAndStop("Falling");
} else if (_parent.environment == "wallslide") {
_parent.gotoAndStop("Wallsliding");
} else if (((_parent.environmentchecker == "bellyslide") && (_parent.bellyslideTIME < 99)) || (((_parent.environmentchecker == "bellyslide") && (_parent.bellyslideTIME >= 99)) && (Math.abs(_parent.movespeedX) > _parent.slidespeedMIN))) {
_parent.gotoAndStop("BellySliding");
} else if (((_parent.environment == "grounded") && (_parent.charROT >= 165)) || ((_parent.environment == "grounded") && (_parent.charROT <= -165))) {
_parent.gotoAndStop("Nosedivebounce");
} else if (_parent.moveX != 0) {
_parent.gotoAndStop("Walking");
} else {
_parent.gotoAndStop("Standing");
}
if (((_parent.environment != "swimmingupward") && (_parent.environment != "swimmingdownward")) && (_parent.environment != "watergrounded")) {
bubbletimeSTART = getTimer() / 1000;
}
}
Symbol 134 MovieClip [Attack Dog 1] Frame 2
_root.soundManager_mc.stopSound("dogBark", 0, 999999999);
barking = false;
if (growling != true) {
_root.soundManager_mc.playSound("dogGrowl", 0, 999999999);
growling = true;
}
Symbol 134 MovieClip [Attack Dog 1] Frame 3
_root.soundManager_mc.stopSound("dogGrowl", 0, 999999999);
growling = false;
if (barking != true) {
_root.soundManager_mc.playSound("dogBark", 0, 999999999);
barking = true;
}
Symbol 134 MovieClip [Attack Dog 1] Frame 4
_root.soundManager_mc.stopSound("dogGrowl", 0, 999999999);
growling = false;
if (barking != true) {
_root.soundManager_mc.playSound("dogBark", 0, 999999999);
barking = true;
}
Symbol 134 MovieClip [Attack Dog 1] Frame 15
if ((_root.stattracking == true) && (this.deathtracked != true)) {
StatTracker.submitStat("/flashgames/breakfastclub/dogkilled");
this.deathtracked = true;
}
_root.soundManager_mc.stopSound("dogBark", 0, 999999999);
barking = false;
_root.soundManager_mc.stopSound("dogGrowl", 0, 999999999);
growling = false;
stop();
Symbol 146 MovieClip Frame 14
stop();
Symbol 147 MovieClip [Goomba 1] Frame 1
framerateDEFAULT = _parent.framerateDEFAULT;
framerateMAX = _parent.framerateMAX;
framerateMIN = _parent.framerateMIN;
DEGtoRAD = (Math.PI/180);
bubbleDEPTH = _parent.bubbleDEPTH;
digitMODE = _parent.digitMODE;
this.charALIVE = true;
this.rocksloaded = 0;
_parent.rocksthrown = 0;
this.rocksloadedMAX = 3;
this.rocksMAX = _parent.rocksMAX;
dHEIGHT = 0.5;
uHEIGHT = 0.5;
rWIDTH = 0.5;
rHEIGHT = 0;
urWIDTH = 0.3;
urHEIGHT = 0.25;
lWIDTH = 0.5;
lHEIGHT = 0;
ulWIDTH = 0.3;
ulHEIGHT = 0.25;
offsetX = 0;
offsetY = 0;
charACTION = true;
initWIDTH = sensor._width;
initHEIGHT = sensor._height;
initHYP = Math.sqrt(Math.pow(initWIDTH, 2) + Math.pow(initHEIGHT, 2));
initANGLE1 = Math.asin(initHEIGHT / initHYP);
initANGLE2 = Math.asin(initWIDTH / initHYP);
slopesensorRATIO = 3;
floorpushes = 100;
speedXMAX = _parent.speedXMAX;
speedYMAX = _parent.speedYMAX;
speedMAXdivisor = _parent.speedMAXdivisor;
speedXMIN = _parent.speedXMIN;
speedYMIN = _parent.speedYMIN;
slidespeedMIN = _parent.slidespeedMIN;
jumpTHRESHOLD = _parent.jumpTHRESHOLD;
airjumpsMAX = 0;
duckjumpRATIO = 2;
throwTIME = 2.5;
throwANGLEup = 0;
throwANGLEforward = 45;
throwANGLEdown = 135;
nosedivebounceTIME = 0.25;
swimcollideMAX = 7;
duckpaddleFALLSPEED = _parent.duckpaddleFALLSPEED;
duckpaddleRATIO = _parent.duckpaddleRATIO;
faceX = 1;
faceY = 1;
if (initfaceXDIR != undefined) {
faceXDIR = initfaceXDIR;
} else {
faceXDIR = (this._x - _root.World.Player1._x) / Math.abs(this._x - _root.World.Player1._x);
}
if (initfaceYDIR != undefined) {
faceYDIR = initfaceYDIR;
} else {
faceYDIR = 1;
}
digitARCLENGTH = _parent.digitARCLENGTH;
engineloops = _parent.engineloops;
speedmultiUNIVERSAL = _parent.speedmultiUNIVERSAL;
speedmultiX = speedmultiUNIVERSAL;
speedmultiY = speedmultiUNIVERSAL;
speedmultiROT = speedmultiUNIVERSAL;
movedragX = 1.2;
movedragY = 1.2;
slidedragX = _parent.slidedragX;
slidedragY = _parent.slidedragY;
waterdragX = 3;
waterdragY = 3;
swimdragX = _parent.swimdragX;
swimdragY = _parent.swimdragY;
watergroundfriction = _parent.watergroundfriction;
throwdrag = _parent.throwdrag;
swimspindrag = _parent.swimspindrag;
airspindrag = _parent.airspindrag;
windrateX = _parent.windrateX;
windrateY = _parent.windrateY;
watercurrentrateX = _parent.watercurrentrateX;
watercurrentrateY = _parent.watercurrentrateY;
gravityrateX = _parent.gravityrateX;
gravityrateY = _parent.gravityrateY;
gspeedX = 0 * speedmultiX;
gspeedY = 0 * speedmultiY;
windX = 0 * speedmultiX;
windY = 0 * speedmultiY;
windspeedX = 0 * speedmultiX;
windspeedY = 0 * speedmultiY;
environment = "falling";
environmentchecker = "air";
moverate = 0.3 * speedmultiUNIVERSAL;
sliderate = 0.75 * speedmultiUNIVERSAL;
sliderampBOOST = 0.8 * speedmultiUNIVERSAL;
sliderampTHRESHOLD = 13;
swimspeedMAXTRANSFER = 15 * speedmultiUNIVERSAL;
jumprateX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
jumprateY = (25 * gravityrateY) / Math.sqrt(speedmultiY);
walljumpTIME = 20;
nosedivejumprateX = jumprateX * 1.4;
nosedivejumprateY = jumprateY * 1.4;
springrateX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
springrateY = (50 * gravityrateY) / Math.sqrt(speedmultiY);
nosediveBOUNCEXrate = 0.5;
nosediveBOUNCEYrate = (24 * gravityrateY) / Math.sqrt(speedmultiY);
nosediveBOUNCEspinrate = 17 * speedmultiROT;
swimrateX = (1 * gravityrateY) / Math.sqrt(speedmultiY);
swimrateY = (1 * gravityrateY) / Math.sqrt(speedmultiY);
throwrate = (40 * gravityrateY) / Math.sqrt(speedmultiY);
swimspinrate = 0.5 * speedmultiROT;
airspinrate = 0.75 * speedmultiROT;
watergroundboostX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
watergroundboostY = (0 * gravityrateY) / Math.sqrt(speedmultiY);
moveX = 0 * speedmultiX;
moveY = 0 * speedmultiY;
movespeedX = 0 * speedmultiX;
movespeedY = 0 * speedmultiY;
jumpX = 0 * speedmultiX;
jumpY = 0 * speedmultiY;
walljumpTIMER = 0;
airjumpCOUNT = 0;
jumpspeedX = 0 * speedmultiX;
jumpspeedY = 0 * speedmultiY;
swimX = 0 * speedmultiX;
swimY = 0 * speedmultiY;
swimX2 = 0 * speedmultiX;
swimY2 = 0 * speedmultiY;
swimI = 0 * speedmultiUNIVERSAL;
swimspeedX = 0 * speedmultiX;
swimspeedY = 0 * speedmultiY;
speedX = 0 * speedmultiX;
speedY = 0 * speedmultiY;
swimspin = 0 * speedmultiROT;
swimspinspeed = 0 * speedmultiROT;
airspin = 0 * speedmultiROT;
airspinspeed = 0 * speedmultiROT;
charX = this._x;
charY = this._y;
charROT = this._rotation;
charsensorX = this.sensor._x;
charsensorY = this.sensor._y;
charsensorWIDTH = this.sensor._width;
charsensorHEIGHT = this.sensor._height;
worldX = _parent._x;
worldY = _parent._y;
worldROT = _parent._rotation;
worldXSCALE = _parent._xscale;
worldYSCALE = _parent._yscale;
this.attackRANGE = 400;
this.jumpRANGE = 200;
this.hitDISTANCE = 50;
this.vulnerableDISTANCE = (_width + _height) / 4;
this.birth = getTimer() / 1000;
onEnterFrame = function () {
this.age = getTimer() / 1000;
if ((((this.pasted == true) && (Math.abs(_x - _parent.camera._x) > (((_parent.camera._width / 2) + _width) + _root.World.badguyDISTANCEMAX))) && ((this.age - this.birth) > 2)) || (((this.pasted == true) && (Math.abs(_y - _parent.camera._y) > (((_parent.camera._height / 2) + this._height) + _root.World.badguyDISTANCEMAX))) && ((this.age - this.birth) > 2))) {
this.removeMovieClip();
}
this.Player1X = _parent.Player1._x;
this.Player1Y = _parent.Player1._y;
this.Player1HEIGHT = _parent.Player1._height;
this.Player1WIDTH = _parent.Player1._width;
this.Player1DISTANCE = Math.pow(Math.pow(this.Player1X - this._x, 2) + Math.pow(this.Player1Y - this._y, 2), 0.5);
if ((((_parent.Player1.rocksloaded > 0) && (this.Player1DISTANCE < this.hitDISTANCE)) && (_root.World.charBLINK == false)) && (this.charALIVE == true)) {
this.throwANGLEdamaged = random(90) - 45;
this.throwratedamaged = 8;
_parent.Player1.rocksthrown = _parent.Player1.rocksthrown + 1;
_parent.attachMovie("Rock 1", "rock" + _parent.Player1.rocksthrown, 100 + _parent.Player1.rocksthrown, {_x:_parent.charsensorX + _parent.charX, _y:(_parent.charsensorY + _parent.charY) - ((_parent.charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEdamaged * DEGtoRAD) * throwratedamaged) * _parent.faceX) + _parent.speedX, throwspeedY:(Math.cos(throwANGLEdamaged * DEGtoRAD) * throwratedamaged) - _parent.speedY, weapon:false});
_parent.oldrock = _parent.Player1.rocksthrown - _parent.rocksMAX;
_parent["rock" + _parent.oldrock].removeMovieClip();
_parent.Player1.rocksloaded = _parent.Player1.rocksloaded - 1;
_root.World.charBLINK = true;
} else if (((this.Player1DISTANCE < this.hitDISTANCE) && (_root.World.charBLINK == false)) && (this.charALIVE == true)) {
_root.World.charALIVE = false;
}
if (this.charALIVE == true) {
if (this.faceXDIR < 0) {
triggerLEFT = true;
} else {
triggerLEFT = false;
}
if (this.faceXDIR > 0) {
triggerRIGHT = true;
} else {
triggerRIGHT = false;
}
if ((((environment == "swimmingupward") && (swimarmed == true)) || ((environment == "swimmingdownward") && (swimarmed == true))) || ((environment == "duckpaddle") && (swimarmed == true))) {
triggerJUMP = true;
} else {
triggerJUMP = false;
}
engineloops = _parent.engineloops;
} else {
triggerLEFT = false;
triggerRIGHT = false;
triggerUP = false;
triggerDOWN = false;
triggerJUMP = false;
engineloops = 0;
}
worldXinit = _parent._x;
worldYinit = _parent._y;
worldROTinit = _parent._rotation;
worldXSCALEinit = _parent._xscale;
worldYSCALEinit = _parent._yscale;
frameloops = 1;
while (frameloops <= _parent.engineloops) {
if (environmentchecker != "bellyslide") {
charWIDTH = Math.abs(Math.cos(initANGLE1 - ((Math.abs(charROT) + 180) * DEGtoRAD)) * initHYP);
charHEIGHT = Math.abs(Math.cos(initANGLE2 - ((Math.abs(charROT) + 180) * DEGtoRAD)) * initHYP);
} else {
charWIDTH = initWIDTH;
charHEIGHT = initWIDTH;
}
slopesensorDISTANCE = charWIDTH / slopesensorRATIO;
if (this.charALIVE == true) {
rockcheck = _parent.Player1.rocksthrown - _root.World.rocksMAX;
while (rockcheck <= _parent.Player1.rocksthrown) {
if (((_parent["rock" + rockcheck].weapon == true) && (_parent["rock" + rockcheck] != undefined)) && (_parent["rock" + rockcheck].totalspeed > 5)) {
this[("rock" + rockcheck) + "currentXDIS"] = _parent["rock" + rockcheck]._x - this._x;
this[("rock" + rockcheck) + "currentYDIS"] = _parent["rock" + rockcheck]._y - this._y;
this[("rock" + rockcheck) + "currentDIS"] = Math.pow(Math.pow((this[("rock" + rockcheck) + "currentXDIS"] + this[("rock" + rockcheck) + "oldXDIS"]) / 2, 2) + Math.pow((this[("rock" + rockcheck) + "currentYDIS"] + this[("rock" + rockcheck) + "oldYDIS"]) / 2, 2), 0.5);
this[("rock" + rockcheck) + "avgDIS"] = Math.pow(Math.pow(this[("rock" + rockcheck) + "currentXDIS"], 2) + Math.pow(this[("rock" + rockcheck) + "currentYDIS"], 2), 0.5);
if ((this[("rock" + rockcheck) + "currentDIS"] < vulnerableDISTANCE) || (this[("rock" + rockcheck) + "avgDIS"] < vulnerableDISTANCE)) {
this.charALIVE = false;
_parent.attachMovie("puffexplosion", "puffexplosion" + rockcheck, _root.attachDEPTH, {_x:_parent["rock" + rockcheck]._x, _y:_parent["rock" + rockcheck]._y, _xscale:50, _yscale:50});
_root.attachDEPTH = _root.attachDEPTH + 1;
_parent["rock" + rockcheck].removeMovieClip();
_root.soundManager_mc.playSound("B12sFire_Shot.wav", 0, 1);
}
this[("rock" + rockcheck) + "oldXDIS"] = this[("rock" + rockcheck) + "currentXDIS"];
this[("rock" + rockcheck) + "oldYDIS"] = this[("rock" + rockcheck) + "currentYDIS"];
this[("rock" + rockcheck) + "oldDIS"] = this[("rock" + rockcheck) + "currentDIS"];
}
rockcheck++;
}
}
if (((speedY >= 0) && (_parent.SoftBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true))) || ((speedY >= 0) && (_parent.HardBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)))) {
TOUCHground = true;
if (((speedY >= 0) && (_parent.SoftBoundary.DigitBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true))) || ((speedY >= 0) && (_parent.HardBoundary.DigitBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)))) {
TOUCHdigit = true;
} else {
TOUCHdigit = false;
}
} else {
TOUCHground = false;
TOUCHdigit = false;
}
if ((faceXDIR > 0) && (_parent.HardBoundary.hitTest((((((charsensorX + charX) + offsetX) + (charWIDTH * 0.5)) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.25)) * worldYSCALEinit) / 100) + worldYinit, true))) {
TOUCHwallright = true;
faceXDIR = faceXDIR * -1;
} else {
TOUCHwallright = false;
}
if ((faceXDIR < 0) && (_parent.HardBoundary.hitTest((((((charsensorX + charX) + offsetX) - (charWIDTH * 0.5)) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.25)) * worldYSCALEinit) / 100) + worldYinit, true))) {
TOUCHwallleft = true;
faceXDIR = faceXDIR * -1;
} else {
TOUCHwallleft = false;
}
if (_parent.HardBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) - (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHceiling = true;
} else {
TOUCHceiling = false;
}
if (_parent.Water.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, ((((charsensorY + charY) + offsetY) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHwater = true;
} else {
TOUCHwater = false;
}
if (_parent.Spring.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true) && (speedY >= 0)) {
TOUCHspring = true;
} else {
TOUCHspring = false;
}
if ((((environmentchecker == "air") && (TOUCHwater == true)) && (Math.abs(speedY) < duckpaddleFALLSPEED)) || (environment == "duckpaddle")) {
environment = "duckpaddle";
} else if (((((TOUCHwater == true) && (TOUCHground == true)) || ((TOUCHwater == true) && (TOUCHceiling == true))) || ((TOUCHwater == true) && (TOUCHwallleft == true))) || ((TOUCHwater == true) && (TOUCHwallright == true))) {
environment = "watergrounded";
} else if ((TOUCHwater == true) && (speedY < 0)) {
environment = "swimmingupward";
} else if (((TOUCHwater == true) && (TOUCHground == false)) && (speedY >= 0)) {
environment = "swimmingdownward";
} else if ((TOUCHspring == true) && (speedY >= 0)) {
environment = "sprung";
} else if ((TOUCHground == true) && (speedY >= 0)) {
environment = "grounded";
} else if (speedY < 0) {
environment = "flying";
} else if ((TOUCHground == false) && (speedY >= 0)) {
environment = "falling";
}
if (((this.rocksloaded > 0) && (throwarmed == true)) && (triggerTHROW == true)) {
_parent.rocksthrown = _parent.rocksthrown + 1;
if (triggerUP == true) {
_parent.attachMovie("Rock 1", "rock" + _parent.rocksthrown, 100 + _parent.rocksthrown, {_x:charsensorX + charX, _y:(charsensorY + charY) - ((charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEup * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEup * DEGtoRAD) * throwrate) - speedY});
} else if (triggerDOWN == true) {
_parent.attachMovie("Rock 1", "rock" + _parent.rocksthrown, 100 + _parent.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * faceX), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEdown * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEdown * DEGtoRAD) * throwrate) - speedY});
} else {
_parent.attachMovie("Rock 1", "rock" + _parent.rocksthrown, 100 + _parent.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * faceX), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEforward * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEforward * DEGtoRAD) * throwrate) - speedY});
}
oldrock = _parent.rocksthrown - rocksMAX;
_parent["rock" + oldrock].removeMovieClip();
this.rocksloaded = this.rocksloaded - 1;
throwarmed = false;
} else if ((!triggerTHROW) == true) {
throwarmed = true;
} else {
throwarmed = false;
}
if (environment == "grounded") {
if ((environmentchecker != "bellyslide") && (environmentchecker != "nosedivebounce")) {
movementhyp = moverate / Math.pow(Math.pow(dr - dl, 2) + Math.pow(slopesensorDISTANCE, 2), 0.5);
if ((triggerRIGHT == true) && (TOUCHwallright == false)) {
moveX = movementhyp * slopesensorDISTANCE;
moveY = movementhyp * (-Math.abs(dr - dl));
faceX = 1;
} else if ((triggerLEFT == true) && (TOUCHwallleft == false)) {
moveX = movementhyp * (-slopesensorDISTANCE);
moveY = movementhyp * (-Math.abs(dr - dl));
faceX = -1;
} else {
moveX = 0;
moveY = 0;
}
}
if ((triggerJUMP == true) && (jumparmed == true)) {
jumpX = 0;
jumpY = jumprateY;
gspeedX = 0;
gspeedY = 0;
moveY = 0;
movespeedY = 0;
jumparmed = false;
} else {
jumpX = 0;
jumpY = 0;
if ((!triggerJUMP) == true) {
jumparmed = true;
}
}
} else if ((environment == "wallslide") || (environmentchecker == "wallsliding")) {
if ((triggerJUMP == true) && (jumparmed == true)) {
jumpX = 0;
jumpY = jumprateY;
gspeedX = 0;
gspeedY = 0;
if (triggerRIGHT == true) {
moveX = -moverate;
} else if (triggerLEFT == true) {
moveX = moverate;
}
moveY = 0;
movespeedY = 0;
jumparmed = false;
walljumpTIMER = walljumpTIME;
} else {
jumpX = 0;
jumpY = 0;
if ((!triggerJUMP) == true) {
jumparmed = true;
}
}
} else if ((environment == "flying") || (environment == "falling")) {
if (walljumpTIMER <= 0) {
if (environmentchecker != "bellyslide") {
if ((triggerRIGHT == true) && (TOUCHwallright == false)) {
moveX = moverate;
faceX = 1;
} else if ((triggerLEFT == true) && (TOUCHwallleft == false)) {
moveX = -moverate;
faceX = -1;
} else {
moveX = 0;
}
} else {
moveX = 0;
}
walljumpTIMER = 0;
} else {
walljumpTIMER = walljumpTIMER - 1;
}
if (((triggerJUMP == true) && (jumparmed == true)) && (airjumpCOUNT > 0)) {
jumpspeedX = 0;
jumpspeedY = jumprateY;
gspeedX = 0;
gspeedY = 0;
moveY = 0;
movespeedY = 0;
jumparmed = false;
airjumpCOUNT = airjumpCOUNT - 1;
} else {
jumpX = 0;
jumpY = 0;
if ((!triggerJUMP) == true) {
jumparmed = true;
}
}
if (((((Key.isDown(_root.kJUMP) && (gspeedY <= jumpTHRESHOLD)) && ((dr + dl) == -2)) && (jumpspeedX == 0)) && (jumpspeedY == 0)) && (environment == "falling")) {
airjumpCOUNT = airjumpsMAX;
}
} else if ((((environment == "duckpaddle") || (environment == "swimmingupward")) || (environment == "swimmingdownward")) || (environment == "watergrounded")) {
if (((triggerRIGHT == true) && (triggerUP == true)) && (environment != "duckpaddle")) {
if ((charROT > -135) && (charROT <= 45)) {
if ((45 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-135 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((45 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-135 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((triggerRIGHT == true) && (triggerDOWN == true)) {
if ((charROT > -45) && (charROT <= 135)) {
if ((135 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-45 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((135 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-45 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if (((triggerLEFT == true) && (triggerUP == true)) && (environment != "duckpaddle")) {
if ((charROT >= -45) && (charROT < 135)) {
if ((-45 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (135 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((-45 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (135 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((triggerLEFT == true) && (triggerDOWN == true)) {
if ((charROT >= -135) && (charROT < 45)) {
if ((-135 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (45 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((-135 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (45 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (triggerRIGHT == true) {
if (environment == "duckpaddle") {
faceX = 1;
} else if ((charROT >= -90) && (charROT < 90)) {
if ((90 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-90 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((90 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-90 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if (triggerLEFT == true) {
if (environment == "duckpaddle") {
faceX = -1;
} else if ((charROT > -90) && (charROT <= 90)) {
if ((90 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (-90 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((90 > (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (-90 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((triggerUP == true) && (environment != "duckpaddle")) {
if (faceX > 0) {
if ((0 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-180 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 0;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((0 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (180 > (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 0;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (triggerDOWN == true) {
if (environment == "duckpaddle") {
swimX2 = swimX2 / duckpaddleRATIO;
swimY2 = swimY2 / duckpaddleRATIO;
environment = "swimmingdownward";
}
if (faceX < 0) {
if ((0 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (-180 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 180;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((0 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (180 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 180;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else {
swimspin = 0;
}
if ((swimspeedX > 0) && (environment != "duckpaddle")) {
faceX = 1;
} else if ((swimspeedX < 0) && (environment != "duckpaddle")) {
faceX = -1;
}
if ((triggerJUMP == true) && (swimarmed == true)) {
if (((triggerUP == true) && (environment == "duckpaddle")) && (duckjumparmed == true)) {
while (Water.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((charY + offsetY) * worldYSCALEinit) / 100) + worldYinit, true)) {
charY = charY - 1;
}
jumpX = jumprateX;
jumpY = jumprateY;
environment = "duckjump";
environmentchecker = "duckjump";
duckjumparmed = false;
swimarmed = false;
} else if ((((environment == "duckpaddle") && (speedX == 0)) || (((environment == "duckpaddle") && (speedX > 0)) && (TOUCHwallright == false))) || (((environment == "duckpaddle") && (speedX < 0)) && (TOUCHwallleft == false))) {
if (((speedY == 0) || ((speedY > 0) && (TOUCHground == false))) || ((speedY < 0) && (TOUCHceiling == false))) {
swimX = swimrateX / duckpaddleRATIO;
swimY = swimrateY / duckpaddleRATIO;
swimarmed = false;
}
} else if (((speedX == 0) || ((speedX > 0) && (TOUCHwallright == false))) || ((speedX < 0) && (TOUCHwallleft == false))) {
if (((speedY == 0) || ((speedY > 0) && (TOUCHground == false))) || ((speedY < 0) && (TOUCHceiling == false))) {
swimX = swimrateX;
swimY = swimrateY;
swimarmed = false;
}
}
} else {
swimX = 0;
swimY = 0;
}
if ((!triggerJUMP) == true) {
swimarmed = true;
duckjumparmed = true;
}
}
if (environment == "duckpaddle") {
charROT = 90 * faceX;
if (airspinspeed != 0) {
swimspinspeed = swimspinspeed + airspinspeed;
airspinspeed = 0;
}
airspin = 0;
if ((charROT > 100) || (charROT < -100)) {
if ((environmentchecker != "water") && (environmentchecker != "duckpaddle")) {
swimI = swimI + (Math.abs(movespeedX) / 3);
}
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
gspeedX = 0;
gspeedY = 0;
gravityX = 0;
gravityY = 0;
windX = watercurrentrateX;
windY = 0;
if ((environmentchecker != "water") && (environmentchecker != "duckpaddle")) {
swimY = 0;
swimY2 = 0;
}
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
environmentchecker = "duckpaddle";
} else if ((environment == "swimmingupward") || (environment == "swimmingdownward")) {
if (airspinspeed != 0) {
swimspinspeed = swimspinspeed + airspinspeed;
airspinspeed = 0;
}
airspin = 0;
if ((charROT > 100) || (charROT < -100)) {
if (environmentchecker != "water") {
swimI = swimI + ((Math.abs(movespeedX) / 3) + (gspeedY / 3));
gspeedY = 0;
}
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = gravityrateX;
gravityY = gravityrateY;
windX = watercurrentrateX;
windY = watercurrentrateY;
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
swimY2 = swimY2 / swimdragY;
swimI = swimI / swimdragY;
gspeedX = gspeedX / waterdragX;
gspeedY = gspeedY / waterdragY;
environmentchecker = "water";
} else if (environment == "watergrounded") {
if (((Math.abs(swimX2) >= swimcollideMAX) || (Math.abs(swimY2) >= swimcollideMAX)) || (Math.abs(swimI) >= swimcollideMAX)) {
swimX2 = Math.min(swimX2, swimcollideMAX);
swimY2 = Math.min(swimY2, swimcollideMAX);
swimI = Math.min(swimI, swimcollideMAX);
} else if (((Math.abs(swimX2) >= 0.25) || (Math.abs(swimY2) >= 0.25)) || (Math.abs(swimI) >= 0.25)) {
swimX2 = swimX2 / watergroundfriction;
swimY2 = swimY2 / watergroundfriction;
swimI = swimI / watergroundfriction;
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
windX = 0;
windY = 0;
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
swimY2 = swimY2 / swimdragY;
movespeedX = movespeedX / waterdragX;
movespeedY = movespeedY / waterdragY;
environmentchecker = "waterground";
} else if ((environment == "flying") || (environment == "falling")) {
charROT = 0;
if ((dr == -1) && (dl == -1)) {
moveY = 0;
movespeedY = 0;
}
if (swimspinspeed != 0) {
airspinspeed = airspinspeed + swimspinspeed;
swimspinspeed = 0;
}
swimspin = 0;
if (((swimX2 != 0) || (swimY2 != 0)) || (swimI != 0)) {
if (environmentchecker == "duckjump") {
swimX2 = swimX2 / duckjumpRATIO;
swimI = swimI / duckjumpRATIO;
}
jumpspeedX = jumpspeedX + (Math.sin(charROT * DEGtoRAD) * swimX2);
if (environmentchecker != "duckjump") {
jumpspeedY = jumpspeedY + Math.min(Math.cos(charROT * DEGtoRAD) * (swimX2 + swimI), swimspeedMAXTRANSFER);
}
}
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
gravityX = gravityrateX;
gravityY = gravityrateY;
windX = windrateX;
windY = windrateY;
if (environment == "flying") {
jumpX = 0;
jumpY = 0;
}
airspinspeed = airspinspeed / airspindrag;
if (environmentchecker != "bellyslide") {
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
} else {
movespeedX = movespeedX / slidedragX;
movespeedY = movespeedY / slidedragY;
}
if (environmentchecker == "nosedivebounce") {
airspin = 0;
if (Math.abs(charROT) < 5) {
charROT = 0;
environmentchecker = ((gspeedY > (jumpspeedY * 2)) ? "air" : "nosedivebounce");
}
}
if (((((environmentchecker == "water") && (triggerRIGHT == true)) && ((!triggerUP) == true)) && ((!triggerDOWN) == true)) || ((((environmentchecker == "water") && (triggerLEFT == true)) && ((!triggerUP) == true)) && ((!triggerDOWN) == true))) {
environmentchecker = "porpoising";
} else if (((environmentchecker != "porpoising") && (environmentchecker != "bellyslide")) && (environmentchecker != "nosedivebounce")) {
environmentchecker = "air";
}
} else if (environment == "wallslide") {
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 1;
swimspin = 0;
swimspinspeed = 0;
airspin = 0;
airspinspeed = 0;
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
environmentchecker = "wallsliding";
} else if (environment == "grounded") {
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
swimspin = 0;
swimspinspeed = 0;
airspin = 0;
airspinspeed = 0;
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
if (environmentchecker != "bellyslide") {
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
bellyslideTIME = 0;
} else {
if ((dr - dl) != 0) {
moveX = (((sliderate * slopesensorDISTANCE) / Math.sqrt(Math.pow(dl - dr, 2) + Math.pow(slopesensorDISTANCE, 2))) * (dl - dr)) / Math.abs(dl - dr);
moveY = (sliderate * (-Math.abs(dr - dl))) / Math.sqrt(Math.pow(dr - dl, 2) + Math.pow(slopesensorDISTANCE, 2));
} else {
moveX = 0;
moveY = 0;
}
movespeedX = movespeedX / slidedragX;
movespeedY = movespeedY / slidedragY;
}
if (((((charROT < 89) && (charROT > -89)) && (environmentchecker != "bellyslide")) || ((((environmentchecker == "bellyslide") && (Math.abs(movespeedX) <= slidespeedMIN)) && (Math.abs(dr - dl) <= 0)) && (bellyslideTIME > 100))) || (((environmentchecker == "bellyslide") && (charROT < 30)) && (charROT > -30))) {
charY = charY - ((initHEIGHT - charHEIGHT) / 2);
charROT = 0;
environmentchecker = "ground";
} else if (((charROT < 165) && (charROT > -165)) || (((environmentchecker == "bellyslide") && (charROT < 30)) && (charROT > -30))) {
charY = charY - ((initWIDTH - charHEIGHT) / 2);
charWIDTH = initWIDTH;
charHEIGHT = initWIDTH;
if (environmentchecker != "bellyslide") {
charROT = ((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD);
} else if (charROT != (((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD))) {
slopeDIFFERENCE = (((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD)) - charROT;
charROT = charROT + (slopeDIFFERENCE / 2);
}
bellyslideTIME = bellyslideTIME + 1;
environmentchecker = "bellyslide";
if ((((jumpspeedY == 0) && ((oldslopeANGLE * slopeANGLE) <= 0)) && (oldslopeANGLE != 0)) || (((jumpspeedY == 0) && ((oldslopeANGLE * slopeANGLE) <= 0)) && (slopeANGLE != 0))) {
if (((oldslopeANGLE > 0) && (speedX > 0)) || ((oldslopeANGLE < 0) && (speedX < 0))) {
moveY = 0;
movespeedY = 0;
gspeedY = 0;
rampjumpY = (sliderampBOOST * Math.abs(speedX)) * Math.cos(oldslopeANGLE * DEGtoRAD);
jumpY = ((rampjumpY > 0) ? rampjumpY : 0);
} else {
moveY = 0;
movespeedY = 0;
}
}
} else {
charY = charY - ((initHEIGHT - charHEIGHT) / 2);
charROT = 180;
if (environmentchecker != "nosedivebounce") {
nosedivebounceSTART = getTimer() / 1000;
environmentchecker = "nosedivebounce";
}
if ((triggerJUMP == true) && (jumparmed == true)) {
airspin = airspin + (nosediveBOUNCEspinrate * faceX);
jumpX = nosedivejumprateX * faceX;
jumpY = nosedivejumprateY;
environmentchecker = "nosedivebounce";
moveY = 0;
movespeedY = 0;
jumparmed = false;
} else {
jumpX = 0;
jumpY = 0;
if ((!triggerJUMP) == true) {
jumparmed = true;
}
}
nosedivebounceTIMER = (getTimer() / 1000) - nosedivebounceSTART;
if (nosedivebounceTIMER >= nosedivebounceTIME) {
airspin = airspin + (nosediveBOUNCEspinrate * faceX);
jumpX = nosediveBOUNCEXrate * faceX;
jumpY = nosediveBOUNCEYrate;
}
}
} else if (environment == "sprung") {
swimX2 = 0;
swimY2 = 0;
swimI = 0;
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
if (TOUCHwater == false) {
jumpX = springrateX;
jumpY = springrateY;
swimX = 0;
swimY = 0;
} else {
swimX = springrateX;
swimY = springrateY;
jumpX = 0;
jumpY = 0;
}
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
environmentchecker = "sprung";
}
movespeedX = movespeedX + moveX;
jumpspeedX = jumpspeedX + jumpX;
swimX2 = swimX2 + swimX;
if ((charROT == 180) || (charROT == -180)) {
swimspeedX = 0;
} else {
swimspeedX = Math.sin(charROT * DEGtoRAD) * (swimX2 + swimI);
}
gspeedX = gspeedX + gravityX;
windspeedX = windX;
movespeedY = movespeedY + moveY;
jumpspeedY = jumpspeedY + jumpY;
swimY2 = swimY2 + swimY;
swimspeedY = Math.cos(charROT * DEGtoRAD) * (swimY2 + swimI);
gspeedY = gspeedY + gravityY;
windspeedY = windY;
if (Math.abs(movespeedX) < 0.1) {
movespeedX = 0;
}
if (Math.abs(movespeedY) < 0.1) {
movespeedY = 0;
}
speedX = (((movespeedX + jumpspeedX) + swimspeedX) - gspeedX) + windspeedX;
speedY = ((((-movespeedY) - jumpspeedY) - swimspeedY) + gspeedY) - windspeedY;
if (speedX > speedXMAX) {
speedX = speedX - (speedX - speedXMAX);
} else if (speedX < (-speedXMAX)) {
speedX = speedX + (speedXMAX - speedX);
}
if (speedY > speedYMAX) {
speedY = speedY - (speedY - speedYMAX);
} else if (speedY < (-speedYMAX)) {
speedY = speedY + (speedYMAX - speedY);
}
if (Math.abs(speedX) < speedMINX) {
speedX = 0;
}
if (Math.abs(speedY) < speedMINY) {
speedY = 0;
}
charX = charX + speedX;
charY = charY + speedY;
swimspinspeed = swimspinspeed + swimspin;
airspinspeed = airspinspeed + airspin;
speedROT = swimspinspeed + airspinspeed;
charROT = charROT + speedROT;
if (charROT > 180) {
charROT = charROT - 360;
} else if (charROT < -180) {
charROT = charROT + 360;
}
if (((speedX == 0) && (speedY == 0)) && (speedROT == 0)) {
charACTION = false;
} else {
charACTION = true;
}
if (charACTION == true) {
if (speedY > 0) {
d = 1;
while (d <= floorpushes) {
if (((!_parent.SoftBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true)) && (!_parent.HardBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true))) && (!_parent.Spring.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true))) {
charY = charY - (d - 1);
break;
}
d++;
}
} else if (speedY < 0) {
u = 1;
while (u <= floorpushes) {
if (!_parent.HardBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) - (charHEIGHT * uHEIGHT)) + u) * worldYSCALEinit) / 100) + worldYinit, true)) {
charY = charY + (u - 1);
break;
}
movespeedY = 0;
jumpspeedY = 0;
gspeedY = 0;
u++;
}
}
if (speedX > 0) {
r = 1;
while (r <= floorpushes) {
if (!_parent.HardBoundary.hitTest((((((charX + offsetX) + (charWIDTH * rWIDTH)) - r) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) + (charHEIGHT * rHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX - (r - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
r++;
}
if (environmentchecker != "bellysliding") {
ur = 1;
while (ur <= floorpushes) {
if (!_parent.HardBoundary.hitTest((((((charX + offsetX) + (charWIDTH * urWIDTH)) - ur) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) - (charHEIGHT * urHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX - (ur - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
ur++;
}
}
}
if (speedX < 0) {
l = 1;
while (l <= floorpushes) {
if (!_parent.HardBoundary.hitTest((((((charX + offsetX) - (charWIDTH * lWIDTH)) + l) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) + (charHEIGHT * lHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX + (l - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
l++;
}
if (environmentchecker != "bellysliding") {
ul = 1;
while (ul <= floorpushes) {
if (!_parent.HardBoundary.hitTest((((((charX + offsetX) - (charWIDTH * ulWIDTH)) + ul) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) - (charHEIGHT * ulHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX + (ul - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
ul++;
}
}
}
}
oldslopeANGLE = slopeANGLE;
if ((((charACTION == true) && (oldTOUCHdigit == false)) && (digitMODE == "constant")) || ((charACTION == true) && (digitMODE != "constant"))) {
dr = 0;
while (dr <= floorpushes) {
if ((!_parent.SoftBoundary.hitTest(((((charX + offsetX) + (slopesensorDISTANCE / 2)) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dr) * worldYSCALEinit) / 100) + worldYinit, true)) && (!_parent.HardBoundary.hitTest(((((charX + offsetX) + slopesensorDISTANCE) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dr) * worldYSCALEinit) / 100) + worldYinit, true))) {
dr = dr - 1;
break;
}
dr++;
}
dl = 0;
while (dl <= floorpushes) {
if ((!_parent.SoftBoundary.hitTest(((((charX + offsetX) - (slopesensorDISTANCE / 2)) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dl) * worldYSCALEinit) / 100) + worldYinit, true)) && (!_parent.HardBoundary.hitTest(((((charX + offsetX) - slopesensorDISTANCE) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dl) * worldYSCALEinit) / 100) + worldYinit, true))) {
dl = dl - 1;
break;
}
dl++;
}
slopeANGLE = Math.atan((dr - dl) / slopesensorDISTANCE) / DEGtoRAD;
if ((TOUCHdigit == true) && (digitMODE == "restricted")) {
slopeANGLE = Math.round(slopeANGLE / digitARCLENGTH) * digitARCLENGTH;
if (slopeANGLE > 0) {
dr = Math.abs((Math.tan(slopeANGLE * DEGtoRAD) * slopesensorDISTANCE) / 2);
dl = -dr;
} else {
dr = -Math.abs((Math.tan(slopeANGLE * DEGtoRAD) * slopesensorDISTANCE) / 2);
dl = -dr;
}
}
}
if ((((TOUCHground == true) && (TOUCHdigit == false)) || ((jumpspeedY < gspeedY) && (jumpspeedY > 0))) || ((jumpspeedY == 0) && (gspeedY > jumpTHRESHOLD))) {
oldTOUCHdigit = false;
} else {
oldTOUCHdigit = true;
}
totalspeed = Math.pow(Math.pow(speedX, 2) + Math.pow(speedY, 2), 0.5);
frameloops++;
}
worldX = _parent._x;
worldY = _parent._y;
worldROT = _parent._rotation;
worldXSCALE = _parent._xscale;
worldYSCALE = _parent._yscale;
this._x = charX;
this._y = charY;
this._rotation = charROT;
this.sensor._x = charsensorX;
this.sensor._y = charsensorY;
this.sensor._width = charsensorWIDTH;
this.sensor._height = charsensorHEIGHT;
if (faceX > 0) {
this._xscale = 100;
} else if (faceX < 0) {
this._xscale = -100;
}
};
Instance of Symbol 81 MovieClip "sensor" in Symbol 147 MovieClip [Goomba 1] Frame 1
onClipEvent (load) {
_visible = false;
_parent.stop();
bubbles = 0;
bubbletime = 2;
bubbleSCALEMIN = 100;
bubbleSCALEMAX = 400;
bubblesMAX = 50;
bubbleLOOPS = 5;
bubbleSPEEDSPAWN = 5 * bubbleLOOPS;
}
onClipEvent (enterFrame) {
if (_parent.charALIVE == false) {
_parent.gotoAndStop("Dead");
} else if (_parent.environment == "duckpaddle") {
if (Key.isDown(_root.kJUMP)) {
_parent.gotoAndStop("SurfaceSwimming-Flapping");
} else {
_parent.gotoAndStop("SurfaceSwimming");
}
} else if (((_parent.environment == "swimmingupward") || (_parent.environment == "swimmingdownward")) || (_parent.environment == "watergrounded")) {
if ((bubbletimeSTART + bubbletime) > (getTimer() / 1000)) {
bubbleloop = 1;
while (bubbleloop < bubbleLOOPS) {
if (random(Math.max(0, bubbleSPEEDSPAWN - (_parent.totalspeed * bubbleLOOPS))) == 0) {
bubbles = bubbles + 1;
bubbleSCALE = random(bubbleSCALEMAX - bubbleSCALEMIN) + bubbleSCALEMIN;
_parent.attachMovie("Bubble 1", "bubble" + bubbles, _parent.bubbledepth + bubbles, {_x:((((_x + (((_height / 2) * _parent.faceX) * Math.sin(_parent._rotation * _parent.DEGtoRAD))) + ((random(_width) - (_width / 2)) * Math.cos(_parent._rotation * _parent.DEGtoRAD))) * _parent._xscale) / 100) + _parent._x, _y:((((_y - ((_height / 2) * Math.cos(_parent._rotation * _parent.DEGtoRAD))) - ((random(_width) - (_width / 2)) * Math.sin(_parent._rotation * _parent.DEGtoRAD))) * _parent._yscale) / 100) + _parent._y, _xscale:bubbleSCALE, _yscale:bubbleSCALE, bubbleSCALE:bubbleSCALE});
}
bubbleloop++;
}
}
if (Key.isDown(_root.kJUMP)) {
_parent.gotoAndStop("Swimming-Flapping");
} else if ((Math.abs(_parent.swimspeedX) > _parent.gspeedY) || (Math.abs(_parent.swimspeedY) > _parent.gspeedY)) {
_parent.gotoAndStop("Swimming");
} else {
_parent.gotoAndStop("Sinking");
}
} else if ((_parent.jumpspeedY >= _parent.gspeedY) && (_parent.jumpspeedY > 0)) {
if (_parent.airjumpCOUNT == _parent.airjumpsMAX) {
_parent.gotoAndStop("Flying");
} else {
_parent.gotoAndStop("DoubleJumping");
}
} else if (((_parent.jumpspeedY < _parent.gspeedY) && (_parent.jumpspeedY > 0)) || ((_parent.jumpspeedY == 0) && (_parent.gspeedY > _parent.jumpTHRESHOLD))) {
_parent.gotoAndStop("Falling");
} else if (_parent.environment == "wallslide") {
_parent.gotoAndStop("Wallsliding");
} else if (((_parent.environmentchecker == "bellyslide") && (_parent.bellyslideTIME < 99)) || (((_parent.environmentchecker == "bellyslide") && (_parent.bellyslideTIME >= 99)) && (Math.abs(_parent.movespeedX) > _parent.slidespeedMIN))) {
_parent.gotoAndStop("BellySliding");
} else if (((_parent.environment == "grounded") && (_parent.charROT >= 165)) || ((_parent.environment == "grounded") && (_parent.charROT <= -165))) {
_parent.gotoAndStop("Nosedivebounce");
} else if (_parent.moveX != 0) {
_parent.gotoAndStop("Walking");
} else {
_parent.gotoAndStop("Standing");
}
if (((_parent.environment != "swimmingupward") && (_parent.environment != "swimmingdownward")) && (_parent.environment != "watergrounded")) {
bubbletimeSTART = getTimer() / 1000;
}
}
Symbol 176 MovieClip Frame 14
stop();
Symbol 177 MovieClip [Koopa Troopa 1] Frame 1
framerateDEFAULT = _parent.framerateDEFAULT;
framerateMAX = _parent.framerateMAX;
framerateMIN = _parent.framerateMIN;
DEGtoRAD = (Math.PI/180);
bubbleDEPTH = _parent.bubbleDEPTH;
digitMODE = _parent.digitMODE;
this.charALIVE = true;
this.rocksloaded = 0;
_parent.rocksthrown = 0;
this.rocksloadedMAX = 3;
this.rocksMAX = _parent.rocksMAX;
dHEIGHT = 0.5;
uHEIGHT = 0.5;
rWIDTH = 0.5;
rHEIGHT = 0;
urWIDTH = 0.3;
urHEIGHT = 0.25;
lWIDTH = 0.5;
lHEIGHT = 0;
ulWIDTH = 0.3;
ulHEIGHT = 0.25;
offsetX = 0;
offsetY = 0;
charACTION = true;
initWIDTH = sensor._width;
initHEIGHT = sensor._height;
initHYP = Math.sqrt(Math.pow(initWIDTH, 2) + Math.pow(initHEIGHT, 2));
initANGLE1 = Math.asin(initHEIGHT / initHYP);
initANGLE2 = Math.asin(initWIDTH / initHYP);
slopesensorRATIO = 3;
floorpushes = 100;
speedXMAX = _parent.speedXMAX;
speedYMAX = _parent.speedYMAX;
speedMAXdivisor = _parent.speedMAXdivisor;
speedXMIN = _parent.speedXMIN;
speedYMIN = _parent.speedYMIN;
slidespeedMIN = _parent.slidespeedMIN;
jumpTHRESHOLD = _parent.jumpTHRESHOLD;
airjumpsMAX = 0;
duckjumpRATIO = 2;
throwTIME = 2.5;
throwANGLEup = 0;
throwANGLEforward = 45;
throwANGLEdown = 135;
nosedivebounceTIME = 0.25;
swimcollideMAX = 7;
duckpaddleFALLSPEED = _parent.duckpaddleFALLSPEED;
duckpaddleRATIO = _parent.duckpaddleRATIO;
faceX = 1;
faceY = 1;
if (initfaceXDIR != undefined) {
faceXDIR = initfaceXDIR;
} else {
faceXDIR = (this._x - _root.World.Player1._x) / Math.abs(this._x - _root.World.Player1._x);
}
if (initfaceYDIR != undefined) {
faceYDIR = initfaceYDIR;
} else {
faceYDIR = 1;
}
digitARCLENGTH = _parent.digitARCLENGTH;
engineloops = _parent.engineloops;
speedmultiUNIVERSAL = _parent.speedmultiUNIVERSAL;
speedmultiX = speedmultiUNIVERSAL;
speedmultiY = speedmultiUNIVERSAL;
speedmultiROT = speedmultiUNIVERSAL;
movedragX = 1.2;
movedragY = 1.2;
slidedragX = _parent.slidedragX;
slidedragY = _parent.slidedragY;
waterdragX = 3;
waterdragY = 3;
swimdragX = _parent.swimdragX;
swimdragY = _parent.swimdragY;
watergroundfriction = _parent.watergroundfriction;
throwdrag = _parent.throwdrag;
swimspindrag = _parent.swimspindrag;
airspindrag = _parent.airspindrag;
windrateX = _parent.windrateX;
windrateY = _parent.windrateY;
watercurrentrateX = _parent.watercurrentrateX;
watercurrentrateY = _parent.watercurrentrateY;
gravityrateX = _parent.gravityrateX;
gravityrateY = _parent.gravityrateY;
gspeedX = 0 * speedmultiX;
gspeedY = 0 * speedmultiY;
windX = 0 * speedmultiX;
windY = 0 * speedmultiY;
windspeedX = 0 * speedmultiX;
windspeedY = 0 * speedmultiY;
environment = "falling";
environmentchecker = "air";
moverate = 0.3 * speedmultiUNIVERSAL;
sliderate = 0.75 * speedmultiUNIVERSAL;
sliderampBOOST = 0.8 * speedmultiUNIVERSAL;
sliderampTHRESHOLD = 13;
swimspeedMAXTRANSFER = 15 * speedmultiUNIVERSAL;
jumprateX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
jumprateY = (25 * gravityrateY) / Math.sqrt(speedmultiY);
walljumpTIME = 20;
nosedivejumprateX = jumprateX * 1.4;
nosedivejumprateY = jumprateY * 1.4;
springrateX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
springrateY = (50 * gravityrateY) / Math.sqrt(speedmultiY);
nosediveBOUNCEXrate = 0.5;
nosediveBOUNCEYrate = (24 * gravityrateY) / Math.sqrt(speedmultiY);
nosediveBOUNCEspinrate = 17 * speedmultiROT;
swimrateX = (1 * gravityrateY) / Math.sqrt(speedmultiY);
swimrateY = (1 * gravityrateY) / Math.sqrt(speedmultiY);
throwrate = (40 * gravityrateY) / Math.sqrt(speedmultiY);
swimspinrate = 0.5 * speedmultiROT;
airspinrate = 0.75 * speedmultiROT;
watergroundboostX = (0 * gravityrateX) / Math.sqrt(speedmultiX);
watergroundboostY = (0 * gravityrateY) / Math.sqrt(speedmultiY);
moveX = 0 * speedmultiX;
moveY = 0 * speedmultiY;
movespeedX = 0 * speedmultiX;
movespeedY = 0 * speedmultiY;
jumpX = 0 * speedmultiX;
jumpY = 0 * speedmultiY;
walljumpTIMER = 0;
airjumpCOUNT = 0;
jumpspeedX = 0 * speedmultiX;
jumpspeedY = 0 * speedmultiY;
swimX = 0 * speedmultiX;
swimY = 0 * speedmultiY;
swimX2 = 0 * speedmultiX;
swimY2 = 0 * speedmultiY;
swimI = 0 * speedmultiUNIVERSAL;
swimspeedX = 0 * speedmultiX;
swimspeedY = 0 * speedmultiY;
speedX = 0 * speedmultiX;
speedY = 0 * speedmultiY;
swimspin = 0 * speedmultiROT;
swimspinspeed = 0 * speedmultiROT;
airspin = 0 * speedmultiROT;
airspinspeed = 0 * speedmultiROT;
charX = this._x;
charY = this._y;
charROT = this._rotation;
charsensorX = this.sensor._x;
charsensorY = this.sensor._y;
charsensorWIDTH = this.sensor._width;
charsensorHEIGHT = this.sensor._height;
worldX = _parent._x;
worldY = _parent._y;
worldROT = _parent._rotation;
worldXSCALE = _parent._xscale;
worldYSCALE = _parent._yscale;
this.attackRANGE = 400;
this.jumpRANGE = 200;
this.hitDISTANCE = 50;
this.vulnerableDISTANCE = (_width + _height) / 4;
this.birth = getTimer() / 1000;
onEnterFrame = function () {
this.age = getTimer() / 1000;
if ((((this.pasted == true) && (Math.abs(_x - _parent.camera._x) > (((_parent.camera._width / 2) + _width) + _root.World.badguyDISTANCEMAX))) && ((this.age - this.birth) > 2)) || (((this.pasted == true) && (Math.abs(_y - _parent.camera._y) > (((_parent.camera._height / 2) + this._height) + _root.World.badguyDISTANCEMAX))) && ((this.age - this.birth) > 2))) {
this.removeMovieClip();
}
this.Player1X = _parent.Player1._x;
this.Player1Y = _parent.Player1._y;
this.Player1HEIGHT = _parent.Player1._height;
this.Player1WIDTH = _parent.Player1._width;
this.Player1DISTANCE = Math.pow(Math.pow(this.Player1X - this._x, 2) + Math.pow(this.Player1Y - this._y, 2), 0.5);
if ((((_parent.Player1.rocksloaded > 0) && (this.Player1DISTANCE < this.hitDISTANCE)) && (_root.World.charBLINK == false)) && (this.charALIVE == true)) {
this.throwANGLEdamaged = random(90) - 45;
this.throwratedamaged = 8;
_parent.Player1.rocksthrown = _parent.Player1.rocksthrown + 1;
_parent.attachMovie("Rock 1", "rock" + _parent.Player1.rocksthrown, 100 + _parent.Player1.rocksthrown, {_x:_parent.charsensorX + _parent.charX, _y:(_parent.charsensorY + _parent.charY) - ((_parent.charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEdamaged * DEGtoRAD) * throwratedamaged) * _parent.faceX) + _parent.speedX, throwspeedY:(Math.cos(throwANGLEdamaged * DEGtoRAD) * throwratedamaged) - _parent.speedY, weapon:false});
_parent.oldrock = _parent.Player1.rocksthrown - _parent.rocksMAX;
_parent["rock" + _parent.oldrock].removeMovieClip();
_parent.Player1.rocksloaded = _parent.Player1.rocksloaded - 1;
_root.World.charBLINK = true;
} else if (((this.Player1DISTANCE < this.hitDISTANCE) && (_root.World.charBLINK == false)) && (this.charALIVE == true)) {
_root.World.charALIVE = false;
}
if (charALIVE == true) {
if (this.faceXDIR < 0) {
triggerLEFT = true;
} else {
triggerLEFT = false;
}
if (this.faceXDIR > 0) {
triggerRIGHT = true;
} else {
triggerRIGHT = false;
}
if ((((environment == "swimmingupward") && (swimarmed == true)) || ((environment == "swimmingdownward") && (swimarmed == true))) || ((environment == "duckpaddle") && (swimarmed == true))) {
triggerJUMP = true;
} else {
triggerJUMP = false;
}
engineloops = _parent.engineloops;
} else {
triggerLEFT = false;
triggerRIGHT = false;
triggerUP = false;
triggerDOWN = false;
triggerJUMP = false;
engineloops = 0;
}
worldXinit = _parent._x;
worldYinit = _parent._y;
worldROTinit = _parent._rotation;
worldXSCALEinit = _parent._xscale;
worldYSCALEinit = _parent._yscale;
frameloops = 1;
while (frameloops <= _parent.engineloops) {
if (environmentchecker != "bellyslide") {
charWIDTH = Math.abs(Math.cos(initANGLE1 - ((Math.abs(charROT) + 180) * DEGtoRAD)) * initHYP);
charHEIGHT = Math.abs(Math.cos(initANGLE2 - ((Math.abs(charROT) + 180) * DEGtoRAD)) * initHYP);
} else {
charWIDTH = initWIDTH;
charHEIGHT = initWIDTH;
}
slopesensorDISTANCE = charWIDTH / slopesensorRATIO;
if (this.charALIVE == true) {
rockcheck = _parent.Player1.rocksthrown - _root.World.rocksMAX;
while (rockcheck <= _parent.Player1.rocksthrown) {
if (((_parent["rock" + rockcheck].weapon == true) && (_parent["rock" + rockcheck] != undefined)) && (_parent["rock" + rockcheck].totalspeed > 5)) {
this[("rock" + rockcheck) + "currentXDIS"] = _parent["rock" + rockcheck]._x - this._x;
this[("rock" + rockcheck) + "currentYDIS"] = _parent["rock" + rockcheck]._y - this._y;
this[("rock" + rockcheck) + "currentDIS"] = Math.pow(Math.pow((this[("rock" + rockcheck) + "currentXDIS"] + this[("rock" + rockcheck) + "oldXDIS"]) / 2, 2) + Math.pow((this[("rock" + rockcheck) + "currentYDIS"] + this[("rock" + rockcheck) + "oldYDIS"]) / 2, 2), 0.5);
this[("rock" + rockcheck) + "avgDIS"] = Math.pow(Math.pow(this[("rock" + rockcheck) + "currentXDIS"], 2) + Math.pow(this[("rock" + rockcheck) + "currentYDIS"], 2), 0.5);
if ((this[("rock" + rockcheck) + "currentDIS"] < vulnerableDISTANCE) || (this[("rock" + rockcheck) + "avgDIS"] < vulnerableDISTANCE)) {
this.charALIVE = false;
_parent.attachMovie("puffexplosion", "puffexplosion" + rockcheck, _root.attachDEPTH, {_x:_parent["rock" + rockcheck]._x, _y:_parent["rock" + rockcheck]._y, _xscale:50, _yscale:50});
_root.attachDEPTH = _root.attachDEPTH + 1;
_parent["rock" + rockcheck].removeMovieClip();
_root.soundManager_mc.playSound("B12sFire_Shot.wav", 0, 1);
}
this[("rock" + rockcheck) + "oldXDIS"] = this[("rock" + rockcheck) + "currentXDIS"];
this[("rock" + rockcheck) + "oldYDIS"] = this[("rock" + rockcheck) + "currentYDIS"];
this[("rock" + rockcheck) + "oldDIS"] = this[("rock" + rockcheck) + "currentDIS"];
}
rockcheck++;
}
}
if (((speedY >= 0) && (_parent.SoftBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true))) || ((speedY >= 0) && (_parent.HardBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)))) {
TOUCHground = true;
if (((speedY >= 0) && (_parent.SoftBoundary.DigitBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true))) || ((speedY >= 0) && (_parent.HardBoundary.DigitBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)))) {
TOUCHdigit = true;
changedirarmed = true;
} else {
TOUCHdigit = false;
if (changedirarmed == true) {
faceXDIR = faceXDIR * -1;
changedirarmed = false;
}
}
} else {
TOUCHground = false;
TOUCHdigit = false;
if (changedirarmed == true) {
faceXDIR = faceXDIR * -1;
changedirarmed = false;
}
}
if ((faceXDIR > 0) && (_parent.HardBoundary.hitTest((((((charsensorX + charX) + offsetX) + (charWIDTH * 0.5)) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.25)) * worldYSCALEinit) / 100) + worldYinit, true))) {
TOUCHwallright = true;
faceXDIR = faceXDIR * -1;
} else {
TOUCHwallright = false;
}
if ((faceXDIR < 0) && (_parent.HardBoundary.hitTest((((((charsensorX + charX) + offsetX) - (charWIDTH * 0.5)) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.25)) * worldYSCALEinit) / 100) + worldYinit, true))) {
TOUCHwallleft = true;
faceXDIR = faceXDIR * -1;
} else {
TOUCHwallleft = false;
}
if (_parent.HardBoundary.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) - (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHceiling = true;
} else {
TOUCHceiling = false;
}
if (_parent.Water.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, ((((charsensorY + charY) + offsetY) * worldYSCALEinit) / 100) + worldYinit, true)) {
TOUCHwater = true;
} else {
TOUCHwater = false;
}
if (_parent.Spring.hitTest(((((charsensorX + charX) + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charsensorY + charY) + offsetY) + (charHEIGHT * 0.5)) * worldYSCALEinit) / 100) + worldYinit, true) && (speedY >= 0)) {
TOUCHspring = true;
} else {
TOUCHspring = false;
}
if ((((environmentchecker == "air") && (TOUCHwater == true)) && (Math.abs(speedY) < duckpaddleFALLSPEED)) || (environment == "duckpaddle")) {
environment = "duckpaddle";
} else if (((((TOUCHwater == true) && (TOUCHground == true)) || ((TOUCHwater == true) && (TOUCHceiling == true))) || ((TOUCHwater == true) && (TOUCHwallleft == true))) || ((TOUCHwater == true) && (TOUCHwallright == true))) {
environment = "watergrounded";
} else if ((TOUCHwater == true) && (speedY < 0)) {
environment = "swimmingupward";
} else if (((TOUCHwater == true) && (TOUCHground == false)) && (speedY >= 0)) {
environment = "swimmingdownward";
} else if ((TOUCHspring == true) && (speedY >= 0)) {
environment = "sprung";
} else if ((TOUCHground == true) && (speedY >= 0)) {
environment = "grounded";
} else if (speedY < 0) {
environment = "flying";
} else if ((TOUCHground == false) && (speedY >= 0)) {
environment = "falling";
}
if (((this.rocksloaded > 0) && (throwarmed == true)) && (triggerTHROW == true)) {
_parent.rocksthrown = _parent.rocksthrown + 1;
if (triggerUP == true) {
_parent.attachMovie("Rock 1", "rock" + _parent.rocksthrown, 100 + _parent.rocksthrown, {_x:charsensorX + charX, _y:(charsensorY + charY) - ((charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEup * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEup * DEGtoRAD) * throwrate) - speedY});
} else if (triggerDOWN == true) {
_parent.attachMovie("Rock 1", "rock" + _parent.rocksthrown, 100 + _parent.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * faceX), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEdown * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEdown * DEGtoRAD) * throwrate) - speedY});
} else {
_parent.attachMovie("Rock 1", "rock" + _parent.rocksthrown, 100 + _parent.rocksthrown, {_x:(charsensorX + charX) + (((charWIDTH / 2) + 1) * faceX), _y:charsensorY + charY, throwspeedX:((Math.sin(throwANGLEforward * DEGtoRAD) * throwrate) * faceX) + speedX, throwspeedY:(Math.cos(throwANGLEforward * DEGtoRAD) * throwrate) - speedY});
}
oldrock = _parent.rocksthrown - rocksMAX;
_parent["rock" + _parent.oldrock].removeMovieClip();
this.rocksloaded = this.rocksloaded - 1;
throwarmed = false;
} else if ((!triggerTHROW) == true) {
throwarmed = true;
} else {
throwarmed = false;
}
if (environment == "grounded") {
if ((environmentchecker != "bellyslide") && (environmentchecker != "nosedivebounce")) {
movementhyp = moverate / Math.pow(Math.pow(dr - dl, 2) + Math.pow(slopesensorDISTANCE, 2), 0.5);
if ((triggerRIGHT == true) && (TOUCHwallright == false)) {
moveX = movementhyp * slopesensorDISTANCE;
moveY = movementhyp * (-Math.abs(dr - dl));
faceX = 1;
} else if ((triggerLEFT == true) && (TOUCHwallleft == false)) {
moveX = movementhyp * (-slopesensorDISTANCE);
moveY = movementhyp * (-Math.abs(dr - dl));
faceX = -1;
} else {
moveX = 0;
moveY = 0;
}
}
if ((triggerJUMP == true) && (jumparmed == true)) {
jumpX = 0;
jumpY = jumprateY;
gspeedX = 0;
gspeedY = 0;
moveY = 0;
movespeedY = 0;
jumparmed = false;
} else {
jumpX = 0;
jumpY = 0;
if ((!triggerJUMP) == true) {
jumparmed = true;
}
}
} else if ((environment == "wallslide") || (environmentchecker == "wallsliding")) {
if ((triggerJUMP == true) && (jumparmed == true)) {
jumpX = 0;
jumpY = jumprateY;
gspeedX = 0;
gspeedY = 0;
if (triggerRIGHT == true) {
moveX = -moverate;
} else if (triggerLEFT == true) {
moveX = moverate;
}
moveY = 0;
movespeedY = 0;
jumparmed = false;
walljumpTIMER = walljumpTIME;
} else {
jumpX = 0;
jumpY = 0;
if ((!triggerJUMP) == true) {
jumparmed = true;
}
}
} else if ((environment == "flying") || (environment == "falling")) {
if (walljumpTIMER <= 0) {
if (environmentchecker != "bellyslide") {
if ((triggerRIGHT == true) && (TOUCHwallright == false)) {
moveX = moverate;
faceX = 1;
} else if ((triggerLEFT == true) && (TOUCHwallleft == false)) {
moveX = -moverate;
faceX = -1;
} else {
moveX = 0;
}
} else {
moveX = 0;
}
walljumpTIMER = 0;
} else {
walljumpTIMER = walljumpTIMER - 1;
}
if (((triggerJUMP == true) && (jumparmed == true)) && (airjumpCOUNT > 0)) {
jumpspeedX = 0;
jumpspeedY = jumprateY;
gspeedX = 0;
gspeedY = 0;
moveY = 0;
movespeedY = 0;
jumparmed = false;
airjumpCOUNT = airjumpCOUNT - 1;
} else {
jumpX = 0;
jumpY = 0;
if ((!triggerJUMP) == true) {
jumparmed = true;
}
}
if (((((Key.isDown(_root.kJUMP) && (gspeedY <= jumpTHRESHOLD)) && ((dr + dl) == -2)) && (jumpspeedX == 0)) && (jumpspeedY == 0)) && (environment == "falling")) {
airjumpCOUNT = airjumpsMAX;
}
} else if ((((environment == "duckpaddle") || (environment == "swimmingupward")) || (environment == "swimmingdownward")) || (environment == "watergrounded")) {
if (((triggerRIGHT == true) && (triggerUP == true)) && (environment != "duckpaddle")) {
if ((charROT > -135) && (charROT <= 45)) {
if ((45 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-135 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((45 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-135 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((triggerRIGHT == true) && (triggerDOWN == true)) {
if ((charROT > -45) && (charROT <= 135)) {
if ((135 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-45 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((135 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-45 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if (((triggerLEFT == true) && (triggerUP == true)) && (environment != "duckpaddle")) {
if ((charROT >= -45) && (charROT < 135)) {
if ((-45 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (135 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((-45 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (135 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -45;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((triggerLEFT == true) && (triggerDOWN == true)) {
if ((charROT >= -135) && (charROT < 45)) {
if ((-135 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (45 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((-135 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (45 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -135;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (triggerRIGHT == true) {
if (environment == "duckpaddle") {
faceX = 1;
} else if ((charROT >= -90) && (charROT < 90)) {
if ((90 < (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (-90 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((90 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-90 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if (triggerLEFT == true) {
if (environment == "duckpaddle") {
faceX = -1;
} else if ((charROT > -90) && (charROT <= 90)) {
if ((90 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (-90 > (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = -90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((90 > (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (-90 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = -90;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if ((triggerUP == true) && (environment != "duckpaddle")) {
if (faceX > 0) {
if ((0 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) && (-180 < (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 0;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((0 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) && (180 > (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 0;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else if (triggerDOWN == true) {
if (environment == "duckpaddle") {
swimX2 = swimX2 / duckpaddleRATIO;
swimY2 = swimY2 / duckpaddleRATIO;
environment = "swimmingdownward";
}
if (faceX < 0) {
if ((0 <= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag))) || (-180 >= (charROT + ((swimspinspeed - swimspinrate) / swimspindrag)))) {
charROT = 180;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = -swimspinrate;
}
} else if ((0 >= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag))) || (180 <= (charROT + ((swimspinspeed + swimspinrate) / swimspindrag)))) {
charROT = 180;
swimspin = 0;
swimspinspeed = 0;
} else {
swimspin = swimspinrate;
}
} else {
swimspin = 0;
}
if ((swimspeedX > 0) && (environment != "duckpaddle")) {
faceX = 1;
} else if ((swimspeedX < 0) && (environment != "duckpaddle")) {
faceX = -1;
}
if ((triggerJUMP == true) && (swimarmed == true)) {
if (((triggerUP == true) && (environment == "duckpaddle")) && (duckjumparmed == true)) {
while (Water.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((charY + offsetY) * worldYSCALEinit) / 100) + worldYinit, true)) {
charY = charY - 1;
}
jumpX = jumprateX;
jumpY = jumprateY;
environment = "duckjump";
environmentchecker = "duckjump";
duckjumparmed = false;
swimarmed = false;
} else if ((((environment == "duckpaddle") && (speedX == 0)) || (((environment == "duckpaddle") && (speedX > 0)) && (TOUCHwallright == false))) || (((environment == "duckpaddle") && (speedX < 0)) && (TOUCHwallleft == false))) {
if (((speedY == 0) || ((speedY > 0) && (TOUCHground == false))) || ((speedY < 0) && (TOUCHceiling == false))) {
swimX = swimrateX / duckpaddleRATIO;
swimY = swimrateY / duckpaddleRATIO;
swimarmed = false;
}
} else if (((speedX == 0) || ((speedX > 0) && (TOUCHwallright == false))) || ((speedX < 0) && (TOUCHwallleft == false))) {
if (((speedY == 0) || ((speedY > 0) && (TOUCHground == false))) || ((speedY < 0) && (TOUCHceiling == false))) {
swimX = swimrateX;
swimY = swimrateY;
swimarmed = false;
}
}
} else {
swimX = 0;
swimY = 0;
}
if ((!triggerJUMP) == true) {
swimarmed = true;
duckjumparmed = true;
}
}
if (environment == "duckpaddle") {
charROT = 90 * faceX;
if (airspinspeed != 0) {
swimspinspeed = swimspinspeed + airspinspeed;
airspinspeed = 0;
}
airspin = 0;
if ((charROT > 100) || (charROT < -100)) {
if ((environmentchecker != "water") && (environmentchecker != "duckpaddle")) {
swimI = swimI + (Math.abs(movespeedX) / 3);
}
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
gspeedX = 0;
gspeedY = 0;
gravityX = 0;
gravityY = 0;
windX = watercurrentrateX;
windY = 0;
if ((environmentchecker != "water") && (environmentchecker != "duckpaddle")) {
swimY = 0;
swimY2 = 0;
}
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
environmentchecker = "duckpaddle";
} else if ((environment == "swimmingupward") || (environment == "swimmingdownward")) {
if (airspinspeed != 0) {
swimspinspeed = swimspinspeed + airspinspeed;
airspinspeed = 0;
}
airspin = 0;
if ((charROT > 100) || (charROT < -100)) {
if (environmentchecker != "water") {
swimI = swimI + ((Math.abs(movespeedX) / 3) + (gspeedY / 3));
gspeedY = 0;
}
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = gravityrateX;
gravityY = gravityrateY;
windX = watercurrentrateX;
windY = watercurrentrateY;
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
swimY2 = swimY2 / swimdragY;
swimI = swimI / swimdragY;
gspeedX = gspeedX / waterdragX;
gspeedY = gspeedY / waterdragY;
environmentchecker = "water";
} else if (environment == "watergrounded") {
if (((Math.abs(swimX2) >= swimcollideMAX) || (Math.abs(swimY2) >= swimcollideMAX)) || (Math.abs(swimI) >= swimcollideMAX)) {
swimX2 = Math.min(swimX2, swimcollideMAX);
swimY2 = Math.min(swimY2, swimcollideMAX);
swimI = Math.min(swimI, swimcollideMAX);
} else if (((Math.abs(swimX2) >= 0.25) || (Math.abs(swimY2) >= 0.25)) || (Math.abs(swimI) >= 0.25)) {
swimX2 = swimX2 / watergroundfriction;
swimY2 = swimY2 / watergroundfriction;
swimI = swimI / watergroundfriction;
}
movespeedX = 0;
movespeedY = 0;
moveX = 0;
moveY = 0;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
jumpspeedX = 0;
jumpspeedY = 0;
jumpX = 0;
jumpY = 0;
airjumpCOUNT = airjumpsMAX;
windX = 0;
windY = 0;
swimspinspeed = swimspinspeed / swimspindrag;
swimX2 = swimX2 / swimdragX;
swimY2 = swimY2 / swimdragY;
movespeedX = movespeedX / waterdragX;
movespeedY = movespeedY / waterdragY;
environmentchecker = "waterground";
} else if ((environment == "flying") || (environment == "falling")) {
charROT = 0;
if ((dr == -1) && (dl == -1)) {
moveY = 0;
movespeedY = 0;
}
if (swimspinspeed != 0) {
airspinspeed = airspinspeed + swimspinspeed;
swimspinspeed = 0;
}
swimspin = 0;
if (((swimX2 != 0) || (swimY2 != 0)) || (swimI != 0)) {
if (environmentchecker == "duckjump") {
swimX2 = swimX2 / duckjumpRATIO;
swimI = swimI / duckjumpRATIO;
}
jumpspeedX = jumpspeedX + (Math.sin(charROT * DEGtoRAD) * swimX2);
if (environmentchecker != "duckjump") {
jumpspeedY = jumpspeedY + Math.min(Math.cos(charROT * DEGtoRAD) * (swimX2 + swimI), swimspeedMAXTRANSFER);
}
}
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
gravityX = gravityrateX;
gravityY = gravityrateY;
windX = windrateX;
windY = windrateY;
if (environment == "flying") {
jumpX = 0;
jumpY = 0;
}
airspinspeed = airspinspeed / airspindrag;
if (environmentchecker != "bellyslide") {
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
} else {
movespeedX = movespeedX / slidedragX;
movespeedY = movespeedY / slidedragY;
}
if (environmentchecker == "nosedivebounce") {
airspin = 0;
if (Math.abs(charROT) < 5) {
charROT = 0;
environmentchecker = ((gspeedY > (jumpspeedY * 2)) ? "air" : "nosedivebounce");
}
}
if (((((environmentchecker == "water") && (triggerRIGHT == true)) && ((!triggerUP) == true)) && ((!triggerDOWN) == true)) || ((((environmentchecker == "water") && (triggerLEFT == true)) && ((!triggerUP) == true)) && ((!triggerDOWN) == true))) {
environmentchecker = "porpoising";
} else if (((environmentchecker != "porpoising") && (environmentchecker != "bellyslide")) && (environmentchecker != "nosedivebounce")) {
environmentchecker = "air";
}
} else if (environment == "wallslide") {
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 1;
swimspin = 0;
swimspinspeed = 0;
airspin = 0;
airspinspeed = 0;
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
environmentchecker = "wallsliding";
} else if (environment == "grounded") {
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
swimspin = 0;
swimspinspeed = 0;
airspin = 0;
airspinspeed = 0;
swimX2 = 0;
swimY2 = 0;
swimI = 0;
swimX = 0;
swimY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
if (environmentchecker != "bellyslide") {
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
bellyslideTIME = 0;
} else {
if ((dr - dl) != 0) {
moveX = (((sliderate * slopesensorDISTANCE) / Math.sqrt(Math.pow(dl - dr, 2) + Math.pow(slopesensorDISTANCE, 2))) * (dl - dr)) / Math.abs(dl - dr);
moveY = (sliderate * (-Math.abs(dr - dl))) / Math.sqrt(Math.pow(dr - dl, 2) + Math.pow(slopesensorDISTANCE, 2));
} else {
moveX = 0;
moveY = 0;
}
movespeedX = movespeedX / slidedragX;
movespeedY = movespeedY / slidedragY;
}
if (((((charROT < 89) && (charROT > -89)) && (environmentchecker != "bellyslide")) || ((((environmentchecker == "bellyslide") && (Math.abs(movespeedX) <= slidespeedMIN)) && (Math.abs(dr - dl) <= 0)) && (bellyslideTIME > 100))) || (((environmentchecker == "bellyslide") && (charROT < 30)) && (charROT > -30))) {
charY = charY - ((initHEIGHT - charHEIGHT) / 2);
charROT = 0;
environmentchecker = "ground";
} else if (((charROT < 165) && (charROT > -165)) || (((environmentchecker == "bellyslide") && (charROT < 30)) && (charROT > -30))) {
charY = charY - ((initWIDTH - charHEIGHT) / 2);
charWIDTH = initWIDTH;
charHEIGHT = initWIDTH;
if (environmentchecker != "bellyslide") {
charROT = ((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD);
} else if (charROT != (((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD))) {
slopeDIFFERENCE = (((90 * charROT) / Math.abs(charROT)) + (Math.atan((dl - dr) / slopesensorDISTANCE) / DEGtoRAD)) - charROT;
charROT = charROT + (slopeDIFFERENCE / 2);
}
bellyslideTIME = bellyslideTIME + 1;
environmentchecker = "bellyslide";
if ((((jumpspeedY == 0) && ((oldslopeANGLE * slopeANGLE) <= 0)) && (oldslopeANGLE != 0)) || (((jumpspeedY == 0) && ((oldslopeANGLE * slopeANGLE) <= 0)) && (slopeANGLE != 0))) {
if (((oldslopeANGLE > 0) && (speedX > 0)) || ((oldslopeANGLE < 0) && (speedX < 0))) {
moveY = 0;
movespeedY = 0;
gspeedY = 0;
rampjumpY = (sliderampBOOST * Math.abs(speedX)) * Math.cos(oldslopeANGLE * DEGtoRAD);
jumpY = ((rampjumpY > 0) ? rampjumpY : 0);
} else {
moveY = 0;
movespeedY = 0;
}
}
} else {
charY = charY - ((initHEIGHT - charHEIGHT) / 2);
charROT = 180;
if (environmentchecker != "nosedivebounce") {
nosedivebounceSTART = getTimer() / 1000;
environmentchecker = "nosedivebounce";
}
if ((triggerJUMP == true) && (jumparmed == true)) {
airspin = airspin + (nosediveBOUNCEspinrate * faceX);
jumpX = nosedivejumprateX * faceX;
jumpY = nosedivejumprateY;
environmentchecker = "nosedivebounce";
moveY = 0;
movespeedY = 0;
jumparmed = false;
} else {
jumpX = 0;
jumpY = 0;
if ((!triggerJUMP) == true) {
jumparmed = true;
}
}
nosedivebounceTIMER = (getTimer() / 1000) - nosedivebounceSTART;
if (nosedivebounceTIMER >= nosedivebounceTIME) {
airspin = airspin + (nosediveBOUNCEspinrate * faceX);
jumpX = nosediveBOUNCEXrate * faceX;
jumpY = nosediveBOUNCEYrate;
}
}
} else if (environment == "sprung") {
swimX2 = 0;
swimY2 = 0;
swimI = 0;
jumpspeedX = 0;
jumpspeedY = 0;
airjumpCOUNT = airjumpsMAX;
if (TOUCHwater == false) {
jumpX = springrateX;
jumpY = springrateY;
swimX = 0;
swimY = 0;
} else {
swimX = springrateX;
swimY = springrateY;
jumpX = 0;
jumpY = 0;
}
gravityX = 0;
gravityY = 0;
gspeedX = 0;
gspeedY = 0;
windX = 0;
windY = 0;
windspeedX = 0;
windspeedY = 0;
movespeedX = movespeedX / movedragX;
movespeedY = movespeedY / movedragY;
environmentchecker = "sprung";
}
movespeedX = movespeedX + moveX;
jumpspeedX = jumpspeedX + jumpX;
swimX2 = swimX2 + swimX;
if ((charROT == 180) || (charROT == -180)) {
swimspeedX = 0;
} else {
swimspeedX = Math.sin(charROT * DEGtoRAD) * (swimX2 + swimI);
}
gspeedX = gspeedX + gravityX;
windspeedX = windX;
movespeedY = movespeedY + moveY;
jumpspeedY = jumpspeedY + jumpY;
swimY2 = swimY2 + swimY;
swimspeedY = Math.cos(charROT * DEGtoRAD) * (swimY2 + swimI);
gspeedY = gspeedY + gravityY;
windspeedY = windY;
if (Math.abs(movespeedX) < 0.1) {
movespeedX = 0;
}
if (Math.abs(movespeedY) < 0.1) {
movespeedY = 0;
}
speedX = (((movespeedX + jumpspeedX) + swimspeedX) - gspeedX) + windspeedX;
speedY = ((((-movespeedY) - jumpspeedY) - swimspeedY) + gspeedY) - windspeedY;
if (speedX > speedXMAX) {
speedX = speedX - (speedX - speedXMAX);
} else if (speedX < (-speedXMAX)) {
speedX = speedX + (speedXMAX - speedX);
}
if (speedY > speedYMAX) {
speedY = speedY - (speedY - speedYMAX);
} else if (speedY < (-speedYMAX)) {
speedY = speedY + (speedYMAX - speedY);
}
if (Math.abs(speedX) < speedMINX) {
speedX = 0;
}
if (Math.abs(speedY) < speedMINY) {
speedY = 0;
}
charX = charX + speedX;
charY = charY + speedY;
swimspinspeed = swimspinspeed + swimspin;
airspinspeed = airspinspeed + airspin;
speedROT = swimspinspeed + airspinspeed;
charROT = charROT + speedROT;
if (charROT > 180) {
charROT = charROT - 360;
} else if (charROT < -180) {
charROT = charROT + 360;
}
if (((speedX == 0) && (speedY == 0)) && (speedROT == 0)) {
charACTION = false;
} else {
charACTION = true;
}
if (charACTION == true) {
if (speedY > 0) {
d = 1;
while (d <= floorpushes) {
if (((!_parent.SoftBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true)) && (!_parent.HardBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true))) && (!_parent.Spring.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * dHEIGHT)) - d) * worldYSCALEinit) / 100) + worldYinit, true))) {
charY = charY - (d - 1);
break;
}
d++;
}
} else if (speedY < 0) {
u = 1;
while (u <= floorpushes) {
if (!_parent.HardBoundary.hitTest((((charX + offsetX) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) - (charHEIGHT * uHEIGHT)) + u) * worldYSCALEinit) / 100) + worldYinit, true)) {
charY = charY + (u - 1);
break;
}
movespeedY = 0;
jumpspeedY = 0;
gspeedY = 0;
u++;
}
}
if (speedX > 0) {
r = 1;
while (r <= floorpushes) {
if (!_parent.HardBoundary.hitTest((((((charX + offsetX) + (charWIDTH * rWIDTH)) - r) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) + (charHEIGHT * rHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX - (r - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
r++;
}
if (environmentchecker != "bellysliding") {
ur = 1;
while (ur <= floorpushes) {
if (!_parent.HardBoundary.hitTest((((((charX + offsetX) + (charWIDTH * urWIDTH)) - ur) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) - (charHEIGHT * urHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX - (ur - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
ur++;
}
}
}
if (speedX < 0) {
l = 1;
while (l <= floorpushes) {
if (!_parent.HardBoundary.hitTest((((((charX + offsetX) - (charWIDTH * lWIDTH)) + l) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) + (charHEIGHT * lHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX + (l - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
l++;
}
if (environmentchecker != "bellysliding") {
ul = 1;
while (ul <= floorpushes) {
if (!_parent.HardBoundary.hitTest((((((charX + offsetX) - (charWIDTH * ulWIDTH)) + ul) * worldXSCALEinit) / 100) + worldXinit, ((((charY + offsetY) - (charHEIGHT * ulHEIGHT)) * worldYSCALEinit) / 100) + worldYinit, true)) {
charX = charX + (ul - 1);
break;
}
movespeedX = 0;
jumpspeedX = 0;
ul++;
}
}
}
}
oldslopeANGLE = slopeANGLE;
if ((((charACTION == true) && (oldTOUCHdigit == false)) && (digitMODE == "constant")) || ((charACTION == true) && (digitMODE != "constant"))) {
dr = 0;
while (dr <= floorpushes) {
if ((!_parent.SoftBoundary.hitTest(((((charX + offsetX) + (slopesensorDISTANCE / 2)) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dr) * worldYSCALEinit) / 100) + worldYinit, true)) && (!_parent.HardBoundary.hitTest(((((charX + offsetX) + slopesensorDISTANCE) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dr) * worldYSCALEinit) / 100) + worldYinit, true))) {
dr = dr - 1;
break;
}
dr++;
}
dl = 0;
while (dl <= floorpushes) {
if ((!_parent.SoftBoundary.hitTest(((((charX + offsetX) - (slopesensorDISTANCE / 2)) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dl) * worldYSCALEinit) / 100) + worldYinit, true)) && (!_parent.HardBoundary.hitTest(((((charX + offsetX) - slopesensorDISTANCE) * worldXSCALEinit) / 100) + worldXinit, (((((charY + offsetY) + (charHEIGHT * 0.75)) - dl) * worldYSCALEinit) / 100) + worldYinit, true))) {
dl = dl - 1;
break;
}
dl++;
}
slopeANGLE = Math.atan((dr - dl) / slopesensorDISTANCE) / DEGtoRAD;
if ((TOUCHdigit == true) && (digitMODE == "restricted")) {
slopeANGLE = Math.round(slopeANGLE / digitARCLENGTH) * digitARCLENGTH;
if (slopeANGLE > 0) {
dr = Math.abs((Math.tan(slopeANGLE * DEGtoRAD) * slopesensorDISTANCE) / 2);
dl = -dr;
} else {
dr = -Math.abs((Math.tan(slopeANGLE * DEGtoRAD) * slopesensorDISTANCE) / 2);
dl = -dr;
}
}
}
if ((((TOUCHground == true) && (TOUCHdigit == false)) || ((jumpspeedY < gspeedY) && (jumpspeedY > 0))) || ((jumpspeedY == 0) && (gspeedY > jumpTHRESHOLD))) {
oldTOUCHdigit = false;
} else {
oldTOUCHdigit = true;
}
totalspeed = Math.pow(Math.pow(speedX, 2) + Math.pow(speedY, 2), 0.5);
frameloops++;
}
worldX = _parent._x;
worldY = _parent._y;
worldROT = _parent._rotation;
worldXSCALE = _parent._xscale;
worldYSCALE = _parent._yscale;
this._x = charX;
this._y = charY;
this._rotation = charROT;
this.sensor._x = charsensorX;
this.sensor._y = charsensorY;
this.sensor._width = charsensorWIDTH;
this.sensor._height = charsensorHEIGHT;
if (faceX > 0) {
this._xscale = 100;
} else if (faceX < 0) {
this._xscale = -100;
}
};
Instance of Symbol 81 MovieClip "sensor" in Symbol 177 MovieClip [Koopa Troopa 1] Frame 1
onClipEvent (load) {
_visible = false;
_parent.stop();
bubbles = 0;
bubbletime = 2;
bubbleSCALEMIN = 100;
bubbleSCALEMAX = 400;
bubblesMAX = 50;
bubbleLOOPS = 5;
bubbleSPEEDSPAWN = 5 * bubbleLOOPS;
}
onClipEvent (enterFrame) {
if (_parent.charALIVE == false) {
_parent.gotoAndStop("Dead");
} else if (_parent.environment == "duckpaddle") {
if (Key.isDown(_root.kJUMP)) {
_parent.gotoAndStop("SurfaceSwimming-Flapping");
} else {
_parent.gotoAndStop("SurfaceSwimming");
}
} else if (((_parent.environment == "swimmingupward") || (_parent.environment == "swimmingdownward")) || (_parent.environment == "watergrounded")) {
if ((bubbletimeSTART + bubbletime) > (getTimer() / 1000)) {
bubbleloop = 1;
while (bubbleloop < bubbleLOOPS) {
if (random(Math.max(0, bubbleSPEEDSPAWN - (_parent.totalspeed * bubbleLOOPS))) == 0) {
bubbles = bubbles + 1;
bubbleSCALE = random(bubbleSCALEMAX - bubbleSCALEMIN) + bubbleSCALEMIN;
_parent.attachMovie("Bubble 1", "bubble" + bubbles, _parent.bubbledepth + bubbles, {_x:((((_x + (((_height / 2) * _parent.faceX) * Math.sin(_parent._rotation * _parent.DEGtoRAD))) + ((random(_width) - (_width / 2)) * Math.cos(_parent._rotation * _parent.DEGtoRAD))) * _parent._xscale) / 100) + _parent._x, _y:((((_y - ((_height / 2) * Math.cos(_parent._rotation * _parent.DEGtoRAD))) - ((random(_width) - (_width / 2)) * Math.sin(_parent._rotation * _parent.DEGtoRAD))) * _parent._yscale) / 100) + _parent._y, _xscale:bubbleSCALE, _yscale:bubbleSCALE, bubbleSCALE:bubbleSCALE});
}
bubbleloop++;
}
}
if (Key.isDown(_root.kJUMP)) {
_parent.gotoAndStop("Swimming-Flapping");
} else if ((Math.abs(_parent.swimspeedX) > _parent.gspeedY) || (Math.abs(_parent.swimspeedY) > _parent.gspeedY)) {
_parent.gotoAndStop("Swimming");
} else {
_parent.gotoAndStop("Sinking");
}
} else if ((_parent.jumpspeedY >= _parent.gspeedY) && (_parent.jumpspeedY > 0)) {
if (_parent.airjumpCOUNT == _parent.airjumpsMAX) {
_parent.gotoAndStop("Flying");
} else {
_parent.gotoAndStop("DoubleJumping");
}
} else if (((_parent.jumpspeedY < _parent.gspeedY) && (_parent.jumpspeedY > 0)) || ((_parent.jumpspeedY == 0) && (_parent.gspeedY > _parent.jumpTHRESHOLD))) {
_parent.gotoAndStop("Falling");
} else if (_parent.environment == "wallslide") {
_parent.gotoAndStop("Wallsliding");
} else if (((_parent.environmentchecker == "bellyslide") && (_parent.bellyslideTIME < 99)) || (((_parent.environmentchecker == "bellyslide") && (_parent.bellyslideTIME >= 99)) && (Math.abs(_parent.movespeedX) > _parent.slidespeedMIN))) {
_parent.gotoAndStop("BellySliding");
} else if (((_parent.environment == "grounded") && (_parent.charROT >= 165)) || ((_parent.environment == "grounded") && (_parent.charROT <= -165))) {
_parent.gotoAndStop("Nosedivebounce");
} else if (_parent.moveX != 0) {
_parent.gotoAndStop("Walking");
} else {
_parent.gotoAndStop("Standing");
}
if (((_parent.environment != "swimmingupward") && (_parent.environment != "swimmingdownward")) && (_parent.environment != "watergrounded")) {
bubbletimeSTART = getTimer() / 1000;
}
}
Symbol 180 MovieClip [Point Number] Frame 24
this.removeMovieClip();
Symbol 183 MovieClip [Point 1] Frame 1
onEnterFrame = function () {
if ((Math.abs((_parent.Player1.sensor._x + _parent.Player1._x) - _x) <= (_parent.Player1.sensor._width / 2)) && (Math.abs((_parent.Player1.sensor._y + _parent.Player1._y) - _y) <= (_parent.Player1.sensor._height / 2))) {
_parent.Player1.points = _parent.Player1.points + 1;
_parent.attachMovie("Point Number", "PointNumber" + _parent.Player1.points, _root.attachDEPTH, {_x:_x, _y:_y - 10, pointvalue:"+1"});
_root.attachDEPTH = _root.attachDEPTH + 1;
_root[(_root.level + "obtained") + this._name] = true;
_root.soundManager_mc.playSound("get cigs.wav", 0, 1);
this.removeMovieClip();
}
};
Symbol 191 MovieClip [textbubble] Frame 1
maxlength = textbox.text.length;
textarray = textcontent.split(" ");
lastword = 0;
pagenumber = 1;
while (pagenumber > 0) {
this["page" + pagenumber] = "";
word = lastword + 1;
while (word <= textarray.length) {
if ((this["page" + pagenumber].length == 0) && (textarray[word - 1].length > maxlength)) {
this["page" + pagenumber] = this["page" + pagenumber] + textarray[word - 1];
} else if ((this["page" + pagenumber].length + textarray[word - 1].length) <= maxlength) {
this["page" + pagenumber] = this["page" + pagenumber] + textarray[word - 1];
if ((this["page" + pagenumber].length + 1) <= maxlength) {
this["page" + pagenumber] = this["page" + pagenumber] + " ";
}
} else {
break;
}
lastword = word;
lastpage = pagenumber;
word++;
}
if (lastword >= textarray.length) {
break;
}
pagenumber++;
}
pagenumber = 1;
textbox.text = this["page" + pagenumber];
onEnterFrame = function () {
textbox.text = this["page" + pagenumber];
if ((armed == true) && (Key.isDown(_root.kSTART))) {
if (pagenumber < lastpage) {
pagenumber = pagenumber + 1;
armed = false;
} else {
_root.World.jumparmed = false;
_root.PAUSE = false;
_root.pauseEND = getTimer() / 1000;
_root.pauseTIME = _root.pauseTIME + (_root.pauseEND - _root.pauseSTART);
this.removeMovieClip();
}
} else if (!Key.isDown(_root.kSTART)) {
armed = true;
}
};
Symbol 195 MovieClip [Fireball] Frame 1
if (speedX == undefined) {
speedX = 0;
}
if (speedY == undefined) {
speedY = 0;
}
if (moverateINIT == undefined) {
moverateINIT = 1;
}
if (moverate == undefined) {
moverate = 0.005;
}
if (speedMAX == undefined) {
speedMAX = 2;
}
startTIME = getTimer() / 1000;
ageMAX = 12;
hitDISTANCE = 50;
DEGtoRAD = (Math.PI/180);
onEnterFrame = function () {
if ((((getTimer() / 1000) - startTIME) > ageMAX) || (_parent.Boss.charALIVE == false)) {
this.removeMovieClip();
}
this.Player1X = _parent.Player1._x;
this.Player1Y = _parent.Player1._y;
this.PlayerHEIGHT = _parent.Player1._height;
this.Player1WIDTH = _parent.Player1._width;
this.Player1XDIS = Player1X - _x;
this.Player1YDIS = Player1Y - _y;
this.Player1DIS = Math.pow(Math.pow(Player1XDIS, 2) + Math.pow(Player1YDIS, 2), 0.5);
if (((_parent.Player1.rocksloaded > 0) && (this.Player1DIS < this.hitDISTANCE)) && (_root.World.charBLINK == false)) {
this.throwANGLEdamaged = random(90) - 45;
this.throwratedamaged = 8;
_parent.Player1.rocksthrown = _parent.Player1.rocksthrown + 1;
_parent.attachMovie("Rock 1", "rock" + _parent.Player1.rocksthrown, 100 + _parent.Player1.rocksthrown, {_x:_parent.charsensorX + _parent.charX, _y:(_parent.charsensorY + _parent.charY) - ((_parent.charHEIGHT / 2) + 1), throwspeedX:((Math.sin(throwANGLEdamaged * DEGtoRAD) * throwratedamaged) * _parent.faceX) + _parent.speedX, throwspeedY:(Math.cos(throwANGLEdamaged * DEGtoRAD) * throwratedamaged) - _parent.speedY, weapon:false});
_parent.oldrock = _parent.Player1.rocksthrown - _parent.rocksMAX;
_parent["rock" + _parent.oldrock].removeMovieClip();
_parent.Player1.rocksloaded = _parent.Player1.rocksloaded - 1;
_root.World.charBLINK = true;
this.removeMovieClip();
} else if ((this.Player1DIS < this.hitDISTANCE) && (_root.World.charBLINK == false)) {
_root.World.charALIVE = false;
this.removeMovieClip();
}
engineloops = 0;
while (engineloops < _root.World.engineloops) {
if (moverateINIT != 0) {
speedX = speedX + ((moverateINIT * Player1XDIS) / Player1DIS);
speedY = speedY + ((moverateINIT * Player1YDIS) / Player1DIS);
moverateINIT = 0;
} else if ((type == "heatseeker") || (type == undefined)) {
speedX = speedX + ((moverate * Player1XDIS) / Player1DIS);
speedY = speedY + ((moverate * Player1YDIS) / Player1DIS);
}
totalspeed = Math.pow(Math.pow(speedX, 2) + Math.pow(speedY, 2), 0.5);
_x = (_x + speedX);
_y = (_y + speedY);
engineloops++;
}
};
Symbol 206 MovieClip [CrumblingBox] Frame 1
stop();
Symbol 215 MovieClip [BomberExplosion] Frame 10
this.removeMovieClip();
Symbol 240 MovieClip Frame 1
_root.stop();
this.levelname.text = this.textvalue;
onMouseDown = function () {
if ((this._visible == true) && (this.hitTest(_root._xmouse, _root._ymouse, true))) {
_root.soundManager_mc.playSound("Beep_Error06.wavsound", 0, 1);
_root.gotoAndPlay(this.linkvalue);
}
};
armed = false;
var buttonColor = new Color(this);
var mouseoverFlash = {ra:100, rb:100, ga:100, gb:100, ba:100, bb:100, aa:100, ab:0};
var normal = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
onEnterFrame = function () {
if ((Key.isDown(_root.kSTART) && (armed == true)) && (this.linkvalue == "Level 0A Start")) {
_root.soundManager_mc.playSound("Beep_Error06.wavsound", 0, 1);
_root.gamestartpoint = this._name;
_root.levelSTART = getTimer() / 1000;
_root.go = true;
_root.gotoAndPlay(this.linkvalue);
} else if (!Key.isDown(_root.kSTART)) {
armed = true;
}
if ((((_parent._xmouse > (this._x - (this._width / 2))) && (_parent._xmouse < (this._x + (this._width / 2)))) && (_parent._ymouse > (this._y - (this._height / 2)))) && (_parent._ymouse < (this._y + (this._height / 2)))) {
buttonColor.setTransform(mouseoverFlash);
} else {
buttonColor.setTransform(normal);
}
};
Symbol 241 MovieClip [deadalert] Frame 1
stop();
Instance of Symbol 240 MovieClip in Symbol 241 MovieClip [deadalert] Frame 1
onClipEvent (load) {
this.textvalue = "Menu";
this.linkvalue = "Game Start";
this.gotoAndStop("Menu");
}
Symbol 241 MovieClip [deadalert] Frame 2
_root.gotoAndPlay(_root.level + " Start");
this.removeMovieClip();
Symbol 242 MovieClip [puffexplosion] Frame 18
this.removeMovieClip();
Symbol 268 MovieClip [Sparkle] Frame 1
_root.soundManager_mc.playSound("Cartoon_OpenMagicBag2.wav", 0, 1);
Symbol 268 MovieClip [Sparkle] Frame 10
this.removeMovieClip();
Symbol 299 MovieClip Frame 1
stop();
Symbol 333 Button
on (release) {
play();
}
Symbol 371 MovieClip Frame 1
this.segment = 1;
_root.soundManager_mc.playSound("BreakfastCinematic.wav", 0, 9999999999);
Instance of Symbol 81 MovieClip in Symbol 371 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
this.skiparmed = false;
}
onClipEvent (enterFrame) {
_parent.nextsegment = _parent.segment + 1;
if (Key.isDown(_root.kSTART) && (this.skiparmed == true)) {
_parent.gotoAndPlay("segment" + _parent.nextsegment);
this.skiparmed = false;
} else if (!Key.isDown(_root.kSTART)) {
this.skiparmed = true;
}
}
Symbol 371 MovieClip Frame 136
stop();
Symbol 371 MovieClip Frame 137
this.segment = 2;
Symbol 371 MovieClip Frame 263
stop();
Symbol 371 MovieClip Frame 264
this.segment = 3;
_root.soundManager_mc.stopSound("BreakfastCinematic.wav");
Symbol 371 MovieClip Frame 265
_root.soundManager_mc.playSound("BreakfastIntroCinematic.wav", 0, 9999999999);
Symbol 371 MovieClip Frame 356
stop();
Symbol 371 MovieClip Frame 357
this.segment = 4;
Symbol 371 MovieClip Frame 396
stop();
Symbol 371 MovieClip Frame 397
this.segment = 5;
Symbol 371 MovieClip Frame 463
_root.go = true;
_parent.play();
Symbol 376 MovieClip Frame 1
onEnterFrame = function () {
if (_root.World.Player1.keyred == this.keynumber) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
}
};
Instance of Symbol 376 MovieClip in Symbol 378 MovieClip Frame 1
onClipEvent (enterFrame) {
this.keynumber = 1;
}
Symbol 381 MovieClip Frame 1
onEnterFrame = function () {
if (_root.World.Player1.keyblue == 1) {
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
}
};
Symbol 383 MovieClip Frame 1
onEnterFrame = function () {
if ((_parent._parent.environment == "grounded") && (this.hitTest((((_parent._parent.Player1._x + _parent._parent.offsetX) * _parent._parent._xscale) / 100) + _parent._parent._x, ((((_parent._parent.Player1._y + _parent._parent.offsetY) + (_parent._parent.charHEIGHT * 0.5)) * _parent._parent._yscale) / 100) + _parent._parent._y, true))) {
_parent._parent.TOUCHtile = true;
} else {
_parent._parent.TOUCHtile = false;
}
};
Instance of Symbol 381 MovieClip in Symbol 384 MovieClip Frame 1
onClipEvent (enterFrame) {
this.keynumber = 1;
}
Symbol 393 MovieClip Frame 1
_name = "keyblue";
if (_root.died == false) {
_root[(((((("keyblue" + this.keynumber) + "LVL") + _root.level) + "x") + _x) + "y") + _y] == false;
}
onEnterFrame = function () {
if (((Math.abs((_root.World.Player1.sensor._x + _root.World.Player1._x) - _x) <= (_root.World.Player1.sensor._width / 2)) && (Math.abs((_root.World.Player1.sensor._y + _root.World.Player1._y) - _y) <= (_root.World.Player1.sensor._height / 2))) || (((_root[(((((("keyblue" + this.keynumber) + "LVL") + _root.level) + "x") + _x) + "y") + _y] == true) && (_root.died == true)) && (_root.levelselect == false))) {
_root.World.Player1.keyblue = this.keynumber;
this.play();
}
};
stop();
Symbol 393 MovieClip Frame 2
onEnterFrame = undefined;
_root[(((((("keyblue" + this.keynumber) + "LVL") + _root.level) + "x") + _x) + "y") + _y] = true;
_root.soundManager_mc.playSound("Pickup_Key10.wav", 0, 1);
stop();
Symbol 396 MovieClip Frame 1
_name = "keyred";
if (_root.died == false) {
_root[(((((("keyred" + this.keynumber) + "LVL") + _root.level) + "x") + _x) + "y") + _y] == false;
}
onEnterFrame = function () {
if (((Math.abs((_root.World.Player1.sensor._x + _root.World.Player1._x) - _x) <= (_root.World.Player1.sensor._width / 2)) && (Math.abs((_root.World.Player1.sensor._y + _root.World.Player1._y) - _y) <= (_root.World.Player1.sensor._height / 2))) || (((_root[(((((("keyred" + this.keynumber) + "LVL") + _root.level) + "x") + _x) + "y") + _y] == true) && (_root.died == true)) && (_root.levelselect == false))) {
_root.World.Player1.keyred = this.keynumber;
this.play();
}
};
stop();
Symbol 396 MovieClip Frame 2
onEnterFrame = undefined;
_root[(((((("keyred" + this.keynumber) + "LVL") + _root.level) + "x") + _x) + "y") + _y] = true;
_root.soundManager_mc.playSound("Pickup_Key10.wav", 0, 1);
stop();
Symbol 402 MovieClip Frame 1
_root.World.Barrels = _root.World.Barrels + 1;
this.filled = 0;
this.vulnerableDISTANCE = 35;
if (((_root[(((("BarrelFilledLVL" + _root.level) + "x") + _x) + "y") + _y] == true) && (_root.died == true)) && (_root.levelselect == false)) {
gotoAndStop (4);
} else {
_root[(((("BarrelFilledLVL" + _root.level) + "x") + _x) + "y") + _y] = false;
}
onEnterFrame = function () {
rockcheck = _parent.Player1.rocksthrown - _root.World.rocksMAX;
while (rockcheck <= _parent.Player1.rocksthrown) {
if (((this.filled < 3) && (_parent["rock" + rockcheck].weapon == true)) && (_parent["rock" + rockcheck] != undefined)) {
this[("rock" + rockcheck) + "currentXDIS"] = _parent["rock" + rockcheck]._x - this._x;
this[("rock" + rockcheck) + "currentYDIS"] = _parent["rock" + rockcheck]._y - this._y;
this[("rock" + rockcheck) + "currentDIS"] = Math.pow(Math.pow((this[("rock" + rockcheck) + "currentXDIS"] + this[("rock" + rockcheck) + "oldXDIS"]) / 2, 2) + Math.pow((this[("rock" + rockcheck) + "currentYDIS"] + this[("rock" + rockcheck) + "oldYDIS"]) / 2, 2), 0.5);
this[("rock" + rockcheck) + "avgDIS"] = Math.pow(Math.pow(this[("rock" + rockcheck) + "currentXDIS"], 2) + Math.pow(this[("rock" + rockcheck) + "currentYDIS"], 2), 0.5);
if ((this[("rock" + rockcheck) + "currentDIS"] < vulnerableDISTANCE) || (this[("rock" + rockcheck) + "avgDIS"] < vulnerableDISTANCE)) {
this.filled = this.filled + 1;
this.nextFrame();
_parent.attachMovie("puffexplosion", "puffexplosion" + rockcheck, _root.attachDEPTH, {_x:_parent["rock" + rockcheck]._x, _y:_parent["rock" + rockcheck]._y, _xscale:50, _yscale:50});
_root.attachDEPTH = _root.attachDEPTH + 1;
_parent["rock" + rockcheck].removeMovieClip();
}
this[("rock" + rockcheck) + "oldXDIS"] = this[("rock" + rockcheck) + "currentXDIS"];
this[("rock" + rockcheck) + "oldYDIS"] = this[("rock" + rockcheck) + "currentYDIS"];
this[("rock" + rockcheck) + "oldDIS"] = this[("rock" + rockcheck) + "currentDIS"];
}
rockcheck++;
}
};
stop();
Symbol 402 MovieClip Frame 4
_root.World.BarrelsFilled = _root.World.BarrelsFilled + 1;
_root[(((("BarrelFilledLVL" + _root.level) + "x") + _x) + "y") + _y] = true;
this.BarrelLabel = (_root.World.BarrelsFilled + "/") + _root.World.Barrels;
onEnterFrame = undefined;
this.nextFrame();
Symbol 412 MovieClip Frame 1
_root.endlevel = false;
this.skiplevelarmed = false;
sensorWIDTH = 50;
sensorHEIGHT = 100;
onEnterFrame = function () {
if ((((_root.World.Barrels <= _root.World.BarrelsFilled) && (_root.World.Barrels > 0)) || ((_root.World.Barrels == 0) && (skiplevelarmed == true))) || (((_root.PAUSE == false) && (Key.isDown(_root.kSKIPLEVEL))) && (skiplevelarmed == true))) {
this.Player1X = _root.World.Player1._x;
this.Player1Y = _root.World.Player1._y;
this.Player1XDIS = Math.abs(this.Player1X - this._x);
this.Player1YDIS = Math.abs(this.Player1Y - this._y);
if (((this.Player1XDIS < (sensorWIDTH / 2)) && (this.Player1YDIS < (sensorHEIGHT / 2))) || (Key.isDown(_root.kSKIPLEVEL) && (skiplevelarmed == true))) {
if (Key.isDown(_root.kSKIPLEVEL)) {
_root.cheats = true;
}
_root.endlevel = true;
_root.gotoAndPlay(_root.level + " Complete");
}
nextFrame();
} else if (!Key.isDown(_root.kSKIPLEVEL)) {
skiplevelarmed = true;
}
};
stop();
Symbol 419 MovieClip Frame 1
armed = true;
onEnterFrame = function () {
if ((((armed == true) && (_root.textbubble == undefined)) && (Math.abs((_parent.Player1.sensor._x + _parent.Player1._x) - _x) <= (_parent.Player1.sensor._width / 2))) && (Math.abs((_parent.Player1.sensor._y + _parent.Player1._y) - _y) <= (_parent.Player1.sensor._height / 2))) {
_root.PAUSE = true;
_root.pauseSTART = getTimer() / 1000;
_root.attachMovie("textbubble", "textbubble", _root.attachDEPTH, {_x:275, _y:75, textcontent:textcontent});
_root.attachDEPTH = _root.attachDEPTH + 1;
armed = false;
if (this.pushright == true) {
_parent.charX = _parent.charX + 50;
}
_root.Antifreezer = false;
} else if (((armed == false) && (Math.abs((_parent.Player1.sensor._x + _parent.Player1._x) - _x) > (_parent.Player1.sensor._width / 2))) || ((armed == false) && (Math.abs((_parent.Player1.sensor._y + _parent.Player1._y) - _y) > (_parent.Player1.sensor._height / 2)))) {
armed = true;
}
};
Symbol 456 MovieClip Frame 1
this.keynumber = 1;
onEnterFrame = function () {
if (_root.World.Player1.keyblue == this.keynumber) {
this._visible = true;
this.play();
}
};
stop();
Symbol 456 MovieClip Frame 18
onEnterFrame = undefined;
stop();
Symbol 459 MovieClip Frame 1
this.keynumber = 1;
onEnterFrame = function () {
if (_root.World.Player1.keyred == this.keynumber) {
this.play();
}
};
stop();
Symbol 459 MovieClip Frame 15
onEnterFrame = undefined;
stop();
Symbol 477 MovieClip Frame 6
stop();
Symbol 479 MovieClip Frame 6
stop();
Symbol 483 MovieClip Frame 6
stop();
Symbol 493 MovieClip Frame 28
_root.attachMovie("deadalert", "deadalert", _root.attachDEPTH, {_x:275, _y:200});
_root.attachDEPTH = _root.attachDEPTH + 1;
stop();
Instance of Symbol 81 MovieClip "sensor" in Symbol 494 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
_parent.stop();
bubbles = 0;
bubbletime = 2;
bubbleSCALEMIN = 100;
bubbleSCALEMAX = 400;
bubblesMAX = 50;
bubbleLOOPS = 5;
bubbleSPEEDSPAWN = 5 * bubbleLOOPS;
}
onClipEvent (enterFrame) {
if (_parent._parent.charALIVE == false) {
_parent.gotoAndStop("Dead");
} else if (_parent._parent.environment == "duckpaddle") {
if (Key.isDown(_root.kJUMP)) {
_parent.gotoAndStop("SurfaceSwimming-Flapping");
} else {
_parent.gotoAndStop("SurfaceSwimming");
}
} else if (((_parent._parent.environment == "swimmingupward") || (_parent._parent.environment == "swimmingdownward")) || (_parent._parent.environment == "watergrounded")) {
if ((bubbletimeSTART + bubbletime) > (getTimer() / 1000)) {
bubbleloop = 1;
while (bubbleloop < bubbleLOOPS) {
if (random(Math.max(0, bubbleSPEEDSPAWN - (_parent._parent.totalspeed * bubbleLOOPS))) == 0) {
bubbles = bubbles + 1;
bubbleSCALE = random(bubbleSCALEMAX - bubbleSCALEMIN) + bubbleSCALEMIN;
_parent._parent.attachMovie("Bubble 1", "bubble" + bubbles, _parent._parent.bubbledepth + bubbles, {_x:((((_x + (((_height / 2) * _parent._parent.faceX) * Math.sin(_parent._rotation * _parent._parent.DEGtoRAD))) + ((random(_width) - (_width / 2)) * Math.cos(_parent._rotation * _parent._parent.DEGtoRAD))) * _parent._xscale) / 100) + _parent._x, _y:((((_y - ((_height / 2) * Math.cos(_parent._rotation * _parent._parent.DEGtoRAD))) - ((random(_width) - (_width / 2)) * Math.sin(_parent._rotation * _parent._parent.DEGtoRAD))) * _parent._yscale) / 100) + _parent._y, _xscale:bubbleSCALE, _yscale:bubbleSCALE, bubbleSCALE:bubbleSCALE});
}
bubbleloop++;
}
}
if (Key.isDown(_root.kJUMP)) {
_parent.gotoAndStop("Swimming-Flapping");
} else if ((Math.abs(_parent._parent.swimspeedX) > _parent._parent.gspeedY) || (Math.abs(_parent._parent.swimspeedY) > _parent._parent.gspeedY)) {
_parent.gotoAndStop("Swimming");
} else {
_parent.gotoAndStop("Sinking");
}
} else if ((_parent._parent.jumpspeedY >= _parent._parent.gspeedY) && (_parent._parent.jumpspeedY > 0)) {
if (_parent._parent.airjumpCOUNT == _parent._parent.airjumpsMAX) {
_parent.gotoAndStop("Flying");
} else {
_parent.gotoAndStop("DoubleJumping");
}
} else if (((_parent._parent.jumpspeedY < _parent._parent.gspeedY) && (_parent._parent.jumpspeedY > 0)) || ((_parent._parent.jumpspeedY == 0) && (_parent._parent.gspeedY > _parent._parent.jumpTHRESHOLD))) {
_parent.gotoAndStop("Falling");
} else if (_parent._parent.environment == "wallslide") {
_parent.gotoAndStop("Wallsliding");
} else if (((_parent._parent.environmentchecker == "bellyslide") && (_parent._parent.bellyslideTIME < 99)) || (((_parent._parent.environmentchecker == "bellyslide") && (_parent._parent.bellyslideTIME >= 99)) && (Math.abs(_parent._parent.movespeedX) > _parent._parent.slidespeedMIN))) {
_parent.gotoAndStop("BellySliding");
} else if (((_parent._parent.environment == "grounded") && (_parent._parent.charROT >= 165)) || ((_parent._parent.environment == "grounded") && (_parent._parent.charROT <= -165))) {
_parent.gotoAndStop("Nosedivebounce");
} else if (_parent._parent.moveX != 0) {
_parent.gotoAndStop("Walking");
} else {
_parent.gotoAndStop("Standing");
}
if (((_parent._parent.environment != "swimmingupward") && (_parent._parent.environment != "swimmingdownward")) && (_parent._parent.environment != "watergrounded")) {
bubbletimeSTART = getTimer() / 1000;
}
}
Symbol 494 MovieClip Frame 3
_root.soundManager_mc.playSound("jump 1", 0, 1);
Symbol 494 MovieClip Frame 4
_root.soundManager_mc.playSound("bender_2xjump.aiff", 0, 1);
Symbol 494 MovieClip Frame 14
_root.soundManager_mc.playSound("jump2.wav", 0, 1);
Symbol 495 MovieClip Frame 1
_visible = false;
this.armed = true;
_root.World.points = _root.World.points + 1;
this.number = _root.World.points;
this.levelselectarmed = _root.levelselect;
if ((_root[(_root.level + "obtainedPoint") + this.number] == true) && (_root.levelselect == false)) {
_parent.Player1.points = _parent.Player1.points + 1;
} else {
onEnterFrame = function () {
if ((_root[(_root.level + "obtainedPoint") + this.number] != true) || (this.levelselectarmed == true)) {
if (this.levelselectarmed == true) {
_root[(_root.level + "obtainedPoint") + this.number] = false;
}
this.levelselectarmed = false;
if ((((this.armed == true) && (_root.World["Point" + this.number]._x == undefined)) && (Math.abs(_x - _parent.camera._x) < ((_parent.camera._width / 2) + _root.World.badguyDISTANCEMAX))) && (Math.abs(_y - _parent.camera._y) < (((_parent.camera._height / 2) + this._height) + _root.World.badguyDISTANCEMAX))) {
_root.World.attachMovie("Point 1", "Point" + this.number, _root.attachDEPTH, {_x:_x, _y:_y, pasted:true});
this.armed = false;
_root.attachDEPTH = _root.attachDEPTH + 1;
}
}
};
}
Symbol 498 MovieClip Frame 1
onEnterFrame = function () {
if ((((Math.abs((_parent.Player1.sensor._x + _parent.Player1._x) - _x) <= (_parent.Player1.sensor._width / 2)) && (Math.abs((_parent.Player1.sensor._y + _parent.Player1._y) - _y) <= (_parent.Player1.sensor._height / 2))) && (_parent.Player1.rocksloaded < (_parent.Player1.rocksloadedMAX + Math.floor(_root.World.Player1.points / 100)))) && (rockdroparmed == true)) {
_parent.Player1.rocksloaded = _parent.Player1.rocksloadedMAX + Math.floor(_root.World.Player1.points / 100);
rockdroparmed = false;
_parent.attachMovie("Rock Number", "rocknumber" + _parent.Player1.rocksloaded, 250, {_x:_x, _y:_y - 10, rocksloaded:_parent.Player1.rocksloaded});
} else if ((Math.abs((_parent.Player1.sensor._x + _parent.Player1._x) - _x) > (_parent.Player1.sensor._width / 2)) || (Math.abs((_parent.Player1.sensor._y + _parent.Player1._y) - _y) > (_parent.Player1.sensor._height / 2))) {
rockdroparmed = true;
} else {
rockdroparmed = false;
}
};
Instance of Symbol 378 MovieClip "HardBoundary" in Symbol 499 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 384 MovieClip "SoftBoundary" in Symbol 499 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 393 MovieClip in Symbol 499 MovieClip Frame 1
onClipEvent (load) {
this.keynumber = 1;
}
Instance of Symbol 396 MovieClip in Symbol 499 MovieClip Frame 1
onClipEvent (load) {
this.keynumber = 1;
}
Instance of Symbol 419 MovieClip in Symbol 499 MovieClip Frame 1
onClipEvent (load) {
this.textcontent = "Press \"space\" to jump. Use the \"arrow keys\" to move left or right.";
}
Instance of Symbol 419 MovieClip in Symbol 499 MovieClip Frame 1
onClipEvent (load) {
this.textcontent = "Jump onto a wall and press the arrow key in the wall's direction to \"slide\" on the wall. While sliding, press \"space\" to jump upward, off the wall.";
}
Instance of Symbol 419 MovieClip in Symbol 499 MovieClip Frame 1
onClipEvent (load) {
this.textcontent = "While in the air, you can press \"space\" once more to do a \"double jump.\"";
}
Instance of Symbol 419 MovieClip in Symbol 499 MovieClip Frame 1
onClipEvent (load) {
this.textcontent = "Congratulations, you've arrived at the end of your first stage, however it is not over yet! You must destroy those three security boxes to unlock the stage exit. Go pick up cherry bombs from the rockpile to the left, then press \"F\" to throw the cherry bombs at the security boxes. You can carry 1 extra cherry bomb for every 100 packs of cigarettes collected. Light up!";
}
Instance of Symbol 419 MovieClip in Symbol 499 MovieClip Frame 1
onClipEvent (load) {
this.textcontent = "You can press \"up\" or \"down\" while throwing to change the trajectory of your rock. Try to fill these two barrels without jumping.";
this.pushright = true;
}
Symbol 505 MovieClip Frame 1
onEnterFrame = function () {
if ((_root.PAUSE == true) && (_root.textbubble == undefined)) {
_visible = true;
} else {
_visible = false;
}
};
Instance of Symbol 503 MovieClip in Symbol 506 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
variablechecked = 0;
}
onClipEvent (enterFrame) {
if (variablechecked < Math.abs(_root.World.speedX)) {
variablechecked = Math.abs(_root.World.speedX);
}
if (Key.isToggled(20) && (_root.devinfo == true)) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 503 MovieClip in Symbol 506 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
onClipEvent (enterFrame) {
variablechecked = _root.World.environment;
if (Key.isToggled(20) && (_root.devinfo == true)) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 503 MovieClip in Symbol 506 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
variablechecked = 0;
}
onClipEvent (enterFrame) {
if (variablechecked < Math.abs(_root.World.gspeedY)) {
variablechecked = Math.abs(_root.World.gspeedY);
}
if (Key.isToggled(20) && (_root.devinfo == true)) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 503 MovieClip in Symbol 506 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
onClipEvent (enterFrame) {
variablechecked = _root.World.recentFPSoutput;
if (Key.isToggled(20) && (_root.devinfo == true)) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 503 MovieClip in Symbol 506 MovieClip Frame 1
onClipEvent (load) {
variablechecked = 0;
}
onClipEvent (enterFrame) {
variablechecked = (_root.World.Player1.points + "/") + _root.World.points;
}
Instance of Symbol 503 MovieClip in Symbol 506 MovieClip Frame 1
onClipEvent (load) {
variablechecked = 0;
}
onClipEvent (enterFrame) {
variablechecked = (_root.World.BarrelsFilled + "/") + _root.World.Barrels;
}
Instance of Symbol 503 MovieClip in Symbol 506 MovieClip Frame 1
onClipEvent (load) {
variablechecked = 0;
this.rocksloadedMAX = _root.World.Player1.rocksloadedMAX;
}
onClipEvent (enterFrame) {
if (this.rocksloadedMAX < (_root.World.Player1.rocksloadedMAX + Math.floor(_root.World.Player1.points / 100))) {
this.rocksloadedMAX = _root.World.Player1.rocksloadedMAX + Math.floor(_root.World.Player1.points / 100);
_root.World.Player1.rocksloaded = _root.World.Player1.rocksloaded + 1;
_parent.attachMovie("Sparkle", "Sparkle", _root.attachDEPTH, {_x:_parent.cherryicon._x, _y:_parent.cherryicon._y});
_root.attachDEPTH = _root.attachDEPTH + 1;
}
variablechecked = (_root.World.Player1.rocksloaded + "/") + this.rocksloadedMAX;
}
Instance of Symbol 505 MovieClip in Symbol 506 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 528 MovieClip Frame 1
onEnterFrame = function () {
if (_root.World.Player1.keyred == this.keynumber) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
}
};
Instance of Symbol 528 MovieClip in Symbol 529 MovieClip Frame 1
onClipEvent (enterFrame) {
this.keynumber = 1;
}
Symbol 532 MovieClip Frame 1
onEnterFrame = function () {
if ((_parent._parent.environment == "grounded") && (this.hitTest((((_parent._parent.Player1._x + _parent._parent.offsetX) * _parent._parent._xscale) / 100) + _parent._parent._x, ((((_parent._parent.Player1._y + _parent._parent.offsetY) + (_parent._parent.charHEIGHT * 0.5)) * _parent._parent._yscale) / 100) + _parent._parent._y, true))) {
_parent._parent.TOUCHtile = true;
} else {
_parent._parent.TOUCHtile = false;
}
};
Symbol 536 MovieClip Frame 1
_visible = false;
this.armed = true;
_root.World.AttackDogs = _root.World.AttackDogs + 1;
this.number = _root.World.AttackDogs;
onEnterFrame = function () {
if (_root.Antifreezer == false) {
this.armed = true;
}
if (((((((this.armed == true) && (_root.World["Attack Dog" + this.number] == undefined)) && (_root.World.BasketballDog == undefined)) && (Math.abs(_x - _parent.camera._x) < (((_parent.camera._width / 2) + (_width / 2)) + _root.World.badguyDISTANCEMAX))) && (Math.abs(_y - _parent.camera._y) < (((_parent.camera._height / 2) + (this._height / 2)) + _root.World.badguyDISTANCEMAX))) && (_root.Antifreezer != true)) || (_root.Antifreezer == false)) {
if (_root.basketball == false) {
_root.World.attachMovie("Attack Dog 1", "Attack Dog" + this.number, _root.attachDEPTH, {_x:_x, _y:_y, pasted:true});
} else {
_root.World.attachMovie("Attack Dog 1", "BasketballDog", _root.attachDEPTH, {_x:_x, _y:_y, pasted:true});
}
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.Antifreezer = undefined;
this.armed = false;
} else if ((((_root.World["Attack Dog" + this.number] == undefined) && (_root.World.BasketballDog == undefined)) && (Math.abs(_x - _parent.camera._x) > (((_parent.camera._width / 2) + (_width / 2)) + _root.World.badguyDISTANCEMAX))) || ((_root.World["Attack Dog" + this.number] == undefined) && (Math.abs(_y - _parent.camera._y) > (((_parent.camera._height / 2) + (_height / 2)) + _root.World.badguyDISTANCEMAX)))) {
this.armed = true;
}
};
Instance of Symbol 81 MovieClip "sensor" in Symbol 536 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
_parent.stop();
bubbles = 0;
bubbletime = 2;
bubbleSCALEMIN = 100;
bubbleSCALEMAX = 400;
bubblesMAX = 50;
bubbleLOOPS = 5;
bubbleSPEEDSPAWN = 5 * bubbleLOOPS;
}
onClipEvent (enterFrame) {
if (_parent.charALIVE == false) {
_parent.gotoAndStop("Dead");
} else if (_parent.environment == "duckpaddle") {
if (Key.isDown(_root.kJUMP)) {
_parent.gotoAndStop("SurfaceSwimming-Flapping");
} else {
_parent.gotoAndStop("SurfaceSwimming");
}
} else if (((_parent.environment == "swimmingupward") || (_parent.environment == "swimmingdownward")) || (_parent.environment == "watergrounded")) {
if ((bubbletimeSTART + bubbletime) > (getTimer() / 1000)) {
bubbleloop = 1;
while (bubbleloop < bubbleLOOPS) {
if (random(Math.max(0, bubbleSPEEDSPAWN - (_parent.totalspeed * bubbleLOOPS))) == 0) {
bubbles = bubbles + 1;
bubbleSCALE = random(bubbleSCALEMAX - bubbleSCALEMIN) + bubbleSCALEMIN;
_parent.attachMovie("Bubble 1", "bubble" + bubbles, _parent.bubbledepth + bubbles, {_x:((((_x + (((_height / 2) * _parent.faceX) * Math.sin(_parent._rotation * _parent.DEGtoRAD))) + ((random(_width) - (_width / 2)) * Math.cos(_parent._rotation * _parent.DEGtoRAD))) * _parent._xscale) / 100) + _parent._x, _y:((((_y - ((_height / 2) * Math.cos(_parent._rotation * _parent.DEGtoRAD))) - ((random(_width) - (_width / 2)) * Math.sin(_parent._rotation * _parent.DEGtoRAD))) * _parent._yscale) / 100) + _parent._y, _xscale:bubbleSCALE, _yscale:bubbleSCALE, bubbleSCALE:bubbleSCALE});
}
bubbleloop++;
}
}
if (Key.isDown(_root.kJUMP)) {
_parent.gotoAndStop("Swimming-Flapping");
} else if ((Math.abs(_parent.swimspeedX) > _parent.gspeedY) || (Math.abs(_parent.swimspeedY) > _parent.gspeedY)) {
_parent.gotoAndStop("Swimming");
} else {
_parent.gotoAndStop("Sinking");
}
} else if ((_parent.jumpspeedY >= _parent.gspeedY) && (_parent.jumpspeedY > 0)) {
if (_parent.airjumpCOUNT == _parent.airjumpsMAX) {
_parent.gotoAndStop("Flying");
} else {
_parent.gotoAndStop("DoubleJumping");
}
} else if (((_parent.jumpspeedY < _parent.gspeedY) && (_parent.jumpspeedY > 0)) || ((_parent.jumpspeedY == 0) && (_parent.gspeedY > _parent.jumpTHRESHOLD))) {
_parent.gotoAndStop("Falling");
} else if (_parent.environment == "wallslide") {
_parent.gotoAndStop("Wallsliding");
} else if (((_parent.environmentchecker == "bellyslide") && (_parent.bellyslideTIME < 99)) || (((_parent.environmentchecker == "bellyslide") && (_parent.bellyslideTIME >= 99)) && (Math.abs(_parent.movespeedX) > _parent.slidespeedMIN))) {
_parent.gotoAndStop("BellySliding");
} else if (((_parent.environment == "grounded") && (_parent.charROT >= 165)) || ((_parent.environment == "grounded") && (_parent.charROT <= -165))) {
_parent.gotoAndStop("Nosedivebounce");
} else if (_parent.moveX != 0) {
_parent.gotoAndStop("Walking");
} else {
_parent.gotoAndStop("Standing");
}
if (((_parent.environment != "swimmingupward") && (_parent.environment != "swimmingdownward")) && (_parent.environment != "watergrounded")) {
bubbletimeSTART = getTimer() / 1000;
}
}
Symbol 540 MovieClip Frame 1
_visible = false;
this.armed = true;
_root.World.Goombas = _root.World.Goombas + 1;
this.number = _root.World.Goombas;
onEnterFrame = function () {
if ((((this.armed == true) && (_root.World["Goomba" + this.number] == undefined)) && (Math.abs(_x - _parent.camera._x) < (((_parent.camera._width / 2) + (_width / 2)) + _root.World.badguyDISTANCEMAX))) && (Math.abs(_y - _parent.camera._y) < (((_parent.camera._height / 2) + this._height) + _root.World.badguyDISTANCEMAX))) {
_root.World.attachMovie("Goomba 1", "Goomba" + this.number, _root.attachDEPTH, {_x:_x, _y:_y, pasted:true});
this.armed = false;
_root.attachDEPTH = _root.attachDEPTH + 1;
} else if (((_root.World["Goomba" + this.number] == undefined) && (Math.abs(_x - _parent.camera._x) > (((_parent.camera._width / 2) + (_width / 2)) + _root.World.badguyDISTANCEMAX))) || ((_root.World["Goomba" + this.number] == undefined) && (Math.abs(_y - _parent.camera._y) > (((_parent.camera._height / 2) + (_height / 2)) + _root.World.badguyDISTANCEMAX)))) {
this.armed = true;
}
};
Instance of Symbol 81 MovieClip "sensor" in Symbol 540 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
_parent.stop();
bubbles = 0;
bubbletime = 2;
bubbleSCALEMIN = 100;
bubbleSCALEMAX = 400;
bubblesMAX = 50;
bubbleLOOPS = 5;
bubbleSPEEDSPAWN = 5 * bubbleLOOPS;
}
onClipEvent (enterFrame) {
if (_parent.charALIVE == false) {
_parent.gotoAndStop("Dead");
} else if (_parent.environment == "duckpaddle") {
if (Key.isDown(_root.kJUMP)) {
_parent.gotoAndStop("SurfaceSwimming-Flapping");
} else {
_parent.gotoAndStop("SurfaceSwimming");
}
} else if (((_parent.environment == "swimmingupward") || (_parent.environment == "swimmingdownward")) || (_parent.environment == "watergrounded")) {
if ((bubbletimeSTART + bubbletime) > (getTimer() / 1000)) {
bubbleloop = 1;
while (bubbleloop < bubbleLOOPS) {
if (random(Math.max(0, bubbleSPEEDSPAWN - (_parent.totalspeed * bubbleLOOPS))) == 0) {
bubbles = bubbles + 1;
bubbleSCALE = random(bubbleSCALEMAX - bubbleSCALEMIN) + bubbleSCALEMIN;
_parent.attachMovie("Bubble 1", "bubble" + bubbles, _parent.bubbledepth + bubbles, {_x:((((_x + (((_height / 2) * _parent.faceX) * Math.sin(_parent._rotation * _parent.DEGtoRAD))) + ((random(_width) - (_width / 2)) * Math.cos(_parent._rotation * _parent.DEGtoRAD))) * _parent._xscale) / 100) + _parent._x, _y:((((_y - ((_height / 2) * Math.cos(_parent._rotation * _parent.DEGtoRAD))) - ((random(_width) - (_width / 2)) * Math.sin(_parent._rotation * _parent.DEGtoRAD))) * _parent._yscale) / 100) + _parent._y, _xscale:bubbleSCALE, _yscale:bubbleSCALE, bubbleSCALE:bubbleSCALE});
}
bubbleloop++;
}
}
if (Key.isDown(_root.kJUMP)) {
_parent.gotoAndStop("Swimming-Flapping");
} else if ((Math.abs(_parent.swimspeedX) > _parent.gspeedY) || (Math.abs(_parent.swimspeedY) > _parent.gspeedY)) {
_parent.gotoAndStop("Swimming");
} else {
_parent.gotoAndStop("Sinking");
}
} else if ((_parent.jumpspeedY >= _parent.gspeedY) && (_parent.jumpspeedY > 0)) {
if (_parent.airjumpCOUNT == _parent.airjumpsMAX) {
_parent.gotoAndStop("Flying");
} else {
_parent.gotoAndStop("DoubleJumping");
}
} else if (((_parent.jumpspeedY < _parent.gspeedY) && (_parent.jumpspeedY > 0)) || ((_parent.jumpspeedY == 0) && (_parent.gspeedY > _parent.jumpTHRESHOLD))) {
_parent.gotoAndStop("Falling");
} else if (_parent.environment == "wallslide") {
_parent.gotoAndStop("Wallsliding");
} else if (((_parent.environmentchecker == "bellyslide") && (_parent.bellyslideTIME < 99)) || (((_parent.environmentchecker == "bellyslide") && (_parent.bellyslideTIME >= 99)) && (Math.abs(_parent.movespeedX) > _parent.slidespeedMIN))) {
_parent.gotoAndStop("BellySliding");
} else if (((_parent.environment == "grounded") && (_parent.charROT >= 165)) || ((_parent.environment == "grounded") && (_parent.charROT <= -165))) {
_parent.gotoAndStop("Nosedivebounce");
} else if (_parent.moveX != 0) {
_parent.gotoAndStop("Walking");
} else {
_parent.gotoAndStop("Standing");
}
if (((_parent.environment != "swimmingupward") && (_parent.environment != "swimmingdownward")) && (_parent.environment != "watergrounded")) {
bubbletimeSTART = getTimer() / 1000;
}
}
Symbol 541 MovieClip Frame 1
_visible = false;
this.armed = true;
_root.World.KoopaTroopas = _root.World.KoopaTroopas + 1;
this.number = _root.World.KoopaTroopas;
onEnterFrame = function () {
if ((((this.armed == true) && (_root.World["Koopa Troopa" + this.number] == undefined)) && (Math.abs(_x - _parent.camera._x) < (((_parent.camera._width / 2) + (_width / 2)) + _root.World.badguyDISTANCEMAX))) && (Math.abs(_y - _parent.camera._y) < (((_parent.camera._height / 2) + this._height) + _root.World.badguyDISTANCEMAX))) {
_root.World.attachMovie("Koopa Troopa 1", "Koopa Troopa" + this.number, _root.attachDEPTH, {_x:_x, _y:_y, pasted:true});
this.armed = false;
_root.attachDEPTH = _root.attachDEPTH + 1;
} else if (((_root.World["Koopa Troopa" + this.number] == undefined) && (Math.abs(_x - _parent.camera._x) > (((_parent.camera._width / 2) + (_width / 2)) + _root.World.badguyDISTANCEMAX))) || ((_root.World["Koopa Troopa" + this.number] == undefined) && (Math.abs(_y - _parent.camera._y) > (((_parent.camera._height / 2) + (_height / 2)) + _root.World.badguyDISTANCEMAX)))) {
this.armed = true;
}
};
Instance of Symbol 81 MovieClip "sensor" in Symbol 541 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
_parent.stop();
bubbles = 0;
bubbletime = 2;
bubbleSCALEMIN = 100;
bubbleSCALEMAX = 400;
bubblesMAX = 50;
bubbleLOOPS = 5;
bubbleSPEEDSPAWN = 5 * bubbleLOOPS;
}
onClipEvent (enterFrame) {
if (_parent.charALIVE == false) {
_parent.gotoAndStop("Dead");
} else if (_parent.environment == "duckpaddle") {
if (Key.isDown(_root.kJUMP)) {
_parent.gotoAndStop("SurfaceSwimming-Flapping");
} else {
_parent.gotoAndStop("SurfaceSwimming");
}
} else if (((_parent.environment == "swimmingupward") || (_parent.environment == "swimmingdownward")) || (_parent.environment == "watergrounded")) {
if ((bubbletimeSTART + bubbletime) > (getTimer() / 1000)) {
bubbleloop = 1;
while (bubbleloop < bubbleLOOPS) {
if (random(Math.max(0, bubbleSPEEDSPAWN - (_parent.totalspeed * bubbleLOOPS))) == 0) {
bubbles = bubbles + 1;
bubbleSCALE = random(bubbleSCALEMAX - bubbleSCALEMIN) + bubbleSCALEMIN;
_parent.attachMovie("Bubble 1", "bubble" + bubbles, _parent.bubbledepth + bubbles, {_x:((((_x + (((_height / 2) * _parent.faceX) * Math.sin(_parent._rotation * _parent.DEGtoRAD))) + ((random(_width) - (_width / 2)) * Math.cos(_parent._rotation * _parent.DEGtoRAD))) * _parent._xscale) / 100) + _parent._x, _y:((((_y - ((_height / 2) * Math.cos(_parent._rotation * _parent.DEGtoRAD))) - ((random(_width) - (_width / 2)) * Math.sin(_parent._rotation * _parent.DEGtoRAD))) * _parent._yscale) / 100) + _parent._y, _xscale:bubbleSCALE, _yscale:bubbleSCALE, bubbleSCALE:bubbleSCALE});
}
bubbleloop++;
}
}
if (Key.isDown(_root.kJUMP)) {
_parent.gotoAndStop("Swimming-Flapping");
} else if ((Math.abs(_parent.swimspeedX) > _parent.gspeedY) || (Math.abs(_parent.swimspeedY) > _parent.gspeedY)) {
_parent.gotoAndStop("Swimming");
} else {
_parent.gotoAndStop("Sinking");
}
} else if ((_parent.jumpspeedY >= _parent.gspeedY) && (_parent.jumpspeedY > 0)) {
if (_parent.airjumpCOUNT == _parent.airjumpsMAX) {
_parent.gotoAndStop("Flying");
} else {
_parent.gotoAndStop("DoubleJumping");
}
} else if (((_parent.jumpspeedY < _parent.gspeedY) && (_parent.jumpspeedY > 0)) || ((_parent.jumpspeedY == 0) && (_parent.gspeedY > _parent.jumpTHRESHOLD))) {
_parent.gotoAndStop("Falling");
} else if (_parent.environment == "wallslide") {
_parent.gotoAndStop("Wallsliding");
} else if (((_parent.environmentchecker == "bellyslide") && (_parent.bellyslideTIME < 99)) || (((_parent.environmentchecker == "bellyslide") && (_parent.bellyslideTIME >= 99)) && (Math.abs(_parent.movespeedX) > _parent.slidespeedMIN))) {
_parent.gotoAndStop("BellySliding");
} else if (((_parent.environment == "grounded") && (_parent.charROT >= 165)) || ((_parent.environment == "grounded") && (_parent.charROT <= -165))) {
_parent.gotoAndStop("Nosedivebounce");
} else if (_parent.moveX != 0) {
_parent.gotoAndStop("Walking");
} else {
_parent.gotoAndStop("Standing");
}
if (((_parent.environment != "swimmingupward") && (_parent.environment != "swimmingdownward")) && (_parent.environment != "watergrounded")) {
bubbletimeSTART = getTimer() / 1000;
}
}
Instance of Symbol 529 MovieClip "HardBoundary" in Symbol 542 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 533 MovieClip "SoftBoundary" in Symbol 542 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 535 MovieClip "DeathBoundary" in Symbol 542 MovieClip Frame 1
onClipEvent (load) {
_root.DeathBoundaryPresent = true;
}
Instance of Symbol 396 MovieClip in Symbol 542 MovieClip Frame 1
onClipEvent (load) {
this.keynumber = 1;
}
Instance of Symbol 419 MovieClip in Symbol 542 MovieClip Frame 1
onClipEvent (load) {
this.textcontent = "Watch out for those barbed wires! Touch them and you will lose cherry bombs. If you have no cherry bombs, the barbed wire will kill you!";
}
Instance of Symbol 419 MovieClip in Symbol 542 MovieClip Frame 1
onClipEvent (load) {
this.textcontent = "Avoid enemies or use your cherry bombs to disable them! Be careful, they mean business. Some enemies will even chase after you or drop bombs from the sky!";
}
Instance of Symbol 419 MovieClip in Symbol 542 MovieClip Frame 1
onClipEvent (load) {
this.textcontent = "Hm, that barbed wire will hurt. . . . Can you destroy the security box from afar?";
}
Symbol 599 MovieClip Frame 1
this.segment = 1;
_root.soundManager_mc.playSound("BreakfastCinematic.wav", 0, 9999999999);
Instance of Symbol 81 MovieClip in Symbol 599 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
this.skiparmed = false;
}
onClipEvent (enterFrame) {
_parent.nextsegment = _parent.segment + 1;
if (Key.isDown(_root.kSTART) && (this.skiparmed == true)) {
_parent.gotoAndPlay("segment" + _parent.nextsegment);
this.skiparmed = false;
} else if (!Key.isDown(_root.kSTART)) {
this.skiparmed = true;
}
}
Symbol 599 MovieClip Frame 77
stop();
Symbol 599 MovieClip Frame 78
this.segment = 2;
Symbol 599 MovieClip Frame 150
stop();
Symbol 599 MovieClip Frame 151
this.segment = 3;
Symbol 599 MovieClip Frame 214
stop();
Symbol 599 MovieClip Frame 215
this.segment = 4;
Symbol 599 MovieClip Frame 250
_root.go = true;
_parent.play();
_root.soundManager_mc.stopSound("BreakfastCinematic.wav");
Symbol 604 MovieClip Frame 1
onEnterFrame = function () {
if (_root.World.Player1.keyred == this.keynumber) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
}
};
Instance of Symbol 604 MovieClip in Symbol 605 MovieClip Frame 1
onClipEvent (enterFrame) {
this.keynumber = 1;
}
Symbol 608 MovieClip Frame 1
onEnterFrame = function () {
if (_root.World.Player1.keyblue == 1) {
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
}
};
Symbol 610 MovieClip [Crumbling 1] Frame 1
_visible = false;
this.hitXDIS = (this._width / 2) + 1;
this.hitYDIS = ((this._height / 2) + (_root.World.Player1.sensor._height / 2)) + 1;
firstframe = true;
if (_root.World[this._name + "ART"]._name == undefined) {
_root.World.attachMovie("CrumblingBox", this._name + "ART", _root.attachDEPTH, {_x:this._x, _y:this._y});
_root.attachDEPTH = _root.attachDEPTH + 1;
}
onEnterFrame = function () {
this.Player1X = _root.World.Player1._x;
this.Player1Y = _root.World.Player1._y;
this.Player1XDIS = Math.abs(this.Player1X - this._x);
this.Player1YDIS = Math.abs(this.Player1Y - this._y);
if ((((((_root.PAUSE == false) && (this.Player1Y <= this._y)) && (this.Player1XDIS < this.hitXDIS)) && (this.Player1YDIS < this.hitYDIS)) && (_root.World.environment == "grounded")) || ((_root.PAUSE == false) && (firstframe == false))) {
_root.World[this._name + "ART"].play();
play();
} else if (_root.PAUSE == true) {
_root.World[this._name + "ART"].stop();
stop();
}
};
stop();
Symbol 610 MovieClip [Crumbling 1] Frame 2
firstframe = false;
Symbol 610 MovieClip [Crumbling 1] Frame 17
onEnterFrame = function () {
if (_root.PAUSE == false) {
play();
} else if (_root.PAUSE == true) {
stop();
}
};
Symbol 612 MovieClip Frame 1
onEnterFrame = function () {
if ((_parent._parent.environment == "grounded") && (this.hitTest((((_parent._parent.Player1._x + _parent._parent.offsetX) * _parent._parent._xscale) / 100) + _parent._parent._x, ((((_parent._parent.Player1._y + _parent._parent.offsetY) + (_parent._parent.charHEIGHT * 0.5)) * _parent._parent._yscale) / 100) + _parent._parent._y, true))) {
_parent._parent.TOUCHtile = true;
} else {
_parent._parent.TOUCHtile = false;
}
};
Instance of Symbol 608 MovieClip in Symbol 613 MovieClip Frame 1
onClipEvent (enterFrame) {
this.keynumber = 1;
}
Instance of Symbol 615 MovieClip "DeathBoundary" in Symbol 623 MovieClip Frame 1
onClipEvent (load) {
_root.DeathBoundaryPresent = true;
}
Instance of Symbol 419 MovieClip in Symbol 623 MovieClip Frame 1
onClipEvent (load) {
this.textcontent = "See if you can collect all the cigarettes in this level. Some are hidden in secret locations! You can press \"CONTROL\" and \"SHIFT\" to zoom in and out for a better view. . . . Hm, that big wall looks suspicious. Explore and be rewarded with hundreds smooth smokes, filled with sweet nicotine.";
}
Instance of Symbol 419 MovieClip in Symbol 623 MovieClip Frame 1
onClipEvent (load) {
this.textcontent = "Nice work! You've got the blue and red keys! The stage exit is just up ahead, but maybe you should see what else those keys may have opened up.";
}
Instance of Symbol 419 MovieClip in Symbol 623 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
this.textcontent = "Hello! Hope you're enjoying the game! -Christopher J. Rock";
}
Instance of Symbol 393 MovieClip in Symbol 623 MovieClip Frame 1
onClipEvent (load) {
this.keynumber = 1;
}
Instance of Symbol 396 MovieClip in Symbol 623 MovieClip Frame 1
onClipEvent (load) {
this.keynumber = 1;
}
Instance of Symbol 540 MovieClip in Symbol 623 MovieClip Frame 1
onClipEvent (load) {
initfaceXDIR = -1;
}
Symbol 640 MovieClip Frame 1
onEnterFrame = function () {
if (_root.World.Player1.keyred == this.keynumber) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
}
};
Instance of Symbol 640 MovieClip in Symbol 641 MovieClip Frame 1
onClipEvent (enterFrame) {
this.keynumber = 1;
}
Symbol 644 MovieClip Frame 1
onEnterFrame = function () {
if (_root.World.Player1.keyblue == 1) {
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
}
};
Symbol 646 MovieClip Frame 1
onEnterFrame = function () {
if ((_parent._parent.environment == "grounded") && (this.hitTest((((_parent._parent.Player1._x + _parent._parent.offsetX) * _parent._parent._xscale) / 100) + _parent._parent._x, ((((_parent._parent.Player1._y + _parent._parent.offsetY) + (_parent._parent.charHEIGHT * 0.5)) * _parent._parent._yscale) / 100) + _parent._parent._y, true))) {
_parent._parent.TOUCHtile = true;
} else {
_parent._parent.TOUCHtile = false;
}
};
Instance of Symbol 644 MovieClip in Symbol 647 MovieClip Frame 1
onClipEvent (enterFrame) {
this.keynumber = 1;
}
Instance of Symbol 649 MovieClip "DeathBoundary" in Symbol 659 MovieClip Frame 1
onClipEvent (load) {
_root.DeathBoundaryPresent = true;
}
Instance of Symbol 419 MovieClip in Symbol 659 MovieClip Frame 1
onClipEvent (load) {
this.textcontent = "Hm, nothing here but barbed wire. . . . Could some of these pits be hiding something?";
}
Instance of Symbol 419 MovieClip in Symbol 659 MovieClip Frame 1
onClipEvent (load) {
this.textcontent = "When stuck, don't forget to look upward!";
}
Instance of Symbol 419 MovieClip in Symbol 659 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
this.textcontent = "Nice moves, hot shot! -Christopher J. Rock";
}
Instance of Symbol 396 MovieClip "keyred" in Symbol 659 MovieClip Frame 1
onClipEvent (load) {
this.keynumber = 1;
}
Instance of Symbol 393 MovieClip "keyblue" in Symbol 659 MovieClip Frame 1
onClipEvent (load) {
this.keynumber = 1;
}
Symbol 712 MovieClip Frame 1
this.segment = 1;
_root.soundManager_mc.playSound("BreakfastCinematic.wav", 0, 9999999999);
Instance of Symbol 81 MovieClip in Symbol 712 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
this.skiparmed = false;
}
onClipEvent (enterFrame) {
_parent.nextsegment = _parent.segment + 1;
if (Key.isDown(_root.kSTART) && (this.skiparmed == true)) {
_parent.gotoAndPlay("segment" + _parent.nextsegment);
this.skiparmed = false;
} else if (!Key.isDown(_root.kSTART)) {
this.skiparmed = true;
}
}
Symbol 712 MovieClip Frame 73
stop();
Symbol 712 MovieClip Frame 74
this.segment = 2;
Symbol 712 MovieClip Frame 136
stop();
Symbol 712 MovieClip Frame 137
this.segment = 3;
Symbol 712 MovieClip Frame 206
stop();
Symbol 712 MovieClip Frame 207
this.segment = 4;
Symbol 712 MovieClip Frame 243
_root.go = true;
_parent.play();
_root.soundManager_mc.stopSound("BreakfastCinematic.wav");
Symbol 721 MovieClip Frame 1
onEnterFrame = function () {
if ((_parent._parent.environment == "grounded") && (this.hitTest((((_parent._parent.Player1._x + _parent._parent.offsetX) * _parent._parent._xscale) / 100) + _parent._parent._x, ((((_parent._parent.Player1._y + _parent._parent.offsetY) + (_parent._parent.charHEIGHT * 0.5)) * _parent._parent._yscale) / 100) + _parent._parent._y, true))) {
_parent._parent.TOUCHtile = true;
} else {
_parent._parent.TOUCHtile = false;
}
};
Instance of Symbol 724 MovieClip "DeathBoundary" in Symbol 728 MovieClip Frame 1
onClipEvent (load) {
_root.DeathBoundaryPresent = true;
}
Instance of Symbol 419 MovieClip in Symbol 728 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
this.textcontent = "What are you doing down here? -Christopher J. Rock";
}
Symbol 745 MovieClip Frame 1
onEnterFrame = function () {
if (_root.World.Player1.keyred == this.keynumber) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
}
};
Instance of Symbol 745 MovieClip in Symbol 746 MovieClip Frame 1
onClipEvent (enterFrame) {
this.keynumber = 1;
}
Symbol 749 MovieClip Frame 1
onEnterFrame = function () {
if (_root.World.Player1.keyblue == 1) {
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
}
};
Symbol 751 MovieClip Frame 1
onEnterFrame = function () {
if ((_parent._parent.environment == "grounded") && (this.hitTest((((_parent._parent.Player1._x + _parent._parent.offsetX) * _parent._parent._xscale) / 100) + _parent._parent._x, ((((_parent._parent.Player1._y + _parent._parent.offsetY) + (_parent._parent.charHEIGHT * 0.5)) * _parent._parent._yscale) / 100) + _parent._parent._y, true))) {
_parent._parent.TOUCHtile = true;
} else {
_parent._parent.TOUCHtile = false;
}
};
Instance of Symbol 749 MovieClip in Symbol 752 MovieClip Frame 1
onClipEvent (enterFrame) {
this.keynumber = 1;
}
Instance of Symbol 754 MovieClip "DeathBoundary" in Symbol 772 MovieClip Frame 1
onClipEvent (load) {
_root.DeathBoundaryPresent = true;
}
Instance of Symbol 419 MovieClip in Symbol 772 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
this.textcontent = "Ooh, not just any player makes it this far. Keep playing! -Christopher J. Rock";
}
Instance of Symbol 419 MovieClip in Symbol 772 MovieClip Frame 1
onClipEvent (load) {
this.textcontent = "Check out cigarette trails. Some will lead to more treasure, keys or the end of the level! Plus, smoking makes you even sexier than drinking makes you cool!";
}
Instance of Symbol 419 MovieClip in Symbol 772 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
this.textcontent = "Are these things really worth the effort? -Christopher J. Rock";
}
Instance of Symbol 396 MovieClip "keyred " in Symbol 772 MovieClip Frame 1
onClipEvent (load) {
this.keynumber = 1;
}
Instance of Symbol 393 MovieClip "keyblue" in Symbol 772 MovieClip Frame 1
onClipEvent (load) {
this.keynumber = 1;
}
Symbol 819 MovieClip Frame 1
this.segment = 1;
_root.soundManager_mc.playSound("BreakfastCinematic.wav", 0, 9999999999);
Instance of Symbol 81 MovieClip in Symbol 819 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
this.skiparmed = false;
}
onClipEvent (enterFrame) {
_parent.nextsegment = _parent.segment + 1;
if (Key.isDown(_root.kSTART) && (this.skiparmed == true)) {
_parent.gotoAndPlay("segment" + _parent.nextsegment);
this.skiparmed = false;
} else if (!Key.isDown(_root.kSTART)) {
this.skiparmed = true;
}
}
Symbol 819 MovieClip Frame 136
stop();
Symbol 819 MovieClip Frame 137
this.segment = 2;
Symbol 819 MovieClip Frame 190
stop();
Symbol 819 MovieClip Frame 191
this.segment = 3;
Symbol 819 MovieClip Frame 273
stop();
Symbol 819 MovieClip Frame 274
this.segment = 4;
Symbol 819 MovieClip Frame 368
stop();
Symbol 819 MovieClip Frame 369
this.segment = 5;
Symbol 819 MovieClip Frame 382
_root.go = true;
_parent.play();
_root.soundManager_mc.stopSound("BreakfastCinematic.wav");
Symbol 824 MovieClip Frame 1
onEnterFrame = function () {
if (_root.World.Player1.keyred == this.keynumber) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
}
};
Instance of Symbol 824 MovieClip in Symbol 825 MovieClip Frame 1
onClipEvent (enterFrame) {
this.keynumber = 1;
}
Symbol 828 MovieClip Frame 1
onEnterFrame = function () {
if (_root.World.Player1.keyblue == 1) {
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
}
};
Symbol 830 MovieClip Frame 1
onEnterFrame = function () {
if ((_parent._parent.environment == "grounded") && (this.hitTest((((_parent._parent.Player1._x + _parent._parent.offsetX) * _parent._parent._xscale) / 100) + _parent._parent._x, ((((_parent._parent.Player1._y + _parent._parent.offsetY) + (_parent._parent.charHEIGHT * 0.5)) * _parent._parent._yscale) / 100) + _parent._parent._y, true))) {
_parent._parent.TOUCHtile = true;
} else {
_parent._parent.TOUCHtile = false;
}
};
Instance of Symbol 828 MovieClip in Symbol 831 MovieClip Frame 1
onClipEvent (enterFrame) {
this.keynumber = 1;
}
Instance of Symbol 833 MovieClip "DeathBoundary" in Symbol 851 MovieClip Frame 1
onClipEvent (load) {
_root.DeathBoundaryPresent = true;
}
Instance of Symbol 419 MovieClip in Symbol 851 MovieClip Frame 1
onClipEvent (load) {
this.textcontent = "That dog looks hungry. . . .";
}
Instance of Symbol 419 MovieClip in Symbol 851 MovieClip Frame 1
onClipEvent (load) {
this.textcontent = "Cigarettes never caused anything except for big muscles and sun-glasses.";
}
Instance of Symbol 419 MovieClip in Symbol 851 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
this.textcontent = "You can plan a pretty picnic, but you can't predict the weather. -Christopher J. Rock";
}
Instance of Symbol 419 MovieClip in Symbol 851 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
this.textcontent = "Keep it real. -Christopher J. Rock";
}
Instance of Symbol 419 MovieClip in Symbol 851 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
this.textcontent = "Now and again, it is perfectly healthy for a man to question his own sexuality. -Christopher J. Rock";
}
Instance of Symbol 396 MovieClip in Symbol 851 MovieClip Frame 1
onClipEvent (load) {
this.keynumber = 1;
}
Instance of Symbol 393 MovieClip in Symbol 851 MovieClip Frame 1
onClipEvent (load) {
this.keynumber = 1;
}
Instance of Symbol 536 MovieClip in Symbol 851 MovieClip Frame 1
onClipEvent (load) {
_root.Antifreezer = true;
}
Symbol 868 MovieClip Frame 1
onEnterFrame = function () {
if (_root.World.Player1.keyred == this.keynumber) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
}
};
Instance of Symbol 868 MovieClip in Symbol 869 MovieClip Frame 1
onClipEvent (enterFrame) {
this.keynumber = 1;
}
Symbol 872 MovieClip Frame 1
onEnterFrame = function () {
if (_root.World.Player1.keyblue == 1) {
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
}
};
Symbol 874 MovieClip Frame 1
onEnterFrame = function () {
if ((_parent._parent.environment == "grounded") && (this.hitTest((((_parent._parent.Player1._x + _parent._parent.offsetX) * _parent._parent._xscale) / 100) + _parent._parent._x, ((((_parent._parent.Player1._y + _parent._parent.offsetY) + (_parent._parent.charHEIGHT * 0.5)) * _parent._parent._yscale) / 100) + _parent._parent._y, true))) {
_parent._parent.TOUCHtile = true;
} else {
_parent._parent.TOUCHtile = false;
}
};
Instance of Symbol 872 MovieClip in Symbol 875 MovieClip Frame 1
onClipEvent (enterFrame) {
this.keynumber = 1;
}
Instance of Symbol 877 MovieClip "DeathBoundary" in Symbol 902 MovieClip Frame 1
onClipEvent (load) {
_root.DeathBoundaryPresent = true;
}
Instance of Symbol 419 MovieClip in Symbol 902 MovieClip Frame 1
onClipEvent (load) {
this.textcontent = "Run. Run as fast as you can.";
}
Instance of Symbol 419 MovieClip in Symbol 902 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
this.textcontent = "You are dead. -Christopher J. Rock";
}
Instance of Symbol 419 MovieClip in Symbol 902 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
this.textcontent = "Sweet jump! -Christopher J. Rock";
}
Instance of Symbol 396 MovieClip in Symbol 902 MovieClip Frame 1
onClipEvent (load) {
this.keynumber = 1;
}
Instance of Symbol 393 MovieClip in Symbol 902 MovieClip Frame 1
onClipEvent (load) {
this.keynumber = 1;
}
Symbol 987 MovieClip Frame 1
this.segment = 1;
_root.soundManager_mc.playSound("BreakfastCinematic.wav", 0, 9999999999);
Instance of Symbol 81 MovieClip in Symbol 987 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
this.skiparmed = false;
}
onClipEvent (enterFrame) {
_parent.nextsegment = _parent.segment + 1;
if (Key.isDown(_root.kSTART) && (this.skiparmed == true)) {
_parent.gotoAndPlay("segment" + _parent.nextsegment);
this.skiparmed = false;
} else if (!Key.isDown(_root.kSTART)) {
this.skiparmed = true;
}
}
Symbol 987 MovieClip Frame 52
stop();
Symbol 987 MovieClip Frame 53
this.segment = 2;
Symbol 987 MovieClip Frame 91
this.segment = 3;
_root.soundManager_mc.stopSound("BreakfastCinematic.wav");
Symbol 987 MovieClip Frame 92
_root.soundManager_mc.playSound("BreakfastIntroCinematic.wav", 0, 9999999999);
Symbol 987 MovieClip Frame 129
stop();
Symbol 987 MovieClip Frame 130
this.segment = 4;
Symbol 987 MovieClip Frame 340
_root.go = true;
_parent.play();
_root.soundManager_mc.stopSound("BreakfastIntroCinematic.wav");
stop();
Symbol 992 MovieClip Frame 1
onEnterFrame = function () {
if (_root.World.Player1.keyblue == 1) {
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
}
};
Symbol 994 MovieClip Frame 1
onEnterFrame = function () {
if ((_parent._parent.environment == "grounded") && (this.hitTest((((_parent._parent.Player1._x + _parent._parent.offsetX) * _parent._parent._xscale) / 100) + _parent._parent._x, ((((_parent._parent.Player1._y + _parent._parent.offsetY) + (_parent._parent.charHEIGHT * 0.5)) * _parent._parent._yscale) / 100) + _parent._parent._y, true))) {
_parent._parent.TOUCHtile = true;
} else {
_parent._parent.TOUCHtile = false;
}
};
Instance of Symbol 992 MovieClip in Symbol 995 MovieClip Frame 1
onClipEvent (enterFrame) {
this.keynumber = 1;
}
Symbol 998 MovieClip Frame 1
if (_root.chains == undefined) {
_root.chains = 1;
} else {
_root.chains = _root.chains + 1;
}
this.chainnumber = _root.chains;
if (speedY == undefined) {
speedY = 1;
}
if (yMIN == undefined) {
yMIN = _y;
}
_root.World.attachMovie("ChainArt", "Chain" + this.chainnumber, _root.attachDEPTH, {_x:_x + _parent._x, _y:_y + _parent._y});
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World.attachMovie("ChainMask", "ChainMask" + this.chainnumber, _root.attachDEPTH, {_x:_parent._x, _y:_parent._y});
_root.attachDEPTH = _root.attachDEPTH + 1;
_root.World["Chain" + this.chainnumber].setMask(_root.World["ChainMask" + this.chainnumber]);
onEnterFrame = function () {
engineloops = 1;
while (engineloops <= _root.World.engineloops) {
_y = (_y - this.speedY);
if (((yMAX != undefined) && (yMAX <= yMIN)) && (_y <= yMAX)) {
_y = yMIN;
} else if (((yMAX != undefined) && (yMAX > yMIN)) && (_y >= yMAX)) {
_y = yMIN;
}
engineloops++;
}
_root.World["Chain" + this.chainnumber]._y = _y + _parent._y;
};
Symbol 999 MovieClip Frame 2
stop();
Symbol 1001 MovieClip Frame 1
onEnterFrame = function () {
if (_root.World.Player1.keyred == this.keynumber) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
}
};
Instance of Symbol 999 MovieClip in Symbol 1002 MovieClip Frame 1
onClipEvent (load) {
wall.speedY = -1;
wall.yMAX = 325;
wall.yMIN = -325;
wall._y = wall.yMIN;
}
Instance of Symbol 999 MovieClip in Symbol 1002 MovieClip Frame 1
onClipEvent (load) {
wall.speedY = 1;
wall.yMAX = -325;
}
Instance of Symbol 999 MovieClip in Symbol 1002 MovieClip Frame 1
onClipEvent (load) {
wall.speedY = 1;
wall.yMAX = -325;
wall.yMIN = 325;
wall._y = 0;
}
Instance of Symbol 999 MovieClip in Symbol 1002 MovieClip Frame 1
onClipEvent (load) {
wall.speedY = -1;
wall.yMAX = 325;
wall.yMIN = -325;
wall._y = 0;
}
Instance of Symbol 999 MovieClip in Symbol 1002 MovieClip Frame 1
onClipEvent (load) {
wall.speedY = -1;
wall.yMAX = 325;
wall.yMIN = -325;
wall._y = wall.yMIN;
}
Instance of Symbol 999 MovieClip in Symbol 1002 MovieClip Frame 1
onClipEvent (load) {
wall.speedY = 1;
wall.yMAX = -325;
}
Instance of Symbol 999 MovieClip in Symbol 1002 MovieClip Frame 1
onClipEvent (load) {
wall.speedY = 1;
wall.yMAX = -325;
wall.yMIN = 325;
wall._y = 0;
}
Instance of Symbol 999 MovieClip in Symbol 1002 MovieClip Frame 1
onClipEvent (load) {
wall.speedY = -1;
wall.yMAX = 325;
wall.yMIN = -325;
wall._y = 0;
}
Instance of Symbol 1001 MovieClip in Symbol 1002 MovieClip Frame 1
onClipEvent (enterFrame) {
this.keynumber = 1;
}
Symbol 1036 MovieClip Frame 5
_root.soundManager_mc.playSound("Hit_SlimeSplat8.wav", 0, 1);
Symbol 1036 MovieClip Frame 15
_parent.gotoAndStop("default");
Symbol 1055 MovieClip Frame 1
stopAllSounds();
_root.soundManager_mc.playSound("GiantMantis_Roar3.wav", 0, 1);
_root.soundManager_mc.playSound("explosion.wav", 0, 1);
Symbol 1055 MovieClip Frame 2
_root.soundManager_mc.playSound("explosion.wav", 0, 1);
Symbol 1055 MovieClip Frame 4
_root.soundManager_mc.playSound("explosion.wav", 0, 1);
Symbol 1055 MovieClip Frame 8
_root.soundManager_mc.playSound("explosion.wav", 0, 1);
Symbol 1055 MovieClip Frame 11
_root.soundManager_mc.playSound("explosion.wav", 0, 1);
Symbol 1055 MovieClip Frame 12
_root.soundManager_mc.playSound("explosion.wav", 0, 1);
Symbol 1055 MovieClip Frame 15
_root.soundManager_mc.playSound("explosion.wav", 0, 1);
Symbol 1055 MovieClip Frame 16
_root.soundManager_mc.playSound("explosion.wav", 0, 1);
Symbol 1055 MovieClip Frame 18
_root.soundManager_mc.playSound("explosion.wav", 0, 1);
Symbol 1055 MovieClip Frame 19
_root.soundManager_mc.playSound("explosion.wav", 0, 1);
Symbol 1055 MovieClip Frame 22
_root.soundManager_mc.playSound("explosion.wav", 0, 1);
Symbol 1055 MovieClip Frame 26
_root.soundManager_mc.playSound("explosion.wav", 0, 1);
Symbol 1055 MovieClip Frame 30
_root.soundManager_mc.playSound("explosion.wav", 0, 1);
Symbol 1055 MovieClip Frame 32
_root.soundManager_mc.playSound("explosion.wav", 0, 1);
Symbol 1055 MovieClip Frame 69
_parent.onEnterFrame = undefined;
stop();
Symbol 1056 MovieClip Frame 1
faceLENGTH = 225;
location1X = this._x;
location1Y = this._y;
location2X = this._x + (faceLENGTH / 2);
location2Y = this._y - Math.pow(Math.pow(faceLENGTH, 2) - Math.pow(faceLENGTH / 2, 2), 0.5);
location3X = this._x - (faceLENGTH / 2);
location3Y = this._y - Math.pow(Math.pow(faceLENGTH, 2) - Math.pow(faceLENGTH / 2, 2), 0.5);
locationTIME = 8;
faderate = 1;
currentLOCATION = 1;
startTIME = getTimer() / 1000;
fireballs = 0;
charALIVE = true;
vulnerableDISTANCE = this.sensor._height / 2;
hits = 0;
hitsMAX = 7;
active = false;
onEnterFrame = function () {
engineloopsMAX = _root.World.engineloops;
if ((active == false) && (Math.abs(_parent.Player1._y - this._y) < 500)) {
active = true;
}
if (active == true) {
if ((((getTimer() / 1000) - startTIME) >= locationTIME) && (charALIVE == true)) {
startTIME = getTimer() / 1000;
currentLOCATION = currentLOCATION + 1;
if (this[("location" + currentLOCATION) + "X"] == undefined) {
currentLOCATION = 1;
}
} else if (charALIVE == false) {
engineloopsMAX = 0;
_root.World.Player1.keyblue = 1;
}
engineloops = 0;
while (engineloops <= engineloopsMAX) {
if (_x != this[("location" + currentLOCATION) + "X"]) {
if (_alpha > 0) {
_alpha = (_alpha - faderate);
} else {
_x = this[("location" + currentLOCATION) + "X"];
_y = this[("location" + currentLOCATION) + "Y"];
}
} else if (_x == this[("location" + currentLOCATION) + "X"]) {
if (_alpha < 100) {
_alpha = (_alpha + faderate);
} else if ((((Math.floor((getTimer() / 1000) - startTIME) % 3) == 0) && (lastshot != Math.floor((getTimer() / 1000) - startTIME))) && (charALIVE == true)) {
fireballs = fireballs + 1;
_root.World.attachMovie("Fireball", "Fireball" + fireballs, _root.attachDEPTH, {_x:_x, _y:_y});
_root.attachDEPTH = _root.attachDEPTH + 1;
lastshot = Math.floor((getTimer() / 1000) - startTIME);
}
}
engineloops++;
}
if (this.charALIVE == true) {
rockcheck = _parent.Player1.rocksthrown - _root.World.rocksMAX;
while (rockcheck <= _parent.Player1.rocksthrown) {
if (((_parent["rock" + rockcheck].weapon == true) && (_parent["rock" + rockcheck] != undefined)) && (_parent["rock" + rockcheck].totalspeed > 5)) {
this[("rock" + rockcheck) + "currentXDIS"] = _parent["rock" + rockcheck]._x - this._x;
this[("rock" + rockcheck) + "currentYDIS"] = _parent["rock" + rockcheck]._y - this._y;
this[("rock" + rockcheck) + "currentDIS"] = Math.pow(Math.pow((this[("rock" + rockcheck) + "currentXDIS"] + this[("rock" + rockcheck) + "oldXDIS"]) / 2, 2) + Math.pow((this[("rock" + rockcheck) + "currentYDIS"] + this[("rock" + rockcheck) + "oldYDIS"]) / 2, 2), 0.5);
this[("rock" + rockcheck) + "avgDIS"] = Math.pow(Math.pow(this[("rock" + rockcheck) + "currentXDIS"], 2) + Math.pow(this[("rock" + rockcheck) + "currentYDIS"], 2), 0.5);
if (((this[("rock" + rockcheck) + "currentDIS"] < vulnerableDISTANCE) || (this[("rock" + rockcheck) + "avgDIS"] < vulnerableDISTANCE)) || (Key.isDown(_root.kSKIPLEVEL))) {
hits = hits + 1;
if (hits > hitsMAX) {
this.gotoAndStop("Dead");
this.charALIVE = false;
} else {
this.gotoAndStop("Hurt");
}
_parent.attachMovie("puffexplosion", "puffexplosion" + rockcheck, _root.attachDEPTH, {_x:_parent["rock" + rockcheck]._x, _y:_parent["rock" + rockcheck]._y, _xscale:50, _yscale:50});
_root.attachDEPTH = _root.attachDEPTH + 1;
_parent["rock" + rockcheck].removeMovieClip();
_root.soundManager_mc.playSound("B12sFire_Shot.wav", 0, 1);
}
this[("rock" + rockcheck) + "oldXDIS"] = this[("rock" + rockcheck) + "currentXDIS"];
this[("rock" + rockcheck) + "oldYDIS"] = this[("rock" + rockcheck) + "currentYDIS"];
this[("rock" + rockcheck) + "oldDIS"] = this[("rock" + rockcheck) + "currentDIS"];
}
rockcheck++;
}
}
}
if (random(48) == 0) {
_root.soundManager_mc.playSound("Claws_RatScurry_Loop.wav", 0, 999999999);
}
};
Instance of Symbol 81 MovieClip "sensor" in Symbol 1056 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 1056 MovieClip Frame 2
stop();
Symbol 1056 MovieClip Frame 3
stop();
Symbol 1056 MovieClip Frame 4
stop();
Instance of Symbol 1004 MovieClip "DeathBoundary" in Symbol 1057 MovieClip Frame 1
onClipEvent (load) {
_root.DeathBoundaryPresent = true;
}
Instance of Symbol 419 MovieClip in Symbol 1057 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
this.textcontent = "Man, you're wasting both of our damn time. You gotta game to beat! -Christopher J. Rock";
}
Instance of Symbol 419 MovieClip in Symbol 1057 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
this.textcontent = "You're dead. On the last boss, you've jumped off a cliff. You son of a bitch. -Christopher J. Rock";
}
Instance of Symbol 456 MovieClip in Symbol 1057 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 456 MovieClip in Symbol 1057 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 456 MovieClip in Symbol 1057 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 456 MovieClip in Symbol 1057 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 456 MovieClip in Symbol 1057 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 456 MovieClip in Symbol 1057 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 456 MovieClip in Symbol 1057 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 396 MovieClip in Symbol 1057 MovieClip Frame 1
onClipEvent (load) {
this.keynumber = 1;
}
Symbol 1086 Button
on (release) {
play();
}
Symbol 1121 Button
on (release) {
play();
}
Symbol 1123 MovieClip Frame 1
this.segment = 1;
_root.soundManager_mc.playSound("BreakfastEnding.wav", 0, 9999999999);
Instance of Symbol 81 MovieClip in Symbol 1123 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
this.skiparmed = false;
}
onClipEvent (enterFrame) {
_parent.nextsegment = _parent.segment + 1;
if (Key.isDown(_root.kSTART) && (this.skiparmed == true)) {
_parent.gotoAndPlay("segment" + _parent.nextsegment);
this.skiparmed = false;
} else if (!Key.isDown(_root.kSTART)) {
this.skiparmed = true;
}
}
Symbol 1123 MovieClip Frame 87
stop();
Symbol 1123 MovieClip Frame 88
this.segment = 2;
Symbol 1123 MovieClip Frame 190
stop();
Symbol 1123 MovieClip Frame 191
this.segment = 3;
Symbol 1123 MovieClip Frame 223
stop();
Symbol 1123 MovieClip Frame 224
this.segment = 4;
Symbol 1123 MovieClip Frame 417
stop();
Symbol 1123 MovieClip Frame 418
this.segment = 5;
Symbol 1123 MovieClip Frame 437
_root.go = true;
_parent.play();