错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Wandering Hazards

  • Casey Hardman

摘要

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 wait some amount of time between a minimum and maximum number of seconds before moving again, which we can configure in the Inspector.