コード例 #1
0
ファイル: UserInterface.java プロジェクト: zushenyan/Snake
 public void update(GameEvent e) {
   this.m_map = e.getMap();
   if (e.getState() == Snake.DEAD) {
     int respond = JOptionPane.showConfirmDialog(this, "Snake is DEAD!!\nPlay again?");
     if (respond == JOptionPane.OK_OPTION) {
       this.m_isBegin = true;
       this.m_body = new GameBody(this, this.m_map, 125);
       System.gc();
     } else if (respond == JOptionPane.CANCEL_OPTION || respond == JOptionPane.NO_OPTION) {
       System.exit(0);
     }
   }
   this.repaint();
 }