Frame 1
function website() {
getURL ("http://www.rrrrthats5rs.com", "_blank");
}
function BS() {
}
rrrrbutton.onPress = website;
MENU = new ContextMenu();
MENU.hideBuiltInItems();
MenChoice1 = new ContextMenuItem("Visit RRRRThats5Rs", website);
MenChoice2 = new ContextMenuItem("Unlock Secret Levels", BS);
MENU.customItems.push(MenChoice1);
MENU.customItems.push(MenChoice2);
_root.menu = MENU;
stop();
firsthobo.stage = "blah";
_global.gamestate = "setup";
_global.tries = 1;
_global.cheating = false;
start_btn.onRelease = function () {
if (_global.gamestate == "setup") {
_global.gamestate = "rules";
gotoAndStop (2);
}
};
var dt = 0.5;
var gravity = new Vector(0, 10, 0);
var vel = 0;
var nextvy = 0;
var meters = 0;
var rank = 0;
var ranks = ["Pitiful Paul", "Average Joe", "Ben Stiller", "Calvin Coolidge", "Benjamin Disraeli", "Mary Higgins Clark", "Dr. James Naismith", "Harriet Beecher Stowe", "Harriet Tubman", "Martin Luther King Jr.", "FDR", "Gandhi", "Muhammed", "Muhammed Ali", "Confucius", "Sacagawea", "Shakespeare", "Susan B. Anthony", "Stalin", "Mother Teresa", "Abraham Lincoln", "Jesus Christ", "...........", "... you done yet?"];
Frame 2
function website() {
getURL ("http://www.rrrrthats5rs.com", "_blank");
}
rrrrbutton.onPress = website;
firsthobo.stage = "blah";
start_btn.onRelease = function () {
if (_global.gamestate == "rules") {
_global.gamestate = "play";
gotoAndStop (3);
}
};
Frame 3
function website() {
getURL ("http://www.rrrrthats5rs.com", "_blank");
}
rrrrbutton.onPress = website;
stop();
if (_global.gamestate == "setup") {
gotoAndStop (1);
}
if (_global.gamestate == "rules") {
gotoAndStop (2);
}
hobo.reset();
retry_btn.onRelease = function () {
_global.tries++;
if (_global.tries == 3) {
_global.cheating = true;
} else {
_global.cheating = false;
}
if ((_global.tries > 3) && (Math.random() < 0.1)) {
_global.cheating = true;
}
scoreboard._y = 500;
scoreboard.gotoAndStop(1);
hobo.reset();
};
Instance of Symbol 108 MovieClip "master_background" in Frame 3
onClipEvent (enterFrame) {
_root.meters = _root.meters + (_root.vel * _root.dt);
_root.score.text = "Score: " + int(_root.meters / 30);
rankedscore = (_root.rank * 100) + Math.pow(1.8, _root.rank);
if ((_root.meters / 30) > rankedscore) {
_root.rank = (_root.rank + 1) % 24;
}
_root.ranked.text = ((("Rank: " + _root.ranks[_root.rank]) + newline) + (22 - _root.rank)) + " ranks to go!";
}
Instance of Symbol 56 MovieClip [scroller_grass] in Frame 3
onClipEvent (load) {
attachMovie("foreground", "bg1", 1, {_y:-75});
attachMovie("foreground", "bg2", 2, {_y:-75});
bg1._x = -550;
bg2._x = 450;
}
onClipEvent (enterFrame) {
speed = _root.vel;
scroll(_root.dt);
}
Instance of Symbol 54 MovieClip [scroller_hills] in Frame 3
onClipEvent (load) {
attachMovie("background", "bg1", 1, {_y:-175});
attachMovie("background", "bg2", 2, {_y:-175});
bg1._x = -550;
bg2._x = 450;
}
onClipEvent (enterFrame) {
speed = _root.vel / 3;
scroll(_root.dt);
}
Instance of Symbol 66 MovieClip "arm" in Frame 3
onClipEvent (enterFrame) {
_x = (20 + _root.hobo._x);
}
Instance of Symbol 51 MovieClip [generator] "generator" in Frame 3
onClipEvent (enterFrame) {
shiftItems((-_root.vel) * _root.dt, 0);
}
Instance of Symbol 51 MovieClip [generator] "cheater" in Frame 3
onClipEvent (enterFrame) {
shiftItems((-_root.vel) * _root.dt, 0);
}
Instance of Symbol 48 MovieClip [comp] "computer" in Frame 3
onClipEvent (load) {
var bouncedyet = false;
var oldy = 0;
var oldvy = 0;
var nextspot = 0;
var dist = 0;
var nextvy = 0;
}
onClipEvent (enterFrame) {
p = Math.random();
if (_root.stage == "moving") {
if (_global.cheating == false) {
p = Math.random();
if (p < 0.01) {
_root.indians.makeQuickIndian();
}
if (p > 0.97) {
_root.generator.makeQuickItem();
}
} else if ((p < 0.02) && (_root.vel > 1)) {
_root.generator.makeQuickItem();
}
force.addSelf(_root.gravity);
oldvy = vel.y;
update(_root.dt, false);
dist = dist + (_root.vel * _root.dt);
var hit = _root.indians.checkCollisions();
if ((hit > -1) && (pos.y > 230)) {
_root.vel = 0;
vel.y = 0;
nextspot = 0;
}
if (checkGround() && (hit < 0)) {
if (_currentframe < 3) {
nextFrame();
}
vel.y = nextvy;
nextvy = nextvy * 0.7;
_root.vel = _root.vel * 0.7;
if (nextspot > 0) {
dx = dist - nextspot;
}
_root.cheater.shiftItems(dx, 0);
dist = 0;
nextspot = Math.abs((_root.vel * vel.y) / 5);
if ((nextspot > 600) && (_root.vel < (-vel.y))) {
_root.indians.makeQuickIndian();
}
_root.cheater.manageCollisions();
_root.generator.manageCollisions();
}
if ((oldvy < 0) && (vel.y > 0)) {
if (pos.y < 100) {
if (nextspot > 1200) {
_root.indians.makeQuickIndian();
} else {
_root.generator.makeQuickItem();
}
}
}
setXY();
if (_root.vel < 0.01) {
_root.stage = "stopped";
_root.vel = 0;
}
}
if (_root.stage == "stopped") {
_root.scoreboard._y = 150;
}
}
Instance of Symbol 51 MovieClip [generator] "indians" in Frame 3
onClipEvent (enterFrame) {
shiftItems((-_root.vel) * _root.dt, 0);
}
Symbol 4 MovieClip [computer] Frame 1
#initclip 12
Object.registerClass("computer", Bounce);
#endinitclip
Symbol 42 MovieClip [items] Frame 1
stop();
Symbol 42 MovieClip [items] Frame 2
stop();
Symbol 42 MovieClip [items] Frame 3
stop();
Symbol 42 MovieClip [items] Frame 4
stop();
Symbol 42 MovieClip [items] Frame 5
stop();
Symbol 42 MovieClip [items] Frame 6
stop();
Symbol 42 MovieClip [items] Frame 7
stop();
Symbol 42 MovieClip [items] Frame 8
stop();
Symbol 42 MovieClip [items] Frame 9
stop();
Symbol 42 MovieClip [items] Frame 10
stop();
Symbol 42 MovieClip [items] Frame 11
stop();
Symbol 42 MovieClip [items] Frame 12
stop();
Symbol 42 MovieClip [items] Frame 13
stop();
Symbol 42 MovieClip [items] Frame 14
stop();
Symbol 42 MovieClip [items] Frame 15
stop();
Symbol 42 MovieClip [items] Frame 16
stop();
Symbol 42 MovieClip [items] Frame 17
stop();
Symbol 42 MovieClip [items] Frame 18
stop();
Symbol 42 MovieClip [items] Frame 19
stop();
Symbol 42 MovieClip [items] Frame 20
stop();
Symbol 42 MovieClip [items] Frame 21
stop();
Symbol 42 MovieClip [items] Frame 22
stop();
Symbol 42 MovieClip [items] Frame 23
stop();
Symbol 42 MovieClip [items] Frame 24
stop();
Symbol 42 MovieClip [items] Frame 25
stop();
Symbol 42 MovieClip [items] Frame 26
stop();
Symbol 48 MovieClip [comp] Frame 1
#initclip 7
Object.registerClass("comp", Bounce);
#endinitclip
stop();
Symbol 48 MovieClip [comp] Frame 2
stop();
Symbol 48 MovieClip [comp] Frame 3
stop();
Symbol 51 MovieClip [generator] Frame 1
#initclip 8
Object.registerClass("generator", Generator);
#endinitclip
Symbol 54 MovieClip [scroller_hills] Frame 1
#initclip 9
Object.registerClass("scroller_hills", ScrollingBG);
#endinitclip
Symbol 56 MovieClip [scroller_grass] Frame 1
#initclip 10
Object.registerClass("scroller_grass", ScrollingBG);
#endinitclip
Symbol 85 MovieClip Frame 1
Symbol 87 MovieClip [hobo] Frame 1
#initclip 11
Object.registerClass("hobo", HoboKick);
#endinitclip
Symbol 132 MovieClip [__Packages.Vector] Frame 0
class Vector
{
var x, y, z;
function Vector (px, py, pz) {
x = px;
y = py;
z = pz;
}
function toString() {
return(((((("<" + x) + ",") + y) + ",") + z) + ">");
}
function reset(px, py, pz) {
x = px;
y = py;
z = pz;
}
function clone(other) {
x = other.x;
y = other.y;
z = other.z;
}
static function cloneNew(other) {
return(new Vector(other.x, other.y, other.z));
}
function addSelf(other) {
x = x + other.x;
y = y + other.y;
z = z + other.z;
}
function addNew(other) {
return(new Vector(x + other.x, y + other.y, z + other.z));
}
function subSelf(other) {
x = x - other.x;
y = y - other.y;
z = z - other.z;
}
function subNew(other) {
return(new Vector(x - other.x, y - other.y, z - other.z));
}
function getNegativeSelf(other) {
x = -x;
y = -y;
z = -z;
}
function getNegativeNew(other) {
return(new Vector(-x, -y, -z));
}
function scaleSelf(scalar) {
x = x * scalar;
y = y * scalar;
z = z * scalar;
}
function scaleNew(scalar) {
return(new Vector(x * scalar, y * scalar, z * scalar));
}
function dot(other) {
return(((x * other.x) + (y * other.y)) + (z * other.z));
}
function cross(other) {
var _local3 = new Vector(0, 0, 0);
_local3.x = (y * other.z) - (z * other.y);
_local3.y = (z * other.x) - (x * other.z);
_local3.z = (x * other.y) - (y * other.x);
return(_local3);
}
function getNormal() {
return(Math.sqrt(((x * x) + (y * y)) + (z * z)));
}
function normalize() {
var _local2 = getNormal();
x = x / _local2;
y = y / _local2;
z = z / _local2;
}
function getUnitVector() {
var _local2 = new Vector(x, y, z);
var _local3 = getNormal();
_local2.x = _local2.x / _local3;
_local2.y = _local2.y / _local3;
_local2.z = _local2.z / _local3;
return(_local2);
}
}
Symbol 133 MovieClip [__Packages.Particle] Frame 0
class Particle extends MovieClip
{
var pos, _x, _y, vel, force, mass, fixed;
function Particle () {
super();
pos = new Vector(_x, _y, 0);
vel = new Vector(0, 0, 0);
force = new Vector(0, 0, 0);
mass = 1;
fixed = true;
}
function setPos(other) {
pos.clone(other);
setXY();
}
function setXY() {
_x = pos.x;
_y = pos.y;
}
function update(dt, draw) {
if (fixed == false) {
vel.addSelf(force.scaleNew(dt / mass));
pos.addSelf(vel.scaleNew(dt));
}
force = new Vector(0, 0, 0);
if (draw) {
setXY();
}
}
}
Symbol 134 MovieClip [__Packages.Bounce] Frame 0
class Bounce extends Particle
{
var pos, vel;
function Bounce () {
super();
}
function checkGround() {
if (pos.y > ground) {
pos.y = ground;
vel.y = (-Math.abs(vel.y)) * c;
return(true);
}
return(false);
}
var ground = 355;
var c = 0.7;
}
Symbol 135 MovieClip [__Packages.Generator] Frame 0
class Generator extends MovieClip
{
var numItems, latest, attachMovie, removeMovieClip;
function Generator () {
super();
numItems = 5;
latest = 0;
var _local3 = 0;
while (_local3 < numItems) {
attachMovie("items", "item" + _local3, _local3 + 1, {_x:-200, _y:200});
_local3++;
}
}
function makeItem(x, y, n) {
(removeMovieClip());// not popped
attachMovie("items", "item" + latest, latest + 1, {_x:x, _y:y});
this["item" + latest].gotoAndStop(n);
latest = (latest + 1) % numItems;
}
function makeQuickItem() {
var _local2 = (int(Math.random() * 12) * 2) + 3;
makeItem(700, -100, _local2);
}
function makeQuickIndian() {
makeItem(580, -100, 1);
}
function shiftItems(dx, dy) {
var _local2 = 0;
while (_local2 < numItems) {
if (this["item" + _local2]._x > -300) {
this["item" + _local2]._x = this["item" + _local2]._x + dx;
this["item" + _local2]._y = this["item" + _local2]._y + dy;
}
_local2++;
}
}
function checkCollisions() {
var _local3 = 0;
while (_local3 < numItems) {
var _local4 = this["item" + _local3]._x - _root.computer._x;
if (Math.abs(_local4) < 50) {
return(_local3);
}
_local3++;
}
return(-1);
}
function manageCollisions() {
var _local3 = checkCollisions();
if (_local3 >= 0) {
var _local4 = this["item" + _local3];
var _local5 = _local4._currentframe;
if (_local5 % 2) {
_local4.gotoAndStop(_local5 + 1);
_root.vel = _root.vel + (30 + (20 * Math.random()));
_root.computer.vel.y = (-30 - Math.abs(_root.computer.vel.y)) - (75 * Math.random());
_root.computer.nextvy = _root.computer.vel.y * 0.7;
_root.computer.nextspot = Math.abs((_root.vel * _root.computer.vel.y) / 5);
if ((Math.abs((_root.vel * _root.computer.vel.y) / 5) > 600) && (_root.vel < (-_root.computer.vel.y))) {
_root.indians.makeQuickIndian();
}
_root.cheater.cheat();
}
}
}
function cheatSmart() {
var _local5 = Math.abs((_root.vel * _root.computer.vel.y) / 5);
var _local3 = 0.49;
var _local4 = _local5 / (1 - _local3);
var _local2 = _local4 + _root.computer._x;
if (_local2 < 550) {
_local2 = 550;
}
return(_local2);
}
function cheat() {
if (_global.cheating) {
var _local4 = cheatSmart();
var _local3 = (int(Math.random() * 12) * 2) + 3;
makeItem(_local4, -150, _local3);
}
}
}
Symbol 136 MovieClip [__Packages.ScrollingBG] Frame 0
class ScrollingBG extends MovieClip
{
var speed, bg2, bg1;
function ScrollingBG () {
super();
speed = 0;
}
function scroll(dt) {
if (bg1._x < bg2._x) {
bg1._x = bg1._x - (speed * dt);
if (bg1._x <= -1600) {
bg1._x = bg1._x + 1998;
} else {
bg2._x = 1000 + bg1._x;
}
} else {
bg2._x = bg2._x - (speed * dt);
if (bg2._x <= -1600) {
bg2._x = bg2._x + 1998;
} else {
bg1._x = 1000 + bg2._x;
}
}
}
}
Symbol 137 MovieClip [__Packages.HoboKick] Frame 0
class HoboKick
{
var power, dir, stage, back_leg;
function HoboKick () {
power = 0;
dir = -10;
stage = "setup";
Key.addListener(this);
}
function reset() {
_root.stage = "setup";
_root.vel = 0;
_root.meters = 0;
_root.hobo._x = 210;
_root.computer.pos.x = 275;
_root.computer.pos.y = 280;
_root.computer.setXY();
_root.computer.vel = new Vector(0, 0, 0);
_root.computer.fixed = true;
_root.computer.bouncedyet = false;
_root.computer.nextspot = 0;
_root.computer.gotoAndStop(1);
_root.indians.shiftItems(-700);
_root.generator.shiftItems(-700);
_root.rank = 0;
power = 0;
dir = -10;
stage = "setup";
back_leg._rotation = power - 50;
if (_global.tries == 2) {
_root.indians.makeQuickIndian();
}
}
function onEnterFrame() {
if (stage == "setup") {
power = power + dir;
if (power > 100) {
dir = -10;
power = 100;
}
if (power < 0) {
dir = 10;
power = 0;
}
back_leg._rotation = power - 50;
}
if (stage == "kicking") {
if (back_leg._rotation > -80) {
back_leg._rotation = back_leg._rotation - 30;
} else {
if (_global.tries == 3) {
power = 40;
}
_root.computer.vel = new Vector(0, -power, 0);
_root.vel = power;
_root.computer.nextvy = _root.computer.vel.y * 0.7;
_root.cheater.cheat();
stage = "kicked";
_root.stage = "moving";
}
}
if (stage == "kicked") {
if (_root.hobo._x > -200) {
_root.hobo._x = _root.hobo._x - (_root.vel * _root.dt);
}
}
}
function onKeyDown() {
if (Key.isDown(32) && (stage == "setup")) {
stage = "kicking";
_root.computer.fixed = false;
}
}
}
Symbol 130 MovieClip Frame 1
stop();
addscore = function (myName, myScore) {
i = 0;
while (i < 10) {
if (myScore > scores[i]) {
names.splice(i, 0, myName);
scores.splice(i, 0, myScore);
names.pop();
scores.pop();
myScore = 0;
}
i++;
}
};
update = function () {
scoreboard.text = "";
i = 0;
while (i < 10) {
scoreboard.text = scoreboard.text + newline;
if ((i + 1) < 10) {
scoreboard.text = scoreboard.text + " ";
}
scoreboard.text = scoreboard.text + (((i + 1) + ": ") + names[i]);
L = length(names[i]);
j = 0;
while (j < (8 - L)) {
scoreboard.text = scoreboard.text + " ";
j++;
}
scoreboard.text = scoreboard.text + (" " + scores[i]);
i++;
}
};
if (init == null) {
var myScore = 0;
init = true;
so = SharedObject.getLocal("rrrrthats5rs.com/highscore");
trace("yum");
var names = ["tony", "Sam", "your Mom", "Jazzman9", "i<3BOOBz", "Qville", "voidX", "3z3k131", "maXXX", "c0wb0y"];
var scores = [];
i = 0;
while (i < 10) {
scores[i] = int(Math.random() * 500) + 100;
i++;
}
scores.sort(Array.DESCENDING | Array.NUMERIC);
var newnames = ["dork1337", "hpotter1", "sexman!!", "BALLX!!", "THE BEsT", "solidus", "stankbom", "GoodHead", "QTBabe", "SEXBLING", "flowerZ", "COOLbabe", "Jagger17"];
if ((so.data.names != null) && (so.data.scores != null)) {
names = so.data.names;
scores = so.data.scores;
newguy = newnames[int(Math.random() * newnames.length)];
trace(newguy);
newscore = int(scores[0] * Math.random()) + 100;
addscore(newguy, newscore);
}
update();
}
submit.onRelease = function () {
trace(inputname.text);
trace("crap");
if (inputname != null) {
addscore(inputname.text, int(_root.meters / 30));
so.data.names = names;
so.data.scores = scores;
so.flush();
}
gotoAndStop (2);
};
Symbol 130 MovieClip Frame 2
stop();
loadbar._xscale = 0;
loadbar.addstuff = 10;
loadbar.amount = 1;
Instance of Symbol 126 MovieClip "loadbar" in Symbol 130 MovieClip Frame 2
onClipEvent (enterFrame) {
_xscale = (_xscale + ((3 * amount) * Math.random()));
if (amount) {
if (addstuff < 0) {
amount = 0;
} else {
addstuff = addstuff - Math.random();
}
} else if (addstuff > 20) {
amount = 1;
} else {
addstuff = addstuff + (20 * Math.random());
}
if (_xscale > 100) {
_parent.gotoAndStop(3);
}
}
Symbol 130 MovieClip Frame 3
stop();
trace("butt" + scoreboard.text);
update();