/// Ex /// make rect (joe) mouse x, mouse y, blades of grass, //joe chases the mouse, divide x by 30 divide y by 30 float X, topX; float position; // -1to 1 float centerX= width/2; void setup() { size(500,500); stroke(0); } void draw() { scene(); drawJoe(); moveJoe(); } void scene() { background(255, 255, 200); /// grass at the bottom for (int X=0; X <= width; X + =5); top X = X +position*10; line(X, height, X, height-10); } void drawJoe() { rect(20, 30, 55, 50); fill(255, 0, 0); { void moveJoe() { dX= (mouseX - JoeX) /30; dY= (mouseY - JoeY) /30 joeX = JoeX+ dX; joeY = JoeY+ dY; position =( joeX- centerX)/centerX; }