Displaying 2D isometric maps
Despite the advent of modern graphics hardware that can support full-blown 3D imagery quite easily, isometric displays continue to be a popular choice for many games as it can speed up the production of both code and artwork considerably when you only need to deal with two-dimensional images instead of three-dimensional models. If there's one thing that game designers at all levels appreciate, it's the ability to get things done even faster.
Getting ready
An image of an isometric element such as the following cube is required for this recipe:
It can be something as simple as a flat isometric square, but a cube may prove to be an easier subject to deal with for initial testing and alignment.
How to do it...
1. First, define the texture and the dimensions of both the cubes and the visible world as follows:
Vector2 scrollOffset; Texture2D cube; int halfCubeWidth = 50; int halfCubeHeight = 25; float depthVolume = 5f * 5f * 5f;
2. Using the
LoadContent()
method, load...