Game Development Reference
In-Depth Information
We will store _lastBlockHeight and _lastBlockWidth because the
more information we have about the terrain the better we can apply our own con-
ditions to it, as you will see in a moment.
3. Consider that we are set to _startTerrain :
if (_startTerrain) {
if (_showGap) {
int gap = rand() % _gapSize;
if (gap < 2) gap = 2;
block->setupBlock (gap, 0, kBlockGap);
_showGap = false;
} else {
//...
In the following screenshot, you can see the different widths used for our blocks:
Search WWH ::




Custom Search