Page 1 of 1

Question about physics.

Posted: Sat Oct 11, 2014 5:23 pm
by roxxo
Just saw this on the physics api page:
love.physics is not lightweight, and not even remotely simple to use. It's a ten-ton hammer designed for heavy-lifting (er...hammer...lifting?)
If you are just trying to make a character jump around on blocks or the likes, then move along, nothing to see here.
I was planning to use it for a 2D tiled scroller and use love physics to add a rectangle fixture for each tile (or a little optimisation by joining tiles), but after I saw that, I'm thinking on not using it, concretely because of the second line.

I've used box2d on Java or C++ this way and no problem with that, but that comment suggests me this could be an overkill here. What's the thing so?

Thanks!

Re: Question about physics.

Posted: Sat Oct 11, 2014 9:22 pm
by Kingdaro
Depending on what to do, it can be fairly unnecessary. For example, a game like angry birds which requires objects to be dynamically movable (to be knocked down) would need to use something like box2d. Super Mario Bros, on the other hand, only uses AABB rectangles, and only needs simple rectangle detection and resolution, something that can be provided by a small library like bump.lua or HardonCollider.

Re: Question about physics.

Posted: Sat Oct 11, 2014 10:18 pm
by roxxo
I just wanted to avoid to make a quadtree and the like, so I guess hardon collider and bump are better choices if I don't need real physics, but just collisions, isn't it?

Re: Question about physics.

Posted: Sat Oct 11, 2014 10:25 pm
by undef
If you have used Box2D before, you will have no problems using this.
But:
Do you really have to apply physics to every single tile?
Is it easier to describe your game with the physics module, or will it add complexity?

I generally suggest not using the physics module, unless you see great benefit from it for your particular project.

Re: Question about physics.

Posted: Sat Oct 11, 2014 10:47 pm
by roxxo
Of course, every tile would be static, I won't apply forces to tiles. As I said, I'm okay with collision detection + handling.

I'll just keep that question in mind, thank you both!

EDIT: if I use a tiled map, I could simplify collisions by tile, that's right, but I wanted to keep focus on if physics could be very bad performant.