Rebirth 0.6
| Published: | Comments: 1 | Filed under: Announcements, Rebirth
I finished Rebirth 0.6 tonight. This version adds the GameObject class, which is the base class for objects in the game and on the screen, such as characters, items, missiles, and so on.
In addition to adding the new class, I also did some more refactoring, and made a new mixin module, Drawable, which handles the OpenGL transformation voodoo for GameObject and Shape.
The demo for this version looks the same as before in a screenshot, but you can now control the box with the numeric keypad! The keypad's arrow keys (2, 4, 6, and 8) move the box (down, left, right, and up, respectively). Keypad 7 and 9 rotate the box counterclockwise and clockwise. Keypad + (plus) and - (minus) make the box larger or smaller.
It's not the most impressive demo in the world, but it's nice to be far enough along that I can control objects on the screen. At this point, it would be possible to recreate Pong with Rebirth. How exciting! ;-D
Regarding the depth issue I blogged about last time, I decided to go with the lazy way. Not because it's lazy, but because it's consistent with software like Inkscape / SVG and Flash. After thinking about it, I realized that I've been half-subconsciously modelling the graphics system of Rebirth after SVG. Rebirth's GameObjects correspond to SVG's groups, and Shapes correspond to the various SVG shapes.
Inkscape and SVG have also influenced my plans for shape styles. Shapes will have "fill" and "outline" styles, which can (eventually) be solid colors, images/textures, and perhaps gradients (depending on how confident I'm feeling about my OpenGL skills). You'll be able to control how thick the outlines are, of course, and maybe line stippling (dotted/dashed lines).
I do have two small concerns about Chipmunk integration. The first is that Chipmunk has support for circles, but not for ellipses (ovals). Since Shapes and GameObjects can be squished and squashed and sheared, I'll need to be able to approximate all shapes as polygons, with the transformations applied (glUnproject might help with that). The second is that Chipmunk doesn't support hierarchical objects, so I'll need to figure out how I'm going to handle that. Perhaps just make so that all shapes and children of a physics-enabled GameObject form one body.
Anyway. The next version is supposed to be adding the Circle class, but I might do some rearranging and update the plans, since I've noticed Rebirth is missing a central class to hold the game together as a cohesive unit. Long ago, I called that class Game, and it held a clock, event manager, camera, and world filled with sprites. I'll probably come up with a different class name (to avoid confusion with the GameObject class), but the general idea is the same.
Comments