-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGameFrame.java
52 lines (46 loc) · 1.38 KB
/
GameFrame.java
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
/*
* Decompiled with CFR 0.151.
*/
package game;
import java.awt.*;
import java.net.URL;
import java.util.Timer;
import java.util.TimerTask;
import javax.swing.JFrame;
public class GameFrame
extends JFrame {
private static final long serialVersionUID = 1L;
public static String title = "v1.7.0";
public static int secondsPassed;
public static int minutesPassed;
public static int tSecondsPassed;
GetTheAppleGame getTheAppleGame;
GameFrame() {
URL resource = getClass().getClassLoader().getResource("icon_mdk.png");
this.add(new GamePanel());
this.setTitle("Get The Apple! " + title);
this.setDefaultCloseOperation(3);
this.setResizable(true);
this.pack();
this.setVisible(true);
this.setLocationRelativeTo(null);
Image icon = Toolkit.getDefaultToolkit().getImage(resource);
this.setIconImage(icon);
Timer timer = new Timer();
TimerTask task = new TimerTask(){
@Override
public void run() {
++secondsPassed;
}
};
timer.scheduleAtFixedRate(task, 1000L, 1000L);
Timer tTimer = new Timer();
TimerTask tTask = new TimerTask(){
@Override
public void run() {
++tSecondsPassed;
}
};
tTimer.scheduleAtFixedRate(tTask, 1000L, 1000L);
}
}