• Advertisement
Sign in to follow this  

Pong speed?? Is there a good formula i should use?

This topic is 4519 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have generically coded the ball to increase in speed upon each hit of the paddle. I was curious if there was a better way to go about this? For instance, the paddle will hit the ball and automatically the speed is increased. Is there a common formula that can be used? I am curious if when the paddle is steady and not moving, whether there should be an increase or decrease in speed...and when the paddle IS moving...there should be an increase in speed of the ball. I thank you guys for any advice on how I should go about this. I can figure out how to program it, it just that I have not quite taken a physics class...I am not slow...I just never took the opportunity :) I really appreciate any guidance with concepts and formula. By the way, when I say speed of the ball...am I using the wrong word? Should I be saying acceleration? Gil

Share this post


Link to post
Share on other sites
Advertisement
Last I checked, there wasn't a formula for writing Pong.
The simple answer is that of course, the paddle and ball should both have *exactly* the speed that makes the game fun.
If you can find a formula for fun, then I think a lot of people here would like to see it. Otherwise, you have to do like everyone else, and balance your game by testing and seeing what works. [wink]

If you want a proper physics simulation, then you should ask for physics formulas, rather than Pong ones. [smile]

But one thing to keep in mind is that Pong is what, 30 years old? It does not have an advanced physics model (at least in the original version). Of course, that's not to say you can't add that. But then you have to look beyond a "Pong formula" :)

Share this post


Link to post
Share on other sites
Okay, this is simple physics.
When the ball hits the paddle, these 2 bodies begin to interchange the energy and impulse. So, you have to write 2 basic physical laws: for saving energy and for saving impulse, and to solve them for the situation after hit.
Also, you can include the energy dissipation condition. But if you do so, you can't use the impulse saving law after it.
So, I think, the better way is to use some "fake" formula, as Spoonbender has proposed.

Share this post


Link to post
Share on other sites
Quote:
Original post by Figherstarter
By the way, when I say speed of the ball...am I using the wrong word? Should I be saying acceleration?


Speed is the correct term. If you want to get ultra-technical, "applying jerk" (jerk is the derivative of acceleration) might be better, but speed is much easier to understand what you're saying. [smile]

To answer your question: No, there is no "formula" for pong. You're not making a physics simulation, so you don't need to worry about actual physical phenomenon.

Simply, you just need to make the game so it's *fun*. It doesn't matter what your equation looks like in the end, when you do or do not increase the ball's speed, or whatever. It matters if it's fun.

I can't say that there "should" be an increase in ball speed on certain situations, because really this is a matter of opinion. Do you want it to speed up? Do you think it makes the game more fun? Those are the questions you should be asking.

Share this post


Link to post
Share on other sites
Thanks guys, I guess your right about the whole fun factor thing. It is my game afterall...I should make it the way I think is fun :)

You guys reply fast!

Gil

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement