Exercises

To help you test your knowledge of this chapter's content, here are a few exercises that you should work on. They are not imperative to the rest of the book, but working on them will help you access your strengths and weaknesses in the material covered:

  1. Add a new item to the game. Then, hook it up to the spawn system so that it can be randomly spawned with the existing items.
  2. Add your own tile to the game. Hook this up to the spawn code and change the underlying level grid so that the player cannot move through it.
  3. Check whether the number of tiles that we created when calling Game::SpawnRandomTiles() are hard-coded:
    // change a selection of random tiles to the cracked tile sprite
    this->SpawnRandomTiles(tileIndex, 15);

    Use RNG to generate ...

Get Procedural Content Generation for C++ Game Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.