|
|
@ -71,6 +71,7 @@ public class SnakeGame extends JFrame { |
|
|
|
public int xCords4 = 600; |
|
|
|
public int xCords5 = 700; |
|
|
|
public int xCords6 = 800; |
|
|
|
public int yCords1 = 0; |
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
EventQueue.invokeLater(new Runnable() { |
|
|
@ -96,42 +97,42 @@ public class SnakeGame extends JFrame { |
|
|
|
cP.setLayout(null); |
|
|
|
|
|
|
|
panel1 = new JPanel(); |
|
|
|
panel1.setBounds(xCords1, 0, 100, 100); |
|
|
|
panel1.setBounds(xCords1, yCords1, 100, 100); |
|
|
|
panel1.setVisible(true); |
|
|
|
panel1.setBackground(Color.BLACK); |
|
|
|
|
|
|
|
cP.add(panel1); |
|
|
|
|
|
|
|
panel2 = new JPanel(); |
|
|
|
panel2.setBounds(xCords2, 0, 100, 100); |
|
|
|
panel2.setBounds(xCords2, yCords1, 100, 100); |
|
|
|
panel2.setVisible(true); |
|
|
|
panel2.setBackground(Color.BLACK); |
|
|
|
|
|
|
|
cP.add(panel2); |
|
|
|
|
|
|
|
panel3 = new JPanel(); |
|
|
|
panel3.setBounds(xCords3, 0, 100, 100); |
|
|
|
panel3.setBounds(xCords3, yCords1, 100, 100); |
|
|
|
panel3.setVisible(true); |
|
|
|
panel3.setBackground(Color.BLACK); |
|
|
|
|
|
|
|
cP.add(panel3); |
|
|
|
|
|
|
|
panel4 = new JPanel(); |
|
|
|
panel4.setBounds(xCords4, 0, 100, 100); |
|
|
|
panel4.setBounds(xCords4, yCords1, 100, 100); |
|
|
|
panel4.setVisible(true); |
|
|
|
panel4.setBackground(Color.BLACK); |
|
|
|
|
|
|
|
cP.add(panel4); |
|
|
|
|
|
|
|
panel5 = new JPanel(); |
|
|
|
panel5.setBounds(xCords5, 0, 100, 100); |
|
|
|
panel5.setBounds(xCords5, yCords1, 100, 100); |
|
|
|
panel5.setVisible(true); |
|
|
|
panel5.setBackground(Color.BLACK); |
|
|
|
|
|
|
|
cP.add(panel5); |
|
|
|
|
|
|
|
panel6 = new JPanel(); |
|
|
|
panel6.setBounds(xCords6, 0, 100, 100); |
|
|
|
panel6.setBounds(xCords6, yCords1, 100, 100); |
|
|
|
panel6.setVisible(true); |
|
|
|
panel6.setBackground(Color.BLACK); |
|
|
|
|
|
|
|