Exercises

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

  1. Give the goblin enemy a slightly random color and scale every time one is spawned.
  2. Finish the code to generate armor procedurally for the humanoid by completing the condition for the torso and leg armor.
  3. Try to generate armor in a more succinct manner. We're using two textures; maybe there's a way to use only one. See if you can improve the function.

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.