/*to paint (not sure) voidmousePressed() { mouseX, mouseY; goldX=mouseX; goldY=mouseY; fill(_, _, _); ellipse(goldX, goldY, 30, 30); }*/ /*To do frames make background cover previous frame. void draw() { background(_, _, _); fill(_, _, _); rect(_, _, _, _, _);*/ // "%" is used to express remainders of division done //headsize 60 //if count % =30>15 //head size 90 //=fluctuating head size /*noFill(); fill(255); a,b,c,d,e,f,g,h c and e set the x-coords and _ and _ set the y coords. curve(50, 100, 150, 200, 250, 300, 350, 500);*/ /*void rays( float s, float t ) { // Draw ray from s to t //TOP line( sunX-s,sunY-s, sunX-t,sunY-t ); line( sunX+s,sunY-s, sunX+t,sunY-t ); //BOTTOM line( sunX-s,sunY+s, sunX-t,sunY+t ); line( sunX+s,sunY+s, sunX+t,sunY+t ); }*/ //some code I want to save /*//draw fill (0, 150, 0); rectMode(CENTER); rect(riburtX, riburtY, 50, 80); fill(255, 127, 0); ellipse(riburtX, riburtY-40, 40, 50); //arms rectMode(CORNERS); fill(0); rect(riburtX-60, riburtY-45, riburtX-35, riburtY-45+75); fill(0); rect(riburtX+60, riburtY-45, riburtX+35, riburtY-45+75); } /**\\NOTES// for(x=0;xwidth?0:x+dx; <-this does the same as... if(x>width){ x=0} else{ x++;} **/ /**void startPage(){ background(50); translate(mx, my); drawShape(); //START button drawn fill(225); stroke(0); rect(titleX-50,titleY+100,titleX+100,titleY+40,60); textSize(35); text("START",370,535); //the START button functionality and dimentions if(mousePressed&&mouseXtitleX-100&&mouseYtitleY-100) {playScreen=2;} textSize(40); fill(150,0,150); text("Riburt & Skelly",titleX-125,titleY-250); textSize(32); fill(0,102,153); text("RULES",titleX-50,titleY-80); textSize(32); fill(200,100,200); text("START",titleX-50,titleY+10);} // text("Author: "+author,800,500);} void drawShape() { PVector[] points; float radius = rStart; float x, y, a, r, r0; b = 100/ (float)steps; for (int j = 0; j < steps; j++) { points = new PVector[numPoints]; a = 0; r0 = 0; for (int i = 0; i < numPoints; i++) { r = random(radius/2, radius); x = cos(radians(a)) * r; y = sin(radians(a)) * r; points[i] = new PVector(x, y); a += sAngle / (numPoints - 1); if (i == 0) { r0 = r; } } if (match) { a -= sAngle / (numPoints - 1); x = cos(radians(a)) * r0; y = sin(radians(a)) * r0; points[numPoints-1] = new PVector(x, y); } if (cMode == 0) { fill(h, s, b); //stroke(h, s, b); } else { fill(random(360), random(50, 100), random(50, 100), 80); } for (float angle = 0; angle < 360; angle += sAngle) { pushMatrix(); rotate(radians(angle)); beginShape(); vertex(0, 0); curveVertex(points[0].x, points[0].y); curveVertex(points[0].x, points[0].y); for (int i = 0; i < numPoints; i++) { curveVertex(points[i].x, points[i].y); } //curveVertex(points[numPoints-1].x, points[numPoints-1].y); curveVertex(0, 0); vertex(0, 0); endShape(CLOSE); popMatrix(); } radius -= rStep; b += 100/ (float)steps; } }**/ //**make dx=10 if(x>width||x<0) dx=-dx x=x+dx float left=50; float right; left=0 x=left; right=width-100??? make if statement say left&right instead of other values @draw fish: float tailX=x, <-fish go left when dx>0 redraw tringle(x,y,tailX,y-h,tailX,y+h); if(dx<0){tailX=x+w;} <-when fish goes left, tail is x-w or use this->tailX=dx>0?x-w:x+w;} directly under draw new pair.. xx=dx>0?xx-2*w:xx+2*w; under draw new pair, up, down,.. ..if(dx>0){ tailX=x-w; xx=xx-2*w; else xx=xx+2*w; make seaweed float left right sealevel bottom void seaweed(){ float x; for(x=left;x0 if(dx<0){tailX=x+w;} //when fish goes left, tail is to the right x+w tailX=dx>0?x-w:x+w; //alt code triangle(x,y,tailX,y-h,tailX,y+h); make the sun follow a sine curve sin(PI,sunX,..**// /**\\ \\ \\ FLOATS // // // float left=50,right=width-100????,sealevel,bottom float tailX=x; <-fish goes left when dx>0 float tailX=x-w; <-tail is to the left when dx>0 make dx=10 with this 'if' statement if(left>width||right<0) dx=-dx x=x+dx the 'if' statement below needs 2B in 'draw fish' function if(dx<0){tailX=x+w;} <-when fish goes left,tail=right x-w tailX=dx>0?x-w:x+w;} <-or use this triangle(x,y,tailX,y-h,tailX,y+h); this function needs 2 exist / it's mandatory void seaweed(){ float x; for(x=left;x0?xx-2*w:xx+2*w; -- if(dx>0){ -- tailX=x-w; -- xx=xx-2*w; -- else xx=xx+2*w; " for(int j=1;j0?xx-2*w:xx+2*w; fish(xx,y+hh,ww,h); //above fish(xx,y-hh,ww,h); //below //-- if(dx>0){ //-- tailX=x-w; //-- xx=xx-2*w; //-- else xx=xx+2*w; xx=xx-2*ww; //new pair behind this pair ww*=0.7; //smaller hh=hh+h*3; } " **/