Пример #1
0
  public void draw(Graphics2D g) {
    // draw background
    bg.draw(g);

    // draw title
    g.setColor(titleColor);
    g.setFont(titleFont);
    g.drawString("Game Over", 80, 70);

    // draw return text
    g.setFont(font);
    g.drawString("Your score: " + Level1State.endScore, 65, 160);
    g.drawString("Press SPACEBAR to return to menu", 65, 180);
  }
Пример #2
0
  public GameOverState(GameStateManager gsm) {

    this.gsm = gsm;
    try {
      bg = new Background("/Backgrounds/menubg.gif", 0.5);
      bg.setVector(-1.0, 0);

      titleColor = new Color(128, 0, 0);
      titleFont = new Font("Century Gothic", Font.PLAIN, 28);
      font = new Font("Arial", Font.PLAIN, 12);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
Пример #3
0
 public void update() {
   // handle keys
   handleInput();
   bg.update();
 }