nimgame2 icon indicating copy to clipboard operation
nimgame2 copied to clipboard

Plans to implement collision between entities?

Open hcorion opened this issue 7 years ago • 5 comments

Hi, I'm wondering if you were planning to implement a physics engine? If you were, do you think it would be best to use a pre-made one like chipmunk2d?

hcorion avatar Mar 07 '17 01:03 hcorion

There's actually a primitive physics implemented already https://github.com/Vladar4/nimgame2/blob/master/nimgame2/entity.nim#L296 with the possibility of using something else.

Vladar4 avatar Mar 07 '17 07:03 Vladar4

Does it deal with collisions? The two objects in my game aren't colliding (ie when one hits the other it can't move any further). I made sure they had bounding boxes using the debug.

hcorion avatar Mar 07 '17 07:03 hcorion

No, it does not work with the object interactions, just with a single objects. Anything else should be coded manually at this moment.

Vladar4 avatar Mar 07 '17 07:03 Vladar4

Ok, that's what I was wanting when I said Physics engine.

hcorion avatar Mar 07 '17 07:03 hcorion

@hcorion I'd recommend taking a look at https://github.com/oprypin/nim-chipmunk

Chipmunk2D is a pretty excellent 2D physics engine, that shouldn't be too hard to slot into any game engine (depending). It's all proper rigid body, and has some amazing features. Take a look at this:

https://github.com/matkuki/chipmunk7_demos

girvo avatar Apr 04 '17 12:04 girvo