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:
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.
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.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 a count during the runtime instead.
Now we have our Game::SpawnItem function, update our enemy item drops to use it.
Since we now have a function to calculate actual tile location, update our torch spawn code so we don't do the position calculations...