嘿,伙计们,我刚开始用 Slick2d 创建一些程序或游戏。所以问题是我遇到了这样的错误:实例化类型 Game。
编码:
public HelloWorld()
public static final String gamename = "Game"
{
super(gamename);
}
@Override
public void init(GameContainer gc) throws SlickException
{
}
@Override
public void update(GameContainer gc, int delta) throws SlickException
{
}
@Override
public void render(GameContainer gc, Graphics g) throws SlickException
{
g.drawString("Hello World", 100, 100);
}
public static void main(String[] args) throws SlickException
{
AppGameContainer app = new AppGameContainer(new Game(gamename));
app.setDisplayMode(800, 600, false);
app.start();
} }