Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
CSE2102_group_37/src/main/ShowScore.java
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
34 lines (29 sloc)
684 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main; | |
import java.awt.Color; | |
import java.awt.Graphics; | |
import java.awt.Font; | |
public class ShowScore { | |
private Game game; | |
private int shift = 0; | |
public ShowScore(Game game){ | |
this.game = game; | |
} | |
public void render(Graphics g){ | |
Font title_font = new Font("comic sans ms", Font.BOLD, 100); | |
g.setFont(title_font); | |
g.setColor(Color.white); | |
if(game.getScore() < 100){ | |
shift = 0; | |
} | |
if(game.getScore()>= 100){ | |
shift = -50; | |
} | |
if(game.getScore() >= 1000){ | |
shift = -75; | |
} | |
if(game.getScore() >= 10000){ | |
shift = -100; | |
} | |
g.drawString("SCORE: " + Integer.toString(game.getScore()), 145+shift, 450); | |
} | |
} |