home *** CD-ROM | disk | FTP | other *** search
- function Map_Balls_to_perspective(max_b)
- {
- trace("first " + first_play);
- ball = 1;
- while(max_b >= ball)
- {
- trace("ball === " + ball + " " + in_zone[ball]);
- if(in_zone[ball])
- {
- disp_zoom_y = zoom_origin_y - realy[ball];
- thisball = eval("per" + ball);
- even_number = ball == int(ball / 2) * 2;
- if(first_play == "computer" and even_number or first_play == "user" and !even_number)
- {
- trace("blue" + ball_in);
- thisball.gotoandstop("blue");
- }
- else
- {
- trace("red" + ball_in);
- thisball.gotoandstop("red");
- }
- thisball._y = (PerY1 - Pery3) / (ZooY1 - ZooY3) * disp_zoom_y + Pery3;
- a = zoox1;
- b = middle;
- c = realx[ball];
- o = perx1;
- p = b;
- f = perx3;
- g = b;
- d1 = (c - a) * (p - o) / (b - a) + o;
- d2 = (c - a) * (g - f) / (b - a) + f;
- extra_y = pery1 - thisball._y;
- extra_dy = pery1 - pery3;
- extra_dx = d2 - d1;
- extra_m = extra_dy / extra_dx;
- extra_x = extra_y / extra_m;
- thisball._x = (realx[ball] - offset) / mgrad + extra_x;
- }
- ball++;
- }
- }
- minimum_points_for_prize = 2;
- timeout_value = 3000;
- home_radius = 137;
- waiting = false;
- end_no = 1;
- max_ends = 2;
- Message = "";
- computer_score = 0;
- user_score = 0;
- totals_message = "";
- ends_message = "END: 1";
- score_message = ends_message + totals_message;
- winpoints = 0;
- curve = 1;
- curve_amplitude = 25;
- stone_status = new array();
- stone_in_use = 0;
- totalballs = 8;
- max_pwr = 950;
- min_pwr = 600;
- vx = new array();
- vy = new array();
- realx = new array();
- realy = new array();
- in_zone = new array();
- Map_Perx = new array();
- Map_Pery = new array();
- ZooX1 = 95;
- ZooY1 = 370;
- ZooX2 = 549;
- ZooY2 = 370;
- ZooY3 = 12;
- ZooY4 = 12;
- middle = 322;
- PerX1 = 254;
- PerY1 = 60;
- PerX2 = 390;
- PerY1 = 60;
- Perx3 = 272;
- PerY3 = 20;
- Perx4 = 372;
- mgrad = (ZooX2 - ZooX1) / (PerX2 - PerX1);
- offset = zoox1 - mgrad * perx1;
- zoom_origin_x = 0;
- zoom_origin_y = 400;
- ball = 1;
- while(totalballs >= ball)
- {
- in_zone[ball] = false;
- realx[ball] = -999 * ball;
- realy[ball] = -999 * ball;
- stone_status[ball] = "bright";
- ball++;
- }
-