Frame 17
level = 0;
acct = 0;
_level0.rotat = random(2200);
rota = new array();
stopAllSounds();
stop();
Frame 18
level++;
max_levels = 3;
level_time = new array();
level_time[1] = 60;
level_time[2] = 45;
level_time[3] = 60;
limit = level_time[level];
task = new array();
task[1] = "LEVEL 1. You must park your car in the highlighted space without hitting another vehicle.";
task[2] = "LEVEL 2. Some idiot has boxed your car in! Manoeuvre your car out and park in front of the car park office.";
task[3] = "LEVEL 3. You must park your car into the highlighted space. But be careful - there are icy patches on the ground!";
task_txt = task[level];
limit_txt = ("You have " + limit) + " seconds to complete this level.";
Frame 19
function get_cookie_txt() {
cookie_best1_txt = cookie_best1;
cookie_best2_txt = cookie_best2;
cookie_best3_txt = cookie_best3;
cookie_best4_txt = cookie_best4;
cookie_best5_txt = cookie_best5;
cookie_best_txt = cookie_best;
if (cookie_best == not_yet_done) {
cookie_best_txt = "N/A";
}
if (cookie_best1 == not_yet_done) {
cookie_best1_txt = "N/A";
}
if (cookie_best2 == not_yet_done) {
cookie_best2_txt = "N/A";
}
if (cookie_best3 == not_yet_done) {
cookie_best3_txt = "N/A";
}
if (cookie_best4 == not_yet_done) {
cookie_best4_txt = "N/A";
}
if (cookie_best5 == not_yet_done) {
cookie_best5_txt = "N/A";
}
}
game_id = "pp21";
exists = game_cooky.read_game_cookie(game_id);
trace((("game " + game_id) + " ") + exists);
not_yet_done = 9999;
if (exists == false) {
game_cooky.write_game_cookie(game_id, not_yet_done, not_yet_done, not_yet_done, not_yet_done, not_yet_done, not_yet_done, 0, 0);
f1 = not_yet_done;
f2 = not_yet_done;
f3 = not_yet_done;
f4 = not_yet_done;
f5 = not_yet_done;
f6 = not_yet_done;
f7 = 0;
f8 = 0;
f9 = 0;
}
cookie_best1 = f1;
cookie_best2 = f2;
cookie_best3 = f3;
cookie_best4 = f4;
cookie_best5 = f5;
cookie_best = f6;
cookie_played = f7;
cookie_completed = f8;
trace("****READ****");
trace("cookie_best1 " + cookie_best1);
trace("****ENDREAD****");
get_cookie_txt();
stop();
Frame 23
carstart1._visible = false;
carstart2._visible = false;
carstart3._visible = false;
carstart4._visible = false;
carstart5._visible = false;
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))) {
trace("**********************");
trace("t=" + t);
trace("rangle " + _level0.car.rangle);
trace((("dangle " + _level0.car.dangle) + " last ") + last_d);
trace("angle needed " + angle_needed);
trace(" dist = " + math.sqrt((((x1 - tick_x) * (x1 - tick_x)) * (y1 - tick_y)) * (y1 - tick_y)));
trace((("R=" + R) + " last=") + last_r);
trace("car rot = " + _level0.car._rotation);
trace((("x1/y1 " + x1) + " ") + y1);
trace((("circle x1/y1 " + circle_x) + " ") + circle_y);
trace("turn..." + turn);
trace((("new pos x1/y1 " + tick_x) + " ") + tick_y);
trace("**********************");
} 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;
} else {
trace("**********************");
trace("t=" + t);
trace("rangle " + _level0.car.rangle);
trace((("dangle " + _level0.car.dangle) + " last ") + last_d);
trace("angle needed " + angle_needed);
trace("BAD dist = " + math.sqrt((((x1 - tick_x) * (x1 - tick_x)) * (y1 - tick_y)) * (y1 - tick_y)));
trace((("R=" + R) + " last=") + last_r);
trace("car rot = " + _level0.car._rotation);
trace((("x1/y1 " + x1) + " ") + y1);
trace((("circle x1/y1 " + circle_x) + " ") + circle_y);
trace("turn..." + turn);
trace((("new pos x1/y1 " + tick_x) + " ") + tick_y);
trace("**********************");
}
_level0.car._rotation = _level0.car._rotation + turn;
}
last_R = R;
last_D = _level0.car.dangle;
}
}
count = 1;
block = false;
t = 0;
Instance of Symbol 71 MovieClip "car" in Frame 23
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 = "down";
final_pos2 = "dontcare";
}
if (level == 3) {
final_pos1 = "up";
final_pos2 = "down";
}
if (level == 4) {
final_pos1 = "up";
final_pos2 = "down";
}
if (level == 5) {
final_pos1 = "side";
final_pos2 = "dontcare";
}
if (final_pos1 == "side") {
ok1 = true;
}
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 = true;
}
if (final_pos2 == "dontcare") {
ok2 = false;
}
answer = ok1 or ok2;
return(answer);
}
trace("start..." + _level0["carstart" + _level0.level]._x);
xdx = this._x - _level0["carstart" + _level0.level]._x;
xdy = this._y - _level0["carstart" + _level0.level]._y;
this._x = _level0["carstart" + _level0.level]._x;
this._y = _level0["carstart" + _level0.level]._y;
trace("start..." + this._x);
_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 = 14;
ang = new array();
cross_dx = new array();
cross_dy = new array();
mag = new array();
trace("START " + _level0["carstart" + _level0.level]._x);
j = 1;
while (j <= cmax) {
mov1 = eval ("_level0.cross" + j);
cross_dx[j] = (xdx + _level0["carstart" + _level0.level]._x) - mov1._x;
cross_dy[j] = (xdy + _level0["carstart" + _level0.level]._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++;
}
}
onClipEvent (enterFrame) {
if (_level0.fader._y > -600) {
_level0.fader._y = _level0.fader._y - 50;
}
if (status != "done") {
level = _level0.level;
if (level == 5) {
mov1 = _level0.light1;
mov1._x = _x;
mov1._y = _y;
mov1._rotation = _rotation;
}
if (check_this_cycle) {
count = 0;
j = 1;
while (j <= cmax) {
mov1 = eval ("_level0.cross" + j);
testx = _x + (mag[j] * Math.sin((_rotation + ang[j]) * pi_div_180));
testy = _y - (mag[j] * Math.cos((_rotation + ang[j]) * pi_div_180));
wheels = (((j == 6) or (j == 10)) or (j == 11)) or (j == 12);
if ((wheels and (_level0.level == 3)) and (_level0.ice1.hitTest(testx, testy, true) or _level0.ice2.hitTest(testx, testy, true))) {
this._rotation = this._rotation + ((dangle * _level0.speed) / 10);
}
mov = _level0.zone;
if (mov.hitTest(testx, testy, true) and (_level0.speed == 0)) {
count++;
}
i = 1;
while (i <= other_cars_max) {
mov = eval ("_level0.car" + i);
if (mov.hitTest(testx, testy, true)) {
this.gotoandplay(2);
_level0.speed = 0;
status = "done";
_level0.result.gotoandplay("crashed");
_level0.timer.stop_timer();
}
i++;
}
j++;
}
if (status != "done") {
trace((((("count.." + count) + " ") + cmax) + " ") + _rotation);
if (((_level0.speed == 0) and (count == cmax)) and ok_position()) {
trace("done!");
_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];
_level0.toand = 10 + _level0.rota[5];
}
if (_level0.timer.timer_val >= _level0.level_time[level]) {
trace("too slow!");
_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 90 MovieClip "timer" in Frame 23
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 24
if (level == 1) {
gotoAndPlay (28);
}
if (level == 2) {
gotoAndPlay (35);
}
if (level == 3) {
gotoAndPlay (41);
}
if (level == 4) {
gotoAndPlay (23);
}
if (level == 5) {
gotoAndPlay (23);
}
trace("LEVEL = " + level);
Frame 28
trace("here1");
carstart1._visible = false;
carstart2._visible = false;
carstart3._visible = false;
carstart4._visible = false;
carstart5._visible = false;
stop();
Frame 35
carstart1._visible = false;
carstart2._visible = false;
carstart3._visible = false;
carstart4._visible = false;
carstart5._visible = false;
stop();
Frame 41
carstart1._visible = false;
carstart2._visible = false;
carstart3._visible = false;
carstart4._visible = false;
carstart5._visible = false;
stop();
Frame 48
stopAllSounds();
if (level >= max_levels) {
gotoAndPlay (55);
} else {
gotoAndPlay (18);
}
Frame 52
gotoAndPlay (3);
Frame 55
score = manager_rating;
players = "";
sct1 = _level0.rota[1];
sct2 = _level0.rota[2];
sct3 = _level0.rota[3];
sct4 = _level0.rota[4];
sct5 = _level0.rota[5];
Frame 56
_level0.get_cookie_txt();
stopAllSounds();
stop();
Symbol 7 MovieClip Frame 1
doneLoading = 0;
stop();
Instance of Symbol 3 MovieClip "bkgd" in Symbol 7 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.doneLoading == 0) {
total = _parent._parent.getBytesTotal();
isloaded = _parent._parent.getBytesLoaded();
p = 100 * (isLoaded / total);
_parent.bytes = ((int(isloaded / 1000) add " KB of ") add int(total / 1000)) add " KB";
_parent.percent = int(p) add "% LOADED";
_parent.bar._xscale = p;
trace("....." + Number(p));
if (Number(p) >= Number(100)) {
_parent._parent.gotoAndPlay(Number(2));
_parent.gotoAndStop("off");
_parent.doneLoading = 1;
} else {
_parent._parent.gotoAndPlay(Number(1));
}
}
}
Symbol 13 MovieClip Frame 7
gotoAndPlay (1);
Symbol 16 MovieClip Frame 32
gotoAndPlay (1);
Symbol 24 Button
on (keyPress "~") {
command = "init";
gotoAndPlay (55);
}
Symbol 27 Button
on (release) {
getURL ("http://www.mousebreaker.com/index.php?cdgtid=parking2", "_blank");
}
Symbol 30 Button
on (release) {
getURL ("http://www.mousebreaker.com/index.php?page=downloadagreement");
}
Symbol 43 Button
on (release, keyPress "<Enter>") {
play();
}
Symbol 50 Button
on (release, keyPress "<Enter>") {
if (level == 1) {
cookie_played++;
}
game_cooky.write_game_cookie(game_id, cookie_best1, cookie_best2, cookie_best3, cookie_best4, cookie_best5, cookie_best, cookie_played, cookie_completed);
play();
}
Symbol 71 MovieClip Frame 1
stop();
Symbol 71 MovieClip Frame 8
gotoAndPlay (1);
Symbol 79 Button
on (release) {
play();
}
Symbol 84 Button
on (release) {
play();
}
Symbol 85 MovieClip Frame 1
stop();
Symbol 85 MovieClip Frame 2
if (_level0.level == 5) {
_level0.cookie_completed++;
if (_level0.acct < _level0.cookie_best) {
_level0.cookie_best = _level0.acct;
}
}
trace("best was..." + _level0["cookie_best" + _level0.level]);
cs = _level0.rota[_level0.level];
trace("this..." + cs);
if (cs < _level0["cookie_best" + _level0.level]) {
_level0["cookie_best" + _level0.level] = cs;
}
_level0.game_cooky.write_game_cookie(_level0.game_id, _level0.cookie_best1, _level0.cookie_best2, _level0.cookie_best3, _level0.cookie_best4, _level0.cookie_best5, _level0.cookie_best, _level0.cookie_played, _level0.cookie_completed);
_level0.get_cookie_txt();
_level0.game_cooky._visible = true;
Symbol 85 MovieClip Frame 20
stop();
Symbol 85 MovieClip Frame 21
_root.gotoandplay("end");
stop();
Symbol 85 MovieClip Frame 55
stop();
Symbol 85 MovieClip Frame 56
_root.gotoandplay("failed");
stop();
Symbol 85 MovieClip Frame 82
stopAllSounds();
Symbol 85 MovieClip Frame 83
stop();
Symbol 85 MovieClip Frame 84
_root.gotoandplay("failed");
stop();
Symbol 85 MovieClip Frame 117
stop();
Symbol 85 MovieClip Frame 118
_root.gotoandplay("failed");
stop();
Symbol 88 MovieClip Frame 1
stop();
Symbol 118 MovieClip Frame 17
stop();
Symbol 123 Button
on (release) {
getURL ("http://www.mousebreaker.com/index.php?cdgtid=parking", "_blank");
}
Symbol 125 Button
on (release) {
gotoAndPlay (3);
}