Skip to content
Snippets Groups Projects
Commit 5afd9936 authored by ALGLAVE Ivan's avatar ALGLAVE Ivan
Browse files

After 2 seconds, switch the screen to the MenuScreen

parent c945151b
No related branches found
No related tags found
No related merge requests found
......@@ -4,17 +4,22 @@ import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.mygdx.game.singletons.FontManager;
import java.util.Date;
/**
* Intro screen showing a preview of the game for a few seconds
*/
public class GameIntro extends GameScreen
{
long creationDate;
@Override
public void buildStage() {
/*Label l = new Label("Intro screen", FontManager.getInstance().getLabelStyle(Color.BLACK));
l.setPosition(50, 50);
addActor(l);*/
creationDate = System.currentTimeMillis();
}
@Override
......@@ -22,6 +27,12 @@ public class GameIntro extends GameScreen
// Add logic
if(System.currentTimeMillis() - creationDate > 2000)
{
// Intro screen is over
GameScreenManager.getInstance().showGameScreen(GameScreenEnum.GAME_MENU);
}
// Call the drawing methods of the parent to render the screen
super.render(delta);
}
......
......@@ -9,4 +9,9 @@ public class GameMenu extends GameScreen {
public void buildStage() {
}
@Override
public void render(float delta) {
super.render(delta);
}
}
......@@ -25,7 +25,7 @@ public abstract class GameScreen extends Stage implements Screen {
public void render(float delta)
{
// Clear screen
Gdx.gl.glClearColor(255, 0, 0, 1);
Gdx.gl.glClearColor(0, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
// Calling to Stage methods
super.act(delta);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment