I will be in labs (all of them) next week. 

I will guide you through the three stages of the semester project. 

I want to write the first stage today. 

I will post a list of questions (with answers) to study for the final.

I graded and posted stats about Exam Three. 

I look forward to see you come for makeups between now and the end of time. 

Don't leave things to the last minute because if the office gets crowded I leave. 

At the end of today's class minute paper: thoughts about Tetris. 

Alternative project is: shopping cart with Tomcat (JSP/Java servlets). 

Finally tell me about your write-in (if any). 

There are Pieces. A current Piece is falling at all times. While the current Piece
can fall down it does, and when it can't any more it stops. A new current Piece is
generated and starts falling from the top. The falling Piece stops falling when it
touches the Ground. Pieces that fall and get stuck join the Ground. They become part
of the Ground. 

import java.awt.*;
import java.awt.event.*;

public class Game implements World {
  Piece current; 
  Ground ground; 
  public Game() {
    this.current = new Piece(200, 0); 
    this.ground = new Ground(); 
  }
  public void teh() {
    this.current.fall(); 
  }
  public void meh(MouseEvent e) {
    
  }
  public void keh(KeyEvent e) {
    
  }
  public void draw(Graphics g) {
    System.out.println( this.current ); 
  }
  public static void main(String[] args) {
    BigBang b = new BigBang(new Game()); 
    b.start(1000, 400); 
  }
}

-- 

public class Piece {
  int x, y; 
  public Piece(int x, int y) {
    this.x = x; 
    this.y = y;
  }
  public void fall() {
    this.y += 5;     
  }
  public String toString() {
    return "Pc(" + this.x + ", " + this.y + ")";  
  }
}

--

import java.util.*;

public class Ground extends ArrayList<Piece> {
   
}

Now we run and it shows and we want to see more. 

import java.awt.*;
import java.awt.event.*;

public class Game implements World {
  Piece current; 
  Ground ground; 
  public Game() {
    this.current = new Piece(200, 0); 
    this.ground = new Ground(); 
  }
  public void teh() {
    this.current.fall(); 
    if ( this.current.y >= 400 || this.current.touches(this.ground) ) {
      this.ground.add( this.current );  
      this.current = new Piece(200, 0); 
    }
  }
  public void meh(MouseEvent e) {
    
  }
  public void keh(KeyEvent e) {
    int code = e.getKeyCode(); 
    if (code == 37) {
      this.current.left();  
    } else {
      this.current.right();  
    }
  }
  public void draw(Graphics g) {
    System.out.println( this.current ); 
    this.ground.draw(g); 
    this.current.draw(g); 
  }
  public static void main(String[] args) {
    BigBang b = new BigBang(new Game()); 
    b.start(200, 400); 
  }
}

--

import java.awt.*;
import java.awt.event.*;

public class Game implements World {
  Piece current; 
  Ground ground; 
  public Game() {
    this.current = new Piece(200, 0); 
    this.ground = new Ground(); 
  }
  public void teh() {
    this.current.fall(); 
    if ( this.current.y >= 400 || this.current.touches(this.ground) ) {
      this.ground.add( this.current );  
      this.current = new Piece(200, 0); 
    }
  }
  public void meh(MouseEvent e) {
    
  }
  public void keh(KeyEvent e) {
    int code = e.getKeyCode(); 
    if (code == 37) {
      this.current.left();  
    } else {
      this.current.right();  
    }
  }
  public void draw(Graphics g) {
    System.out.println( this.current ); 
    this.ground.draw(g); 
    this.current.draw(g); 
  }
  public static void main(String[] args) {
    BigBang b = new BigBang(new Game()); 
    b.start(50, 400); 
  }
}

--

import java.util.*;
import java.awt.*; 

public class Ground extends ArrayList<Piece> {
  public void draw(Graphics g) {
    for (Piece p : this)
      p.draw(g); 
  }
}

--

import java.awt.*; 

public class Piece {
  int x, y; 
  public Piece(int x, int y) {
    this.x = x; 
    this.y = y;
  }
  public void fall() {
    this.y += 5;     
  }
  public void left() { this.x -= 5; } 
  public void right() { this.x += 5; } 
  public String toString() {
    return "Pc(" + this.x + ", " + this.y + ")";  
  }
  public void draw(Graphics g) {
    g.setColor(Color.YELLOW); 
    g.fillOval(this.x - 10, this.y - 10, 20, 20);
    g.setColor(Color.BLACK); 
    g.drawOval(this.x - 10, this.y - 10, 20, 20);
  }
  public boolean touches(Ground g) {
    for (Piece p : g)
      if (p.overlaps(this))
        return true;
    return false; 
  }
  public boolean overlaps(Piece other) {
    return 20 < Math.sqrt( Math.pow( this.x - other.x, 2 ) + 
                           Math.pow( this.y - other.y, 2 ) ); 
  } 
}

--

Small error: what is it? 

(to be continued)