Exemplo n.º 1
0
 public void keyPressed(KeyEvent event) {
   int code = event.getKeyCode();
   if (code == KeyEvent.VK_N) {
     Tile newTile = makeRandomTile();
     list.addTile(newTile);
     Graphics g = panel.getGraphics();
     list.drawAll(g);
   } else if (code == KeyEvent.VK_S) {
     list.shuffle(WIDTH, HEIGHT);
     Graphics g = panel.getGraphics();
     panel.clear();
     list.drawAll(g);
   }
 }