Question directed towards Upu

But if anyone else knows the answer I’ll gladly accept a response. I’m a little rusty on my physics. I want to have two dynamic text boxes one for angle and one for velocity, and when the player presses the enter button, it propels a MC across the stage, in an ARCH fashion using the angle and velocity inputted by the user. Like Upu’s B-ball game. I don’t just want a code, i just want some help on how to go about this. Like how to use Velocities and arching angles, i’m pretty sure it had to do with physics, but I’m not sure how to go about the code. I already know how to do the input boxes, its just the motion code that I need help on. thanks in advance.

Sorry man… I’ll bet I told you I would get you the code for this. I will, I just need to remember when I’m on at my home computer. I’ll be sure to send you the bball game when I get home and then you can disect it to your hearts content.

oh… and to say that you have a question for me because your physics are rusty is laughable… my physics are none existent. :slight_smile:

You want a physics explanation of gravitation ? Don’t tempt me… Maudit, I can’t resist to show off a bit.\r\rOK, so basically, the gravitation field is a vector field. This means that wherever you are in space, there’s a vector associated with your position, and this vector, homogenous to an acceleration, creates a force, equal to mass*vector.

 Force = m*g //I'm putting this as code :) \r\rBut you surely know that the sum of forces = mass*acceleration hence :\r\rForce = m*a\r\rm*a=m*g and a=g.\r\rThe integral of acceleration on time is velocity, so you get v = g*t + v0\r\rThe integral of velocity on time is position, so you get y = 1/2*g*t^2+v0*t+x0

Yes, that’s the _y position of your object !! On the _x axis, much more simple, as velocity is constant. You’ll get something like :

 &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp vely += g*(time elapsed)/1000;\r\r&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp _y += vely;\r\r                _x += velx;

Did this help, or did it confuse you ??\r\rpom 0]

Does that work?

ok thanks Pom, and thanks Upu. well I figured that the arching motion was done with some simple physics equations. Or at least they can be done with simple physics. I’ll play around with what Pom gave me later, but I’m going home for spring break tomorrow, and I might not have flash on that computer. ok thanks again. And upu, whenever you have time you can send it. no rush. thanks :slight_smile:

Upu, if (big if;) ) you remember to send that fla sometime before Arpril 1st, could you please send it to [email protected] and [email protected] because for the next week Im going to be home, and the yahoo acount is the only one that I can access at my home computer. thanks.

I sent it to both of those addresses.\r\rThe basics of it are far more simple than what Pom provided. Most of the time physics can be imitated rather than actually used.

thanks upu. i already have the basics of the game made, and now all i need is the code. :slight_smile: i’ll let you know when its done.