|
|
@ -0,0 +1,25 @@ |
|
|
|
package Snake; |
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
import java.awt.*; |
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
public class GameView extends JPanel |
|
|
|
{ |
|
|
|
private final int gridSize; |
|
|
|
|
|
|
|
private ArrayList<Drawable> views; |
|
|
|
|
|
|
|
public GameView(int viewSize, int gridSize) |
|
|
|
{ |
|
|
|
super(); |
|
|
|
setPreferredSize(new Dimension(viewSize, viewSize)); |
|
|
|
setDoubleBuffered(true); |
|
|
|
setBackground(Color.BLACK); |
|
|
|
|
|
|
|
views = new ArrayList<>(); |
|
|
|
this.gridSize = gridSize; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |