Open
Description
The leap from single segment path to multi-segment is a bit trickier than the simplified explanation in Chapter 5. Example 5.8 relies on the path moving from left to right and having its start and end points on the edges of the canvas.
This is a quick demonstration of how the code fails when the path doesn't follow this format:
https://editor.p5js.org/natureofcode/sketches/ZnQRpvMLr-
The vehicles are instantly stuck at the corner:
Some things to think about:
- explicitly mention this limitation
- examine the code to be more general purpose (re-read Craig Reynolds explanation, maybe I missed something important!)
- record a follow-up video to https://youtu.be/rlZYT-uvmGQ
There is also additional code for handling multi-segment paths in Exercise 5.13 that relates to this!
Metadata
Metadata
Assignees
Labels
No labels