A Flash Developer Resource Site

1. ## jumpTo()?

couldn't really think of a title to explain it.

say i have three variables

gravity Y

velocity X

velocity Y

and i wish to make an object jump to a position based on a passed Y velocity value which returns the appropriate X velocity to get to the destination

function getJumpX(px, py, dx, dy, y){

}

var gravity = .5
var vy = -10
var vx = getJump(0, 0, 100, 0, vy)

i honestly have no idea where to start

any ideas?

2. You can use curveTo class given Flash 8 help.
-Bezier curves.
Code:
```lineStyle(2, 0xFF0000, 100, true, "none", "round", "miter", 1);
moveTo(0,400);
curveTo(250,0,500,400);```

3. Originally Posted by Eager Beaver
You can use curveTo class given Flash 8 help.
-Bezier curves.
Code:
```lineStyle(2, 0xFF0000, 100, true, "none", "round", "miter", 1);
moveTo(0,400);
curveTo(250,0,500,400);```
lol

you need to factor for time, mr_malee.

the equation you should be looking for is:
velocity * time + 0.5 * acceleration * time * time

4. Yeah! great!

http://board.flashkit.com/board/show...1&page=2&pp=20

5. The trajectory of the object can be a quadratic curve, cubic curve or a higher order curve.
I have developed the attached FLA in Flash 8, taking into consideration a quadratic curve.
Select the values of ym, x0, y0, x1, y1, and click play button. The object moves from x0, y0, to x1, y1, through ym in a parabolic trajectory, drawing a parabolic curve.

Homepage

6. great, thanks for the help everyone. Achyut you especially

just wondering though what the different variables mean, i think i've figured out a few but theres one that eludes me

ballym. It looks like its supposed to be the height of the jump, however when i set these values up:

x0 = 200
y0 = 200
x1 = 100
y1 = 100
ballym = 0

the ball doesn't go to 0 at the height of its jump, just not sure what values this can be and how it alters the jump. ballym makes sense when both y0 and y1 are equal and ballym is different, the ball seems to pass through at the correct height. But when y0 and y1 have different values and the distance between them can be negative, i get a little lost with the ballym variable

thanks for the help anyway

7. You are 100% correct mr_malee!
Primarily I have included ym to create depth of the parabola.
if y0=ym=y1, you draw a straight line.
ym(actual) corresponding to (x0+x1)/2 is equal to ym(set) only when y0=y1.
in all other cases ym(actual)=ym(set)+(y0-y1)/2.
To construct a general quadratic curve I have to use the formula
y=a*x*x+b*x+c
for any arbitrary values of a, b, and c set by the user.
In the present program I have used the formulas:
x=x0+vx*t;
y=y0+vy*t+0.5*g*t*t;
and
boundary conditions set by user:
initial: (x0,y0)
final: (x1,y1)
middle: ym corresponding to (x0+x1)/2
Hope I will be able to do further work on this fascinating subject.

8. Originally Posted by Eager Beaver
You are 100% correct mr_malee!....
Actually I and Eager Beaver (my colleague) have together developed this movie. As I was busy with some other work I asked Eager Beaver to post
The reply may be considered to have been given by me.
I am extremely sorry if any confusion was created.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

 » Home » Movies » Tutorials » Submissions » Board » Links » Reviews » Feedback » Gallery » Fonts » The Lounge » Sound Loops » Sound FX » About FK » Sitemap