Instance of Symbol 214 MovieClip in Frame 1
//component parameters
onClipEvent (construct) {
xin_motion_val = "Down";
xin_alphatype_val = "Yes";
xout_motion_val = "Down";
xout_alphatype_val = "Yes";
perc_req_val = 90;
show_perc_val = "Yes";
slow_factor_val = 0.3;
init_action_val = "_parent.stop();";
play_action_val = "_parent.play();";
}
Frame 128
stop();
Frame 129
stop();
Instance of Symbol 204 MovieClip [RoadRampageGame] in Frame 129
//component parameters
onClipEvent (construct) {
cp_up_linkage = [];
cp_up_linkage[0] = "side_up1";
cp_up_linkage[1] = "side_up2";
cp_up_linkage[2] = "side_up3";
cp_up_linkage[3] = "side_up4";
cp_up_linkage[4] = "tree0";
cp_up_linkage[5] = "tree1";
cp_up_linkage[6] = "tree2";
cp_up_linkage[7] = "tree3";
cp_up_linkage[8] = "tree4";
cp_down_linkage = [];
cp_down_linkage[0] = "tree0";
cp_down_linkage[1] = "tree1";
cp_down_linkage[2] = "tree2";
cp_down_linkage[3] = "tree3";
cp_down_linkage[4] = "tree4";
cp_down_linkage[5] = "side_down1";
cp_down_linkage[6] = "side_down2";
cp_down_linkage[7] = "side_down3";
cp_down_linkage[8] = "side_down4";
cp_obstacles_road_linkage = [];
cp_obstacles_road_linkage[0] = "obstacle0";
cp_obstacles_road_linkage[1] = "obstacle1";
cp_obstacles_road_linkage[2] = "obstacle2";
cp_obstacles_road_linkage[3] = "obstacle3";
cp_obstacles_road_linkage[4] = "obstacle4";
cp_obstacles_road_linkage[5] = "obstacle5";
cp_obstacles_hole_linkage = [];
cp_obstacles_hole_linkage[0] = "obstaclehole1";
cp_obstacles_hole_linkage[1] = "obstaclehole2";
cp_obstacles_hole_linkage[2] = "obstaclehole3";
cp_obstacles_hole_linkage[3] = "obstaclehole4";
cp_obstacles_moving_linkage = [];
cp_obstacles_moving_linkage[0] = "moving1";
cp_obstacles_moving_linkage[1] = "moving2";
cp_obstacles_moving_linkage[2] = "moving3";
cp_obstacles_moving_linkage[3] = "moving4";
cp_moving_points = 20;
cp_new_obstacle_delay = 0.5;
cp_new_moving_obstacle_delay = 3.5;
cp_repair_delay = 3;
cp_reload_delay = 4;
cp_repair_linkage = "repair";
cp_speed_increase = 0.1;
cp_speed_freq = 10;
cp_bonus_linkage = "bonus";
cp_reload_linkage = "reload";
cp_shield_linkage = "shield";
cp_bad_linkage = "bad";
cp_bad_points = -10;
cp_min_speed = 7;
cp_max_speed = 15;
cp_num_bullets = 5;
cp_bonus_points = 1000;
cp_shield_time = 3;
cp_car_accuracy = 15;
cp_tree_spacing = 150;
cp_left_tree_x = 40;
cp_right_tree_x = 610;
cp_up_tree_y = 20;
cp_down_tree_y = 450;
cp_num_fall_game_over = 6;
cp_direction = "Right to Left";
}
Frame 130
stop();
Frame 131
stop();
Symbol 10 MovieClip [explosion1] Frame 17
this._parent._unloadMovie();
Instance of Symbol 13 MovieClip "hit_mc" in Symbol 14 MovieClip [obstacle5] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 13 MovieClip "hit_mc" in Symbol 16 MovieClip [obstacle4] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 13 MovieClip "hit_mc" in Symbol 18 MovieClip [obstaclehole4] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 13 MovieClip "hit_mc" in Symbol 20 MovieClip [obstaclehole3] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 13 MovieClip "hit_mc" in Symbol 22 MovieClip [obstacle3] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 13 MovieClip "hit_mc" in Symbol 24 MovieClip [obstaclehole1] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 13 MovieClip "hit_mc" in Symbol 26 MovieClip [obstacle2] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 13 MovieClip "hit_mc" in Symbol 28 MovieClip [obstacle1] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 13 MovieClip "hit_mc" in Symbol 30 MovieClip [obstacle0] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 37 MovieClip [small poof] Frame 18
this._parent.remove_me(this);
Symbol 47 MovieClip [big poof] Frame 19
this._parent.remove_me(this);
Symbol 54 MovieClip [explosion] Frame 17
this._parent._unloadMovie();
Instance of Symbol 13 MovieClip "hit_mc" in Symbol 62 MovieClip [moving4] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 13 MovieClip "hit_mc" in Symbol 67 MovieClip [moving3] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 13 MovieClip "hit_mc" in Symbol 72 MovieClip [moving2] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 13 MovieClip "hit_mc" in Symbol 77 MovieClip [moving1] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 118 MovieClip Frame 1
stop();
Symbol 118 MovieClip Frame 2
stop();
Symbol 118 MovieClip Frame 3
stop();
Symbol 118 MovieClip Frame 4
stop();
Symbol 118 MovieClip Frame 5
stop();
Symbol 118 MovieClip Frame 6
stop();
Symbol 126 MovieClip [car] Frame 1
stop();
Instance of Symbol 13 MovieClip "hit_car_mc" in Symbol 126 MovieClip [car] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 132 Button
on (release) {
_parent.change_mode("play");
this.removeMovieClip();
}
Symbol 133 MovieClip [next_level_prompt] Frame 17
stop();
Instance of Symbol 13 MovieClip "hit_mc" in Symbol 153 MovieClip [shield] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 13 MovieClip "hit_mc" in Symbol 165 MovieClip [bonus] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 13 MovieClip "hit_mc" in Symbol 167 MovieClip [repair] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 13 MovieClip "hit_mc" in Symbol 169 MovieClip [reload] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 13 MovieClip "hit_mc" in Symbol 170 MovieClip [bullet] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 13 MovieClip "hit_mc" in Symbol 171 MovieClip [bad] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 203 MovieClip Frame 1
this._visible = false;
this.stop();
Symbol 204 MovieClip [RoadRampageGame] Frame 1
#initclip 1
RoadRampageGame = function () {
this.debug = true;
this._visible = false;
this.change_mode("loading data");
this.side_up_linkage = this.cp_up_linkage;
this.side_down_linkage = this.cp_down_linkage;
this.road_obstacles_linkage = this.cp_obstacles_road_linkage;
this.hole_obstacles_linkage = this.cp_obstacles_hole_linkage;
this.moving_obstacles_linkage = this.cp_obstacles_moving_linkage;
this.moving_points = this.cp_moving_points;
this.repair_linkage = this.cp_repair_linkage;
this.bonus_linkage = this.cp_bonus_linkage;
this.reload_linkage = this.cp_reload_linkage;
this.shield_linkage = this.cp_shield_linkage;
this.bad_linkage = this.cp_bad_linkage;
this.bad_points = this.cp_bad_points;
this.new_obstacle_delay = this.cp_new_obstacle_delay * SECOND;
this.new_moving_obstacle_delay = this.cp_new_moving_obstacle_delay * SECOND;
this.repair_delay = this.cp_repair_delay * SECOND;
this.reload_delay = this.cp_reload_delay * SECOND;
this.speed_increase = this.cp_speed_increase * SECOND;
this.speed_freq = this.cp_speed_freq * SECOND;
this.starting_bullets = this.cp_num_bullets;
this.min_speed = this.cp_min_speed;
this.max_speed = this.cp_max_speed;
this.roadster_accuracy = this.cp_car_accuracy;
this.tree_spacing = this.cp_tree_spacing;
this.left_tree_x = this.cp_left_tree_x;
this.right_tree_x = this.cp_right_tree_x;
this.up_tree_y = this.cp_up_tree_y;
this.down_tree_y = this.cp_down_tree_y;
this.bonus_points = this.cp_bonus_points;
this.shield_time = this.cp_shield_time;
this.num_fall_game_over = this.cp_num_fall_game_over;
this.direction = this.cp_direction;
this.timeline = this;
for (var _local2 in this) {
if (_local2.indexOf("cp_") != -1) {
delete this[_local2];
}
}
this.initialize();
};
RoadRampageGame.prototype = new MovieClip();
Object.registerClass("RoadRampageGame", RoadRampageGame);
Object.prototype.SECOND = 1000;
RoadRampageGame.prototype.initialize = function () {
this.initialize_variables();
this.initialize_graphics();
this.change_mode("play");
this._visible = true;
};
RoadRampageGame.prototype.initialize_variables = function () {
this._num = new Number();
this.depth = 0;
this.roadster_depth = 50000;
this.moving_obs_depth = 1000;
this.bullet_speed = 0;
this.bullet_array = new Array();
this.speed_increase_time = getTimer();
this.obstacles = new Array();
this.moving_obstacles = new Array();
this.trees = new Array();
this.stationary_obstacles_linkage = new Array();
this.score = 0;
this.straight_angle = 0.628318530717959;
this.roadster_speed = 0;
this.num_bullets = this.starting_bullets;
this.roadster_distance = 0;
this.current_level = -1;
this.tree_side = 1;
this.num_wipe_outs = 0;
this.stage_width = Stage.width;
this.stage_height = Stage.height;
this.previous_repair = -1;
this.previous_reload = -1;
this.shielded = false;
this.new_question_delay = Number.MAX_VALUE;
this.change_mode("play");
};
RoadRampageGame.prototype.initialize_graphics = function () {
this.timeline._parent.background_mc.cacheAsBitmap = true;
this.initialize_obstructions();
this.create_roadster_graphic();
this.create_question_graphic();
this.timeline.info.swapDepths(this.roadster_depth + 1);
this.obstacleID = setInterval(this.timeline, "add_obstacle", this.new_obstacle_delay, "normal");
this.movingObstacleID = setInterval(this.timeline, "add_moving_obstacle", this.new_moving_obstacle_delay);
this.repairID = setInterval(this.timeline, "add_obstacle", this.repair_delay, "repair");
this.reloadID = setInterval(this.timeline, "add_obstacle", this.reload_delay, "reload");
};
RoadRampageGame.prototype.initialize_obstructions = function () {
var _local2 = 0;
while (_local2 < this.road_obstacles_linkage.length) {
var _local3 = new Object();
_local3.linkage = this.road_obstacles_linkage[_local2];
_local3.type = "normal";
this.stationary_obstacles_linkage.push(_local3);
_local2++;
}
_local2 = 0;
while (_local2 < this.hole_obstacles_linkage.length) {
var _local3 = new Object();
_local3.linkage = this.hole_obstacles_linkage[_local2];
_local3.type = "hole";
this.stationary_obstacles_linkage.push(_local3);
_local2++;
}
var _local3 = new Object();
_local3.linkage = this.bonus_linkage;
_local3.type = "bonus";
this.stationary_obstacles_linkage.push(_local3);
_local3 = new Object();
_local3.linkage = this.shield_linkage;
_local3.type = "shield";
this.stationary_obstacles_linkage.push(_local3);
_local3 = new Object();
_local3.linkage = this.bad_linkage;
_local3.type = "bad";
this.stationary_obstacles_linkage.push(_local3);
};
RoadRampageGame.prototype.create_roadster_graphic = function () {
this.timeline.attachMovie("car", "roadster", this.roadster_depth);
this.timeline.roadster.cacheAsBitmap = true;
this.timeline.roadster.shield_mc._visible = false;
if (this.direction == "Up to Down") {
this.timeline.roadster._x = this.stage_width / 2;
this.timeline.roadster._y = this.stage_height;
} else if (this.direction == "Down to Up") {
this.timeline.roadster._x = this.stage_width / 2;
this.timeline.roadster._y = 0;
} else if (this.direction == "Left to Right") {
this.timeline.roadster._x = this.stage_width;
this.timeline.roadster._y = this.stage_height / 2;
} else if (this.direction == "Right to Left") {
this.timeline.roadster._x = 0;
this.timeline.roadster._y = this.stage_height / 2;
}
this.timeline.roadster._xscale = (this.timeline.roadster._yscale = 80);
};
RoadRampageGame.prototype.onEnterFrame = function () {
if ((this.mode == "play") || (this.mode == "wiped_out")) {
this.check_add_tree();
this.apply_roadster_physics();
this.animate_game_objects();
this.update_variables();
}
};
RoadRampageGame.prototype.add_obstacle = function (new_type) {
if (this.mode != "play") {
return(undefined);
}
if (new_type == "normal") {
clearInterval(this.obstacleID);
var _local3 = this.stationary_obstacles_linkage.rande();
this.obstacleID = setInterval(this.timeline, "add_obstacle", this.new_obstacle_delay, "normal");
} else if (new_type == "repair") {
clearInterval(this.repairID);
var _local3 = new Object();
_local3.linkage = this.repair_linkage;
_local3.type = "repair";
this.repair_delay = this.repair_delay + (this.speed_increase / 10);
this.repairID = setInterval(this.timeline, "add_obstacle", this.repair_delay, "repair");
} else if (new_type == "reload") {
clearInterval(this.reloadID);
var _local3 = new Object();
_local3.linkage = this.reload_linkage;
_local3.type = "reload";
this.reload_delay = this.reload_delay + (this.speed_increase / 10);
this.reloadID = setInterval(this.timeline, "add_obstacle", this.reload_delay, "reload");
}
this.depth++;
if (this.depth >= this.moving_obs_depth) {
this.depth = 1;
}
var _local2 = this.timeline.attachMovie(_local3.linkage, "obstacle" + this.depth, this.depth);
_local2.cacheAsBitmap = true;
_local2.linkage = _local3.linkage;
_local2.type = _local3.type;
if (this.direction == "Up to Down") {
_local2._x = this._num.randf(this.left_tree_x + (_local2._width / 2), this.right_tree_x - (_local2._width / 2));
_local2._y = (-_local2._height) / 2;
} else if (this.direction == "Down to Up") {
_local2._x = this._num.randf(this.left_tree_x + (_local2._width / 2), this.right_tree_x - (_local2._width / 2));
_local2._y = this.stage_height + (_local2._height / 2);
} else if (this.direction == "Left to Right") {
_local2._x = (-_local2._width) / 2;
_local2._y = this._num.randf(this.up_tree_y + (_local2._height / 2), this.down_tree_y - (_local2._height / 2));
} else if (this.direction == "Right to Left") {
_local2._x = this.stage_width + (_local2._width / 2);
_local2._y = this._num.randf(this.up_tree_y + (_local2._height / 2), this.down_tree_y - (_local2._height / 2));
}
_local2._scale = (_local2._yscale = 80);
this.obstacles.push(_local2);
};
RoadRampageGame.prototype.add_moving_obstacle = function () {
if (this.mode != "play") {
return(undefined);
}
clearInterval(this.movingObstacleID);
var _local3 = this.moving_obstacles_linkage.rande();
this.moving_obs_depth++;
if (this.moving_obs_depth >= this.roadster_depth) {
this.moving_obs_depth = 1000;
this.depth = 1;
}
var _local2 = this.timeline.attachMovie(_local3, "obstacle" + this.moving_obs_depth, this.moving_obs_depth);
_local2.cacheAsBitmap = true;
_local2.linkage = _local3;
_local2.type = "car";
if (this.direction == "Up to Down") {
_local2._x = this._num.randf(this.left_tree_x + (_local2._width / 2), this.right_tree_x - (_local2._width / 2));
_local2._y = (-_local2._height) / 2;
} else if (this.direction == "Down to Up") {
_local2._x = this._num.randf(this.left_tree_x + (_local2._width / 2), this.right_tree_x - (_local2._width / 2));
_local2._y = this.stage_height + (_local2._height / 2);
} else if (this.direction == "Left to Right") {
_local2._x = (-_local2._width) / 2;
_local2._y = this._num.randf(this.up_tree_y + (_local2._height / 2), this.down_tree_y - (_local2._height / 2));
} else if (this.direction == "Right to Left") {
_local2._x = this.stage_width + (_local2._width / 2);
_local2._y = this._num.randf(this.up_tree_y + (_local2._height / 2), this.down_tree_y - (_local2._height / 2));
}
_local2._xscale = (_local2._yscale = 80);
this.moving_obstacles.push(_local2);
this.movingObstacleID = setInterval(this.timeline, "add_moving_obstacle", this.new_moving_obstacle_delay);
};
RoadRampageGame.prototype.check_add_tree = function () {
if ((this.roadster_distance - this.last_distance) >= this.tree_spacing) {
this.depth++;
if (this.tree_side == 1) {
var _local3 = this.side_up_linkage.rande();
} else {
var _local3 = this.side_down_linkage.rande();
}
var _local2 = this.timeline.attachMovie(_local3, "tree" + this.depth, this.depth);
_local2.cacheAsBitmap = true;
_local2.type = "tree";
if (this.direction == "Up to Down") {
if (this.tree_side == 1) {
_local2._x = this.left_tree_x;
} else {
_local2._x = this.right_tree_x;
}
_local2._y = (-_local2._height) / 2;
} else if (this.direction == "Down to Up") {
if (this.tree_side == 1) {
_local2._x = this.left_tree_x;
} else {
_local2._x = this.right_tree_x;
}
_local2._y = this.stage_height + (_local2._height / 2);
} else if (this.direction == "Left to Right") {
_local2._x = (-_local2._width) / 2;
if (this.tree_side == 1) {
_local2._y = this.up_tree_y;
} else {
_local2._y = this.down_tree_y;
}
} else if (this.direction == "Right to Left") {
_local2._x = this.stage_width + (_local2._width / 2);
if (this.tree_side == 1) {
_local2._y = this.up_tree_y;
} else {
_local2._y = this.down_tree_y;
}
}
_local2._xscale = (_local2._yscale = 80);
this.trees.push(_local2);
this.last_distance = this.roadster_distance;
this.tree_side = this.tree_side * -1;
}
};
RoadRampageGame.prototype.apply_roadster_physics = function () {
if (this.direction == "Up to Down") {
this.roadster_acceleration = ((this.timeline.roadster._y + (this.timeline.roadster._height / 2)) - _root._ymouse) / 50;
} else if (this.direction == "Down to Up") {
this.roadster_acceleration = ((this.timeline.roadster._y - (this.timeline.roadster._height / 2)) - _root._ymouse) / 50;
this.roadster_acceleration = this.roadster_acceleration * -1;
} else if (this.direction == "Left to Right") {
this.roadster_acceleration = ((this.timeline.roadster._x + (this.timeline.roadster._width / 2)) + _root._xmouse) / 50;
this.roadster_acceleration = this.roadster_acceleration * -1;
} else if (this.direction == "Right to Left") {
this.roadster_acceleration = ((this.timeline.roadster._x + (this.timeline.roadster._width / 2)) + _root._xmouse) / 50;
}
if (this.mode == "play") {
this.roadster_speed = this.roadster_speed + this.roadster_acceleration;
if (this.roadster_speed > this.max_speed) {
this.roadster_speed = this.max_speed;
} else if (this.roadster_speed < this.min_speed) {
this.roadster_speed = this.min_speed;
}
} else if (this.mode == "wiped_out") {
this.roadster_speed = this.roadster_speed - (this.roadster_speed / 30);
this.timeline.roadster._rotation = 0;
if (Math.abs(this.roadster_speed) < 5) {
this.timeline._parent.background_mc.play();
this.change_mode("play");
if (this.num_wipe_outs >= this.num_fall_game_over) {
_root.score = this.score;
this.timeline._parent.gotoAndStop("Lose");
}
}
}
this.roadster_distance = this.roadster_distance + this.roadster_speed;
};
RoadRampageGame.prototype.animate_game_objects = function () {
this.animate_roadster();
this.animate_trees();
this.animate_obstacles();
this.animate_moving_obstacles();
this.animate_bullet();
this.animate_answer_choices();
};
RoadRampageGame.prototype.animate_roadster = function () {
if (this.mode == "wiped_out") {
if ((this.direction == "Up to Down") || (this.direction == "Down to Up")) {
if (this.timeline.roadster._x <= (this.stage_width / 2)) {
var direction = 1;
} else {
var direction = -1;
}
this.timeline.roadster._x = this.timeline.roadster._x + ((this.roadster_speed * direction) * 0.333333333333333);
} else {
if (this.timeline.roadster._y <= (this.stage_height / 2)) {
var direction = 1;
} else {
var direction = -1;
}
this.timeline.roadster._y = this.timeline.roadster._y + ((this.roadster_speed * direction) * 0.333333333333333);
}
} else if (this.mode == "play") {
if (this.direction == "Up to Down") {
this.timeline.roadster._x = this.timeline.roadster._x + ((_root._xmouse - this.timeline.roadster._x) / this.roadster_accuracy);
this.timeline.roadster._y = this.timeline.roadster._y + ((_root._ymouse - (this.timeline.roadster._y - (this.timeline.roadster._height / 2))) / this.roadster_accuracy);
} else if (this.direction == "Down to Up") {
this.timeline.roadster._x = this.timeline.roadster._x + ((_root._xmouse - this.timeline.roadster._x) / this.roadster_accuracy);
this.timeline.roadster._y = this.timeline.roadster._y + ((_root._ymouse - (this.timeline.roadster._y + (this.timeline.roadster._height / 2))) / this.roadster_accuracy);
} else if (this.direction == "Left to Right") {
this.timeline.roadster._x = this.timeline.roadster._x + (((_root._xmouse - this.timeline.roadster._x) + (this.timeline.roadster._width / 2)) / this.roadster_accuracy);
this.timeline.roadster._y = this.timeline.roadster._y + ((_root._ymouse - this.timeline.roadster._y) / this.roadster_accuracy);
} else if (this.direction == "Right to Left") {
this.timeline.roadster._x = this.timeline.roadster._x + (((_root._xmouse - this.timeline.roadster._x) - (this.timeline.roadster._width / 2)) / this.roadster_accuracy);
this.timeline.roadster._y = this.timeline.roadster._y + ((_root._ymouse - this.timeline.roadster._y) / this.roadster_accuracy);
}
var _local5 = this.timeline.roadster._x - _root._xmouse;
var _local4 = this.timeline.roadster._y - _root._ymouse;
if (this.direction == "Up to Down") {
var _local3 = Math.atan2(_local5, _local4);
} else if (this.direction == "Down to Up") {
var _local3 = Math.atan2(_local5, -_local4);
} else if (this.direction == "Left to Right") {
var _local3 = Math.atan2(_local4, _local5);
} else if (this.direction == "Right to Left") {
var _local3 = Math.atan2(_local4, -_local5);
}
this.timeline.roadster._rotation = ((-0.333333333333333 * _local3) * 180) / Math.PI;
this.timeline.roadster.angle = _local3;
this.old_frame = this.timeline.roadster._currentframe;
if (Math.abs(_local3) < this.straight_angle) {
this.timeline.roadster.gotoAndStop("Straight");
} else if (_local3 > 0) {
this.timeline.roadster.gotoAndStop("Turn Left");
} else if (_local3 < 0) {
this.timeline.roadster.gotoAndStop("Turn Right");
}
this.timeline.roadster.main_car.gotoAndStop(this.num_wipe_outs + 1);
var _local6 = this.timeline.roadster._currentframe;
if ((this.old_frame != _local6) && (_local3 > (1.2 * this.straight_angle))) {
this.play_sound(["skids1", "skids2"].rande());
}
if ((this.old_frame != _local6) && (_local3 < (-1.2 * this.straight_angle))) {
this.play_sound(["skids1", "skids2"].rande());
}
}
};
RoadRampageGame.prototype.animate_trees = function () {
var _local3 = 0;
while (_local3 < this.trees.length) {
var _local2 = this.trees[_local3];
if (this.direction == "Up to Down") {
_local2._y = _local2._y + this.roadster_speed;
} else if (this.direction == "Down to Up") {
_local2._y = _local2._y - this.roadster_speed;
} else if (this.direction == "Left to Right") {
_local2._x = _local2._x + this.roadster_speed;
} else if (this.direction == "Right to Left") {
_local2._x = _local2._x - this.roadster_speed;
}
if (this.obstacle_off_stage(_local2)) {
this.trees = this.trees.remove_element(_local2);
_local2.removeMovieClip();
}
if ((this.mode != "wiped_out") && (this.wipeout_object != _local2)) {
if (_local2.hitTest(this.timeline.roadster.hit_area)) {
if (!this.shielded) {
this.wipe_out(_local2);
} else {
this.play_sound("hitwithshield");
}
}
}
_local3++;
}
};
RoadRampageGame.prototype.animate_obstacles = function () {
j = this.obstacles.length - 1;
while (j >= 0) {
var _local2 = this.obstacles[j];
if (this.direction == "Up to Down") {
_local2._y = _local2._y + this.roadster_speed;
} else if (this.direction == "Down to Up") {
_local2._y = _local2._y - this.roadster_speed;
} else if (this.direction == "Left to Right") {
_local2._x = _local2._x + this.roadster_speed;
} else if (this.direction == "Right to Left") {
_local2._x = _local2._x - this.roadster_speed;
}
if (this.obstacle_off_stage(_local2)) {
this.obstacles = this.obstacles.remove_element(_local2);
_local2.removeMovieClip();
}
if ((_local2.hit_mc.hitTest(this.timeline.roadster.hit_area) && (this.mode != "wiped_out")) && (this.wipeout_object != _local2)) {
if ((_local2.type == "normal") || (_local2.type == "hole")) {
if (!this.shielded) {
this.wipe_out(_local2);
} else {
this.play_sound("hitwithshield");
}
} else if (_local2.type == "repair") {
this.repair_car();
this.obstacles = this.obstacles.remove_element(_local2);
_local2.removeMovieClip();
} else if (_local2.type == "shield") {
this.shield_car();
this.obstacles = this.obstacles.remove_element(_local2);
_local2.removeMovieClip();
} else if (_local2.type == "reload") {
this.reload_car();
this.obstacles = this.obstacles.remove_element(_local2);
_local2.removeMovieClip();
} else if (_local2.type == "bonus") {
this.get_bonus();
this.obstacles = this.obstacles.remove_element(_local2);
_local2.removeMovieClip();
} else if (_local2.type == "bad") {
if (!this.shielded) {
this.wipe_out(_local2);
this.obstacles = this.obstacles.remove_element(_local2);
_local2.removeMovieClip();
this.get_bad();
} else {
this.play_sound("hitwithshield");
}
}
}
j--;
}
};
RoadRampageGame.prototype.animate_moving_obstacles = function () {
var _local3 = this.moving_obstacles.length - 1;
while (_local3 >= 0) {
var _local2 = this.moving_obstacles[_local3];
if (this.direction == "Up to Down") {
_local2._y = _local2._y + (this.roadster_speed * 0.5);
} else if (this.direction == "Down to Up") {
_local2._y = _local2._y - (this.roadster_speed * 0.5);
} else if (this.direction == "Left to Right") {
_local2._x = _local2._x + (this.roadster_speed * 0.5);
} else if (this.direction == "Right to Left") {
_local2._x = _local2._x - (this.roadster_speed * 0.5);
}
if (this.obstacle_off_stage(_local2)) {
this.moving_obstacles = this.moving_obstacles.remove_element(_local2);
_local2.removeMovieClip();
}
if ((this.mode != "wiped_out") && (this.wipeout_object != _local2)) {
if (_local2.hit_mc.hitTest(this.timeline.roadster.hit_car_mc)) {
if (!this.shielded) {
this.wipe_out(_local2);
return(undefined);
}
this.play_sound("hitwithshield");
}
}
if (_local2.hit_mc.hitTest(this.timeline.roadster.hit_car_mc)) {
this.adjust_cars(_local2);
}
_local3--;
}
};
RoadRampageGame.prototype.adjust_cars = function (_mc) {
var _local5 = {x:this.timeline.roadster.hit_car_mc._x, y:this.timeline.roadster.hit_car_mc._y};
this.timeline.roadster.hit_car_mc.localToGlobal(_local5);
var _local7 = this.timeline.roadster.hit_car_mc._width / 2;
var _local6 = this.timeline.roadster.hit_car_mc._height / 2;
var _local3 = [_local5.x - _local7, _local5.y - _local6, _local5.x + _local7, _local5.y + _local6];
_local5 = {x:_mc.hit_mc._x, y:_mc.hit_mc._y};
_mc.hit_mc.localToGlobal(_local5);
_local7 = _mc.hit_mc._width / 2;
_local6 = _mc.hit_mc._height / 2;
var _local2 = [_local5.x - _local7, _local5.y - _local6, _local5.x + _local7, _local5.y + _local6];
if ((_local3[2] > _local2[0]) && (_local3[0] < _local2[0])) {
var _local8 = _local3[2] - _local2[0];
_mc._x = _mc._x + _local8;
} else if ((_local3[0] < _local2[2]) && (_local3[2] > _local2[2])) {
var _local8 = _local2[2] - _local3[0];
_mc._x = _mc._x - _local8;
}
if ((_local3[3] > _local2[1]) && (_local3[1] < _local2[1])) {
var _local8 = _local3[3] - _local2[1];
_mc._y = _mc._y + _local8;
} else if ((_local3[1] < _local2[3]) && (_local3[3] > _local2[3])) {
var _local8 = _local2[3] - _local3[1];
_mc._y = _mc._y - _local8;
}
};
RoadRampageGame.prototype.animate_bullet = function () {
var _local3 = this.bullet_array.length - 1;
while (_local3 >= 0) {
var _local2 = this.bullet_array[_local3];
if (_local2 != undefined) {
if (this.direction == "Up to Down") {
_local2._y = _local2._y - _local2.bullet_speed;
_local2._x = _local2._x + (_local2.bullet_angle * 5);
} else if (this.direction == "Down to Up") {
_local2._y = _local2._y + _local2.bullet_speed;
_local2._x = _local2._x - (_local2.bullet_angle * 5);
} else if (this.direction == "Left to Right") {
_local2._x = _local2._x - _local2.bullet_speed;
_local2._y = _local2._y + (_local2.bullet_angle * 5);
} else if (this.direction == "Right to Left") {
_local2._x = _local2._x + _local2.bullet_speed;
_local2._y = _local2._y - (_local2.bullet_angle * 5);
}
if (this.bullet_hit(_local2)) {
this.bullet_array = this.bullet_array.remove_element(_local2);
this.play_sound("explode");
_local2.removeMovieClip();
}
if (this.bullet_off_stage(_local2)) {
this.bullet_array = this.bullet_array.remove_element(_local2);
_local2.removeMovieClip();
}
}
_local3--;
}
};
RoadRampageGame.prototype.bullet_hit = function (_mc_bullet) {
var _local5 = this.moving_obstacles.length - 1;
while (_local5 >= 0) {
var _local4 = this.moving_obstacles[_local5];
if (_mc_bullet.hit_mc.hitTest(_local4.hit_mc)) {
this.moving_obstacles = this.moving_obstacles.remove_element(_local4);
_local4.removeMovieClip();
this.moving_obs_depth++;
_local4 = this.timeline.attachMovie("big poof", "explosion_big", this.moving_obs_depth);
_local4._x = _mc_bullet._x + (_mc_bullet._width / 2);
_local4._y = _mc_bullet._y;
_local4.cacheAsBitmap = true;
this.bullet_speed = this.roadster_speed * 0.5;
this.score = this.score + this.moving_points;
_local4._yscale = (_local4._xscale = 80);
return(true);
}
_local5--;
}
_local5 = this.obstacles.length - 1;
while (_local5 >= 0) {
var _local4 = this.obstacles[_local5];
if (_local4.type == "normal") {
if (_mc_bullet.hit_mc.hitTest(_local4)) {
this.obstacles = this.obstacles.remove_element(_local4);
this.moving_obs_depth++;
var _local3 = this.timeline.attachMovie("small poof", "explosion_small", this.moving_obs_depth);
_local3._x = _mc_bullet._x + (_mc_bullet._width / 2);
_local3._y = _mc_bullet._y;
_local3._xscale = (_local3._yscale = 80);
_local3.cacheAsBitmap = true;
_local4.removeMovieClip();
return(true);
}
}
_local5--;
}
return(false);
};
RoadRampageGame.prototype.remove_me = function (_mc) {
_mc.removeMovieClip();
};
RoadRampageGame.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 ((_mc._y + (_mc._height / 2)) <= 0) {
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 ((_mc._x + (_mc._width / 2)) <= 0) {
return(true);
}
}
return(false);
};
RoadRampageGame.prototype.bullet_off_stage = function (_mc) {
if (this.direction == "Down to Up") {
if ((_mc._y - (_mc._height / 2)) >= this.stage_height) {
return(true);
}
} else if (this.direction == "Up to Down") {
if ((_mc._y + (_mc._height / 2)) <= 0) {
return(true);
}
} else if (this.direction == "Right to Left") {
if ((_mc._x - (_mc._width / 2)) >= this.stage_width) {
return(true);
}
} else if (this.direction == "Left to Right") {
if ((_mc._x + (_mc._width / 2)) <= 0) {
return(true);
}
}
return(false);
};
RoadRampageGame.prototype.update_variables = function () {
this.timeline.info.player_score = this.score;
this.timeline.info.lives = this.num_fall_game_over - this.num_wipe_outs;
this.timeline.info.bullets = this.num_bullets;
if ((getTimer() - this.speed_increase_time) >= this.speed_freq) {
this.speed_increase_time = getTimer();
this.new_obstacle_delay = this.new_obstacle_delay - (this.speed_increase / 10);
if (this.new_obstacle_delay < 300) {
this.new_obstacle_delay = 300;
}
this.new_moving_obstacle_delay = this.new_moving_obstacle_delay - this.speed_increase;
if (this.new_moving_obstacle_delay < 1500) {
this.new_moving_obstacle_delay = 1500;
}
}
};
RoadRampageGame.prototype.wipe_out = function (_who) {
this.change_mode("wiped_out");
this.num_wipe_outs++;
this.timeline.roadster.gotoAndStop("Wipe Out");
this.timeline.roadster.main_car.gotoAndStop(this.num_wipe_outs + 1);
this.timeline.roadster.main_car.car.stop();
this.timeline._parent.background_mc.stop();
if (this.num_wipe_outs == this.num_fall_game_over) {
this.play_sound("finalcrash");
} else if (this.num_wipe_outs == (this.num_fall_game_over - 1)) {
this.play_sound("almostfinalcrash");
} else if (_who.type == "car") {
this.play_sound(["hitcar1", "hitcar2", "hitcar3"].rande());
} else {
this.play_sound(["hitobs1", "hitobs2", "hitobs3"].rande());
}
this.wipeout_object = _who;
};
RoadRampageGame.prototype.repair_car = function () {
this.num_wipe_outs--;
if (this.num_wipe_outs < 0) {
this.num_wipe_outs = 0;
}
this.timeline.roadster.gotoAndStop(1);
this.timeline.roadster.main_car.prevFrame();
this.play_sound("hitrepair");
};
RoadRampageGame.prototype.shield_car = function () {
this.timeline.roadster.shield_mc._visible = true;
this.play_sound("hitshield");
this.shieldID = setInterval(this.timeline, "clear_shield", this.shield_time * SECOND);
this.shielded = true;
};
RoadRampageGame.prototype.clear_shield = function () {
clearInterval(this.shieldID);
this.timeline.roadster.shield_mc._visible = false;
this.shielded = false;
};
RoadRampageGame.prototype.reload_car = function () {
this.num_bullets = this.starting_bullets;
this.play_sound("reload");
};
RoadRampageGame.prototype.get_bonus = function () {
this.score = this.score + this.bonus_points;
this.play_sound("powerup");
};
RoadRampageGame.prototype.get_bad = function (_mc) {
this.score = this.score + this.bad_points;
this.play_sound("hitbad");
};
RoadRampageGame.prototype.onMouseDown = function () {
if ((this.num_bullets > 0) && (this.mode == "play")) {
this.moving_obs_depth++;
var _local2 = this.timeline.attachMovie("bullet", "bullet" + this.moving_obs_depth, this.moving_obs_depth);
_local2._x = this.timeline.roadster._x + (this.timeline.roadster._width / 2);
_local2._y = this.timeline.roadster._y;
_local2.cacheAsBitmap = true;
_local2.bullet_speed = this.roadster_speed * 0.5;
_local2.bullet_angle = this.timeline.roadster.angle;
_local2._rotation = this.timeline.roadster._rotation;
_local2._yscale = (_local2._xscale = 80);
this.num_bullets--;
this.play_sound("shoot");
this.bullet_array.push(_local2);
}
};
RoadRampageGame.prototype.play_sound = function (linkage) {
this.sound_mc.gotoAndStop(linkage);
this.sound_mc.gotoAndStop(1);
};
RoadRampageGame.prototype.change_mode = function (new_mode) {
this.old_mode = this.mode;
this.mode = new_mode;
};
#endinitclip
MovieClip.prototype.playing = false;
MovieClip.prototype.mouseOver = false;
MovieClip.prototype._currentlabel = "";
MovieClip.prototype.intersects = function (_mc, align_x, align_y) {
var _local3 = new Array();
var _local2 = new Array();
switch (align_x) {
case "center" :
_local3.push(this._x - (this._width / 2));
_local3.push(this._x + (this._width / 2));
_local2.push(_mc._x - (_mc._width / 2));
_local2.push(_mc._x + (_mc._width / 2));
break;
case "left" :
_local3.push(this._x);
_local3.push(this._x + this._width);
_local2.push(_mc._x);
_local2.push(_mc._x + _mc._width);
break;
case "right" :
_local3.push(this._x - this._width);
_local3.push(this._x);
_local2.push(_mc._x - _mc._width);
_local2.push(_mc._x);
}
switch (align_y) {
case "center" :
_local3.push(this._y - (this._height / 2));
_local3.push(this._y + (this._height / 2));
_local2.push(_mc._y - (_mc._height / 2));
_local2.push(_mc._y + (_mc._height / 2));
break;
case "top" :
_local3.push(this._y);
_local3.push(this._y + this._height);
_local2.push(_mc._y);
_local2.push(_mc._y + _mc._height);
break;
case "bottom" :
_local3.push(this._y - this._height);
_local3.push(this._y);
_local2.push(_mc._y - _mc._height);
_local2.push(_mc._y);
}
if ((_local3[0] < _local2[0]) && (_local3[1] > _local2[0])) {
return(1);
}
if ((_local3[0] < _local2[1]) && (_local3[1] > _local2[1])) {
return(1);
}
if ((_local3[2] < _local2[2]) && (_local3[3] > _local2[2])) {
return(2);
}
if ((_local3[2] < _local2[3]) && (_local3[3] > _local2[3])) {
return(2);
}
return(0);
};
MovieClip.prototype._play = function () {
this.playing = true;
this.play();
};
MovieClip.prototype._stop = function () {
this.playing = false;
this.stop();
};
MovieClip.prototype._gotoAndPlay = function (frame) {
this.playing = true;
if (typeof(frame) == "string") {
this._currentlabel = frame;
}
this.gotoAndPlay(frame);
};
MovieClip.prototype._gotoAndStop = function (frame) {
this.playing = false;
if (typeof(frame) == "string") {
this._currentlabel = frame;
}
this.gotoAndStop(frame);
};
MovieClip.prototype.hasLabel = function (label) {
this.duplicateMovieClip("__TEMP__", 97324, {_x:-1, _y:-1, _visible:false, _width:1, _height:1});
new Sound(this._parent.__TEMP__).setVolume(0);
this._parent.__TEMP__.gotoAndStop(label);
var _local3 = this._parent.__TEMP__._currentframe;
this._parent.__TEMP__.nextFrame();
this._parent.__TEMP__.gotoAndStop(label);
var _local4 = this._parent.__TEMP__._currentframe;
var _local2 = _local3 == _local4;
this._parent.__TEMP__.removeMovieClip();
return(_local2);
};
MovieClip.prototype.gotoAndPlayRandom = function () {
var _local2 = new Number();
this._gotoAndPlay(_local2.randi(1, this._totalframes + 1));
};
MovieClip.prototype.gotoAndStopRandom = function () {
var _local2 = new Number();
this._gotoAndStop(_local2.randi(1, this._totalframes + 1));
};
Number.prototype.isOdd = function (x) {
return(x % 2);
};
Number.prototype.randi = function (a, b) {
return(Math.floor(Math.random() * (b - a)) + Math.floor(a));
};
Number.prototype.randf = function (a, b) {
return((Math.random() * (b - a)) + a);
};
Array.prototype.swap_elements = function (a, b) {
var _local2 = this[a];
this[a] = this[b];
this[b] = _local2;
};
Array.prototype.copy = function (_array) {
var _local2 = 0;
while (_local2 < _array.length) {
this[_local2] = _array[_local2];
_local2++;
}
return(this);
};
Array.prototype.swap_elements2D = function (a, b, c, d) {
if ((a == c) && (b == d)) {
return(undefined);
}
var _local3 = this[a][b];
this[a][b] = this[c][d];
this[c][d] = _local3;
};
Array.prototype.randomize = function () {
var _local3 = new Number();
var _local2 = 0;
while (_local2 < this.length) {
this.swap_elements(_local3.randi(0, this.length), _local3.randi(0, this.length));
_local2++;
}
};
Array.prototype.randomize2D = function () {
var _local5 = this.length;
var _local4 = this[0].length;
var _local2 = new Number();
var _local3 = 0;
while (_local3 < (_local5 * _local4)) {
this.swap_elements2D(_local2.randi(0, _local5), _local2.randi(0, _local4), _local2.randi(0, _local5), _local2.randi(0, _local4));
_local3++;
}
};
Array.prototype.build_2D_Array = function (x, y) {
var _local5 = 0;
var _local4 = 0;
var _local3 = 0;
while (_local3 < x) {
this[_local3] = new Array();
var _local2 = 0;
while (_local2 < y) {
if ((_local4 != 0) && ((_local4 % 2) == 0)) {
_local5++;
}
this[_local3][_local2] = Math.floor(_local5);
_local4++;
_local2++;
}
_local3++;
}
};
Array.prototype.return_random_element = function () {
var _local2 = new Number();
return(this[_local2.randi(0, this.length)]);
};
Array.prototype.get_random_indices = function (a, b) {
var _local2 = new Array();
var _local1 = a;
while (_local1 <= b) {
_local2.push(_local1);
_local1++;
}
_local2.randomize();
return(_local2);
};
Array.prototype.contains = function (_array) {
var _local2 = 0;
while (_local2 < _array.length) {
if (this.return_indices(_array[_local2]) == -1) {
return(false);
}
_local2++;
}
return(true);
};
Array.prototype.return_indices = function (a) {
var _local2 = 0;
while (_local2 < this.length) {
if (this[_local2] == a) {
return(_local2);
}
_local2++;
}
return(-1);
};
Array.prototype.remove_element = function (a) {
var _local2 = this.return_indices(a);
if (_local2 == -1) {
return(this);
}
var _local4 = this.slice(0, _local2);
var _local3 = this.slice(_local2 + 1, this.length);
this=_local4.concat(_local3);//parameter overwritten
_local4.concat(_local3);
return(this);
};
Array.prototype.remove_indices = function (a) {
var _local3 = this.slice(0, a);
var _local2 = this.slice(a + 1, this.length);
this=_local3.concat(_local2);//parameter overwritten
_local3.concat(_local2);
return(this);
};
Array.prototype.push_no_duplicate = function (a) {
var _local2 = this.return_indices(a);
if (_local2 == -1) {
this.push(a);
}
return(this);
};
Array.prototype.populate = function (_indices, _number, _increase) {
var _local2 = 0;
while (_local2 < _indices) {
if (_increase) {
var _local3 = _number + _local2;
} else {
var _local3 = _number;
}
if (this[_local2] == undefined) {
this.push(_local3);
} else {
this[_local2] = _local3;
}
_local2++;
}
return(this);
};
Array.NumericSortFunction = function (A, B) {
if (A < B) {
return(-1);
}
if (A > B) {
return(1);
}
return(0);
};
Array.prototype.rande = function () {
var _local2 = new Number();
return(this[_local2.randi(0, this.length)]);
};
Array.prototype.hasElement = function (e) {
var _local2 = 0;
while (_local2 < this.length) {
if (this[_local2] == e) {
return(true);
}
_local2++;
}
return(false);
};
Array.prototype.swap = function (a, b) {
var _local2 = this[a];
this[a] = this[b];
this[b] = _local2;
};
Array.prototype.removeElementByProp = function (e) {
var _local2 = 0;
while (_local2 < this.length) {
var _local3 = true;
for (var _local5 in this[_local2]) {
if (this[_local2][_local5] != e[_local5]) {
_local3 = false;
}
}
if (_local3) {
this.splice(_local2, 1);
_local2--;
}
_local2++;
}
};
Array.prototype.randomize_array_letters = function () {
var _local2 = new String();
var _local4 = 0;
while (_local4 < this.length) {
var _local5 = 0;
while (_local5 < this[_local4].length) {
_local2 = _local2 + this[_local4].charAt(_local5);
_local5++;
}
_local4++;
}
var _local8 = new Array();
_local4 = 0;
while (_local4 < this.length) {
_local8[_local4] = new String();
var _local5 = 0;
while (_local5 < this[_local4].length) {
var _local7 = new Number();
var _local3 = _local7.randi(0, _local2.length);
var _local6 = _local2.charAt(_local3);
_local2 = _local2.substr(0, _local3) + _local2.substr(_local3 + 1, _local2.length - _local3);
_local8[_local4] = _local8[_local4] + _local6;
_local5++;
}
_local4++;
}
return(_local8);
};
String.prototype.replace = function (s, r) {
var _local4 = "";
var _local2 = 0;
while (_local2 = this.indexOf(s) , _local2 != -1) {
_local4 = _local4 + (this.substr(0, _local2) + r);
this=this.substr(_local2 + s.length);//parameter overwritten
this.substr(_local2 + s.length);
}
return(_local4 + this);
};
String.prototype.return_reverse = function () {
var _local3 = "";
var _local2 = this.length - 1;
while (_local2 >= 0) {
_local3 = _local3 + this.charAt(_local2);
_local2--;
}
return(_local3);
};
String.prototype.replace_where = function (where, newChar) {
var _local2 = "";
_local2 = this.substring(0, where) + newChar;
_local2 = _local2 + this.substring(where + 1, this.length);
return(_local2);
};
String.prototype.remove_where = function (s) {
var _local2 = "";
_local2 = this.substring(0, s);
_local2 = _local2 + this.substring(s + 1, this.length);
return(_local2);
};
String.prototype.pad = function (s, n) {
var _local3 = "";
var _local2 = 0;
while (_local2 < n) {
_local3 = _local3 + s;
_local2++;
}
_local3 = _local3 + this;
return(_local3);
};
String.prototype.randomize_letters = function () {
var _local3 = new Array();
var _local2 = 0;
while (_local2 < this.length) {
_local3.push(this.charAt(_local2));
_local2++;
}
_local3.randomize();
var _local4 = new String();
_local2 = 0;
while (_local2 < _local3.length) {
_local4 = _local4 + _local3[_local2];
_local2++;
}
return(_local4);
};
_global.degreesToRadians = function (degrees) {
return((degrees / 180) * Math.PI);
};
_global.radiansToDegrees = function (radians) {
return((radians / Math.PI) * 180);
};
_global.returnConstantString = function (char, n) {
var _local2 = "";
var _local1 = 0;
while (_local1 < n) {
_local2 = _local2 + char;
_local1++;
}
return(_local2);
};
ASSetPropFlags(_global, "returnConstantString", 1);
_global.recursiveObjectTrace = function (obj, level) {
if (level == undefined) {
level = 0;
}
for (var _local3 in obj) {
if (typeof(obj[_local3]) == "object") {
trace(((returnConstantString(" ", level * 4) + _local3) + " = ") + obj[_local3]);
trace(returnConstantString(" ", level * 4) + "{");
recursiveObjectTrace(obj[_local3], level + 1);
trace(returnConstantString(" ", level * 4) + "}");
} else {
trace(((returnConstantString(" ", level * 4) + _local3) + " = ") + obj[_local3]);
}
}
};
ASSetPropFlags(_global, "recursiveObjectTrace", 1);
_root._quality = "MEDIUM";
Instance of Symbol 173 MovieClip "controller" in Symbol 204 MovieClip [RoadRampageGame] 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.quiz_questions.shuffle();
_parent.change_mode("play");
}
onClipEvent (keyDown) {
_parent.key_press();
}
Symbol 214 MovieClip Frame 1
stop();
Instance of Symbol 213 MovieClip "swfloader" in Symbol 214 MovieClip Frame 1
onClipEvent (load) {
function strip_spaces(str) {
var _local3 = new String("");
var _local1 = 0;
while (_local1 < str.length) {
if ((str.charAt(_local1) != " ") && (str.charAt(_local1) != ";")) {
_local3 = _local3 + str.charAt(_local1);
}
_local1++;
}
return(_local3);
}
function simple_script(action, timeline) {
action = strip_spaces(action);
if ((action.length > 0) && ((action.indexOf(")") != -1) && (action.indexOf("(") != -1))) {
var _local3 = action.split(".");
var _local5 = _local3.pop();
var _local7 = _local5.indexOf("(");
var _local9 = _local5.indexOf(")");
var _local8 = _local5.substr(0, _local7);
var _local4 = _local5.substr(_local7 + 1, _local9 - (_local7 + 1));
var _local2 = timeline;
var _local1 = 0;
while (_local1 < _local3.length) {
_local2 = _local2[_local3[_local1]];
_local1++;
}
if (_local4.indexOf("\"") != -1) {
_local4 = _local4.substr(1, _local4.length - 2);
}
_local2[_local8](_local4);
}
}
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) {
switch (_parent.xin_motion_val) {
case "Up" :
_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) {
switch (_parent.xin_motion_val) {
case "Toward" :
_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_x - _parent._x) > Math.abs(orig_y - _parent._y)) {
_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") && (Math.abs(_parent._alpha - orig_a) <= 1)) || (((_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 ((rl > 10) && (rt > 10)) {
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) {
switch (_parent.xout_motion_val) {
case "Down" :
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 "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 (_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 "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 (Math.abs(perc_fadeout - 100) > 1) {
break;
}
execute_action();
}
if (!(_parent.xout_alphatype_val === "Yes")) {
} else {
_parent._alpha = (orig_a / 100) * (100 - perc_fadeout);
}
} else {
execute_action();
}
}
Symbol 319 Button
on (release) {
_root.inst.gotoAndStop("On");
gotoAndStop ("i2");
}
Symbol 320 Button
on (release) {
_root.inst.gotoAndStop("Off");
gotoAndStop ("i1");
}
Symbol 321 MovieClip Frame 1
stop();
Symbol 321 MovieClip Frame 2
stop();
Symbol 331 Button
on (release) {
this.play();
}
Symbol 339 MovieClip Frame 1
stop();
Symbol 339 MovieClip Frame 2
stop();
Symbol 348 Button
on (press) {
this.gotoAndStop("Intro");
}
Symbol 352 Button
on (press) {
_root.gotoAndStop("Intro");
}