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