Frame 2
stop();
Instance of Symbol 337 MovieClip in Frame 2
onClipEvent (load) {
xin_motion_val = "Toward";
xin_alphatype_val = "No";
xout_motion_val = "None";
xout_alphatype_val = "No";
perc_req_val = 100;
show_perc_val = "Yes";
slow_factor_val = 0.2;
init_action_val = "_root.stop();";
play_action_val = "_root.play();";
}
Frame 4
stop();
Frame 5
stop();
Instance of Symbol 316 MovieClip [SnowboardingGame] in Frame 5
onClipEvent (load) {
quiz_data_file = "Quiz.txt";
game_type = "No Quiz";
new_question_delay = 70;
question_pause = 30;
num_used_questions = 10;
answer_spacing = 400;
answer_speed_factor = 2;
correct_answer_points = 20;
wrong_answer_points = -5;
trees_linkage = [];
trees_linkage[0] = "tree0";
trees_linkage[1] = "tree1";
trees_linkage[2] = "tree2";
trees_linkage[3] = "tree3";
trees_linkage[4] = "tree4";
obstacles_linkage = [];
obstacles_linkage[0] = "obstacle0";
obstacles_linkage[1] = "obstacle1";
obstacles_linkage[2] = "obstacle2";
obstacles_linkage[3] = "obstacle3";
obstacles_linkage[4] = "obstacle4";
obstacles_linkage[5] = "obstacle5";
obstacles_linkage[6] = "obstacle6";
obstacles_linkage[7] = "obstacle7";
obstacles_linkage[8] = "obstacle8";
obstacles_linkage[9] = "obstacle9";
obstacles_linkage[10] = "obstacle10";
obstacles_linkage[11] = "obstacle11";
new_obstacle_frame_delay = 40;
num_new_obstacles = 2;
stage_width = 650;
stage_height = 450;
min_speed = 7;
max_speed = 15;
snowboarder_accuracy = 15;
tree_spacing = 150;
left_tree_x = 40;
right_tree_x = 610;
up_tree_y = 40;
down_tree_y = 410;
time_bonus_start = 10000;
num_fall_game_over = 5;
correct_answer_sound = "correct_sound";
wipe_out_sound = "wipe_out_sound";
direction = "Down to Up";
num_points_next_level = 200;
next_level_speed_increase = 1;
win_level = 10;
}
Frame 6
stop();
Frame 7
stop();
Symbol 44 MovieClip Frame 41
stop();
Symbol 76 MovieClip Frame 44
_parent.gotoAndStop("Straight");
Symbol 118 MovieClip Frame 74
_parent.gotoAndStop("Straight");
Symbol 137 MovieClip Frame 35
_parent.gotoAndStop("Straight");
Symbol 163 MovieClip Frame 46
_parent.gotoAndStop("Straight");
Symbol 208 MovieClip Frame 71
_parent.gotoAndStop("Straight");
Symbol 232 MovieClip Frame 15
_parent.gotoAndStop("Flying");
Symbol 245 MovieClip Frame 12
_parent.gotoAndStop("Flying");
Symbol 262 MovieClip Frame 19
_parent.gotoAndStop("Flying");
Symbol 263 MovieClip Frame 1
stop();
Symbol 267 MovieClip Frame 1
stop();
Symbol 274 MovieClip Frame 1
stop();
Symbol 275 MovieClip Frame 1
play();
Symbol 275 MovieClip Frame 62
var game = _parent._parent.game;
if (this.trick_player._currentframe != 1) {
bad_sounds.gotoAndStop(Math.randi(0, bad_sounds._totalframes - 1) + 2);
var _mc = _parent._parent.points_prompt;
var messages = ["What the?!", "How does the snow taste?", "What a loser...", "I wouldn't let you walk on the streets"];
_mc.play();
_mc.message = messages.rande();
_mc.points = "";
game.mode = game.mode ^ SNOWBOARDING_PLAYING;
game.mode = game.mode | (SNOWBOARDING_WIPED_OUT | SNOWBOARDING_OBSTACLE);
_parent._parent.snowboarder.gotoAndStop("Jumping Wipe Out");
game.wipe_out();
} else {
if (0.5 < Math.random()) {
game.play_sound("landing_sound");
} else {
good_sounds.gotoAndStop(Math.randi(0, good_sounds._totalframes - 1) + 2);
}
if ((game.jump_score / 10) >= 2) {
game.play_sound("trick_powerup");
}
game.num_successive_jumps++;
game.score = game.score + (game.jump_score * game.num_successive_jumps);
game.check_score = game.check_score + (game.jump_score * game.num_successive_jumps);
var _mc = _parent._parent.points_prompt;
var messages = ["Sweet!", "Nice one!", "Wowsers!", "You were flying!"];
_mc.play();
_mc.message = messages.rande();
_mc.points = ((game.jump_score + " X ") + game.num_successive_jumps) + " Points!";
}
game.jump_score = 0;
_parent.gotoAndStop("Straight");
Symbol 295 MovieClip Frame 1
play();
Symbol 295 MovieClip Frame 24
stop();
Symbol 296 MovieClip [snowboarder] Frame 1
stop();
Symbol 301 Button
on (release) {
_parent.game.mode = _parent.game.old_mode;
this.removeMovieClip();
}
Symbol 303 MovieClip [next_level_prompt] Frame 17
stop();
Symbol 308 MovieClip Frame 1
stop();
Symbol 308 MovieClip Frame 50
gotoAndStop (1);
Symbol 316 MovieClip [SnowboardingGame] Frame 1
Key.A = 65;
Key.B = 66;
Key.C = 67;
Key.D = 68;
Key.E = 69;
Key.F = 70;
Key.G = 71;
Key.H = 72;
Key.I = 73;
Key.J = 74;
Key.K = 75;
Key.L = 76;
Key.M = 77;
Key.N = 78;
Key.O = 79;
Key.P = 80;
Key.Q = 81;
Key.R = 82;
Key.S = 83;
Key.T = 84;
Key.U = 85;
Key.V = 86;
Key.W = 87;
Key.X = 88;
Key.Y = 89;
Key.Z = 90;
Key.ZERO = 48;
Key.ONE = 49;
Key.TWO = 50;
Key.THREE = 51;
Key.FOUR = 52;
Key.FIVE = 53;
Key.SIX = 54;
Key.SEVEN = 55;
Key.EIGHT = 56;
Key.NINE = 57;
Key.NUMPAD_ZERO = 96;
Key.NUMPAD_ONE = 97;
Key.NUMPAD_TWO = 98;
Key.NUMPAD_THREE = 99;
Key.NUMPAD_FOUR = 100;
Key.NUMPAD_FIVE = 101;
Key.NUMPAD_SIX = 102;
Key.NUMPAD_SEVEN = 103;
Key.NUMPAD_EIGHT = 104;
Key.NUMPAD_NINE = 105;
Key.MULTIPLY = 106;
Key.ADD = 107;
Key.SUBTRACT = 109;
Key.DECIMAL = 110;
Key.DIVIDE = 111;
Key.F1 = 112;
Key.F2 = 113;
Key.F3 = 114;
Key.F4 = 115;
Key.F5 = 116;
Key.F6 = 117;
Key.F7 = 118;
Key.F8 = 119;
Key.F9 = 120;
Key.F10 = 121;
Key.F11 = 122;
Key.F12 = 123;
Key.CLEAR = 12;
Key.PAGEUP = 33;
Key.PAGEDOWN = 34;
Key.HELP = 47;
Key.NUMLOCK = 144;
Key.SEMICOLON = 186;
Key.EQUAL = 187;
Key.MINUS = 189;
Key.SLASH = 191;
Key.GRAVE = 192;
Key.OPENBRACKET = 219;
Key.BACKSLASH = 220;
Key.CLOSEBRACKET = 221;
Key.QUOTE = 222;
Math.randi = function (a, b) {
return(Math.floor(Math.random() * (b - a)) + a);
};
Math.randf = function (a, b) {
return((Math.random() * (b - a)) + a);
};
Sound.playSound = function (linkage) {
var _sound = new Sound();
_sound.attachSound(linkage);
_sound.start(0, 1);
};
Array.prototype.swap = function (a, b) {
var temp = this[a];
this[a] = this[b];
this[b] = temp;
};
Array.prototype.shuffle = function () {
var j = 0;
while (j < this.length) {
var a = Math.randi(0, this.length);
var b = Math.randi(0, this.length);
this.swap(a, b);
j++;
}
};
Array.prototype.rande = function () {
return(this[Math.randi(0, this.length)]);
};
Array.prototype.remove_element = function (e) {
var j = 0;
while (j < this.length) {
if (this[j] == e) {
this.splice(j, 1);
return(undefined);
}
j++;
}
};
Object.prototype.SNOWBOARDING_NULL = 0;
Object.prototype.SNOWBOARDING_LOADING_VARS = 2;
Object.prototype.SNOWBOARDING_PLAYING = 4;
Object.prototype.SNOWBOARDING_PAUSED = 8;
Object.prototype.SNOWBOARDING_WIPED_OUT = 16;
Object.prototype.SNOWBOARDING_TREE = 32;
Object.prototype.SNOWBOARDING_OBSTACLE = 64;
Object.prototype.SNOWBOARDING_QUIZ_OUT = 128;
Object.prototype.SNOWBOARDING_PAUSED = 256;
_root._quality = "MEDIUM";
SnowboardingGame = function () {
this.initialize();
};
SnowboardingGame.prototype.quiz_data_file = quiz_data_file;
SnowboardingGame.prototype.new_question_delay = Number(new_question_delay);
SnowboardingGame.prototype.num_used_questions = Number(num_used_questions);
SnowboardingGame.prototype.question_pause = Number(question_pause);
SnowboardingGame.prototype.answer_spacing = Number(answer_spacing);
SnowboardingGame.prototype.answer_speed_factor = Number(answer_speed_factor);
SnowboardingGame.prototype.correct_answer_points = Number(correct_answer_points);
SnowboardingGame.prototype.wrong_answer_points = Number(wrong_answer_points);
SnowboardingGame.prototype.trees_linkage = trees_linkage;
SnowboardingGame.prototype.obstacles_linkage = obstacles_linkage;
SnowboardingGame.prototype.new_obstacle_frame_delay = Number(new_obstacle_frame_delay);
SnowboardingGame.prototype.num_new_obstacles = Number(num_new_obstacles);
SnowboardingGame.prototype.stage_width = Number(stage_width);
SnowboardingGame.prototype.stage_height = Number(stage_height);
SnowboardingGame.prototype.min_speed = Number(min_speed);
SnowboardingGame.prototype.max_speed = Number(max_speed);
SnowboardingGame.prototype.snowboarder_accuracy = Number(snowboarder_accuracy);
SnowboardingGame.prototype.tree_spacing = Number(tree_spacing);
SnowboardingGame.prototype.left_tree_x = Number(left_tree_x);
SnowboardingGame.prototype.right_tree_x = Number(right_tree_x);
SnowboardingGame.prototype.up_tree_y = Number(up_tree_y);
SnowboardingGame.prototype.down_tree_y = Number(down_tree_y);
SnowboardingGame.prototype.time_bonus_start = Number(time_bonus_start);
SnowboardingGame.prototype.num_fall_game_over = Number(num_fall_game_over);
SnowboardingGame.prototype.correct_answer_sound = correct_answer_sound;
SnowboardingGame.prototype.wipe_out_sound = wipe_out_sound;
SnowboardingGame.prototype.direction = direction;
SnowboardingGame.prototype.num_points_next_level = Number(num_points_next_level);
SnowboardingGame.prototype.next_level_speed_increase = Number(next_level_speed_increase);
SnowboardingGame.prototype.win_level = Number(win_level);
SnowboardingGame.prototype.game_type = game_type;
SnowboardingGame.prototype.timeline = this;
delete quiz_data_file;
delete new_question_delay;
delete num_used_questions;
delete question_pause;
delete answer_spacing;
delete answer_speed_factor;
delete correct_answer_points;
delete wrong_answer_points;
delete trees_linkage;
delete obstacles_linkage;
delete new_obstacle_frame_delay;
delete num_new_obstacles;
delete stage_width;
delete stage_height;
delete min_speed;
delete max_speed;
delete snowboarder_accuracy;
delete tree_spacing;
delete left_tree_x;
delete right_tree_x;
delete time_bonus_start;
delete num_fall_game_over;
delete correct_answer_sound;
delete wipe_out_sound;
delete direction;
SnowboardingGame.prototype.initialize = function () {
this.initialize_variables();
this.initialize_graphics();
};
SnowboardingGame.prototype.initialize_variables = function () {
this.depth = 0;
this.obstacles = new Array();
this.trees = new Array();
this.question_choices = new Array();
this.time_bonus = this.time_bonus_start;
this.score = 0;
this.mode = SNOWBOARDING_NULL;
this.straight_angle = 0.628318530717959;
this.snowboarder_speed = 0;
this.snowboarder_distance = 0;
this.current_frame = 0;
this.tree_side = 1;
this.quiz_start_frame = 0;
this.quiz_exit_frame = 0;
this.num_wipe_outs = 0;
if (this.game_type == "Quiz") {
this.timeline.controller.loadVariables(this.quiz_data_file);
} else {
this.new_question_delay = Number.MAX_VALUE;
this.mode = SNOWBOARDING_PLAYING;
}
};
SnowboardingGame.prototype.initialize_graphics = function () {
this.create_snowboarder_graphic();
this.create_question_graphic();
};
SnowboardingGame.prototype.create_snowboarder_graphic = function () {
this.timeline.attachMovie("snowboarder", "snowboarder", 50000);
if (this.direction == "Up to Down") {
this.timeline.snowboarder._x = this.stage_width / 2;
this.timeline.snowboarder._y = this.stage_height;
} else if (this.direction == "Down to Up") {
this.timeline.snowboarder._x = this.stage_width / 2;
this.timeline.snowboarder._y = 0;
} else if (this.direction == "Left to Right") {
this.timeline.snowboarder._x = this.stage_width;
this.timeline.snowboarder._y = this.stage_height / 2;
} else if (this.direction == "Right to Left") {
this.timeline.snowboarder._x = 0;
this.timeline.snowboarder._y = this.stage_height / 2;
}
};
SnowboardingGame.prototype.create_question_graphic = function () {
this.timeline.attachMovie("question_animation", "question_animation", 20000);
this.timeline.question_animation._x = this.stage_width / 2;
this.timeline.question_animation._y = this.stage_height;
};
SnowboardingGame.prototype.action = function () {
if (!(this.mode & SNOWBOARDING_PAUSED)) {
this.check_for_quiz();
this.check_add_objects();
this.apply_snowboarder_physics();
this.animate_game_objects();
this.update_variables();
}
this.timeline.info.player_score = this.score;
this.timeline.info.lives = this.num_fall_game_over - this.num_wipe_outs;
};
SnowboardingGame.prototype.check_for_quiz = function () {
if (!(this.mode & SNOWBOARDING_QUIZ_OUT)) {
if ((this.current_frame - this.quiz_exit_frame) >= this.new_question_delay) {
this.mode = this.mode | SNOWBOARDING_QUIZ_OUT;
this.quiz_start_frame = this.current_frame;
var question = this.quiz_questions.pop();
this.timeline.question_animation.question_mc.field = question.question;
this.timeline.question_animation.play();
if ((this.direction == "Up to Down") || (this.direction == "Down to Up")) {
var spacing = ((this.right_tree_x - this.left_tree_x) / (question.choices.length + 1));
} else {
var spacing = ((this.down_tree_y - this.up_tree_y) / (question.choices.length + 1));
}
spacing = spacing - 20;
var indices_x = new Array();
var indices_y = new Array();
var k = 0;
while (k < this.num_choices) {
indices_x[k] = k;
indices_y[k] = k;
k++;
}
indices_x.shuffle();
indices_y.shuffle();
var j = 0;
while (j < this.num_choices) {
this.timeline.attachMovie("answer_textfield", "answer" + j, 100000 + (this.depth++));
var _mc = this.timeline["answer" + j];
_mc.field = question.choices[j];
if (this.direction == "Up to Down") {
_mc._x = (((indices_x[j] + 0.5) * spacing) + this.left_tree_x) + 100;
_mc._y = (-this.answer_spacing) * (indices_y[j] + 1);
} else if (this.direction == "Down to Up") {
_mc._x = (((indices_x[j] + 0.5) * spacing) + this.left_tree_x) + 100;
_mc._y = this.stage_height + (this.answer_spacing * (indices_y[j] + 1));
} else if (this.direction == "Left to Right") {
_mc._x = (-this.answer_spacing) * (indices_x[j] + 1);
_mc._y = (((indices_y[j] + 0.5) * spacing) + this.up_tree_y) + 100;
} else if (this.direction == "Right to Left") {
_mc._x = this.stage_width + (this.answer_spacing * (indices_x[j] + 1));
_mc._y = (((indices_y[j] + 0.5) * spacing) + this.up_tree_y) + 100;
}
_mc.correct_answer = j == question.answer;
this.question_choices.push(_mc);
j++;
}
}
}
};
SnowboardingGame.prototype.check_add_objects = function () {
this.check_add_obstacle();
this.check_add_tree();
};
SnowboardingGame.prototype.check_add_obstacle = function () {
if (this.mode & SNOWBOARDING_WIPED_OUT) {
return(undefined);
}
if ((this.current_frame % this.new_obstacle_frame_delay) == 0) {
if (Math.random() < 0.3) {
this.depth++;
var rand = Math.random();
var linkages = ["rough_patch", "outhouse", "snow_pile", "hanging_laundry", "animal_tree", "animal_tree", "jump0", "jump1", "jump0", "jump1", "jump0", "jump1"];
var rand_link = linkages.rande();
if (this.timeline[rand_link] != undefined) {
return(undefined);
}
this.timeline.attachMovie(rand_link, rand_link, this.depth);
var _mc = this.timeline[rand_link];
this.depth++;
if (this.direction == "Up to Down") {
_mc._x = this.stage_width / 2;
_mc._y = (-_mc._height) / 2;
} else if (this.direction == "Down to Up") {
_mc._x = this.stage_width / 2;
_mc._y = this.stage_height + (_mc._height / 2);
} else if (this.direction == "Left to Right") {
_mc._x = (-_mc._width) / 2;
_mc._y = this.stage_height / 2;
} else if (this.direction == "Right to Left") {
_mc._x = this.stage_width + (_mc._width / 2);
_mc._y = this.stage_height / 2;
}
this.obstacles.push(_mc);
return(undefined);
}
var num_obstacles = Math.randi(1, this.num_new_obstacles + 1);
var j = 0;
while (j < num_obstacles) {
var linkage = this.obstacles_linkage.rande();
this.depth++;
this.timeline.attachMovie(linkage, "obstacle" + this.depth, this.depth);
var _mc = this.timeline["obstacle" + this.depth];
this.depth++;
if (this.direction == "Up to Down") {
_mc._x = Math.randf(this.left_tree_x + (_mc._width / 2), this.right_tree_x - (_mc._width / 2));
_mc._y = (-_mc._height) / 2;
} else if (this.direction == "Down to Up") {
_mc._x = Math.randf(this.left_tree_x + (_mc._width / 2), this.right_tree_x - (_mc._width / 2));
_mc._y = this.stage_height + (_mc._height / 2);
} else if (this.direction == "Left to Right") {
_mc._x = (-_mc._width) / 2;
_mc._y = Math.randf(this.up_tree_y + (_mc._height / 2), this.down_tree_y - (_mc._height / 2));
} else if (this.direction == "Right to Left") {
_mc._x = this.stage_width + (_mc._width / 2);
_mc._y = Math.randf(this.up_tree_y + (_mc._height / 2), this.down_tree_y - (_mc._height / 2));
}
this.obstacles.push(_mc);
j++;
}
}
};
SnowboardingGame.prototype.check_add_tree = function () {
if ((this.snowboarder_distance - this.last_distance) >= this.tree_spacing) {
var linkage = this.trees_linkage.rande();
this.depth++;
this.timeline.attachMovie(linkage, "tree" + this.depth, this.depth);
var _mc = this.timeline["tree" + this.depth];
this.depth++;
if (this.direction == "Up to Down") {
if (this.tree_side == 1) {
_mc._x = this.left_tree_x;
} else {
_mc._x = this.right_tree_x;
}
_mc._y = (-_mc._height) / 2;
} else if (this.direction == "Down to Up") {
if (this.tree_side == 1) {
_mc._x = this.left_tree_x;
} else {
_mc._x = this.right_tree_x;
}
_mc._y = this.stage_height + (_mc._height / 2);
} else if (this.direction == "Left to Right") {
_mc._x = (-_mc._width) / 2;
if (this.tree_side == 1) {
_mc._y = this.up_tree_y;
} else {
_mc._y = this.down_tree_y;
}
} else if (this.direction == "Right to Left") {
_mc._x = this.stage_width + (_mc._width / 2);
if (this.tree_side == 1) {
_mc._y = this.up_tree_y;
} else {
_mc._y = this.down_tree_y;
}
}
this.trees.push(_mc);
this.last_distance = this.snowboarder_distance;
this.tree_side = this.tree_side * -1;
}
};
SnowboardingGame.prototype.apply_snowboarder_physics = function () {
if (this.direction == "Up to Down") {
this.snowboarder_acceleration = ((this.timeline.snowboarder._y + (this.timeline.snowboarder._height / 2)) - _root._ymouse) / 50;
} else if (this.direction == "Down to Up") {
this.snowboarder_acceleration = ((this.timeline.snowboarder._y - (this.timeline.snowboarder._height / 2)) - _root._ymouse) / 50;
this.snowboarder_acceleration = this.snowboarder_acceleration * -1;
} else if (this.direction == "Left to Right") {
} else if (this.direction == "Right to Left") {
}
if (this.mode & SNOWBOARDING_PLAYING) {
this.snowboarder_speed = this.snowboarder_speed + this.snowboarder_acceleration;
if (this.max_speed < this.snowboarder_speed) {
this.snowboarder_speed = this.max_speed;
} else if (this.snowboarder_speed < this.min_speed) {
this.snowboarder_speed = this.min_speed;
}
} else if (this.mode & SNOWBOARDING_WIPED_OUT) {
if (this.timeline.snowboarder._currentframe != 9) {
this.snowboarder_speed = this.snowboarder_speed - (this.snowboarder_speed / 20);
}
this.timeline.snowboarder._rotation = 0;
if ((Math.abs(this.snowboarder_speed) < 0.5) || ((this.timeline.snowboarder._currentframe == 9) && (this.timeline.snowboarder._mc._currentframe >= (this.timeline.snowboarder._mc._totalframes - 1)))) {
this.mode = this.mode ^ SNOWBOARDING_WIPED_OUT;
this.mode = this.mode | SNOWBOARDING_PLAYING;
if (this.mode & SNOWBOARDING_TREE) {
this.mode = this.mode ^ SNOWBOARDING_TREE;
}
if (this.mode & SNOWBOARDING_OBSTACLE) {
this.mode = this.mode ^ SNOWBOARDING_OBSTACLE;
}
if (this.num_wipe_outs >= this.num_fall_game_over) {
_root.score = this.score;
_root.gotoAndStop("Lose");
}
}
}
this.snowboarder_distance = this.snowboarder_distance + this.snowboarder_speed;
};
SnowboardingGame.prototype.animate_game_objects = function () {
this.animate_snowboarder();
this.animate_trees();
this.animate_obstacles();
this.animate_answer_choices();
};
SnowboardingGame.prototype.animate_snowboarder = function () {
if ((this.mode & SNOWBOARDING_WIPED_OUT) && (this.mode & SNOWBOARDING_TREE)) {
if ((this.direction == "Up to Down") || (this.direction == "Down to Up")) {
if ((this.stage_width / 2) >= this.timeline.snowboarder._x) {
var direction = 1;
} else {
var direction = -1;
}
if (this.timeline.snowboarder._currentframe == 9) {
this.timeline.snowboarder._x = this.timeline.snowboarder._x + ((this.snowboarder_speed * direction) * 0.142857142857143);
} else {
this.timeline.snowboarder._x = this.timeline.snowboarder._x + ((this.snowboarder_speed * direction) * 0.333333333333333);
}
} else {
if ((this.stage_height / 2) >= this.timeline.snowboarder._y) {
var direction = 1;
} else {
var direction = -1;
}
if (this.timeline.snowboarder._currentframe == 9) {
this.timeline.snowboarder._y = this.timeline.snowboarder._y + ((this.snowboarder_speed * direction) * 0.142857142857143);
} else {
this.timeline.snowboarder._y = this.timeline.snowboarder._y + ((this.snowboarder_speed * direction) * 0.333333333333333);
}
}
} else if (this.mode & SNOWBOARDING_PLAYING) {
if (this.direction == "Up to Down") {
this.timeline.snowboarder._x = this.timeline.snowboarder._x + ((_root._xmouse - this.timeline.snowboarder._x) / this.snowboarder_accuracy);
this.timeline.snowboarder._y = this.timeline.snowboarder._y + ((_root._ymouse - (this.timeline.snowboarder._y - (this.timeline.snowboarder._height / 2))) / this.snowboarder_accuracy);
} else if (this.direction == "Down to Up") {
this.timeline.snowboarder._x = this.timeline.snowboarder._x + ((_root._xmouse - this.timeline.snowboarder._x) / this.snowboarder_accuracy);
this.timeline.snowboarder._y = this.timeline.snowboarder._y + ((_root._ymouse - (this.timeline.snowboarder._y + (this.timeline.snowboarder._height / 2))) / this.snowboarder_accuracy);
} else if (this.direction == "Left to Right") {
this.timeline.snowboarder._x = this.timeline.snowboarder._x + (((_root._xmouse - this.timeline.snowboarder._x) + (this.timeline.snowboarder._width / 2)) / this.snowboarder_accuracy);
this.timeline.snowboarder._y = this.timeline.snowboarder._y + ((_root._ymouse - this.timeline.snowboarder._y) / this.snowboarder_accuracy);
} else if (this.direction == "Right to left") {
this.timeline.snowboarder._x = this.timeline.snowboarder._x + (((_root._xmouse - this.timeline.snowboarder._x) - (this.timeline.snowboarder._width / 2)) / this.snowboarder_accuracy);
this.timeline.snowboarder._y = this.timeline.snowboarder._y + ((_root._ymouse - this.timeline.snowboarder._y) / this.snowboarder_accuracy);
}
var delta_x = (this.timeline.snowboarder._x - _root._xmouse);
var delta_y = (this.timeline.snowboarder._y - _root._ymouse);
if (this.direction == "Up to Down") {
var angle = Math.atan2(delta_x, delta_y);
} else if (this.direction == "Down to Up") {
var angle = Math.atan2(delta_x, -delta_y);
} else if (this.direction == "Left to Right") {
var angle = Math.atan2(delta_y, delta_x);
} else if (this.direction == "Right to Left") {
var angle = Math.atan2(delta_y, -delta_x);
}
this.timeline.snowboarder._rotation = ((-0.333333333333333 * angle) * 180) / Math.PI;
if (this.timeline.snowboarder._currentframe == 5) {
return(undefined);
}
if (this.timeline.snowboarder._currentframe == 6) {
return(undefined);
}
if (this.timeline.snowboarder._currentframe == 7) {
return(undefined);
}
if (this.timeline.snowboarder._currentframe == 8) {
return(undefined);
}
if (this.timeline.snowboarder._currentframe == 9) {
return(undefined);
}
if (this.timeline.snowboarder._currentframe == 10) {
return(undefined);
}
this.old_frame = this.timeline.snowboarder._currentframe;
if (Math.abs(angle) < this.straight_angle) {
this.timeline.snowboarder.gotoAndStop("Straight");
} else if (0 < angle) {
this.timeline.snowboarder.gotoAndStop("Turn Left");
} else if (angle < 0) {
this.timeline.snowboarder.gotoAndStop("Turn Right");
}
var frame = this.timeline.snowboarder._currentframe;
if ((this.old_frame != frame) && ((1.2 * this.straight_angle) < angle)) {
this.play_sound(["turn_left", "turn_right"].rande());
}
if ((this.old_frame != frame) && (angle < (-1.2 * this.straight_angle))) {
this.play_sound(["turn_left", "turn_right"].rande());
}
}
};
SnowboardingGame.prototype.animate_trees = function () {
var j = 0;
while (j < this.trees.length) {
var _mc = this.trees[j];
if (this.direction == "Up to Down") {
_mc._y = _mc._y + this.snowboarder_speed;
} else if (this.direction == "Down to Up") {
_mc._y = _mc._y - this.snowboarder_speed;
} else if (this.direction == "Left to Right") {
_mc._x = _mc._x + this.snowboarder_speed;
} else if (this.direction == "Right to Left") {
_mc._x = _mc._x - this.snowboarder_speed;
}
if (this.obstacle_off_stage(_mc)) {
this.trees.remove_element(_mc);
_mc.removeMovieClip();
}
if (this.timeline.snowboarder._currentframe != 10) {
if (_mc.hitTest(this.timeline.snowboarder.hit_area) && (!(this.mode & SNOWBOARDING_WIPED_OUT))) {
this.mode = this.mode ^ SNOWBOARDING_PLAYING;
this.mode = this.mode | (SNOWBOARDING_WIPED_OUT | SNOWBOARDING_TREE);
if (0.5 < Math.random()) {
this.timeline.snowboarder.gotoAndStop("Wipe Out");
} else {
this.timeline.snowboarder.gotoAndStop("Animal");
}
this.play_sound("tree_impact");
this.wipe_out();
}
}
j++;
}
};
SnowboardingGame.prototype.animate_obstacles = function () {
var j = 0;
while (j < this.obstacles.length) {
var _mc = this.obstacles[j];
if (this.direction == "Up to Down") {
_mc._y = _mc._y + this.snowboarder_speed;
} else if (this.direction == "Down to Up") {
_mc._y = _mc._y - this.snowboarder_speed;
} else if (this.direction == "Left to Right") {
_mc._x = _mc._x + this.snowboarder_speed;
} else if (this.direction == "Right to Left") {
_mc._x = _mc._x - this.snowboarder_speed;
}
if (this.obstacle_off_stage(_mc)) {
this.obstacles.remove_element(_mc);
_mc.removeMovieClip();
}
if (this.timeline.snowboarder._currentframe != 10) {
if (_mc.hitTest(this.timeline.snowboarder.hit_area) && (!(this.mode & SNOWBOARDING_WIPED_OUT))) {
if (_mc._name == "rough_patch") {
if (this.timeline.snowboarder._currentframe != 5) {
this.timeline.snowboarder.gotoAndStop("Off Balance");
}
} else if (_mc._name == "hanging_laundry") {
if (this.timeline.snowboarder._currentframe != 7) {
this.timeline.snowboarder.gotoAndStop("Clothsline");
}
} else if (_mc._name == "outhouse") {
_mc._visible = false;
if (this.timeline.snowboarder._currentframe != 8) {
this.timeline.snowboarder.gotoAndStop("Outhouse");
}
} else if (_mc._name == "snow_pile") {
if (this.timeline.snowboarder._currentframe != 6) {
this.timeline.snowboarder.gotoAndStop("Snowman");
}
} else if (_mc._name == "animal_tree") {
if (this.timeline.snowboarder._currentframe != 9) {
this.timeline.snowboarder.gotoAndStop("Animal");
}
} else if ((_mc._name == "jump0") || (_mc._name == "jump1")) {
if (this.timeline.snowboarder._currentframe != 10) {
this.timeline.snowboarder.gotoAndStop("Jumping");
}
} else {
this.mode = this.mode ^ SNOWBOARDING_PLAYING;
this.mode = this.mode | (SNOWBOARDING_WIPED_OUT | SNOWBOARDING_OBSTACLE);
this.timeline.snowboarder.gotoAndStop("Wipe Out");
this.wipe_out();
this.play_sound("wipe_out_sound");
}
}
}
j++;
}
};
SnowboardingGame.prototype.animate_answer_choices = function () {
if (this.mode & SNOWBOARDING_QUIZ_OUT) {
if ((this.current_frame - this.quiz_start_frame) >= this.question_pause) {
var j = 0;
while (j < this.question_choices.length) {
var _mc = this.question_choices[j];
if (this.direction == "Up to Down") {
_mc._y = _mc._y + (this.snowboarder_speed / this.answer_speed_factor);
} else if (this.direction == "Down to Up") {
_mc._y = _mc._y - (this.snowboarder_speed / this.answer_speed_factor);
} else if (this.direction == "Left to Right") {
_mc._x = _mc._x + (this.snowboarder_speed / this.answer_speed_factor);
} else if (this.direction == "Right to Left") {
_mc._x = _mc._x - (this.snowboarder_speed / this.answer_speed_factor);
}
if (this.obstacle_off_stage(_mc)) {
if (this.direction == "Up to Down") {
_mc._y = (-this.answer_spacing) * 2;
} else if (this.direction == "Down to Up") {
_mc._y = this.stage_height + (this.answer_spacing * 2);
} else if (this.direction == "Left to Right") {
_mc._x = (-this.answer_spacing) * 2;
} else if (this.direction == "Right to Left") {
_mc._x = this.stage_width + (this.answer_spacing * 2);
}
}
if (this.timeline.snowboarder.hitTest(_mc._x, _mc._y, true)) {
if (((_mc.field == undefined) || (_mc.field == "")) || (this.mode & SNOWBOARDING_WIPED_OUT)) {
return(undefined);
}
if (_mc.correct_answer) {
this.score = this.score + this.correct_answer_points;
this.check_score = this.check_score + this.correct_answer_points;
var k = 0;
while (k < this.question_choices.length) {
this.question_choices[k].removeMovieClip();
k++;
}
this.question_choices = new Array();
this.mode = this.mode ^ SNOWBOARDING_QUIZ_OUT;
Sound.playSound(this.correct_answer_sound);
Sound.playSound("cheer");
} else {
this.score = this.score + this.wrong_answer_points;
var k = 0;
while (k < this.question_choices.length) {
this.question_choices[k].removeMovieClip();
k++;
}
this.question_choices = new Array();
this.mode = this.mode ^ SNOWBOARDING_PLAYING;
this.mode = this.mode ^ SNOWBOARDING_QUIZ_OUT;
this.mode = this.mode | (SNOWBOARDING_WIPED_OUT | SNOWBOARDING_OBSTACLE);
this.timeline.snowboarder.gotoAndStop("Wipe Out");
this.wipe_out();
Sound.playSound("boo");
}
this.num_questions_answered++;
if (this.current_level >= (this.win_level - 1)) {
_root.score = this.score;
_root.gotoAndStop("Win");
return(undefined);
}
if (this.check_score >= this.num_points_next_level) {
this.check_score = 0;
this.num_wipe_outs--;
this.max_speed = this.max_speed + this.next_level_speed_increase;
this.current_level++;
this.timeline.attachMovie("next_level_prompt", "next_level_prompt", 999999 + (this.depth++));
this.timeline.next_level_prompt._x = this.stage_width / 2;
this.timeline.next_level_prompt._y = this.stage_height / 2;
this.timeline.next_level_prompt.field = ("Level " + (this.current_level + 1)) + "!";
}
this.timeline.question_animation.play();
this.quiz_exit_frame = this.current_frame;
return(undefined);
}
j++;
}
}
}
if (this.current_level >= (this.win_level - 1)) {
_root.score = this.score;
_root.gotoAndStop("Win");
return(undefined);
}
if (this.check_score >= this.num_points_next_level) {
this.check_score = 0;
this.num_wipe_outs--;
this.max_speed = this.max_speed + this.next_level_speed_increase;
this.current_level++;
this.timeline.attachMovie("next_level_prompt", "next_level_prompt", 999999 + (this.depth++));
this.timeline.next_level_prompt._x = this.stage_width / 2;
this.timeline.next_level_prompt._y = this.stage_height / 2;
this.timeline.next_level_prompt.field = ("Level " + (this.current_level + 1)) + "!";
this.old_mode = this.mode;
this.mode = SNOWBOARDING_PAUSED;
}
};
SnowboardingGame.prototype.obstacle_off_stage = function (_mc) {
if (this.direction == "Up to Down") {
if ((_mc._y - (_mc._height / 2)) >= this.stage_height) {
return(true);
}
} else if (this.direction == "Down to Up") {
if (0 >= (_mc._y + (_mc._height / 2))) {
return(true);
}
} else if (this.direction == "Left to Right") {
if ((_mc._x - (_mc._width / 2)) >= this.stage_width) {
return(true);
}
} else if (this.direction == "Right to Left") {
if (0 >= (_mc._x + (_mc._width / 2))) {
return(true);
}
}
return(false);
};
SnowboardingGame.prototype.update_variables = function () {
this.current_frame++;
};
SnowboardingGame.prototype.wipe_out = function () {
this.jump_score = 0;
this.num_successive_jumps = 0;
if (this.timeline.next_level_prompt == undefined) {
this.num_wipe_outs++;
}
};
SnowboardingGame.prototype.key_press = function () {
var trick_score = 10;
if (((this.timeline.snowboarder._currentframe == 10) && (this.timeline.snowboarder.player.trick_player != undefined)) && (this.timeline.snowboarder.player.trick_player._currentframe == 1)) {
if (Key.isDown(Key.A)) {
this.jump_score = this.jump_score + trick_score;
this.timeline.snowboarder.player.trick_player.gotoAndStop("180 Trick");
} else if (Key.isDown(Key.S)) {
this.jump_score = this.jump_score + trick_score;
this.timeline.snowboarder.player.trick_player.gotoAndStop("Side Kick");
} else if (Key.isDown(Key.D)) {
this.jump_score = this.jump_score + trick_score;
this.timeline.snowboarder.player.trick_player.gotoAndStop("Flip Trick");
}
}
};
SnowboardingGame.prototype.play_sound = function (linkage) {
var _sound = new Sound(this.timeline);
_sound.attachSound(linkage);
_sound.setVolume(70);
_sound.start(0, 1);
};
this._x = 0;
this._y = 0;
game = new SnowboardingGame();
Instance of Symbol 305 MovieClip "controller" in Symbol 316 MovieClip [SnowboardingGame] Frame 1
onClipEvent (load) {
this._visible = false;
}
onClipEvent (data) {
_parent.game.num_questions = Number(num_questions);
_parent.game.num_choices = Number(num_choices);
_parent.game.quiz_questions = new Array();
var j = 0;
while (j < _parent.game.num_questions) {
_parent.game.quiz_questions[j] = new Object();
_parent.game.quiz_questions[j].question = this["question" + j];
_parent.game.quiz_questions[j].answer = this[("question" + j) + "_answer"];
_parent.game.quiz_questions[j].choices = new Array();
var k = 0;
while (k < _parent.game.num_choices) {
_parent.game.quiz_questions[j].choices[k] = this[(("choice" + j) + "_") + k];
k++;
}
j++;
}
_parent.game.quiz_questions.shuffle();
_parent.game.mode = SNOWBOARDING_PLAYING;
}
onClipEvent (keyDown) {
_parent.game.key_press();
}
onClipEvent (enterFrame) {
_parent.game.action();
}
Instance of Symbol 308 MovieClip "points_prompt" in Symbol 316 MovieClip [SnowboardingGame] Frame 1
onClipEvent (load) {
this.swapDepths(99999);
}
Instance of Symbol 315 MovieClip "info" in Symbol 316 MovieClip [SnowboardingGame] Frame 1
onClipEvent (load) {
this.swapDepths(999999);
}
Symbol 337 MovieClip Frame 1
stop();
Instance of Symbol 336 MovieClip "swfloader" in Symbol 337 MovieClip Frame 1
onClipEvent (load) {
function strip_spaces(str) {
var _str = new String("");
var j = 0;
while (j < str.length) {
if ((str.charAt(j) != " ") && (str.charAt(j) != ";")) {
_str = _str + str.charAt(j);
}
j++;
}
return(_str);
}
function simple_script(action, timeline) {
action = strip_spaces(action);
if ((0 < action.length) && ((action.indexOf(")") != -1) && (action.indexOf("(") != -1))) {
var sections = action.split(".");
var timeline_action = sections.pop();
var first_paren = timeline_action.indexOf("(");
var second_paren = timeline_action.indexOf(")");
var timeline_function = timeline_action.substr(0, first_paren);
var function_parameter = timeline_action.substr(first_paren + 1, second_paren - (first_paren + 1));
var timeline_reference = timeline;
var j = 0;
while (j < sections.length) {
timeline_reference = timeline_reference[sections[j]];
j++;
}
if (function_parameter.indexOf("\"") != -1) {
function_parameter = function_parameter.substr(1, function_parameter.length - 2);
}
timeline_reference[timeline_function](function_parameter);
}
}
function execute_action() {
unloaded = true;
_parent._visible = false;
simple_script(_parent.play_action_val, _parent);
}
_parent.anim.gotoAndStop(1);
simple_script(_parent.init_action_val, _parent);
var done = false;
var unloaded = false;
var orig_x = _parent._x;
var orig_y = _parent._y;
var dist_x = (_parent._x + ((_parent._width * 2) / 3));
var dist_y = (_parent._y + ((_parent._height * 2) / 3));
var orig_a = _parent._alpha;
var accel_jump = 0.75;
var slow_factor = _parent.slow_factor_val;
var speed_factor = (1 + (slow_factor / (1 - slow_factor)));
var ready = false;
var perc_fadeout = 0;
_parent.perc._x = _parent.anim._x - (_parent.perc._width / 2);
_parent.perc._y = _parent.anim._y - (_parent.perc._height / 2);
if (slow_factor < 1) {
var _local1 = "Up";
switch (_parent.xin_motion_val) {
case _local1 :
_parent._y = orig_y + (dist_y * 2);
break;
case "Down" :
_parent._y = orig_y - (dist_y * 2);
break;
case "Left" :
_parent._x = orig_x + (dist_x * 2);
break;
case "Right" :
_parent._x = orig_x - (dist_x * 2);
break;
case "Toward" :
_parent._xscale = (_parent._yscale = 1);
break;
case "None" :
_parent._alpha = 0;
}
} else {
ready = true;
}
}
onClipEvent (enterFrame) {
if (unloaded) {
return(undefined);
}
if (!ready) {
var _local1 = "Toward";
switch (_parent.xin_motion_val) {
case _local1 :
_parent._xscale = _parent._xscale + ((100 - _parent._xscale) * slow_factor);
_parent._yscale = _parent._xscale;
if (_parent.xin_alphatype_val == "Yes") {
_parent._alpha = Math.round((orig_a / 100) * Math.max(0, Math.min(_parent._xscale, 100)));
}
if (Math.abs(100 - _parent._xscale) < 0.5) {
_parent._xscale = (_parent._yscale = 100);
_parent._alpha = orig_a;
ready = true;
}
break;
default :
_parent._x = _parent._x + ((orig_x - _parent._x) * slow_factor);
_parent._y = _parent._y + ((orig_y - _parent._y) * slow_factor);
if (_parent.xin_alphatype_val == "Yes") {
if (_parent.xin_motion_val == "None") {
_parent._alpha = _parent._alpha + ((orig_a - _parent._alpha) * slow_factor);
} else if (Math.abs(orig_y - _parent._y) < Math.abs(orig_x - _parent._x)) {
_parent._alpha = 100 - Math.round(((orig_a / 100) * (Math.min(dist_x, Math.abs(_parent._x - orig_x)) / dist_x)) * 100);
} else {
_parent._alpha = 100 - Math.round(((orig_a / 100) * (Math.min(dist_y, Math.abs(_parent._y - orig_y)) / dist_y)) * 100);
}
}
if (!(((_parent.xin_motion_val == "None") && (1 >= Math.abs(_parent._alpha - orig_a))) || (((_parent.xin_motion_val != "None") && (Math.abs(_parent._y - orig_y) < 0.5)) && (Math.abs(_parent._x - orig_x) < 0.5)))) {
break;
}
_parent._x = orig_x;
_parent._y = orig_y;
_parent._alpha = orig_a;
ready = true;
}
} else if (!done) {
var rl = _root.getBytesLoaded();
var rt = (_root.getBytesTotal() * (_parent.perc_req_val / 100));
if ((10 < rl) && (10 < rt)) {
rl = Math.min(rl, rt);
var new_frame = (_parent.anim._currentframe + Math.ceil(((_parent.anim._totalframes * (rl / rt)) - _parent.anim._currentframe) / 4));
new_frame = Math.max(1, new_frame);
if (_parent.show_perc_val == "Yes") {
_parent.perc.text = Math.round(((new_frame - 1) / (_parent.anim._totalframes - 1)) * 100) + " %";
}
if (new_frame != _parent.anim._currentframe) {
_parent.anim.gotoAndStop(new_frame);
}
if ((_parent.anim._totalframes == _parent.anim._currentframe) && (rl >= rt)) {
done = true;
}
}
} else if (slow_factor < 1) {
var _local1 = "Down";
switch (_parent.xout_motion_val) {
case _local1 :
if (orig_y >= _parent._y) {
_parent._y = orig_y + accel_jump;
}
_parent._y = orig_y + (Math.abs(_parent._y - orig_y) * speed_factor);
perc_fadeout = Math.round((Math.min(dist_y, Math.abs(_parent._y - orig_y)) / dist_y) * 100);
if ((orig_y + (dist_y * 2)) < _parent._y) {
execute_action();
}
break;
case "Up" :
if (_parent._y >= orig_y) {
_parent._y = orig_y - accel_jump;
}
_parent._y = orig_y - (Math.abs(_parent._y - orig_y) * speed_factor);
perc_fadeout = Math.round((Math.min(dist_y, Math.abs(_parent._y - orig_y)) / dist_y) * 100);
if (_parent._y < (orig_y - (dist_y * 2))) {
execute_action();
}
break;
case "Right" :
if (orig_x >= _parent._x) {
_parent._x = orig_x + accel_jump;
}
_parent._x = orig_x + (Math.abs(_parent._x - orig_x) * speed_factor);
perc_fadeout = Math.round((Math.min(dist_x, Math.abs(_parent._x - orig_x)) / dist_x) * 100);
if ((orig_x + (dist_x * 2)) < _parent._x) {
execute_action();
}
break;
case "Left" :
if (_parent._x >= orig_x) {
_parent._x = orig_x - accel_jump;
}
_parent._x = orig_x - (Math.abs(_parent._x - orig_x) * speed_factor);
perc_fadeout = Math.round((Math.min(dist_x, Math.abs(_parent._x - orig_x)) / dist_x) * 100);
if (_parent._x < (orig_x - (dist_x * 2))) {
execute_action();
}
break;
case "Away" :
if ((_parent._xscale >= 100) || (_parent._yscale >= 100)) {
_parent._xscale = (_parent._yscale = 100 - accel_jump);
}
_parent._xscale = (_parent._yscale = Math.max(0.5, 100 - ((100 - _parent._yscale) * speed_factor)));
perc_fadeout = 100 - Math.round(Math.max(0, Math.min(_parent._xscale, 100)));
if (_parent._xscale < 1) {
execute_action();
}
break;
default :
perc_fadeout = perc_fadeout + ((100 - perc_fadeout) * slow_factor);
if (1 < Math.abs(perc_fadeout - 100)) {
break;
}
execute_action();
}
_local1 = "Yes";
if (!((_parent.xout_alphatype_val) === (_local1))) {
} else {
_parent._alpha = (orig_a / 100) * (100 - perc_fadeout);
}
} else {
execute_action();
}
}
Symbol 342 MovieClip Frame 1
stop();
Symbol 342 MovieClip Frame 2
stop();
Symbol 343 Button
on (release) {
_root.play();
}
Symbol 346 Button
on (release) {
_root.inst.gotoAndStop("On");
gotoAndStop (2);
}
Symbol 347 Button
on (release) {
_root.inst.gotoAndStop("Off");
gotoAndStop (1);
}
Symbol 348 MovieClip Frame 1
stop();
Symbol 348 MovieClip Frame 2
stop();
Symbol 400 Button
on (press) {
_root.gotoAndStop("Intro");
}
Symbol 404 Button
on (press) {
_root.gotoAndStop("Intro");
}