// Mauricio O. - project 3 Button[] buttons; String buttonNames[]= { "Up", "Down", "Flock", "Gold", "Reset", "Quit" }; int numButtons= buttonNames.length; int score=0; String title= "Project 3x"; String author= "Mauricio O."; String news=""; int bgR, bgG, bgB, bgT; int count2; boolean debug=false; int n; float look; float birdX, birdY=20; float sunX=90, sunY=90; float cloudX=80, cloudY=80; float horizon=height/2; int step; float helpX, helpY; float grizzX, grizzY, grizzW=50, grizzH=80; float pikaX, pikaY, pikaW=70, pikaH=90; float rupeesX, rupeesY; int count=0 ; float Ladder; int pairs; // float pikaStep; float z = 1; float mX = 60, mY = 600; float x; float y= 100; float w; float h=height/2; float grizzDX; ; float shrink= .80; void setup() { //// setup //// size( 1000, 700); horizon= height/3; sunY= height/3; grizzX= width/2; grizzY= height/2; rupeesX=width; rupeesY=height/3; cloudX= horizon; cloudY= height/3; pikaX=30; pikaY= random( horizon, height-100); count=0 ; makebuttons(); } void makebuttons() { buttons= new Button[numButtons]; float x=150, y=50; for (int j=0; j100){ mY = mY-50; } } if ( frameCount%when == 30) { z = -z; if (mY100){ mY = mY-50; } } if ( frameCount%when == 45) { z = -z; if (mY width) { sunX=0; sunY= random( 5, horizon-1); score= score+50; } if (sunX > width) { sunX=0; news=""; } if ( count2++ % 150 == 2 ) { news=""; } sunX= sunX+2; fill(0); // text( sunX, sunX, sunY+40); text( "SCORE= " + score, width-300, 80 ); textSize(18); text( author, width*3/4, height-20 ); //-- text( news, width/3, 100 ); // textSize(12); text( "Monkey goes up and down with 'u' or 'd' keys.", width/5, height-60 ); text( "(Press '?' key for further help.)", width/5, height-40 ); textSize(18); } void buttons() { for (int j=0; j0 ? 10 : -10; stroke(355,255,0); strokeWeight(6); for (float x=100; x 1) { grizzX= width -30; pikaX= width+30; } else { grizzX= height-30; pikaX= height+15; } //news=""; gold(); grizzX= random(1, 1000); grizzY= random(1, 700); pikaX= random(1, 1000); pikaY= random(1, 700); mouseY=height; } void gold() { rupeesX= random(1, 1000); rupeesY= random(1, 700); } // Create a new flock of birds. / void newFlock() { pairs= int( random(3, 6) ); x=random(w/2); y=random( 40, height/4 ); w=random(10, 50); h=random(10, 50); } void eat() { //// pika eats grizz Deduct 100 from score. fill(232, 250, 0); //--textAlign(CENTER); news="you had been eaten"; score= score - 100; background(255, 0, 0); reset(); } // flocks of void flock(int pairs, float x, float y, float w, float h) { //draw a flock //draw a lead bird float u= h; bird(x, y, w, h); // draw pairs for (int loop=0; loop100) mY = mY-50; } void down() { z = -z; if (mY x+w) return false; if (yy < y) return false; if (yy > y+h) return false; return true; } }//class//