Modify a text file: $/pisano.java
$/pisano.java
//pisano float left=20, top=20, right=480, bottom=580; Fish rob; Fish tim; Fish john; //int many=5; int many=3, toomany=200; Fish[] school= new Fish [toomany] ; void setup(){ size (500,600); //background(100,100,100); reset(); } void reset(){ rob= new Fish(); rob.name = "rob"; tim= new Fish(); tim.name = "tim"; john= new Fish(); john.name= "john"; school[0]= rob; school[1]= tim; school[2]= john; /* school= new Fish[many]; for (int j=0; j
right-(w/2)) dx= -dx; if (y
bottom-(h/2)) dy=-dy; dy= dy + random( -0.5, +0.5 ); if (abs(dy) > 10) dy /= 10; } void show(){ /// draws fish fill (r,g,b); ellipse (x,y,w,h);//body if ( dx>0 ) { triangle (x-w/2,y,x-(w/2)-30,y-10,x-(w/2)-30,y+10);//fin fill(255); ellipse (x+w/4,y-6,5,5); } else { triangle (x+w/2,y,x+(w/2)+30,y-10,x+(w/2)+30,y+10); fill (255); ellipse (x-w/4,y-6,5,5); } fill(0); text (name, x-25, y-5); } } void check(){ } //keypressed(){ void keyPressed() { //// Handle keys if (key == 'q') exit(); if (key == 'r') reset(); if (key == 'F') { many--; if (many<0) many=0; } if (key == 'f') { if (many