Separating into Tech and SysDev
This commit is contained in:
35
Technology/Game-2/src/Game/TheGame.java
Normal file
35
Technology/Game-2/src/Game/TheGame.java
Normal file
@@ -0,0 +1,35 @@
|
||||
// Origin: https://zetcode.com/javagames/movingsprites/
|
||||
|
||||
package Game;
|
||||
|
||||
import java.awt.EventQueue;
|
||||
import javax.swing.JFrame;
|
||||
|
||||
public class TheGame extends JFrame {
|
||||
|
||||
public TheGame() {
|
||||
|
||||
initUI();
|
||||
}
|
||||
|
||||
private void initUI() {
|
||||
|
||||
add(new Board());
|
||||
|
||||
setTitle("Moving sprite");
|
||||
setSize(800, 800);
|
||||
|
||||
setLocationRelativeTo(null);
|
||||
setResizable(false);
|
||||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
EventQueue.invokeLater(() -> {
|
||||
TheGame ex = new TheGame();
|
||||
ex.setVisible(true);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user