class Vehicle { float x,y,rad,dx,dy; Vehicle prev; boolean inst = false; Vehicle(float ax, float ay, float arad){ println("I'm a car"); x = ax; y = ay; dx = random(-7,7); dy = random(-7,7); rad = arad; inst = true; } void update(){ move(); ellipse(x,y,rad,rad); } void calcds(){ /*if(prev.inst){ dx = 0.1(prev.x-x) }*/ } void move(){ x+=dx; y+=dy; bounds(); } void bounds(){ if(y<0){ y=0; dy = -1*dy; } else if(y>400){ y=400; dy = -1*dy; } if(x<0){ x=0; dx = -1*dx; } else if(x>400){ x=400; dx = -1*dx; } } }