Monday, September 15, 2008

Work on Carpac

With a basic, functioning engine done (in the form of the Tumbling Robots demo), I am now working on making a more complete demo with it. The plan is to make some variant of a Pacman game (hence the name, 'Carpac').
I am also exploring the idea of a component-based software architecture for the code, as described by this article on GameArchitect.net. It's quite an interesting read.
So far, my design consists of three separate worlds: rendering, physics, and game. Each object in the game can then have components in each of these worlds. For instance, a static floor would have:
  • a rendering component that draws the box representing the floor volume, and
  • a physics component that adds a solid, static body to the world in the space the floor occupies.
It won't have a game component since a floor doesn't really do anything (not at this stage atleast - maybe I will add one in the future if I find a need for it). Usually, game components are used to interact with other objects in the game world like damage players or pick-up power-ups.
So what's the point? Read the GameArchitect.net article for more information.
This is just a rough idea. I do not know if it will work or whether it is a better structure. This is an experiment after all. It will most probably change significantly by the time I am done though!
Check back in a day or so. I should have a video to show soon!
Browse the code so far: http://code.google.com/p/glutinous/source/browse/#svn/trunk/carpac/src