Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin/
6 changes: 6 additions & 0 deletions BradyHangman/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="output" path="bin"/>
</classpath>
17 changes: 17 additions & 0 deletions BradyHangman/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>BradyHangman</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
11 changes: 11 additions & 0 deletions BradyHangman/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
34 changes: 34 additions & 0 deletions BradyHangman/people.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
B0
BBB
BBB
BFBF
BFFFFFF
BRA
BRAD
BRADY123
BRADYCOOLQ
BRADYSAWES
BRFG
HFHF
HHGHG
ZZZZZZ
B12
FBBF
ZZZZZ
B3
B34
B
B6
B7
BBGJ
BNNJJ
BR
BRADY
BRADY
BRBR
BRGD
CTGB
KLH
NDHD
NSDJD
YJNKJH
34 changes: 34 additions & 0 deletions BradyHangman/scores.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
2
3
4
6
7
7
7
7
7
7
7
7
7
7
7
7
7
65 changes: 65 additions & 0 deletions BradyHangman/src/CenteredText.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
//Draws text at the center of the screen. Also can be used to store the x value
//of where text is centered
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;


public class CenteredText {


public int x;
public int y;

public CenteredText() {
this.x = 0;
this.y = 0;

}

public CenteredText(String text, int width, int height, Graphics g) {

FontMetrics fontInfo = g.getFontMetrics();
int textWidth = fontInfo.stringWidth(text);
int textHeight = fontInfo.getHeight();

this.x = (width - textWidth)/2;
this.y = (height - textHeight)/2;


}

public CenteredText(String text, int width, int height, Graphics g, boolean draw, int textY) {

FontMetrics fontInfo = g.getFontMetrics();
int textWidth = fontInfo.stringWidth(text);
int textHeight = fontInfo.getHeight();

this.x = (width - textWidth)/2;
this.y = (height - textHeight)/2;

if(draw) {

g.drawString(text, x, textY);

}


}

public CenteredText(String text, int width, int height, Graphics g, Font theFont) {

FontMetrics fontInfo = g.getFontMetrics(theFont);
int textWidth = fontInfo.stringWidth(text);
int textHeight = fontInfo.getHeight();

this.x = (width - textWidth)/2;
this.y = (height - textHeight)/2;


}




}
Loading