Frame 60
if ((!_totalframes) || (_framesloaded != _totalframes)) {
gotoAndPlay (1);
}
Frame 61
function SetStatus(s) {
if (s == undefined) {
s = "";
}
_root.txtStatus = String(s);
}
function SetLife(l) {
_root.txtLife = "Life\n" + String(l);
}
function SetLevel(lv, ttlv) {
_root.txtLevel = (("Level " + String(lv)) + "/") + String(ttlv);
}
function NewGame() {
_root.gotoAndStop("play");
_root.MainGame.removeMovieClip();
MainGame = _root.createEmptyMovieClip("MainGame", _root.getNextHighestDepth());
MainGame._y = 325;
map = MainGame.attachMovie("class_map", "map", MainGame.getNextHighestDepth());
character = MainGame.attachMovie("class_character", "character", MainGame.getNextHighestDepth() + 1);
map.setSize(size[0], size[1]);
map.setMap(LevelMap);
character.setSize(size[0], size[1]);
character.setLife(Life);
character.setMap(map);
character.setOptionLevel(LevelOption);
character.Start();
_root.setStatus("");
MainGame.onKeyUp = function () {
if (Key.getCode() == 80) {
if (this.pause == undefined) {
this.pause = false;
}
this.pause = !this.pause;
_root.SetStatus();
if (this.pause) {
_root.SetStatus("Pause");
}
this.character.Pause(this.pause);
}
};
Key.addListener(MainGame);
}
stop();
var map1 = [[], [], [], [], [], [], [], [], [], [], [1, 0.2, 1], [], [], [], [], [], [], [], [], [], []];
var map2 = [[], [], [], [], [], [], [], [], [], [], [3, 0.3, 2, 10], [], [], [], [], [], [], [], [], [], []];
var map3 = [[], [], [], [], [], [], [], [], [], [], [5, 1, 2, 12], [], [], [], [], [], [], [], [], [], []];
var map4 = [[], [], [], [], [], [], [1, 0.2, 1], [], [], [], [1, 0.2, 1], [], [], [], [1, 0.2, 1], [], [], [], [], [], []];
var map5 = [[], [], [], [], [], [3, 0.3, 2, 10], [], [], [], [], [3, 0.3, 2, 10], [], [], [], [], [3, 0.3, 2, 10], [], [], [], [], []];
var map6 = [[], [], [], [1, 0.2, 1], [], [], [1, 1, 2, 5], [], [], [1, 0.2, 1], [], [], [1, 1, 2, 5], [], [], [1, 0.2, 1], [], [], [], [], []];
var map7 = [[], [], [], [1, 0.2, 1], [], [], [], [3, 0.3, 2, 10], [], [], [], [1, 0.2, 1], [3, 0.3, 2, 10], [], [], [], [], [1, 0.2, 1], [], [], []];
var map8 = [[], [], [], [1, 0.2, 1], [], [], [], [1, 3, 3, 10], [1, 3, 3, 10], [3, 0.3, 2, 10], [1, 0.4, 1], [1, 0.2, 1], [], [], [], [3, 0.3, 2, 10], [1, 0.2, 1], [1, 0.2, 1], [], [], []];
var map9 = [[], [], [], [1, 0.2, 1], [], [], [], [], [3, 0.3, 2, 10], [], [], [1, 1, 2, 5], [], [], [], [3, 0.3, 2, 10], [1, 0.2, 1], [1, 0.2, 1], [], [], []];
var map10 = [[], [], [], [], [5, 1, 2, 12], [1, 1, 1.3, 0], [], [], [3, 0, 1, 10], [], [1, 3, 3, 10], [], [], [2, 1, 1.5, 10], [1, 0.3, 2, 0, -10], [], [2, 1, 2.5, 10], [], [], [], []];
var map11 = [[], [], [], [1, 0.2, 1], [1, 0.2, 1], [1, 0.2, 1], [], [], [3, 0.3, 2, 10], [3, 0.3, 2, 10], [], [], [1, 1, 2, 5], [], [], [3, 0.3, 2, 10], [], [], [1, 1, 2, 5], [], []];
var map12 = [[], [], [], [1, 1, 2, 5], [1, 0.2, 1], [1, 0.2, 1], [3, 0.3, 2, 10], [], [], [2, 2, 2, 5], [], [], [1, 0.2, 1], [1, 0.2, 1], [1, 0.2, 1], [], [1, 0.2, 1], [1, 0.2, 1], [1, 0.2, 1], [1, 0.2, 1], []];
var map13 = [[], [], [5, 1, 2, 12], [5, 1, 2, 12], [5, 1, 2, 12], [1, 1, 2, 5], [], [1, 1, 1.5, 5], [3, 0.3, 2, 3], [1, 0.2, 1], [], [], [1, 0.2, 1], [], [], [3, 0.3, 2, 10], [], [], [5, 1, 2, 12], [5, 1, 2, 12], [5, 1, 2, 12]];
var map14 = [[1, 1, 2, 5], [1, 1, 2, 5], [1, 1, 2, 5], [1, 1, 2, 5], [], [3, 0.2, 1.8, 3], [], [], [], [1, 0.2, 1], [1, 0.2, 1], [3, 0.3, 2, 3], [1, 0.2, 1], [], [3, 1.5, 2, 10], [], [1, 0.2, 1], [3, 0.3, 2, 3], [1, 0.2, 1], [], []];
var map15 = [[1, 1, 2, 5], [], [], [1, 0.2, 1], [], [1, 1, 2, 5], [], [], [1, 1, 2.5, 5], [3, 0.3, 2, 3], [1, 0.2, 1], [], [], [], [3, 1.5, 2, 10], [], [1, 0.2, 1], [1, 0.2, 1], [1, 0.3, 1], [], [1, 1, 2, 5]];
var LevelMap = [map1, map2, map3, map4, map5, map6, map7, map8, map9, map10, map11, map12, map13, map14, map15];
var level1 = {x_speed:7, x_sjump:7, y_sjump:15, x_pjump:7.5, y_pjump:20, gravity:2};
var LevelOption = [level1];
var Life = 10;
var size = [30, 30];
MovieClip.prototype.Blur = function (x, y) {
var _local2 = new flash.filters.BlurFilter(x, y, 3);
this.filters = new Array(_local2);
};
Frame 62
stop();
Frame 63
stop();
Symbol 4 MovieClip Frame 13
gotoAndPlay (1);
Symbol 10 MovieClip Frame 1
d = 50 + random(50);
Symbol 10 MovieClip Frame 2
d = d - 1;
Symbol 10 MovieClip Frame 3
if (d > 0) {
gotoAndPlay(_currentframe - 1);
}
Symbol 10 MovieClip Frame 20
d = 20 + random(40);
Symbol 10 MovieClip Frame 21
d = d - 1;
Symbol 10 MovieClip Frame 22
if (d > 0) {
gotoAndPlay(_currentframe - 1);
}
Symbol 10 MovieClip Frame 40
gotoAndPlay (1);
Symbol 19 MovieClip Frame 2
death = false;
Symbol 19 MovieClip Frame 14
gotoAndPlay ("run");
Symbol 19 MovieClip Frame 22
death = false;
Symbol 19 MovieClip Frame 30
this.gotoAndPlay("jump");
Symbol 19 MovieClip Frame 37
death = false;
Symbol 19 MovieClip Frame 45
death = true;
stop();
Symbol 19 MovieClip Frame 52
death = false;
Symbol 19 MovieClip Frame 53
stop();
Symbol 19 MovieClip Frame 62
gotoAndPlay ("lastdeath");
Symbol 20 MovieClip [class_character] Frame 1
#initclip 2
function class_character() {
this.def_x_speed = 3;
this.def_x_sjump = 20;
this.def_y_sjump = 20;
this.def_x_pjump = 20;
this.def_y_pjump = 40;
this.def_gravity = 2;
this.def_width = 30;
this.def_height = 30;
this.def_totalLife = 25;
this.setSize(this.width, this.height);
this.setLife(this.life);
this.setMap(this.map);
this.setOptionLevel(this.levelopt);
this.ResetPostion();
}
class_character.prototype = new MovieClip();
class_character.prototype.setSpeed = function (sp) {
this.x_speed = ((sp == undefined) ? (((this.x_speed == undefined) ? (this.def_x_speed) : (this.x_speed))) : (Number(sp)));
this.vx = this.x_speed;
};
class_character.prototype.setSmallJump = function (xj, yj) {
this.x_sjump = ((xj == undefined) ? (((this.x_sjump == undefined) ? (this.def_x_sjump) : (this.x_sjump))) : (Number(xj)));
this.y_sjump = ((yj == undefined) ? (((this.y_sjump == undefined) ? (this.def_y_sjump) : (this.y_sjump))) : (Number(yj)));
};
class_character.prototype.setPowerJump = function (xj, yj) {
this.x_pjump = ((xj == undefined) ? (((this.x_pjump == undefined) ? (this.def_x_pjump) : (this.x_pjump))) : (Number(xj)));
this.y_pjump = ((yj == undefined) ? (((this.y_pjump == undefined) ? (this.def_y_pjump) : (this.y_pjump))) : (Number(yj)));
};
class_character.prototype.setGravity = function (g) {
this.gravity = ((g == undefined) ? (((this.gravity == undefined) ? (this.def_gravity) : (this.gravity))) : (Number(g)));
};
class_character.prototype.setOptionLevel = function (opt) {
this.levelopt = opt;
this.setLevel(this.level);
};
class_character.prototype.setLevel = function (lv) {
this.level = ((lv == undefined) ? 0 : (Number(lv)));
_root.SetLevel(this.level + 1, this.totalLevel);
this.CurOption = this.levelopt[this.level];
this.setSpeed(this.CurOption.x_speed);
this.setSmallJump(this.CurOption.x_sjump, this.CurOption.y_sjump);
this.setPowerJump(this.CurOption.x_pjump, this.CurOption.y_pjump);
this.setGravity(this.CurOption.gravity);
};
class_character.prototype.setMap = function (map) {
this.map = map;
this.totalLevel = map.totalLevel;
};
class_character.prototype.setSize = function (w, h) {
this.width = ((w == undefined) ? (this.def_width) : (Number(w)));
this.height = ((h == undefined) ? (this.def_height) : (Number(h)));
};
class_character.prototype.setLife = function (lf) {
this.totalLife = ((lf == undefined) ? (this.def_totalLife) : (Number(lf)));
this.life = this.totalLife;
_root.SetLife(this.life);
};
class_character.prototype.Run = function () {
this.KeyAble(true);
this.onEnterFrame = function () {
this._x = this._x + this.vx;
this._y = this._y + this.vy;
this.CheckPostion();
};
};
class_character.prototype.Stop = function () {
this.KeyAble(false);
delete this.onEnterFrame;
};
class_character.prototype.Pause = function (p) {
if (p) {
this.Stop();
} else if (!this.death) {
this.Run();
}
};
class_character.prototype.Die = function () {
this.life--;
_root.SetLife(this.life);
if (this.life > 0) {
this.character.gotoAndPlay("death");
this.Stop();
this.death = true;
this.timerDeath = setInterval(this.CheckTimeDeath, 100, this);
} else {
this.character.gotoAndPlay("lastdeath");
_root.SetStatus("You lose!");
this.Stop();
}
};
class_character.prototype.KeyAble = function (key) {
if (key) {
Key.addListener(this);
this.onKeyDown = function () {
if (Key.isDown(38)) {
this.vx = this.x_sjump;
this.vy = -this.y_sjump;
this.character.gotoAndPlay("jump");
this.KeyAble(false);
}
if (Key.isDown(32)) {
this.vx = this.x_pjump;
this.vy = -this.y_pjump;
this.character.gotoAndPlay("jump");
this.KeyAble(false);
}
};
} else {
Key.removeListener(this);
}
};
class_character.prototype.ResetPostion = function (lvup) {
this._x = 0;
if (!lvup) {
this._y = 0;
this.vx = this.x_speed;
this.vy = 0;
}
};
class_character.prototype.CheckPostion = function () {
if (this._y > 0) {
this._y = 0;
this.vx = this.x_speed;
this.vy = 0;
this._rotation = 0;
this.character.gotoAndPlay("run");
this.KeyAble(true);
} else if (this._y < 0) {
this.vy = this.vy + this.gravity;
}
if ((this.map.alltree.hitTest(this._x + this._parent._x, (this._y + this._parent._y) - ((3 * this.height) / 4), 1) or this.map.alltree.hitTest(this._x + this._parent._x, (this._y + this._parent._y) - ((2 * this.height) / 4), 1)) or this.map.alltree.hitTest(this._x + this._parent._x, (this._y + this._parent._y) - ((1 * this.height) / 4), 1)) {
this.Die();
}
if (this._x >= 600) {
this.FinishLevel();
}
};
class_character.prototype.CheckTimeDeath = function (mc) {
if (mc.character.death) {
if (mc._parent.pause) {
mc.character.gotoAndPlay("death");
} else {
mc.character.gotoAndPlay("run");
mc.ResetPostion(false);
mc.Run();
mc.death = false;
clearInterval(mc.timerDeath);
}
}
};
class_character.prototype.FinishLevel = function () {
this.level++;
if (this.level < this.totalLevel) {
this.ResetPostion(true);
this.setLevel(this.level);
this.map.setLevel(this.level);
} else {
_root.SetStatus("Congratulations, You Finished!!!");
}
};
class_character.prototype.Start = function () {
this.setLife(this.totalLife);
this.setLevel(0);
this.map.drawMap(0);
this.Run();
_root.SetStatus();
};
Object.registerClass("class_character", class_character);
#endinitclip
Symbol 25 MovieClip [class_map] Frame 1
#initclip 1
function class_map() {
this.def_width = 30;
this.def_height = 30;
this.setMap(this.maplevel);
this.setSize(this.width, this.height);
}
class_map.prototype = new MovieClip();
class_map.prototype.setMap = function (map) {
this.def_width = 30;
this.def_height = 30;
this.maplevel = map;
this.totalLevel = map.length;
};
class_map.prototype.setLevel = function (lv) {
this.level = ((lv == undefined) ? 0 : (Number(lv)));
this.drawMap(this.level);
};
class_map.prototype.setSize = function (w, h) {
this.width = ((w == undefined) ? (this.def_width) : (Number(w)));
this.height = ((h == undefined) ? (_root.def_height) : (Number(h)));
};
class_map.prototype.drawMap = function (lv) {
this.allroot.removeMovieClip();
this.alltree.removeMovieClip();
allroot = this.createEmptyMovieClip("allroot", this.getNextHighestDepth());
alltree = this.createEmptyMovieClip("alltree", this.getNextHighestDepth() + 1);
allroot.Blur(2, 2);
alltree.Blur(2, 2);
highest_depth = allroot.getNextHighestDepth();
var _local4 = 0;
while (_local4 < this.maplevel[lv].length) {
map = this.maplevel[lv][_local4];
quantity = ((map[0] == undefined) ? 0 : (Number(map[0])));
root = ((map[1] == undefined) ? 0 : (Number(map[1])));
tree = ((map[2] == undefined) ? 0 : (Number(map[2])));
space = ((map[3] == undefined) ? 0 : (Number(map[3])));
moving = ((map[4] == undefined) ? 0 : (Number(map[4])));
listDepth = new Array();
listDepth.length = quantity;
var _local2 = 0;
while (_local2 < quantity) {
do {
d = int(Math.random() * quantity);
if (listDepth[d] == undefined) {
break;
}
} while (true);
listDepth[d] = 1;
var _local5 = ((this.width * _local4) + (((d - (quantity / 2)) - 0.5) * space)) + moving;
m_root = null;
if (root) {
var m_root = allroot.attachMovie("m_root", ("root" + _local4) + _local2, highest_depth + _local2);
m_root._x = _local5;
m_root._xscale = 100 + ((Math.random * root) * 20);
m_root._height = (1 + (Math.random() * 0.2)) * this.height;
m_root._height = m_root._height * root;
}
if (tree) {
var _local3 = alltree.attachMovie("m_tree", ("tree" + _local4) + _local2, highest_depth + _local2);
_local3._x = _local5;
_local3._y = ((m_root._height == undefined) ? 0 : (-m_root._height));
_local3._width = (1 + (tree * (Math.random() * 0.3))) * this.width;
_local3._height = (1 + (Math.random() * 0.3)) * this.height;
_local3._height = _local3._height * tree;
}
_local2++;
}
highest_depth = highest_depth + quantity;
_local4++;
}
};
Object.registerClass("class_map", class_map);
#endinitclip
mc_tree._visible = false;
mc_root._visible = false;
Symbol 32 MovieClip Frame 1
_root.stop();
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded != 100) {
bar._xscale = PercentLoaded;
} else {
gotoAndStop ("loaded");
}
Symbol 32 MovieClip Frame 2
gotoAndPlay (1);
Symbol 32 MovieClip Frame 3
_root.play();
Symbol 38 Button
on (release) {
getURL ("http://www.allfunnystuff.com", "_blank");
}
Symbol 48 Button
on (release) {
NewGame();
}
Symbol 52 Button
on (release) {
gotoAndStop ("intro");
stopAllSounds();
}
Symbol 57 Button
on (release) {
getURL ("http://www.allfunnystuff.com", "_blank");
}
Symbol 68 Button
on (release) {
_root.gotoAndPlay("main");
_root.MainGame.removeMovieClip();
stopAllSounds();
}
Symbol 72 Button
on (release) {
nextFrame();
}
Symbol 74 Button
on (release) {
prevFrame();
}
Symbol 75 MovieClip Frame 1
stop();
Symbol 75 MovieClip Frame 2
stopAllSounds();
Symbol 80 Button
on (release) {
getURL ("http://www.allfunnystuff.com", "_blank");
}
Symbol 83 Button
on (release) {
_root.gotoAndPlay("main");
_root.MainGame.removeMovieClip();
}