-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscore.java
More file actions
29 lines (22 loc) · 761 Bytes
/
score.java
File metadata and controls
29 lines (22 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import java.awt.*;
// import java.awt.event.*;
// import java.util.*;
// import javax.swing.*;
import javafx.scene.shape.Rectangle;
public class score extends Rectangle{
static int GAME_WIDTH;
static int GAME_HEIGHT;
int player1;
int player2;
public 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), GAME_WIDTH/2-85, 50);
g.drawString(String.valueOf(player2), GAME_WIDTH/2+20, 50);
}
}