Some question about Chipmunk

Official forum for the Chipmunk2D Physics Library.
Post Reply
di3go
Posts: 1
Joined: Tue Apr 08, 2008 10:34 am
Contact:

Some question about Chipmunk

Post by di3go »

Hi guys,

Im new at game development and i started with gosu, im planing to make a 2d side scroller, the map and some monsters gonna be very rich so i cant do the collisions with just retangles, im planning to use the chipmunk to make this collision. I didint used the chipmunk yet, im need know one thing before start to study :)

chipmunk support polygons, right? my idea is to use photoshop to make all the images and the collision mask, then later RMagick to get the X,Y of the collision mask and create a file with a array to make the polygon to use later when the game run (this is all pre-calculated)

but, now is the problem, a monster animation its about 10 images, and some have diferente sizes, everytime i switch the image can i update the chipmunk polygon for that image to make the collision?

Thanks!
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Some question about Chipmunk

Post by slembcke »

Chipmunk supports convex polygons (no dents). The simpler the better.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Michael Buckley
Posts: 46
Joined: Tue Aug 21, 2007 10:30 am
Contact:

Re: Some question about Chipmunk

Post by Michael Buckley »

I have a feeling that changing the shapes attached to a body each frame might cause some odd collision detection behavior in certain cases, but I haven't tested it myself.
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Some question about Chipmunk

Post by slembcke »

Oh! I misread that. That will be a problem for sure. Changing the shape of the object will not produce a realistic collision response.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Beoran
Posts: 19
Joined: Sat Apr 12, 2008 2:02 pm
Contact:

Re: Some question about Chipmunk

Post by Beoran »

My advice to you would be: YAGNI, You Aint' Gonna Need It. Just use a rectangular hit box that is a bit smaller than the sprite's bounding box. If you want your monsters to havze a special weak spot, add a "hit box" for that too. Most all classic, famous, 2D console games like Mario, etc, were written on lowly hardware that didn't support much in ways of collision detection. Static hit boxes (rectangles or a set of circles) will most likely be fine. So make it easy on yourself and try to the simple way first. :)
Post Reply

Who is online

Users browsing this forum: Heise IT-Markt [Crawler] and 9 guests