Rubygame 3: Days 13 & 14

Not much to report, just vague ideas about sprites and Chipmunk floating around in my head during my spare moments the past few days, waiting for it all to click together.

Technically this is the end of week 2, and according to the schedule I should be starting on the actual development part now. But, since I can't really develop something that has no design, I'll be spending some of the development time trying to hammer out a tangible design.

Not sure if the schedule is still do-able; it really depends on when this design forms itself in my brain. It doesn't help that I've been too busy to put in much time during the past week or so. We'll see.


sparkymat submitted a comment on #

Thou progress is being watched. Am using Rubygame for my game :) . So quite interested to see how Rubygame 3.0 turns out. A question. Just wondering how Chipmunk would work for an isometric game?

Scott Lembcke submitted a comment on #

I’ve been working on a 2D Ruby scenegraph library that integrates well with Chipmunk.

In the scenegraph, the nodes represent things like transformation changes, blending mode changes, rendering geometry, etc. In relation to sprites, think of the sequence -> applying a transformation, setting the blending mode, setting the texture, and rendering some geometry.

The fun thing about the scenegraph is that you can compose “chunks” of the scenegraph and reuse them. Thinking of the sprite again. A particular sprite instance can share the same geometry, blending, and texture nodes as all the other instances of the same type of sprite. (lets call this chain a sprite template) The only thing that needs to set them apart is the transformation, meaning that you only need to create a new transformation node and set it’s child to the sprite template. That’s the cool thing about using a scenegraph as compared to vanilla sprites, is that you can easily construct hierarchical sprites, render shadows, and a bunch of other nifty effects simply by reusing chunks and setting different rendering states or transformations.

Aeroids.rb- Asteroids in 130 lines using a scenegraph.

Getting back to the Chipmunk integration, I basically have a “BodyNode” that applies a transformation from a Chipmunk body. All the child nodes move along with the body. AS_bodyNode.c

While I don’t really recommend anyone to use my Ruby game runtime at the moment due to how often I change the API, feel free to steal any of the code you wish.

Google code page

Have something interesting to add to the discussion? Email your thoughtful comments to