Methods (to "organize" & "modularize"). scene(): sky, grass, hills, houses, etc. notes(): title, subtitle, signature, score, etc action(): creatures move around. (Interact?) (These are void functions with no args, for now), e.g. in addition to setup(), draw(), mousePressed(), etc. Variables (global declarations, for now). "parameterization" (Also: system-defined variables, e.g. height, width, etc.) Assignment statements. Expressions, operators ---- Projects 0 & 1 -- practice. Draw shapes, fill, etc. Follow mouseX,Y Project 2 [?] -- moving creatures Each has coordinates (x,y) and velocity (dx,dy) variables. hero (you make up the name!) monster[s] (whatever!) others (birds, etc.) Respond to events, such as mouse click, Movement w/o IF statements, e.g. x= x + (mouseX-x) / 2; x= x % width; x= constrain( ... x= ... + random( ... ----- //// Today's lesson & demo: // Click to set new gold location. // Hero chases gold, dog chases hero, puppy chases dog. // Monster heads for OLD position of hero. // ?? It is dark (and monster cannot see hero), // except for flash oi light during gold placement. void draw() { // Next frame. scene(); notes(); bird(); monster(); hero(); dog(); puppy(); } void bird() { // Move & draw bird. fill(0,0,255); triangle( birdX,birdY, birdX-40,birdY-20, birdX-40,birdY+20 ); } void hero() { // Move toward gold. heroX= heroX + (goldX-heroX)/60; heroX= heroY + (goldX-heroY)/60; // Draw hero fill( 255,255,0 ); rect( heroX, heroY, 50, 80 ); fill( 255,200,150 ); ellipse( heroX, heroY-80/2-30/2, 30, 30 ); // + eyes eyes(); } // STUBS // void dog() { } void puppy() { } void monster() { } void eyes() { }