Game Development Reference
In-Depth Information
long enough that it gives just enough time for the new level to be loaded before
the player emerges from it. Dog legs don't have to be corridors; they can also be
mountain passes or a narrow alleyway between tall buildings.
A top-down camera doesn't suffer as much from the vast world problems as an
FPS or third-person camera view, because the camera only looks at a small chunk
of the world. A player with an FPS camera can look to the horizon and see vast
trails of the land; this is not the case with the top-down camera. There is always
quite a small fixed area around the player. This makes loading and unloading
chunks of a level easier. Top-down views also do quite well with a tile-based
approach, but instead of each tile being a sprite, each tile is a 3D mesh that
matches its surrounding 3D tiles. This makes it much faster to make levels; a few
chunks can be modeled and then attached together to form a level fairly quickly.
Platform Games
Platform games are very popular for amateur and independent game developers.
There is a little math involved, but it tends to be quite simple, and there are a lot
of different gameplay ideas that can be explored in the 2D platformer world.
Most platformer games use a tile approach quite similar to the approach dis-
cussed in the role-playing section.
Platform games usually require a small degree of physics modeling; gravity nearly
always needs modeling. The physics can be written using the basic equations for
velocity and acceleration, or by using a third-party physics library, such as a
Box2d (there is a C# port called Box2dx). If you decide to code everything by
hand, then you can get something up and running quite quickly with the sprite
classes and simple rectangle-rectangle collision tests.
Here is a very simple game state that moves a red square around with the arrow
keys, and it can be made to jump with the up arrow key.
class PlatfomerTestState : IGameObject
{
class PlatformEntity
{
const float _width = 16;
const float _height = 16;
RectangleF bounds = new RectangleF(-_width, -_height, _width,
_height);
 
Search WWH ::




Custom Search