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 ...
Get Apple Game Frameworks and Technologies 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.