Modify the Monster Generator
In Build a Monster Generator, you set up a monster generator component that spawns monsters based on its set up, such as how many monsters per generator and how often they spawn. When a generator spawns a monster, you fire off an action that moves the new monster slightly to the right, stopping a few pixels away from the generator.
As you might have guessed, monsters who don’t move pose very little threat or challenge for Val—she is a warrior after all, and she deserves better. To solve this problem, you’ll set up some goals and behaviors to help the monsters track Val, but only when she has keys in her pocket. You’ll know when she does thanks to the state machine you set up in the previous chapter.
But moving monsters ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access