@@ -0,0 +1,1894 @@
+/**%0A * @(#)SnakeMenu.java%0A *%0A *%0A * @authors Martin Verde%0A * @version 1.00 2014/5/20%0A */%0Aimport javax.swing.JFrame;%0Aimport javax.swing.JButton;%0Aimport java.awt.Dimension;%0Aimport java.awt.GridLayout;%0Aimport java.awt.event.ActionListener;%0Aimport java.awt.event.ActionEvent;%0A%0Apublic class SnakeMenu extends SnakeObject implements ActionListener%0A%7B%0A%09private JFrame frame = new JFrame();%0A%09private static final int WIDTH = 320;%0A%09private static final int HEIGHT = 320;%0A%09private static final int SCALE = 2;%0A%09private String playing;%0A%09private JButton%5B%5D%5B%5D grid;%0A%09%0A    public SnakeMenu(int width, int length)  //constructs a new button menu%0A    %7B%0A    %09playing = %22f%22;%0A    %09frame.setLayout(new GridLayout(width, length));%0A    %09grid = new JButton%5Bwidth%5D%5Blength%5D;%0A    %09for(int l=0; l%3Clength; l++)%0A    %09%7B%0A    %09%09for(int w=0; w%3Cwidth; w++)%0A    %09%09%7B%0A    %09%09%09if(w == 0)%0A    %09%09%09%7B%0A    %09%09%09%09grid%5Bw%5D%5Bl%5D = new JButton(%22Play!%22);%0A    %09%09%09%7D%0A    %09%09%09else if(w == 1)%0A    %09%09%09%7B%0A    %09%09%09%09grid%5Bw%5D%5Bl%5D = new JButton(%22Quit%22);%0A    %09%09%09%7D%0A    %09%09%09frame.add(grid%5Bw%5D%5Bl%5D);%0A    %09%09%7D%0A    %09%7D%0A    %09grid%5B0%5D%5B0%5D.addActionListener(this);%0A    %09grid%5B1%5D%5B0%5D.addActionListener(this);%0A    %09frame.setPreferredSize(new Dimension(WIDTH * SCALE, HEIGHT * SCALE));%0A%09%09frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);%0A%09%09frame.pack();%0A%09%09frame.setVisible(true);%0A    %7D%0A    public void actionPerformed(ActionEvent event)  //gets which menu button was pressed and sets the state of the game to match%0A    %7B%0A    %09Object source = event.getSource();%0A    %09if(source == grid%5B0%5D%5B0%5D)%0A    %09%7B%0A    %09%09this.setPlaying();%0A    %09%7D%0A    %09else if(source == grid%5B1%5D%5B0%5D)%0A    %09%7B%0A    %09%09System.exit(0);%0A    %09%7D%0A    %7D %0A    public void setPlaying()  //sets whether or not the game is running%0A    %7B%0A    %09if(playing.equals(%22f%22))%0A    %09%09playing = %22t%22;%0A    %09else%0A    %09%09playing = %22f%22;%0A    %7D%0A    public String getPlaying()  //returns whether or not the game is playing%0A    %7B%0A    %09return playing;%0A    %7D%0A%7D%0A

Create SnakeMenu.java