Wednesday, January 25, 2012

The Next Step

I have the opportunity now that GraphViewer is nearing completion, to start planning out my next step. My next objective is to create more of a simple prototype of my game. This involves creating a basic game class to base the game off of. I have seen many ways of setting up a base game class, but the one that I find is most effective is the component model. Here is pretty simple explanation by Robert Nystrom. Pretty much it splits up the roles of a single object in a game. There is a separate graphics component, that draws everything to the screen, a physics component, that handles everything physical, etc. You can plug and play different components depending on how you want the object to act. I have sketched up simple plan for my game:

As you can see, the GameState object has several contexts (which handle the graphics/input/audio API), and and "Object pool" of entities. An entity is simply a "thing" in the game. It could be anything, a star ship, a laser, or even a timer. It is merely made up of components. Every context also has a pointer to each separate component. This is where it differs from Robert Nystom's model, allowing each context know about each entity's components. This allows for optimization within each context. 

No comments:

Post a Comment