Instance of Symbol 330 MovieClip in Frame 1
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 2
stop();
Frame 3
stop();
Instance of Symbol 420 MovieClip in Frame 3
onClipEvent (load) {
quiz_data_file = "";
quiz_object_probability = 0;
shuffle_questions = "True";
correct_points = 100;
incorrect_points = -25;
stage_width = 720;
stage_height = 450;
show_mouse = "False";
minimum_bubble_size = 50;
flying_objects_linkages = [];
flying_objects_linkages[0] = "flying0";
flying_objects_linkages[1] = "flying1";
flying_objects_linkages[2] = "flying2";
flying_objects_linkages[3] = "flying3";
flying_objects_linkages[4] = "flying4";
flying_quiz_objects_linkages = [];
flying_quiz_objects_linkages[0] = "flying_quiz0";
special_objects_linkages = [];
special_objects_linkages[0] = "special0";
falling_objects_linkages = [];
falling_objects_linkages[0] = "falling0";
falling_objects_linkages[1] = "falling1";
flying_points = 10;
flying_points_increase = 10;
falling_points = 20;
falling_points_increase = 10;
flying_falling_points = 30;
flying_falling_points_increase = 10;
special_points = 40;
special_points_increase = 10;
multiple_catch_factor = 1;
multiple_catch_factor_increase = 1;
next_level_points = 500;
initial_bubbles = 50;
initial_time = 120000 /* 0x01D4C0 */;
time_bonus = 10000;
time_bonus_increase = 2000;
time_bonus_points = 175;
time_bonus_points_increase = 25;
power_up_delay = 350;
time_power_up = 15000;
bubbles_power_up = 15;
flying_delay = 75;
flying_delay_change = -1;
falling_delay = 300;
falling_delay_change = -10;
special_delay = 400;
special_delay_change = -10;
flying_speed = 3;
flying_speed_deviation = 1;
flying_speed_increase = 0.5;
falling_speed = 2;
falling_deviation = 0.5;
falling_speed_increase = 0.5;
special_speed = 6;
special_speed_deviation = 0.5;
special_speed_increase = 0.5;
}
Frame 4
stop();
Symbol 31 MovieClip [bubble_maker] Frame 1
stop();
Symbol 140 MovieClip [flying0] Frame 1
stop();
Symbol 184 MovieClip [flying_quiz0] Frame 1
stop();
Symbol 201 MovieClip [flying4] Frame 1
stop();
Symbol 219 MovieClip [flying3] Frame 1
stop();
Symbol 248 MovieClip [flying2] Frame 1
stop();
Symbol 280 MovieClip [flying1] Frame 1
stop();
Symbol 283 MovieClip [score_display] Frame 1
play();
Symbol 283 MovieClip [score_display] Frame 30
this._unloadMovie();
Symbol 306 MovieClip Frame 19
stop();
Symbol 307 MovieClip [special0] Frame 1
stop();
Symbol 330 MovieClip Frame 1
stop();
Instance of Symbol 329 MovieClip "swfloader" in Symbol 330 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 _local2 = "Up";
switch (_parent.xin_motion_val) {
case _local2 :
_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 _local2 = "Toward";
switch (_parent.xin_motion_val) {
case _local2 :
_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 _local2 = "Down";
switch (_parent.xout_motion_val) {
case _local2 :
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();
}
_local2 = "Yes";
if (!((typeof(_parent.xout_alphatype_val) == typeof(_local2)) ? (_parent.xout_motion_val == _local2) : false)) {
} else {
_parent._alpha = (orig_a / 100) * (100 - perc_fadeout);
}
} else {
execute_action();
}
}
Symbol 335 Button
on (release) {
this.play();
}
Symbol 339 Button
on (release) {
getURL ("http://www.winxclub.tv");
}
Symbol 359 MovieClip Frame 1
stop();
Symbol 376 Button
on (press) {
_parent._parent.game.evaluate_answer(this);
}
Symbol 402 MovieClip Frame 1
stop();
Symbol 402 MovieClip Frame 20
stop();
Symbol 402 MovieClip Frame 79
_parent.game.answer_prompt_done();
this.gotoAndStop(1);
Symbol 402 MovieClip Frame 138
_parent.game.answer_prompt_done();
this.gotoAndStop(1);
Symbol 419 MovieClip Frame 1
stop();
Symbol 419 MovieClip Frame 72
_parent.game.paused = false;
Symbol 420 MovieClip Frame 1
Math.formatMillisecondTime = function (ms) {
var sec = Math.floor(ms / 1000);
var min = Math.floor(sec / 60);
var sec = (sec % 60);
if (sec < 10) {
sec = "0" + sec;
}
return((min + ":") + sec);
};
Math.oscillate = function (a, b, t) {
return(a + ((b - a) * Math.abs(Math.sin(t))));
};
Math.sign = function (a) {
return(((a == 0) ? 0 : (Math.abs(a) / a)));
};
Math.randi = function (a, b) {
return(Math.floor(Math.random() * (b - a)) + Math.floor(a));
};
Math.randf = function (a, b) {
return((Math.random() * (b - a)) + a);
};
Math.randa = function () {
return(arguments.rande());
};
Array.prototype.swap = function (a, b) {
var temp = this[a];
this[a] = this[b];
this[b] = this[a];
};
Array.prototype.shuffle = function () {
var j = 0;
while (j < this.length) {
this.swap(j, Math.randi(this.length));
j++;
}
};
Array.prototype.rande = function () {
return(this[Math.randi(0, this.length)]);
};
MovieClip.prototype._unloadMovie = function () {
this._x = -1000;
this._y = -1000;
this._visible = false;
this.removeMovieClip();
};
BeeGame = function () {
if (this.quiz_data_file == "") {
this.initialize();
} else {
this.load_quiz_data();
}
};
BeeGame.prototype.quiz_data_file = quiz_data_file;
BeeGame.prototype.quiz_object_probability = Number(quiz_object_probability);
BeeGame.prototype.shuffle_questions = shuffle_questions;
BeeGame.prototype.correct_points = Number(correct_points);
BeeGame.prototype.incorrect_points = Number(incorrect_points);
BeeGame.prototype.stage_width = Number(stage_width);
BeeGame.prototype.stage_height = Number(stage_height);
BeeGame.prototype.show_mouse = show_mouse;
BeeGame.prototype.minimum_bubble_size = Number(minimum_bubble_size);
BeeGame.prototype.flying_objects_linkages = flying_objects_linkages;
BeeGame.prototype.flying_quiz_objects_linkages = flying_quiz_objects_linkages;
BeeGame.prototype.special_objects_linkages = special_objects_linkages;
BeeGame.prototype.falling_objects_linkages = falling_objects_linkages;
BeeGame.prototype.flying_points = Number(flying_points);
BeeGame.prototype.flying_points_increase = Number(flying_points_increase);
BeeGame.prototype.falling_points = Number(falling_points);
BeeGame.prototype.falling_points_increase = Number(falling_points_increase);
BeeGame.prototype.flying_falling_points = Number(flying_falling_points);
BeeGame.prototype.flying_falling_points_increase = Number(flying_falling_points_increase);
BeeGame.prototype.special_points = Number(special_points);
BeeGame.prototype.special_points_increase = Number(special_points_increase);
BeeGame.prototype.multiple_catch_factor = Number(multiple_catch_factor);
BeeGame.prototype.multiple_catch_factor_increase = Number(multiple_catch_factor_increase);
BeeGame.prototype.next_level_points = Number(next_level_points);
BeeGame.prototype.initial_bubbles = Number(initial_bubbles);
BeeGame.prototype.initial_time = Number(initial_time);
BeeGame.prototype.time_bonus = Number(time_bonus);
BeeGame.prototype.time_bonus_increase = Number(time_bonus_increase);
BeeGame.prototype.time_bonus_points = Number(time_bonus_points);
BeeGame.prototype.time_bonus_points_increase = Number(time_bonus_points_increase);
BeeGame.prototype.power_up_delay = Number(power_up_delay);
BeeGame.prototype.time_power_up = Number(time_power_up);
BeeGame.prototype.bubbles_power_up = Number(bubbles_power_up);
BeeGame.prototype.flying_delay = Number(flying_delay);
BeeGame.prototype.flying_delay_change = Number(flying_delay_change);
BeeGame.prototype.falling_delay = Number(falling_delay);
BeeGame.prototype.falling_delay_change = Number(falling_delay_change);
BeeGame.prototype.special_delay = Number(special_delay);
BeeGame.prototype.special_delay_change = Number(special_delay_change);
BeeGame.prototype.flying_speed = Number(flying_speed);
BeeGame.prototype.flying_speed_deviation = Number(flying_speed_deviation);
BeeGame.prototype.flying_speed_increase = Number(flying_speed_increase);
BeeGame.prototype.falling_speed = Number(falling_speed);
BeeGame.prototype.falling_speed_deviation = Number(falling_speed_deviation);
BeeGame.prototype.falling_speed_increase = Number(falling_speed_increase);
BeeGame.prototype.special_speed = Number(special_speed);
BeeGame.prototype.special_speed_deviation = Number(special_speed_deviation);
BeeGame.prototype.special_speed_increase = Number(special_speed_increase);
BeeGame.prototype.timeline = this;
BeeGame.prototype.load_quiz_data = function () {
this.num_bubbles_left = this.initial_bubbles;
this.timeline.controller.loadVariables(this.quiz_data_file);
};
BeeGame.prototype.initialize = function () {
this.initialize_variables();
this.initialize_graphics();
this.initialize_level();
};
BeeGame.prototype.initialize_variables = function () {
this.depth = 0;
this.current_level = 0;
this.current_frame = 0;
this.score = 0;
this.start_time = getTimer();
this.paused = false;
this.num_bubbles_left = this.initial_bubbles;
this.initial_liquid_height = this.timeline.bottle.liquid._height;
this.center_x = this.stage_width / 2;
this.center_y = this.stage_height / 2;
this.flying_objects = new Array();
this.falling_objects = new Array();
this.special_objects = new Array();
this.bubbles = new Array();
this.power_ups = new Array();
};
BeeGame.prototype.initialize_graphics = function () {
this.create_bubble_maker_graphics();
if (this.show_mouse == "False") {
Mouse.hide();
}
};
BeeGame.prototype.create_bubble_maker_graphics = function () {
this.timeline.attachMovie("bubble_maker", "bubble_maker", this.depth++);
this.timeline.bubble_maker._x = this.stage_width / 2;
this.timeline.bubble_maker._y = this.stage_height / 2;
this.timeline.bubble_maker.startDrag(true);
};
BeeGame.prototype.initialize_level = function () {
this.timeline.level_prompt.level = this.current_level + 1;
this.timeline.level_prompt.play();
this.timeline.backgrounds.gotoAndStop((this.current_level % this.timeline.backgrounds._totalframes) + 1);
this.starting_level_score = this.score;
};
BeeGame.prototype.action = function () {
if (this.depth == undefined) {
return(undefined);
}
this.update_properties();
this.render_bubble_maker();
this.check_add_flying_object();
this.check_add_falling_object();
this.check_add_special_object();
this.check_add_power_up();
this.move_all_flying_objects();
this.move_all_falling_objects();
this.move_all_special_objects();
this.move_all_bubbles();
this.move_all_power_ups();
};
BeeGame.prototype.update_properties = function () {
this.old_mouse_x = this.mouse_x;
this.old_mouse_y = this.mouse_y;
this.mouse_x = _root._xmouse;
this.mouse_y = _root._ymouse;
this.current_frame++;
this.timeline.score = this.score;
_root.score = this.score;
this.current_time = this.initial_time - (getTimer() - this.start_time);
this.timeline.time = Math.formatMillisecondTime(this.current_time);
this.timeline.bottle.liquid._height = (this.initial_liquid_height * this.num_bubbles_left) / this.initial_bubbles;
this.check_game_over();
};
BeeGame.prototype.render_bubble_maker = function () {
if ((this.mouse_x - this.old_mouse_x) < 0) {
this.timeline.bubble_maker._xscale = 100;
} else if (0 < (this.mouse_x - this.old_mouse_x)) {
this.timeline.bubble_maker._xscale = -100;
}
if ((this.timeline.bubble_maker._currentframe == this.timeline.bubble_maker._totalframes) && (this.timeline.bubble_maker != undefined)) {
this.play_sound("bubble_pop");
this.timeline.bubble_maker.gotoAndStop(1);
}
};
BeeGame.prototype.check_add_flying_object = function () {
var num_frames = (this.flying_delay + (this.current_level * this.flying_delay_change));
if ((this.current_frame % num_frames) == 0) {
this.create_flying_object();
}
};
BeeGame.prototype.check_add_falling_object = function () {
var num_frames = (this.falling_delay + (this.current_level * this.falling_delay_change));
if ((this.current_frame % num_frames) == 0) {
this.create_falling_object();
}
};
BeeGame.prototype.check_add_special_object = function () {
var num_frames = (this.special_delay + (this.current_level * this.special_delay_change));
if ((this.current_frame % num_frames) == 0) {
this.create_special_object();
}
};
BeeGame.prototype.create_flying_object = function (x, y) {
if (Math.random() < this.quiz_object_probability) {
var linkage = this.flying_quiz_objects_linkages.rande();
var quiz_object = true;
} else {
var linkage = this.flying_objects_linkages.rande();
var quiz_object = false;
}
this.timeline.attachMovie(linkage, "flying" + this.depth, this.depth++);
var _mc = this.timeline["flying" + this.depth];
_mc._x = 0;
_mc._y = Math.randf(this.center_y - (this.center_y / 2), this.center_y + (this.center_y / 2));
if (x != undefined) {
_mc._x = x;
}
if (y != undefined) {
_mc._y = y;
}
var temp_speed = (this.flying_speed + (this.current_level * this.flying_speed_increase));
_mc.speed = Math.randf(temp_speed - this.flying_speed_deviation, temp_speed + this.flying_speed_deviation);
_mc.current_angle = 0;
_mc.tween_angle = 0;
_mc.capturer_mc = undefined;
_mc.riding = false;
_mc.quiz = quiz_object;
this.flying_objects.push(_mc);
if (Math.random() < 0.1) {
this.create_flying_object(_mc._x, _mc._y);
}
};
BeeGame.prototype.create_falling_object = function () {
var index = Math.randi(0, this.falling_objects_linkages.length);
this.timeline.attachMovie(this.falling_objects_linkages[index], "falling" + this.depth, this.depth++);
var _mc = this.timeline["falling" + this.depth];
_mc._x = Math.randf(0, this.center_x / 2);
_mc._y = 0;
var temp_speed = (this.falling_speed + (this.current_level * this.falling_speed_increase));
_mc.speed = Math.randf(temp_speed - this.falling_speed_deviation, temp_speed + this.falling_speed_deviation);
_mc.current_angle = 0;
_mc.min_heading_range = Math.randf(-0.448798950512828, 0);
_mc.max_heading_range = Math.randf((Math.PI/4), (Math.PI/2));
_mc.oscillate_factor = Math.randf(0.0628318530717959, 0.0392699081698724);
_mc.index = index;
this.falling_objects.push(_mc);
};
BeeGame.prototype.create_special_object = function () {
this.timeline.attachMovie(this.special_objects_linkages.rande(), "special" + this.depth, this.depth++);
var _mc = this.timeline["special" + this.depth];
_mc._x = 0;
_mc._y = Math.randf(this.center_y - (this.center_y / 2), this.center_y + (this.center_y / 2));
var temp_speed = (this.special_speed + (this.current_level * this.special_speed_increase));
_mc.speed = Math.randf(temp_speed - this.special_speed_deviation, temp_speed + this.special_speed_deviation);
_mc.current_angle = 0;
_mc.tween_angle = 0;
_mc.parachute_x = Math.randf(this.center_x / 3, 3 * this.center_x);
_mc.parachuting = false;
_mc.capturer_mc = undefined;
this.special_objects.push(_mc);
};
BeeGame.prototype.check_add_power_up = function () {
if ((this.current_frame % this.power_up_delay) == 0) {
this.create_power_up();
}
};
BeeGame.prototype.create_power_up = function () {
var linkage = Math.randa("bubbles_power_up", "clock_power_up");
if (linkage == "clock_power_up") {
this.play_sound("clock_appear");
}
this.timeline.attachMovie(linkage, "power_up" + this.depth, this.depth++);
var _mc = this.timeline["power_up" + this.depth];
var angle = Math.randf(-0.392699081698724, 0);
var speed = (this.special_speed + (this.current_level * this.special_speed_increase));
_mc.vel_x = speed * Math.cos(angle);
_mc.vel_y = speed * Math.sin(angle);
_mc.type = linkage;
_mc.capturer_mc = undefined;
this.power_ups.push(_mc);
};
BeeGame.prototype.move_all_flying_objects = function () {
var j = 0;
while (j < this.flying_objects.length) {
this.move_flying_object(this.flying_objects[j], j);
j++;
}
};
BeeGame.prototype.move_flying_object = function (flying_mc, index) {
if (flying_mc.capturer_mc != undefined) {
flying_mc._x = flying_mc.capturer_mc._x;
flying_mc._y = flying_mc.capturer_mc._y;
} else if (flying_mc.riding) {
var tween_angle = Math.oscillate(flying_mc.min_heading_range, flying_mc.max_heading_range, this.current_frame * flying_mc.oscillate_factor);
flying_mc.current_angle = flying_mc.current_angle + ((tween_angle - flying_mc.current_angle) / 4);
flying_mc._x = flying_mc._x + (flying_mc.speed * Math.cos(flying_mc.current_angle));
flying_mc._y = flying_mc._y + (flying_mc.speed * Math.sin(flying_mc.current_angle));
} else {
flying_mc.current_angle = flying_mc.current_angle + ((flying_mc.tween_angle - flying_mc.current_angle) / 4);
if ((this.current_frame % 10) == 0) {
flying_mc.tween_angle = Math.randf(-0.523598775598299, 0.523598775598299);
}
flying_mc._x = flying_mc._x + (flying_mc.speed * Math.cos(flying_mc.current_angle));
flying_mc._y = flying_mc._y + (flying_mc.speed * Math.sin(flying_mc.current_angle));
}
if (this.stage_width < flying_mc._x) {
this.flying_objects.splice(index, 1);
flying_mc._unloadMovie();
} else {
this.check_flying_landed_falling(flying_mc);
}
};
BeeGame.prototype.check_flying_landed_falling = function (flying_mc) {
var j = 0;
while (j < this.falling_objects.length) {
var falling_mc = this.falling_objects[j];
if (falling_mc.hitTest(flying_mc._x, flying_mc._y, true)) {
flying_mc.gotoAndStop("Riding Falling Object " + falling_mc.index);
this.falling_objects.splice(j, 1);
falling_mc._unloadMovie();
flying_mc.riding = true;
flying_mc.current_angle = 0;
flying_mc.min_heading_range = Math.randf(-0.448798950512828, 0);
flying_mc.max_heading_range = Math.randf((Math.PI/4), (Math.PI/2));
flying_mc.oscillate_factor = Math.randf(0.0628318530717959, 0.0392699081698724);
flying_mc.speed = flying_mc.speed / 2;
}
j++;
}
};
BeeGame.prototype.move_all_falling_objects = function () {
var j = 0;
while (j < this.falling_objects.length) {
this.move_falling_object(this.falling_objects[j], j);
j++;
}
};
BeeGame.prototype.move_falling_object = function (falling_mc, index) {
var tween_angle = Math.oscillate(falling_mc.min_heading_range, falling_mc.max_heading_range, this.current_frame * falling_mc.oscillate_factor);
falling_mc.current_angle = falling_mc.current_angle + ((tween_angle - falling_mc.current_angle) / 4);
falling_mc._x = falling_mc._x + (falling_mc.speed * Math.cos(falling_mc.current_angle));
falling_mc._y = falling_mc._y + (falling_mc.speed * Math.sin(falling_mc.current_angle));
if ((this.stage_width < falling_mc._x) && (this.stage_height < falling_mc._y)) {
this.falling_objects.splice(index, 1);
falling_mc._unloadMovie();
}
};
BeeGame.prototype.move_all_special_objects = function () {
var j = 0;
while (j < this.special_objects.length) {
this.move_special_object(this.special_objects[j], j);
j++;
}
};
BeeGame.prototype.move_special_object = function (special_mc, index) {
if (special_mc.capturer_mc != undefined) {
special_mc._x = special_mc.capturer_mc._x;
special_mc._y = special_mc.capturer_mc._y;
} else if (special_mc.parachuting) {
var tween_angle = Math.oscillate(special_mc.min_heading_range, special_mc.max_heading_range, this.current_frame * special_mc.oscillate_factor);
special_mc.current_angle = special_mc.current_angle + ((tween_angle - special_mc.current_angle) / 4);
special_mc._x = special_mc._x + (special_mc.speed * Math.cos(special_mc.current_angle));
special_mc._y = special_mc._y + (special_mc.speed * Math.sin(special_mc.current_angle));
} else {
special_mc.current_angle = special_mc.current_angle + ((special_mc.tween_angle - special_mc.current_angle) / 4);
if ((this.current_frame % 10) == 0) {
special_mc.tween_angle = Math.randf(-0.523598775598299, 0.523598775598299);
}
special_mc._x = special_mc._x + (special_mc.speed * Math.cos(special_mc.current_angle));
special_mc._y = special_mc._y + (special_mc.speed * Math.sin(special_mc.current_angle));
if (special_mc.parachute_x < special_mc._x) {
special_mc.parachuting = true;
special_mc.gotoAndStop("Falling");
special_mc.current_angle = 0;
special_mc.min_heading_range = Math.randf(-0.448798950512828, 0);
special_mc.max_heading_range = Math.randf((Math.PI/4), (Math.PI/2));
special_mc.oscillate_factor = Math.randf(0.0628318530717959, 0.0392699081698724);
special_mc.speed = special_mc.speed / 2;
}
}
if ((this.stage_width < special_mc._x) || (this.stage_height < special_mc._y)) {
this.special_objects.splice(index, 1);
special_mc._unloadMovie();
}
};
BeeGame.prototype.move_all_bubbles = function () {
var j = 0;
while (j < this.bubbles.length) {
this.move_bubble(this.bubbles[j], j);
j++;
}
};
BeeGame.prototype.move_bubble = function (bubble_mc, index) {
bubble_mc.current_angle = bubble_mc.current_angle + ((bubble_mc.tween_angle - bubble_mc.current_angle) / 4);
if ((this.current_frame % 10) == 0) {
bubble_mc.tween_angle = Math.randf(-0.523598775598299, 0.523598775598299);
}
bubble_mc._x = bubble_mc._x + (bubble_mc.speed * Math.cos(bubble_mc.current_angle));
bubble_mc._y = bubble_mc._y + (bubble_mc.speed * Math.sin(bubble_mc.current_angle));
if ((this.stage_width + 100) < bubble_mc._x) {
this.bubbles.splice(index, 1);
bubble_mc._unloadMovie();
}
};
BeeGame.prototype.move_all_power_ups = function () {
var j = 0;
while (j < this.power_ups.length) {
this.move_power_up(this.power_ups[j], j);
j++;
}
};
BeeGame.prototype.move_power_up = function (power_up_mc, index) {
if (power_up_mc.capturer_mc != undefined) {
power_up_mc._x = power_up_mc.capturer_mc._x;
power_up_mc._y = power_up_mc.capturer_mc._y;
} else {
power_up_mc.vel_y = power_up_mc.vel_y + 0.15;
power_up_mc._x = power_up_mc._x + power_up_mc.vel_x;
power_up_mc._y = power_up_mc._y + power_up_mc.vel_y;
}
if ((this.stage_width < power_up_mc._x) || (this.stage_height < power_up_mc._y)) {
this.power_ups.splice(index, 1);
power_up_mc._unloadMovie();
}
};
BeeGame.prototype.mouse_down = function () {
this.timeline.bubble_maker.gotoAndPlay(1);
};
BeeGame.prototype.mouse_up = function () {
if (this.timeline.bubble_maker._currentframe == 1) {
return(undefined);
}
this.create_bubble();
this.timeline.bubble_maker.gotoAndStop(1);
};
BeeGame.prototype.create_bubble = function () {
var size = ((100 * this.timeline.bubble_maker._currentframe) / this.timeline.bubble_maker._totalframes);
if (size < this.minimum_bubble_size) {
this.play_sound("bubble_pop");
return(undefined);
}
this.timeline.attachMovie("floating_bubble", "bubble" + this.depth, this.depth++);
var _mc = this.timeline["bubble" + this.depth];
_mc._width = size;
_mc._height = size;
_mc._x = this.timeline.bubble_maker._x + ((Math.sign(this.timeline.bubble_maker._xscale) * size) / 2);
_mc._y = this.timeline.bubble_maker._y;
var temp_speed = (this.flying_speed + (this.current_level * this.flying_speed_increase));
_mc.speed = Math.randf(temp_speed - this.flying_speed_deviation, temp_speed + this.flying_speed_deviation);
_mc.current_angle = 0;
_mc.tween_angle = 0;
this.bubbles.push(_mc);
this.num_bubbles_left--;
this.check_bubble_captures(_mc);
};
BeeGame.prototype.check_bubble_captures = function (bubble_mc) {
this.caught_quiz_object = false;
var num_flying = this.check_flying_captures(bubble_mc);
var num_flying_falling = this.check_flying_falling_captures(bubble_mc);
var num_special = this.check_special_captures(bubble_mc);
var num_power_ups = this.check_power_up_captures(bubble_mc);
var flying_score = (num_flying * (this.flying_points + (this.current_level * this.flying_points_increase)));
var flying_falling_score = (num_flying_falling * (this.flying_falling_points + (this.current_level * this.flying_falling_points_increase)));
var special_score = (num_special * (this.special_points + (this.current_level * this.special_points_increase)));
var points = ((((flying_score + flying_falling_score) + special_score) * this.multiple_catch_factor) * ((num_flying + num_flying_falling) + num_special));
this.score = this.score + points;
if (0 < points) {
this.timeline.attachMovie("score_display", "score" + this.depth, this.depth++);
var score_mc = this.timeline["score" + this.depth];
score_mc.points = points;
score_mc._x = bubble_mc._x;
score_mc._y = bubble_mc._y;
}
var n = ((num_flying + num_flying_falling) + num_special);
if (n == 1) {
this.play_sound("capture");
} else if (0 < n) {
this.play_sound("special_capture");
}
if ((this.starting_level_score + this.next_level_points) < this.score) {
this.current_level++;
this.initialize_level();
}
if (((this.last_time_bonus_score + this.time_bonus_points) + (this.current_level * this.time_bonus_points_increase)) < this.score) {
this.start_time = this.start_time + (this.time_bonus + (this.current_level * this.time_bonus_increase));
this.last_time_bonus_score = this.score;
this.timeline.attachMovie("score_display", "bonus" + this.depth, this.depth++);
var bonus_mc = this.timeline["bonus" + this.depth];
bonus_mc.points = "Time Bonus!";
bonus_mc._x = bubble_mc._x;
bonus_mc._y = bubble_mc._y - 20;
}
if (this.caught_quiz_object) {
this.paused = true;
this.create_quiz();
}
};
BeeGame.prototype.create_quiz = function () {
this.quiz_start_time = getTimer();
this.timeline.quiz_prompt.play();
var question = this.questions.shift();
this.questions.push(question);
this.timeline.quiz_prompt.question = question.text;
var j = 0;
while (j < this.num_choices_per_question) {
var choice_mc = this.timeline.quiz_prompt["choice" + j];
choice_mc.index = String.fromCharCode(j + 65);
choice_mc.field = question.choices[j];
choice_mc.correct = j == question.answer;
j++;
}
};
BeeGame.prototype.evaluate_answer = function (choice_mc) {
if (choice_mc.correct) {
this.correct_answer();
} else {
this.incorrect_answer();
}
};
BeeGame.prototype.correct_answer = function () {
this.score = this.score + this.correct_points;
this.timeline.quiz_prompt.gotoAndPlay("Correct");
};
BeeGame.prototype.incorrect_answer = function () {
this.score = this.score + this.incorrect_points;
this.timeline.quiz_prompt.gotoAndPlay("Incorrect");
};
BeeGame.prototype.answer_prompt_done = function () {
this.start_time = this.start_time + (getTimer() - this.quiz_start_time);
this.paused = false;
};
BeeGame.prototype.check_flying_captures = function (bubble_mc) {
var num = 0;
var j = 0;
while (j < this.flying_objects.length) {
var flying_mc = this.flying_objects[j];
if ((!flying_mc.riding) && (bubble_mc.hitTest(flying_mc._x, flying_mc._y, true))) {
if (flying_mc.capturer_mc == undefined) {
num++;
flying_mc.capturer_mc = bubble_mc;
if (flying_mc.quiz) {
this.caught_quiz_object = true;
num--;
}
}
}
j++;
}
return(num);
};
BeeGame.prototype.check_flying_falling_captures = function (bubble_mc) {
var num = 0;
var j = 0;
while (j < this.flying_objects.length) {
var flying_mc = this.flying_objects[j];
if (flying_mc.riding && (bubble_mc.hitTest(flying_mc._x, flying_mc._y, true))) {
if (flying_mc.capturer_mc == undefined) {
num++;
flying_mc.capturer_mc = bubble_mc;
if (flying_mc.quiz) {
this.caught_quiz_object = true;
num--;
}
}
}
j++;
}
return(num);
};
BeeGame.prototype.check_special_captures = function (bubble_mc) {
var num = 0;
var j = 0;
while (j < this.special_objects.length) {
var special_mc = this.special_objects[j];
if (bubble_mc.hitTest(special_mc._x, special_mc._y, true)) {
if (special_mc.capturer_mc == undefined) {
num++;
special_mc.capturer_mc = bubble_mc;
}
}
j++;
}
return(num);
};
BeeGame.prototype.check_power_up_captures = function (bubble_mc) {
var num = 0;
var j = 0;
while (j < this.power_ups.length) {
var power_up_mc = this.power_ups[j];
if (bubble_mc.hitTest(power_up_mc._x, power_up_mc._y, true)) {
if (power_up_mc.capturer_mc == undefined) {
num++;
power_up_mc.capturer_mc = bubble_mc;
if (power_up_mc.type == "bubbles_power_up") {
this.num_bubbles_left = Math.min(this.num_bubbles_left + this.bubbles_power_up, this.initial_bubbles);
} else if (power_up_mc.type == "clock_power_up") {
this.start_time = this.start_time + this.time_power_up;
this.timeline.attachMovie("score_display", "bonus" + this.depth, this.depth++);
var bonus_mc = this.timeline["bonus" + this.depth];
bonus_mc.points = "Time Bonus!";
bonus_mc._x = bubble_mc._x;
bonus_mc._y = bubble_mc._y - 20;
}
}
}
j++;
}
};
BeeGame.prototype.check_game_over = function () {
if ((0 >= this.current_time) || (0 >= this.num_bubbles_left)) {
this.game_over();
}
};
BeeGame.prototype.game_over = function () {
Mouse.show();
_root.gotoAndStop("Game Over");
};
BeeGame.prototype.play_sound = function (linkage) {
var _sound = new Sound();
_sound.attachSound(linkage);
_sound.start(0, 1);
};
this._x = 0;
this._y = 0;
game = new BeeGame();
_root._quality = "MEDIUM";
Instance of Symbol 342 MovieClip "controller" in Symbol 420 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
onClipEvent (data) {
_parent.game.num_choices_per_question = Number(num_choices_per_question);
_parent.game.questions = new Array();
var j = 0;
while (j >= 0) {
if (this[("question" + j) + "_text"] == undefined) {
break;
}
_parent.game.questions[j] = new Object();
_parent.game.questions[j].text = this[("question" + j) + "_text"];
_parent.game.questions[j].answer = Number(this[("question" + j) + "_answer"]);
_parent.game.questions[j].choices = new Array();
var k = 0;
while (k < _parent.game.num_choices_per_question) {
_parent.game.questions[j].choices[k] = this[(("question" + j) + "_choice") + k];
k++;
}
j++;
}
if (_parent.game.shuffle_questions == "True") {
_parent.game.questions.shuffle();
}
_parent.game.initialize();
}
onClipEvent (mouseDown) {
if (!_parent.game.paused) {
_parent.game.mouse_down();
}
}
onClipEvent (mouseUp) {
if (!_parent.game.paused) {
_parent.game.mouse_up();
}
}
onClipEvent (enterFrame) {
if (!_parent.game.paused) {
_parent.game.action();
}
}
Instance of Symbol 402 MovieClip "quiz_prompt" in Symbol 420 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(16005);
}
Instance of Symbol 419 MovieClip "level_prompt" in Symbol 420 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(16001);
}
Symbol 424 Button
on (press) {
_root.gotoAndStop("Starting Screen");
}