chore(scene): set game in super
This commit is contained in:
@ -17,7 +17,6 @@ import com.badlogic.gdx.video.VideoPlayer;
|
||||
import com.badlogic.gdx.video.VideoPlayerCreator;
|
||||
|
||||
public class MainMenu extends Scene {
|
||||
private final Game game;
|
||||
private VideoPlayer videoPlayer;
|
||||
private FileHandle videoFileHandle;
|
||||
private Texture titleTexture;
|
||||
@ -26,7 +25,6 @@ public class MainMenu extends Scene {
|
||||
|
||||
public MainMenu(Game game) {
|
||||
super(game);
|
||||
this.game = game;
|
||||
initVideo();
|
||||
initUI();
|
||||
}
|
||||
|
||||
@ -10,8 +10,10 @@ import com.badlogic.gdx.scenes.scene2d.ui.Table;
|
||||
public abstract class Scene {
|
||||
protected final Logger log = org.slf4j.LoggerFactory.getLogger(getClass());
|
||||
public Table root;
|
||||
public Game game;
|
||||
public Scene(Game game) {
|
||||
this();
|
||||
this.game = game;
|
||||
}
|
||||
public Scene() {
|
||||
root = new Table();
|
||||
|
||||
@ -9,7 +9,6 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
||||
* Handles transitions between scenes with a linear transition effect.
|
||||
*/
|
||||
public class Transition extends Scene {
|
||||
private Game game;
|
||||
private Scene from;
|
||||
private Scene to;
|
||||
private State targetState;
|
||||
@ -25,8 +24,8 @@ public class Transition extends Scene {
|
||||
*/
|
||||
public Transition(Game game, Scene from, Scene to, State targetState, long duration) {
|
||||
// Transition does not need to render UI elements
|
||||
super(game);
|
||||
this.root = null;
|
||||
this.game = game;
|
||||
this.from = from;
|
||||
this.to = to;
|
||||
this.targetState = targetState;
|
||||
|
||||
Reference in New Issue
Block a user