5
\$\begingroup\$

I am developing a platformer game using SDL2 for graphics and Box2D for physics. I am currently designing my levels and would like to know if it is better to make the static part of each level (ie: ground) one big (500+ units wide) polygon or to break each level up into multiple tiles just a few units wide.

The Box2D manual says that I should keep my objects small to avoid bugs in the floating point code but having a single large ground object seems like a resonable way of reducing the number of objects in the simulation.

So, can I make my ground object one large 500+ unit polygon or should I break it up into many smaller 1-2 unit polygons.

\$\endgroup\$
1
  • \$\begingroup\$ Floating point bugs only arise when creating MASSIVE levels. This shouldn't be a problem for standard platformer games. I've personally created a platformer with a Box2D "block" per static object and didn't have any problems \$\endgroup\$
    – Dries
    Commented May 18, 2015 at 11:20

0

You must log in to answer this question.

Browse other questions tagged .