Frame 1
level = 0;
acct = 0;
_level0.rotat = random(2200);
rota = new array();
stopAllSounds();
stop();
Frame 2
level++;
max_levels = 2;
level_time = new array();
level_time[1] = 60;
level_time[2] = 45;
limit = level_time[level];
task = new array();
task[1] = "You must park your car FRONT FIRST into the highlighted space.";
task[2] = "You must REVERSE your car into the highlighted space.";
task_txt = task[level];
limit_txt = ("You have " + limit) + " seconds to complete this level.";
stop();
Frame 3
function draw() {
if (!block) {
t++;
if (_level0.car.rangle == 0) {
_level0.car.rangle = 0.000174555555555556;
R = _level0.car.L / Math.sin(_level0.car.rangle);
} else {
R = _level0.car.L / Math.sin(_level0.car.rangle);
}
angle_needed = ((2 * speed) * 360) / (6.284 * R);
turn = angle_needed;
rangle = _level0.car.rangle;
x1 = _level0.car._x;
y1 = _level0.car._y;
circle_x = x1 + (R * Math.cos((3.142 * _level0.car._rotation) / 180));
circle_y = y1 + (R * Math.sin((3.142 * _level0.car._rotation) / 180));
tx1 = x1 - circle_x;
ty1 = y1 - circle_y;
vx = tx1;
vy = ty1;
delta = ((-turn) * 3.142) / 180;
tick_x = (vx * math.cos(delta)) + (vy * math.sin(delta));
tick_y = (vy * math.cos(delta)) - (vx * math.sin(delta));
tick_x = tick_x + circle_x;
tick_y = tick_y + circle_y;
if (((last_R > 0) and (R < 0)) or ((last_R < 0) and (R > 0))) {
} else {
dist = math.sqrt((((x1 - tick_x) * (x1 - tick_x)) * (y1 - tick_y)) * (y1 - tick_y));
if (dist < 100) {
_level0.car._x = tick_x;
_level0.car._y = tick_y;
}
_level0.car._rotation = _level0.car._rotation + turn;
}
last_R = R;
last_D = _level0.car.dangle;
}
}
count = 1;
block = false;
t = 0;
Instance of Symbol 42 MovieClip "car" in Frame 3
onClipEvent (load) {
function ok_position() {
answer = false;
ok1 = false;
ok2 = false;
if (level == 1) {
final_pos1 = "down";
final_pos2 = "dontcare";
}
if (level == 2) {
final_pos1 = "up";
final_pos2 = "dontcare";
}
if (level == 3) {
final_pos1 = "up";
final_pos2 = "down";
}
if (level == 4) {
final_pos1 = "up";
final_pos2 = "down";
}
if ((((final_pos1 == "up") and (_rotation > -10)) and (_rotation < 10)) or (((final_pos1 == "down") and ((_rotation > 170) and (_rotation < 180))) or ((_rotation > -180) and (_rotation < -170)))) {
ok1 = true;
}
if ((((final_pos2 == "up") and (_rotation > -10)) and (_rotation < 10)) or (((final_pos2 == "down") and ((_rotation > 170) and (_rotation < 180))) or ((_rotation > -180) and (_rotation < -170)))) {
ok2 = true;
}
if (final_pos1 == "dontcare") {
ok1 = false;
}
if (final_pos2 == "dontcare") {
ok2 = false;
}
answer = ok1 or ok2;
return(answer);
}
_level0.engine.gotoandplay(2);
status = "playing";
pi_div_180 = 0.0174555555555556;
_rotation = 0;
l = 100;
turn = 4;
dangle = 0;
MAXSPEED = 2;
acc = 0.2;
lim = 60;
cmax = 14;
other_cars_max = 8;
ang = new array();
cross_dx = new array();
cross_dy = new array();
mag = new array();
j = 1;
while (j <= cmax) {
mov1 = eval ("_level0.cross" + j);
cross_dx[j] = this._x - mov1._x;
cross_dy[j] = this._y - mov1._y;
mag[j] = math.sqrt((cross_dx[j] * cross_dx[j]) + (cross_dy[j] * cross_dy[j]));
ang[j] = -90 + ((Math.atan2(cross_dy[j], cross_dx[j]) * 180) / 3.142);
mov1._visible = false;
j++;
}
bang = new array();
bcross_dx = new array();
bcross_dy = new array();
bmag = new array();
j = 1;
while (j <= 2) {
mov1 = eval ("_level0.beam" + j);
bcross_dx[j] = this._x - mov1._x;
bcross_dy[j] = this._y - mov1._y;
bmag[j] = math.sqrt((bcross_dx[j] * bcross_dx[j]) + (bcross_dy[j] * bcross_dy[j]));
bang[j] = -90 + ((Math.atan2(bcross_dy[j], bcross_dx[j]) * 180) / 3.142);
mov1._visible = true;
j++;
}
}
onClipEvent (enterFrame) {
if (status != "done") {
level = _level0.level;
if (check_this_cycle) {
count = 0;
j = 1;
while (j <= cmax) {
mov1 = eval ("_level0.cross" + j);
mov1._x = _x + (mag[j] * Math.sin((_rotation + ang[j]) * pi_div_180));
mov1._y = _y - (mag[j] * Math.cos((_rotation + ang[j]) * pi_div_180));
if (level == 3) {
if ((_level0.last_zone != 1) and _level0.zone1.hitTest(mov1._x, mov1._y, true)) {
_level0.last_zone = 1;
}
if ((_level0.last_zone != 2) and _level0.zone2.hitTest(mov1._x, mov1._y, true)) {
_level0.last_zone = 2;
}
}
if (_level0.speed == 0) {
mov = _level0.zone;
if (mov.hitTest(mov1._x, mov1._y, true)) {
count++;
}
} else {
i = 1;
while (i <= other_cars_max) {
mov = eval ("_level0.car" + i);
if ((_level0.level == 4) and _level0.dog.hitTest(mov1._x, mov1._y, true)) {
_level0.speed = 0;
_level0.dog.gotoandplay("squashed");
status = "done";
_level0.result.gotoandplay("dog");
_level0.timer.stop_timer();
}
if (mov.hitTest(mov1._x, mov1._y, true)) {
this.gotoandplay(2);
_level0.speed = 0;
status = "done";
_level0.result.gotoandplay("crashed");
_level0.timer.stop_timer();
}
i++;
}
}
j++;
}
if (status != "done") {
if (((_level0.speed == 0) and (count == cmax)) and ok_position()) {
_level0.result.gotoandplay("done");
_level0.timer.stop_timer();
_level0.acct = _level0.acct + _level0.timer.timer_val;
status = "done";
_level0.eve = _level0.rotat - _level0.rota[1];
_level0.vel = _level0.rota[2] + _level0.rotat;
_level0.leve = _level0.rota[3] + (_level0.rotat * 2);
_level0.tation = 200 - _level0.rota[4];
}
if (_level0.timer.timer_val >= _level0.level_time[level]) {
_level0.result.gotoandplay("timeup");
_level0.timer.stop_timer();
status = "done";
}
}
}
check_this_cycle = !check_this_cycle;
if (Key.isDown(37) and (dangle > (-lim))) {
dangle = dangle - turn;
}
if (Key.isDown(39) and (dangle < lim)) {
dangle = dangle + turn;
}
kd = false;
ku = false;
if (Key.isDown(40)) {
if (_level0.speed > -2) {
_level0.speed = _level0.speed - acc;
}
kd = true;
}
if (Key.isDown(38)) {
if (_level0.speed < maxspeed) {
_level0.speed = _level0.speed + acc;
}
ku = true;
}
if (Key.isDown(32)) {
_level0.speed = 0;
}
if ((!kd) and (!ku)) {
if (_level0.speed > 0) {
_level0.speed = _level0.speed - 0.1;
}
if (_level0.speed < 0) {
_level0.speed = _level0.speed + 0.1;
}
if (Math.abs(_level0.speed) < 0.1) {
_level0.speed = 0;
}
}
if (last_dangle != dangle) {
rangle = dangle * pi_div_180;
this.wheel1._rotation = dangle / 2;
this.wheel4._rotation = dangle / 2;
}
last_dangle = dangle;
_level0.draw();
}
}
Instance of Symbol 58 MovieClip "timer" in Frame 3
onClipEvent (load) {
function start_timer() {
start = getTimer();
state = "running";
}
function stop_timer() {
finish = getTimer();
state = "stopped";
}
state = "idle";
timer_val = "00.0";
start_timer();
}
onClipEvent (enterFrame) {
if (state == "running") {
time_now = getTimer();
duration = (time_now - start) / 1000;
timer_val = int(duration * 10) / 10;
if (timer_val != last_timer_val) {
timer_val_txt = timer_val;
if (timer_val == int(timer_val)) {
timer_val_txt = timer_val_txt + ".0";
}
_level0.acct_txt = _level0.acct + timer_val;
if ((_level0.acct + timer_val) == int(_level0.acct + timer_val)) {
_level0.acct_txt = _level0.acct_txt + ".0";
}
}
_level0.rota[_level0.level] = timer_val;
last_timer_val = timer_val;
}
}
Frame 4
if (level == 1) {
gotoAndPlay (8);
}
if (level == 2) {
gotoAndPlay (15);
}
if (level == 3) {
gotoAndPlay (3);
}
if (level == 4) {
gotoAndPlay (3);
}
Frame 8
stop();
Frame 15
stop();
Frame 21
stopAllSounds();
if (level >= max_levels) {
gotoAndPlay (27);
} else {
gotoAndPlay (2);
}
Frame 25
gotoAndPlay (1);
Frame 27
score = manager_rating;
players = "";
Frame 28
stopAllSounds();
stop();
Symbol 11 Button
on (release) {
play();
}
Symbol 18 Button
on (release) {
getURL ("http://www.mousebreaker.com/index.php?cdgtid=parking", "_blank");
}
Symbol 22 Button
on (release) {
getURL ("http://www.mousebreaker.com/index.php?page=downloadagreement");
}
Symbol 24 Button
on (keyPress "~") {
gotoAndPlay (27);
}
Symbol 42 MovieClip Frame 1
stop();
Symbol 42 MovieClip Frame 8
gotoAndPlay (1);
Symbol 47 Button
on (release) {
play();
}
Symbol 52 MovieClip Frame 1
stop();
Symbol 52 MovieClip Frame 20
stop();
Symbol 52 MovieClip Frame 21
_root.gotoandplay("end");
stop();
Symbol 52 MovieClip Frame 55
stop();
Symbol 52 MovieClip Frame 56
_root.gotoandplay("failed");
stop();
Symbol 52 MovieClip Frame 82
stopAllSounds();
Symbol 52 MovieClip Frame 83
stop();
Symbol 52 MovieClip Frame 84
_root.gotoandplay("failed");
stop();
Symbol 52 MovieClip Frame 117
stop();
Symbol 52 MovieClip Frame 118
_root.gotoandplay("failed");
stop();
Symbol 55 MovieClip Frame 1
stop();
Symbol 72 Button
on (release) {
getURL ("http://www.mousebreaker.com/index.php?cdgtid=parking", "_blank");
}
Symbol 75 Button
on (release) {
gotoAndPlay (1);
}