diff --git a/vehicle.js b/vehicle.js index 66e2bb0..01cfa86 100644 --- a/vehicle.js +++ b/vehicle.js @@ -12,8 +12,8 @@ function setup() { function draw() { // 追逐鼠标(); // 逃避鼠标(); - // 巡游小车(); - 小车追逐(); + 巡游小车(); + // 小车追逐(); } function 追逐鼠标() { @@ -119,9 +119,9 @@ class Vehicle { const y = offset * sin(PI / 2 + this.heading); target.add(x, y); - // noStroke(); - // fill("#F063A4"); - // circle(target.x, target.y, 5); + noStroke(); + fill("#F063A4"); + circle(target.x, target.y, 5); const steering = target.sub(this.position); this.acceleration.add(steering); @@ -179,7 +179,7 @@ class Vehicle { noFill(); stroke(50); strokeWeight(1); - if (this.path.length >= 1024) this.path.shift(); + if (this.path.length >= 10240) this.path.shift(); beginShape(); this.path.forEach((v) => { if (!v) {