-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMenu.java
More file actions
49 lines (35 loc) · 1.06 KB
/
Menu.java
File metadata and controls
49 lines (35 loc) · 1.06 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
import java.awt.*;
public class Menu {
Rect start = new Rect(50, 200, 200, 100);
Rect help = new Rect(50, 400, 200, 100);
Rect quit = new Rect(50,600, 200, 100);
public Rect getStart(){
return start;
}
public Rect getHelp(){
return help;
}
public Rect getQuit(){
return quit;
}
public void draw(Graphics g){
Font font1 = new Font("arial", 1, 80);
Font font2 = new Font("arial", 1, 40);
Font font3 = new Font("arial", 1, 20);
g.setColor(Color.black);
g.setFont(font1);
g.drawString("ALIEN INVASION", 200, 100);
g.setFont(font2);
start.draw(g);
g.drawString("Start", 100, 275);
help.draw(g);
g.drawString("Help", 100, 475);
quit.draw(g);
g.drawString("Quit", 100, 675);
g.setFont(font3);
g.drawString("All music and images belong to their respectful owners.", 380, 730);
g.drawString("No copyright infringement intended." , 380, 760);
Image image = Toolkit.getDefaultToolkit().getImage("alien-head.png");
g.drawImage(image, 400, 180, 500, 500, null);
}
}