This repository has been archived by the owner on Jun 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AboutView.java
51 lines (46 loc) · 1.79 KB
/
AboutView.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.util.ArrayList;
/**
* A panel with information about the game any myself
*/
public class AboutView extends Menu {
private static final long serialVersionUID = -4543847690002129914L;
private Font font = new Font("Courier New", Font.PLAIN, 17);
private final int Y_TOP = 150;
private int y = Y_TOP;
private final int LINE_LENGTH = 46;
private ArrayList<String> text;
public AboutView() throws Exception {
super("About");
text = BasicWars.toList("Basic Wars is a strategy game loosely based on Advance Wars,"
+ " developed for the ICS Summer of Code competition at UC,"
+ " Irvine. I could have developed anything, but I chose this"
+ " simple game because it involves a lot of Computer Science"
+ " know-how such as Graph Theory, Inheritance, 2D Graphics, etc."
+ " This game also has the potential to add online multiplayer"
+ " and online games introduce a lot of fun/new features/problems."
+ " I have never made a full-featured game before so I thought a"
+ " modern war game (modern if it was made in 1990) would be a "
+ " good place to start. I really hope you enjoy it and I would"
+ " appreciate any feedback you have, as long as it doesn't crush"
+ " my will to code."
, LINE_LENGTH);
text.add("\n");
text.add("-Steven Salat");
}
@Override
public void paintChildren(Graphics graphics) {
Graphics2D g = (Graphics2D)graphics;
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g.setColor(BasicWars.TEXT_COLOR);
g.setFont(font);
y = Y_TOP;
for (String s : text) {
g.drawString(s, 80, y); // change x pos if needed
y += 30;
}
}
}