我尝试编写启动屏幕来测试游戏。当我尝试运行此代码时,我遇到了一些错误。我正在寻找一些关于任何具体但未学过的信息,此外,有人提到我没有图形驱动程序,但我有图形驱动程序:)
包 JaAdrian.MyGame;
import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.BasicGame;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.SlickException;
public class Main extends BasicGame {
public static final String NAME = "SampleTest";
public Main() {
super(NAME);
}
public void render(GameContainer gc, Graphics g){
}
@Override
public void init(GameContainer gc) throws SlickException {
}
@Override
public void update(GameContainer gc, int g) throws SlickException {
}
public static void main(String[] args){
try {
AppGameContainer app = new AppGameContainer(new Main());
app.setDisplayMode(800, 600, false); //true == fullscreen
app.setTargetFrameRate(60);
app.setAlwaysRender(true);
app.setUpdateOnlyWhenVisible(false);
app.start();
} catch (SlickException e) {
e.printStackTrace();
}
}
}
当我尝试测试它时出现错误:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.lwjgl.Sys$1.run(Sys.java:73)
at java.security.AccessController.doPrivileged(Native Method)
at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
at org.lwjgl.Sys.loadLibrary(Sys.java:95)
at org.lwjgl.Sys.<clinit>(Sys.java:112)
at org.lwjgl.opengl.Display.<clinit>(Display.java:132)
at org.newdawn.slick.AppGameContainer$1.run(AppGameContainer.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at org.newdawn.slick.AppGameContainer.<clinit>(AppGameContainer.java:34)
at JaAdrian.MyGame.Main.main(Main.java:35)