-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
44 lines (35 loc) · 1.11 KB
/
Main.java
File metadata and controls
44 lines (35 loc) · 1.11 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
/*******************************************************************************
| Copyright 2016 Stephen Smith. All rights reserved. |
*******************************************************************************/
/*
* Main.java
*
* Created on January 1, 2007, 5:10 PM
*/
package tetrisjava;
import java.applet.Applet;
import java.awt.event.WindowAdapter;
/**
* Creates a new Tetris game and starts a new game
* @author Stephen Smith
*/
public class Main{
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
//Create a new game
TetrisGame f = new TetrisGame();
//On exit event close the window
f.addWindowListener(new WindowAdapter() {
public void windowClosing() {
System.exit(0);
}
});
//Size of the window
f.setSize(TetrisPiece.PIECELENGTH * Board.BoardWidth +
140,TetrisPiece.PIECELENGTH * Board.BoardHeight + 40);
f.setVisible(true);
f.setDefaultCloseOperation(f.EXIT_ON_CLOSE);
}
}