fix: BaseGame not needed (for now?)

This commit is contained in:
Laureηt 2021-04-09 15:09:47 +02:00
parent 56bde9124c
commit 41d8518890
2 changed files with 18 additions and 26 deletions

View file

@ -1,18 +0,0 @@
package sagittarius;
import com.badlogic.gdx.Game;
import sagittarius.view.BaseScreen;
public abstract class BaseGame extends Game {
private static BaseGame game;
public BaseGame() {
game = this;
}
public static void setActiveScreen(BaseScreen s) {
game.setScreen(s);
}
}

View file

@ -1,18 +1,28 @@
package sagittarius; package sagittarius;
import sagittarius.view.*; import com.badlogic.gdx.Game;
public class SagittariusGame extends BaseGame { import sagittarius.view.BaseScreen;
import sagittarius.view.GameScreen;
// ---------- CONSTANTs ---------- public class SagittariusGame extends Game {
public static final float G = 100; private static SagittariusGame game;
// ---------- METHODs ---------- public SagittariusGame() {
game = this;
}
public static void setActiveScreen(BaseScreen s) {
game.setScreen(s);
}
public static BaseScreen getActiveScreen() {
return (BaseScreen) game.getScreen();
}
@Override @Override
public void create() { public void create() {
this.setScreen(new StartScreen()); this.setScreen(new GameScreen());
} }
} }