nature-of-code / noc-examples-processing

Repository for example code from The Nature of Code book

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A simple question about the path following code

4skinSkywalker opened this issue · comments

I have a question about NOC_6_05_PathFollowingSimple

In the Vehicle class you calculate the target position outside the if (distance > p.radius), but actually you apply seek(target) only if in that condition is true, could you save some calculation by moving the logic for finding the target within the if (distance > p.radius) block?

Why did you choose to put that logic outside the conditional? Just for debugging reasons or there's something else useful you can do with that?