mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-01-31 23:29:36 +01:00
Merge branch 'master' of https://github.com/inf112-v20/Fiasko
This commit is contained in:
commit
1b04ed462c
@ -5,6 +5,7 @@ import com.badlogic.gdx.graphics.GL20;
|
|||||||
import com.badlogic.gdx.graphics.OrthographicCamera;
|
import com.badlogic.gdx.graphics.OrthographicCamera;
|
||||||
import com.badlogic.gdx.utils.viewport.ExtendViewport;
|
import com.badlogic.gdx.utils.viewport.ExtendViewport;
|
||||||
import com.badlogic.gdx.utils.viewport.Viewport;
|
import com.badlogic.gdx.utils.viewport.Viewport;
|
||||||
|
import inf112.fiasko.roborally.element_properties.GameState;
|
||||||
import inf112.fiasko.roborally.game_wrapper.RoboRallyWrapper;
|
import inf112.fiasko.roborally.game_wrapper.RoboRallyWrapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -18,6 +19,8 @@ public class LoadingScreen extends AbstractScreen {
|
|||||||
|
|
||||||
private long startTime;
|
private long startTime;
|
||||||
|
|
||||||
|
private GameState initialGameState;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new loading screen
|
* Instantiates a new loading screen
|
||||||
* @param roboRallyWrapper The Robo Rally wrapper which is parent of this screen
|
* @param roboRallyWrapper The Robo Rally wrapper which is parent of this screen
|
||||||
@ -44,19 +47,24 @@ public class LoadingScreen extends AbstractScreen {
|
|||||||
roboRallyWrapper.batch.end();
|
roboRallyWrapper.batch.end();
|
||||||
long time = System.currentTimeMillis();
|
long time = System.currentTimeMillis();
|
||||||
//TODO: Allow to set any condition and next screen
|
//TODO: Allow to set any condition and next screen
|
||||||
if (time - startTime > 5000){
|
if (roboRallyWrapper.roboRallyGame.getGameState() != initialGameState) {
|
||||||
roboRallyWrapper.setScreen(roboRallyWrapper.screenManager.getBoardActiveScreen(this.roboRallyWrapper));
|
handleScreenChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void handleScreenChange() {
|
||||||
|
roboRallyWrapper.setScreen(roboRallyWrapper.screenManager.getBoardActiveScreen(this.roboRallyWrapper));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resize(int width, int height) {
|
public void resize(int width, int height) {
|
||||||
viewport.update(width, height);
|
viewport.update(width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void show(){
|
public void show() {
|
||||||
startTime = System.currentTimeMillis();
|
startTime = System.currentTimeMillis();
|
||||||
|
initialGameState = roboRallyWrapper.roboRallyGame.getGameState();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user