Frame 1
function Sign(n) {
if (0 < n) {
return(1);
}
if (n < 0) {
return(-1);
}
return(0);
}
function fncMove(a, b) {
if (10 < Math.abs(a - b)) {
movelocked = false;
var m1 = ((a - b) / 5);
var m2 = (Sign(a - b) * 5);
return(Math.min(Math.max(Math.abs(m1), Math.abs(m2)), 40) * Sign(a - b));
}
return(0);
}
function objMove(name, code, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, xoffset, yoffset) {
this.name = name;
this.code = code;
this.r1 = r1;
this.r2 = r2;
this.r3 = r3;
this.r4 = r4;
this.r5 = r5;
this.r6 = r6;
this.r7 = r7;
this.r8 = r8;
this.r9 = r9;
this.r10 = r10;
this.r11 = r11;
this.r12 = r12;
this.r13 = r13;
this.xoffset = xoffset;
this.yoffset = yoffset;
}
function objCombo(name, code, front, back, points) {
this.name = name;
this.code = code;
this.front = front;
this.back = back;
this.points = points;
}
function fncAddCombo(name, code, front, back, points) {
combos[combos.length] = new objCombo(name, code, front, back, points);
}
function objLanding(name, code, angle, points) {
this.name = name;
this.code = code;
this.angle = angle;
this.points = points;
}
function fncHitTest(obj) {
var hit = false;
var n = 0;
while (n < hit_sensor_num) {
e = eval ("_root.hit_sensor_" + n);
if (obj.hitTest(e)) {
hit = _root.trampoline._x - e._x;
}
n++;
}
return(hit);
}
function fncTrimQuotes(s) {
var t = s;
if ((t.charAt(0) == "\"") && (t.charAt(t.length - 1) == "\"")) {
t = t.substr(1, t.length - 2);
}
return(t);
}
function fncRestrictChars(s) {
c = "1234567890 ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.,/?*!()-='<>@";
var t = "";
var n = 0;
while (n < s.length) {
if (c.indexOf(s.charAt(n)) >= 0) {
t = t + s.charAt(n);
}
n++;
}
return(t);
}
function fncEncryptScore(sc) {
t = new String("00000000" + sc, 8);
t = t.substr(t.length - 8, 8);
sn = Math.sin(sc);
sns = ("x" + sn) + "0000";
t = t + sns.substr(sns.indexOf(".") + 1, 4);
cs = Math.cos(sc);
css = ("x" + cs) + "0000";
t = t + css.substr(css.indexOf(".") + 1, 4);
return(t);
}
("c" < (b >= undefined)) || (1());
("c" < (b >= undefined)) || (1());
var v = _root.$version;
flashversion = Number(v.substr(v.indexOf(" ") + 1, 1));
comboname = "Trampoline Trickz 2";
_root.man._x = -200;
score = "";
timerdisplay = "";
highscoreoffset = 0;
var n = 1;
while (100 >= n) {
Set("tscore" + n, n);
Set("tname" + n, "\"*** Loading... ***\"");
n++;
}
loadVariablesNum ("_server/tramp_scores_swf.txt?" + Math.random(), 0);
stop();
Frame 2
("c" < (b >= undefined)) || (1());
moves = new Array();
moves[0] = new objMove("Straight", "ST", 0, 0, 0, 0, 0, 0, 0, 0, 0, -30, 0, 0, -30, 0, 10);
moves[1] = new objMove("Tuck", "TK", -45, 40, 90, 0, 45, 90, 0, 150, -120, 10, 140, -115, 10, 20, 50);
moves[2] = new objMove("Pike", "PK", -30, 45, 70, -15, 45, 70, -15, 130, 0, -20, 130, 0, -20, 20, 50);
moves[3] = new objMove("Split", "SP", 0, -35, 110, -10, 50, 55, -15, -90, 0, -60, 90, 0, 10, -10, 15);
moves[4] = new objMove("Cowboy", "CB", -15, 18, 145, 0, 18, 145, 0, 160, -140, 15, 155, -142, 16, 10, 50);
moves[5] = new objMove("Freefall", "FF", 20, 170, 100, 10, 170, 110, 0, -30, -100, 0, -35, -100, 10, -20, 40);
moves[6] = new objMove("FreeStyle", "FS", -15, 95, 10, 10, -75, 10, 0, 125, 0, 0, 127, 0, 0, 20, 50);
moves[7] = new objMove("Popeye", "PO", 35, -85, 50, 0, 95, 50, 0, 35, -5, -10, -70, -75, 10, 20, 50);
combos = new Array();
fncAddCombo("Street Style", "FF.FS.PO", 0, 1, 30);
fncAddCombo("Mad Street Style!", "FF.FS.PO", 0, 2, 50);
fncAddCombo("Crazy Street Style!!", "FF.FS.PO", 0, 3, 90);
fncAddCombo("Punk Style", "PO.FS.FF", 0, 1, 30);
fncAddCombo("Mad Punk Style!", "PO.FS.FF", 0, 2, 50);
fncAddCombo("Crazy Punk Style!!", "PO.FS.FF", 0, 3, 90);
fncAddCombo("Flash", "SP", 0, 1, 5);
fncAddCombo("Double Flash", "SP", 0, 2, 15);
fncAddCombo("Triple Flash", "SP", 0, 3, 15);
fncAddCombo("Back Freefall", "IN", 0, 1, 5);
fncAddCombo("Double Back Freefall", "FF", 0, 2, 15);
fncAddCombo("Triple Back Freefall", "FF", 0, 3, 30);
fncAddCombo("Front Freefall", "FF", 1, 0, 5);
fncAddCombo("Double Front Freefall", "FF", 2, 0, 15);
fncAddCombo("Triple Front Freefall", "FF", 3, 0, 30);
fncAddCombo("Straight Front", "ST", 1, 0, 5);
fncAddCombo("Double Straight Front", "ST", 2, 0, 20);
fncAddCombo("Triple Straight Front", "ST", 3, 0, 45);
fncAddCombo("Straight Back", "ST", 0, 1, 5);
fncAddCombo("Double Straight Back", "ST", 0, 2, 20);
fncAddCombo("Triple Straight Back", "ST", 0, 3, 45);
fncAddCombo("Tuck Front", "TK", 1, 0, 5);
fncAddCombo("Double Tuck Front", "TK", 2, 0, 10);
fncAddCombo("Triple Tuck Front", "TK", 3, 0, 25);
fncAddCombo("Quadruple Tuck Front", "TK", 4, 0, 40);
fncAddCombo("Tuck Back", "TK", 0, 1, 5);
fncAddCombo("Double Tuck Back", "TK", 0, 2, 10);
fncAddCombo("Triple Tuck Back", "TK", 0, 3, 25);
fncAddCombo("Quadruple Tuck Back", "TK", 0, 4, 40);
fncAddCombo("Cowboy", "CB", 1, 0, 4);
fncAddCombo("Cowboy Double", "CB", 2, 0, 8);
fncAddCombo("Cowboy Triple", "CB", 3, 0, 20);
fncAddCombo("Cowboy Quadruple", "CB", 4, 0, 32);
fncAddCombo("Pike Front", "PK", 1, 0, 5);
fncAddCombo("Double Pike Front", "PK", 2, 0, 20);
fncAddCombo("Triple Pike Front", "PK", 3, 0, 35);
fncAddCombo("Quadruple Pike Front", "PK", 4, 0, 50);
fncAddCombo("Pike Back", "PK", 0, 1, 5);
fncAddCombo("Double Pike Back", "PK", 0, 2, 20);
fncAddCombo("Triple Pike Back", "PK", 0, 3, 35);
fncAddCombo("Free Style", "FS", 0, 2, 20);
fncAddCombo("Mad Style!", "FS", 0, 3, 45);
fncAddCombo("Crazy Style!!", "FS", 0, 4, 80);
fncAddCombo("Popeye", "PO", 1, 0, 5);
fncAddCombo("Popeye Reverse", "PO", 0, 1, 10);
fncAddCombo("Front Sommersaut", false, 1, 0, 4);
fncAddCombo("Double Front", false, 2, 0, 8);
fncAddCombo("Triple Front", false, 3, 0, 16);
fncAddCombo("Quadruple Front", false, 4, 0, 32);
fncAddCombo("Quintriple Front!", false, 5, 0, 64);
fncAddCombo("Back Sommersault", false, 0, 1, 4);
fncAddCombo("Double Back", false, 0, 2, 8);
fncAddCombo("Triple Back", false, 0, 3, 16);
fncAddCombo("Quadruple Back", false, 0, 4, 32);
fncAddCombo("Quintriple Back!", false, 0, 5, 64);
fncAddCombo("Reversal", false, 1, 1, 32);
fncAddCombo("Reversal Plus!", false, 2, 1, 32);
fncAddCombo("Gainer Reversal Plus!", false, 1, 2, 32);
landings = new Array();
landings[0] = new objLanding("Straight", "ST", 0, 0);
landings[1] = new objLanding("Front Drop", "ST", -90, 5);
landings[2] = new objLanding("Back Drop", "ST", 90, 5);
landings[3] = new objLanding("Freefall", "FF", -90, 15);
landings[4] = new objLanding("Split leg", "SP", 0, 5);
landings[5] = new objLanding("Seat Drop", "PK", -20, 8);
currentmove = 0;
combo = "";
combohistory = new Array();
x_offset = 0;
y_offset = 0;
x_pos = _root.trampoline._x;
x_vel = 0;
y_pos = 100;
y_vel = 0;
rot_acc = 0;
rot_pos = 0;
rot_startpos = 0;
rot_maxpos = 0;
rot_minpos = 0;
gravity = 0.6;
friction = 0.98;
movename = "";
comboname = "";
combonametime = 0;
timer = 1800;
timerdisplay = 0;
score = 0;
crash = false;
_root.man._alpha = 100;
var depth = 10;
x1 = (_root.trampoline._x - (_root.trampoline._width / 2)) + _root.hit_sensor._width;
x2 = (_root.trampoline._x + (_root.trampoline._width / 2)) - _root.hit_sensor._width;
hit_sensor_num = 0;
var x = x1;
while (x2 >= x) {
duplicateMovieClip (hit_sensor, "hit_sensor_" + hit_sensor_num, depth);
depth++;
e = eval ("hit_sensor_" + hit_sensor_num);
e._x = x + (hit_sensor._width / 2);
e._y = _root.trampoline._y;
hit_sensor_num++;
x = x + _root.hit_sensor._width;
}
pose_button_original.pose.gotoAndStop(1);
var o = (200 + ((moves.length * pose_button_original._height) / 2));
var n = 0;
while (n < moves.length) {
duplicateMovieClip (pose_button_original, "pose_button_" + n, depth);
depth++;
e = eval ("pose_button_" + n);
e._x = 500;
e._y = o - (e._height * n);
e.pose.gotoAndStop(n + 1);
n++;
}
duplicateMovieClip (target_original, "target", depth);
depth++;
Frame 4
("c" < (b >= undefined)) || (1());
if (!crash) {
if (Key.isDown(Key.LEFT)) {
rot_acc = rot_acc - (2.5 * (1 - (Math.abs(rot_acc) / 40)));
}
if (Key.isDown(Key.RIGHT)) {
rot_acc = rot_acc + (2.5 * (1 - (Math.abs(rot_acc) / 40)));
}
if (Key.isDown(Key.UP)) {
if (currentmove < (moves.length - 1)) {
currentmove++;
_root.target.gotoAndStop(1);
_root.soundplayer.gotoAndPlay("click");
}
}
if (Key.isDown(Key.DOWN)) {
if (0 < currentmove) {
currentmove--;
_root.target.gotoAndStop(1);
_root.soundplayer.gotoAndPlay("click");
}
}
}
var movelocked = true;
_root.man.all.head._rotation = _root.man.all.head._rotation + fncMove(moves[currentmove].r1, _root.man.all.head._rotation);
_root.man.all.leftarm._rotation = _root.man.all.leftarm._rotation + fncMove(moves[currentmove].r2, _root.man.all.leftarm._rotation);
_root.man.all.leftarm.forearm._rotation = _root.man.all.leftarm.forearm._rotation + fncMove(moves[currentmove].r3, _root.man.all.leftarm.forearm._rotation);
_root.man.all.leftarm.forearm.hand._rotation = _root.man.all.leftarm.forearm.hand._rotation + fncMove(moves[currentmove].r4, _root.man.all.leftarm.forearm.hand._rotation);
_root.man.all.rightarm._rotation = _root.man.all.rightarm._rotation + fncMove(moves[currentmove].r5, _root.man.all.rightarm._rotation);
_root.man.all.rightarm.forearm._rotation = _root.man.all.rightarm.forearm._rotation + fncMove(moves[currentmove].r6, _root.man.all.rightarm.forearm._rotation);
_root.man.all.rightarm.forearm.hand._rotation = _root.man.all.rightarm.forearm.hand._rotation + fncMove(moves[currentmove].r7, _root.man.all.rightarm.forearm.hand._rotation);
_root.man.all.leftleg._rotation = _root.man.all.leftleg._rotation + fncMove(moves[currentmove].r8, _root.man.all.leftleg._rotation);
_root.man.all.leftleg.shin._rotation = _root.man.all.leftleg.shin._rotation + fncMove(moves[currentmove].r9, _root.man.all.leftleg.shin._rotation);
_root.man.all.leftleg.shin.foot._rotation = _root.man.all.leftleg.shin.foot._rotation + fncMove(moves[currentmove].r10, _root.man.all.leftleg.shin.foot._rotation);
_root.man.all.rightleg._rotation = _root.man.all.rightleg._rotation + fncMove(moves[currentmove].r11, _root.man.all.rightleg._rotation);
_root.man.all.rightleg.shin._rotation = _root.man.all.rightleg.shin._rotation + fncMove(moves[currentmove].r12, _root.man.all.rightleg.shin._rotation);
_root.man.all.rightleg.shin.foot._rotation = _root.man.all.rightleg.shin.foot._rotation + fncMove(moves[currentmove].r13, _root.man.all.rightleg.shin.foot._rotation);
_root.man.all._x = _root.man.all._x + fncMove(moves[currentmove].xoffset, _root.man.all._x);
_root.man.all._y = _root.man.all._y + fncMove(moves[currentmove].yoffset, _root.man.all._y);
if (movelocked && (combo.substr(combo.length - 2, 2) != moves[currentmove].code)) {
combo = combo + ("." + moves[currentmove].code);
_root.target.gotoAndPlay(2);
}
i1 = Math.abs(Math.sin(((((_root.man.all.leftarm._rotation + _root.man.all.rightarm._rotation) / 2) + 180) / 180) * 1.57));
i2 = Math.abs(Math.sin(((((_root.man.all.leftarm.forearm._rotation + _root.man.all.rightarm.forearm._rotation) / 2) + 10) / 180) * 1.57));
i3 = Math.abs(Math.sin(((((_root.man.all.leftleg._rotation + _root.man.all.rightleg._rotation) / 2) + 10) / 180) * 1.57));
i4 = Math.abs(Math.sin(((((_root.man.all.leftleg.shin._rotation + _root.man.all.rightleg.shin._rotation) / 2) + 350) / 180) * 1.57));
var inertia = ((((((i1 + i2) + i3) + i4) / 4) + 7) / 8);
rot_pos = rot_pos + rot_acc;
rot_acc = (rot_acc * inertia) * friction;
rot_maxpos = Math.max(rot_pos, rot_maxpos);
rot_minpos = Math.min(rot_pos, rot_minpos);
x_pos = x_pos + x_vel;
x_vel = x_vel * 0.99;
y_pos = y_pos + y_vel;
y_vel = y_vel + gravity;
var hit = false;
var headbanger = false;
if (!hit) {
hit = fncHitTest(_root.man.all.leftarm.forearm.hand);
}
if (!hit) {
hit = fncHitTest(_root.man.all.rightarm.forearm.hand);
}
if (!hit) {
hit = fncHitTest(_root.man.all.leftleg.shin.foot);
}
if (!hit) {
hit = fncHitTest(_root.man.all.rightleg.shin.foot);
}
if (!hit) {
hit = fncHitTest(_root.man.all.leftarm.forearm);
}
if (!hit) {
hit = fncHitTest(_root.man.all.rightarm.forearm);
}
if (!hit) {
hit = fncHitTest(_root.man.all.leftleg.shin);
}
if (!hit) {
hit = fncHitTest(_root.man.all.rightleg.shin);
}
if (!hit) {
hit = fncHitTest(_root.man.all.leftarm);
}
if (!hit) {
hit = fncHitTest(_root.man.all.rightarm);
}
if (!hit) {
hit = fncHitTest(_root.man.all.leftleg);
}
if (!hit) {
hit = fncHitTest(_root.man.all.rightleg);
}
if (!hit) {
hit = fncHitTest(_root.man.all.head);
if (hit) {
headbanger = true;
}
}
if ((0 < y_vel) && (hit)) {
if (movelocked) {
var l = combo.substr(combo.length - 2, 2);
} else {
var l = "";
}
if (3 < combo.length) {
combo = combo.substr(1, combo.length - 4);
} else {
combo = combo.substr(combo.length - 2, 2);
}
var t = combo.substr(0, 3);
combo = combo.substr(3, combo.length - 3);
if ((combo == "") && (l != t)) {
combo = l;
t = t + ".";
}
var f = Math.floor(Math.max((rot_startpos - rot_minpos) / 360, 0) + 0.2);
var b = Math.floor(Math.max((rot_maxpos - rot_startpos) / 360, 0) + 0.2);
var a = (((int(rot_pos) % 360) + 360) % 360);
if (headbanger) {
comboname = "Doh! Head Banger -10 Points !!";
combonametime = 30;
if (((f >= 3) || (b >= 3)) && (0.8 < Math.random())) {
_root.soundplayer.gotoAndPlay("brain");
} else {
_root.soundplayer.gotoAndPlay("doh");
}
crash = true;
score = score - 10;
} else {
var n = 0;
while (n < combos.length) {
if (((((((combos[n].code == combo) || (combos[n].code == (t + combo))) || (combos[n].code == ((combo + ".") + l))) || (combos[n].code == (((t + combo) + ".") + l))) || (combos[n].code == false)) && (combos[n].front == f)) && (combos[n].back == b)) {
comboname = combos[n].name;
if (!combohistory[n]) {
combohistory[n] = combos[n].points;
} else {
combohistory[n] = int((combohistory[n] / 2) + 0.5);
}
var p = combohistory[n];
var o = 0;
while (o < landings.length) {
if ((landings[o].code == l) && ((Math.abs(landings[o].angle - a) < 30) || (Math.abs(landings[o].angle - (a - 360)) < 30))) {
if (0 < landings[o].points) {
p = p + landings[o].points;
comboname = comboname + ((" (" + landings[o].name) + " Landing)");
}
break;
}
o++;
}
if (50 < p) {
_root.soundplayer.gotoAndPlay("woohoo");
}
score = score + p;
comboname = comboname + ((" " + p) + " Points!");
combonametime = 35;
break;
}
n++;
}
}
combo = "";
x_vel = x_vel + (hit / 20);
if (y_pos < (_root.trampoline._y - 20)) {
x_vel = x_vel + ((hit - (_root.trampoline._x - x_pos)) / 15);
rot_acc = rot_acc + ((hit - (_root.trampoline._x - x_pos)) * 0.6);
}
y_vel = Math.max(-Math.abs(y_vel), -16.5);
rot_pos = rot_pos % 360;
rot_startpos = rot_pos;
rot_maxpos = rot_pos;
rot_minpos = rot_pos;
if (hit < ((-_root.trampoline._width) / 6)) {
_root.trampoline.gotoAndPlay(18);
} else if ((_root.trampoline._width / 6) < hit) {
_root.trampoline.gotoAndPlay(10);
} else {
_root.trampoline.gotoAndPlay(2);
}
}
_root.man._x = x_pos;
_root.man._y = y_pos;
_root.man._rotation = rot_pos;
movename = moves[currentmove].name;
e = eval ("pose_button_" + currentmove);
_root.target._x = e._x;
_root.target._y = e._y;
if (0 < combonametime) {
if (combonametime == 1) {
comboname = "";
crash = false;
}
combonametime--;
}
timer = timer - 1;
timerdisplay = int(timer / 18);
if (timer >= 0) {
prevFrame();
play();
} else if ((parseInt(tscore100) < score) || (!tscore100)) {
gotoAndPlay (6);
} else {
gotoAndPlay (5);
}
if (y_pos >= 400) {
if ((parseInt(tscore100) < score) || (!tscore100)) {
gotoAndPlay (8);
} else {
message = "";
var f = Math.floor(Math.max((rot_startpos - rot_minpos) / 360, 0) + 0.2);
var b = Math.floor(Math.max((rot_maxpos - rot_startpos) / 360, 0) + 0.2);
if ((f >= 4) || (b >= 4)) {
message = "That was one hell of a dismount though...";
} else if ((f >= 3) || (b >= 3)) {
message = "Nice dismount...";
}
gotoAndPlay (7);
}
}
Frame 5
("c" < (b >= undefined)) || (1());
comboname = "";
score = "";
timerdisplay = "";
_root.man._alpha = 25;
stop();
Frame 6
("c" < (b >= undefined)) || (1());
comboname = "";
timerdisplay = "";
_root.man._alpha = 25;
stop();
Frame 7
("c" < (b >= undefined)) || (1());
comboname = "";
score = "";
timerdisplay = "";
_root.man._alpha = 25;
stop();
Frame 8
("c" < (b >= undefined)) || (1());
comboname = "";
timerdisplay = "";
_root.man._alpha = 25;
stop();
Symbol 28 MovieClip Frame 1
stop();
Symbol 28 MovieClip Frame 6
gotoAndStop (1);
Symbol 42 MovieClip Frame 1
stop();
Symbol 42 MovieClip Frame 9
gotoAndStop (1);
Symbol 42 MovieClip Frame 17
gotoAndStop (1);
Symbol 42 MovieClip Frame 25
gotoAndStop (1);
Symbol 49 MovieClip Frame 1
stop();
Symbol 49 MovieClip Frame 14
stop();
Symbol 49 MovieClip Frame 37
stop();
Symbol 49 MovieClip Frame 42
stop();
Symbol 49 MovieClip Frame 89
stop();
Symbol 56 Button
on (release) {
var s = this._name;
_root.currentmove = parseInt(s.substr(12, s.length - 12));
}
Symbol 71 Button
on (release) {
if (_root.flashversion >= 5) {
_root.gotoAndPlay(2);
}
}
Symbol 76 Button
on (release) {
_root.page.gotoAndStop(1);
}
Symbol 81 Button
on (release) {
_root.highscoreoffset = 0;
_root.page.gotoAndStop(2);
}
Symbol 89 Button
on (release) {
_root.highscoreoffset = (_root.highscoreoffset + 1) % 10;
fncUpdateHighscores();
}
Symbol 92 Button
on (release) {
_root.highscoreoffset = _root.highscoreoffset - 1;
if (_root.highscoreoffset < 0) {
_root.highscoreoffset = 9;
}
fncUpdateHighscores();
}
Symbol 93 MovieClip Frame 1
stop();
Symbol 93 MovieClip Frame 2
function fncUpdateHighscores() {
var n = "\r";
highranks = "";
highnames = "";
highscores = "";
i = 1;
while (10 >= i) {
r = i + (_root.highscoreoffset * 10);
highranks = (highranks + r) + n;
highnames = (highnames + _root.fncTrimQuotes(eval ("_root.tname" + r))) + n;
highscores = (highscores + eval ("_root.tscore" + r)) + n;
i++;
}
}
("c" < (b >= undefined)) || (1());
fncUpdateHighscores();
stop();
Symbol 98 Button
on (release) {
loadVariablesNum ("trampoline_get.asp?" + now.getTime(), 0);
_root.gotoAndPlay(1);
}
Symbol 104 Button
on (release) {
loadVariablesNum ((("tramp_set.asp?tscore=" + fncEncryptScore(score)) + "&tname=") + fncRestrictChars(tname), 0);
loadVariablesNum ("_server/tramp_scores_swf.txt?" + Math.random(), 0);
_root.gotoAndPlay(1);
}
Symbol 111 Button
on (release) {
loadVariablesNum ("_server/tramp_scores_swf.txt?" + Math.random(), 0);
_root.gotoAndPlay(1);
}