In this chapter, we’ll implement an obstacle type that we’ll call Wanderer. They’ll look like the Patrollers we implemented in the last chapter, but instead of moving along a set of points repeatedly, they’ll be confined to a rectangular region, and they’ll periodically wander over to a new point inside that region. We can put multiple Wanderers in the same region, and they’ll all act separately, finding a new place to move to every so often. We’ll use a little bit of random number generation to make them ...
19. Wandering Hazards
Get Game Programming with Unity and C#: A Complete Beginner’s Guide 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.