public GameOver (Invaders invaders) { super(invaders); spriteBatch = new SpriteBatch(); background = new Texture(Gdx.files.internal("data/planet.jpg")); background.setFilter(TextureFilter.Linear, TextureFilter.Linear); logo = new Texture(Gdx.files.internal("data/title.png")); logo.setFilter(TextureFilter.Linear, TextureFilter.Linear); font = new BitmapFont(Gdx.files.internal("data/font16.fnt"), Gdx.files.internal("data/font16.png"), false); if (invaders.getController() != null) { invaders.getController().addListener(new ControllerAdapter() { @Override public boolean buttonUp(Controller controller, int buttonIndex) { controller.removeListener(this); isDone = true; return false; } }); } }
public MainMenu (Invaders invaders) { super(invaders); spriteBatch = new SpriteBatch(); background = new Texture(Gdx.files.internal("data/planet.jpg")); background.setFilter(TextureFilter.Linear, TextureFilter.Linear); logo = new Texture(Gdx.files.internal("data/title.png")); logo.setFilter(TextureFilter.Linear, TextureFilter.Linear); font = new BitmapFont(Gdx.files.internal("data/font16.fnt"), Gdx.files.internal("data/font16.png"), false); if (invaders.getController() != null) { invaders.getController().addListener(new ControllerAdapter() { @Override public boolean buttonUp(Controller controller, int buttonIndex) { controller.removeListener(this); isDone = true; return false; } }); } }