Game Development Reference
In-Depth Information
{
for (int j = 0; j < _mapWidth; j++)
{
if (j == _playerX && i == _playerY)
{
Console.Write('@');
}
else
{
Console.Write('.');
}
}
Console.WriteLine();
}
Console.WriteLine();
}
Console.SetCursorPosition(0, 0);
}
}
Even though this code snippet is quite short, it demonstrates the basics of a
Roguelike. The next step is to read the input from the arrow keys and move the
character around the small world.
Tile-Based Role-Playing Games
Tile-based games build a 2D world from small sprites called tiles. Tiles are used in
all sorts of different games, not just role-playing, but they were a very popular
technique with the early Japanese-style RPGS such as the Final Fantasy games
(prior to the seventh), Chrono Trigger, the early Zelda games, and many other
titles. Tiled graphics are still very common on handheld devices such as the DS and
PlayStation portable. An example of a tile-based game can be seen in Figure 11.6.
All the tiles describing the world are packed together in one or more textures called
a tilemap. The tilemap used to build Figure 11.7 can be seen in Figure 11.8.
A good starting point for a tile-based game is to create a text file that represents
the world. For example:
############
# #
# #
#S E#
############
 
Search WWH ::




Custom Search