您好我正在尝试使用 slick2D 和 lwjgl 2.8.4 制作 Java 游戏。但我无法实现 AppGameContainer 类。它会导致运行时错误。我的代码如下:
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 Main(String title) {
super(title);
// TODO Auto-generated constructor stub
}
public static void main(String args[]) throws SlickException{
AppGameContainer app = new AppGameContainer(new Main("Tower Defence"));
app.setDisplayMode(800, 600, false);
app.start();
}
@Override
public void render(GameContainer container, Graphics g)
throws SlickException {
// TODO Auto-generated method stub
}
@Override
public void init(GameContainer container) throws SlickException {
// TODO Auto-generated method stub
}
@Override
public void update(GameContainer container, int delta)
throws SlickException {
// TODO Auto-generated method stub
}
}
然后我得到以下运行时错误:
我在 Eclipse 中的包资源管理器如下所示:
我怎样才能避免这个错误?