Mike Owens


Renaissance Hacker Extraordinaire (look at the ego on this one)

Filespanker LLC

September 19
Day 16: Rubygame, Audio, Cleanups

If you’re using SDL/OpenGL with Ruby, just use Rubygame. It brings in sdl-ffi (which apparently Nice-FFI was written for), and in general just uncomplicates things. I had almost converted to Glut a few days ago to get rid of my SDL dependency, but now I’m glad I didn’t. I was only using SDL for events and getting a GL context. Swapping over to Rubygame let me do both of those things, but with a MUCH nicer interface, add sound/background music trivially, and I finally fixed my game loop timestep. Realizing where the next few steps were headed, I took out a bunch of “works for now” hacks and put a lot of things where they needed to be. 

Ruby’s “require” is seriously deficient vs. Python’s “import”. The lack of an __init__.rb makes a bunch of “proxy requires” necessary for libs, and INSIDE the lib, you end up with Rails-style File.dirname(__FILE__) cruft. 

I have four goals over the next few days: 
A) Get a real hold on the camera. The time for glOrtho has passed, because I need parallax layers. 
B) Tighten up the controls for the player. I’m tired of him skating everywhere. 
C) Get the dude animated. How I do this depends on… 
D) Decide how I handle getting large SVG objects on the screen. 

My GeometryRender can handle simple objects (solid fill, no stroke), but I’ll have to introduce the concept of a “stacked mesh” to get them on screen. My CairoRender can render damn near anything, except the texture sizes would be unreal for things like the tree to the left. I’d have to splice them even across single objects, and get into the texture-virtual-memory game, which I don’t look forward to.

Day 16: Rubygame, Audio, Cleanups

If you’re using SDL/OpenGL with Ruby, just use Rubygame. It brings in sdl-ffi (which apparently Nice-FFI was written for), and in general just uncomplicates things. I had almost converted to Glut a few days ago to get rid of my SDL dependency, but now I’m glad I didn’t. I was only using SDL for events and getting a GL context. Swapping over to Rubygame let me do both of those things, but with a MUCH nicer interface, add sound/background music trivially, and I finally fixed my game loop timestep. Realizing where the next few steps were headed, I took out a bunch of “works for now” hacks and put a lot of things where they needed to be.

Ruby’s “require” is seriously deficient vs. Python’s “import”. The lack of an __init__.rb makes a bunch of “proxy requires” necessary for libs, and INSIDE the lib, you end up with Rails-style File.dirname(__FILE__) cruft.

I have four goals over the next few days:
A) Get a real hold on the camera. The time for glOrtho has passed, because I need parallax layers.
B) Tighten up the controls for the player. I’m tired of him skating everywhere.
C) Get the dude animated. How I do this depends on…
D) Decide how I handle getting large SVG objects on the screen.

My GeometryRender can handle simple objects (solid fill, no stroke), but I’ll have to introduce the concept of a “stacked mesh” to get them on screen. My CairoRender can render damn near anything, except the texture sizes would be unreal for things like the tree to the left. I’d have to splice them even across single objects, and get into the texture-virtual-memory game, which I don’t look forward to.