-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRoundFinish.java
37 lines (32 loc) · 1.21 KB
/
RoundFinish.java
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
30
31
32
33
34
35
36
37
//To use GUI items and images
import java.awt.*;
//To use arraylists
import java.util.*;
public class RoundFinish{
Button exit = new Button("Exit to Main Menu");
Button start = new Button("Start round");
int imageSpace;
public RoundFinish(int widthLimit, int heightLimit){
exit.setBounds(10,35, 250, 50);
start.setBounds(widthLimit - 250, heightLimit- 50, 250, 50);
imageSpace = (widthLimit - 200)/3;
}
public void paint(Graphics g, ArrayList<Character> c, ArrayList<Integer> a, int widthLimit, int heightLimit, int round, int maxRound){
for(int i = 0; i < a.size(); i++){
g.drawImage(c.get(a.get(i)-1).baseImage, 50 + i*imageSpace, 100, null);
}
if(round > 1){
g.drawString("Congratulations", widthLimit/2 - 200, 70);
g.drawString("You have completed round " + (round-1) + "/" + maxRound, widthLimit/2 - 400, 120);
}
g.drawString("Go to round " + round, widthLimit - 350, heightLimit - 75);
}
void showButtons(){
exit.setVisible(true);
start.setVisible(true);
}
void hideButtons(){
exit.setVisible(false);
start.setVisible(false);
}
}