@@ -0,0 +1,1808 @@
+import javax.swing.*;%0Aimport java.awt.event.*;%0Aimport java.awt.geom.*; // import necessary classes%0A%0Apublic class Main // class constructor%0A%7B%0A    public static void main (String %5B%5D args) // create the game within the main class%0A    %7B%0A        JFrame frame = new JFrame (); // create a new frame%0A        frame.setSize (600, 600); // set the size of the frame%0A        frame.setTitle (%22Snake Game%22); // title the frame%0A        frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); // set how to close the frame %0A        frame.setResizable (false); // dont allow the frame to be resizable due to necessary borders for the game%0A        frame.setFocusable (true); // allow the movement to actually occur%0A        final Snake c = new Snake (); // create a new snake game class, final so that it can be referenced within the inner class%0A        class KeyClickListener implements KeyListener // use a key listener here to that the setfocusable can see it%0A        %7B%0A            public void keyPressed (KeyEvent e) // if the key is pressed%0A            %7B%0A                c.move(e.getKeyCode ()); // use the move method from the snake class to define what direction the snake will move in%0A            %7D%0A%0A            public void keyReleased (KeyEvent e) // empty method%0A            %7B%0A%0A            %7D%0A%0A            public void keyTyped (KeyEvent e) // unused method%0A            %7B%0A%0A            %7D%0A        %7D%0A%0A         // create a new keyclick listener to listen to the key clicks%0A        frame.addKeyListener (new KeyClickListener()); // and add it to the frame so that it can read them and the snake can move accordingly%0A%0A        c.startGame (); // have the snake use the start game method to start the game and%0A        frame.add (c); // add the snake to the frame%0A        frame.setVisible (true); // and make it visible%0A    %7D%0A%7D%0A

Create main.java