blob: 3fb3d2a0440493d5cd11024cb76dbe80ad5f3c70 (
plain)
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
|
package kz.ilotterytea.maxon;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration;
import java.util.ArrayList;
import java.util.Objects;
import java.util.Scanner;
// Please note that on macOS your application needs to be started with the -XstartOnFirstThread JVM argument
public class DesktopLauncher {
public static void main (String[] arg) {
Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration();
config.setForegroundFPS(60);
config.setTitle(String.format("%s %s: %s", MaxonConstants.GAME_NAME, MaxonConstants.GAME_VERSION, getRandomLine()));
config.setWindowIcon("icon_chest.png");
new Lwjgl3Application(MaxonGame.getInstance(), config);
}
private static String getRandomLine() {
String line = "missingno";
try {
Scanner scanner = new Scanner(
Objects.requireNonNull(Thread.currentThread().getContextClassLoader().getResourceAsStream("texts/splashes.txt"))
);
ArrayList<String> strings = new ArrayList<>();
while (scanner.hasNext()) {
strings.add(scanner.next());
}
line = strings.get((int) Math.floor(Math.random() * strings.size()));
} catch (NullPointerException e) {
e.printStackTrace();
}
return line;
}
}
|