Game Development Reference
In-Depth Information
The information inside _blockPattern determines how many buildings we
show in a row, and once a series is completed, we show a gap by setting the
boolean value of _showGap to true . A gap's width is based on the current
value of _gapSize , which may increase as the game gets harder and it can't be
less than two times the tile width.
4. If we are not creating a gap this time, we determine the width and height of the
new block based on the current indexed values of _blockWidths and
_blockHeights :
} else {
blockWidth = _blockWidths[_currentWidthIndex];
_currentWidthIndex++;
if (_currentWidthIndex == _blockWidths.size()) {
random_shuffle(_blockWidths.begin(),
_blockWidths.end());
_currentWidthIndex = 0;
}
if (_blockHeights[_currentHeightIndex] != 0) {
Search WWH ::




Custom Search