0
\$\begingroup\$

How to make a game with a static scene and balls that can bounce on it? What is used for this, generally? Physics engines? Even if this is a simplistic example?

\$\endgroup\$
1
  • 4
    \$\begingroup\$ I think this would be an good question if you elaborated more on what you are trying to accomplish. \$\endgroup\$
    – tyjkenn
    Mar 9 '12 at 5:00
2
\$\begingroup\$

The easiest way would to be use a physics engine. Box2D has been ported to nearly every popular language. However, its impossible to make a more specific suggestion as you provide no contextual information.

\$\endgroup\$
0
\$\begingroup\$

The simplest way would be good if the static scene only has straight walls and flat ground. All you would have to do is multiply one of its components speeds by -1. If it collides with a wall, this would be the x component. If it is the ceiling or floor, this would be the y component. If you want to add in friction, multiply instead by -.7 or something similar.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.