Modify a text file: $/trees30a.pde
$/trees30a.pde
//// Trees 30 (with arrays) String title= "Many Trees [in an array]"; String subtitle= "Click any tree to make it jump!"; String news="..."; String author= "Briley & BAM"; float horizon; color SKY= color( 150, 200, 250 ); color GRASS= color( 160, 255, 160 ); int many=3, maxtrees=30; Tree[] forest = new Tree[maxtrees]; Star sun = new Star(); void setup() { size( 800, 600 ); horizon = height/3; reset(); } void reset() { // Fill the forest with many trees! for ( int i=0; i
0) --many; reset(); news= many + " trees. ('r' to reset.)"; } if (key == '0') many=0; } void mousePressed() { for (int i=0; i
width) x=0; } }//// End of class Tree. ////