Stephcraft / Project-16x16

2D Platformer game made with processing
GNU General Public License v3.0
97 stars 77 forks source link

Replace project collision solution with a more robust solution #147

Open R4nKF1v3 opened 4 years ago

R4nKF1v3 commented 4 years ago

This issue is mentioned as a bullet point in #68 and i'm opening it here for better isolation.

As the collision solution implemented in the project currently is not as much escalable, i'm taking a shot on it. Talking with @Stephcraft over Discord, he gave me advice on the desired implementation, using a PhysicsEngine singleton to register and handle every collision check for every non-static Collider object. The reached design is as follows:

Things left out from this refactor, left pending of implementation:

Please, do tell me if i'm missing something or any suggestion, i'll be working on it shortly.

micycle1 commented 4 years ago

I once tried to integrate the fisica library into the Project, although I came across some kind of glitch with the library and abandoned it.

It might also be worth looking at Box2D for Processing to see whether that could be integrated, before designing a new collision/physics engine in-house.

R4nKF1v3 commented 4 years ago

Thanks @micycle1 ! I'll check that library out and see if it's a viable integration (From what i've seen, it may well be what we're looking for)