-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameFrame.java
More file actions
68 lines (68 loc) · 1.66 KB
/
GameFrame.java
File metadata and controls
68 lines (68 loc) · 1.66 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import java.awt.*;
import java.applet.*;
import javax.swing.*;
import java.util.Timer;
import java.util.TimerTask;
public class GameFrame
{
public static GameFrame gf;
public JFrame frame;
public GamePanel gp;
public RepaintThread repaint;
public Player player;
public GradePanel grade;
public WordPanel wp;
public TimePanel tp;
public JPanel big, top;
public boolean pause = false;
public Timer timer;
public static void main(String[] args)
{
gf = new GameFrame();
gf.frame.setVisible(true);
}
public GameFrame()
{
pause = false;
frame = new JFrame();
frame.setTitle("Flying with Letters");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container container = frame.getContentPane();
frame.setResizable(false);
frame.setSize(900, 935);
container.setSize(900, 900);
gp = new GamePanel();
grade = new GradePanel();
wp = new WordPanel();
tp = new TimePanel();
big = new JPanel();
top = new JPanel();
big.setBounds(0, 0, 900, 900);
big.setBackground(Color.WHITE);
big.setLayout(null);
top.setBackground(Color.WHITE);
top.setLayout(null);
wp.setSize(630, 45);
grade.setSize(135, 45);
gp.setSize(900, 855);
top.setSize(900, 45);
top.setBounds(0, 0, 900, 45);
top.add(wp);
top.add(tp.panel);
top.add(grade);
wp.setLocation(0, 0);
tp.panel.setLocation(630, 0);
grade.setLocation(765, 0);
gp.setFocusable(true);
gp.setLocation(0, 45);
top.setLocation(0, 0);
big.add(gp);
big.add(top);
container.add(big);
timer = new Timer();
timer.schedule(tp, 0, 1000);
player = new Player(container.getWidth() / 2 - 150 / 2, container.getHeight() - 180);
repaint = new RepaintThread();
repaint.start();
}
}