// declaring a global variable for AI cars Car[] cars; //player car Car player; //number of cars int numCars = 500; //speed of player int ros = 4; //sample Sample sine; //rate array int[] sr; int srCnt; void setup() { //size of canvas size(640, 480); //start up Sonia Sonia.start(this); //create a sample instance sine = new Sample("beck.aif"); //create empty rate array sr = new int[8]; //fill rate array, high to low for (int i=0; i<8; i++) { sr[i] = 22000+(8275*(i)); } //counter to step through rate array srCnt = 0; //making an empty array of AI cars cars = new Car[numCars]; //populating that array for (int i=0; iwidth) { redirect(); } //left boundary if (x<0) { redirect(); } //top boundary if (y<0) { redirect(); } //bottom boundary if (y>height) { redirect(); } } void aiDrive() { //move left if (dir == 0) { if (travel