Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Scenario in which a win becomes true
- if(ballFollower.overlapping(hole, true))
- {
- win = true;
- ballFollower.remove();
- ball.remove();
- currentLevel += 1;
- previousLevel = currentLevel - 1;
- Action fadeIn = Actions.sequence(Actions.alpha(0), Actions.show(), Actions.fadeIn(2),
- Actions.forever(Actions.sequence(Actions.color(new Color(1, 0, 0, 1), 1),
- Actions.color(new Color(0, 0, 1, 1), 1))));
- winText.addAction(fadeIn);
- System.out.println(currentLevel);
- }
- // If won, give an option to move onto the next level.
- if(win)
- {
- nextLevelLabel.setVisible(true);
- if(Gdx.input.isKeyPressed(Keys.ENTER))
- {
- // currentLevel increments by 1 once the level is won.
- game.setScreen(new ElevatorLevel(game, currentLevel));
- }
- }
- private int previousLevel = 0;
- private int currentLevel = 1;
- public ElevatorLevel(Game g, int level)
- {
- super(g, level);
- currentLevel = level;
- }
Add Comment
Please, Sign In to add comment