import java.awt.*; 
import java.awt.event.*; 
import javax.swing.*; 

class Tetris implements World {
  public void draw(Graphics g) { // world->image
    System.out.println("World being drawn."); 
    /*********************************************************
    Block b = new Block((int)(Math.random() * 10), 
                        (int)(Math.random() * 20), 
                        new Color((int)(Math.random() * 255), 
                                  (int)(Math.random() * 255), 
                                  (int)(Math.random() * 255))); 
    b.draw(g); 
    **********************************************************/
    Tetromino t = new Tetromino(new Point(250, 250), Utilities.makeSquare()); 
    t.draw(g); 
  } 
  public void update() { System.out.println("World getting older."); }
  public boolean hasEnded() { return false; } 
  public void keyPressed(KeyEvent e) { // world-key-move
    System.out.println("Ouch."); 
  } 
  public static void main(String[] args) {
    BigBang game = new BigBang(200, new Tetris()); 
    JFrame frame = new JFrame("Tetris"); 
    frame.getContentPane().add( game ); 
    frame.addKeyListener( game ); 
    frame.setVisible(true); 
    frame.setSize(400, 400); 
    frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); 
    game.start(); 
  }
}