-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFrontEnd.java
More file actions
64 lines (52 loc) · 1.31 KB
/
FrontEnd.java
File metadata and controls
64 lines (52 loc) · 1.31 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
import java.awt.Color;
public class FrontEnd {
private static WelcomeScreen welcomeScreen = null;
private static GameScreen gameScreen = null;
private static BackEnd backEnd = null;
private static MinesweeperIcons msIcons = null;
public static final Color backgroundColor = new Color(102, 178, 255);
public static void main(String[] args){
//came from old game - OLDGAME as arg
if (args.length > 0){
if (args[0].equals("OLDGAME")){
welcomeScreen = null;
gameScreen = null;
backEnd = null;
msIcons = null;
if (MusicEnabledCheckbox.musicEnabled()){
Songs.song1.stop();
Songs.song2.stop();
}
}
}
msIcons = new MinesweeperIcons();
if (MusicEnabledCheckbox.musicEnabled()){
Songs.song1.loop();
}
welcomeScreen = new WelcomeScreen();
}
public static WelcomeScreen welcomeScreen(){
if (welcomeScreen == null){
welcomeScreen = new WelcomeScreen();
}
return welcomeScreen;
}
public static GameScreen gameScreen(){
if (gameScreen == null){
gameScreen = new GameScreen();
}
return gameScreen;
}
public static BackEnd backEnd(){
if (backEnd == null){
backEnd = new BackEnd();
}
return backEnd;
}
public static MinesweeperIcons msIcons(){
if (msIcons == null){
msIcons = new MinesweeperIcons();
}
return msIcons;
}
}