Skip to content

Commit

Permalink
Added showing of level in transition state
Browse files Browse the repository at this point in the history
  • Loading branch information
ameade committed Apr 8, 2012
1 parent 4e2b6ee commit d231904
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/com/vulcastudios/states/TransitionState.java
Expand Up @@ -10,6 +10,8 @@
import com.vulcastudios.TestGame;

public class TransitionState extends BasicGameState {

private int numOfZombies = -1;

@Override
public void init(GameContainer container, StateBasedGame game)
Expand All @@ -24,7 +26,8 @@ public void render(GameContainer container, StateBasedGame game, Graphics g)
long finalTime = ((TestGame)game).getCurrentLevel().getFinalTime();
double seconds = finalTime / 1000.0;
g.drawString("Final Time: " + seconds + " seconds", 50, 50);
int numOfZombies = ((TestGame)game).getCurrentLevel().getNumberOfZombies();
if(numOfZombies <0)
numOfZombies = ((TestGame)game).getCurrentLevel().getNumberOfZombies();
String par = ((TestGame)game).getCurrentLevel().getPar();
g.drawString("Zombies Used: " + numOfZombies + " Par: " + par, 50, 100);
if(!((TestGame)game).isOnLastLevel()){
Expand All @@ -33,6 +36,8 @@ public void render(GameContainer container, StateBasedGame game, Graphics g)
else{
g.drawString("The Game Is Done!", 50, 150);
}

((TestGame)game).getCurrentLevel().render(container, game, g);
}

@Override
Expand Down

0 comments on commit d231904

Please sign in to comment.