Project stages:

  1. Framework? Basic User Interface. 

  2. Move, rotate, fall (and what ends it). 

  3. Tighten loose ends: score, full rows vanish, etc. 

Final Exam: based on the project. 

  Mock exam on Wed, will be posted on Monday. 

  (Might include the shadow feature, and others.) 

What do we do today? 

https://www.cs.indiana.edu/classes/c212-dgerman/spr2015/labFourteen.html 

We first discussed the World interface: 

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

We then discussed the BigBang framework: 

interface World {
  public void draw(Graphics g);
  public void update(); 
  public boolean hasEnded();
  public void keyPressed(KeyEvent e); 
}

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

class BigBang extends JComponent implements KeyListener, ActionListener {
  Timer timer; 
  World world; 
  BigBang(int delay, World world) {
    timer = new Timer(delay, this); 
    this.world = world;
  } 
  public void start() {
    timer.start();  
  }
  BigBang(World world) {
    this(1000, world);  
  }
  public void paintComponent(Graphics g) {
    world.draw(g);  
  }
  public void actionPerformed(ActionEvent e) {
    world.update(); 
    if (world.hasEnded())
      timer.stop(); 
    this.repaint(); 
  }
  public void keyPressed(KeyEvent e) { 
    world.keyPressed(e); 
  } 
  public void keyTyped(KeyEvent e) { } 
  public void keyReleased(KeyEvent e) { } 
}

What do we do now? 

Take attendance: 

Logan, Mark, Daniel, Jared, Austin, Trevor,
Walter, Aleksa, Judy, Hallie, Adam, Gabriela, James, Brennan, Jacquelyn
Nick, Grant, Yiming, Jingzhe, Paul, Morgan, Alex Ong, William, 
Jon, Michael Alexander, Mohan. 

Next we worked out the Game: 

http://www.cs.indiana.edu/classes/c212/sum2015/lecture.jpg

It's clear we need to solve Spaceship next, which should be our World implementation. 

See you in lab. 

--