Frame 1
function clockTimer() {
if (timerSec < 10) {
timer_var = (timerMin + " : 0") + timerSec;
} else {
timer_var = (timerMin + " : ") + timerSec;
}
if (timerSec == 0) {
if (timerMin == 0) {
kill();
} else {
timerMin--;
timerSec = 59;
}
} else {
timerSec--;
}
}
function kill() {
times_up.gotoAndPlay(2);
if (!cc_1.the_player_has_engaged) {
gotoAndPlay ("end");
}
cc_1.key_chakra = null;
cc_1.key_marker = null;
cc_1.key_left = null;
cc_1.key_right = null;
clearInterval(timer);
}
intialize_gamePlay = function () {
cc_1.key_chakra = 38;
cc_1.key_marker = 40;
cc_1.key_left = 37;
cc_1.key_right = 39;
timerMin = 5;
timerSec = 0;
timer = setInterval(this, "clockTimer", 1000);
cc_1.int_bar_length = momentum1_mc._width;
};
submitMyScore = function () {
scoreCard.filename = "scores/treeclimber.sco";
scoreCard.scoresize = 10;
scoreCard.action = "WRITE_SCORE_FILE";
scoreCard.viewtype = "FLASH";
scoreCard.winname = winner_name;
scoreCard.winscore = personal_best;
scoreCard.sendAndLoad("scores.php?R=" + random(9999), scoreVars, "POST");
};
scoreVars = new LoadVars();
scoreVars.onLoad = function (success) {
if (success) {
i = 0;
while (i < 10) {
_root["score" + i] = this["SCORE" + i];
_root["name" + i] = this["NAME" + i];
i++;
}
rules_mc.scroll_content_mc.gotoAndStop("top_score");
} else {
error_mess = "This game cannot contact the server at this time";
}
};
scoreCard = new LoadVars();
scoreCard.filename = "scores/treeclimber.sco";
scoreCard.scoresize = 10;
scoreCard.action = "VIEW";
scoreCard.viewtype = "FLASH";
scoreCard.sendAndLoad("scores.php?R=" + random(9999), scoreVars, "POST");
_root.scroll_content = "rules";
rules_txt = "See how well you can focus your Chakra to climb up a tree! \r\rUsing your keyboard, mash the LEFT and RIGHT arrow keys as quickly as possible to climb up the tree. \r\rMark your highest point with the DOWN arrow key. Sasuke will only mark the tree if it is the highest mark, he will not mark the tree if it is lower than the previous mark. \r\rUse your 3 \"Chakra Boosts\" by HOLDING DOWN the UP arrow key to give Sasuke a burst of energy. Use them wisely! \r\rThe game becomes more difficult the higher you get up the tree.";
Instance of Symbol 121 MovieClip in Frame 1
on (release) {
getURL ("academy.php?visit=true");
}
Frame 9
stop();
Frame 17
intialize_gamePlay();
Frame 27
kill();
_root.scroll_content = "try_again";
Frame 55
stop();
Symbol 51 MovieClip Frame 8
_parent.gotoAndStop(1);
Symbol 55 MovieClip Frame 7
stop();
Symbol 68 MovieClip Frame 15
stop();
Symbol 69 MovieClip Frame 1
stop();
Symbol 70 MovieClip Frame 1
function set_a1_0() {
a1 = 0;
clearInterval(reset_a1);
}
function accelerate() {
clearInterval(reset_a1);
if (tree1.ySpeed < maxSpeed) {
if (tree1.ySpeed > 0) {
a1 = a1 + 0.75;
} else {
a1 = a1 + 2;
}
reset_a1 = setInterval(this, "set_a1_0", 100);
}
prevent_strong_fall_momentum();
}
function decelerate() {
if (tree1.ySpeed > maxNegSpeed) {
tree1.ySpeed = tree1.ySpeed - resistance_rate;
}
}
function slowTree() {
this.onEnterFrame = decelerate;
}
function prevent_strong_fall_momentum() {
if (tree1.ySpeed < 0) {
tree1.ySpeed = tree1.ySpeed / 2;
}
}
function naruto_y_pos() {
if (tree1.ySpeed >= 0) {
naruto_y = (naruto_char_mc._y = 400 - int(tree1.ySpeed * 4));
}
}
function chakraBoost() {
if ((Key.isDown(key_chakra) && (chakra_boost_count != 0)) && (!key_active_press)) {
a1 = a1 + chakra_boost_strength;
setProperty(_parent[("chakra1-" + chakra_boost_count) + "_mc"], _visible , false);
chakra_boost_count--;
key_active_press = true;
chakra_audio.start(0, 0);
_parent.chakra_boost_mc.gotoAndPlay(2);
}
}
function chakraSustain() {
if (a1 == 2) {
if (chakra_sustain < chakra_sustain_strength) {
chakra_sustain++;
naruto_move();
naruto_char_mc.chakra_glow_mc._visible = true;
} else {
a1 = 0;
chakra_sustain = 0;
naruto_char_mc.chakra_glow_mc._visible = false;
}
}
}
function slashMarker() {
if (!current_slashMark) {
current_slashMark = 0;
}
if (Key.isDown(key_marker)) {
if (comp_meter > current_slashMark) {
slash_mark_cDistance = tens_meter;
naruto_slash_adjustment = 75;
slash_mark_pos = (naruto_y - tree1._y) - naruto_slash_adjustment;
_parent.meter_length1_mc.gotoAndPlay("mark");
naruto_char_mc.gotoAndStop("mark_tree");
_parent.treemarking_mc.gotoAndPlay(2);
_parent.personal_best = (current_slashMark = comp_meter);
}
}
}
function slashMark_sustain() {
if (slash_mark_cDistance == tens_meter) {
tree1.slash_mark_mc._y = slash_mark_pos;
} else {
tree1.slash_mark_mc._y = -100;
}
}
function topScoreMarker() {
high_comp_meter = _root.score0 / 10;
high_tens_meter = int(high_comp_meter);
high_ones_meter = (high_comp_meter - high_tens_meter) * 10;
highscore_adj_var = 20;
_root.error_mess = (("high_tens_meter = " + high_tens_meter) + " : high_ones_meter = ") + high_ones_meter;
if (high_tens_meter == tens_meter) {
tree1.highscore_mc._y = ((596 - (high_ones_meter * 59.6)) + 298) - highscore_adj_var;
} else if ((high_tens_meter - 1) == tens_meter) {
tree1.highscore_mc._y = (298 - (high_ones_meter * 59.6)) - highscore_adj_var;
} else if ((high_tens_meter + 1) == tens_meter) {
tree1.highscore_mc._y = (894 + (596 - (high_ones_meter * 59.6))) - highscore_adj_var;
} else {
tree1.highscore_mc._y = -100;
}
}
function grounded() {
if (comp_meter < 5) {
tree1.ground_mc._y = 1000;
} else {
tree1.ground_mc._y = 1200;
}
}
function resistance() {
if (comp_meter > 20) {
resistance_rate = comp_meter * 0.01;
} else if (comp_meter > 0) {
resistance_rate = 0.2;
} else {
resistance_rate = 0;
}
}
function reset_fall() {
if (tens_meter < 0) {
tree1.ySpeed = 0;
naruto_char_mc.gotoAndStop("stand");
tree1.reset_clickDistance = false;
} else if (tens_meter >= 0) {
tree1.reset_clickDistance = true;
}
}
function tree_graphic_repeat() {
if (tree1._y > 26) {
tree1.yPos = yStart + (tree1.ySpeed / 2);
tens_meter++;
ones_meter = 0;
} else if (tree1._y < -568) {
if (comp_meter > 0) {
tree1.yPos = tree1.ySpeed / 4;
ones_meter = 0;
tens_meter--;
} else {
tree1.yPos = -569;
tree1.onEnterFrame = null;
tree1.ySpeed = 0;
naruto_char_mc.gotoAndStop("stand");
_parent.gotoAndPlay("end");
}
} else if (tens_meter > -1) {
tree1.yPos = tree1.yPos + tree1.ySpeed;
ones_meter = int((tree1._y + 568) / 59.4);
} else {
tens_meter = 0;
tree1.yPos = yStart;
}
if (tens_meter != -1) {
comp_meter = (tens_meter * 10) + ones_meter;
} else {
comp_meter = 0;
}
if (comp_meter > 0) {
mark_height = comp_meter + " meters";
} else {
mark_height = "";
}
}
function myKeyPress() {
chakraBoost();
slashMarker();
if (!key_active_press) {
if (lastKeyPressed_1 == key_right) {
if (Key.isDown(key_left) && (!Key.isDown(key_right))) {
accelerate();
naruto_move();
lastKeyPressed_1 = key_left;
}
} else if (lastKeyPressed_1 == key_left) {
if (Key.isDown(key_right) && (!Key.isDown(key_left))) {
accelerate();
naruto_move();
lastKeyPressed_1 = key_right;
}
} else if (lastKeyPressed_1 == undefined) {
if (Key.isDown(key_left) && (!Key.isDown(key_right))) {
accelerate();
naruto_move();
lastKeyPressed_1 = key_left;
} else if (Key.isDown(key_right) && (!Key.isDown(key_left))) {
accelerate();
naruto_move();
lastKeyPressed_1 = key_right;
}
}
}
the_player_has_engaged = true;
}
function myKeyRelease() {
slowTree();
a1 = 0;
key_active_press = false;
}
var a1 = 0;
var maxSpeed = 50;
var maxNegSpeed = -50;
var key_active_press = Boolean(true);
var intervalId;
var totalDistance_1 = 0;
var yStart = tree1._y;
var resistance_rate = 0.05;
var mileMarker = 100;
var decelIncrease = 0.01;
var chakra_boost_count = 3;
var chakra_boost_strength = 2;
var chakra_sustain_strength = 30;
var chakra_sustain = 0;
var mark_var_1place = 0;
var tens_meter = 0;
naruto_char_mc.gotoAndStop("stand");
chakra_audio = new Sound(this);
chakra_audio.attachSound("chakra");
place_knife_marker = function () {
if (comp_meter > 3) {
marker_mc.knife_marker_mc.distanceMark = tens_meter;
marker_mc._y = tree1._y + 600;
marker_mc._visible = true;
meter_display_adjust = naruto_y - 700;
} else {
marker_mc._visible = false;
}
if (tree1._y > meter_display_adjust) {
marker_mc.knife_marker_mc.distanceMark = (tens_meter + 1) + "0";
} else {
marker_mc.knife_marker_mc.distanceMark = tens_meter + "0";
}
};
tree1.onEnterFrame = function () {
naruto_y_pos();
slashMark_sustain();
if (tree1.ySpeed < maxSpeed) {
tree1.ySpeed = tree1.ySpeed + a1;
}
tree_graphic_repeat();
topScoreMarker();
resistance();
chakraSustain();
grounded();
reset_fall();
tree1._y = tree1.yPos;
_parent.momentum1_mc.m_bar_mc._width = (int(tree1.ySpeed) * (int_bar_length * 2)) / 100;
place_knife_marker();
if (tree1.ySpeed < -20) {
naruto_char_mc.gotoAndStop("fall");
} else if (tree1.ySpeed < -10) {
naruto_char_mc.gotoAndStop("prefall");
}
};
j = 0;
naruto_move = function () {
if (j < 10) {
j++;
naruto_char_mc.gotoAndStop(j);
} else {
j = 0;
naruto_char_mc.gotoAndStop(1);
}
};
var myListener_1 = new Object();
myListener_1.onKeyDown = myKeyPress;
myListener_1.onKeyUp = myKeyRelease;
Key.addListener(myListener_1);
Instance of Symbol 29 MovieClip "tree1" in Symbol 70 MovieClip Frame 1
onClipEvent (load) {
var ySpeed = 0;
var yPos = this._y;
var checkHeight = 0;
var clickDistance = 1;
var reset_clickDistance = false;
}
Symbol 83 Button
on (release) {
_parent.play();
}
Symbol 88 Button
on (press) {
_root.rules_txt.scroll++;
}
Symbol 89 Button
on (press) {
_root.rules_txt.scroll--;
}
Symbol 91 Button
on (release) {
_parent.play();
}
Symbol 93 Button
on (release) {
gotoAndStop ("top_score");
}
Symbol 98 Button
on (release) {
gotoAndStop ("submit");
_parent._parent.submitMyScore();
}
Symbol 106 MovieClip Frame 1
num_txt = item_num + 1;
score_txt = _root["score" + item_num];
name_txt = _root["name" + item_num];
Symbol 111 MovieClip Frame 1
stop();
gotoAndStop(_root.scroll_content);
Symbol 111 MovieClip Frame 10
if (_root.personal_best > _root.score9) {
gotoAndStop ("winner");
}
Instance of Symbol 106 MovieClip in Symbol 111 MovieClip Frame 27
onClipEvent (load) {
this.item_num = 0;
}
Instance of Symbol 106 MovieClip in Symbol 111 MovieClip Frame 27
onClipEvent (load) {
this.item_num = 1;
}
Instance of Symbol 106 MovieClip in Symbol 111 MovieClip Frame 27
onClipEvent (load) {
this.item_num = 2;
}
Instance of Symbol 106 MovieClip in Symbol 111 MovieClip Frame 27
onClipEvent (load) {
this.item_num = 3;
}
Instance of Symbol 106 MovieClip in Symbol 111 MovieClip Frame 27
onClipEvent (load) {
this.item_num = 4;
}
Instance of Symbol 106 MovieClip in Symbol 111 MovieClip Frame 27
onClipEvent (load) {
this.item_num = 5;
}
Instance of Symbol 106 MovieClip in Symbol 111 MovieClip Frame 27
onClipEvent (load) {
this.item_num = 6;
}
Instance of Symbol 106 MovieClip in Symbol 111 MovieClip Frame 27
onClipEvent (load) {
this.item_num = 7;
}
Instance of Symbol 106 MovieClip in Symbol 111 MovieClip Frame 27
onClipEvent (load) {
this.item_num = 8;
}
Instance of Symbol 106 MovieClip in Symbol 111 MovieClip Frame 27
onClipEvent (load) {
this.item_num = 9;
}
Symbol 114 MovieClip Frame 13
stop();
Symbol 114 MovieClip Frame 26
stop();
if (_root.scroll_content == "try_again") {
_parent.gotoAndPlay("intro");
} else {
_parent.gotoAndStop("game");
}
Symbol 136 MovieClip Frame 1
stop();
Symbol 147 MovieClip Frame 12
stop();
Symbol 148 MovieClip Frame 1
stop();
Symbol 159 MovieClip Frame 1
stop();
Symbol 159 MovieClip Frame 30
stop();
Symbol 168 MovieClip Frame 1
stop();
Symbol 168 MovieClip Frame 2
mark_height = _parent.cc_1.mark_height;
_root.final_mark = mark_height;
_root.final_mark_txt = mark_height + " meters";
Symbol 168 MovieClip Frame 41
stop();