-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGame.java
More file actions
32 lines (24 loc) · 685 Bytes
/
Copy pathGame.java
File metadata and controls
32 lines (24 loc) · 685 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import model.board.Canvas;
import javax.swing.*;
import java.awt.*;
import static model.board.Canvas.CANVAS_HEIGHT;
import static model.board.Canvas.CANVAS_WIDTH;
public class Game extends JFrame {
public Game() {
initGame();
}
private void initGame() {
add(new Canvas());
setTitle("Apple eater");
setSize(CANVAS_WIDTH, CANVAS_HEIGHT);
setLocationRelativeTo(null);
setResizable(false);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public static void main(String[] args) {
EventQueue.invokeLater(() -> {
Game g = new Game();
g.setVisible(true);
});
}
}