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 |
package bump_n_jump;
import java.awt.*;
import javax.swing.*;
/*
* GameFrame - the JFrame that contains the game panel.
* Main method is here.
*/
public class GameFrame extends JFrame {
private static final long serialVersionUID = 1L;
private int frameWidth = 758, frameHeight = 759;
/**
* Main method - create a new game frame.
*/
public static void main(String args[]) {
GameFrame gf = new GameFrame();
gf.setDefaultCloseOperation(EXIT_ON_CLOSE);
}
/**
* GameFrame constructor - create the frame and add the game object to it.
*/
public GameFrame() {
setTitle("Bump 'n' Jump!");
setSize(frameWidth, frameHeight);
Game g = new Game();
Container contentPane = getContentPane();
contentPane.add(g);
setVisible(true);
}
} |