PDA

View Full Version : ball bounce based on the coordinates



messi
September 2nd, 2006, 02:29 PM
Hi iam doing a cricket game.
Bowling : On the pitch their are two lines one moving horizontal (line_marker) and one moving vertical(length_marker). The line_marker is to select the line of the delivery, and length_marker is used to select the length of the delivery. The two markers are kept as two seperate movie clips.

1. On the main timeline i have the two markers running, but one marker is masked under another(length_marker masked by line_marker). I also have a button on the main timeline. When pressed once the line_marker should stop and when pressed once more the length_marker should stop.
How do i do that.

2. Once the two markers are stopped, how do i get the x and y coordinates for the markers.

3. How do i make a ball bounce on that particular x and y coordinate and make it move in that path.

Hope the question is not confusing.

Ash.

messi
September 12th, 2006, 02:34 PM
Any ideas how to make it guys.
Ash.

messi
September 13th, 2006, 11:50 PM
Ok i will rephrase the question a bit.
Their are three positions start position(a), middle position(b) and finish position(c).
1. I can generate a ball at the start positiona(a).
2. How do i make it goto the middle position next(b).
3. From the middle position how do i make the ball goto the (c).

SeiferTim
September 15th, 2006, 01:50 PM
It's a little bit hard to understand what you're trying to acomplish, but it sounds like you have 2 bars that are constantly moving back and forth, and when you hit "toss" or whatever, the ball is supposed to fly in a direction and angle based on what those bars said at the time, am I right?
The easiest way to do this is to have 2 variables: direction (angle) and power.
Have the button link to the two bars MCs, and send the stop() command, and then set the variables based on that - for instance, if you have both bars have a width of 100, when they stop, take the x position to determine the percentage of power and your angle. This really all depends on a lot of factors in your game, your best bet may be to find a tutorial on something somewhat similar and tweak it once you understand how it works.

messi
September 18th, 2006, 04:02 PM
Yes a bit right but not correct fully.
If u have seen a cricket pitch, then i have two markers one vertical marker which moves vertcially and another horizontal marker which moves horizontally. When both the markers are stopped i should bounce the ball on the intersection of those two markers how do i do it.
The camera angle is a televison angle of a cricket pitch. The ball should start closer from the camera and bounce on the intersection point and move way from the camera.

messi
November 10th, 2006, 04:49 PM
This is a video of a bowler bowlinga ball,
http://video.google.com/videoplay?docid=-1233966347598618487&q=cricket+bowling
this is the same thing i want to simulate in flash.