Skip to content

Commit e612873

Browse files
committed
Updated Menu and the runnable Jar
1 parent 35b1706 commit e612873

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

jar/javagame.jar

4.28 KB
Binary file not shown.

src/com/redomar/game/menu/Menu.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
import javax.swing.JOptionPane;
1010
import javax.swing.UIManager;
1111

12+
import org.apache.commons.lang3.text.WordUtils;
13+
1214
import com.redomar.game.Game;
1315
import com.redomar.game.lib.Font;
1416
import com.redomar.game.lib.Mouse;
@@ -107,7 +109,8 @@ private void render() {
107109
if(isGameOver()){
108110
g.drawString("GAME OVER... What will you do now?",35,30);
109111
}else{
110-
g.drawString("Welcome to JavaGame",35,30);
112+
String name = (Game.getJdata_UserName().length() >= 1) ? WordUtils.capitalizeFully(Game.getJdata_UserName()).toString() : "Player";
113+
g.drawString("Welcome to JavaGame "+name,35,30);
111114
}
112115
g.drawLine(10, (HEIGHT*3), 10, 10);
113116
g.drawLine(10, 10, (WIDTH*3), 10);
@@ -154,10 +157,6 @@ private void paintButtons(boolean start, boolean exit, Graphics g){
154157
g.drawString("Exit", 220, 220);
155158
}
156159
}
157-
158-
public static void main(String[] args) {
159-
new Menu().start();
160-
}
161160

162161
public static void play(){
163162
try {

0 commit comments

Comments
 (0)