package ru.deadsoftware.cavedroid;
+import com.badlogic.gdx.Application;
import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import ru.deadsoftware.cavedroid.game.GameItems;
mMainConfig.setHeight(height);
mMainConfig.setShowInfo(mDebug);
mMainConfig.setAssetsPackPath(mAssetsPackPath);
+
+ if (mDebug) {
+ Gdx.app.setLogLevel(Application.LOG_DEBUG);
+ } else {
+ Gdx.app.setLogLevel(Application.LOG_ERROR);
+ }
}
public void newGame(int gameMode) {
standardInput = System.in
workingDir = project.assetsDir
ignoreExitValue = true as JavaExecSpec
+ args "--debug"
}
task runTouch(dependsOn: classes, type: JavaExec) {
standardInput = System.in
workingDir = project.assetsDir
ignoreExitValue = true as JavaExecSpec
- args "--touch"
+ args "--touch --debug"
}
task debug(dependsOn: classes, type: JavaExec) {
import ru.deadsoftware.cavedroid.CaveGame;
class DesktopLauncher {
- public static void main (String[] arg) {
- Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration();
- config.setWindowIcon(Files.FileType.Internal, "icons/icon256.png", "icons/icon128.png");
+ public static void main(String[] arg) {
+ Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration();
+ config.setWindowIcon(Files.FileType.Internal, "icons/icon256.png", "icons/icon128.png");
config.setTitle("CaveDroid");
- config.setWindowedMode(960, 540);
- config.useVsync(true);
+ config.setWindowedMode(960, 540);
+ config.useVsync(true);
- boolean touch = false;
- String assetsPath = null;
+ boolean touch = false;
+ boolean debug = false;
+ String assetsPath = null;
- for (String anArg : arg) {
+ for (String anArg : arg) {
if (anArg.equals("--touch")) {
touch = true;
}
- if (anArg.startsWith("--assets")) {
- String[] splitArg = anArg.split("=");
- if (splitArg.length >= 2) {
- assetsPath = splitArg[1];
- }
- }
- }
-
- new Lwjgl3Application(
- new CaveGame(
- System.getProperty("user.home") + "/.cavedroid",
- touch,
- assetsPath),
- config
- );
- }
+ if (anArg.equals("--debug")) {
+ debug = true;
+ }
+
+ if (anArg.startsWith("--assets")) {
+ String[] splitArg = anArg.split("=");
+ if (splitArg.length >= 2) {
+ assetsPath = splitArg[1];
+ }
+ }
+ }
+
+ CaveGame caveGame = new CaveGame(System.getProperty("user.home") + "/.cavedroid", touch, assetsPath);
+ caveGame.setDebug(debug);
+
+ new Lwjgl3Application(caveGame, config);
+ }
}