我正在尝试使用silck2d创建一个简单的基于状态的游戏,每当我运行这个简单的代码时,应该创建一个空窗口(到目前为止,除了状态的基本shell之外)。相反,它运行我从未调用过的AlphaMapTest程序......
import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.state.StateBasedGame;
public class Plane extends StateBasedGame {
public static final String gamename = "Plane Game";
public static final int MENU = 1;
public static final int PLAY = 2;
public Plane(String gamename) {
super(gamename);
addState(new Menu(MENU));
addState(new Play(PLAY));
}
@Override
public void initStatesList(GameContainer container) throws SlickException {
getState(MENU).init(container, this);
getState(PLAY).init(container, this);
enterState(PLAY);
}
public void main(String[] args) {
AppGameContainer appgc;
try {
appgc = new AppGameContainer(new Plane(gamename));
appgc.setDisplayMode(600, 400, false);
appgc.start();
} catch (SlickException e) {
e.printStackTrace();
}
}
}