Game Development Reference
In-Depth Information
Text
Texture
TextureManager
Tween
Vector
These core engine classes should all be set to public . If they are private ,
protected ,or internal then any game using the engine library will not be
able to access them. There may also be private , protected, or internal
functions that now need to be made public so that they may be accessed from
the library; change these to public as you encounter them.
As you develop games, you can extend the engine with useful code you create.
The engine should never have any gameplay code for a specific game; the engine
should be general enough to form the basis of many different games.
Extending the Game Engine
The classes we've created so far cover a good deal of what is desirable in a game
engine. There are a few omissions: the input library could be better developed,
there is no support for handling multiple textures, and there is no support for
sound. These are all simple changes that will round out the engine.
You may notice that if you try to run the game engine project, you'll receive this
error: ''A project with an Output Type of Class Library cannot be started di-
rectly.'' Class libraries have no main function; they do not directly run code.
Instead, other projects make use of the code they contain. That means if you
want to test part of the engine you'll need to make a new project that uses the
engine.
Using the Game Engine in a Project
A new project needs to be created that will make use of the new engine class. This
project will be used to run the engine code and test the various improvements
we'll be making.
Close the engine project in Visual Studio and start a new project by selecting
File > New > Project. This time choose a Windows Form Application instead of a
 
 
Search WWH ::




Custom Search