コード例 #1
0
ファイル: LevelSelectScreen.java プロジェクト: Ziamor/Runner
  public void paintComponent(Graphics g) {

    // draw the border
    g.setColor(Color.darkGray);
    g.fillRect(0, 0, 80, 80);
    g.fillRect(720 - 80, 0, 80, 80);
    g.fillRect(0, 0, 720, 60);
    g.fillRect(0, 608 - 80, 80, 80);
    g.fillRect(720 - 80, 608 - 80, 80, 80);
    g.fillRect(0, 608 - 60, 720, 60);

    // draw the objects
    super.paintComponent(g);

    Runner.scoreTotal = 200 * (100 * 500 + 3 * 10000);
    Runner.starsTotal = 3 * 200;

    // draw the score display
    g.setColor(new Color(20, 110, 255, 255));
    g.setFont(Runner.fontSmall);
    g.drawString("Score:", 338, 18);
    g.setFont(Runner.fontLarge);
    g.drawString("" + Runner.scoreTotal, 361 - String.valueOf(Runner.scoreTotal).length() * 9, 50);

    // draw the star display
    g.setColor(new Color(225, 225, 0, 255));
    g.drawImage(TextureCache._textures.get("star").getTexture(0, 32, 32), 100, 14, null);
    g.drawString("x " + Runner.starsTotal, 140, 40);

    // draw the trophy display

  }
コード例 #2
0
ファイル: LevelSelectScreen.java プロジェクト: Ziamor/Runner
 public void update() {
   // call the gameScreen update();
   super.update();
   if (getDisableUpdate()) return;
 }