Question about physics.

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
roxxo
Prole
Posts: 4
Joined: Sat Oct 11, 2014 5:17 pm

Question about physics.

Post 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!
User avatar
Kingdaro
Party member
Posts: 395
Joined: Sun Jul 18, 2010 3:08 am

Re: Question about physics.

Post 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.
User avatar
roxxo
Prole
Posts: 4
Joined: Sat Oct 11, 2014 5:17 pm

Re: Question about physics.

Post 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?
User avatar
undef
Party member
Posts: 438
Joined: Mon Jun 10, 2013 3:09 pm
Location: Berlin
Contact:

Re: Question about physics.

Post 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.
twitter | steam | indieDB

Check out quadrant on Steam!
User avatar
roxxo
Prole
Posts: 4
Joined: Sat Oct 11, 2014 5:17 pm

Re: Question about physics.

Post 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.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 3 guests