Any 2D RnJ Platformer Sample Code?

Official forum for the Chipmunk2D Physics Library.
Post Reply
justindz
Posts: 3
Joined: Mon Mar 02, 2009 10:43 am
Contact:

Any 2D RnJ Platformer Sample Code?

Post by justindz »

I have been teaching myself 2D games lately and was working on a project in Ruby/Gosu. I built a scrolling tile engine with a little guy who walks around like in the old console RPGs, can't go through rocks, slows down in the woods, that sort of thing. But, I decided to try a multi-player, scrolling platform game over time. I'm starting with just getting a little scrolling run and jump going and Chipmunk seems very useful. I ripped out my custom tile collision detection and I want to use line segments, gravity, etc.

However, the documentation seems to assume that you know how or can figure out how to accomplish the type of game play you want using the brand of physics involved. In my case, I am learning this all from scratch. I am fairly good at reading and learning from code, but I have not been able to find any real example code for a platformer. I've found some videos, commercial games, demos, etc. and some forum articles which I read over the weekend that talk rather generally about how to do these things. But, I was wondering if anyone has a dedicated howto or code sample for this sort of game?

Alternately, is there some kind of good online resource that describes how to accomplish this sort of thing using the Chipmunk brand of physics to which I could apply the API? I haven't had any problem working in Ruby and using the C API, so I could probably go from a C physics tutorial based on the same kind of impulse/force/etc. model to my own Ruby work.

Hopefully some good resources exist. If not, and assuming I ever figure out how to do what I want to do, I would be willing to provide my core code and insights as it seems a lot of people have interest in doing platformers rather than Asteroid clones :-)
justindz
Posts: 3
Joined: Mon Mar 02, 2009 10:43 am
Contact:

Re: Any 2D RnJ Platformer Sample Code?

Post by justindz »

I have a further question as well. I have basic walls, ground, running and jumping/falling (although about as visually impressive as NES Dragon Warrior, minus the tiling talent). One thing I was wondering is whether falling can be made to accelerate slightly past the apex of a jump. It currently doesn't feel natural on screen. Is it tweakable without horrible monkey patching, or is this a limitation?

Chipmunk is extra swank!
Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests