I have to make a frogger game for my class. I have no clue when it comes to this stuff. I've managed to get to this point. 
I need to know what to do to make my frog die when it hits the water. And how to make it ride the logs. 
Any help?
Main frogger code(first Tab)
Car[] cars = new Car[4];//an array of 5 cars
Log[] logs = new Log[6];//an array of 5 logs
Frog frogger; 
Quote:void setup(){
  rectMode(CORNER);
  smooth();
  size(600,600);
  frogger = new Frog(300, 570); // Initiate Frog
  for (int v = 0; v < logs.length; v ++ ) { // Initialize each Log using a for loop.
    logs[v] = new Log(color(random(255),125,random(255)),50,v,random(1,3));
  }                                                    //^apart //^speed
  for (int i = 0; i < cars.length; i ++ ) { // Initialize each Car using a for loop.
    cars[i] = new Car(color(random(255),125,random(255)),50,i,random(5,10)); 
  }
}
void draw() {
  background (100, 173, 0);
  //road
  fill(145);
  stroke(145);
  rect(0,350,700,200);
  //mid point - safe
  fill(214,180,145);
  stroke(214,180,145);
  rect(0,250,700,100);
  //water
  fill(191,237,252);
  stroke(191,237,252);
  rect(0,80,700,200);
  //lillypad background
  fill(86,180,66);
  stroke(86,180,66);
  rect(0,0,700,100);
  frogger.showFrog();
  //start - safe
  for(int i=0; i<cars.length; i++){
    if(cars[i].intersect(frogger)){
      frogger.die();
    }
  }
  
  for (int v = 0; v < logs.length; v ++ ) { // Run each Log using a for loop.
    logs[v].move();
    logs[v].display();
  }
  for (int i = 0; i < cars.length; i ++ ) { // Run each Car using a for loop.
    cars[i].move();
    cars[i].display();
  }
}
void keyPressed () {
  if (key == CODED) {
    if (keyCode == UP) {
      if (!(frogger.frogy - 10 < 0)) {
        frogger.frogy = frogger.frogy - 20;
      }
    }
    if (keyCode == DOWN) {
      if (!(frogger.frogy + 10 > height - 10)) {
        frogger.frogy = frogger.frogy + 20;
      }
    }
    if (keyCode == LEFT) {
      if (!(frogger.frogx - 10 < 0)) {
        frogger.frogx = frogger.frogx - 20;
      }
    }
    if (keyCode == RIGHT) {
      if (!(frogger.frogx + 10 > width - 10)) {
        frogger.frogx = frogger.frogx + 20;
      }
    }
  }
}
 
Car Class (second tab) 
Quote:// The Car class does not change whether we are making one car, 100 cars or 1,000 cars!
class Car { 
  color c;
  float xpos;
  float ypos;
  float xspeed;
  Car(color c_, float xpos_, float ypos_, float xspeed_) {
    c = c_;
    xpos = width;
    ypos = 530-(ypos_*50) ;
    xspeed = xspeed_;
  }
  void display() {
    //rectMode(CENTER);
    stroke(0);
    fill(c);
    ellipse(xpos,ypos,70,40);
  }
  void move() {
    xpos = xpos + xspeed;
    if (xpos > width +10) {
      xpos = -20;
    }
    if (xpos < -25){
      xpos = width +10;
    }
  }
  boolean intersect(Frog myFrog){
       //colision detection of frog and car
    if ((myFrog.frogy >= ypos && myFrog.frogy <= ypos + 10 && myFrog.frogx >= xpos && myFrog.frogx <= xpos + 20) || (myFrog.frogy + 10 >= ypos && myFrog.frogy + 10 <= ypos + 10 && myFrog.frogx >= xpos && myFrog.frogx <= xpos + 20) || 
      (myFrog.frogy >= ypos && myFrog.frogy <= ypos + 10 && myFrog.frogx + 10 >= xpos && myFrog.frogx + 10 <= xpos + 20) || (myFrog.frogy + 10 >= ypos && myFrog.frogy + 10 <= ypos + 10 && myFrog.frogx + 10 >= xpos && myFrog.frogx + 10 <= xpos + 20)) {
           return true;
      } else {
        return false;
      }
  }
      
    } 
  
 
Frog Class (third tab) 
Quote:class Frog {
int frogx;
int frogy;
  
  Frog(int frogx_, int frogy_){
    frogx = frogx_;
    frogy = frogy_;
  }
  
  void showFrog() {
    
     //FROG
 fill(111,255,138);
 ellipse(frogx,frogy,30,30);
  }
  
//When the frog dies.  
  void die(){ 
    frogx = 300;
    frogy = 570; 
  
  
}
}
 
Log Class (fourth tab) 
Quote:// The log class does not change whether we are making one car, 100 cars or 1,000 cars!
class Log { 
  color c;
  float xpos;
  float ypos;
  float xspeed;
  Log(color c_, float xpos_, float ypos_, float xspeed_) {
    c = c;
    xpos = width;
    ypos = 250-(ypos_*30);
    xspeed = xspeed_;
  }
  void display() {
    //rectMode(CENTER);
    stroke(111,55,27);
    fill(111,55,2);
    rect(xpos,ypos,70,30);
  }
  void move() {
    xpos = xpos + xspeed;
    if (xpos > width +10) {
      xpos = -20;
    }
    if (xpos < -25){
      xpos = width +10;
    }
  
    //colision detection of frog and car
    if ((frogger.frogy >= ypos && frogger.frogy <= ypos + 10 && frogger.frogx >= xpos && frogger.frogx <= xpos + 20) || (frogger.frogy + 10 >= ypos && frogger.frogy + 10 <= ypos + 10 && frogger.frogx >= xpos && frogger.frogx <= xpos + 20) || 
      (frogger.frogy >= ypos && frogger.frogy <= ypos + 10 && frogger.frogx + 10 >= xpos && frogger.frogx + 10 <= xpos + 20) || (frogger.frogy + 10 >= ypos && frogger.frogy + 10 <= ypos + 10 && frogger.frogx + 10 >= xpos && frogger.frogx + 10 <= xpos + 20)) {
      // collision detected
      println("collision detected"); 
      
    }
  }
}
 
Any help with this would be great! I have no clue what I'm doing :(