创建了一个新的libgdx项目来创建一个多平台游戏,但是当我尝试运行它时,我没有错误但没有运行。例如我打开一个android模拟器,右键单击android program => run as => android应用程序。然后进度条在eclipse中加载到100%,随着应用程序运行而消失,但没有。对于桌面我右键单击桌面程序=> run as => java application => DesktopLauncher。再也没有......
继承桌面启动器:
package com.mkgame.game1.desktop;
import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
import com.mkgame.game1.Game1;
public class DesktopLauncher {
public static void main (String[] arg) {
LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
cfg.title = "Game1";
cfg.width = 1920;
cfg.height = 1020;
cfg.useGL30 = true;
}
}
答案 0 :(得分:3)
你的启动器在函数末尾缺少这行代码:
new LwjglApplication(new Game1(), cfg);