I've been trying to wrap my mind around this for a while now. In a pseudo 3D side scrolling game (2D game, but characters can move not only forward and back, but also up and down within a certain area, like double dragon or golden axe), how would you approach setting up Chipmunk physics?
Set it up like you would a 2D overhead view game? I guess you'd lose gravity and correct collisions between objects (a characters head would collide with another characters foot, if they are at different Z depths).
Set it up like a 2D side scrolling game - with different layers with their own physics boundaries, which would represent different Z depths, between which a character would move - and objects in one layer can't interact with objects in another layer? I'm not sure if this is even doable, or practical, or fast enough.
I'm doing this in Cocos2D. Any guidelines would be very valuable at this point.
How would you set up physics for a pseudo 3D sidescroller?
-
- Posts: 2
- Joined: Mon Oct 22, 2012 3:55 pm
- Contact:
- slembcke
- Site Admin
- Posts: 4166
- Joined: Tue Aug 14, 2007 7:13 pm
- Contact:
Re: How would you set up physics for a pseudo 3D sidescrolle
Hrm. If you really want smooth movements in all directions it might actually be better to use a 3D physics engine like Bullet instead. I think I would not use Chipmunk for it myself.
Another possibility is something like what Little Big Planet does. There are 3 distinct z-layers, and players can only be in one at a time although level geometry could be in multiple. You could easily implement that using Chipmunk layers. While you could use more than 3 layers to give the z-dimension more resolution, things would only be able to interact in the x/y plane. Collisions in the z-dimension wouldn't be able to affect things without clever hacks (which might be interesting?). Sometimes the charm of older games is their simplicity, or quirky not-quite-realistic rules instead of being crazy realistic. It might make the controls simpler for a touchscreen game I suppose. Something to think about, but it really depends on what you want.
Another possibility is something like what Little Big Planet does. There are 3 distinct z-layers, and players can only be in one at a time although level geometry could be in multiple. You could easily implement that using Chipmunk layers. While you could use more than 3 layers to give the z-dimension more resolution, things would only be able to interact in the x/y plane. Collisions in the z-dimension wouldn't be able to affect things without clever hacks (which might be interesting?). Sometimes the charm of older games is their simplicity, or quirky not-quite-realistic rules instead of being crazy realistic. It might make the controls simpler for a touchscreen game I suppose. Something to think about, but it really depends on what you want.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
-
- Posts: 2
- Joined: Mon Oct 22, 2012 3:55 pm
- Contact:
Re: How would you set up physics for a pseudo 3D sidescrolle
Thanks a lot Slembcke. That pretty much confirms what I've been thinking.
Who is online
Users browsing this forum: No registered users and 10 guests