Frame 1
function ngpage1() {
getURL ("http://www.truedarkness.newgrounds.com", "_blank");
}
function ngpage2() {
getURL ("http://www.luis.newgrounds.com", "_blank");
}
_root.timesPlayedThrough = 0;
_root.SCALEX = _root._xscale;
_root.SCALEY = _root._yscale;
_root.XXX = _root._x;
_root.YYY = _root._y;
SW = _root.Stage.width;
SH = _root.Stage.height;
_root.all = new Sound();
var myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
myMenu.builtInItems.quality = show();
var Dave = new ContextMenuItem("David Silver", ngpage1);
var Luis = new ContextMenuItem("Luis Castanon", ngpage2);
myMenu.customItems.push(Dave, Luis);
_root.menu = myMenu;
NewgroundsAPI.connectMovie(10867);
stop();
Frame 2
_x = _root.XXX;
_y = _root.YYY;
_xscale = _root.SCALEX;
_yscale = _root.SCALEY;
Stage.width = SW;
Stage.height = SH;
stop();
stop();
Instance of Symbol 355 MovieClip [API Connector (NewgroundsAPI)] in Frame 2
//component parameters
onClipEvent (construct) {
encryption_key = "c32N6L7Fo3K8AqYmdXSpk46zvyBPgFBZ";
movie_id = "10867";
movie_version = "";
fake_session = true;
debug = true;
error_screens = true;
medal_popups = true;
}
Frame 3
_root.deaths = 0;
_root.turns = 0;
_root.reStart = 0;
stopAllSounds();
_root.all.setVolume(100);
_root.nextFrame();
_root.Cam._x = 0;
_root.Cam._y = 0;
_root._x = _root.dx;
_root._y = _root.dy;
_root.player.grav = 0;
_root.player.yspeed = 0;
_root.player.xspeed = 0;
Frame 4
onEnterFrame = function () {
if ((Key.isDown(77) && (_root.SOFF != true)) && (_root.holdM != true)) {
_root.all.setVolume(0);
_root.SOFF = true;
_root.holdM = true;
}
if ((Key.isDown(77) && (_root.SOFF == true)) && (_root.holdM != true)) {
_root.all.setVolume(100);
_root.SOFF = false;
_root.holdM = true;
}
if ((!Key.isDown(77)) && (_root.holdM == true)) {
_root.holdM = false;
}
if ((_root.deaths >= 50) && (varDeath != true)) {
var _local2 = "Death Medal";
com.newgrounds.API.unlockMedal(_local2, _root.Cam._x, _root.Cam._y);
varDeath = true;
}
if ((_root.turns >= 500) && (varTurn != true)) {
var _local2 = "500th Flip";
com.newgrounds.API.unlockMedal(_local2, _root.Cam._x, _root.Cam._y);
varTurn = true;
}
};
_root.Cam.lvla.lvlb.lvl = "01";
_root.Cam.lvla.lvlb.lvl.gotoAndPlay(1);
Gravity = 1;
CamTurn = 0;
lastKeyPressed = 1;
lastKeyPressed2 = 0;
stop();
_root.dx = _root._x;
_root.dy = _root._y;
Instance of Symbol 397 MovieClip in Frame 4
onClipEvent (enterFrame) {
if ((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Cam.fadeOut._currentframe == 1)) {
_root.stopCam = true;
_root.Cam.fadeOut.play();
_root.stars.nextFrame();
} else if (_root.player.grounded == true) {
_root.stopCam = false;
}
}
Instance of Symbol 432 MovieClip "player" in Frame 4
onClipEvent (load) {
xspeed = 0;
yspeed = 0;
grav = 1;
w = _width / 2;
h = _height / 2;
scale = _xscale;
rot = _rotation;
grounded = true;
jump = false;
_root.playerX = _x;
_root.playerY = _y;
_root._x = _root.dx;
_root._y = _root.dy;
standStill = 0;
}
onClipEvent (enterFrame) {
standStill++;
if (standStill <= 5) {
_x = 124;
_y = 278;
}
if (Key.isDown(82)) {
_root.Cam.fadeOutRestart.play();
_root.reStart = _root.reStart + 1;
}
if (_root.Gravity == 1) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, (_y + h) + 30, true)) && (!_root.plat.hitTest(_x, (_y + h) + 30, true))) {
if (_rotation != rot) {
_rotation = (_rotation - 5);
}
} else {
_rotation = rot;
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, (_y + h) + 30, true)) && (!_root.plat.hitTest(_x, (_y + h) + 30, true))) {
if (_rotation != rot) {
_rotation = (_rotation + 5);
}
} else {
_rotation = rot;
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != rot) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed * 0.83;
_y = (_y + yspeed);
yspeed = yspeed + grav;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
xspeed = xspeed + 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
xspeed = xspeed - 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
yspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (jump != true)) && (_currentframe != 3)) {
this.gotoAndStop(1);
}
if (_root.plat.hitTest(_x, (_y + h) + 4, grounded)) {
_x = (_root.plat._x - _root.plat.dx);
}
if ((_root.land.hitTest(_x, (_y + h) + 10, true) && (yspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest(_x, (_y + h) + 6, true) && (yspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y + h) + 4, true) or _root.plat.hitTest(_x, (_y + h) + 2, true)) {
if (!Key.isDown(38)) {
yspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest(_x, (_y + h) - 3, true)) {
_y = (_y - 0.1);
}
while (_root.plat.hitTest(_x, (_y + h) - 3, true)) {
_y = (_y - 0.1);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x + w, _y, true) or _root.plat.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
while (_root.plat.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.land.hitTest(_x - w, _y, true) or _root.plat.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
while (_root.plat.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
yspeed = 0;
_rotation = rot;
jump = false;
}
}
if (_root.Gravity == 2) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x - w) + 30, _y, true)) && (!_root.plat.hitTest((_x - w) + 30, _y, true))) {
if (_rotation >= (rot - 90)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rot - 90);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x - w) + 30, _y, true)) && (!_root.plat.hitTest((_x - w) + 30, _y, true))) {
if (_rotation != (rot - 90)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot - 90);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot - 90)) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed + grav;
_y = (_y + yspeed);
yspeed = yspeed * 0.83;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
yspeed = yspeed - 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
yspeed = yspeed + 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
xspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest((_x + w) + 55, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x + w) + 45, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest((_x + w) + 45, _y, true) or _root.plat.hitTest((_x + w) + 45, _y, true)) {
if (!Key.isDown(38)) {
xspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest((_x + w) + 38, _y, true)) {
_x = (_x - 0.4);
}
while (_root.plat.hitTest((_x + w) + 38, _y, true)) {
_x = (_x - 0.4);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.plat.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.plat.hitTest(_x, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.land.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
_rotation = (rot - 90);
}
}
if (_root.Gravity == 3) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x + w) + 30, _y, true)) && (!_root.plat.hitTest((_x + w) + 30, _y, true))) {
if (_rotation != (rot - 180)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rot - 180);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x + w) + 30, _y - h, true)) && (!_root.plat.hitTest((_x + w) + 30, _y - h, true))) {
if (_rotation != (rot + 180)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot + 180);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot - 180)) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed * 0.83;
_y = (_y + yspeed);
yspeed = yspeed - grav;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
xspeed = xspeed - 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
xspeed = xspeed + 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
yspeed = 10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest(_x, (_y - h) - 11, true) && (yspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest(_x, (_y - h) - 6, true) && (yspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y - h) - 5, true) or _root.plat.hitTest(_x, (_y - h) - 3, true)) {
if (!Key.isDown(38)) {
yspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest(_x, (_y - h) + 5, true)) {
_y = (_y + 0.1);
}
while (_root.plat.hitTest(_x, (_y - h) + 5, true)) {
_y = (_y + 0.1);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.plat.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.plat.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.land.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (_root.plat.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.plat.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
yspeed = 0;
_rotation = (rot - 180);
}
}
if (_root.Gravity == 4) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, _y, true)) && (!_root.plat.hitTest(_x, _y, true))) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rott + 90);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, _y - h, true)) && (!_root.plat.hitTest(_x, _y - h, true))) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot + 90);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation - 9);
}
}
_x = (_x - xspeed);
xspeed = xspeed + grav;
_y = (_y + yspeed);
yspeed = yspeed * 0.83;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
yspeed = yspeed + 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
yspeed = yspeed - 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
xspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest((_x - w) - 60, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x - w) - 50, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest((_x - w) - 43, _y, true) or _root.plat.hitTest((_x - w) - 43, _y, true)) {
if (!Key.isDown(38)) {
xspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest((_x - w) - 38, _y, true)) {
_x = (_x + 0.1);
}
grounded = true;
jump = false;
while (_root.plat.hitTest((_x - w) - 38, _y, true)) {
_x = (_x + 0.1);
}
} else {
grounded = false;
}
if ((_root.land.hitTest((_x - w) - 55, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x - w) - 45, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y + h) - 30, true) or _root.plat.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
while (_root.plat.hitTest(_x + w, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.land.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
_rotation = (rot + 90);
}
}
if (((grounded && (!this.hitTest(_root.noGrav1))) && (!this.hitTest(_root.noGrav2))) && (!this.hitTest(_root.noGrav3))) {
if (Key.isDown(83) && (sHold != true)) {
sHold = true;
}
}
}
Instance of Symbol 466 MovieClip "Cam" in Frame 4
onClipEvent (load) {
_rotation = 360;
rot = _rotation;
_root.SCALERX = _xscale;
_root.SCALERY = _yscale;
rot2 = rot + 270;
scalex = _xscale + 20;
scaley = _yscale + 20;
_xscale = (scalex + 100);
_yscale = (scaley + 100);
shiftHold = 0;
}
onClipEvent (enterFrame) {
if (_root.stopCam != true) {
_x = (_x + ((_root.player._x - _x) / 10));
_y = (_y + ((_root.player._y - _y) / 10));
}
if (!Key.isDown(16)) {
if (_xscale > scalex) {
_xscale = (_xscale - 2);
}
if (_yscale > scaley) {
_yscale = (_yscale - 2);
}
shiftHold = 0;
}
if (Key.isDown(16)) {
shiftHold++;
if (_xscale < (scalex + 100)) {
_xscale = (_xscale + 2);
}
if (_yscale < (scaley + 100)) {
_yscale = (_yscale + 2);
}
}
_root.bg2._x = _x;
_root.bg2._y = _y;
if (shiftHold >= 900) {
if (_root.gotShiftMedal != true) {
shiftHold = 0;
_root.gotShiftMedal = true;
}
}
}
Instance of Symbol 467 MovieClip in Frame 4
onClipEvent (enterFrame) {
_x = _root.Cam._x;
_y = _root.Cam._y;
}
Frame 5
_root.nextFrame();
_root.Cam._x = 0;
_root.Cam._y = 0;
Frame 6
_root.Cam.lvla.lvlb.lvl = "02";
_root.Cam.lvla.lvlb.lvl.gotoAndPlay(1);
function rotateCamBack() {
if (_root.Cam._rotation < _root.Cam.rot) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
if (_root.Cam._rotation > _root.Cam.rot) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
}
function rotateCam1() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation > (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
if (_root.Cam._rotation < (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation > (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
if (_root.Cam._rotation < (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
}
function rotateCam2() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation > (_root.Cam.rot - 180)) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation < (_root.Cam.rot + 180)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
}
function rotateCam3() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation != 90) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation != 90) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
}
Gravity = 1;
CamTurn = 0;
lastKeyPressed = 1;
lastKeyPressed2 = 0;
_root.stopCam = false;
_root._x = _root.dx;
_root._y = _root.dy;
stop();
onEnterFrame = function () {
if ((_root.deaths >= 50) && (varDeath != true)) {
var _local2 = "Death Medal";
com.newgrounds.API.unlockMedal(_local2, _root.Cam._x, _root.Cam._y);
varDeath = true;
}
if ((_root.turns >= 500) && (varTurn != true)) {
var _local2 = "500th Flip";
com.newgrounds.API.unlockMedal(_local2, _root.Cam._x, _root.Cam._y);
varTurn = true;
}
if ((Key.isDown(77) && (_root.SOFF != true)) && (_root.holdM != true)) {
_root.all.setVolume(0);
_root.SOFF = true;
_root.holdM = true;
}
if ((Key.isDown(77) && (_root.SOFF == true)) && (_root.holdM != true)) {
_root.all.setVolume(100);
_root.SOFF = false;
_root.holdM = true;
}
if ((!Key.isDown(77)) && (_root.holdM == true)) {
_root.holdM = false;
}
if (Gravity == 1) {
rotateCamBack();
}
if (Gravity == 2) {
rotateCam1();
}
if (Gravity == 3) {
rotateCam2();
}
if (Gravity == 4) {
rotateCam3();
}
};
Instance of Symbol 397 MovieClip in Frame 6
onClipEvent (enterFrame) {
if (this.hitTest(_root.player)) {
_root.stopCam = true;
_root.Cam.fadeOut.play();
}
}
Instance of Symbol 432 MovieClip "player" in Frame 6
onClipEvent (load) {
xspeed = 0;
yspeed = 0;
grav = 1;
w = _width / 2;
h = _height / 2;
scale = _xscale;
rot = _rotation;
grounded = true;
jump = false;
_root.playerX = _x;
_root.playerY = _y;
_root._x = _root.dx;
_root._y = _root.dy;
standStill = 0;
}
onClipEvent (enterFrame) {
standStill++;
if (standStill <= 5) {
_x = -20;
_y = 292;
}
if (Key.isDown(82)) {
_root.Cam.fadeOutRestart.play();
_root.reStart = _root.reStart + 1;
}
if (_root.Gravity == 1) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, (_y + h) + 30, true)) && (!_root.plat.hitTest(_x, (_y + h) + 30, true))) {
if (_rotation != rot) {
_rotation = (_rotation - 5);
}
} else {
_rotation = rot;
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, (_y + h) + 30, true)) && (!_root.plat.hitTest(_x, (_y + h) + 30, true))) {
if (_rotation != rot) {
_rotation = (_rotation + 5);
}
} else {
_rotation = rot;
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != rot) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed * 0.83;
_y = (_y + yspeed);
yspeed = yspeed + grav;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
xspeed = xspeed + 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
xspeed = xspeed - 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
yspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (jump != true)) && (_currentframe != 3)) {
this.gotoAndStop(1);
}
if (_root.plat.hitTest(_x, (_y + h) + 4, grounded)) {
_x = (_root.plat._x - _root.plat.dx);
}
if ((_root.land.hitTest(_x, (_y + h) + 10, true) && (yspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest(_x, (_y + h) + 6, true) && (yspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y + h) + 4, true) or _root.plat.hitTest(_x, (_y + h) + 2, true)) {
if (!Key.isDown(38)) {
yspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest(_x, (_y + h) - 3, true)) {
_y = (_y - 0.1);
}
while (_root.plat.hitTest(_x, (_y + h) - 3, true)) {
_y = (_y - 0.1);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x + w, _y, true) or _root.plat.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
while (_root.plat.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.land.hitTest(_x - w, _y, true) or _root.plat.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
while (_root.plat.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
yspeed = 0;
_rotation = rot;
jump = false;
}
}
if (_root.Gravity == 2) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x - w) + 30, _y, true)) && (!_root.plat.hitTest((_x - w) + 30, _y, true))) {
if (_rotation >= (rot - 90)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rot - 90);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x - w) + 30, _y, true)) && (!_root.plat.hitTest((_x - w) + 30, _y, true))) {
if (_rotation != (rot - 90)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot - 90);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot - 90)) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed + grav;
_y = (_y + yspeed);
yspeed = yspeed * 0.83;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
yspeed = yspeed - 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
yspeed = yspeed + 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
xspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest((_x + w) + 55, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x + w) + 45, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest((_x + w) + 45, _y, true) or _root.plat.hitTest((_x + w) + 45, _y, true)) {
if (!Key.isDown(38)) {
xspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest((_x + w) + 38, _y, true)) {
_x = (_x - 0.4);
}
while (_root.plat.hitTest((_x + w) + 38, _y, true)) {
_x = (_x - 0.4);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.plat.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.plat.hitTest(_x, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.land.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
_rotation = (rot - 90);
}
}
if (_root.Gravity == 3) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x + w) + 30, _y, true)) && (!_root.plat.hitTest((_x + w) + 30, _y, true))) {
if (_rotation != (rot - 180)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rot - 180);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x + w) + 30, _y - h, true)) && (!_root.plat.hitTest((_x + w) + 30, _y - h, true))) {
if (_rotation != (rot + 180)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot + 180);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot - 180)) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed * 0.83;
_y = (_y + yspeed);
yspeed = yspeed - grav;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
xspeed = xspeed - 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
xspeed = xspeed + 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
yspeed = 10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest(_x, (_y - h) - 11, true) && (yspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest(_x, (_y - h) - 6, true) && (yspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y - h) - 5, true) or _root.plat.hitTest(_x, (_y - h) - 3, true)) {
if (!Key.isDown(38)) {
yspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest(_x, (_y - h) + 5, true)) {
_y = (_y + 0.1);
}
while (_root.plat.hitTest(_x, (_y - h) + 5, true)) {
_y = (_y + 0.1);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.plat.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.plat.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.land.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (_root.plat.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.plat.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
yspeed = 0;
_rotation = (rot - 180);
}
}
if (_root.Gravity == 4) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, _y, true)) && (!_root.plat.hitTest(_x, _y, true))) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rott + 90);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, _y - h, true)) && (!_root.plat.hitTest(_x, _y - h, true))) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot + 90);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation - 9);
}
}
_x = (_x - xspeed);
xspeed = xspeed + grav;
_y = (_y + yspeed);
yspeed = yspeed * 0.83;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
yspeed = yspeed + 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
yspeed = yspeed - 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
xspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest((_x - w) - 60, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x - w) - 50, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest((_x - w) - 43, _y, true) or _root.plat.hitTest((_x - w) - 43, _y, true)) {
if (!Key.isDown(38)) {
xspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest((_x - w) - 38, _y, true)) {
_x = (_x + 0.1);
}
grounded = true;
jump = false;
while (_root.plat.hitTest((_x - w) - 38, _y, true)) {
_x = (_x + 0.1);
}
} else {
grounded = false;
}
if ((_root.land.hitTest((_x - w) - 55, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x - w) - 45, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y + h) - 30, true) or _root.plat.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
while (_root.plat.hitTest(_x + w, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.land.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
_rotation = (rot + 90);
}
}
if (((grounded && (!this.hitTest(_root.noGrav1))) && (!this.hitTest(_root.noGrav2))) && (!this.hitTest(_root.noGrav3))) {
if (Key.isDown(83) && (sHold != true)) {
sHold = true;
}
if ((!Key.isDown(83)) && (sHold == true)) {
sHold = false;
}
if (Key.isDown(65) && (aHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 0;
if (_root.Gravity <= 1) {
_root.Gravity = 5;
}
_root.lastKeyPressed = 1;
_root.CamTurn--;
_root.Gravity--;
aHold = true;
}
if ((!Key.isDown(65)) && (aHold == true)) {
aHold = false;
}
if (Key.isDown(68) && (dHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 0;
_root.Gravity++;
if (_root.Gravity > 4) {
_root.Gravity = 1;
}
_root.lastKeyPressed = 2;
dHold = true;
}
if ((!Key.isDown(68)) && (dHold == true)) {
dHold = false;
}
if (Key.isDown(87) && (wHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 3;
if (_root.Gravity == 1) {
_root.Gravity = 3;
} else if (_root.Gravity == 3) {
_root.Gravity = 1;
}
if (_root.Gravity == 2) {
_root.Gravity = 4;
} else if (_root.Gravity == 4) {
_root.Gravity = 2;
}
wHold = true;
}
if ((!Key.isDown(87)) && (wHold == true)) {
wHold = false;
}
}
}
Instance of Symbol 466 MovieClip "Cam" in Frame 6
onClipEvent (load) {
_rotation = 360;
rot = _rotation;
rot2 = rot + 270;
scalex = _xscale + 20;
scaley = _yscale + 20;
_xscale = (scalex + 100);
_yscale = (scaley + 100);
shiftHold = 0;
}
onClipEvent (enterFrame) {
if (_root.stopCam != true) {
_x = (_x + ((_root.player._x - _x) / 10));
_y = (_y + ((_root.player._y - _y) / 10));
}
if (!Key.isDown(16)) {
if (_xscale > scalex) {
_xscale = (_xscale - 2);
}
if (_yscale > scaley) {
_yscale = (_yscale - 2);
}
shiftHold = 0;
}
if (Key.isDown(16)) {
shiftHold++;
if (_xscale < (scalex + 100)) {
_xscale = (_xscale + 2);
}
if (_yscale < (scaley + 100)) {
_yscale = (_yscale + 2);
}
}
_root.bg2._x = _x;
_root.bg2._y = _y;
if (shiftHold >= 900) {
if (_root.gotShiftMedal != true) {
shiftHold = 0;
_root.gotShiftMedal = true;
}
}
}
Instance of Symbol 467 MovieClip in Frame 6
onClipEvent (enterFrame) {
_x = _root.Cam._x;
_y = _root.Cam._y;
}
Frame 7
_root.nextFrame();
_root.Cam._x = 0;
_root.Cam._y = 0;
_root._x = _root.dx;
_root._y = _root.dy;
_root.player.grav = 0;
_root.player.yspeed = 0;
_root.player.xspeed = 0;
Frame 8
_root.Cam.lvla.lvlb.lvl = "03";
function rotateCamBack() {
if (_root.Cam._rotation < _root.Cam.rot) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
if (_root.Cam._rotation > _root.Cam.rot) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
_root.turn++;
}
function rotateCam1() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation > (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
if (_root.Cam._rotation < (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation > (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
if (_root.Cam._rotation < (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
function rotateCam2() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation > (_root.Cam.rot - 180)) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation < (_root.Cam.rot + 180)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
function rotateCam3() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation != 90) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation != 90) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
Gravity = 1;
CamTurn = 0;
lastKeyPressed = 1;
lastKeyPressed2 = 0;
_root.stopCam = false;
_root._x = _root.dx;
_root._y = _root.dy;
_x = _root.playerX;
_y = _root.playerY;
stop();
onEnterFrame = function () {
if ((_root.deaths >= 50) && (varDeath != true)) {
var _local2 = "Death Medal";
com.newgrounds.API.unlockMedal(_local2, _root.Cam._x, _root.Cam._y);
varDeath = true;
}
if ((_root.turns >= 500) && (varTurn != true)) {
var _local2 = "500th Flip";
com.newgrounds.API.unlockMedal(_local2, _root.Cam._x, _root.Cam._y);
varTurn = true;
}
if ((Key.isDown(77) && (_root.SOFF != true)) && (_root.holdM != true)) {
_root.all.setVolume(0);
_root.SOFF = true;
_root.holdM = true;
}
if ((Key.isDown(77) && (_root.SOFF == true)) && (_root.holdM != true)) {
_root.all.setVolume(100);
_root.SOFF = false;
_root.holdM = true;
}
if ((!Key.isDown(77)) && (_root.holdM == true)) {
_root.holdM = false;
}
if (Gravity == 1) {
rotateCamBack();
}
if (Gravity == 2) {
rotateCam1();
}
if (Gravity == 3) {
rotateCam2();
}
if (Gravity == 4) {
rotateCam3();
}
};
Instance of Symbol 397 MovieClip in Frame 8
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 1)) && (_root.player._y > (_y - 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 8
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 4)) && (_root.player._x < (_x + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip "exitt" in Frame 8
onClipEvent (enterFrame) {
if ((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Cam.fadeOut._currentframe == 1)) {
_root.stopCam = true;
_root.Cam.fadeOut.play();
}
}
Instance of Symbol 397 MovieClip in Frame 8
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 2)) && (_root.player._x > (_x - 200))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 8
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 3)) && (_root.player._y < (_y + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 432 MovieClip "player" in Frame 8
onClipEvent (load) {
xspeed = 0;
yspeed = 0;
grav = 1;
w = _width / 2;
h = _height / 2;
scale = _xscale;
rot = _rotation;
grounded = true;
jump = false;
_root.playerX = _x;
_root.playerY = _y;
_root._x = _root.dx;
_root._y = _root.dy;
standStill = 0;
}
onClipEvent (enterFrame) {
standStill++;
if (standStill <= 5) {
_x = -20;
_y = 292;
}
if (Key.isDown(82)) {
_root.Cam.fadeOutRestart.play();
_root.reStart = _root.reStart + 1;
}
if (_root.Gravity == 1) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, (_y + h) + 30, true)) && (!_root.plat.hitTest(_x, (_y + h) + 30, true))) {
if (_rotation != rot) {
_rotation = (_rotation - 5);
}
} else {
_rotation = rot;
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, (_y + h) + 30, true)) && (!_root.plat.hitTest(_x, (_y + h) + 30, true))) {
if (_rotation != rot) {
_rotation = (_rotation + 5);
}
} else {
_rotation = rot;
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != rot) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed * 0.83;
_y = (_y + yspeed);
yspeed = yspeed + grav;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
xspeed = xspeed + 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
xspeed = xspeed - 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
yspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (jump != true)) && (_currentframe != 3)) {
this.gotoAndStop(1);
}
if (_root.plat.hitTest(_x, (_y + h) + 4, grounded)) {
_x = (_root.plat._x - _root.plat.dx);
}
if ((_root.land.hitTest(_x, (_y + h) + 10, true) && (yspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest(_x, (_y + h) + 6, true) && (yspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y + h) + 4, true) or _root.plat.hitTest(_x, (_y + h) + 2, true)) {
if (!Key.isDown(38)) {
yspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest(_x, (_y + h) - 3, true)) {
_y = (_y - 0.1);
}
while (_root.plat.hitTest(_x, (_y + h) - 3, true)) {
_y = (_y - 0.1);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x + w, _y, true) or _root.plat.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
while (_root.plat.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.land.hitTest(_x - w, _y, true) or _root.plat.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
while (_root.plat.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
yspeed = 0;
_rotation = rot;
jump = false;
}
}
if (_root.Gravity == 2) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x - w) + 30, _y, true)) && (!_root.plat.hitTest((_x - w) + 30, _y, true))) {
if (_rotation >= (rot - 90)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rot - 90);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x - w) + 30, _y, true)) && (!_root.plat.hitTest((_x - w) + 30, _y, true))) {
if (_rotation != (rot - 90)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot - 90);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot - 90)) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed + grav;
_y = (_y + yspeed);
yspeed = yspeed * 0.83;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
yspeed = yspeed - 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
yspeed = yspeed + 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
xspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest((_x + w) + 55, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x + w) + 45, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest((_x + w) + 45, _y, true) or _root.plat.hitTest((_x + w) + 45, _y, true)) {
if (!Key.isDown(38)) {
xspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest((_x + w) + 38, _y, true)) {
_x = (_x - 0.4);
}
while (_root.plat.hitTest((_x + w) + 38, _y, true)) {
_x = (_x - 0.4);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.plat.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.plat.hitTest(_x, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.land.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
_rotation = (rot - 90);
}
}
if (_root.Gravity == 3) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x + w) + 30, _y, true)) && (!_root.plat.hitTest((_x + w) + 30, _y, true))) {
if (_rotation != (rot - 180)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rot - 180);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x + w) + 30, _y - h, true)) && (!_root.plat.hitTest((_x + w) + 30, _y - h, true))) {
if (_rotation != (rot + 180)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot + 180);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot - 180)) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed * 0.83;
_y = (_y + yspeed);
yspeed = yspeed - grav;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
xspeed = xspeed - 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
xspeed = xspeed + 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
yspeed = 10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest(_x, (_y - h) - 11, true) && (yspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest(_x, (_y - h) - 6, true) && (yspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y - h) - 5, true) or _root.plat.hitTest(_x, (_y - h) - 3, true)) {
if (!Key.isDown(38)) {
yspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest(_x, (_y - h) + 5, true)) {
_y = (_y + 0.1);
}
while (_root.plat.hitTest(_x, (_y - h) + 5, true)) {
_y = (_y + 0.1);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.plat.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.plat.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.land.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (_root.plat.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.plat.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
yspeed = 0;
_rotation = (rot - 180);
}
}
if (_root.Gravity == 4) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, _y, true)) && (!_root.plat.hitTest(_x, _y, true))) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rott + 90);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, _y - h, true)) && (!_root.plat.hitTest(_x, _y - h, true))) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot + 90);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation - 9);
}
}
_x = (_x - xspeed);
xspeed = xspeed + grav;
_y = (_y + yspeed);
yspeed = yspeed * 0.83;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
yspeed = yspeed + 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
yspeed = yspeed - 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
xspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest((_x - w) - 60, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x - w) - 50, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest((_x - w) - 43, _y, true) or _root.plat.hitTest((_x - w) - 43, _y, true)) {
if (!Key.isDown(38)) {
xspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest((_x - w) - 38, _y, true)) {
_x = (_x + 0.1);
}
grounded = true;
jump = false;
while (_root.plat.hitTest((_x - w) - 38, _y, true)) {
_x = (_x + 0.1);
}
} else {
grounded = false;
}
if ((_root.land.hitTest((_x - w) - 55, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x - w) - 45, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y + h) - 30, true) or _root.plat.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
while (_root.plat.hitTest(_x + w, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.land.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
_rotation = (rot + 90);
}
}
if (((grounded && (!this.hitTest(_root.noGrav1))) && (!this.hitTest(_root.noGrav2))) && (!this.hitTest(_root.noGrav3))) {
if (Key.isDown(83) && (sHold != true)) {
sHold = true;
}
if ((!Key.isDown(83)) && (sHold == true)) {
sHold = false;
}
if (Key.isDown(65) && (aHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 0;
if (_root.Gravity <= 1) {
_root.Gravity = 5;
}
_root.lastKeyPressed = 1;
_root.CamTurn--;
_root.Gravity--;
aHold = true;
}
if ((!Key.isDown(65)) && (aHold == true)) {
aHold = false;
}
if (Key.isDown(68) && (dHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 0;
_root.Gravity++;
if (_root.Gravity > 4) {
_root.Gravity = 1;
}
_root.lastKeyPressed = 2;
dHold = true;
}
if ((!Key.isDown(68)) && (dHold == true)) {
dHold = false;
}
if (Key.isDown(87) && (wHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 3;
if (_root.Gravity == 1) {
_root.Gravity = 3;
} else if (_root.Gravity == 3) {
_root.Gravity = 1;
}
if (_root.Gravity == 2) {
_root.Gravity = 4;
} else if (_root.Gravity == 4) {
_root.Gravity = 2;
}
wHold = true;
}
if ((!Key.isDown(87)) && (wHold == true)) {
wHold = false;
}
}
}
Instance of Symbol 466 MovieClip "Cam" in Frame 8
onClipEvent (load) {
_rotation = 360;
rot = _rotation;
rot2 = rot + 270;
scalex = _xscale + 20;
scaley = _yscale + 20;
_xscale = (scalex + 100);
_yscale = (scaley + 100);
shiftHold = 0;
}
onClipEvent (enterFrame) {
if (_root.stopCam != true) {
_x = (_x + ((_root.player._x - _x) / 10));
_y = (_y + ((_root.player._y - _y) / 10));
}
if (!Key.isDown(16)) {
if (_xscale > scalex) {
_xscale = (_xscale - 2);
}
if (_yscale > scaley) {
_yscale = (_yscale - 2);
}
shiftHold = 0;
}
if (Key.isDown(16)) {
shiftHold++;
if (_xscale < (scalex + 100)) {
_xscale = (_xscale + 2);
}
if (_yscale < (scaley + 100)) {
_yscale = (_yscale + 2);
}
}
_root.bg2._x = _x;
_root.bg2._y = _y;
if (shiftHold >= 900) {
if (_root.gotShiftMedal != true) {
shiftHold = 0;
_root.gotShiftMedal = true;
}
}
}
Instance of Symbol 467 MovieClip in Frame 8
onClipEvent (enterFrame) {
_x = _root.Cam._x;
_y = _root.Cam._y;
}
Frame 9
_root.nextFrame();
_root.Cam._x = 0;
_root.Cam._y = 0;
_root._x = _root.dx;
_root._y = _root.dy;
_root.player.grav = 0;
_root.player.yspeed = 0;
_root.player.xspeed = 0;
Frame 10
_root.Cam.lvla.lvlb.lvl = "04";
function rotateCamBack() {
if (_root.Cam._rotation < _root.Cam.rot) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
if (_root.Cam._rotation > _root.Cam.rot) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
_root.turn++;
}
function rotateCam1() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation > (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
if (_root.Cam._rotation < (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation > (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
if (_root.Cam._rotation < (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
function rotateCam2() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation > (_root.Cam.rot - 180)) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation < (_root.Cam.rot + 180)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
function rotateCam3() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation != 90) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation != 90) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
Gravity = 1;
CamTurn = 0;
lastKeyPressed = 1;
lastKeyPressed2 = 0;
_root.stopCam = false;
_root._x = _root.dx;
_root._y = _root.dy;
stop();
onEnterFrame = function () {
if ((_root.deaths >= 50) && (varDeath != true)) {
var _local2 = "Death Medal";
com.newgrounds.API.unlockMedal(_local2, _root.Cam._x, _root.Cam._y);
varDeath = true;
}
if ((_root.turns >= 500) && (varTurn != true)) {
var _local2 = "500th Flip";
com.newgrounds.API.unlockMedal(_local2, _root.Cam._x, _root.Cam._y);
varTurn = true;
}
if ((Key.isDown(77) && (_root.SOFF != true)) && (_root.holdM != true)) {
_root.all.setVolume(0);
_root.SOFF = true;
_root.holdM = true;
}
if ((Key.isDown(77) && (_root.SOFF == true)) && (_root.holdM != true)) {
_root.all.setVolume(100);
_root.SOFF = false;
_root.holdM = true;
}
if ((!Key.isDown(77)) && (_root.holdM == true)) {
_root.holdM = false;
}
if (Gravity == 1) {
rotateCamBack();
}
if (Gravity == 2) {
rotateCam1();
}
if (Gravity == 3) {
rotateCam2();
}
if (Gravity == 4) {
rotateCam3();
}
};
Instance of Symbol 397 MovieClip in Frame 10
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 1)) && (_root.player._y > (_y - 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 10
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 2)) && (_root.player._x > (_x - 200))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 10
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 3)) && (_root.player._y < (_y + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 10
onClipEvent (enterFrame) {
if ((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Cam.fadeOut._currentframe == 1)) {
_root.stopCam = true;
_root.Cam.fadeOut.play();
}
}
Instance of Symbol 432 MovieClip "player" in Frame 10
onClipEvent (load) {
xspeed = 0;
yspeed = 0;
grav = 1;
w = _width / 2;
h = _height / 2;
scale = _xscale;
rot = _rotation;
grounded = true;
jump = false;
_root.playerX = _x;
_root.playerY = _y;
_root._x = _root.dx;
_root._y = _root.dy;
standStill = 0;
}
onClipEvent (enterFrame) {
standStill++;
if (standStill <= 5) {
_x = -1975;
_y = -422;
}
if (Key.isDown(82)) {
_root.Cam.fadeOutRestart.play();
_root.reStart = _root.reStart + 1;
}
if (_root.Gravity == 1) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, (_y + h) + 30, true)) && (!_root.plat.hitTest(_x, (_y + h) + 30, true))) {
if (_rotation != rot) {
_rotation = (_rotation - 5);
}
} else {
_rotation = rot;
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, (_y + h) + 30, true)) && (!_root.plat.hitTest(_x, (_y + h) + 30, true))) {
if (_rotation != rot) {
_rotation = (_rotation + 5);
}
} else {
_rotation = rot;
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != rot) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed * 0.83;
_y = (_y + yspeed);
yspeed = yspeed + grav;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
xspeed = xspeed + 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
xspeed = xspeed - 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
yspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (jump != true)) && (_currentframe != 3)) {
this.gotoAndStop(1);
}
if (_root.plat.hitTest(_x, (_y + h) + 4, grounded)) {
_x = (_root.plat._x - _root.plat.dx);
}
if ((_root.land.hitTest(_x, (_y + h) + 10, true) && (yspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest(_x, (_y + h) + 6, true) && (yspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y + h) + 4, true) or _root.plat.hitTest(_x, (_y + h) + 2, true)) {
if (!Key.isDown(38)) {
yspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest(_x, (_y + h) - 3, true)) {
_y = (_y - 0.1);
}
while (_root.plat.hitTest(_x, (_y + h) - 3, true)) {
_y = (_y - 0.1);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x + w, _y, true) or _root.plat.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
while (_root.plat.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.land.hitTest(_x - w, _y, true) or _root.plat.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
while (_root.plat.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
yspeed = 0;
_rotation = rot;
jump = false;
}
}
if (_root.Gravity == 2) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x - w) + 30, _y, true)) && (!_root.plat.hitTest((_x - w) + 30, _y, true))) {
if (_rotation >= (rot - 90)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rot - 90);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x - w) + 30, _y, true)) && (!_root.plat.hitTest((_x - w) + 30, _y, true))) {
if (_rotation != (rot - 90)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot - 90);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot - 90)) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed + grav;
_y = (_y + yspeed);
yspeed = yspeed * 0.83;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
yspeed = yspeed - 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
yspeed = yspeed + 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
xspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest((_x + w) + 55, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x + w) + 45, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest((_x + w) + 45, _y, true) or _root.plat.hitTest((_x + w) + 45, _y, true)) {
if (!Key.isDown(38)) {
xspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest((_x + w) + 38, _y, true)) {
_x = (_x - 0.4);
}
while (_root.plat.hitTest((_x + w) + 38, _y, true)) {
_x = (_x - 0.4);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.plat.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.plat.hitTest(_x, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.land.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
_rotation = (rot - 90);
}
}
if (_root.Gravity == 3) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x + w) + 30, _y, true)) && (!_root.plat.hitTest((_x + w) + 30, _y, true))) {
if (_rotation != (rot - 180)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rot - 180);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x + w) + 30, _y - h, true)) && (!_root.plat.hitTest((_x + w) + 30, _y - h, true))) {
if (_rotation != (rot + 180)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot + 180);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot - 180)) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed * 0.83;
_y = (_y + yspeed);
yspeed = yspeed - grav;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
xspeed = xspeed - 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
xspeed = xspeed + 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
yspeed = 10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest(_x, (_y - h) - 11, true) && (yspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest(_x, (_y - h) - 6, true) && (yspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y - h) - 5, true) or _root.plat.hitTest(_x, (_y - h) - 3, true)) {
if (!Key.isDown(38)) {
yspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest(_x, (_y - h) + 5, true)) {
_y = (_y + 0.1);
}
while (_root.plat.hitTest(_x, (_y - h) + 5, true)) {
_y = (_y + 0.1);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.plat.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.plat.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.land.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (_root.plat.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.plat.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
yspeed = 0;
_rotation = (rot - 180);
}
}
if (_root.Gravity == 4) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, _y, true)) && (!_root.plat.hitTest(_x, _y, true))) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rott + 90);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, _y - h, true)) && (!_root.plat.hitTest(_x, _y - h, true))) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot + 90);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation - 9);
}
}
_x = (_x - xspeed);
xspeed = xspeed + grav;
_y = (_y + yspeed);
yspeed = yspeed * 0.83;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
yspeed = yspeed + 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
yspeed = yspeed - 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
xspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest((_x - w) - 60, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x - w) - 50, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest((_x - w) - 43, _y, true) or _root.plat.hitTest((_x - w) - 43, _y, true)) {
if (!Key.isDown(38)) {
xspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest((_x - w) - 38, _y, true)) {
_x = (_x + 0.1);
}
grounded = true;
jump = false;
while (_root.plat.hitTest((_x - w) - 38, _y, true)) {
_x = (_x + 0.1);
}
} else {
grounded = false;
}
if ((_root.land.hitTest((_x - w) - 55, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x - w) - 45, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y + h) - 30, true) or _root.plat.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
while (_root.plat.hitTest(_x + w, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.land.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
_rotation = (rot + 90);
}
}
if (((grounded && (!this.hitTest(_root.noGrav1))) && (!this.hitTest(_root.noGrav2))) && (!this.hitTest(_root.noGrav3))) {
if (Key.isDown(83) && (sHold != true)) {
sHold = true;
}
if ((!Key.isDown(83)) && (sHold == true)) {
sHold = false;
}
if (Key.isDown(65) && (aHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 0;
if (_root.Gravity <= 1) {
_root.Gravity = 5;
}
_root.lastKeyPressed = 1;
_root.CamTurn--;
_root.Gravity--;
aHold = true;
}
if ((!Key.isDown(65)) && (aHold == true)) {
aHold = false;
}
if (Key.isDown(68) && (dHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 0;
_root.Gravity++;
if (_root.Gravity > 4) {
_root.Gravity = 1;
}
_root.lastKeyPressed = 2;
dHold = true;
}
if ((!Key.isDown(68)) && (dHold == true)) {
dHold = false;
}
if (Key.isDown(87) && (wHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 3;
if (_root.Gravity == 1) {
_root.Gravity = 3;
} else if (_root.Gravity == 3) {
_root.Gravity = 1;
}
if (_root.Gravity == 2) {
_root.Gravity = 4;
} else if (_root.Gravity == 4) {
_root.Gravity = 2;
}
wHold = true;
}
if ((!Key.isDown(87)) && (wHold == true)) {
wHold = false;
}
}
}
Instance of Symbol 466 MovieClip "Cam" in Frame 10
onClipEvent (load) {
_rotation = 360;
rot = _rotation;
rot2 = rot + 270;
scalex = _xscale + 20;
scaley = _yscale + 20;
_xscale = (scalex + 100);
_yscale = (scaley + 100);
shiftHold = 0;
}
onClipEvent (enterFrame) {
if (_root.stopCam != true) {
_x = (_x + ((_root.player._x - _x) / 10));
_y = (_y + ((_root.player._y - _y) / 10));
}
if (!Key.isDown(16)) {
if (_xscale > scalex) {
_xscale = (_xscale - 2);
}
if (_yscale > scaley) {
_yscale = (_yscale - 2);
}
shiftHold = 0;
}
if (Key.isDown(16)) {
shiftHold++;
if (_xscale < (scalex + 100)) {
_xscale = (_xscale + 2);
}
if (_yscale < (scaley + 100)) {
_yscale = (_yscale + 2);
}
}
_root.bg2._x = _x;
_root.bg2._y = _y;
if (shiftHold >= 900) {
if (_root.gotShiftMedal != true) {
shiftHold = 0;
_root.gotShiftMedal = true;
}
}
}
Instance of Symbol 467 MovieClip in Frame 10
onClipEvent (enterFrame) {
_x = _root.Cam._x;
_y = _root.Cam._y;
}
Frame 11
_root.nextFrame();
_root.Cam._x = 0;
_root.Cam._y = 0;
_root._x = _root.dx;
_root._y = _root.dy;
_root.player.grav = 0;
_root.player.yspeed = 0;
_root.player.xspeed = 0;
Frame 12
_root.Cam.lvla.lvlb.lvl = "05";
function rotateCamBack() {
if (_root.Cam._rotation < _root.Cam.rot) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
if (_root.Cam._rotation > _root.Cam.rot) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
_root.turn++;
}
function rotateCam1() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation > (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
if (_root.Cam._rotation < (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation > (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
if (_root.Cam._rotation < (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
function rotateCam2() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation > (_root.Cam.rot - 180)) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation < (_root.Cam.rot + 180)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
function rotateCam3() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation != 90) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation != 90) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
Gravity = 1;
CamTurn = 0;
lastKeyPressed = 1;
lastKeyPressed2 = 0;
_root.stopCam = false;
_root._x = _root.dx;
_root._y = _root.dy;
stop();
onEnterFrame = function () {
if ((_root.deaths >= 50) && (varDeath != true)) {
var _local2 = "Death Medal";
com.newgrounds.API.unlockMedal(_local2, _root.Cam._x, _root.Cam._y);
varDeath = true;
}
if ((_root.turns >= 500) && (varTurn != true)) {
var _local2 = "500th Flip";
com.newgrounds.API.unlockMedal(_local2, _root.Cam._x, _root.Cam._y);
varTurn = true;
}
if ((Key.isDown(77) && (_root.SOFF != true)) && (_root.holdM != true)) {
_root.all.setVolume(0);
_root.SOFF = true;
_root.holdM = true;
}
if ((Key.isDown(77) && (_root.SOFF == true)) && (_root.holdM != true)) {
_root.all.setVolume(100);
_root.SOFF = false;
_root.holdM = true;
}
if ((!Key.isDown(77)) && (_root.holdM == true)) {
_root.holdM = false;
}
if (Gravity == 1) {
rotateCamBack();
}
if (Gravity == 2) {
rotateCam1();
}
if (Gravity == 3) {
rotateCam2();
}
if (Gravity == 4) {
rotateCam3();
}
};
Instance of Symbol 494 MovieClip in Frame 12
onClipEvent (enterFrame) {
if (this.hitTest(_root.player.block) && (_currentframe == 1)) {
this.play();
_root.land.wall.play();
}
}
Instance of Symbol 397 MovieClip in Frame 12
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 4)) && (_root.player._x < (_x + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 12
onClipEvent (enterFrame) {
if ((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Cam.fadeOut._currentframe == 1)) {
_root.stopCam = true;
_root.Cam.fadeOut.play();
}
}
Instance of Symbol 432 MovieClip "player" in Frame 12
onClipEvent (load) {
xspeed = 0;
yspeed = 0;
grav = 1;
w = _width / 2;
h = _height / 2;
scale = _xscale;
rot = _rotation;
grounded = true;
jump = false;
_root.playerX = _x;
_root.playerY = _y;
_root._x = _root.dx;
_root._y = _root.dy;
standStill = 0;
}
onClipEvent (enterFrame) {
standStill++;
if (standStill <= 5) {
_x = -4;
_y = 278;
}
if (Key.isDown(82)) {
_root.Cam.fadeOutRestart.play();
_root.reStart = _root.reStart + 1;
}
if (_root.Gravity == 1) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, (_y + h) + 30, true)) && (!_root.plat.hitTest(_x, (_y + h) + 30, true))) {
if (_rotation != rot) {
_rotation = (_rotation - 5);
}
} else {
_rotation = rot;
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, (_y + h) + 30, true)) && (!_root.plat.hitTest(_x, (_y + h) + 30, true))) {
if (_rotation != rot) {
_rotation = (_rotation + 5);
}
} else {
_rotation = rot;
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != rot) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed * 0.83;
_y = (_y + yspeed);
yspeed = yspeed + grav;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
xspeed = xspeed + 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
xspeed = xspeed - 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
yspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (jump != true)) && (_currentframe != 3)) {
this.gotoAndStop(1);
}
if (_root.plat.hitTest(_x, (_y + h) + 4, grounded)) {
_x = (_root.plat._x - _root.plat.dx);
}
if ((_root.land.hitTest(_x, (_y + h) + 10, true) && (yspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest(_x, (_y + h) + 6, true) && (yspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y + h) + 4, true) or _root.plat.hitTest(_x, (_y + h) + 2, true)) {
if (!Key.isDown(38)) {
yspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest(_x, (_y + h) - 3, true)) {
_y = (_y - 0.1);
}
while (_root.plat.hitTest(_x, (_y + h) - 3, true)) {
_y = (_y - 0.1);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x + w, _y, true) or _root.plat.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
while (_root.plat.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.land.hitTest(_x - w, _y, true) or _root.plat.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
while (_root.plat.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
yspeed = 0;
_rotation = rot;
jump = false;
}
}
if (_root.Gravity == 2) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x - w) + 30, _y, true)) && (!_root.plat.hitTest((_x - w) + 30, _y, true))) {
if (_rotation >= (rot - 90)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rot - 90);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x - w) + 30, _y, true)) && (!_root.plat.hitTest((_x - w) + 30, _y, true))) {
if (_rotation != (rot - 90)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot - 90);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot - 90)) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed + grav;
_y = (_y + yspeed);
yspeed = yspeed * 0.83;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
yspeed = yspeed - 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
yspeed = yspeed + 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
xspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest((_x + w) + 55, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x + w) + 45, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest((_x + w) + 45, _y, true) or _root.plat.hitTest((_x + w) + 45, _y, true)) {
if (!Key.isDown(38)) {
xspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest((_x + w) + 38, _y, true)) {
_x = (_x - 0.4);
}
while (_root.plat.hitTest((_x + w) + 38, _y, true)) {
_x = (_x - 0.4);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.plat.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.plat.hitTest(_x, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.land.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
_rotation = (rot - 90);
}
}
if (_root.Gravity == 3) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x + w) + 30, _y, true)) && (!_root.plat.hitTest((_x + w) + 30, _y, true))) {
if (_rotation != (rot - 180)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rot - 180);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x + w) + 30, _y - h, true)) && (!_root.plat.hitTest((_x + w) + 30, _y - h, true))) {
if (_rotation != (rot + 180)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot + 180);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot - 180)) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed * 0.83;
_y = (_y + yspeed);
yspeed = yspeed - grav;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
xspeed = xspeed - 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
xspeed = xspeed + 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
yspeed = 10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest(_x, (_y - h) - 11, true) && (yspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest(_x, (_y - h) - 6, true) && (yspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y - h) - 5, true) or _root.plat.hitTest(_x, (_y - h) - 3, true)) {
if (!Key.isDown(38)) {
yspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest(_x, (_y - h) + 5, true)) {
_y = (_y + 0.1);
}
while (_root.plat.hitTest(_x, (_y - h) + 5, true)) {
_y = (_y + 0.1);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.plat.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.plat.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.land.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (_root.plat.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.plat.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
yspeed = 0;
_rotation = (rot - 180);
}
}
if (_root.Gravity == 4) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, _y, true)) && (!_root.plat.hitTest(_x, _y, true))) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rott + 90);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, _y - h, true)) && (!_root.plat.hitTest(_x, _y - h, true))) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot + 90);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation - 9);
}
}
_x = (_x - xspeed);
xspeed = xspeed + grav;
_y = (_y + yspeed);
yspeed = yspeed * 0.83;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
yspeed = yspeed + 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
yspeed = yspeed - 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
xspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest((_x - w) - 60, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x - w) - 50, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest((_x - w) - 43, _y, true) or _root.plat.hitTest((_x - w) - 43, _y, true)) {
if (!Key.isDown(38)) {
xspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest((_x - w) - 38, _y, true)) {
_x = (_x + 0.1);
}
grounded = true;
jump = false;
while (_root.plat.hitTest((_x - w) - 38, _y, true)) {
_x = (_x + 0.1);
}
} else {
grounded = false;
}
if ((_root.land.hitTest((_x - w) - 55, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x - w) - 45, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y + h) - 30, true) or _root.plat.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
while (_root.plat.hitTest(_x + w, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.land.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
_rotation = (rot + 90);
}
}
if (((grounded && (!this.hitTest(_root.noGrav1))) && (!this.hitTest(_root.noGrav2))) && (!this.hitTest(_root.noGrav3))) {
if (Key.isDown(83) && (sHold != true)) {
sHold = true;
}
if ((!Key.isDown(83)) && (sHold == true)) {
sHold = false;
}
if (Key.isDown(65) && (aHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 0;
if (_root.Gravity <= 1) {
_root.Gravity = 5;
}
_root.lastKeyPressed = 1;
_root.CamTurn--;
_root.Gravity--;
aHold = true;
}
if ((!Key.isDown(65)) && (aHold == true)) {
aHold = false;
}
if (Key.isDown(68) && (dHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 0;
_root.Gravity++;
if (_root.Gravity > 4) {
_root.Gravity = 1;
}
_root.lastKeyPressed = 2;
dHold = true;
}
if ((!Key.isDown(68)) && (dHold == true)) {
dHold = false;
}
if (Key.isDown(87) && (wHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 3;
if (_root.Gravity == 1) {
_root.Gravity = 3;
} else if (_root.Gravity == 3) {
_root.Gravity = 1;
}
if (_root.Gravity == 2) {
_root.Gravity = 4;
} else if (_root.Gravity == 4) {
_root.Gravity = 2;
}
wHold = true;
}
if ((!Key.isDown(87)) && (wHold == true)) {
wHold = false;
}
}
}
Instance of Symbol 466 MovieClip "Cam" in Frame 12
onClipEvent (load) {
_rotation = 360;
rot = _rotation;
rot2 = rot + 270;
scalex = _xscale + 20;
scaley = _yscale + 20;
_xscale = (scalex + 100);
_yscale = (scaley + 100);
shiftHold = 0;
}
onClipEvent (enterFrame) {
if (_root.stopCam != true) {
_x = (_x + ((_root.player._x - _x) / 10));
_y = (_y + ((_root.player._y - _y) / 10));
}
if (!Key.isDown(16)) {
if (_xscale > scalex) {
_xscale = (_xscale - 2);
}
if (_yscale > scaley) {
_yscale = (_yscale - 2);
}
shiftHold = 0;
}
if (Key.isDown(16)) {
shiftHold++;
if (_xscale < (scalex + 100)) {
_xscale = (_xscale + 2);
}
if (_yscale < (scaley + 100)) {
_yscale = (_yscale + 2);
}
}
_root.bg2._x = _x;
_root.bg2._y = _y;
if (shiftHold >= 900) {
if (_root.gotShiftMedal != true) {
shiftHold = 0;
_root.gotShiftMedal = true;
}
}
}
Instance of Symbol 467 MovieClip in Frame 12
onClipEvent (enterFrame) {
_x = _root.Cam._x;
_y = _root.Cam._y;
}
Frame 13
_root.nextFrame();
_root.Cam.lvla.lvlb.lvl = "10";
_root.Cam._x = 0;
_root.Cam._y = 0;
_root._x = _root.dx;
_root._y = _root.dy;
_root.player.grav = 0;
_root.player.yspeed = 0;
_root.player.xspeed = 0;
Frame 14
_root.Cam.lvla.lvlb.lvl = "06";
function rotateCamBack() {
if (_root.Cam._rotation < _root.Cam.rot) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
if (_root.Cam._rotation > _root.Cam.rot) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
_root.turn++;
}
function rotateCam1() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation > (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
if (_root.Cam._rotation < (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation > (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
if (_root.Cam._rotation < (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
function rotateCam2() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation > (_root.Cam.rot - 180)) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation < (_root.Cam.rot + 180)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
function rotateCam3() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation != 90) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation != 90) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
Gravity = 1;
CamTurn = 0;
lastKeyPressed = 1;
lastKeyPressed2 = 0;
_root.stopCam = false;
_root._x = _root.dx;
_root._y = _root.dy;
stop();
onEnterFrame = function () {
if ((_root.deaths >= 50) && (varDeath != true)) {
var _local2 = "Death Medal";
com.newgrounds.API.unlockMedal(_local2, _root.Cam._x, _root.Cam._y);
varDeath = true;
}
if ((_root.turns >= 500) && (varTurn != true)) {
var _local2 = "500th Flip";
com.newgrounds.API.unlockMedal(_local2, _root.Cam._x, _root.Cam._y);
varTurn = true;
}
if ((Key.isDown(77) && (_root.SOFF != true)) && (_root.holdM != true)) {
_root.all.setVolume(0);
_root.SOFF = true;
_root.holdM = true;
}
if ((Key.isDown(77) && (_root.SOFF == true)) && (_root.holdM != true)) {
_root.all.setVolume(100);
_root.SOFF = false;
_root.holdM = true;
}
if ((!Key.isDown(77)) && (_root.holdM == true)) {
_root.holdM = false;
}
if (Gravity == 1) {
rotateCamBack();
}
if (Gravity == 2) {
rotateCam1();
}
if (Gravity == 3) {
rotateCam2();
}
if (Gravity == 4) {
rotateCam3();
}
};
Instance of Symbol 494 MovieClip in Frame 14
onClipEvent (enterFrame) {
if (this.hitTest(_root.player.block) && (_currentframe == 1)) {
this.play();
_root.land.wall.play();
}
}
Instance of Symbol 397 MovieClip in Frame 14
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 3)) && (_root.player._y < (_y + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 14
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 4)) && (_root.player._x < (_x + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 14
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 1)) && (_root.player._y > (_y - 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 14
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 2)) && (_root.player._x > (_x - 200))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 14
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 4)) && (_root.player._x < (_x + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 14
onClipEvent (enterFrame) {
if ((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Cam.fadeOut._currentframe == 1)) {
_root.stopCam = true;
_root.Cam.fadeOut.play();
}
}
Instance of Symbol 432 MovieClip "player" in Frame 14
onClipEvent (load) {
xspeed = 0;
yspeed = 0;
grav = 1;
w = _width / 2;
h = _height / 2;
scale = _xscale;
rot = _rotation;
grounded = true;
jump = false;
_root.playerX = _x;
_root.playerY = _y;
_root._x = _root.dx;
_root._y = _root.dy;
standStill = 0;
}
onClipEvent (enterFrame) {
standStill++;
if (standStill <= 5) {
_x = -1715;
_y = -230;
}
if (Key.isDown(82)) {
_root.Cam.fadeOutRestart.play();
_root.reStart = _root.reStart + 1;
}
if (_root.Gravity == 1) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, (_y + h) + 30, true)) && (!_root.plat.hitTest(_x, (_y + h) + 30, true))) {
if (_rotation != rot) {
_rotation = (_rotation - 5);
}
} else {
_rotation = rot;
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, (_y + h) + 30, true)) && (!_root.plat.hitTest(_x, (_y + h) + 30, true))) {
if (_rotation != rot) {
_rotation = (_rotation + 5);
}
} else {
_rotation = rot;
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != rot) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed * 0.83;
_y = (_y + yspeed);
yspeed = yspeed + grav;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
xspeed = xspeed + 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
xspeed = xspeed - 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
yspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (jump != true)) && (_currentframe != 3)) {
this.gotoAndStop(1);
}
if (_root.plat.hitTest(_x, (_y + h) + 4, grounded)) {
_x = (_root.plat._x - _root.plat.dx);
}
if ((_root.land.hitTest(_x, (_y + h) + 10, true) && (yspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest(_x, (_y + h) + 6, true) && (yspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y + h) + 4, true) or _root.plat.hitTest(_x, (_y + h) + 2, true)) {
if (!Key.isDown(38)) {
yspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest(_x, (_y + h) - 3, true)) {
_y = (_y - 0.1);
}
while (_root.plat.hitTest(_x, (_y + h) - 3, true)) {
_y = (_y - 0.1);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x + w, _y, true) or _root.plat.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
while (_root.plat.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.land.hitTest(_x - w, _y, true) or _root.plat.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
while (_root.plat.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
yspeed = 0;
_rotation = rot;
jump = false;
}
}
if (_root.Gravity == 2) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x - w) + 30, _y, true)) && (!_root.plat.hitTest((_x - w) + 30, _y, true))) {
if (_rotation >= (rot - 90)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rot - 90);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x - w) + 30, _y, true)) && (!_root.plat.hitTest((_x - w) + 30, _y, true))) {
if (_rotation != (rot - 90)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot - 90);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot - 90)) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed + grav;
_y = (_y + yspeed);
yspeed = yspeed * 0.83;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
yspeed = yspeed - 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
yspeed = yspeed + 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
xspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest((_x + w) + 55, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x + w) + 45, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest((_x + w) + 45, _y, true) or _root.plat.hitTest((_x + w) + 45, _y, true)) {
if (!Key.isDown(38)) {
xspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest((_x + w) + 38, _y, true)) {
_x = (_x - 0.4);
}
while (_root.plat.hitTest((_x + w) + 38, _y, true)) {
_x = (_x - 0.4);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.plat.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.plat.hitTest(_x, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.land.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
_rotation = (rot - 90);
}
}
if (_root.Gravity == 3) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x + w) + 30, _y, true)) && (!_root.plat.hitTest((_x + w) + 30, _y, true))) {
if (_rotation != (rot - 180)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rot - 180);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x + w) + 30, _y - h, true)) && (!_root.plat.hitTest((_x + w) + 30, _y - h, true))) {
if (_rotation != (rot + 180)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot + 180);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot - 180)) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed * 0.83;
_y = (_y + yspeed);
yspeed = yspeed - grav;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
xspeed = xspeed - 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
xspeed = xspeed + 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
yspeed = 10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest(_x, (_y - h) - 11, true) && (yspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest(_x, (_y - h) - 6, true) && (yspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y - h) - 5, true) or _root.plat.hitTest(_x, (_y - h) - 3, true)) {
if (!Key.isDown(38)) {
yspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest(_x, (_y - h) + 5, true)) {
_y = (_y + 0.1);
}
while (_root.plat.hitTest(_x, (_y - h) + 5, true)) {
_y = (_y + 0.1);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.plat.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.plat.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.land.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (_root.plat.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.plat.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
yspeed = 0;
_rotation = (rot - 180);
}
}
if (_root.Gravity == 4) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, _y, true)) && (!_root.plat.hitTest(_x, _y, true))) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rott + 90);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, _y - h, true)) && (!_root.plat.hitTest(_x, _y - h, true))) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot + 90);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation - 9);
}
}
_x = (_x - xspeed);
xspeed = xspeed + grav;
_y = (_y + yspeed);
yspeed = yspeed * 0.83;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
yspeed = yspeed + 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
yspeed = yspeed - 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
xspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest((_x - w) - 60, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x - w) - 50, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest((_x - w) - 43, _y, true) or _root.plat.hitTest((_x - w) - 43, _y, true)) {
if (!Key.isDown(38)) {
xspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest((_x - w) - 38, _y, true)) {
_x = (_x + 0.1);
}
grounded = true;
jump = false;
while (_root.plat.hitTest((_x - w) - 38, _y, true)) {
_x = (_x + 0.1);
}
} else {
grounded = false;
}
if ((_root.land.hitTest((_x - w) - 55, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x - w) - 45, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y + h) - 30, true) or _root.plat.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
while (_root.plat.hitTest(_x + w, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.land.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
_rotation = (rot + 90);
}
}
if (((grounded && (!this.hitTest(_root.noGrav1))) && (!this.hitTest(_root.noGrav2))) && (!this.hitTest(_root.noGrav3))) {
if (Key.isDown(83) && (sHold != true)) {
sHold = true;
}
if ((!Key.isDown(83)) && (sHold == true)) {
sHold = false;
}
if (Key.isDown(65) && (aHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 0;
if (_root.Gravity <= 1) {
_root.Gravity = 5;
}
_root.lastKeyPressed = 1;
_root.CamTurn--;
_root.Gravity--;
aHold = true;
}
if ((!Key.isDown(65)) && (aHold == true)) {
aHold = false;
}
if (Key.isDown(68) && (dHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 0;
_root.Gravity++;
if (_root.Gravity > 4) {
_root.Gravity = 1;
}
_root.lastKeyPressed = 2;
dHold = true;
}
if ((!Key.isDown(68)) && (dHold == true)) {
dHold = false;
}
if (Key.isDown(87) && (wHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 3;
if (_root.Gravity == 1) {
_root.Gravity = 3;
} else if (_root.Gravity == 3) {
_root.Gravity = 1;
}
if (_root.Gravity == 2) {
_root.Gravity = 4;
} else if (_root.Gravity == 4) {
_root.Gravity = 2;
}
wHold = true;
}
if ((!Key.isDown(87)) && (wHold == true)) {
wHold = false;
}
}
}
Instance of Symbol 466 MovieClip "Cam" in Frame 14
onClipEvent (load) {
_rotation = 360;
rot = _rotation;
rot2 = rot + 270;
scalex = _xscale + 20;
scaley = _yscale + 20;
_xscale = (scalex + 100);
_yscale = (scaley + 100);
shiftHold = 0;
}
onClipEvent (enterFrame) {
if (_root.stopCam != true) {
_x = (_x + ((_root.player._x - _x) / 10));
_y = (_y + ((_root.player._y - _y) / 10));
}
if (!Key.isDown(16)) {
if (_xscale > scalex) {
_xscale = (_xscale - 2);
}
if (_yscale > scaley) {
_yscale = (_yscale - 2);
}
shiftHold = 0;
}
if (Key.isDown(16)) {
shiftHold++;
if (_xscale < (scalex + 100)) {
_xscale = (_xscale + 2);
}
if (_yscale < (scaley + 100)) {
_yscale = (_yscale + 2);
}
}
_root.bg2._x = _x;
_root.bg2._y = _y;
if (shiftHold >= 900) {
if (_root.gotShiftMedal != true) {
shiftHold = 0;
_root.gotShiftMedal = true;
}
}
}
Frame 15
_root.nextFrame();
_root.Cam._x = 0;
_root.Cam._y = 0;
_root._x = _root.dx;
_root._y = _root.dy;
_root.player.grav = 0;
_root.player.yspeed = 0;
_root.player.xspeed = 0;
Frame 16
_root.Cam.lvla.lvlb.lvl = "07";
_root.Cam._x = 0;
_root.Cam._y = 0;
function rotateCamBack() {
if (_root.Cam._rotation < _root.Cam.rot) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
if (_root.Cam._rotation > _root.Cam.rot) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
_root.turn++;
}
function rotateCam1() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation > (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
if (_root.Cam._rotation < (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation > (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
if (_root.Cam._rotation < (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
function rotateCam2() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation > (_root.Cam.rot - 180)) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation < (_root.Cam.rot + 180)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
function rotateCam3() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation != 90) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation != 90) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
Gravity = 1;
CamTurn = 0;
lastKeyPressed = 1;
lastKeyPressed2 = 0;
_root.stopCam = false;
_root._x = _root.dx;
_root._y = _root.dy;
stop();
onEnterFrame = function () {
if ((_root.deaths >= 50) && (varDeath != true)) {
var _local2 = "Death Medal";
com.newgrounds.API.unlockMedal(_local2, _root.Cam._x, _root.Cam._y);
varDeath = true;
}
if ((_root.turns >= 500) && (varTurn != true)) {
var _local2 = "500th Flip";
com.newgrounds.API.unlockMedal(_local2, _root.Cam._x, _root.Cam._y);
varTurn = true;
}
if ((Key.isDown(77) && (_root.SOFF != true)) && (_root.holdM != true)) {
_root.all.setVolume(0);
_root.SOFF = true;
_root.holdM = true;
}
if ((Key.isDown(77) && (_root.SOFF == true)) && (_root.holdM != true)) {
_root.all.setVolume(100);
_root.SOFF = false;
_root.holdM = true;
}
if ((!Key.isDown(77)) && (_root.holdM == true)) {
_root.holdM = false;
}
if (Gravity == 1) {
rotateCamBack();
}
if (Gravity == 2) {
rotateCam1();
}
if (Gravity == 3) {
rotateCam2();
}
if (Gravity == 4) {
rotateCam3();
}
};
Instance of Symbol 511 MovieClip in Frame 16
onClipEvent (enterFrame) {
if (this.hitTest(_root.player.block) && (this._currentframe == 1)) {
this.play();
_root.land.wall2.play();
}
}
Instance of Symbol 397 MovieClip in Frame 16
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 4)) && (_root.player._x < (_x + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 16
onClipEvent (enterFrame) {
if ((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Cam.fadeOut._currentframe == 1)) {
_root.stopCam = true;
_root.Cam.fadeOut.play();
}
}
Instance of Symbol 397 MovieClip in Frame 16
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 3)) && (_root.player._y < (_y + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 16
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 1)) && (_root.player._y > (_y - 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 432 MovieClip "player" in Frame 16
onClipEvent (load) {
xspeed = 0;
yspeed = 0;
grav = 1;
w = _width / 2;
h = _height / 2;
scale = _xscale;
rot = _rotation;
grounded = true;
jump = false;
_root.playerX = _x;
_root.playerY = _y;
_root._x = _root.dx;
_root._y = _root.dy;
standStill = 0;
}
onClipEvent (enterFrame) {
standStill++;
if (standStill <= 5) {
_x = 336;
_y = 235;
}
if (Key.isDown(82)) {
_root.Cam.fadeOutRestart.play();
_root.reStart = _root.reStart + 1;
}
if (_root.Gravity == 1) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, (_y + h) + 30, true)) && (!_root.plat.hitTest(_x, (_y + h) + 30, true))) {
if (_rotation != rot) {
_rotation = (_rotation - 5);
}
} else {
_rotation = rot;
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, (_y + h) + 30, true)) && (!_root.plat.hitTest(_x, (_y + h) + 30, true))) {
if (_rotation != rot) {
_rotation = (_rotation + 5);
}
} else {
_rotation = rot;
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != rot) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed * 0.83;
_y = (_y + yspeed);
yspeed = yspeed + grav;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
xspeed = xspeed + 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
xspeed = xspeed - 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
yspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (jump != true)) && (_currentframe != 3)) {
this.gotoAndStop(1);
}
if (_root.plat.hitTest(_x, (_y + h) + 4, grounded)) {
_x = (_root.plat._x - _root.plat.dx);
}
if ((_root.land.hitTest(_x, (_y + h) + 10, true) && (yspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest(_x, (_y + h) + 6, true) && (yspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y + h) + 4, true) or _root.plat.hitTest(_x, (_y + h) + 2, true)) {
if (!Key.isDown(38)) {
yspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest(_x, (_y + h) - 3, true)) {
_y = (_y - 0.1);
}
while (_root.plat.hitTest(_x, (_y + h) - 3, true)) {
_y = (_y - 0.1);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x + w, _y, true) or _root.plat.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
while (_root.plat.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.land.hitTest(_x - w, _y, true) or _root.plat.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
while (_root.plat.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
yspeed = 0;
_rotation = rot;
jump = false;
}
}
if (_root.Gravity == 2) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x - w) + 30, _y, true)) && (!_root.plat.hitTest((_x - w) + 30, _y, true))) {
if (_rotation >= (rot - 90)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rot - 90);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x - w) + 30, _y, true)) && (!_root.plat.hitTest((_x - w) + 30, _y, true))) {
if (_rotation != (rot - 90)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot - 90);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot - 90)) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed + grav;
_y = (_y + yspeed);
yspeed = yspeed * 0.83;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
yspeed = yspeed - 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
yspeed = yspeed + 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
xspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest((_x + w) + 55, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x + w) + 45, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest((_x + w) + 45, _y, true) or _root.plat.hitTest((_x + w) + 45, _y, true)) {
if (!Key.isDown(38)) {
xspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest((_x + w) + 38, _y, true)) {
_x = (_x - 0.4);
}
while (_root.plat.hitTest((_x + w) + 38, _y, true)) {
_x = (_x - 0.4);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.plat.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.plat.hitTest(_x, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.land.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
_rotation = (rot - 90);
}
}
if (_root.Gravity == 3) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x + w) + 30, _y, true)) && (!_root.plat.hitTest((_x + w) + 30, _y, true))) {
if (_rotation != (rot - 180)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rot - 180);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x + w) + 30, _y - h, true)) && (!_root.plat.hitTest((_x + w) + 30, _y - h, true))) {
if (_rotation != (rot + 180)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot + 180);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot - 180)) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed * 0.83;
_y = (_y + yspeed);
yspeed = yspeed - grav;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
xspeed = xspeed - 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
xspeed = xspeed + 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
yspeed = 10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest(_x, (_y - h) - 11, true) && (yspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest(_x, (_y - h) - 6, true) && (yspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y - h) - 5, true) or _root.plat.hitTest(_x, (_y - h) - 3, true)) {
if (!Key.isDown(38)) {
yspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest(_x, (_y - h) + 5, true)) {
_y = (_y + 0.1);
}
while (_root.plat.hitTest(_x, (_y - h) + 5, true)) {
_y = (_y + 0.1);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.plat.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.plat.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.land.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (_root.plat.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.plat.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
yspeed = 0;
_rotation = (rot - 180);
}
}
if (_root.Gravity == 4) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, _y, true)) && (!_root.plat.hitTest(_x, _y, true))) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rott + 90);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, _y - h, true)) && (!_root.plat.hitTest(_x, _y - h, true))) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot + 90);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation - 9);
}
}
_x = (_x - xspeed);
xspeed = xspeed + grav;
_y = (_y + yspeed);
yspeed = yspeed * 0.83;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
yspeed = yspeed + 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
yspeed = yspeed - 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
xspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest((_x - w) - 60, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x - w) - 50, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest((_x - w) - 43, _y, true) or _root.plat.hitTest((_x - w) - 43, _y, true)) {
if (!Key.isDown(38)) {
xspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest((_x - w) - 38, _y, true)) {
_x = (_x + 0.1);
}
grounded = true;
jump = false;
while (_root.plat.hitTest((_x - w) - 38, _y, true)) {
_x = (_x + 0.1);
}
} else {
grounded = false;
}
if ((_root.land.hitTest((_x - w) - 55, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x - w) - 45, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y + h) - 30, true) or _root.plat.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
while (_root.plat.hitTest(_x + w, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.land.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
_rotation = (rot + 90);
}
}
if (((grounded && (!this.hitTest(_root.noGrav1))) && (!this.hitTest(_root.noGrav2))) && (!this.hitTest(_root.noGrav3))) {
if (Key.isDown(83) && (sHold != true)) {
sHold = true;
}
if ((!Key.isDown(83)) && (sHold == true)) {
sHold = false;
}
if (Key.isDown(65) && (aHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 0;
if (_root.Gravity <= 1) {
_root.Gravity = 5;
}
_root.lastKeyPressed = 1;
_root.CamTurn--;
_root.Gravity--;
aHold = true;
}
if ((!Key.isDown(65)) && (aHold == true)) {
aHold = false;
}
if (Key.isDown(68) && (dHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 0;
_root.Gravity++;
if (_root.Gravity > 4) {
_root.Gravity = 1;
}
_root.lastKeyPressed = 2;
dHold = true;
}
if ((!Key.isDown(68)) && (dHold == true)) {
dHold = false;
}
if (Key.isDown(87) && (wHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 3;
if (_root.Gravity == 1) {
_root.Gravity = 3;
} else if (_root.Gravity == 3) {
_root.Gravity = 1;
}
if (_root.Gravity == 2) {
_root.Gravity = 4;
} else if (_root.Gravity == 4) {
_root.Gravity = 2;
}
wHold = true;
}
if ((!Key.isDown(87)) && (wHold == true)) {
wHold = false;
}
}
}
Instance of Symbol 466 MovieClip "Cam" in Frame 16
onClipEvent (load) {
_rotation = 360;
rot = _rotation;
rot2 = rot + 270;
scalex = _xscale + 20;
scaley = _yscale + 20;
_xscale = (scalex + 100);
_yscale = (scaley + 100);
shiftHold = 0;
}
onClipEvent (enterFrame) {
if (_root.stopCam != true) {
_x = (_x + ((_root.player._x - _x) / 10));
_y = (_y + ((_root.player._y - _y) / 10));
}
if (!Key.isDown(16)) {
if (_xscale > scalex) {
_xscale = (_xscale - 2);
}
if (_yscale > scaley) {
_yscale = (_yscale - 2);
}
shiftHold = 0;
}
if (Key.isDown(16)) {
shiftHold++;
if (_xscale < (scalex + 100)) {
_xscale = (_xscale + 2);
}
if (_yscale < (scaley + 100)) {
_yscale = (_yscale + 2);
}
}
_root.bg2._x = _x;
_root.bg2._y = _y;
if (shiftHold >= 900) {
if (_root.gotShiftMedal != true) {
shiftHold = 0;
_root.gotShiftMedal = true;
}
}
}
Frame 17
_root.nextFrame();
_root._x = _root.dx;
_root._y = _root.dy;
_root.player.grav = 0;
_root.player.yspeed = 0;
_root.player.xspeed = 0;
Frame 18
_root.Cam.lvla.lvlb.lvl = "08";
function rotateCamBack() {
if (_root.Cam._rotation < _root.Cam.rot) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
if (_root.Cam._rotation > _root.Cam.rot) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
_root.turn++;
}
function rotateCam1() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation > (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
if (_root.Cam._rotation < (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation > (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
if (_root.Cam._rotation < (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
function rotateCam2() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation > (_root.Cam.rot - 180)) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation < (_root.Cam.rot + 180)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
function rotateCam3() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation != 90) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation != 90) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
Gravity = 1;
CamTurn = 0;
lastKeyPressed = 1;
lastKeyPressed2 = 0;
_root.stopCam = false;
_root._x = _root.dx;
_root._y = _root.dy;
stop();
onEnterFrame = function () {
if ((_root.deaths >= 50) && (varDeath != true)) {
var _local2 = "Death Medal";
com.newgrounds.API.unlockMedal(_local2, _root.Cam._x, _root.Cam._y);
varDeath = true;
}
if ((_root.turns >= 500) && (varTurn != true)) {
var _local2 = "500th Flip";
com.newgrounds.API.unlockMedal(_local2, _root.Cam._x, _root.Cam._y);
varTurn = true;
}
if ((Key.isDown(77) && (_root.SOFF != true)) && (_root.holdM != true)) {
_root.all.setVolume(0);
_root.SOFF = true;
_root.holdM = true;
}
if ((Key.isDown(77) && (_root.SOFF == true)) && (_root.holdM != true)) {
_root.all.setVolume(100);
_root.SOFF = false;
_root.holdM = true;
}
if ((!Key.isDown(77)) && (_root.holdM == true)) {
_root.holdM = false;
}
if (Gravity == 1) {
rotateCamBack();
}
if (Gravity == 2) {
rotateCam1();
}
if (Gravity == 3) {
rotateCam2();
}
if (Gravity == 4) {
rotateCam3();
}
};
Instance of Symbol 494 MovieClip in Frame 18
onClipEvent (enterFrame) {
if (this.hitTest(_root.player.block) && (_currentframe == 1)) {
this.play();
_root.land.wall.play();
}
}
Instance of Symbol 511 MovieClip in Frame 18
onClipEvent (enterFrame) {
if (this.hitTest(_root.player.block) && (this._currentframe == 1)) {
this.play();
_root.land.wall2.play();
}
}
Instance of Symbol 397 MovieClip in Frame 18
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 4)) && (_root.player._x < (_x + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 18
onClipEvent (enterFrame) {
if ((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Cam.fadeOut._currentframe == 1)) {
_root.stopCam = true;
_root.Cam.fadeOut.play();
}
}
Instance of Symbol 397 MovieClip in Frame 18
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 1)) && (_root.player._y > (_y - 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 18
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 2)) && (_root.player._x > (_x - 200))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 18
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 3)) && (_root.player._y < (_y + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 432 MovieClip "player" in Frame 18
onClipEvent (load) {
xspeed = 0;
yspeed = 0;
grav = 1;
w = _width / 2;
h = _height / 2;
scale = _xscale;
rot = _rotation;
grounded = true;
jump = false;
_root.playerX = _x;
_root.playerY = _y;
_root._x = _root.dx;
_root._y = _root.dy;
standStill = 0;
}
onClipEvent (enterFrame) {
standStill++;
if (standStill <= 5) {
_x = 261;
_y = 185;
}
if (Key.isDown(82)) {
_root.Cam.fadeOutRestart.play();
_root.reStart = _root.reStart + 1;
}
if (_root.Gravity == 1) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, (_y + h) + 30, true)) && (!_root.plat.hitTest(_x, (_y + h) + 30, true))) {
if (_rotation != rot) {
_rotation = (_rotation - 5);
}
} else {
_rotation = rot;
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, (_y + h) + 30, true)) && (!_root.plat.hitTest(_x, (_y + h) + 30, true))) {
if (_rotation != rot) {
_rotation = (_rotation + 5);
}
} else {
_rotation = rot;
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != rot) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed * 0.83;
_y = (_y + yspeed);
yspeed = yspeed + grav;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
xspeed = xspeed + 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
xspeed = xspeed - 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
yspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (jump != true)) && (_currentframe != 3)) {
this.gotoAndStop(1);
}
if (_root.plat.hitTest(_x, (_y + h) + 4, grounded)) {
_x = (_root.plat._x - _root.plat.dx);
}
if ((_root.land.hitTest(_x, (_y + h) + 10, true) && (yspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest(_x, (_y + h) + 6, true) && (yspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y + h) + 4, true) or _root.plat.hitTest(_x, (_y + h) + 2, true)) {
if (!Key.isDown(38)) {
yspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest(_x, (_y + h) - 3, true)) {
_y = (_y - 0.1);
}
while (_root.plat.hitTest(_x, (_y + h) - 3, true)) {
_y = (_y - 0.1);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x + w, _y, true) or _root.plat.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
while (_root.plat.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.land.hitTest(_x - w, _y, true) or _root.plat.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
while (_root.plat.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
yspeed = 0;
_rotation = rot;
jump = false;
}
}
if (_root.Gravity == 2) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x - w) + 30, _y, true)) && (!_root.plat.hitTest((_x - w) + 30, _y, true))) {
if (_rotation >= (rot - 90)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rot - 90);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x - w) + 30, _y, true)) && (!_root.plat.hitTest((_x - w) + 30, _y, true))) {
if (_rotation != (rot - 90)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot - 90);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot - 90)) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed + grav;
_y = (_y + yspeed);
yspeed = yspeed * 0.83;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
yspeed = yspeed - 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
yspeed = yspeed + 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
xspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest((_x + w) + 55, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x + w) + 45, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest((_x + w) + 45, _y, true) or _root.plat.hitTest((_x + w) + 45, _y, true)) {
if (!Key.isDown(38)) {
xspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest((_x + w) + 38, _y, true)) {
_x = (_x - 0.4);
}
while (_root.plat.hitTest((_x + w) + 38, _y, true)) {
_x = (_x - 0.4);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.plat.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.plat.hitTest(_x, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.land.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
_rotation = (rot - 90);
}
}
if (_root.Gravity == 3) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x + w) + 30, _y, true)) && (!_root.plat.hitTest((_x + w) + 30, _y, true))) {
if (_rotation != (rot - 180)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rot - 180);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x + w) + 30, _y - h, true)) && (!_root.plat.hitTest((_x + w) + 30, _y - h, true))) {
if (_rotation != (rot + 180)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot + 180);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot - 180)) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed * 0.83;
_y = (_y + yspeed);
yspeed = yspeed - grav;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
xspeed = xspeed - 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
xspeed = xspeed + 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
yspeed = 10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest(_x, (_y - h) - 11, true) && (yspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest(_x, (_y - h) - 6, true) && (yspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y - h) - 5, true) or _root.plat.hitTest(_x, (_y - h) - 3, true)) {
if (!Key.isDown(38)) {
yspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest(_x, (_y - h) + 5, true)) {
_y = (_y + 0.1);
}
while (_root.plat.hitTest(_x, (_y - h) + 5, true)) {
_y = (_y + 0.1);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.plat.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.plat.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.land.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (_root.plat.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.plat.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
yspeed = 0;
_rotation = (rot - 180);
}
}
if (_root.Gravity == 4) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, _y, true)) && (!_root.plat.hitTest(_x, _y, true))) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rott + 90);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, _y - h, true)) && (!_root.plat.hitTest(_x, _y - h, true))) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot + 90);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation - 9);
}
}
_x = (_x - xspeed);
xspeed = xspeed + grav;
_y = (_y + yspeed);
yspeed = yspeed * 0.83;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
yspeed = yspeed + 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
yspeed = yspeed - 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
xspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest((_x - w) - 60, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x - w) - 50, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest((_x - w) - 43, _y, true) or _root.plat.hitTest((_x - w) - 43, _y, true)) {
if (!Key.isDown(38)) {
xspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest((_x - w) - 38, _y, true)) {
_x = (_x + 0.1);
}
grounded = true;
jump = false;
while (_root.plat.hitTest((_x - w) - 38, _y, true)) {
_x = (_x + 0.1);
}
} else {
grounded = false;
}
if ((_root.land.hitTest((_x - w) - 55, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x - w) - 45, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y + h) - 30, true) or _root.plat.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
while (_root.plat.hitTest(_x + w, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.land.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
_rotation = (rot + 90);
}
}
if (((grounded && (!this.hitTest(_root.noGrav1))) && (!this.hitTest(_root.noGrav2))) && (!this.hitTest(_root.noGrav3))) {
if (Key.isDown(83) && (sHold != true)) {
sHold = true;
}
if ((!Key.isDown(83)) && (sHold == true)) {
sHold = false;
}
if (Key.isDown(65) && (aHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 0;
if (_root.Gravity <= 1) {
_root.Gravity = 5;
}
_root.lastKeyPressed = 1;
_root.CamTurn--;
_root.Gravity--;
aHold = true;
}
if ((!Key.isDown(65)) && (aHold == true)) {
aHold = false;
}
if (Key.isDown(68) && (dHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 0;
_root.Gravity++;
if (_root.Gravity > 4) {
_root.Gravity = 1;
}
_root.lastKeyPressed = 2;
dHold = true;
}
if ((!Key.isDown(68)) && (dHold == true)) {
dHold = false;
}
if (Key.isDown(87) && (wHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 3;
if (_root.Gravity == 1) {
_root.Gravity = 3;
} else if (_root.Gravity == 3) {
_root.Gravity = 1;
}
if (_root.Gravity == 2) {
_root.Gravity = 4;
} else if (_root.Gravity == 4) {
_root.Gravity = 2;
}
wHold = true;
}
if ((!Key.isDown(87)) && (wHold == true)) {
wHold = false;
}
}
}
Instance of Symbol 466 MovieClip "Cam" in Frame 18
onClipEvent (load) {
_rotation = 360;
rot = _rotation;
rot2 = rot + 270;
scalex = _xscale + 20;
scaley = _yscale + 20;
_xscale = (scalex + 100);
_yscale = (scaley + 100);
shiftHold = 0;
}
onClipEvent (enterFrame) {
if (_root.stopCam != true) {
_x = (_x + ((_root.player._x - _x) / 10));
_y = (_y + ((_root.player._y - _y) / 10));
}
if (!Key.isDown(16)) {
if (_xscale > scalex) {
_xscale = (_xscale - 2);
}
if (_yscale > scaley) {
_yscale = (_yscale - 2);
}
shiftHold = 0;
}
if (Key.isDown(16)) {
shiftHold++;
if (_xscale < (scalex + 100)) {
_xscale = (_xscale + 2);
}
if (_yscale < (scaley + 100)) {
_yscale = (_yscale + 2);
}
}
_root.bg2._x = _x;
_root.bg2._y = _y;
if (shiftHold >= 900) {
if (_root.gotShiftMedal != true) {
shiftHold = 0;
_root.gotShiftMedal = true;
}
}
}
Frame 19
_root.nextFrame();
_root.Cam._x = 0;
_root.Cam._y = 0;
_root._x = _root.dx;
_root._y = _root.dy;
_root.player.grav = 0;
_root.player.yspeed = 0;
_root.player.xspeed = 0;
Frame 20
_root.Cam.lvla.lvlb.lvl = "09";
_root.stopCam = false;
function rotateCamBack() {
if (_root.Cam._rotation < _root.Cam.rot) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
if (_root.Cam._rotation > _root.Cam.rot) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
_root.turn++;
}
function rotateCam1() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation > (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
if (_root.Cam._rotation < (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation > (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
if (_root.Cam._rotation < (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
function rotateCam2() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation > (_root.Cam.rot - 180)) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation < (_root.Cam.rot + 180)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
function rotateCam3() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation != 90) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation != 90) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
Gravity = 1;
CamTurn = 0;
lastKeyPressed = 1;
lastKeyPressed2 = 0;
_root._x = _root.dx;
_root._y = _root.dy;
stop();
onEnterFrame = function () {
if ((_root.deaths >= 50) && (varDeath != true)) {
var _local2 = "Death Medal";
com.newgrounds.API.unlockMedal(_local2, _root.Cam._x, _root.Cam._y);
varDeath = true;
}
if ((_root.turns >= 500) && (varTurn != true)) {
var _local2 = "500th Flip";
com.newgrounds.API.unlockMedal(_local2, _root.Cam._x, _root.Cam._y);
varTurn = true;
}
if ((Key.isDown(77) && (_root.SOFF != true)) && (_root.holdM != true)) {
_root.all.setVolume(0);
_root.SOFF = true;
_root.holdM = true;
}
if ((Key.isDown(77) && (_root.SOFF == true)) && (_root.holdM != true)) {
_root.all.setVolume(100);
_root.SOFF = false;
_root.holdM = true;
}
if ((!Key.isDown(77)) && (_root.holdM == true)) {
_root.holdM = false;
}
if (Gravity == 1) {
rotateCamBack();
}
if (Gravity == 2) {
rotateCam1();
}
if (Gravity == 3) {
rotateCam2();
}
if (Gravity == 4) {
rotateCam3();
}
};
Instance of Symbol 530 MovieClip in Frame 20
onClipEvent (load) {
i = 0;
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.player.block)) {
this.play();
_root.land.wall3.play();
}
if (_currentframe == 7) {
i++;
}
if (i >= 302) {
this.play();
i = 0;
}
}
Instance of Symbol 397 MovieClip in Frame 20
onClipEvent (enterFrame) {
if ((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Cam.fadeOut._currentframe == 1)) {
_root.stopCam = true;
_root.stopp = true;
_root.Cam.fadeOut.play();
}
}
Instance of Symbol 397 MovieClip in Frame 20
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 4)) && (_root.player._x < (_x + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 20
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 2)) && (_root.player._x > (_x - 200))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 20
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 1)) && (_root.player._y > (_y - 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 541 MovieClip in Frame 20
onClipEvent (enterFrame) {
if (((((this.hitTest(_root.player) && (_root.player._currentframe == 2)) && (_root.land.wall3._currentframe >= 310)) && (_root.land.wall3._currentframe <= 332)) && (varM != true)) && (var1 != true)) {
var medal_name = "Just Made It";
com.newgrounds.API.unlockMedal(medal_name, _root.Cam._x, _root.Cam._y);
varM = true;
}
if (this.hitTest(_root.player) && (_root.land.wall3._currentframe <= 331)) {
var1 = true;
}
}
Instance of Symbol 397 MovieClip in Frame 20
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 3)) && (_root.player._y < (_y + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 432 MovieClip "player" in Frame 20
onClipEvent (load) {
xspeed = 0;
yspeed = 0;
grav = 1;
w = _width / 2;
h = _height / 2;
scale = _xscale;
rot = _rotation;
grounded = true;
jump = false;
_root.playerX = _x;
_root.playerY = _y;
_root._x = _root.dx;
_root._y = _root.dy;
standStill = 0;
}
onClipEvent (enterFrame) {
standStill++;
if (standStill <= 5) {
_x = -2162;
_y = 276;
}
if (Key.isDown(82)) {
_root.Cam.fadeOutRestart.play();
_root.reStart = _root.reStart + 1;
}
if (_root.Gravity == 1) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, (_y + h) + 30, true)) && (!_root.plat.hitTest(_x, (_y + h) + 30, true))) {
if (_rotation != rot) {
_rotation = (_rotation - 5);
}
} else {
_rotation = rot;
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, (_y + h) + 30, true)) && (!_root.plat.hitTest(_x, (_y + h) + 30, true))) {
if (_rotation != rot) {
_rotation = (_rotation + 5);
}
} else {
_rotation = rot;
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != rot) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed * 0.83;
_y = (_y + yspeed);
yspeed = yspeed + grav;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
xspeed = xspeed + 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
xspeed = xspeed - 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
yspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (jump != true)) && (_currentframe != 3)) {
this.gotoAndStop(1);
}
if (_root.plat.hitTest(_x, (_y + h) + 4, grounded)) {
_x = (_root.plat._x - _root.plat.dx);
}
if ((_root.land.hitTest(_x, (_y + h) + 10, true) && (yspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest(_x, (_y + h) + 6, true) && (yspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y + h) + 4, true) or _root.plat.hitTest(_x, (_y + h) + 2, true)) {
if (!Key.isDown(38)) {
yspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest(_x, (_y + h) - 3, true)) {
_y = (_y - 0.1);
}
while (_root.plat.hitTest(_x, (_y + h) - 3, true)) {
_y = (_y - 0.1);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x + w, _y, true) or _root.plat.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
while (_root.plat.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.land.hitTest(_x - w, _y, true) or _root.plat.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
while (_root.plat.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
yspeed = 0;
_rotation = rot;
jump = false;
}
}
if (_root.Gravity == 2) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x - w) + 30, _y, true)) && (!_root.plat.hitTest((_x - w) + 30, _y, true))) {
if (_rotation >= (rot - 90)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rot - 90);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x - w) + 30, _y, true)) && (!_root.plat.hitTest((_x - w) + 30, _y, true))) {
if (_rotation != (rot - 90)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot - 90);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot - 90)) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed + grav;
_y = (_y + yspeed);
yspeed = yspeed * 0.83;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
yspeed = yspeed - 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
yspeed = yspeed + 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
xspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest((_x + w) + 55, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x + w) + 45, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest((_x + w) + 45, _y, true) or _root.plat.hitTest((_x + w) + 45, _y, true)) {
if (!Key.isDown(38)) {
xspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest((_x + w) + 38, _y, true)) {
_x = (_x - 0.4);
}
while (_root.plat.hitTest((_x + w) + 38, _y, true)) {
_x = (_x - 0.4);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.plat.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.plat.hitTest(_x, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.land.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
_rotation = (rot - 90);
}
}
if (_root.Gravity == 3) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x + w) + 30, _y, true)) && (!_root.plat.hitTest((_x + w) + 30, _y, true))) {
if (_rotation != (rot - 180)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rot - 180);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x + w) + 30, _y - h, true)) && (!_root.plat.hitTest((_x + w) + 30, _y - h, true))) {
if (_rotation != (rot + 180)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot + 180);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot - 180)) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed * 0.83;
_y = (_y + yspeed);
yspeed = yspeed - grav;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
xspeed = xspeed - 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
xspeed = xspeed + 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
yspeed = 10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest(_x, (_y - h) - 11, true) && (yspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest(_x, (_y - h) - 6, true) && (yspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y - h) - 5, true) or _root.plat.hitTest(_x, (_y - h) - 3, true)) {
if (!Key.isDown(38)) {
yspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest(_x, (_y - h) + 5, true)) {
_y = (_y + 0.1);
}
while (_root.plat.hitTest(_x, (_y - h) + 5, true)) {
_y = (_y + 0.1);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.plat.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.plat.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.land.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (_root.plat.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.plat.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
yspeed = 0;
_rotation = (rot - 180);
}
}
if (_root.Gravity == 4) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, _y, true)) && (!_root.plat.hitTest(_x, _y, true))) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rott + 90);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, _y - h, true)) && (!_root.plat.hitTest(_x, _y - h, true))) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot + 90);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation - 9);
}
}
_x = (_x - xspeed);
xspeed = xspeed + grav;
_y = (_y + yspeed);
yspeed = yspeed * 0.83;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
yspeed = yspeed + 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
yspeed = yspeed - 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
xspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest((_x - w) - 60, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x - w) - 50, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest((_x - w) - 43, _y, true) or _root.plat.hitTest((_x - w) - 43, _y, true)) {
if (!Key.isDown(38)) {
xspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest((_x - w) - 38, _y, true)) {
_x = (_x + 0.1);
}
grounded = true;
jump = false;
while (_root.plat.hitTest((_x - w) - 38, _y, true)) {
_x = (_x + 0.1);
}
} else {
grounded = false;
}
if ((_root.land.hitTest((_x - w) - 55, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x - w) - 45, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y + h) - 30, true) or _root.plat.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
while (_root.plat.hitTest(_x + w, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.land.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
_rotation = (rot + 90);
}
}
if (((grounded && (!this.hitTest(_root.noGrav1))) && (!this.hitTest(_root.noGrav2))) && (!this.hitTest(_root.noGrav3))) {
if (Key.isDown(83) && (sHold != true)) {
sHold = true;
}
if ((!Key.isDown(83)) && (sHold == true)) {
sHold = false;
}
if (Key.isDown(65) && (aHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 0;
if (_root.Gravity <= 1) {
_root.Gravity = 5;
}
_root.lastKeyPressed = 1;
_root.CamTurn--;
_root.Gravity--;
aHold = true;
}
if ((!Key.isDown(65)) && (aHold == true)) {
aHold = false;
}
if (Key.isDown(68) && (dHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 0;
_root.Gravity++;
if (_root.Gravity > 4) {
_root.Gravity = 1;
}
_root.lastKeyPressed = 2;
dHold = true;
}
if ((!Key.isDown(68)) && (dHold == true)) {
dHold = false;
}
if (Key.isDown(87) && (wHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 3;
if (_root.Gravity == 1) {
_root.Gravity = 3;
} else if (_root.Gravity == 3) {
_root.Gravity = 1;
}
if (_root.Gravity == 2) {
_root.Gravity = 4;
} else if (_root.Gravity == 4) {
_root.Gravity = 2;
}
wHold = true;
}
if ((!Key.isDown(87)) && (wHold == true)) {
wHold = false;
}
}
}
Instance of Symbol 466 MovieClip "Cam" in Frame 20
onClipEvent (load) {
_rotation = 360;
rot = _rotation;
rot2 = rot + 270;
scalex = _xscale + 20;
scaley = _yscale + 20;
_xscale = (scalex + 100);
_yscale = (scaley + 100);
shiftHold = 0;
}
onClipEvent (enterFrame) {
if (_root.stopCam != true) {
_x = (_x + ((_root.player._x - _x) / 10));
_y = (_y + ((_root.player._y - _y) / 10));
}
if (!Key.isDown(16)) {
if (_xscale > scalex) {
_xscale = (_xscale - 2);
}
if (_yscale > scaley) {
_yscale = (_yscale - 2);
}
shiftHold = 0;
}
if (Key.isDown(16)) {
shiftHold++;
if (_xscale < (scalex + 100)) {
_xscale = (_xscale + 2);
}
if (_yscale < (scaley + 100)) {
_yscale = (_yscale + 2);
}
}
_root.bg2._x = _x;
_root.bg2._y = _y;
if (shiftHold >= 900) {
if (_root.gotShiftMedal != true) {
shiftHold = 0;
_root.gotShiftMedal = true;
}
}
}
Frame 21
_root.nextFrame();
_root.Cam._x = 0;
_root.Cam._y = 0;
_root._x = _root.dx;
_root._y = _root.dy;
_root.player.grav = 0;
_root.player.yspeed = 0;
_root.player.xspeed = 0;
Frame 22
_root.Cam.lvla.lvlb.lvl = "10";
function rotateCamBack() {
if (_root.Cam._rotation < _root.Cam.rot) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
if (_root.Cam._rotation > _root.Cam.rot) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
_root.turn++;
}
function rotateCam1() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation > (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
if (_root.Cam._rotation < (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation > (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
if (_root.Cam._rotation < (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
function rotateCam2() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation > (_root.Cam.rot - 180)) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation < (_root.Cam.rot + 180)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
function rotateCam3() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation != 90) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation != 90) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
Gravity = 1;
CamTurn = 0;
lastKeyPressed = 1;
lastKeyPressed2 = 0;
_root.stopCam = false;
_root._x = _root.dx;
_root._y = _root.dy;
stop();
onEnterFrame = function () {
if ((_root.deaths >= 50) && (varDeath != true)) {
var _local2 = "Death Medal";
com.newgrounds.API.unlockMedal(_local2, _root.Cam._x, _root.Cam._y);
varDeath = true;
}
if ((_root.turns >= 500) && (varTurn != true)) {
var _local2 = "500th Flip";
com.newgrounds.API.unlockMedal(_local2, _root.Cam._x, _root.Cam._y);
varTurn = true;
}
if ((Key.isDown(77) && (_root.SOFF != true)) && (_root.holdM != true)) {
_root.all.setVolume(0);
_root.SOFF = true;
_root.holdM = true;
}
if ((Key.isDown(77) && (_root.SOFF == true)) && (_root.holdM != true)) {
_root.all.setVolume(100);
_root.SOFF = false;
_root.holdM = true;
}
if ((!Key.isDown(77)) && (_root.holdM == true)) {
_root.holdM = false;
}
if (Gravity == 1) {
rotateCamBack();
}
if (Gravity == 2) {
rotateCam1();
}
if (Gravity == 3) {
rotateCam2();
}
if (Gravity == 4) {
rotateCam3();
}
};
Instance of Symbol 494 MovieClip in Frame 22
onClipEvent (enterFrame) {
if (this.hitTest(_root.player.block) && (_currentframe == 1)) {
this.play();
_root.land.wall2.play();
}
}
Instance of Symbol 511 MovieClip in Frame 22
onClipEvent (enterFrame) {
if (this.hitTest(_root.player.block) && (_currentframe == 1)) {
this.play();
_root.land.wall.play();
}
}
Instance of Symbol 530 MovieClip in Frame 22
onClipEvent (load) {
i = 0;
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.player.block)) {
this.play();
_root.land.wall3.play();
}
if (_currentframe == 7) {
i++;
}
if (i >= 305) {
this.play();
i = 0;
}
}
Instance of Symbol 397 MovieClip in Frame 22
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 4)) && (_root.player._x < (_x + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 22
onClipEvent (enterFrame) {
if ((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Cam.fadeOut._currentframe == 1)) {
_root.stopCam = true;
_root.Cam.fadeOut.play();
}
}
Instance of Symbol 397 MovieClip in Frame 22
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 4)) && (_root.player._x < (_x + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 22
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 2)) && (_root.player._x > (_x - 200))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 22
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 1)) && (_root.player._y > (_y - 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 22
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 3)) && (_root.player._y < (_y + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 22
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 4)) && (_root.player._x < (_x + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 432 MovieClip "player" in Frame 22
onClipEvent (load) {
xspeed = 0;
yspeed = 0;
grav = 1;
w = _width / 2;
h = _height / 2;
scale = _xscale;
rot = _rotation;
grounded = true;
jump = false;
_root.playerX = _x;
_root.playerY = _y;
_root._x = _root.dx;
_root._y = _root.dy;
standStill = 0;
}
onClipEvent (enterFrame) {
standStill++;
if (standStill <= 5) {
_x = -245;
_y = 298;
}
if (Key.isDown(82)) {
_root.Cam.fadeOutRestart.play();
_root.reStart = _root.reStart + 1;
}
if (_root.Gravity == 1) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, (_y + h) + 30, true)) && (!_root.plat.hitTest(_x, (_y + h) + 30, true))) {
if (_rotation != rot) {
_rotation = (_rotation - 5);
}
} else {
_rotation = rot;
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, (_y + h) + 30, true)) && (!_root.plat.hitTest(_x, (_y + h) + 30, true))) {
if (_rotation != rot) {
_rotation = (_rotation + 5);
}
} else {
_rotation = rot;
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != rot) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed * 0.83;
_y = (_y + yspeed);
yspeed = yspeed + grav;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
xspeed = xspeed + 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
xspeed = xspeed - 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
yspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (jump != true)) && (_currentframe != 3)) {
this.gotoAndStop(1);
}
if (_root.plat.hitTest(_x, (_y + h) + 4, grounded)) {
_x = (_root.plat._x - _root.plat.dx);
}
if ((_root.land.hitTest(_x, (_y + h) + 10, true) && (yspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest(_x, (_y + h) + 6, true) && (yspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y + h) + 4, true) or _root.plat.hitTest(_x, (_y + h) + 2, true)) {
if (!Key.isDown(38)) {
yspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest(_x, (_y + h) - 3, true)) {
_y = (_y - 0.1);
}
while (_root.plat.hitTest(_x, (_y + h) - 3, true)) {
_y = (_y - 0.1);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x + w, _y, true) or _root.plat.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
while (_root.plat.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.land.hitTest(_x - w, _y, true) or _root.plat.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
while (_root.plat.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
yspeed = 0;
_rotation = rot;
jump = false;
}
}
if (_root.Gravity == 2) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x - w) + 30, _y, true)) && (!_root.plat.hitTest((_x - w) + 30, _y, true))) {
if (_rotation >= (rot - 90)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rot - 90);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x - w) + 30, _y, true)) && (!_root.plat.hitTest((_x - w) + 30, _y, true))) {
if (_rotation != (rot - 90)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot - 90);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot - 90)) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed + grav;
_y = (_y + yspeed);
yspeed = yspeed * 0.83;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
yspeed = yspeed - 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
yspeed = yspeed + 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
xspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest((_x + w) + 55, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x + w) + 45, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest((_x + w) + 45, _y, true) or _root.plat.hitTest((_x + w) + 45, _y, true)) {
if (!Key.isDown(38)) {
xspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest((_x + w) + 38, _y, true)) {
_x = (_x - 0.4);
}
while (_root.plat.hitTest((_x + w) + 38, _y, true)) {
_x = (_x - 0.4);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.plat.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.plat.hitTest(_x, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.land.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
_rotation = (rot - 90);
}
}
if (_root.Gravity == 3) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x + w) + 30, _y, true)) && (!_root.plat.hitTest((_x + w) + 30, _y, true))) {
if (_rotation != (rot - 180)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rot - 180);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x + w) + 30, _y - h, true)) && (!_root.plat.hitTest((_x + w) + 30, _y - h, true))) {
if (_rotation != (rot + 180)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot + 180);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot - 180)) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed * 0.83;
_y = (_y + yspeed);
yspeed = yspeed - grav;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
xspeed = xspeed - 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
xspeed = xspeed + 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
yspeed = 10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest(_x, (_y - h) - 11, true) && (yspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest(_x, (_y - h) - 6, true) && (yspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y - h) - 5, true) or _root.plat.hitTest(_x, (_y - h) - 3, true)) {
if (!Key.isDown(38)) {
yspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest(_x, (_y - h) + 5, true)) {
_y = (_y + 0.1);
}
while (_root.plat.hitTest(_x, (_y - h) + 5, true)) {
_y = (_y + 0.1);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.plat.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.plat.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.land.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (_root.plat.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.plat.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
yspeed = 0;
_rotation = (rot - 180);
}
}
if (_root.Gravity == 4) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, _y, true)) && (!_root.plat.hitTest(_x, _y, true))) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rott + 90);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, _y - h, true)) && (!_root.plat.hitTest(_x, _y - h, true))) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot + 90);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation - 9);
}
}
_x = (_x - xspeed);
xspeed = xspeed + grav;
_y = (_y + yspeed);
yspeed = yspeed * 0.83;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
yspeed = yspeed + 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
yspeed = yspeed - 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
xspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest((_x - w) - 60, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x - w) - 50, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest((_x - w) - 43, _y, true) or _root.plat.hitTest((_x - w) - 43, _y, true)) {
if (!Key.isDown(38)) {
xspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest((_x - w) - 38, _y, true)) {
_x = (_x + 0.1);
}
grounded = true;
jump = false;
while (_root.plat.hitTest((_x - w) - 38, _y, true)) {
_x = (_x + 0.1);
}
} else {
grounded = false;
}
if ((_root.land.hitTest((_x - w) - 55, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x - w) - 45, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y + h) - 30, true) or _root.plat.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
while (_root.plat.hitTest(_x + w, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.land.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
_rotation = (rot + 90);
}
}
if (((grounded && (!this.hitTest(_root.noGrav1))) && (!this.hitTest(_root.noGrav2))) && (!this.hitTest(_root.noGrav3))) {
if (Key.isDown(83) && (sHold != true)) {
sHold = true;
}
if ((!Key.isDown(83)) && (sHold == true)) {
sHold = false;
}
if (Key.isDown(65) && (aHold != true)) {
_root.lastKeyPressed2 = 0;
if (_root.Gravity <= 1) {
_root.Gravity = 5;
}
_root.lastKeyPressed = 1;
_root.CamTurn--;
_root.Gravity--;
aHold = true;
}
if ((!Key.isDown(65)) && (aHold == true)) {
aHold = false;
}
if (Key.isDown(68) && (dHold != true)) {
if (this.hitTest(_root.medala) && (_root.FF != true)) {
var medal_name = "Fall Fast";
com.newgrounds.API.unlockMedal(medal_name, _root.Cam._x, _root.Cam._y);
_root.FF = true;
}
_root.lastKeyPressed2 = 0;
_root.Gravity++;
if (_root.Gravity > 4) {
_root.Gravity = 1;
}
_root.lastKeyPressed = 2;
dHold = true;
}
if ((!Key.isDown(68)) && (dHold == true)) {
dHold = false;
}
if (Key.isDown(87) && (wHold != true)) {
_root.lastKeyPressed2 = 3;
if (_root.Gravity == 1) {
_root.Gravity = 3;
} else if (_root.Gravity == 3) {
_root.Gravity = 1;
}
if (_root.Gravity == 2) {
_root.Gravity = 4;
} else if (_root.Gravity == 4) {
_root.Gravity = 2;
}
wHold = true;
}
if ((!Key.isDown(87)) && (wHold == true)) {
wHold = false;
}
}
}
Instance of Symbol 466 MovieClip "Cam" in Frame 22
onClipEvent (load) {
_rotation = 360;
rot = _rotation;
rot2 = rot + 270;
scalex = _xscale + 20;
scaley = _yscale + 20;
_xscale = (scalex + 100);
_yscale = (scaley + 100);
shiftHold = 0;
}
onClipEvent (enterFrame) {
if (_root.stopCam != true) {
_x = (_x + ((_root.player._x - _x) / 10));
_y = (_y + ((_root.player._y - _y) / 10));
}
if (!Key.isDown(16)) {
if (_xscale > scalex) {
_xscale = (_xscale - 2);
}
if (_yscale > scaley) {
_yscale = (_yscale - 2);
}
shiftHold = 0;
}
if (Key.isDown(16)) {
shiftHold++;
if (_xscale < (scalex + 100)) {
_xscale = (_xscale + 2);
}
if (_yscale < (scaley + 100)) {
_yscale = (_yscale + 2);
}
}
_root.bg2._x = _x;
_root.bg2._y = _y;
if (shiftHold >= 900) {
if (_root.gotShiftMedal != true) {
shiftHold = 0;
_root.gotShiftMedal = true;
}
}
}
Frame 23
_root.nextFrame();
_root.Cam._x = 0;
_root.Cam._y = 0;
_root._x = _root.dx;
_root._y = _root.dy;
_root.player.grav = 0;
_root.player.yspeed = 0;
_root.player.xspeed = 0;
Frame 24
_root.Cam.lvla.lvlb.lvl = "11";
function rotateCamBack() {
if (_root.Cam._rotation < _root.Cam.rot) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
if (_root.Cam._rotation > _root.Cam.rot) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
_root.turn++;
}
function rotateCam1() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation > (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
if (_root.Cam._rotation < (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation > (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
if (_root.Cam._rotation < (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
function rotateCam2() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation > (_root.Cam.rot - 180)) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation < (_root.Cam.rot + 180)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
function rotateCam3() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation != 90) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation != 90) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
Gravity = 1;
CamTurn = 0;
lastKeyPressed = 1;
lastKeyPressed2 = 0;
_root.stopCam = false;
_root._x = _root.dx;
_root._y = _root.dy;
stop();
onEnterFrame = function () {
if ((_root.deaths >= 50) && (varDeath != true)) {
var _local2 = "Death Medal";
com.newgrounds.API.unlockMedal(_local2, _root.Cam._x, _root.Cam._y);
varDeath = true;
}
if ((_root.turns >= 500) && (varTurn != true)) {
var _local2 = "500th Flip";
com.newgrounds.API.unlockMedal(_local2, _root.Cam._x, _root.Cam._y);
varTurn = true;
}
if ((Key.isDown(77) && (_root.SOFF != true)) && (_root.holdM != true)) {
_root.all.setVolume(0);
_root.SOFF = true;
_root.holdM = true;
}
if ((Key.isDown(77) && (_root.SOFF == true)) && (_root.holdM != true)) {
_root.all.setVolume(100);
_root.SOFF = false;
_root.holdM = true;
}
if ((!Key.isDown(77)) && (_root.holdM == true)) {
_root.holdM = false;
}
if (Gravity == 1) {
rotateCamBack();
}
if (Gravity == 2) {
rotateCam1();
}
if (Gravity == 3) {
rotateCam2();
}
if (Gravity == 4) {
rotateCam3();
}
};
Instance of Symbol 397 MovieClip in Frame 24
onClipEvent (enterFrame) {
if ((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Cam.fadeOut._currentframe == 1)) {
_root.stopCam = true;
_root.Cam.fadeOut.play();
}
}
Instance of Symbol 397 MovieClip in Frame 24
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 4)) && (_root.player._x < (_x + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 24
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 2)) && (_root.player._x > (_x - 200))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 24
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 1)) && (_root.player._y > (_y - 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 24
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 3)) && (_root.player._y < (_y + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 24
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 4)) && (_root.player._x < (_x + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 557 MovieClip in Frame 24
onClipEvent (load) {
xSpeed = 4.1;
dx = _x;
varMove = 0;
i = 0;
}
onClipEvent (enterFrame) {
if ((_x >= (dx + 560)) && (varMove == 0)) {
varMove = 1;
}
if ((_x <= dx) && (varMove == 1)) {
varMove = 0;
}
if (varMove == 0) {
_x = (_x + xSpeed);
}
if (varMove == 1) {
_x = (_x - xSpeed);
}
if (this.hitTest(_root.player)) {
i++;
if ((_root.player._currentframe == 3) && (i <= 8)) {
_root.player.gotoAndStop(1);
}
}
if (!this.hitTest(_root.player)) {
i = 0;
}
}
Instance of Symbol 557 MovieClip in Frame 24
onClipEvent (load) {
xSpeed = 4.1;
dx = _x;
varMove = 0;
i = 0;
}
onClipEvent (enterFrame) {
if ((_x >= (dx + 500)) && (varMove == 0)) {
varMove = 1;
}
if ((_x <= dx) && (varMove == 1)) {
varMove = 0;
}
if (varMove == 0) {
_x = (_x + xSpeed);
}
if (varMove == 1) {
_x = (_x - xSpeed);
}
if (this.hitTest(_root.player)) {
i++;
if ((_root.player._currentframe == 3) && (i <= 8)) {
_root.player.gotoAndStop(1);
}
}
if (!this.hitTest(_root.player)) {
i = 0;
}
}
Instance of Symbol 432 MovieClip "player" in Frame 24
onClipEvent (load) {
xspeed = 0;
yspeed = 0;
grav = 1;
w = _width / 2;
h = _height / 2;
scale = _xscale;
rot = _rotation;
grounded = true;
jump = false;
_root.playerX = _x;
_root.playerY = _y;
_root._x = _root.dx;
_root._y = _root.dy;
standStill = 0;
}
onClipEvent (enterFrame) {
standStill++;
if (standStill <= 5) {
_x = -1255;
_y = 22;
}
if (Key.isDown(82)) {
_root.Cam.fadeOutRestart.play();
_root.reStart = _root.reStart + 1;
}
if (_root.Gravity == 1) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, (_y + h) + 30, true)) && (!_root.plat.hitTest(_x, (_y + h) + 30, true))) {
if (_rotation != rot) {
_rotation = (_rotation - 5);
}
} else {
_rotation = rot;
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, (_y + h) + 30, true)) && (!_root.plat.hitTest(_x, (_y + h) + 30, true))) {
if (_rotation != rot) {
_rotation = (_rotation + 5);
}
} else {
_rotation = rot;
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != rot) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed * 0.83;
_y = (_y + yspeed);
yspeed = yspeed + grav;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
xspeed = xspeed + 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
xspeed = xspeed - 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
yspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (jump != true)) && (_currentframe != 3)) {
this.gotoAndStop(1);
}
if (_root.plat.hitTest(_x, (_y + h) + 4, grounded)) {
_x = (_root.plat._x - _root.plat.dx);
}
if ((_root.land.hitTest(_x, (_y + h) + 10, true) && (yspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest(_x, (_y + h) + 6, true) && (yspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y + h) + 4, true) or _root.plat.hitTest(_x, (_y + h) + 2, true)) {
if (!Key.isDown(38)) {
yspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest(_x, (_y + h) - 3, true)) {
_y = (_y - 0.1);
}
while (_root.plat.hitTest(_x, (_y + h) - 3, true)) {
_y = (_y - 0.1);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x + w, _y, true) or _root.plat.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
while (_root.plat.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.land.hitTest(_x - w, _y, true) or _root.plat.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
while (_root.plat.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
yspeed = 0;
_rotation = rot;
jump = false;
}
}
if (_root.Gravity == 2) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x - w) + 30, _y, true)) && (!_root.plat.hitTest((_x - w) + 30, _y, true))) {
if (_rotation >= (rot - 90)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rot - 90);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x - w) + 30, _y, true)) && (!_root.plat.hitTest((_x - w) + 30, _y, true))) {
if (_rotation != (rot - 90)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot - 90);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot - 90)) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed + grav;
_y = (_y + yspeed);
yspeed = yspeed * 0.83;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
yspeed = yspeed - 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
yspeed = yspeed + 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
xspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest((_x + w) + 55, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x + w) + 45, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest((_x + w) + 45, _y, true) or _root.plat.hitTest((_x + w) + 45, _y, true)) {
if (!Key.isDown(38)) {
xspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest((_x + w) + 38, _y, true)) {
_x = (_x - 0.4);
}
while (_root.plat.hitTest((_x + w) + 38, _y, true)) {
_x = (_x - 0.4);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.plat.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.plat.hitTest(_x, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.land.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
_rotation = (rot - 90);
}
}
if (_root.Gravity == 3) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x + w) + 30, _y, true)) && (!_root.plat.hitTest((_x + w) + 30, _y, true))) {
if (_rotation != (rot - 180)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rot - 180);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x + w) + 30, _y - h, true)) && (!_root.plat.hitTest((_x + w) + 30, _y - h, true))) {
if (_rotation != (rot + 180)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot + 180);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot - 180)) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed * 0.83;
_y = (_y + yspeed);
yspeed = yspeed - grav;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
xspeed = xspeed - 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
xspeed = xspeed + 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
yspeed = 10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest(_x, (_y - h) - 11, true) && (yspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest(_x, (_y - h) - 6, true) && (yspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y - h) - 5, true) or _root.plat.hitTest(_x, (_y - h) - 3, true)) {
if (!Key.isDown(38)) {
yspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest(_x, (_y - h) + 5, true)) {
_y = (_y + 0.1);
}
while (_root.plat.hitTest(_x, (_y - h) + 5, true)) {
_y = (_y + 0.1);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.plat.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.plat.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.land.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (_root.plat.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.plat.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
yspeed = 0;
_rotation = (rot - 180);
}
}
if (_root.Gravity == 4) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, _y, true)) && (!_root.plat.hitTest(_x, _y, true))) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rott + 90);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, _y - h, true)) && (!_root.plat.hitTest(_x, _y - h, true))) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot + 90);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation - 9);
}
}
_x = (_x - xspeed);
xspeed = xspeed + grav;
_y = (_y + yspeed);
yspeed = yspeed * 0.83;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
yspeed = yspeed + 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
yspeed = yspeed - 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
xspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest((_x - w) - 60, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x - w) - 50, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest((_x - w) - 43, _y, true) or _root.plat.hitTest((_x - w) - 43, _y, true)) {
if (!Key.isDown(38)) {
xspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest((_x - w) - 38, _y, true)) {
_x = (_x + 0.1);
}
grounded = true;
jump = false;
while (_root.plat.hitTest((_x - w) - 38, _y, true)) {
_x = (_x + 0.1);
}
} else {
grounded = false;
}
if ((_root.land.hitTest((_x - w) - 55, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x - w) - 45, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y + h) - 30, true) or _root.plat.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
while (_root.plat.hitTest(_x + w, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.land.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
_rotation = (rot + 90);
}
}
if (((grounded && (!this.hitTest(_root.noGrav1))) && (!this.hitTest(_root.noGrav2))) && (!this.hitTest(_root.noGrav3))) {
if (Key.isDown(83) && (sHold != true)) {
sHold = true;
}
if ((!Key.isDown(83)) && (sHold == true)) {
sHold = false;
}
if (Key.isDown(65) && (aHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 0;
if (_root.Gravity <= 1) {
_root.Gravity = 5;
}
_root.lastKeyPressed = 1;
_root.CamTurn--;
_root.Gravity--;
aHold = true;
}
if ((!Key.isDown(65)) && (aHold == true)) {
aHold = false;
}
if (Key.isDown(68) && (dHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 0;
_root.Gravity++;
if (_root.Gravity > 4) {
_root.Gravity = 1;
}
_root.lastKeyPressed = 2;
dHold = true;
}
if ((!Key.isDown(68)) && (dHold == true)) {
dHold = false;
}
if (Key.isDown(87) && (wHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 3;
if (_root.Gravity == 1) {
_root.Gravity = 3;
} else if (_root.Gravity == 3) {
_root.Gravity = 1;
}
if (_root.Gravity == 2) {
_root.Gravity = 4;
} else if (_root.Gravity == 4) {
_root.Gravity = 2;
}
wHold = true;
}
if ((!Key.isDown(87)) && (wHold == true)) {
wHold = false;
}
}
}
Instance of Symbol 466 MovieClip "Cam" in Frame 24
onClipEvent (load) {
_rotation = 360;
rot = _rotation;
rot2 = rot + 270;
scalex = _xscale + 20;
scaley = _yscale + 20;
_xscale = (scalex + 100);
_yscale = (scaley + 100);
shiftHold = 0;
}
onClipEvent (enterFrame) {
if (_root.stopCam != true) {
_x = (_x + ((_root.player._x - _x) / 10));
_y = (_y + ((_root.player._y - _y) / 10));
}
if (!Key.isDown(16)) {
if (_xscale > scalex) {
_xscale = (_xscale - 2);
}
if (_yscale > scaley) {
_yscale = (_yscale - 2);
}
shiftHold = 0;
}
if (Key.isDown(16)) {
shiftHold++;
if (_xscale < (scalex + 100)) {
_xscale = (_xscale + 2);
}
if (_yscale < (scaley + 100)) {
_yscale = (_yscale + 2);
}
}
_root.bg2._x = _x;
_root.bg2._y = _y;
if (shiftHold >= 900) {
if (_root.gotShiftMedal != true) {
shiftHold = 0;
_root.gotShiftMedal = true;
}
}
}
Frame 25
_root.nextFrame();
_root.Cam._x = 0;
_root.Cam._y = 0;
_root._x = _root.dx;
_root._y = _root.dy;
_root.player.grav = 0;
_root.player.yspeed = 0;
_root.player.xspeed = 0;
Frame 26
_root.Cam.lvla.lvlb.lvl = "12";
function rotateCamBack() {
if (_root.Cam._rotation < _root.Cam.rot) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
if (_root.Cam._rotation > _root.Cam.rot) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
_root.turn++;
}
function rotateCam1() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation > (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
if (_root.Cam._rotation < (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation > (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
if (_root.Cam._rotation < (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
function rotateCam2() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation > (_root.Cam.rot - 180)) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation < (_root.Cam.rot + 180)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
function rotateCam3() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation != 90) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation != 90) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
Gravity = 1;
CamTurn = 0;
lastKeyPressed = 1;
lastKeyPressed2 = 0;
_root.stopCam = false;
_root._x = _root.dx;
_root._y = _root.dy;
stop();
onEnterFrame = function () {
if ((_root.deaths >= 50) && (varDeath != true)) {
var _local2 = "Death Medal";
com.newgrounds.API.unlockMedal(_local2, _root.Cam._x, _root.Cam._y);
varDeath = true;
}
if ((_root.turns >= 500) && (varTurn != true)) {
var _local2 = "500th Flip";
com.newgrounds.API.unlockMedal(_local2, _root.Cam._x, _root.Cam._y);
varTurn = true;
}
if ((Key.isDown(77) && (_root.SOFF != true)) && (_root.holdM != true)) {
_root.all.setVolume(0);
_root.SOFF = true;
_root.holdM = true;
}
if ((Key.isDown(77) && (_root.SOFF == true)) && (_root.holdM != true)) {
_root.all.setVolume(100);
_root.SOFF = false;
_root.holdM = true;
}
if ((!Key.isDown(77)) && (_root.holdM == true)) {
_root.holdM = false;
}
if (Gravity == 1) {
rotateCamBack();
}
if (Gravity == 2) {
rotateCam1();
}
if (Gravity == 3) {
rotateCam2();
}
if (Gravity == 4) {
rotateCam3();
}
};
Instance of Symbol 511 MovieClip in Frame 26
onClipEvent (enterFrame) {
if (this.hitTest(_root.player.block) && (_currentframe == 1)) {
this.play();
_root.land.wall.play();
}
}
Instance of Symbol 494 MovieClip in Frame 26
onClipEvent (enterFrame) {
if (this.hitTest(_root.player.block) && (_currentframe == 1)) {
this.play();
_root.land.wall2.play();
}
}
Instance of Symbol 530 MovieClip in Frame 26
onClipEvent (load) {
i = 0;
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.player.block)) {
this.play();
_root.land.wall3.play();
}
if (_currentframe == 7) {
i++;
}
if (i >= 305) {
this.play();
i = 0;
}
}
Instance of Symbol 397 MovieClip in Frame 26
onClipEvent (enterFrame) {
if ((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Cam.fadeOut._currentframe == 1)) {
_root.stopCam = true;
_root.Cam.fadeOut.play();
}
}
Instance of Symbol 397 MovieClip in Frame 26
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 4)) && (_root.player._x < (_x + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 26
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 2)) && (_root.player._x > (_x - 200))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 26
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 1)) && (_root.player._y > (_y - 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 26
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 3)) && (_root.player._y < (_y + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 26
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 4)) && (_root.player._x < (_x + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 557 MovieClip in Frame 26
onClipEvent (load) {
ySpeed = 4.1;
dy = _y;
varMove = 0;
i = 0;
}
onClipEvent (enterFrame) {
if ((_y <= (dy - 500)) && (varMove == 0)) {
varMove = 1;
}
if ((_y >= dy) && (varMove == 1)) {
varMove = 0;
}
if (varMove == 0) {
_y = (_y - ySpeed);
}
if (varMove == 1) {
_y = (_y + ySpeed);
}
if (this.hitTest(_root.player)) {
i++;
if ((_root.player._currentframe == 3) && (i <= 8)) {
_root.player.gotoAndStop(1);
}
}
if (!this.hitTest(_root.player)) {
i = 0;
}
}
Instance of Symbol 557 MovieClip in Frame 26
onClipEvent (load) {
xSpeed = 4.1;
dx = _x;
varMove = 0;
i = 0;
}
onClipEvent (enterFrame) {
if ((_x <= (dx - 500)) && (varMove == 0)) {
varMove = 1;
}
if ((_x >= dx) && (varMove == 1)) {
varMove = 0;
}
if (varMove == 0) {
_x = (_x - xSpeed);
}
if (varMove == 1) {
_x = (_x + xSpeed);
}
if (this.hitTest(_root.player)) {
i++;
if ((_root.player._currentframe == 3) && (i <= 8)) {
_root.player.gotoAndStop(1);
}
}
if (!this.hitTest(_root.player)) {
i = 0;
}
}
Instance of Symbol 432 MovieClip "player" in Frame 26
onClipEvent (load) {
xspeed = 0;
yspeed = 0;
grav = 1;
w = _width / 2;
h = _height / 2;
scale = _xscale;
rot = _rotation;
grounded = true;
jump = false;
_root.playerX = _x;
_root.playerY = _y;
_root._x = _root.dx;
_root._y = _root.dy;
standStill = 0;
}
onClipEvent (enterFrame) {
standStill++;
if (standStill <= 5) {
_x = -465;
_y = 250;
}
if (Key.isDown(82)) {
_root.Cam.fadeOutRestart.play();
_root.reStart = _root.reStart + 1;
}
if (_root.Gravity == 1) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, (_y + h) + 30, true)) && (!_root.plat.hitTest(_x, (_y + h) + 30, true))) {
if (_rotation != rot) {
_rotation = (_rotation - 5);
}
} else {
_rotation = rot;
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, (_y + h) + 30, true)) && (!_root.plat.hitTest(_x, (_y + h) + 30, true))) {
if (_rotation != rot) {
_rotation = (_rotation + 5);
}
} else {
_rotation = rot;
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != rot) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed * 0.83;
_y = (_y + yspeed);
yspeed = yspeed + grav;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
xspeed = xspeed + 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
xspeed = xspeed - 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
yspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (jump != true)) && (_currentframe != 3)) {
this.gotoAndStop(1);
}
if (_root.plat.hitTest(_x, (_y + h) + 4, grounded)) {
_x = (_root.plat._x - _root.plat.dx);
}
if ((_root.land.hitTest(_x, (_y + h) + 10, true) && (yspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest(_x, (_y + h) + 6, true) && (yspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y + h) + 4, true) or _root.plat.hitTest(_x, (_y + h) + 2, true)) {
if (!Key.isDown(38)) {
yspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest(_x, (_y + h) - 3, true)) {
_y = (_y - 0.1);
}
while (_root.plat.hitTest(_x, (_y + h) - 3, true)) {
_y = (_y - 0.1);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x + w, _y, true) or _root.plat.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
while (_root.plat.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.land.hitTest(_x - w, _y, true) or _root.plat.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
while (_root.plat.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
yspeed = 0;
_rotation = rot;
jump = false;
}
}
if (_root.Gravity == 2) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x - w) + 30, _y, true)) && (!_root.plat.hitTest((_x - w) + 30, _y, true))) {
if (_rotation >= (rot - 90)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rot - 90);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x - w) + 30, _y, true)) && (!_root.plat.hitTest((_x - w) + 30, _y, true))) {
if (_rotation != (rot - 90)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot - 90);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot - 90)) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed + grav;
_y = (_y + yspeed);
yspeed = yspeed * 0.83;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
yspeed = yspeed - 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
yspeed = yspeed + 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
xspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest((_x + w) + 55, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x + w) + 45, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest((_x + w) + 45, _y, true) or _root.plat.hitTest((_x + w) + 45, _y, true)) {
if (!Key.isDown(38)) {
xspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest((_x + w) + 38, _y, true)) {
_x = (_x - 0.4);
}
while (_root.plat.hitTest((_x + w) + 38, _y, true)) {
_x = (_x - 0.4);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.plat.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.plat.hitTest(_x, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.land.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
_rotation = (rot - 90);
}
}
if (_root.Gravity == 3) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x + w) + 30, _y, true)) && (!_root.plat.hitTest((_x + w) + 30, _y, true))) {
if (_rotation != (rot - 180)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rot - 180);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x + w) + 30, _y - h, true)) && (!_root.plat.hitTest((_x + w) + 30, _y - h, true))) {
if (_rotation != (rot + 180)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot + 180);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot - 180)) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed * 0.83;
_y = (_y + yspeed);
yspeed = yspeed - grav;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
xspeed = xspeed - 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
xspeed = xspeed + 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
yspeed = 10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest(_x, (_y - h) - 11, true) && (yspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest(_x, (_y - h) - 6, true) && (yspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y - h) - 5, true) or _root.plat.hitTest(_x, (_y - h) - 3, true)) {
if (!Key.isDown(38)) {
yspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest(_x, (_y - h) + 5, true)) {
_y = (_y + 0.1);
}
while (_root.plat.hitTest(_x, (_y - h) + 5, true)) {
_y = (_y + 0.1);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.plat.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.plat.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.land.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (_root.plat.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.plat.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
yspeed = 0;
_rotation = (rot - 180);
}
}
if (_root.Gravity == 4) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, _y, true)) && (!_root.plat.hitTest(_x, _y, true))) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rott + 90);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, _y - h, true)) && (!_root.plat.hitTest(_x, _y - h, true))) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot + 90);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation - 9);
}
}
_x = (_x - xspeed);
xspeed = xspeed + grav;
_y = (_y + yspeed);
yspeed = yspeed * 0.83;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
yspeed = yspeed + 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
yspeed = yspeed - 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
xspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest((_x - w) - 60, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x - w) - 50, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest((_x - w) - 43, _y, true) or _root.plat.hitTest((_x - w) - 43, _y, true)) {
if (!Key.isDown(38)) {
xspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest((_x - w) - 38, _y, true)) {
_x = (_x + 0.1);
}
grounded = true;
jump = false;
while (_root.plat.hitTest((_x - w) - 38, _y, true)) {
_x = (_x + 0.1);
}
} else {
grounded = false;
}
if ((_root.land.hitTest((_x - w) - 55, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x - w) - 45, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y + h) - 30, true) or _root.plat.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
while (_root.plat.hitTest(_x + w, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.land.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
_rotation = (rot + 90);
}
}
if (((grounded && (!this.hitTest(_root.noGrav1))) && (!this.hitTest(_root.noGrav2))) && (!this.hitTest(_root.noGrav3))) {
if (Key.isDown(83) && (sHold != true)) {
sHold = true;
}
if ((!Key.isDown(83)) && (sHold == true)) {
sHold = false;
}
if (Key.isDown(65) && (aHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 0;
if (_root.Gravity <= 1) {
_root.Gravity = 5;
}
_root.lastKeyPressed = 1;
_root.CamTurn--;
_root.Gravity--;
aHold = true;
}
if ((!Key.isDown(65)) && (aHold == true)) {
aHold = false;
}
if (Key.isDown(68) && (dHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 0;
_root.Gravity++;
if (_root.Gravity > 4) {
_root.Gravity = 1;
}
_root.lastKeyPressed = 2;
dHold = true;
}
if ((!Key.isDown(68)) && (dHold == true)) {
dHold = false;
}
if (Key.isDown(87) && (wHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 3;
if (_root.Gravity == 1) {
_root.Gravity = 3;
} else if (_root.Gravity == 3) {
_root.Gravity = 1;
}
if (_root.Gravity == 2) {
_root.Gravity = 4;
} else if (_root.Gravity == 4) {
_root.Gravity = 2;
}
wHold = true;
}
if ((!Key.isDown(87)) && (wHold == true)) {
wHold = false;
}
}
}
Instance of Symbol 466 MovieClip "Cam" in Frame 26
onClipEvent (load) {
_rotation = 360;
rot = _rotation;
rot2 = rot + 270;
scalex = _xscale + 20;
scaley = _yscale + 20;
_xscale = (scalex + 100);
_yscale = (scaley + 100);
shiftHold = 0;
}
onClipEvent (enterFrame) {
if (_root.stopCam != true) {
_x = (_x + ((_root.player._x - _x) / 10));
_y = (_y + ((_root.player._y - _y) / 10));
}
if (!Key.isDown(16)) {
if (_xscale > scalex) {
_xscale = (_xscale - 2);
}
if (_yscale > scaley) {
_yscale = (_yscale - 2);
}
shiftHold = 0;
}
if (Key.isDown(16)) {
shiftHold++;
if (_xscale < (scalex + 100)) {
_xscale = (_xscale + 2);
}
if (_yscale < (scaley + 100)) {
_yscale = (_yscale + 2);
}
}
_root.bg2._x = _x;
_root.bg2._y = _y;
if (shiftHold >= 900) {
if (_root.gotShiftMedal != true) {
shiftHold = 0;
_root.gotShiftMedal = true;
}
}
}
Frame 27
_root.nextFrame();
_root.Cam._x = 0;
_root.Cam._y = 0;
_root._x = _root.dx;
_root._y = _root.dy;
_root.player.grav = 0;
_root.player.yspeed = 0;
_root.player.xspeed = 0;
Frame 28
_root.Cam.lvla.lvlb.lvl = "13";
function rotateCamBack() {
if (_root.Cam._rotation < _root.Cam.rot) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
if (_root.Cam._rotation > _root.Cam.rot) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
_root.turn++;
}
function rotateCam1() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation > (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
if (_root.Cam._rotation < (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation > (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
if (_root.Cam._rotation < (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
function rotateCam2() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation > (_root.Cam.rot - 180)) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation < (_root.Cam.rot + 180)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
function rotateCam3() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation != 90) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation != 90) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
Gravity = 1;
CamTurn = 0;
lastKeyPressed = 1;
lastKeyPressed2 = 0;
_root.stopCam = false;
_root._x = _root.dx;
_root._y = _root.dy;
stop();
onEnterFrame = function () {
if ((_root.deaths >= 50) && (varDeath != true)) {
var _local2 = "Death Medal";
com.newgrounds.API.unlockMedal(_local2, _root.Cam._x, _root.Cam._y);
varDeath = true;
}
if ((_root.turns >= 500) && (varTurn != true)) {
var _local2 = "500th Flip";
com.newgrounds.API.unlockMedal(_local2, _root.Cam._x, _root.Cam._y);
varTurn = true;
}
if ((Key.isDown(77) && (_root.SOFF != true)) && (_root.holdM != true)) {
_root.all.setVolume(0);
_root.SOFF = true;
_root.holdM = true;
}
if ((Key.isDown(77) && (_root.SOFF == true)) && (_root.holdM != true)) {
_root.all.setVolume(100);
_root.SOFF = false;
_root.holdM = true;
}
if ((!Key.isDown(77)) && (_root.holdM == true)) {
_root.holdM = false;
}
if (Gravity == 1) {
rotateCamBack();
}
if (Gravity == 2) {
rotateCam1();
}
if (Gravity == 3) {
rotateCam2();
}
if (Gravity == 4) {
rotateCam3();
}
};
Instance of Symbol 530 MovieClip in Frame 28
onClipEvent (load) {
i = 0;
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.player.block)) {
this.play();
_root.land.wall3.play();
}
if (_currentframe == 7) {
i++;
}
if (i >= 305) {
this.play();
i = 0;
}
}
Instance of Symbol 494 MovieClip in Frame 28
onClipEvent (enterFrame) {
if (this.hitTest(_root.player.block) && (_currentframe == 1)) {
this.play();
_root.land.wall2.play();
}
}
Instance of Symbol 511 MovieClip in Frame 28
onClipEvent (enterFrame) {
if (this.hitTest(_root.player.block) && (_currentframe == 1)) {
this.play();
_root.land.wall.play();
}
}
Instance of Symbol 397 MovieClip in Frame 28
onClipEvent (enterFrame) {
if ((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Cam.fadeOut._currentframe == 1)) {
_root.stopCam = true;
_root.Cam.fadeOut.play();
}
}
Instance of Symbol 397 MovieClip in Frame 28
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 4)) && (_root.player._x < (_x + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 28
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 4)) && (_root.player._x < (_x + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 28
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 1)) && (_root.player._y > (_y - 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 28
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 3)) && (_root.player._y < (_y + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 28
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 2)) && (_root.player._x > (_x - 200))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 557 MovieClip in Frame 28
onClipEvent (load) {
ySpeed = 2.2;
xSpeed = 2.2;
dy = _y;
dx = _x;
varMove = 0;
varMove2 = 0;
i = 0;
}
onClipEvent (enterFrame) {
if ((_y <= (dy - 500)) && (varMove == 0)) {
varMove = 1;
}
if ((_x <= (dx - 500)) && (varMove2 == 0)) {
varMove2 = 1;
}
if ((_y >= dy) && (varMove == 1)) {
varMove = 0;
}
if ((_x >= dx) && (varMove2 == 1)) {
varMove2 = 0;
}
if (varMove == 0) {
_y = (_y - ySpeed);
}
if (varMove == 1) {
_y = (_y + ySpeed);
}
if (varMove2 == 0) {
_x = (_x - xSpeed);
}
if (varMove2 == 1) {
_x = (_x + xSpeed);
}
if (this.hitTest(_root.player)) {
i++;
if ((_root.player._currentframe == 3) && (i <= 8)) {
_root.player.gotoAndStop(1);
}
}
if (!this.hitTest(_root.player)) {
i = 0;
}
}
Instance of Symbol 557 MovieClip in Frame 28
onClipEvent (load) {
ySpeed = 2.2;
dy = _y;
varMove = 0;
i = 0;
}
onClipEvent (enterFrame) {
if ((_y <= (dy - 250)) && (varMove == 0)) {
varMove = 1;
}
if ((_y >= dy) && (varMove == 1)) {
varMove = 0;
}
if (varMove == 0) {
_y = (_y - ySpeed);
}
if (varMove == 1) {
_y = (_y + ySpeed);
}
if (this.hitTest(_root.player)) {
i++;
if ((_root.player._currentframe == 3) && (i <= 8)) {
_root.player.gotoAndStop(1);
}
}
if (!this.hitTest(_root.player)) {
i = 0;
}
}
Instance of Symbol 432 MovieClip "player" in Frame 28
onClipEvent (load) {
xspeed = 0;
yspeed = 0;
grav = 1;
w = _width / 2;
h = _height / 2;
scale = _xscale;
rot = _rotation;
grounded = true;
jump = false;
_root.playerX = _x;
_root.playerY = _y;
_root._x = _root.dx;
_root._y = _root.dy;
standStill = 0;
}
onClipEvent (enterFrame) {
standStill++;
if (standStill <= 5) {
_x = 517;
_y = 243;
}
if (Key.isDown(82)) {
_root.Cam.fadeOutRestart.play();
_root.reStart = _root.reStart + 1;
}
if (_root.Gravity == 1) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, (_y + h) + 30, true)) && (!_root.plat.hitTest(_x, (_y + h) + 30, true))) {
if (_rotation != rot) {
_rotation = (_rotation - 5);
}
} else {
_rotation = rot;
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, (_y + h) + 30, true)) && (!_root.plat.hitTest(_x, (_y + h) + 30, true))) {
if (_rotation != rot) {
_rotation = (_rotation + 5);
}
} else {
_rotation = rot;
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != rot) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed * 0.83;
_y = (_y + yspeed);
yspeed = yspeed + grav;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
xspeed = xspeed + 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
xspeed = xspeed - 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
yspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (jump != true)) && (_currentframe != 3)) {
this.gotoAndStop(1);
}
if (_root.plat.hitTest(_x, (_y + h) + 4, grounded)) {
_x = (_root.plat._x - _root.plat.dx);
}
if ((_root.land.hitTest(_x, (_y + h) + 10, true) && (yspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest(_x, (_y + h) + 6, true) && (yspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y + h) + 4, true) or _root.plat.hitTest(_x, (_y + h) + 2, true)) {
if (!Key.isDown(38)) {
yspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest(_x, (_y + h) - 3, true)) {
_y = (_y - 0.1);
}
while (_root.plat.hitTest(_x, (_y + h) - 3, true)) {
_y = (_y - 0.1);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x + w, _y, true) or _root.plat.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
while (_root.plat.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.land.hitTest(_x - w, _y, true) or _root.plat.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
while (_root.plat.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
yspeed = 0;
_rotation = rot;
jump = false;
}
}
if (_root.Gravity == 2) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x - w) + 30, _y, true)) && (!_root.plat.hitTest((_x - w) + 30, _y, true))) {
if (_rotation >= (rot - 90)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rot - 90);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x - w) + 30, _y, true)) && (!_root.plat.hitTest((_x - w) + 30, _y, true))) {
if (_rotation != (rot - 90)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot - 90);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot - 90)) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed + grav;
_y = (_y + yspeed);
yspeed = yspeed * 0.83;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
yspeed = yspeed - 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
yspeed = yspeed + 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
xspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest((_x + w) + 55, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x + w) + 45, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest((_x + w) + 45, _y, true) or _root.plat.hitTest((_x + w) + 45, _y, true)) {
if (!Key.isDown(38)) {
xspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest((_x + w) + 38, _y, true)) {
_x = (_x - 0.4);
}
while (_root.plat.hitTest((_x + w) + 38, _y, true)) {
_x = (_x - 0.4);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.plat.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.plat.hitTest(_x, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.land.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
_rotation = (rot - 90);
}
}
if (_root.Gravity == 3) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x + w) + 30, _y, true)) && (!_root.plat.hitTest((_x + w) + 30, _y, true))) {
if (_rotation != (rot - 180)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rot - 180);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x + w) + 30, _y - h, true)) && (!_root.plat.hitTest((_x + w) + 30, _y - h, true))) {
if (_rotation != (rot + 180)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot + 180);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot - 180)) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed * 0.83;
_y = (_y + yspeed);
yspeed = yspeed - grav;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
xspeed = xspeed - 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
xspeed = xspeed + 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
yspeed = 10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest(_x, (_y - h) - 11, true) && (yspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest(_x, (_y - h) - 6, true) && (yspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y - h) - 5, true) or _root.plat.hitTest(_x, (_y - h) - 3, true)) {
if (!Key.isDown(38)) {
yspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest(_x, (_y - h) + 5, true)) {
_y = (_y + 0.1);
}
while (_root.plat.hitTest(_x, (_y - h) + 5, true)) {
_y = (_y + 0.1);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.plat.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.plat.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.land.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (_root.plat.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.plat.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
yspeed = 0;
_rotation = (rot - 180);
}
}
if (_root.Gravity == 4) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, _y, true)) && (!_root.plat.hitTest(_x, _y, true))) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rott + 90);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, _y - h, true)) && (!_root.plat.hitTest(_x, _y - h, true))) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot + 90);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation - 9);
}
}
_x = (_x - xspeed);
xspeed = xspeed + grav;
_y = (_y + yspeed);
yspeed = yspeed * 0.83;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
yspeed = yspeed + 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
yspeed = yspeed - 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
xspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest((_x - w) - 60, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x - w) - 50, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest((_x - w) - 43, _y, true) or _root.plat.hitTest((_x - w) - 43, _y, true)) {
if (!Key.isDown(38)) {
xspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest((_x - w) - 38, _y, true)) {
_x = (_x + 0.1);
}
grounded = true;
jump = false;
while (_root.plat.hitTest((_x - w) - 38, _y, true)) {
_x = (_x + 0.1);
}
} else {
grounded = false;
}
if ((_root.land.hitTest((_x - w) - 55, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x - w) - 45, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y + h) - 30, true) or _root.plat.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
while (_root.plat.hitTest(_x + w, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.land.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
_rotation = (rot + 90);
}
}
if (((grounded && (!this.hitTest(_root.noGrav1))) && (!this.hitTest(_root.noGrav2))) && (!this.hitTest(_root.noGrav3))) {
if (Key.isDown(83) && (sHold != true)) {
sHold = true;
}
if ((!Key.isDown(83)) && (sHold == true)) {
sHold = false;
}
if (Key.isDown(65) && (aHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 0;
if (_root.Gravity <= 1) {
_root.Gravity = 5;
}
_root.lastKeyPressed = 1;
_root.CamTurn--;
_root.Gravity--;
aHold = true;
}
if ((!Key.isDown(65)) && (aHold == true)) {
aHold = false;
}
if (Key.isDown(68) && (dHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 0;
_root.Gravity++;
if (_root.Gravity > 4) {
_root.Gravity = 1;
}
_root.lastKeyPressed = 2;
dHold = true;
}
if ((!Key.isDown(68)) && (dHold == true)) {
dHold = false;
}
if (Key.isDown(87) && (wHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 3;
if (_root.Gravity == 1) {
_root.Gravity = 3;
} else if (_root.Gravity == 3) {
_root.Gravity = 1;
}
if (_root.Gravity == 2) {
_root.Gravity = 4;
} else if (_root.Gravity == 4) {
_root.Gravity = 2;
}
wHold = true;
}
if ((!Key.isDown(87)) && (wHold == true)) {
wHold = false;
}
}
}
Instance of Symbol 466 MovieClip "Cam" in Frame 28
onClipEvent (load) {
_rotation = 360;
rot = _rotation;
rot2 = rot + 270;
scalex = _xscale + 20;
scaley = _yscale + 20;
_xscale = (scalex + 100);
_yscale = (scaley + 100);
shiftHold = 0;
}
onClipEvent (enterFrame) {
if (_root.stopCam != true) {
_x = (_x + ((_root.player._x - _x) / 10));
_y = (_y + ((_root.player._y - _y) / 10));
}
if (!Key.isDown(16)) {
if (_xscale > scalex) {
_xscale = (_xscale - 2);
}
if (_yscale > scaley) {
_yscale = (_yscale - 2);
}
shiftHold = 0;
}
if (Key.isDown(16)) {
shiftHold++;
if (_xscale < (scalex + 100)) {
_xscale = (_xscale + 2);
}
if (_yscale < (scaley + 100)) {
_yscale = (_yscale + 2);
}
}
_root.bg2._x = _x;
_root.bg2._y = _y;
if (shiftHold >= 900) {
if (_root.gotShiftMedal != true) {
shiftHold = 0;
_root.gotShiftMedal = true;
}
}
}
Frame 29
_root.nextFrame();
_root.Cam._x = 0;
_root.Cam._y = 0;
_root._x = _root.dx;
_root._y = _root.dy;
_root.player.grav = 0;
_root.player.yspeed = 0;
_root.player.xspeed = 0;
Frame 30
_root.Cam.lvla.lvlb.lvl = "14";
function rotateCamBack() {
if (_root.Cam._rotation < _root.Cam.rot) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
if (_root.Cam._rotation > _root.Cam.rot) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
_root.turn++;
}
function rotateCam1() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation > (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
if (_root.Cam._rotation < (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation > (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
if (_root.Cam._rotation < (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
function rotateCam2() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation > (_root.Cam.rot - 180)) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation < (_root.Cam.rot + 180)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
function rotateCam3() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation != 90) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation != 90) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
Gravity = 1;
CamTurn = 0;
lastKeyPressed = 1;
lastKeyPressed2 = 0;
_root.stopCam = false;
_root._x = _root.dx;
_root._y = _root.dy;
stop();
onEnterFrame = function () {
if ((_root.deaths >= 50) && (varDeath != true)) {
var _local2 = "Death Medal";
com.newgrounds.API.unlockMedal(_local2, _root.Cam._x, _root.Cam._y);
varDeath = true;
}
if ((_root.turns >= 500) && (varTurn != true)) {
var _local2 = "500th Flip";
com.newgrounds.API.unlockMedal(_local2, _root.Cam._x, _root.Cam._y);
varTurn = true;
}
if ((Key.isDown(77) && (_root.SOFF != true)) && (_root.holdM != true)) {
_root.all.setVolume(0);
_root.SOFF = true;
_root.holdM = true;
}
if ((Key.isDown(77) && (_root.SOFF == true)) && (_root.holdM != true)) {
_root.all.setVolume(100);
_root.SOFF = false;
_root.holdM = true;
}
if ((!Key.isDown(77)) && (_root.holdM == true)) {
_root.holdM = false;
}
if (Gravity == 1) {
rotateCamBack();
}
if (Gravity == 2) {
rotateCam1();
}
if (Gravity == 3) {
rotateCam2();
}
if (Gravity == 4) {
rotateCam3();
}
};
Instance of Symbol 511 MovieClip in Frame 30
onClipEvent (enterFrame) {
if (this.hitTest(_root.player.block) && (_currentframe == 1)) {
this.play();
_root.land.wall.play();
}
}
Instance of Symbol 530 MovieClip in Frame 30
onClipEvent (load) {
i = 0;
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.player.block)) {
this.play();
_root.land.wall3.play();
}
if (_currentframe == 7) {
i++;
}
if (i >= 305) {
this.play();
i = 0;
}
}
Instance of Symbol 494 MovieClip in Frame 30
onClipEvent (enterFrame) {
if (this.hitTest(_root.player.block) && (_currentframe == 1)) {
this.play();
_root.land.wall2.play();
}
}
Instance of Symbol 397 MovieClip in Frame 30
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 4)) && (_root.player._x < (_x + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 30
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 2)) && (_root.player._x > (_x - 200))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 30
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 1)) && (_root.player._y > (_y - 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 30
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 3)) && (_root.player._y < (_y + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 30
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 4)) && (_root.player._x < (_x + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 30
onClipEvent (enterFrame) {
if ((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Cam.fadeOut._currentframe == 1)) {
_root.stopCam = true;
_root.Cam.fadeOut.play();
}
}
Instance of Symbol 557 MovieClip in Frame 30
onClipEvent (load) {
xSpeed = 4.1;
dx = _x;
varMove = 0;
i = 0;
}
onClipEvent (enterFrame) {
if ((_x <= (dx - 500)) && (varMove == 0)) {
varMove = 1;
}
if ((_x >= dx) && (varMove == 1)) {
varMove = 0;
}
if (varMove == 0) {
_x = (_x - xSpeed);
}
if (varMove == 1) {
_x = (_x + xSpeed);
}
if (this.hitTest(_root.player)) {
i++;
if ((_root.player._currentframe == 3) && (i <= 8)) {
_root.player.gotoAndStop(1);
}
}
if (!this.hitTest(_root.player)) {
i = 0;
}
}
Instance of Symbol 432 MovieClip "player" in Frame 30
onClipEvent (load) {
xspeed = 0;
yspeed = 0;
grav = 1;
w = _width / 2;
h = _height / 2;
scale = _xscale;
rot = _rotation;
grounded = true;
jump = false;
_root.playerX = _x;
_root.playerY = _y;
_root._x = _root.dx;
_root._y = _root.dy;
standStill = 0;
}
onClipEvent (enterFrame) {
standStill++;
if (standStill <= 5) {
_x = 21;
_y = 250;
}
if (Key.isDown(82)) {
_root.Cam.fadeOutRestart.play();
_root.reStart = _root.reStart + 1;
}
if (_root.Gravity == 1) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, (_y + h) + 30, true)) && (!_root.plat.hitTest(_x, (_y + h) + 30, true))) {
if (_rotation != rot) {
_rotation = (_rotation - 5);
}
} else {
_rotation = rot;
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, (_y + h) + 30, true)) && (!_root.plat.hitTest(_x, (_y + h) + 30, true))) {
if (_rotation != rot) {
_rotation = (_rotation + 5);
}
} else {
_rotation = rot;
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != rot) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed * 0.83;
_y = (_y + yspeed);
yspeed = yspeed + grav;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
xspeed = xspeed + 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
xspeed = xspeed - 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
yspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (jump != true)) && (_currentframe != 3)) {
this.gotoAndStop(1);
}
if (_root.plat.hitTest(_x, (_y + h) + 4, grounded)) {
_x = (_root.plat._x - _root.plat.dx);
}
if ((_root.land.hitTest(_x, (_y + h) + 10, true) && (yspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest(_x, (_y + h) + 6, true) && (yspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y + h) + 4, true) or _root.plat.hitTest(_x, (_y + h) + 2, true)) {
if (!Key.isDown(38)) {
yspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest(_x, (_y + h) - 3, true)) {
_y = (_y - 0.1);
}
while (_root.plat.hitTest(_x, (_y + h) - 3, true)) {
_y = (_y - 0.1);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x + w, _y, true) or _root.plat.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
while (_root.plat.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.land.hitTest(_x - w, _y, true) or _root.plat.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
while (_root.plat.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
yspeed = 0;
_rotation = rot;
jump = false;
}
}
if (_root.Gravity == 2) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x - w) + 30, _y, true)) && (!_root.plat.hitTest((_x - w) + 30, _y, true))) {
if (_rotation >= (rot - 90)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rot - 90);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x - w) + 30, _y, true)) && (!_root.plat.hitTest((_x - w) + 30, _y, true))) {
if (_rotation != (rot - 90)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot - 90);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot - 90)) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed + grav;
_y = (_y + yspeed);
yspeed = yspeed * 0.83;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
yspeed = yspeed - 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
yspeed = yspeed + 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
xspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest((_x + w) + 55, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x + w) + 45, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest((_x + w) + 45, _y, true) or _root.plat.hitTest((_x + w) + 45, _y, true)) {
if (!Key.isDown(38)) {
xspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest((_x + w) + 38, _y, true)) {
_x = (_x - 0.4);
}
while (_root.plat.hitTest((_x + w) + 38, _y, true)) {
_x = (_x - 0.4);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.plat.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.plat.hitTest(_x, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.land.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
_rotation = (rot - 90);
}
}
if (_root.Gravity == 3) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x + w) + 30, _y, true)) && (!_root.plat.hitTest((_x + w) + 30, _y, true))) {
if (_rotation != (rot - 180)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rot - 180);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x + w) + 30, _y - h, true)) && (!_root.plat.hitTest((_x + w) + 30, _y - h, true))) {
if (_rotation != (rot + 180)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot + 180);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot - 180)) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed * 0.83;
_y = (_y + yspeed);
yspeed = yspeed - grav;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
xspeed = xspeed - 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
xspeed = xspeed + 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
yspeed = 10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest(_x, (_y - h) - 11, true) && (yspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest(_x, (_y - h) - 6, true) && (yspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y - h) - 5, true) or _root.plat.hitTest(_x, (_y - h) - 3, true)) {
if (!Key.isDown(38)) {
yspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest(_x, (_y - h) + 5, true)) {
_y = (_y + 0.1);
}
while (_root.plat.hitTest(_x, (_y - h) + 5, true)) {
_y = (_y + 0.1);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.plat.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.plat.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.land.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (_root.plat.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.plat.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
yspeed = 0;
_rotation = (rot - 180);
}
}
if (_root.Gravity == 4) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, _y, true)) && (!_root.plat.hitTest(_x, _y, true))) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rott + 90);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, _y - h, true)) && (!_root.plat.hitTest(_x, _y - h, true))) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot + 90);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation - 9);
}
}
_x = (_x - xspeed);
xspeed = xspeed + grav;
_y = (_y + yspeed);
yspeed = yspeed * 0.83;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
yspeed = yspeed + 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
yspeed = yspeed - 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
xspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest((_x - w) - 60, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x - w) - 50, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest((_x - w) - 43, _y, true) or _root.plat.hitTest((_x - w) - 43, _y, true)) {
if (!Key.isDown(38)) {
xspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest((_x - w) - 38, _y, true)) {
_x = (_x + 0.1);
}
grounded = true;
jump = false;
while (_root.plat.hitTest((_x - w) - 38, _y, true)) {
_x = (_x + 0.1);
}
} else {
grounded = false;
}
if ((_root.land.hitTest((_x - w) - 55, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x - w) - 45, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y + h) - 30, true) or _root.plat.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
while (_root.plat.hitTest(_x + w, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.land.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
_rotation = (rot + 90);
}
}
if (((grounded && (!this.hitTest(_root.noGrav1))) && (!this.hitTest(_root.noGrav2))) && (!this.hitTest(_root.noGrav3))) {
if (Key.isDown(83) && (sHold != true)) {
sHold = true;
}
if ((!Key.isDown(83)) && (sHold == true)) {
sHold = false;
}
if (Key.isDown(65) && (aHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 0;
if (_root.Gravity <= 1) {
_root.Gravity = 5;
}
_root.lastKeyPressed = 1;
_root.CamTurn--;
_root.Gravity--;
aHold = true;
}
if ((!Key.isDown(65)) && (aHold == true)) {
aHold = false;
}
if (Key.isDown(68) && (dHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 0;
_root.Gravity++;
if (_root.Gravity > 4) {
_root.Gravity = 1;
}
_root.lastKeyPressed = 2;
dHold = true;
}
if ((!Key.isDown(68)) && (dHold == true)) {
dHold = false;
}
if (Key.isDown(87) && (wHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 3;
if (_root.Gravity == 1) {
_root.Gravity = 3;
} else if (_root.Gravity == 3) {
_root.Gravity = 1;
}
if (_root.Gravity == 2) {
_root.Gravity = 4;
} else if (_root.Gravity == 4) {
_root.Gravity = 2;
}
wHold = true;
}
if ((!Key.isDown(87)) && (wHold == true)) {
wHold = false;
}
}
}
Instance of Symbol 466 MovieClip "Cam" in Frame 30
onClipEvent (load) {
_rotation = 360;
rot = _rotation;
rot2 = rot + 270;
scalex = _xscale + 20;
scaley = _yscale + 20;
_xscale = (scalex + 100);
_yscale = (scaley + 100);
shiftHold = 0;
}
onClipEvent (enterFrame) {
if (_root.stopCam != true) {
_x = (_x + ((_root.player._x - _x) / 10));
_y = (_y + ((_root.player._y - _y) / 10));
}
if (!Key.isDown(16)) {
if (_xscale > scalex) {
_xscale = (_xscale - 2);
}
if (_yscale > scaley) {
_yscale = (_yscale - 2);
}
shiftHold = 0;
}
if (Key.isDown(16)) {
shiftHold++;
if (_xscale < (scalex + 100)) {
_xscale = (_xscale + 2);
}
if (_yscale < (scaley + 100)) {
_yscale = (_yscale + 2);
}
}
_root.bg2._x = _x;
_root.bg2._y = _y;
if (shiftHold >= 900) {
if (_root.gotShiftMedal != true) {
shiftHold = 0;
_root.gotShiftMedal = true;
}
}
}
Frame 31
_root.nextFrame();
_root.Cam._x = 0;
_root.Cam._y = 0;
_root._x = _root.dx;
_root._y = _root.dy;
_root.player.grav = 0;
_root.player.yspeed = 0;
_root.player.xspeed = 0;
Frame 32
_root.Cam.lvla.lvlb.lvl = "15";
function rotateCamBack() {
if (_root.Cam._rotation < _root.Cam.rot) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
if (_root.Cam._rotation > _root.Cam.rot) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
_root.turn++;
}
function rotateCam1() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation > (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
if (_root.Cam._rotation < (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation > (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
if (_root.Cam._rotation < (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
function rotateCam2() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation > (_root.Cam.rot - 180)) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation < (_root.Cam.rot + 180)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
function rotateCam3() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation != 90) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation != 90) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
_root.turn++;
}
Gravity = 1;
CamTurn = 0;
lastKeyPressed = 1;
lastKeyPressed2 = 0;
_root.stopCam = false;
_root._x = _root.dx;
_root._y = _root.dy;
stop();
onEnterFrame = function () {
if ((_root.deaths >= 50) && (varDeath != true)) {
var _local2 = "Death Medal";
com.newgrounds.API.unlockMedal(_local2, _root.Cam._x, _root.Cam._y);
varDeath = true;
}
if ((_root.turns >= 500) && (varTurn != true)) {
var _local2 = "500th Flip";
com.newgrounds.API.unlockMedal(_local2, _root.Cam._x, _root.Cam._y);
varTurn = true;
}
if ((Key.isDown(77) && (_root.SOFF != true)) && (_root.holdM != true)) {
_root.all.setVolume(0);
_root.SOFF = true;
_root.holdM = true;
}
if ((Key.isDown(77) && (_root.SOFF == true)) && (_root.holdM != true)) {
_root.all.setVolume(100);
_root.SOFF = false;
_root.holdM = true;
}
if ((!Key.isDown(77)) && (_root.holdM == true)) {
_root.holdM = false;
}
if (Gravity == 1) {
rotateCamBack();
}
if (Gravity == 2) {
rotateCam1();
}
if (Gravity == 3) {
rotateCam2();
}
if (Gravity == 4) {
rotateCam3();
}
};
Instance of Symbol 397 MovieClip in Frame 32
onClipEvent (enterFrame) {
if ((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Cam.fadeOut._currentframe == 1)) {
_root.stopCam = true;
_root.Cam.fadeOut.play();
}
}
Instance of Symbol 530 MovieClip in Frame 32
onClipEvent (load) {
i = 0;
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.player.block)) {
this.play();
_root.land.wall3.play();
}
if (_currentframe == 7) {
i++;
}
if (i >= 305) {
this.play();
i = 0;
}
}
Instance of Symbol 511 MovieClip in Frame 32
onClipEvent (enterFrame) {
if (this.hitTest(_root.player.block) && (_currentframe == 1)) {
this.play();
_root.land.wall.play();
}
}
Instance of Symbol 494 MovieClip in Frame 32
onClipEvent (enterFrame) {
if (this.hitTest(_root.player.block) && (_currentframe == 1)) {
this.play();
_root.land.wall2.play();
}
}
Instance of Symbol 397 MovieClip in Frame 32
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 4)) && (_root.player._x < (_x + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 32
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 4)) && (_root.player._x < (_x + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 32
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 1)) && (_root.player._y > (_y - 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 32
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 3)) && (_root.player._y < (_y + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 397 MovieClip in Frame 32
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 2)) && (_root.player._x > (_x - 200))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
if (_root.Cam.fadeOutRestart._currentframe == 2) {
_root.deaths++;
}
}
}
Instance of Symbol 432 MovieClip "player" in Frame 32
onClipEvent (load) {
xspeed = 0;
yspeed = 0;
grav = 1;
w = _width / 2;
h = _height / 2;
scale = _xscale;
rot = _rotation;
grounded = true;
jump = false;
_root.playerX = _x;
_root.playerY = _y;
_root._x = _root.dx;
_root._y = _root.dy;
standStill = 0;
}
onClipEvent (enterFrame) {
standStill++;
if (standStill <= 5) {
_x = 1521;
_y = 250;
}
if (Key.isDown(82)) {
_root.Cam.fadeOutRestart.play();
_root.reStart = _root.reStart + 1;
}
if (_root.Gravity == 1) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, (_y + h) + 30, true)) && (!_root.plat.hitTest(_x, (_y + h) + 30, true))) {
if (_rotation != rot) {
_rotation = (_rotation - 5);
}
} else {
_rotation = rot;
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, (_y + h) + 30, true)) && (!_root.plat.hitTest(_x, (_y + h) + 30, true))) {
if (_rotation != rot) {
_rotation = (_rotation + 5);
}
} else {
_rotation = rot;
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != rot) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed * 0.83;
_y = (_y + yspeed);
yspeed = yspeed + grav;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
xspeed = xspeed + 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
xspeed = xspeed - 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
yspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (jump != true)) && (_currentframe != 3)) {
this.gotoAndStop(1);
}
if (_root.plat.hitTest(_x, (_y + h) + 4, grounded)) {
_x = (_root.plat._x - _root.plat.dx);
}
if ((_root.land.hitTest(_x, (_y + h) + 10, true) && (yspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest(_x, (_y + h) + 6, true) && (yspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y + h) + 4, true) or _root.plat.hitTest(_x, (_y + h) + 2, true)) {
if (!Key.isDown(38)) {
yspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest(_x, (_y + h) - 3, true)) {
_y = (_y - 0.1);
}
while (_root.plat.hitTest(_x, (_y + h) - 3, true)) {
_y = (_y - 0.1);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x + w, _y, true) or _root.plat.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
while (_root.plat.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.land.hitTest(_x - w, _y, true) or _root.plat.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
while (_root.plat.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
yspeed = 0;
_rotation = rot;
jump = false;
}
}
if (_root.Gravity == 2) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x - w) + 30, _y, true)) && (!_root.plat.hitTest((_x - w) + 30, _y, true))) {
if (_rotation >= (rot - 90)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rot - 90);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x - w) + 30, _y, true)) && (!_root.plat.hitTest((_x - w) + 30, _y, true))) {
if (_rotation != (rot - 90)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot - 90);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot - 90)) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed + grav;
_y = (_y + yspeed);
yspeed = yspeed * 0.83;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
yspeed = yspeed - 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
yspeed = yspeed + 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
xspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest((_x + w) + 55, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x + w) + 45, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest((_x + w) + 45, _y, true) or _root.plat.hitTest((_x + w) + 45, _y, true)) {
if (!Key.isDown(38)) {
xspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest((_x + w) + 38, _y, true)) {
_x = (_x - 0.4);
}
while (_root.plat.hitTest((_x + w) + 38, _y, true)) {
_x = (_x - 0.4);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.plat.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.plat.hitTest(_x, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.land.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
_rotation = (rot - 90);
}
}
if (_root.Gravity == 3) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x + w) + 30, _y, true)) && (!_root.plat.hitTest((_x + w) + 30, _y, true))) {
if (_rotation != (rot - 180)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rot - 180);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x + w) + 30, _y - h, true)) && (!_root.plat.hitTest((_x + w) + 30, _y - h, true))) {
if (_rotation != (rot + 180)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot + 180);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot - 180)) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed * 0.83;
_y = (_y + yspeed);
yspeed = yspeed - grav;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
xspeed = xspeed - 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
xspeed = xspeed + 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
yspeed = 10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest(_x, (_y - h) - 11, true) && (yspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest(_x, (_y - h) - 6, true) && (yspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y - h) - 5, true) or _root.plat.hitTest(_x, (_y - h) - 3, true)) {
if (!Key.isDown(38)) {
yspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest(_x, (_y - h) + 5, true)) {
_y = (_y + 0.1);
}
while (_root.plat.hitTest(_x, (_y - h) + 5, true)) {
_y = (_y + 0.1);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.plat.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.plat.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.land.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (_root.plat.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.plat.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
yspeed = 0;
_rotation = (rot - 180);
}
}
if (_root.Gravity == 4) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, _y, true)) && (!_root.plat.hitTest(_x, _y, true))) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rott + 90);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, _y - h, true)) && (!_root.plat.hitTest(_x, _y - h, true))) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot + 90);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation - 9);
}
}
_x = (_x - xspeed);
xspeed = xspeed + grav;
_y = (_y + yspeed);
yspeed = yspeed * 0.83;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
yspeed = yspeed + 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
yspeed = yspeed - 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
xspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest((_x - w) - 60, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x - w) - 50, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest((_x - w) - 43, _y, true) or _root.plat.hitTest((_x - w) - 43, _y, true)) {
if (!Key.isDown(38)) {
xspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest((_x - w) - 38, _y, true)) {
_x = (_x + 0.1);
}
grounded = true;
jump = false;
while (_root.plat.hitTest((_x - w) - 38, _y, true)) {
_x = (_x + 0.1);
}
} else {
grounded = false;
}
if ((_root.land.hitTest((_x - w) - 55, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x - w) - 45, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y + h) - 30, true) or _root.plat.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
while (_root.plat.hitTest(_x + w, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.land.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
_rotation = (rot + 90);
}
}
if (((grounded && (!this.hitTest(_root.noGrav1))) && (!this.hitTest(_root.noGrav2))) && (!this.hitTest(_root.noGrav3))) {
if (Key.isDown(83) && (sHold != true)) {
sHold = true;
}
if ((!Key.isDown(83)) && (sHold == true)) {
sHold = false;
}
if (Key.isDown(65) && (aHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 0;
if (_root.Gravity <= 1) {
_root.Gravity = 5;
}
_root.lastKeyPressed = 1;
_root.CamTurn--;
_root.Gravity--;
aHold = true;
}
if ((!Key.isDown(65)) && (aHold == true)) {
aHold = false;
}
if (Key.isDown(68) && (dHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 0;
_root.Gravity++;
if (_root.Gravity > 4) {
_root.Gravity = 1;
}
_root.lastKeyPressed = 2;
dHold = true;
}
if ((!Key.isDown(68)) && (dHold == true)) {
dHold = false;
}
if (Key.isDown(87) && (wHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 3;
if (_root.Gravity == 1) {
_root.Gravity = 3;
} else if (_root.Gravity == 3) {
_root.Gravity = 1;
}
if (_root.Gravity == 2) {
_root.Gravity = 4;
} else if (_root.Gravity == 4) {
_root.Gravity = 2;
}
wHold = true;
}
if ((!Key.isDown(87)) && (wHold == true)) {
wHold = false;
}
}
}
Instance of Symbol 466 MovieClip "Cam" in Frame 32
onClipEvent (load) {
_rotation = 360;
rot = _rotation;
rot2 = rot + 270;
scalex = _xscale + 20;
scaley = _yscale + 20;
_xscale = (scalex + 100);
_yscale = (scaley + 100);
shiftHold = 0;
}
onClipEvent (enterFrame) {
if (_root.stopCam != true) {
_x = (_x + ((_root.player._x - _x) / 10));
_y = (_y + ((_root.player._y - _y) / 10));
}
if (!Key.isDown(16)) {
if (_xscale > scalex) {
_xscale = (_xscale - 2);
}
if (_yscale > scaley) {
_yscale = (_yscale - 2);
}
shiftHold = 0;
}
if (Key.isDown(16)) {
shiftHold++;
if (_xscale < (scalex + 100)) {
_xscale = (_xscale + 2);
}
if (_yscale < (scaley + 100)) {
_yscale = (_yscale + 2);
}
}
_root.bg2._x = _x;
_root.bg2._y = _y;
if (shiftHold >= 900) {
if (_root.gotShiftMedal != true) {
shiftHold = 0;
_root.gotShiftMedal = true;
}
}
}
Frame 33
_root.nextFrame();
_root.Cam._x = 0;
_root.Cam._y = 0;
_root._x = _root.dx;
_root._y = _root.dy;
_root.player.grav = 0;
_root.player.yspeed = 0;
_root.player.xspeed = 0;
Frame 34
_root.Cam.lvla.lvlb.lvl = "16";
function rotateCamBack() {
if (_root.Cam._rotation < _root.Cam.rot) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
if (_root.Cam._rotation > _root.Cam.rot) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
}
function rotateCam1() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation > (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
if (_root.Cam._rotation < (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation > (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
if (_root.Cam._rotation < (_root.Cam.rot - 90)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
}
function rotateCam2() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation > (_root.Cam.rot - 180)) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation < (_root.Cam.rot + 180)) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
}
function rotateCam3() {
if (lastKeyPressed == 2) {
if (_root.Cam._rotation != 90) {
_root.Cam._rotation = _root.Cam._rotation - 5;
}
}
if (lastKeyPressed == 1) {
if (_root.Cam._rotation != 90) {
_root.Cam._rotation = _root.Cam._rotation + 5;
}
}
}
Gravity = 1;
CamTurn = 0;
lastKeyPressed = 1;
lastKeyPressed2 = 0;
_root.stopCam = false;
_root._x = _root.dx;
_root._y = _root.dy;
stop();
onEnterFrame = function () {
if ((_root.deaths >= 50) && (varDeath != true)) {
var _local2 = "Death Medal";
com.newgrounds.API.unlockMedal(_local2, _root.Cam._x, _root.Cam._y);
varDeath = true;
}
if ((_root.turns >= 500) && (varTurn != true)) {
var _local2 = "500th Flip";
com.newgrounds.API.unlockMedal(_local2, _root.Cam._x, _root.Cam._y);
varTurn = true;
}
if ((Key.isDown(77) && (_root.SOFF != true)) && (_root.holdM != true)) {
_root.all.setVolume(0);
_root.SOFF = true;
_root.holdM = true;
}
if ((Key.isDown(77) && (_root.SOFF == true)) && (_root.holdM != true)) {
_root.all.setVolume(100);
_root.SOFF = false;
_root.holdM = true;
}
if ((!Key.isDown(77)) && (_root.holdM == true)) {
_root.holdM = false;
}
if (Gravity == 1) {
rotateCamBack();
}
if (Gravity == 2) {
rotateCam1();
}
if (Gravity == 3) {
rotateCam2();
}
if (Gravity == 4) {
rotateCam3();
}
};
Instance of Symbol 511 MovieClip in Frame 34
onClipEvent (enterFrame) {
if (this.hitTest(_root.player.block) && (_currentframe == 1)) {
this.play();
_root.land.wall.play();
}
}
Instance of Symbol 530 MovieClip in Frame 34
onClipEvent (load) {
i = 0;
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.player.block)) {
this.play();
_root.land.wall3.play();
}
if (_currentframe == 7) {
i++;
}
if (i >= 305) {
this.play();
i = 0;
}
}
Instance of Symbol 494 MovieClip in Frame 34
onClipEvent (enterFrame) {
if (this.hitTest(_root.player.block) && (_currentframe == 1)) {
this.play();
_root.land.wall2.play();
}
}
Instance of Symbol 397 MovieClip in Frame 34
onClipEvent (enterFrame) {
if ((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Cam.fadeOut._currentframe == 1)) {
_root.stopCam = true;
_root.Cam.fadeOut.play();
}
}
Instance of Symbol 397 MovieClip in Frame 34
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 4)) && (_root.player._x < (_x + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
_root.reStart = _root.reStart + 1;
}
}
Instance of Symbol 397 MovieClip in Frame 34
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 2)) && (_root.player._x > (_x - 200))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
_root.reStart = _root.reStart + 1;
}
}
Instance of Symbol 397 MovieClip in Frame 34
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 1)) && (_root.player._y > (_y - 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
_root.reStart = _root.reStart + 1;
}
}
Instance of Symbol 397 MovieClip in Frame 34
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 3)) && (_root.player._y < (_y + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
_root.reStart = _root.reStart + 1;
}
}
Instance of Symbol 397 MovieClip in Frame 34
onClipEvent (enterFrame) {
if (((this.hitTest(_root.player) && (_root.player.grounded == false)) && (_root.Gravity == 4)) && (_root.player._x < (_x + 250))) {
_root.stopCam = true;
_root.Cam.fadeOutRestart.play();
_root.reStart = _root.reStart + 1;
}
}
Instance of Symbol 557 MovieClip in Frame 34
onClipEvent (load) {
ySpeed = 4.1;
dy = _y;
varMove = 0;
i = 0;
}
onClipEvent (enterFrame) {
if ((_y <= (dy - 500)) && (varMove == 0)) {
varMove = 1;
}
if ((_y >= dy) && (varMove == 1)) {
varMove = 0;
}
if (varMove == 0) {
_y = (_y - ySpeed);
}
if (varMove == 1) {
_y = (_y + ySpeed);
}
if (this.hitTest(_root.player)) {
i++;
if ((_root.player._currentframe == 3) && (i <= 8)) {
_root.player.gotoAndStop(1);
}
}
if (!this.hitTest(_root.player)) {
i = 0;
}
}
Instance of Symbol 432 MovieClip "player" in Frame 34
onClipEvent (load) {
xspeed = 0;
yspeed = 0;
grav = 1;
w = _width / 2;
h = _height / 2;
scale = _xscale;
rot = _rotation;
grounded = true;
jump = false;
_root.playerX = _x;
_root.playerY = _y;
_root._x = _root.dx;
_root._y = _root.dy;
standStill = 0;
}
onClipEvent (enterFrame) {
standStill++;
if (standStill <= 5) {
_x = 180;
_y = 360;
}
if (Key.isDown(82)) {
_root.Cam.fadeOutRestart.play();
_root.reStart = _root.reStart + 1;
}
if (_root.Gravity == 1) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, (_y + h) + 30, true)) && (!_root.plat.hitTest(_x, (_y + h) + 30, true))) {
if (_rotation != rot) {
_rotation = (_rotation - 5);
}
} else {
_rotation = rot;
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, (_y + h) + 30, true)) && (!_root.plat.hitTest(_x, (_y + h) + 30, true))) {
if (_rotation != rot) {
_rotation = (_rotation + 5);
}
} else {
_rotation = rot;
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != rot) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed * 0.83;
_y = (_y + yspeed);
yspeed = yspeed + grav;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
xspeed = xspeed + 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
xspeed = xspeed - 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
yspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (jump != true)) && (_currentframe != 3)) {
this.gotoAndStop(1);
}
if (_root.plat.hitTest(_x, (_y + h) + 4, grounded)) {
_x = (_root.plat._x - _root.plat.dx);
}
if ((_root.land.hitTest(_x, (_y + h) + 10, true) && (yspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest(_x, (_y + h) + 6, true) && (yspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y + h) + 4, true) or _root.plat.hitTest(_x, (_y + h) + 2, true)) {
if (!Key.isDown(38)) {
yspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest(_x, (_y + h) - 3, true)) {
_y = (_y - 0.1);
}
while (_root.plat.hitTest(_x, (_y + h) - 3, true)) {
_y = (_y - 0.1);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x + w, _y, true) or _root.plat.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
while (_root.plat.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.land.hitTest(_x - w, _y, true) or _root.plat.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
while (_root.plat.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
yspeed = 0;
_rotation = rot;
jump = false;
}
}
if (_root.Gravity == 2) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x - w) + 30, _y, true)) && (!_root.plat.hitTest((_x - w) + 30, _y, true))) {
if (_rotation >= (rot - 90)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rot - 90);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x - w) + 30, _y, true)) && (!_root.plat.hitTest((_x - w) + 30, _y, true))) {
if (_rotation != (rot - 90)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot - 90);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot - 90)) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed + grav;
_y = (_y + yspeed);
yspeed = yspeed * 0.83;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
yspeed = yspeed - 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
yspeed = yspeed + 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
xspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest((_x + w) + 55, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x + w) + 45, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest((_x + w) + 45, _y, true) or _root.plat.hitTest((_x + w) + 45, _y, true)) {
if (!Key.isDown(38)) {
xspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest((_x + w) + 38, _y, true)) {
_x = (_x - 0.4);
}
while (_root.plat.hitTest((_x + w) + 38, _y, true)) {
_x = (_x - 0.4);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.plat.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.plat.hitTest(_x, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.land.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
_rotation = (rot - 90);
}
}
if (_root.Gravity == 3) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x + w) + 30, _y, true)) && (!_root.plat.hitTest((_x + w) + 30, _y, true))) {
if (_rotation != (rot - 180)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rot - 180);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest((_x + w) + 30, _y - h, true)) && (!_root.plat.hitTest((_x + w) + 30, _y - h, true))) {
if (_rotation != (rot + 180)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot + 180);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot - 180)) {
_rotation = (_rotation - 9);
}
}
_x = (_x + xspeed);
xspeed = xspeed * 0.83;
_y = (_y + yspeed);
yspeed = yspeed - grav;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
xspeed = xspeed - 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
xspeed = xspeed + 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
yspeed = 10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest(_x, (_y - h) - 11, true) && (yspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest(_x, (_y - h) - 6, true) && (yspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y - h) - 5, true) or _root.plat.hitTest(_x, (_y - h) - 3, true)) {
if (!Key.isDown(38)) {
yspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest(_x, (_y - h) + 5, true)) {
_y = (_y + 0.1);
}
while (_root.plat.hitTest(_x, (_y - h) + 5, true)) {
_y = (_y + 0.1);
}
} else {
grounded = false;
}
if (_root.land.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.plat.hitTest(_x + w, _y, true)) {
xspeed = 0;
while (_root.plat.hitTest(_x + w, _y, true)) {
_x = (_x - 0.1);
}
}
if (_root.land.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.land.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (_root.plat.hitTest(_x - w, _y, true)) {
xspeed = 0;
while (_root.plat.hitTest(_x - w, _y, true)) {
_x = (_x + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
yspeed = 0;
_rotation = (rot - 180);
}
}
if (_root.Gravity == 4) {
if ((_root.lastKeyPressed == 2) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, _y, true)) && (!_root.plat.hitTest(_x, _y, true))) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation - 5);
}
} else {
_rotation = (rott + 90);
}
}
if ((_root.lastKeyPressed == 1) && (_root.lastKeyPressed2 != 3)) {
if ((!_root.land.hitTest(_x, _y - h, true)) && (!_root.plat.hitTest(_x, _y - h, true))) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation + 5);
}
} else {
_rotation = (rot + 90);
}
}
if (_root.lastKeyPressed2 == 3) {
if (_rotation != (rot + 90)) {
_rotation = (_rotation - 9);
}
}
_x = (_x - xspeed);
xspeed = xspeed + grav;
_y = (_y + yspeed);
yspeed = yspeed * 0.83;
if ((!grounded) && (jump != true)) {
gotoAndStop (3);
}
if (Key.isDown(39)) {
yspeed = yspeed + 1.895;
_xscale = scale;
if (grounded) {
gotoAndStop (2);
}
}
if (Key.isDown(37)) {
yspeed = yspeed - 1.895;
_xscale = (-scale);
if (grounded) {
gotoAndStop (2);
}
}
if ((Key.isDown(38) && (grounded)) && (_currentframe != 4)) {
xspeed = -10;
grounded = false;
jump = true;
this.gotoAndStop(4);
}
if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (grounded)) && (_currentframe != 3)) && (jump != true)) {
this.gotoAndStop(1);
}
if ((_root.land.hitTest((_x - w) - 60, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x - w) - 50, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest((_x - w) - 43, _y, true) or _root.plat.hitTest((_x - w) - 43, _y, true)) {
if (!Key.isDown(38)) {
xspeed = 0;
}
grounded = true;
jump = false;
while (_root.land.hitTest((_x - w) - 38, _y, true)) {
_x = (_x + 0.1);
}
grounded = true;
jump = false;
while (_root.plat.hitTest((_x - w) - 38, _y, true)) {
_x = (_x + 0.1);
}
} else {
grounded = false;
}
if ((_root.land.hitTest((_x - w) - 55, _y, true) && (xspeed >= 29)) && (_currentframe == 3)) {
this.fall.play();
}
if (((_root.land.hitTest((_x - w) - 45, _y, true) && (xspeed < 29)) && (_currentframe == 3)) && (this.fall._currentframe < 7)) {
this.gotoAndStop(1);
}
if (_root.land.hitTest(_x, (_y + h) - 30, true) or _root.plat.hitTest(_x, (_y + h) - 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
while (_root.plat.hitTest(_x + w, (_y + h) - 30, true)) {
_y = (_y - 0.1);
}
}
if (_root.land.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (_root.plat.hitTest(_x, (_y - h) + 30, true)) {
yspeed = 0;
while (_root.land.hitTest(_x + w, (_y - h) + 30, true)) {
_y = (_y + 0.1);
}
}
if (grounded && (!Key.isDown(38))) {
jump = false;
_rotation = (rot + 90);
}
}
if (((grounded && (!this.hitTest(_root.noGrav1))) && (!this.hitTest(_root.noGrav2))) && (!this.hitTest(_root.noGrav3))) {
if (Key.isDown(83) && (sHold != true)) {
sHold = true;
}
if ((!Key.isDown(83)) && (sHold == true)) {
sHold = false;
}
if (Key.isDown(65) && (aHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 0;
if (_root.Gravity <= 1) {
_root.Gravity = 5;
}
_root.lastKeyPressed = 1;
_root.CamTurn--;
_root.Gravity--;
aHold = true;
}
if ((!Key.isDown(65)) && (aHold == true)) {
aHold = false;
}
if (Key.isDown(68) && (dHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 0;
_root.Gravity++;
if (_root.Gravity > 4) {
_root.Gravity = 1;
}
_root.lastKeyPressed = 2;
dHold = true;
}
if ((!Key.isDown(68)) && (dHold == true)) {
dHold = false;
}
if (Key.isDown(87) && (wHold != true)) {
_root.turns++;
_root.lastKeyPressed2 = 3;
if (_root.Gravity == 1) {
_root.Gravity = 3;
} else if (_root.Gravity == 3) {
_root.Gravity = 1;
}
if (_root.Gravity == 2) {
_root.Gravity = 4;
} else if (_root.Gravity == 4) {
_root.Gravity = 2;
}
wHold = true;
}
if ((!Key.isDown(87)) && (wHold == true)) {
wHold = false;
}
}
}
Instance of Symbol 466 MovieClip "Cam" in Frame 34
onClipEvent (load) {
_rotation = 360;
rot = _rotation;
rot2 = rot + 270;
scalex = _xscale + 20;
scaley = _yscale + 20;
_xscale = (scalex + 100);
_yscale = (scaley + 100);
shiftHold = 0;
}
onClipEvent (enterFrame) {
if (_root.stopCam != true) {
_x = (_x + ((_root.player._x - _x) / 10));
_y = (_y + ((_root.player._y - _y) / 10));
}
if (!Key.isDown(16)) {
if (_xscale > scalex) {
_xscale = (_xscale - 2);
}
if (_yscale > scaley) {
_yscale = (_yscale - 2);
}
shiftHold = 0;
}
if (Key.isDown(16)) {
shiftHold++;
if (_xscale < (scalex + 100)) {
_xscale = (_xscale + 2);
}
if (_yscale < (scaley + 100)) {
_yscale = (_yscale + 2);
}
}
_root.bg2._x = _x;
_root.bg2._y = _y;
if (shiftHold >= 900) {
if (_root.gotShiftMedal != true) {
shiftHold = 0;
_root.gotShiftMedal = true;
}
}
}
Frame 35
_root.timesPlayedThrough = _root.timesPlayedThrough + 1;
Stage.width = SW;
Stage.height = SH;
_root._xscale = _root.SCALEX;
_root._yscale = _root.SCALEY;
_root._x = _root.XXX;
_root._y = _root.YYY;
stopAllSounds();
_root.play();
Frame 36
if (_root.deaths <= 0) {
var medal_name = "Super Hero";
com.newgrounds.API.unlockMedal(medal_name, 100, 275);
} else {
var medal_name = "Hero";
com.newgrounds.API.unlockMedal(medal_name, 100, 275);
}
Frame 298
die = _root.deaths;
flip = _root.turns;
rstart = _root.reStart;
playa = _root.timesPlayedThrough;
Frame 563
stop();
Symbol 20 MovieClip Frame 1
stop();
Symbol 28 Button
on (press) {
_root.nextFrame();
}
Symbol 38 MovieClip Frame 1
stop();
Symbol 38 MovieClip Frame 81
_root.nextFrame();
Symbol 79 MovieClip Frame 6
stop();
Symbol 165 MovieClip Frame 1
stop();
Symbol 165 MovieClip Frame 4
_root.menuu.bars.play();
Symbol 165 MovieClip Frame 12
stop();
Symbol 191 Button
on (press) {
getURL ("http://www.truedarkness.newgrounds.com", "_blank");
}
Symbol 196 Button
on (press) {
getURL ("http://www.luis.newgrounds.com", "_blank");
}
Symbol 206 Button
on (press) {
getURL ("http://www.sikanth.newgrounds.com", "_blank");
}
Symbol 210 Button
on (press) {
getURL ("http://www.yotipo91.newgrounds.com", "_blank");
}
Symbol 220 Button
on (press) {
_root.menuu.player.play();
}
Symbol 225 Button
on (press) {
getURL ("http://www.newgrounds.com/game/puzzles", "_blank");
}
Symbol 230 MovieClip Frame 1
stop();
Symbol 234 Button
on (press) {
getURL ("http://www.newgrounds.com", "_blank");
}
Instance of Symbol 230 MovieClip in Symbol 235 MovieClip Frame 1
on (press) {
if ((_currentframe == 1) && (_root.soundOff != true)) {
this.gotoAndStop(10);
_root.soundOff = true;
_root.all.setVolume(0);
} else if ((_currentframe == 10) && (_root.soundOff == true)) {
this.gotoAndStop(1);
_root.soundOff = false;
_root.all.setVolume(100);
}
}
Instance of Symbol 42 MovieClip in Symbol 236 MovieClip Frame 29
on (press) {
getURL ("http://www.newgrounds.com/", "_blank");
}
Symbol 236 MovieClip Frame 3500
stop();
Symbol 237 MovieClip Frame 1
stop();
stop();
onEnterFrame = function () {
if ((_root.deaths >= 50) && (varDeath != true)) {
var _local3 = "Death Medal";
com.newgrounds.API.unlockMedal(_local3, _root.Cam._x, _root.Cam._y);
varDeath = true;
}
if ((_root.turns >= 500) && (varTurn != true)) {
var _local3 = "500th Flip";
com.newgrounds.API.unlockMedal(_local3, _root.Cam._x, _root.Cam._y);
varTurn = true;
}
var _local2 = _root.getBytesLoaded() / _root.getBytesTotal();
preloader_mc.value = _local2;
if (_local2 == 1) {
delete onEnterFrame;
play();
}
};
Symbol 237 MovieClip Frame 18
stop();
Instance of Symbol 27 MovieClip in Symbol 237 MovieClip Frame 18
on (press) {
_root.nextFrame();
}
Symbol 237 MovieClip Frame 22
stop();
Symbol 242 Button
on (release) {
NewgroundsAPI.loadNewgrounds();
}
Symbol 244 MovieClip Frame 1
function startAd(ngad_url) {
trace("opening " + ngad_url);
System.security.allowDomain("70.87.128.99");
System.security.allowInsecureDomain("70.87.128.99");
System.security.allowDomain("ads.shizmoo.com");
System.security.allowInsecureDomain("ads.shizmoo.com");
System.security.allowDomain("www.cpmstar.com");
System.security.allowInsecureDomain("www.cpmstar.com");
System.security.allowDomain("server.cpmstar.com");
System.security.allowInsecureDomain("server.cpmstar.com");
var ngads_redirect = new XML();
ngads_redirect.ignoreWhite = true;
ngads_redirect.onLoad = function (success) {
trace("[NEWGROUNDS FLASH ADS] :: You may get a 'Security Sandbox Violation' ... this is normal, do not freak out!");
if (success) {
ng_ad.loadMovie(ngads_redirect.toString(), "GET");
}
};
ngads_redirect.load(ngad_url);
}
if (NewgroundsAPI.getAdURL()) {
startAd(NewgroundsAPI.getAdURL());
}
NewgroundsAPI.onAdsApproved = function (ad_url) {
startAd(ad_url);
};
stop();
Symbol 261 MovieClip Frame 40
stop();
Symbol 275 Button
on (press) {
tellTarget (_root) {
nextFrame();
};
}
Symbol 276 Button
on (press) {
gotoAndStop ("end");
_root.play();
}
Instance of Symbol 251 MovieClip in Symbol 277 MovieClip Frame 1
onClipEvent (load) {
_root.stop();
PercentLoaded = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (PercentLoaded != 100) {
_parent.gotoAndStop(PercentLoaded);
} else {
_parent.gotoAndStop("lastframe");
}
}
onClipEvent (enterFrame) {
PercentLoaded = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (PercentLoaded != 100) {
_parent.gotoAndStop(PercentLoaded);
} else {
_parent.gotoAndPlay("loaded");
}
}
Symbol 277 MovieClip Frame 101
play();
_root.loaderr.play();
Symbol 277 MovieClip Frame 165
stop();
Symbol 280 Button
on (press) {
getURL ("http://www.newgrounds.com/", "_blank");
}
Symbol 636 MovieClip [__Packages.NewgroundsAPI] Frame 0
class NewgroundsAPI
{
static var tracker_id, host, version, debug, error_format, header_format, normal_format, link_format;
function NewgroundsAPI () {
}
static function connectMovie(id) {
if (!id) {
SendError("Missing required 'id' parameter in NewgroundsAPI.connectMovie(id:Number)");
} else if (!tracker_id) {
SendMessage("Connecting to API gateway...");
tracker_id = id;
host = _url.split("/")[2].toLowerCase();
if (host.length < 1) {
host = "localhost";
}
var _local2 = new Object();
SendEvent(MOVIE_VIEWS);
}
}
static function setMovieVersion(movie_version) {
if (!movie_version) {
SendError("Missing required 'version' in NewgroundsAPI.setMovieVersion(version:String)");
} else {
version = movie_version;
}
}
static function debugMode() {
debug = true;
}
static function addCustomEvent(stat_id, stat_name) {
if (!stat_id) {
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else if (!stat_name) {
SendError("Missing required 'event_name' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else {
custom_events[stat_name] = CUSTOM_STATS + stat_id;
SendMessage("Created custom event: " + stat_name);
}
}
static function addCustomLink(stat_id, stat_name) {
if (!stat_id) {
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else if (!stat_name) {
SendError("Missing required 'link_name' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else {
custom_links[stat_name] = CUSTOM_STATS + stat_id;
SendMessage((("Created custom link " + stat_id) + ": ") + stat_name);
}
}
static function loadMySite() {
SendLink(AUTHOR_SITE);
}
static function loadNewgrounds(special) {
if (special) {
var _local1 = {page:special};
}
SendLink(NEWGROUNDS, _local1);
}
static function logCustomEvent(event_name) {
if (!event_name) {
SendError("Missing required 'event_name' parameter in NewgroundsAPI.logCustomEvent(event_name:String)");
} else if (!custom_events[event_name]) {
SendError("Attempted to log undefined custom event: " + event_name);
} else {
SendEvent(custom_events[event_name]);
}
}
static function loadCustomLink(link_name) {
if (!link_name) {
SendError("Missing required 'link_name' parameter in NewgroundsAPI.loadCustomLink(link_name:String)");
} else if (!custom_links[link_name]) {
SendError("Attempted to open undefined custom link: " + link_name);
} else {
SendLink(custom_links[link_name]);
}
}
static function getAdURL() {
return(movie_options.ad_url);
}
static function getMovieURL() {
if (movie_options.movie_url) {
return(movie_options.movie_url);
}
return("Newgrounds.com");
}
static function getNewVersionURL() {
return((((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + NEW_VERSION);
}
static function SendEvent(id) {
SendStat(id, false);
}
static function SendLink(id, extra) {
SendStat(id, true, extra);
}
static function ReadGatewayData(params) {
for (var _local2 in params) {
params[_local2] = unescape(params[_local2]);
movie_options[_local2] = params[_local2];
}
if (params.settings_loaded) {
SendMessage("You have successfully connected to the Newgrounds API gateway!");
SendMessage(("Movie Identified as '" + movie_options.movie_name) + "'");
if (movie_options.message) {
SendMessage(movie_options.message);
}
if (movie_options.ad_url) {
SendMessage("Your movie has been approved to run Flash Ads");
onAdsApproved(movie_options.ad_url);
}
if (movie_options.movie_version and (movie_options.movie_version.toString() != version.toString())) {
SendMessage("WARNING: The movie version configured in your API settings does not match this movie's version!");
onNewVersionAvailable(movie_options.movie_version, getMovieURL(), getNewVersionURL());
}
if (movie_options.deny_host) {
SendMessage("You have blocked 'localHost' in your API settings.");
SendMessage("If you wish to test your movie you will need to remove this block.");
onDenyHost(host, getMovieURL(), getNewVersionURL());
}
if (movie_options.request_portal_url == 1) {
var _local4 = (((GATEWAY_URL + "?&id=") + tracker_id) + "&portal_url=") + escape(_url);
var _local3 = new XML();
_local3.ignoreWhite = true;
_local3.load(_local4);
}
} else if (!movie_options.settings_loaded) {
SendError("Could not establish connection to the API gateway.");
}
}
static function SendStat(stat_id, open_in_browser, extra) {
if (!tracker_id) {
SendError("API calls cannot be made without a valid movie id.");
SendError("Did you remember to add the \"NewgroundsAPI.connectMovie()\" code?");
} else {
var _local7 = (((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + stat_id;
for (var _local9 in extra) {
_local7 = _local7 + ((("&" + escape(_local9)) + "=") + escape(extra[_local9]));
}
trace(_local7);
if (debug) {
_local7 = _local7 + "&debug=1";
}
if (open_in_browser) {
getURL (_local7, "_blank");
} else {
var _local10 = new XML();
_local10.ignoreWhite = true;
_local10.onLoad = function (success) {
var _local6 = new Object();
var _local3 = 0;
while (_local3 < this.firstChild.childNodes.length) {
var _local4 = this.firstChild.childNodes[_local3];
var _local5 = _local4.nodeName;
var _local2 = _local4.attributes.value;
if (_local2 == Number(_local2)) {
_local2 = Number(_local2);
}
_local6[_local5] = _local2;
_local3++;
}
NewgroundsAPI.ReadGatewayData(_local6);
};
_local10.load(_local7);
}
}
}
static function SendError(msg) {
trace("[NEWGROUNDS API ERROR] :: " + msg);
}
static function SendMessage(msg) {
trace("[NEWGROUNDS API] :: " + msg);
}
static function InitTextFormats() {
if (!error_format) {
error_format = new TextFormat();
error_format.font = "Arial Black";
error_format.size = 48;
error_format.color = 16711680 /* 0xFF0000 */;
}
if (!header_format) {
header_format = new TextFormat();
header_format.font = "Arial Black";
header_format.size = 24;
header_format.color = 16777215 /* 0xFFFFFF */;
}
if (!normal_format) {
normal_format = new TextFormat();
normal_format.font = "Arial";
normal_format.bold = true;
normal_format.size = 12;
normal_format.color = 16777215 /* 0xFFFFFF */;
}
if (!link_format) {
link_format = new TextFormat();
link_format.color = 16776960 /* 0xFFFF00 */;
link_format.underline = true;
}
}
static function onNewVersionAvailable(version, movie_url, redirect_url) {
InitTextFormats();
var _local2 = new Object();
_local2.x = Stage.width / 2;
_local2.y = Stage.height / 2;
_root.createEmptyMovieClip("NGAPI_new_version_overlay", _root.getNextHighestDepth());
_root.NGAPI_new_version_overlay.lineStyle(1, 0, 100);
_root.NGAPI_new_version_overlay.beginFill(0, 70);
_root.NGAPI_new_version_overlay.moveTo(-10, -10);
_root.NGAPI_new_version_overlay.lineTo(-10, 1000);
_root.NGAPI_new_version_overlay.lineTo(1000, 1000);
_root.NGAPI_new_version_overlay.lineTo(1000, -10);
_root.NGAPI_new_version_overlay.lineTo(-10, -10);
_root.NGAPI_new_version_overlay.endFill();
_root.NGAPI_new_version_overlay.lineStyle(10, 0, 100);
_root.NGAPI_new_version_overlay.beginFill(51);
_root.NGAPI_new_version_overlay.moveTo(_local2.x - 240, _local2.y - 120);
_root.NGAPI_new_version_overlay.lineTo(_local2.x + 240, _local2.y - 120);
_root.NGAPI_new_version_overlay.lineTo(_local2.x + 240, _local2.y + 80);
_root.NGAPI_new_version_overlay.lineTo(_local2.x - 240, _local2.y + 80);
_root.NGAPI_new_version_overlay.lineTo(_local2.x - 240, _local2.y - 120);
_root.NGAPI_new_version_overlay.endFill();
_root.NGAPI_new_version_overlay.createEmptyMovieClip("exit", 1000);
_root.NGAPI_new_version_overlay.exit.lineStyle(2, 39423, 100);
_root.NGAPI_new_version_overlay.exit.beginFill(0, 50);
_root.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 210, _local2.y - 110);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 230, _local2.y - 110);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 230, _local2.y - 90);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 210, _local2.y - 90);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 210, _local2.y - 110);
_root.NGAPI_new_version_overlay.exit.endFill();
_root.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 214, _local2.y - 106);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 226, _local2.y - 94);
_root.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 226, _local2.y - 106);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 214, _local2.y - 94);
_root.NGAPI_new_version_overlay.exit.onMouseUp = function () {
if (_root.NGAPI_new_version_overlay.exit.hitTest(_root._xmouse, _root._ymouse)) {
_root.NGAPI_new_version_overlay.removeMovieClip();
}
};
var _local3 = (("Version " + version) + " is now available at:") + newline;
var _local5 = _local3.length;
_local3 = _local3 + movie_url;
var _local4 = _local3.length;
_root.NGAPI_new_version_overlay.createTextField("mouseblocker", 99, -10, -10, 1000, 1000);
_root.NGAPI_new_version_overlay.createTextField("newversion", 100, _local2.x - 210, _local2.y - 90, 400, 80);
_root.NGAPI_new_version_overlay.newversion.text = "New Version Available!";
_root.NGAPI_new_version_overlay.newversion.setTextFormat(header_format);
_root.NGAPI_new_version_overlay.createTextField("message", 101, (Stage.width - 400) / 2, Stage.height / 2, 400, 40);
_root.NGAPI_new_version_overlay.message.text = _local3;
_root.NGAPI_new_version_overlay.message.multiline = true;
_root.NGAPI_new_version_overlay.message.wordWrap = true;
_root.NGAPI_new_version_overlay.message.html = true;
_root.NGAPI_new_version_overlay.message.setTextFormat(normal_format);
link_format.url = redirect_url;
_root.NGAPI_new_version_overlay.message.setTextFormat(_local5, _local4, link_format);
}
static function onDenyHost(hostname, movie_url, redirect_url) {
InitTextFormats();
_root.createEmptyMovieClip("NGAPI_deny_host_overlay", _root.getNextHighestDepth());
_root.NGAPI_deny_host_overlay.lineStyle(20, 0, 100);
_root.NGAPI_deny_host_overlay.beginFill(6684672);
_root.NGAPI_deny_host_overlay.moveTo(0, 0);
_root.NGAPI_deny_host_overlay.lineTo(Stage.width, 0);
_root.NGAPI_deny_host_overlay.lineTo(Stage.width, Stage.height);
_root.NGAPI_deny_host_overlay.lineTo(0, Stage.height);
_root.NGAPI_deny_host_overlay.lineTo(0, 0);
_root.NGAPI_deny_host_overlay.endFill();
var _local2 = ("This movie has not been approved for use on " + hostname) + ".";
_local2 = _local2 + "\r\rFor an aproved copy, please visit:\r";
var _local4 = _local2.length;
_local2 = _local2 + movie_url;
var _local3 = _local2.length;
_root.NGAPI_deny_host_overlay.createTextField("mousekill", 100, 0, 0, Stage.width, Stage.height);
_root.NGAPI_deny_host_overlay.createTextField("error", 101, (Stage.width - 400) / 2, (Stage.height / 2) - 100, 400, 200);
_root.NGAPI_deny_host_overlay.error.text = "ERROR!";
_root.NGAPI_deny_host_overlay.error.setTextFormat(error_format);
_root.NGAPI_deny_host_overlay.createTextField("message", 102, (Stage.width - 400) / 2, Stage.height / 2, 400, 200);
_root.NGAPI_deny_host_overlay.message.text = _local2;
_root.NGAPI_deny_host_overlay.message.multiline = true;
_root.NGAPI_deny_host_overlay.message.wordWrap = true;
_root.NGAPI_deny_host_overlay.message.html = true;
_root.NGAPI_deny_host_overlay.message.setTextFormat(normal_format);
link_format.url = redirect_url;
_root.NGAPI_deny_host_overlay.message.setTextFormat(_local4, _local3, link_format);
}
static function isInstalled() {
return(true);
}
static function onAdsApproved(ad_url) {
}
static var movie_options = new Object();
static var custom_events = new Object();
static var custom_links = new Object();
static var MOVIE_VIEWS = 1;
static var AUTHOR_SITE = 2;
static var NEWGROUNDS = 3;
static var NEW_VERSION = 4;
static var CUSTOM_STATS = 50;
static var GATEWAY_URL = "http://www.ngads.com/gateway.php";
}
Symbol 283 MovieClip [__Packages.com.newgrounds.components.APIConnector] Frame 0
!!!ERROR
Symbol 356 MovieClip [__Packages.com.newgrounds.APIError] Frame 0
!!!ERROR
Symbol 357 MovieClip [__Packages.com.newgrounds.API] Frame 0
!!!ERROR
Symbol 358 MovieClip [__Packages.com.newgrounds.Bridge] Frame 0
!!!ERROR
Symbol 359 MovieClip [__Packages.com.newgrounds.SaveFile] Frame 0
!!!ERROR
Symbol 360 MovieClip [__Packages.com.newgrounds.SaveGroup] Frame 0
!!!ERROR
Symbol 361 MovieClip [__Packages.com.newgrounds.ValidationTools] Frame 0
!!!ERROR
Symbol 362 MovieClip [__Packages.com.newgrounds.APIEvent] Frame 0
!!!ERROR
Symbol 363 MovieClip [__Packages.com.newgrounds.SaveGroupQuery] Frame 0
!!!ERROR
Symbol 364 MovieClip [__Packages.com.newgrounds.encoders.BaseN] Frame 0
!!!ERROR
Symbol 365 MovieClip [__Packages.com.newgrounds.encoders.ImageScanner] Frame 0
!!!ERROR
Symbol 366 MovieClip [__Packages.com.newgrounds.encoders.SerialXML] Frame 0
!!!ERROR
Symbol 367 MovieClip [__Packages.com.newgrounds.encoders.LZW2] Frame 0
!!!ERROR
Symbol 368 MovieClip [__Packages.com.newgrounds.encoders.LZW] Frame 0
!!!ERROR
Symbol 369 MovieClip [__Packages.com.newgrounds.Medal] Frame 0
!!!ERROR
Symbol 370 MovieClip [__Packages.com.newgrounds.ScoreBoard] Frame 0
!!!ERROR
Symbol 371 MovieClip [__Packages.com.newgrounds.Score] Frame 0
!!!ERROR
Symbol 372 MovieClip [__Packages.com.newgrounds.encoders.RC4] Frame 0
!!!ERROR
Symbol 373 MovieClip [__Packages.com.newgrounds.encoders.JSON] Frame 0
!!!ERROR
Symbol 374 MovieClip [__Packages.com.newgrounds.APIEventDispatcher] Frame 0
!!!ERROR
Symbol 375 MovieClip [__Packages.com.newgrounds.encoders.MD5] Frame 0
!!!ERROR
Symbol 282 MovieClip Frame 1
stop();
Symbol 282 MovieClip Frame 20
_root.nextFrame();
Symbol 291 MovieClip Frame 1
!!!ERROR
Symbol 293 MovieClip Frame 10
stop();
Symbol 295 MovieClip Frame 37
_parent.setGotoFrame("done");
stop();
Symbol 307 MovieClip [NewgroundsAPIAsset_Medal_Popup] Frame 1
!!!ERROR
Symbol 307 MovieClip [NewgroundsAPIAsset_Medal_Popup] Frame 2
medal.attachIcon(icon);
Symbol 307 MovieClip [NewgroundsAPIAsset_Medal_Popup] Frame 10
!!!ERROR
Symbol 307 MovieClip [NewgroundsAPIAsset_Medal_Popup] Frame 21
this.removeMovieClip();
_visible = false;
stop();
Symbol 313 MovieClip [NewgroundsAPIAsset_Login_Warning] Frame 1
!!!ERROR
Symbol 313 MovieClip [NewgroundsAPIAsset_Login_Warning] Frame 10
stop();
Symbol 313 MovieClip [NewgroundsAPIAsset_Login_Warning] Frame 21
this.removeMovieClip();
_visible = false;
stop();
Symbol 316 MovieClip [NewgroundsAPIAsset_Connection_Error] Frame 1
!!!ERROR
Symbol 316 MovieClip [NewgroundsAPIAsset_Connection_Error] Frame 10
stop();
Symbol 316 MovieClip [NewgroundsAPIAsset_Connection_Error] Frame 21
this.removeMovieClip();
_visible = false;
stop();
Symbol 337 MovieClip [NewgroundsAPIAsset_big_popup_background] Frame 1
!!!ERROR
Symbol 341 Button
on (release) {
!!!ERROR
Symbol 347 Button
on (release) {
getURL (official_version_url, "_blank");
}
Symbol 349 MovieClip [NewgroundsAsset_New_Version_Available] Frame 1
!!!ERROR
Symbol 350 Button
on (release) {
getURL (official_version_url, "_blank");
}
Symbol 354 MovieClip [NewgroundsAsset_Illegal_Host] Frame 1
!!!ERROR
Symbol 355 MovieClip [API Connector (NewgroundsAPI)] Frame 1
#initclip 23
Object.registerClass("API Connector (NewgroundsAPI)", com.newgrounds.components.APIConnector);
#endinitclip
Symbol 355 MovieClip [API Connector (NewgroundsAPI)] Frame 20
_visible = false;
Symbol 416 MovieClip Frame 6
stop();
Symbol 416 MovieClip Frame 14
_parent.gotoAndStop(1);
Symbol 431 MovieClip Frame 14
stop();
Symbol 432 MovieClip Frame 1
stop();
Symbol 437 MovieClip Frame 90
stop();
Symbol 446 MovieClip Frame 61
stop();
Symbol 457 MovieClip Frame 1
stop();
Symbol 457 MovieClip Frame 53
_root.nextFrame();
Symbol 465 MovieClip Frame 1
stop();
Symbol 465 MovieClip Frame 40
_root.prevFrame();
Symbol 466 MovieClip Frame 1
var copyrightNotice = "Copyright (c) 2006-2007 Sockpuppet Pty Ltd. All Rights Reserved. http://www.reanimator.net";
var reanimator = (new flash.geom.Transform(this));
var camera = (new flash.geom.Transform(this._parent));
var w = Stage.width;
var h = Stage.height;
this.onEnterFrame = function () {
if ((_root.deaths >= 50) && (varDeath != true)) {
var _local4 = "Death Medal";
com.newgrounds.API.unlockMedal(_local4, _root.Cam._x, _root.Cam._y);
varDeath = true;
}
if ((_root.turns >= 500) && (varTurn != true)) {
var _local4 = "500th Flip";
com.newgrounds.API.unlockMedal(_local4, _root.Cam._x, _root.Cam._y);
varTurn = true;
}
this._parent.filters = this.filters;
var _local3 = reanimator.matrix;
camera.colorTransform = reanimator.colorTransform;
_local3.invert();
_local3.translate(w * 0.5, h * 0.5);
camera.matrix = _local3;
};
Symbol 494 MovieClip Frame 1
stop();
Symbol 494 MovieClip Frame 7
stop();
Symbol 494 MovieClip Frame 13
gotoAndStop (1);
Symbol 502 MovieClip Frame 1
stop();
Symbol 502 MovieClip Frame 29
stop();
Symbol 511 MovieClip Frame 1
stop();
Symbol 511 MovieClip Frame 7
stop();
Symbol 521 MovieClip Frame 1
stop();
Symbol 521 MovieClip Frame 16
stop();
Symbol 530 MovieClip Frame 1
stop();
Symbol 530 MovieClip Frame 7
stop();
Symbol 530 MovieClip Frame 13
gotoAndStop (1);
Symbol 537 MovieClip Frame 1
stop();
Symbol 537 MovieClip Frame 338
gotoAndStop (1);
Symbol 539 MovieClip Frame 1
Symbol 545 MovieClip Frame 1
Instance of Symbol 553 MovieClip in Symbol 554 MovieClip Frame 1
onClipEvent (load) {
xSpeed = 4.1;
dx = _x;
varMove = 0;
}
onClipEvent (enterFrame) {
if ((_x >= (dx + 560)) && (varMove == 0)) {
varMove = 1;
}
if ((_x <= dx) && (varMove == 1)) {
varMove = 0;
}
if (varMove == 0) {
_x = (_x + xSpeed);
}
if (varMove == 1) {
_x = (_x - xSpeed);
}
if (this.hitTest(_root.player)) {
if (varMove == 0) {
_root.player._x = _root.player._x + xSpeed;
}
if (varMove == 1) {
_root.player._x = _root.player._x - xSpeed;
}
}
}
Instance of Symbol 553 MovieClip in Symbol 554 MovieClip Frame 1
onClipEvent (load) {
xSpeed = 4.1;
dx = _x;
varMove = 0;
}
onClipEvent (enterFrame) {
if ((_x >= (dx + 500)) && (varMove == 0)) {
varMove = 1;
}
if ((_x <= dx) && (varMove == 1)) {
varMove = 0;
}
if (varMove == 0) {
_x = (_x + xSpeed);
}
if (varMove == 1) {
_x = (_x - xSpeed);
}
if (this.hitTest(_root.player)) {
if (varMove == 0) {
_root.player._x = _root.player._x + xSpeed;
}
if (varMove == 1) {
_root.player._x = _root.player._x - xSpeed;
}
}
}
Symbol 556 MovieClip Frame 1
Instance of Symbol 553 MovieClip in Symbol 558 MovieClip Frame 1
onClipEvent (load) {
xSpeed = 4.1;
dx = _x;
varMove = 0;
}
onClipEvent (enterFrame) {
if ((_x <= (dx - 500)) && (varMove == 0)) {
varMove = 1;
}
if ((_x >= dx) && (varMove == 1)) {
varMove = 0;
}
if (varMove == 0) {
_x = (_x - xSpeed);
}
if (varMove == 1) {
_x = (_x + xSpeed);
}
if (this.topp.hitTest(_root.player)) {
if (varMove == 0) {
_root.player._x = _root.player._x - xSpeed;
}
if (varMove == 1) {
_root.player._x = _root.player._x + xSpeed;
}
}
if (this.bottomp.hitTest(_root.player)) {
if (varMove == 0) {
_root.player._x = _root.player._x - xSpeed;
}
if (varMove == 1) {
_root.player._x = _root.player._x + xSpeed;
}
}
}
Instance of Symbol 553 MovieClip in Symbol 558 MovieClip Frame 1
onClipEvent (load) {
ySpeed = 4.1;
dy = _y;
varMove = 0;
}
onClipEvent (enterFrame) {
if ((_y <= (dy - 500)) && (varMove == 0)) {
varMove = 1;
}
if ((_y >= dy) && (varMove == 1)) {
varMove = 0;
}
if (varMove == 0) {
_y = (_y - ySpeed);
}
if (varMove == 1) {
_y = (_y + ySpeed);
}
if (_root.Gravity == 3) {
if (this.hitTest(_root.player) && (varMove != 1)) {
varKeepDown = true;
} else {
varKeepDown = false;
}
}
if (_root.Gravity == 1) {
if (this.hitTest(_root.player) && (varMove != 1)) {
varKeepDown = false;
} else {
varKeepDown = true;
}
}
if ((((((varKeepDown == true) && (_root.player._currentframe != 4)) && (_root.Gravity == 3)) && (this.bottomp.hitTest(_root.player))) && (!_root.player.hitTest(this.bottomp.leftt))) && (!_root.player.hitTest(this.bottomp.rightt))) {
_root.player.yspeed = _root.player.yspeed - 10;
}
if ((((varKeepDown == true) && (_root.player._currentframe != 4)) && (_root.Gravity == 1)) && (this.topp.hitTest(_root.player))) {
_root.player.yspeed = 10;
}
}
Symbol 560 MovieClip Frame 1
Symbol 562 MovieClip Frame 1
Instance of Symbol 553 MovieClip in Symbol 563 MovieClip Frame 1
onClipEvent (load) {
ySpeed = 2.2;
xSpeed = 2.2;
dy = _y;
dx = _x;
varMove = 0;
varMove2 = 0;
}
onClipEvent (enterFrame) {
if ((_y <= (dy - 500)) && (varMove == 0)) {
varMove = 1;
}
if ((_x <= (dx - 500)) && (varMove2 == 0)) {
varMove2 = 1;
}
if ((_y >= dy) && (varMove == 1)) {
varMove = 0;
}
if ((_x >= dx) && (varMove2 == 1)) {
varMove2 = 0;
}
if (varMove == 0) {
_y = (_y - ySpeed);
}
if (varMove == 1) {
_y = (_y + ySpeed);
}
if (varMove2 == 0) {
_x = (_x - xSpeed);
}
if (varMove2 == 1) {
_x = (_x + xSpeed);
}
if (_root.Gravity == 3) {
if (this.hitTest(_root.player) && (varMove != 1)) {
varKeepDown = true;
} else {
varKeepDown = false;
}
}
if (_root.Gravity == 1) {
if (this.hitTest(_root.player) && (varMove != 1)) {
varKeepDown = false;
} else {
varKeepDown = true;
}
}
if (((((((varKeepDown == true) && (_root.player._currentframe != 4)) && (_root.Gravity == 3)) && (this.bottomp.hitTest(_root.player))) && (!_root.player.hitTest(this.bottomp.leftt))) && (!_root.player.hitTest(this.bottomp.rightt))) && (!Key.isDown(87))) {
if ((!Key.isDown(87)) && (_root.Gravity != 3)) {
_root.player.yspeed = _root.player.yspeed - 10;
}
} else if (((((varKeepDown == true) && (_root.player._currentframe != 4)) && (_root.Gravity == 1)) && (this.topp.hitTest(_root.player))) && (!Key.isDown(87))) {
_root.player.yspeed = 10;
}
if (this.topp.hitTest(_root.player)) {
if (varMove == 0) {
_root.player._x = _root.player._x - xSpeed;
}
if (varMove == 1) {
_root.player._x = _root.player._x + xSpeed;
}
}
if (this.bottomp.hitTest(_root.player)) {
if (varMove == 0) {
_root.player._x = _root.player._x - xSpeed;
}
if (varMove == 1) {
_root.player._x = _root.player._x + xSpeed;
}
}
}
Instance of Symbol 553 MovieClip in Symbol 563 MovieClip Frame 1
onClipEvent (load) {
ySpeed = 2.2;
dy = _y;
varMove = 0;
}
onClipEvent (enterFrame) {
if ((_y <= (dy - 250)) && (varMove == 0)) {
varMove = 1;
}
if ((_y >= dy) && (varMove == 1)) {
varMove = 0;
}
if (varMove == 0) {
_y = (_y - ySpeed);
}
if (varMove == 1) {
_y = (_y + ySpeed);
}
if (_root.Gravity == 3) {
if (this.hitTest(_root.player) && (varMove != 1)) {
varKeepDown = true;
} else {
varKeepDown = false;
}
}
if (_root.Gravity == 1) {
if (this.hitTest(_root.player) && (varMove != 1)) {
varKeepDown = false;
} else {
varKeepDown = true;
}
}
if ((((varKeepDown == true) && (_root.player._currentframe != 4)) && (_root.Gravity == 3)) && (this.bottomp.hitTest(_root.player))) {
_root.player.yspeed = _root.player.yspeed - 10;
}
if ((((varKeepDown == true) && (_root.player._currentframe != 4)) && (_root.Gravity == 1)) && (this.topp.hitTest(_root.player))) {
_root.player.yspeed = 10;
}
}
Symbol 565 MovieClip Frame 1
Instance of Symbol 553 MovieClip in Symbol 566 MovieClip Frame 1
onClipEvent (load) {
xSpeed = 4.1;
dx = _x;
varMove = 0;
}
onClipEvent (enterFrame) {
if ((_x <= (dx - 500)) && (varMove == 0)) {
varMove = 1;
}
if ((_x >= dx) && (varMove == 1)) {
varMove = 0;
}
if (varMove == 0) {
_x = (_x - xSpeed);
}
if (varMove == 1) {
_x = (_x + xSpeed);
}
if (this.topp.hitTest(_root.player)) {
if (varMove == 0) {
_root.player._x = _root.player._x - xSpeed;
}
if (varMove == 1) {
_root.player._x = _root.player._x + xSpeed;
}
}
if (this.bottomp.hitTest(_root.player)) {
if (varMove == 0) {
_root.player._x = _root.player._x - xSpeed;
}
if (varMove == 1) {
_root.player._x = _root.player._x + xSpeed;
}
}
}
Symbol 572 MovieClip Frame 1
Instance of Symbol 553 MovieClip in Symbol 577 MovieClip Frame 1
onClipEvent (load) {
ySpeed = 4.1;
dy = _y;
varMove = 0;
}
onClipEvent (enterFrame) {
if ((_y <= (dy - 500)) && (varMove == 0)) {
varMove = 1;
}
if ((_y >= dy) && (varMove == 1)) {
varMove = 0;
}
if (varMove == 0) {
_y = (_y - ySpeed);
}
if (varMove == 1) {
_y = (_y + ySpeed);
}
if (_root.Gravity == 3) {
if (this.hitTest(_root.player) && (varMove != 1)) {
varKeepDown = true;
} else {
varKeepDown = false;
}
}
if (_root.Gravity == 1) {
if (this.hitTest(_root.player) && (varMove != 1)) {
varKeepDown = false;
} else {
varKeepDown = true;
}
}
if ((((((varKeepDown == true) && (_root.player._currentframe != 4)) && (_root.Gravity == 3)) && (this.bottomp.hitTest(_root.player))) && (!_root.player.hitTest(this.bottomp.leftt))) && (!_root.player.hitTest(this.bottomp.rightt))) {
_root.player.yspeed = _root.player.yspeed - 10;
}
if ((((varKeepDown == true) && (_root.player._currentframe != 4)) && (_root.Gravity == 1)) && (this.topp.hitTest(_root.player))) {
_root.player.yspeed = 10;
}
}
Instance of Symbol 553 MovieClip in Symbol 577 MovieClip Frame 1
onClipEvent (load) {
ySpeed = 4.1;
dy = _y;
varMove = 0;
}
onClipEvent (enterFrame) {
if ((_y <= (dy - 510)) && (varMove == 0)) {
varMove = 1;
}
if ((_y >= dy) && (varMove == 1)) {
varMove = 0;
}
if (varMove == 0) {
_y = (_y - ySpeed);
}
if (varMove == 1) {
_y = (_y + ySpeed);
}
if (_root.Gravity == 3) {
if (this.hitTest(_root.player) && (varMove != 1)) {
varKeepDown = true;
} else {
varKeepDown = false;
}
}
if (_root.Gravity == 1) {
if (this.hitTest(_root.player) && (varMove != 1)) {
varKeepDown = false;
} else {
varKeepDown = true;
}
}
if ((((((varKeepDown == true) && (_root.player._currentframe != 4)) && (_root.Gravity == 3)) && (this.bottomp.hitTest(_root.player))) && (!_root.player.hitTest(this.bottomp.leftt))) && (!_root.player.hitTest(this.bottomp.rightt))) {
_root.player.yspeed = _root.player.yspeed - 10;
}
if ((((varKeepDown == true) && (_root.player._currentframe != 4)) && (_root.Gravity == 1)) && (this.topp.hitTest(_root.player))) {
_root.player.yspeed = 10;
}
}
Symbol 580 MovieClip Frame 1
Symbol 607 MovieClip Frame 1
stop();
Symbol 607 MovieClip Frame 53
_root.gotoAndStop(2);
Symbol 629 Button
on (press) {
_root.fadeOutMenu.play();
}