Skip to content

Commit

Permalink
Add Blank state placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
CloneWith committed Aug 26, 2024
1 parent ef842ce commit 316bc40
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/itdelatrisu/opsu/Opsu.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ public class Opsu extends StateBasedGame {
STATE_GAME = 4,
STATE_GAMEPAUSEMENU = 5,
STATE_GAMERANKING = 6,
STATE_DOWNLOADSMENU = 7;
STATE_DOWNLOADSMENU = 7,
STATE_BLANK = 8;

/**
* Constructor.
Expand All @@ -79,6 +80,7 @@ public void initStatesList(GameContainer container) throws SlickException {
addState(new GamePauseMenu(STATE_GAMEPAUSEMENU));
addState(new GameRanking(STATE_GAMERANKING));
addState(new DownloadsMenu(STATE_DOWNLOADSMENU));
addState(new Blank(STATE_BLANK));
}

/**
Expand Down
44 changes: 44 additions & 0 deletions src/itdelatrisu/opsu/states/Blank.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package itdelatrisu.opsu.states;

import org.newdawn.slick.Color;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.state.BasicGameState;
import org.newdawn.slick.state.StateBasedGame;

public class Blank extends BasicGameState {
// game-related variables
private final int state;
private GameContainer container;
private boolean init = false;

public Blank(int state) {
this.state = state;
}

@Override
public int getID() {
return state;
}

@Override
public void init(GameContainer container, StateBasedGame game)
throws SlickException {
this.container = container;
}

@Override
public void render(GameContainer container, StateBasedGame game, Graphics g)
throws SlickException {
g.setBackground(Color.black);
}

@Override
public void update(GameContainer container, StateBasedGame game, int delta)
throws SlickException {
if (!init) {
init = true;
}
}
}

0 comments on commit 316bc40

Please sign in to comment.