Game Development Reference
In-Depth Information
The following screenshot shows the project as it currently stands:
While this topic is not intended to teach you the ins and outs of programming a
game (it's assumed you already know how to do that) it might still be worthwhile
providing a few notes on how the sample game is put together.
The GameObject class
The GameObject class is the base class for anything that makes up a part of the game
world. Currently there are two classes which inherit from this class, Skier and Tree .
No prizes for guessing what they represent!
GameObject provides two virtual methods that can be overridden by child classes
to implement the behavior of an in-game object. The GameObject::Update method
provides support for changing the position of an object by applying a velocity to it,
while the GameObject::Render method allows a size and a material to be defined, and
it will draw a textured polygon at the object's current position using this information.
The ModeManager and Mode classes
The main flow of most games is often represented internally as some kind of state
machine. Even the simplest game will normally have at least a title screen and the
main game screen, but add to this things such as pause modes, high score tables,
options screen, and the like, and you soon end up with a large number of states that
your game could be in.
 
Search WWH ::




Custom Search