forked from kishanrajput23/Java-Projects-Collections
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScore.java
More file actions
23 lines (18 loc) · 671 Bytes
/
Score.java
File metadata and controls
23 lines (18 loc) · 671 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import java.awt.*;
public class Score extends Rectangle{
static int GAME_WIDTH;
static int GAME_HEIGHT;
int player1;
int player2;
Score(int GAME_WIDTH, int GAME_HEIGHT){
Score.GAME_WIDTH = GAME_WIDTH;
Score.GAME_HEIGHT=GAME_HEIGHT;
}
public void draw(Graphics g){
g.setColor(Color.white);
g.setFont(new Font("Consolas", Font.PLAIN,60));
g.drawLine(GAME_WIDTH/2,0,GAME_WIDTH/2,GAME_HEIGHT);
g.drawString(String.valueOf(player1/10)+String.valueOf(player1%10), (GAME_WIDTH/2)-85, 50);
g.drawString(String.valueOf(player2/10)+String.valueOf(player2%10), (GAME_WIDTH/2)+20, 50);
}
}