Modify a text file: $/loops.pde
$/loops.pde
//// CST 112 practice: loops //// 7417:bam String title= "CST 112 practice: loops"; String author= "Prof.BAM"; String news= "(...)"; float top, bottom=400; Button left= new Button( "LEFT", 100, 430 ); Button shoot= new Button( "SHOOT", 200, 430 ); Button right= new Button( "RIGHT", 300, 430 ); Button go= new Button( "GO", 500, 430, 255,100,0 ); void setup() { size(640, 480); top=height/6; bottom=height*5/6; // } void draw() { scene(); targets(); gun(); varmits(); buttons(); } void scene() { background( 255, 200, 255 ); fill(100, 200, 100); rect( 0, height/6, width, height*2/3 ); float top=height/6, bottom=height*5/6; //// Waving grass //// stroke( 0, 150, 0 ); strokeWeight(3); float x; float y= height-20; for ( x=20; x
x+w) return false; if (yy < y || yy > y+h) return false; return true; } }