home *** CD-ROM | disk | FTP | other *** search
- if(started == "0")
- {
- gotoAndPlay(50);
- }
- if(noOfBricks == "0")
- {
- gotoAndPlay(62);
- }
- speed_x = vector_x * magnitude;
- speed_y = vector_y * magnitude;
- ball_xB = getProperty("/ball", _X);
- ball_yB = getProperty("/ball", _Y);
- ball_xA = ball_xB;
- ball_yA = ball_yB;
- ball_xB = ball_xA + speed_x;
- ball_yB = ball_yA + speed_y;
- if(direction eq "NE")
- {
- call("NE");
- }
- else if(direction eq "NW")
- {
- call("NW");
- }
- else if(direction eq "SE")
- {
- call("SE");
- }
- else if(direction eq "SW")
- {
- call("SW");
- }
- if("410" < ball_xB)
- {
- ball_xB = "410" - ballRadius;
- vector_x = - vector_x;
- }
- if(ball_xB < "10")
- {
- ball_xB = "10" + ballRadius;
- vector_x = - vector_x;
- }
- if(caught == "1")
- {
- if(ball_yB == bat_collision_line)
- {
- bat_left = getProperty("/bat", _X) - batWidth / "2";
- bat_right = getProperty("/bat", _X) + batWidth / "2";
- if(ball_xB >= bat_left or bat_right >= ball_xB)
- {
- gotoAndPlay(34);
- }
- }
- }
- if("400" < ball_yB)
- {
- gotoAndPlay(55);
- }
- point_x1 = getProperty("/ball", _X);
- point_y1 = getProperty("/ball", _Y);
- setProperty("/ball", _X, ball_xB);
- setProperty("/ball", _Y, ball_yB);
- point_x2 = getProperty("/ball", _X);
- point_y2 = getProperty("/ball", _Y);
- if("0" < point_x2 - point_x1 and point_y2 - point_y1 < "0")
- {
- direction = "NE";
- }
- else if("0" < point_x2 - point_x1 and "0" < point_y2 - point_y1)
- {
- direction = "SE";
- }
- else if(point_x2 - point_x1 < "0" and "0" < point_y2 - point_y1)
- {
- direction = "SW";
- }
- else if(point_x2 - point_x1 < "0" and point_y2 - point_y1 < "0")
- {
- direction = "NW";
- }
-