Creating block worlds within the Reach profile
With the popularity of the game Minecraft a wave of games pursuing a similar type of block-based imagery have followed.
Presented here is a suitable starting point for creating tracts of block-based geometry utilizing the mesh creation classes discussed in Chapter 3, Procedural Modeling.
It also highlights one possible method of incorporating sprite sheets into your game.
Getting ready
We're going to need a sprite sheet image containing all of the textures intended for use on the blocks, along with a text file providing the mapping details for each texture.
For example, here is a sprite sheet:
Along with the contents of the associated text file that are as follows:
Grass = 0 0 128 128 Ground = 129 0 128 128
An online search for XNA sprite sheet packers should hopefully reveal a few, including my favorite at the time of writing produced by Nick Gravelyn available at http://spritesheetpacker.codeplex.com
This example also makes use of the GeometricBuffer...