Advertisement

How to code patrol() function for my bots?

Started by October 24, 2016 03:22 PM
9 comments, last by Kylotan 8 years, 4 months ago

The benefit of implementing a circular patrol, where you return to the first point when you get to the end, is that you can make it look like a reverse patrol just by duplicating patrol points. So instead of saying "0, 1, 2, 3, then reverse", you can just have points "0, 1, 2, 3, 2, 1", and then it circles back to 0.

You can't go the other way, and define a reversible patrol route look like a circular one.

So, to keep things simple, I think it's preferable to have all patrols as circular, and just define the differences in the data.

This topic is closed to new replies.

Advertisement