-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.java
More file actions
26 lines (22 loc) · 762 Bytes
/
App.java
File metadata and controls
26 lines (22 loc) · 762 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
import javax.swing.*;
public class App {
public static void main(String[] args) {
//window variavles
int tileSie = 32;
int row = 16;
int columns = 16;
int boardWidth = tileSie * columns; //32*16 = 512
int boardheight = tileSie * row; //32*16 = 512
JFrame frame = new JFrame("Space Invaders");
frame.setVisible(true);
frame.setSize(boardWidth, boardheight);
frame.setLocationRelativeTo(null);
frame.setResizable(false);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
SpaceInvaders spaceInvaders = new SpaceInvaders();
frame.add(spaceInvaders);
frame.pack();
spaceInvaders.requestFocus();
frame.setVisible(true);
}
}