Skip to content

Commit

Permalink
Merge pull request #905 from nature-of-code/notion-update-docs
Browse files Browse the repository at this point in the history
fix examples
  • Loading branch information
shiffman committed Mar 7, 2024
2 parents 8c91d00 + 101b5db commit be4c84f
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function setup() {
createCanvas(640, 240);
flock = new Flock();
// Add an initial set of boids into the system
for (let i = 0; i < 1000; i++) {
for (let i = 0; i < 120; i++) {
let boid = new Boid(width / 2, height / 2);
flock.addBoid(boid);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function setup() {
grid = make2DArray(cols, rows);
flock = new Flock();
// Add an initial set of boids into the system
for (let i = 0; i < 1200; i++) {
for (let i = 0; i < 800; i++) {
let boid = new Boid(random(width), random(height));
flock.addBoid(boid);
}
Expand Down
1 change: 0 additions & 1 deletion content/examples/05_steering/exercise_5_2/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ function draw() {
target = new Target(random(width), random(height));
pursuer.pos.set(width / 2, height / 2);
}
//noLoop();

pursuer.update();
pursuer.show();
Expand Down
1 change: 0 additions & 1 deletion content/examples/05_steering/noc_5_01_seek/vehicle.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class Vehicle {

// Scale to maximum speed
desired.setMag(this.maxspeed);
desired.mult(-1);

// Steering = Desired minus velocity
let steer = p5.Vector.sub(desired, this.velocity);
Expand Down

0 comments on commit be4c84f

Please sign in to comment.