xxxxxxxxxx
30
//"made-up" steering behavior to stay within walls
let v;
let debug = true;
let d = 25;
function setup() {
createCanvas(560,390);
v = new Vehicle(width/2, height/2);
}
function draw() {
background(220);
if (debug) {
stroke(175);
noFill();
rectMode(CENTER);
rect(width/2, height/2, width-d*2, height-d*2);
}
//call the appropriate steering behaviors for agents
v.boundaries();
v.update();
v.display();
}
function mousePressed() {
debug = !debug;
}