January 2016
Intermediate to advanced
304 pages
6h 17m
English
The spawning of environmental features will be covered briefly here as there's a whole chapter toward the end of the book that is dedicated to procedurally generating the game map. This is our end goal. So, to get started, we'll generate some superficial environmental features that will be ready for the random level generation later.
Adding a new tile to the game will greatly increase the diversity of levels. One of the problems with procedural generation is that environments can feel too unnatural and generic. So this will help avoid that.
Let's add the following declaration to Game.h:
/** * Spawns a given number of a certain tile at random locations in the level. */ void SpawnRandomTiles(TILE tileType, int count);
We have two ...
Read now
Unlock full access