Skip to content

Commit

Permalink
change stage time
Browse files Browse the repository at this point in the history
  • Loading branch information
bemoty committed Nov 15, 2019
1 parent df8d1ba commit bf514e6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,10 @@ protected void onDraw(final Canvas canvas) {
// Only execute if game has already started
if (GameState.isInGame(gameState)) {
// Check game state
final long delay = gameState == GameState.INGAME ? Config.getInstance().getStage2Time()
: Config.getInstance().getStage3Time();
if (System.currentTimeMillis()
> CatcherStatistics.getInstance().getGameStageChanged() + Config.getInstance()
.getStageTime()) {
> CatcherStatistics.getInstance().getGameStageChanged() + delay) {
switch (gameState) {
case INGAME:
gameState = GameState.INGAME2;
Expand Down Expand Up @@ -334,7 +335,7 @@ private void renderLogo(final Canvas canvas) {
random);
if (gameState == GameState.INGAME2) {
logo.setSpeed(logo.getSpeed() * 2);
} else if(gameState == GameState.INGAME3) {
} else if (gameState == GameState.INGAME3) {
logo.setSpeed(logo.getSpeed() * 3);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,14 @@ public class Config {
private static final Config instance = new Config();

/**
* The time for a player to be in a stage for the game to become harder
* Time for a player to reach stage 2
*/
private long stageTime = 2000;
private long stage2Time = 30000;

/**
* Time for a player to reach stage 3
*/
private long stage3Time = 60000;

/*
LOGO CONFIGURATION
Expand Down

0 comments on commit bf514e6

Please sign in to comment.