Frame 2
function loadGame() {
var _local1 = Math.floor((this.getBytesLoaded() / this.getBytesTotal()) * 100);
loaderBar._xscale = _local1;
if (_local1 == 100) {
clearInterval(loadInt);
nextFrame();
}
}
var loaderBar;
loaderBar._xscale = 1;
var loadInt = setInterval(this, "loadGame", 100);
stop();
Frame 3
play();
Frame 23
function trackGameplays(Void) {
var _local1 = new Date().getTime();
loadMovieNum ("tracker.swf?" + _local1, 10000);
}
var dom = new Game(this, fvGameData);
play();
Frame 37
stop();
Frame 164
dom.init();
Mouse.addListener(dom);
stop();
Frame 178
dom.displayEnd();
stop();
Frame 198
dom.displayEnd();
stop();
Symbol 5 MovieClip [tileOut] Frame 1
core._visible = false;
Symbol 7 MovieClip [tileIn] Frame 1
core._visible = false;
Symbol 19 MovieClip [tileNarrow] Frame 1
stop();
core._visible = false;
Symbol 19 MovieClip [tileNarrow] Frame 2
core._visible = false;
Symbol 19 MovieClip [tileNarrow] Frame 3
core._visible = false;
Symbol 24 MovieClip [tile] Frame 1
stop();
core._visible = false;
Symbol 24 MovieClip [tile] Frame 2
core._visible = false;
Symbol 24 MovieClip [tile] Frame 3
core._visible = false;
Symbol 24 MovieClip [tile] Frame 4
stop();
core._visible = false;
Symbol 33 MovieClip [sawBlood] Frame 10
stop();
Symbol 41 MovieClip [tob1] Frame 1
stop();
this.core._visible = false;
this.obType = "Zap";
Symbol 41 MovieClip [tob1] Frame 6
this.gotoAndStop(1);
Symbol 46 MovieClip [tob] Frame 1
this.core._visible = false;
this.obType = "Saw";
Symbol 49 MovieClip [deathSaw1] Frame 1
stop();
Symbol 53 MovieClip [deathSaw] Frame 1
stop();
Symbol 53 MovieClip [deathSaw] Frame 60
stop();
Symbol 63 MovieClip [deathZap] Frame 1
Symbol 63 MovieClip [deathZap] Frame 9
this.gotoAndPlay(2);
Symbol 63 MovieClip [deathZap] Frame 11
stop();
Symbol 76 MovieClip [deathSun] Frame 1
stop();
Symbol 79 MovieClip [sparks] Frame 40
this.removeMovieClip();
Symbol 83 MovieClip [trail] Frame 40
this.removeMovieClip();
Symbol 101 MovieClip [begin_mc] Frame 1
stop();
Symbol 124 MovieClip Frame 1
stop();
Symbol 124 MovieClip Frame 14
this.gotoAndPlay("flap");
Symbol 124 MovieClip Frame 30
stop();
Symbol 126 MovieClip [bullet] Frame 1
this.core._visible = false;
stop();
Symbol 126 MovieClip [bullet] Frame 30
_parent.nextFrame();
stop();
Symbol 213 MovieClip [__Packages.Game] Frame 0
class Game
{
var _$mc, distance, so;
function Game (mc) {
_$mc = mc;
}
function init() {
var _local1 = this;
_local1.tileName = "tile";
_local1.xvel = 5;
_local1.yvel = 0;
_local1.grav = 0.4;
_local1.lift = 0.6;
_local1.mDown = false;
_local1.collisionCount = 0;
_local1.distance = 0;
_local1.started = false;
_local1.drawObstacles = false;
_local1.obName = "tob";
_local1.obstacles = new Array();
_local1.cols = 30;
_local1.newCol = 0;
_local1.narrow = false;
_local1.randomVal = 11;
_local1.trailNum = 0;
_local1.difficulty = 1;
_local1.mouseClicks = 0;
_local1.lastTile = 1;
_local1.sawX = 0;
_local1.removeBegin = false;
var _local2 = 0;
while (_local2 <= _local1.cols) {
_local1.drawMap(_local2, false);
_local2++;
}
_local1.so = new AdultSwimSO("DreamOfTheMonarch");
_local1.loadBestDistance();
_local1.resetSprites();
_local1.monarchState = "flap";
_local1.diffSwitch = false;
}
function resetSprites() {
var _local1 = this;
_local1._$mc.monarch_mc._visible = true;
_local1._$mc.monarch_mc._x = 70;
_local1._$mc.monarch_mc._y = 200;
_local1._$mc.monarch_mc.gotoAndStop(1);
_local1._$mc.split._x = 0;
_local1._$mc.split._y = 0;
_local1._$mc.split.death.removeMovieClip();
_local1._$mc.disInd_mc.ind_mc._x = 0;
var _local2 = _local1._$mc.attachMovie("begin_mc", "begin", 1);
_local2._x = 32;
_local2._y = -7;
trace("RESET!!!");
_local1._$mc.display_mc._alpha = 0;
}
function drawMap(column) {
var _local1 = this;
var _local3 = column;
var _local2 = "tile" + _local3;
var nameold = ("tile" + (_local3 - 1));
_local1._$mc.t.attachMovie(_local1.tileName, _local2, _local3);
_local1._$mc.t[_local2]._x = _local1.STEP * _local3;
_local1.prevTile = _local1.nextTile;
_local1.nextTile = random(3) - 1;
if ((_local1.nextTile != _local1.prevTile) && (_local1.difficulty > 2)) {
_local1.nextTile = random(3) - 1;
} else if ((_local1.nextTile == _local1.prevTile) && (_local1.nextTile == 0)) {
_local1.nextTile = random(3) - 1;
}
if ((_local1.nextTile != _local1.prevTile) && (_local1.difficulty > 4)) {
_local1.nextTile = random(3) - 1;
}
if ((_local1.nextTile != _local1.prevTile) && (_local1.difficulty > 6)) {
_local1.nextTile = random(3) - 1;
}
if (_local1.cols < 31) {
_local1.nextTile = 0;
}
_local1._$mc.t[_local2]._y = (_local1.STEP * _local1.nextTile) + _local1._$mc.t[nameold]._y;
if (_local1._$mc.t[_local2]._y < -20) {
_local1._$mc.t[_local2]._y = -20;
}
if (_local1._$mc.t[_local2]._y > 80) {
_local1._$mc.t[_local2]._y = 80;
}
if (_local1._$mc.t[_local2]._y > _local1._$mc.t[nameold]._y) {
_local1._$mc.t[_local2].gotoAndStop(3);
}
if (_local1._$mc.t[_local2]._y < _root.t[nameold]._y) {
_local1._$mc.t[_local2].gotoAndStop(2);
}
if (_local3 < 12) {
_local1._$mc.t[_local2].gotoAndStop(4);
}
if (_local1.tileName == "tileIn") {
_local1.tileName = "tileNarrow";
_local1._$mc.t[_local2]._y = _local1._$mc.t[nameold]._y;
} else if (_local1.tileName == "tileOut") {
_local1.tileName = "tile";
_local1._$mc.t[_local2]._y = _local1._$mc.t[nameold]._y;
}
_local1.doSwitches(_local3);
if (_local1.drawObstacles) {
var i = _local1.randomVal;
var ran = random(i);
if (ran == 0) {
var rn = random(5);
if (rn == 0) {
var ny = -40;
} else if (rn == 1) {
var ny = 0;
} else if (rn == 2) {
var ny = 40;
} else if (rn == 3) {
var ny = -60;
} else if (rn == 4) {
var ny = 60;
}
var tooClose;
var last = _local1.obstacles[_local1.obstacles.length - 1];
var ln = Number(last.substring(2));
if ((_local3 - 1) == ln) {
var ly = _local1._$mc.ob[last].y;
var dy = (ny - ly);
if (Math.abs(dy) <= 40) {
tooClose = true;
} else {
tooClose = true;
}
}
if (!tooClose) {
var tname = ("ob" + _local3);
_local1._$mc.ob.attachMovie(_local1.obName, tname, _local3);
_local1._$mc.ob[tname]._x = _local1.STEP * _local3;
_local1._$mc.ob[tname]._y = _local1._$mc.t[_local2]._y + ny;
_local1._$mc.ob[tname].num = _local3;
_local1._$mc.ob[tname].y = ny;
_local1.obstacles.push(tname);
}
}
}
if (((_local1.tileName == "tile") && (_local1.drawObstacles == false)) && (_local1.difficulty > 2)) {
_local1.drawObstacles = true;
}
}
function doSwitches(col) {
var _local1 = this;
var x = col;
if (_local1.cols > 30) {
if (_local1.narrow == false) {
var _local2 = random(20);
if (_local2 == 0) {
_local1.tileName = "tileIn";
_local1.narrow = true;
_local1.drawObstacles = false;
_local1.difficulty++;
}
} else if (_local1.narrow == true) {
var _local2 = random(10);
if (_local2 == 0) {
_local1.tileName = "tileOut";
_local1.narrow = false;
_local1.difficulty++;
}
}
var _local2 = random(80);
if (_local2 == 0) {
if (_local1.randomVal > 2) {
_local1.randomVal--;
}
} else if (_local2 == 1) {
var _local3 = random(4);
if ((_local1.randomVal < 8) && (_local3 == 0)) {
_local1.randomVal++;
}
}
}
}
function moveClouds(xvel) {
var _local1 = this;
var _local2 = xvel;
_local1._$mc.fclouds0._x = _local1._$mc.fclouds0._x - _local2;
_local1._$mc.fclouds1._x = _local1._$mc.fclouds1._x - _local2;
_local1._$mc.fclouds2._x = _local1._$mc.fclouds2._x - _local2;
_local1._$mc.fclouds3._x = _local1._$mc.fclouds3._x - _local2;
if (_local1._$mc.fclouds0._x < 0) {
_local1._$mc.fclouds0._x = _local1._$mc.fclouds1._x + 801;
} else if (_local1._$mc.fclouds1._x < 0) {
_local1._$mc.fclouds1._x = _local1._$mc.fclouds0._x + 801;
}
if (_local1._$mc.fclouds2._x < 0) {
_local1._$mc.fclouds2._x = _local1._$mc.fclouds3._x + 801;
} else if (_local1._$mc.fclouds3._x < 0) {
_local1._$mc.fclouds3._x = _local1._$mc.fclouds2._x + 801;
}
_local1._$mc.cloudsBack._x = _local1._$mc.cloudsBack._x - 2;
if (_local1._$mc.cloudsBack._x < -1318) {
_local1._$mc.cloudsBack._x = 585;
}
}
function update() {
var _local1 = this;
var st = getTimer();
if (_local1.mDown) {
_local1.yvel = _local1.yvel - _local1.lift;
} else {
_local1.yvel = _local1.yvel + _local1.grav;
}
_local1._$mc.t._x = _local1._$mc.t._x - _local1.xvel;
_local1._$mc.ob._x = _local1._$mc.ob._x - _local1.xvel;
_local1.moveClouds(_local1.xvel * 2);
if ((_local1._$mc.begin._x != undefined) && (_local1._$mc.begin._x > -270)) {
_local1._$mc.begin._x = _local1._$mc.begin._x - _local1.xvel;
_local1._$mc.display_mc._alpha = _local1._$mc.display_mc._alpha + 2;
} else if (!_local1.removeBegin) {
_local1._$mc.begin.removeMovieClip();
_local1._$mc.display_mc._alpha = 100;
_local1.removeBegin = true;
}
_local1._$mc.monarch_mc._y = _local1._$mc.monarch_mc._y + _local1.yvel;
_local1.trailNum++;
_local1._$mc.trails.attachMovie("trail", "t" + _local1.trailNum, _local1.trailNum);
_local1._$mc.trails["t" + _local1.trailNum]._x = _local1._$mc.monarch_mc._x - 15;
_local1._$mc.trails["t" + _local1.trailNum]._y = _local1._$mc.monarch_mc._y + (random(30) - 20);
var _local2 = random(80) + 20;
_local1._$mc.trails["t" + _local1.trailNum]._xscale = _local2;
_local1._$mc.trails["t" + _local1.trailNum]._yscale = _local2;
_local1.testWallCollision();
if (_local1.collisionCount > 2) {
_local1.death("Sun");
}
var _local3 = _local1.testObCollision();
if (_local3.col) {
_local1.death(_local3.obType);
}
_local1.addRemoveTiles();
_local1.distance++;
_local1.updateDistanceDisplay();
if (!_local1.diffSwitch) {
_local1.checkDiffSwitch(_local1.distance);
}
}
function checkDiffSwitch(dis) {
var _local1 = this;
if (dis > _local1.DIFFSWITCH_DISTANCE) {
if (_local1.diffSwitchInt != undefined) {
clearInterval(_local1.diffSwitchInt);
}
_local1.diffSwitchInt = setInterval(_local1, "doDiffSwitchSpeed", 40);
_local1.obName = "tob1";
_local1.diffSwitch = true;
}
}
function doDiffSwitchSpeed() {
var _local1 = this;
_local1.xvel = _local1.xvel + 0.1;
if (_local1.xvel >= 8) {
_local1.grav = 0.6;
_local1.lift = 0.8;
clearInterval(_local1.diffSwitchInt);
}
}
function deactMovement() {
var _local1 = this;
Mouse.removeListener(_local1);
_local1.started = false;
clearInterval(_local1.moveInt);
}
function death(state) {
var _local1 = this;
var _local3 = state;
_local1.deactMovement();
_local1._$mc.monarch_mc.anim.gotoAndStop(1);
_local1._$mc.monarch_mc._visible = false;
var x = _local1._$mc.monarch_mc._x;
var y = _local1._$mc.monarch_mc._y;
var _local2 = _local1._$mc.attachMovie("death" + _local3, "death", 5);
if (_local3 == "Saw") {
var dc1 = _local1._$mc.split.attachMovie("deathSaw1", "death", 1);
dc1._x = x;
dc1._y = y;
}
if (_local3 == "Saw") {
_local1.sawX = _local1._$mc.ob._x - 45;
} else if (_local3 == "Zap") {
_local1.sawX = _local1._$mc.ob._x - 35;
_local1._$mc.ob.play();
} else {
_local1.sawX = _local1._$mc.ob._x - 15;
}
_local2._x = x;
_local2._y = y;
_local2.play();
_local1.yvel = 0;
clearInterval(_local1.moveInt);
_local1.deathInt();
_local1.moveInt = setInterval(_local1, "deathInt", 40, _local3);
}
function deathInt(state) {
var _local1 = this;
_local1.moveClouds(4);
_local1.yvel = _local1.yvel + 0.75;
if (state == "Sun") {
if (_local1._$mc.ob._x > _local1.sawX) {
_local1._$mc.death._x = _local1._$mc.death._x + (random(4) + -2);
_local1._$mc.death._y = _local1._$mc.death._y + (random(4) + -2);
var r = (random(40) - 20);
_local1._$mc.death._rotation = r;
var _local3 = 5;
while (_local3--) {
_local1.trailNum++;
_local1._$mc.trails.attachMovie("sparks", "t" + _local1.trailNum, _local1.trailNum);
_local1._$mc.trails["t" + _local1.trailNum]._x = _local1._$mc.death._x;
_local1._$mc.trails["t" + _local1.trailNum]._y = _local1._$mc.death._y + (random(30) - 20);
var scale = (random(80) + 20);
_local1._$mc.trails["t" + _local1.trailNum]._xscale = scale;
_local1._$mc.trails["t" + _local1.trailNum]._yscale = scale;
var _local2 = random(360);
_local1._$mc.trails["t" + _local1.trailNum]._rotation = _local2;
}
} else {
_local1._$mc.death._x = _local1._$mc.death._x + 1.5;
_local1._$mc.death._y = _local1._$mc.death._y + _local1.yvel;
_local1.trailNum++;
_local1._$mc.trails.attachMovie("sparks", "t" + _local1.trailNum, _local1.trailNum);
_local1._$mc.trails["t" + _local1.trailNum]._x = _local1._$mc.death._x;
_local1._$mc.trails["t" + _local1.trailNum]._y = _local1._$mc.death._y;
var scale = (random(80) + 20);
_local1._$mc.trails["t" + _local1.trailNum]._xscale = scale;
_local1._$mc.trails["t" + _local1.trailNum]._yscale = scale;
_local1._$mc.trails["t" + _local1.trailNum]._rotation = 90;
}
_local1._$mc.t._x = _local1._$mc.t._x - 1.5;
_local1._$mc.ob._x = _local1._$mc.ob._x - 1.5;
_local1._$mc.begin._x = _local1._$mc.begin._x - 1.5;
} else if (state == "Saw") {
if (_local1._$mc.ob._x > _local1.sawX) {
_local1._$mc.death.split1._x = _local1._$mc.death.split1._x + 0.05;
_local1._$mc.split._x = _local1._$mc.split._x + 0.3;
_local1._$mc.t._x = _local1._$mc.t._x - 1.5;
_local1._$mc.ob._x = _local1._$mc.ob._x - 1.5;
_local1._$mc.begin._x = _local1._$mc.begin._x - 1.5;
} else {
_local1._$mc.death.split1._y = _local1._$mc.death.split1._y + _local1.yvel;
_local1._$mc.split._y = _local1._$mc.split._y + (_local1.yvel * 0.6);
_local1._$mc.t._x = _local1._$mc.t._x - _local1.xvel;
_local1._$mc.ob._x = _local1._$mc.ob._x - _local1.xvel;
_local1._$mc.begin._x = _local1._$mc.begin._x - _local1.xvel;
}
} else if (state == "Zap") {
if (_local1._$mc.ob._x > _local1.sawX) {
_local1._$mc.death._x = _local1._$mc.death._x + (random(4) + -2);
_local1._$mc.death._y = _local1._$mc.death._y + (random(4) + -2);
var r = (random(20) - 10);
_local1._$mc.death._rotation = r;
} else {
_local1._$mc.death.gotoAndStop("zapped");
_local1._$mc.death._x = _local1._$mc.death._x + 1.5;
_local1._$mc.death._y = _local1._$mc.death._y + (_local1.yvel / 2);
_local1.trailNum++;
_local1._$mc.trails.attachMovie("sparks", "t" + _local1.trailNum, _local1.trailNum);
_local1._$mc.trails["t" + _local1.trailNum]._x = _local1._$mc.death._x;
_local1._$mc.trails["t" + _local1.trailNum]._y = _local1._$mc.death._y;
var scale = (random(80) + 20);
_local1._$mc.trails["t" + _local1.trailNum]._xscale = scale;
_local1._$mc.trails["t" + _local1.trailNum]._yscale = scale;
_local1._$mc.trails["t" + _local1.trailNum]._rotation = 90;
}
_local1._$mc.t._x = _local1._$mc.t._x - 1.5;
_local1._$mc.ob._x = _local1._$mc.ob._x - 1.5;
_local1._$mc.begin._x = _local1._$mc.begin._x - 1.5;
}
if ((_local1._$mc.death._y > 700) || (_local1._$mc.death.split1._y > 500)) {
clearInterval(_local1.moveInt);
_local1._$mc.death.removeMovieClip();
stopAllSounds();
_local1.gameOver();
}
_local1.addRemoveTiles();
}
function gameOver(state) {
var _local1 = this;
_local1._$mc.begin.removeMovieClip();
_local1.checkBestDistance();
if (_local1.distance > _local1.bestDistance) {
_local1._$mc.gotoAndPlay("youWin");
} else {
_local1._$mc.gotoAndPlay("youLose");
}
}
function addRemoveTiles() {
var _local1 = this;
var STEP = ((_local1.newCol * 20) * -1);
if (_local1._$mc.t._x < STEP) {
_local1.newCol++;
_local1.cols++;
_local1.drawMap(_local1.cols, true);
var _local3 = "tile" + (_local1.cols - 32);
removeMovieClip(_local1._$mc.t[_local3]);
var _local2 = "ob" + (_local1.cols - 32);
if (_local1.searchObstacles(_local2)) {
removeMovieClip(_local1._$mc.ob[_local2]);
_local1.obstacles.shift();
}
}
}
function testWallCollision() {
var _local1 = this;
if (_local1._$mc.t.hitTest(_local1._$mc.monarch_mc._x, _local1._$mc.monarch_mc._y, true) == false) {
_local1.collisionCount++;
} else {
_local1.collisionCount = 0;
}
}
function testObCollision(Void) {
var _local1 = this;
var r = new Object();
var n = _local1.obstacles.length;
while (n--) {
var _local2 = _local1.obstacles[n];
if (_local1._$mc.ob[_local2].core.hitTest(_local1._$mc.monarch_mc.core)) {
r.col = true;
r.obType = _local1._$mc.ob[_local2].obType;
if (_local1._$mc.ob[_local2].obType == "Saw") {
var bld = _local1._$mc.ob[_local2].attachMovie("sawBlood", "blood", 1);
var sx = (_local1._$mc.ob[_local2]._x + _local1._$mc.ob._x);
var sy = (200 + _local1._$mc.ob[_local2]._y);
var dy = (sy - _local1._$mc.monarch_mc._y);
var dx = (sx - _local1._$mc.monarch_mc._x);
var _local3 = Math.atan2(dy, dx);
_local3 = (_local3 * 180) / Math.PI;
bld._rotation = Math.floor(_local3) - 90;
}
return(r);
}
}
r.col = false;
r.obType = null;
return(r);
}
function updateDistanceDisplay(Void) {
_$mc.display_mc.distance_txt.text = distance;
}
function checkBestDistance(Void) {
var _local1 = this;
if (_local1.distance > _local1.bestDistance) {
trace(((_local1.distance + " > ") + _local1.bestDistance) + " = update save");
_local1.saveBestDistance(_local1.distance);
}
}
function saveBestDistance(dist) {
so._info._bestDistance = dist;
}
function loadBestDistance() {
var _local1 = this;
_local1.bestDistance = _local1.so._info._bestDistance;
if (_local1.bestDistance == undefined) {
_local1.bestDistance = 0;
}
_local1._$mc.display_mc.bestDist_mc.bestDistance_txt.text = _local1.bestDistance;
}
function searchObstacles(name) {
var _local3 = this;
var _local2 = false;
var _local1 = _local3.obstacles.length;
while (_local1--) {
if (name == _local3.obstacles[_local1]) {
_local2 = true;
}
}
return(_local2);
}
function displayEnd() {
var _local1 = this;
_local1._$mc.finalDistance_txt.text = _local1.distance + " Feet";
_local1._$mc.finalClicks_txt.text = _local1.mouseClicks + " Clicks";
_local1.checkBestDistance();
}
function onMouseDown() {
var _local1 = this;
_local1.mDown = true;
_local1.mouseClicks++;
if (!_local1.started) {
_local1._$mc.monarch_mc.anim.gotoAndPlay("flap");
_local1._$mc.start_mc._visible = false;
if (_local1.moveInt) {
clearInterval(_local1.moveInt);
}
_local1.moveInt = setInterval(_local1, "update", 40);
_local1.started = true;
}
if (_local1.monarchState == "glide") {
_local1.monarchState = "flap";
_local1._$mc.monarch_mc.anim.gotoAndPlay("flapIn");
}
}
function onMouseUp() {
var _local1 = this;
_local1.mDown = false;
if (_local1.monarchState == "flap") {
_local1.monarchState = "glide";
_local1._$mc.monarch_mc.anim.gotoAndPlay("glide");
}
}
var cols = 30;
var STEP = 20;
var DIFFSWITCH_DISTANCE = 5000;
}
Symbol 214 MovieClip [__Packages.AdultSwimSO] Frame 0
class AdultSwimSO
{
var _$gameName, _$so;
function AdultSwimSO (gName) {
_$gameName = gName;
_$so = SharedObject.getLocal(_$USERS_SO, _$USERS_SO_PATH);
}
function get _info() {
var _local1 = this;
if (_local1._$so.data[_local1._$gameName] == undefined) {
_local1._$so.data[_local1._$gameName] = {};
}
return(_local1._$so.data[_local1._$gameName]);
}
static var _$USERS_SO = "AS_users";
static var _$USERS_SO_PATH = "/";
}
Symbol 143 MovieClip Frame 165
this.gotoAndPlay(51);
Symbol 144 MovieClip Frame 190
this.gotoAndPlay(76);
Symbol 150 Button
on (release) {
trackGameplays();
this.play();
}
Symbol 155 Button
on (release) {
this.gotoAndStop("game");
}
Symbol 180 MovieClip Frame 1
stop();
Symbol 180 MovieClip Frame 50
_root.dom.gameOver("winQuest");
Symbol 198 Button
on (release) {
trackGameplays();
this.gotoAndStop("game");
}