Seeking a Target
Nature of Code Lesson #5.2
This video explores Craig Reynolds’ formula for Steering Behaviors in JavaScript (p5.js) beginning with “Seeking a Target.”
Topics
- 0:00 - Hello!
- 1:10 - Explain! What is the desired velocity for seeking?
- 2:46 - Explain! What is the steering force?
- 5:23 - Code! Let's make a Vehicle class from Particle.
- 6:25 - Code! Now we need a target.
- 6:48 - Code! Now let's add code to the seek method!
- 8:21 - Explain! What can we do to make this feel a bit more realistic?
- 9:16 - Code! Adding a maximum force.
- 10:27 - Code! Let's do a little clean up.
- 11:05 - Ideas! What could you try next?
Community Contributions
You can also add your own version! (See how)
Links discussed in this lesson
- Steering Behaviors For Autonomous Characters by Craig Reynolds
Videos discussed in this lesson
- Gravitational Attraction - Nature of Code 2.5 by The Coding Train
- Angles and Vectors - Nature of Code 3.3 by The Coding Train