@@ -48,13 +48,15 @@ public class Game extends Canvas implements Runnable {
4848 .getData ();
4949 private int [] colours = new int [6 * 6 * 6 ];
5050
51+ private BufferedImage image2 = new BufferedImage (WIDTH , HEIGHT - 30 , BufferedImage .TYPE_INT_RGB );
5152 private Screen screen ;
5253 private InputHandler input ;
5354 private WindowHandler window ;
5455 private LevelHandler level ;
5556 private Player player ;
5657 private Music music = new Music ();
5758 public Thread musicThread = new Thread (music );
59+ public String nowPlaying = "Playing Music" ;
5860
5961 public boolean notActive = true ;
6062
@@ -212,18 +214,27 @@ public void render() {
212214 int musicOption = JOptionPane .showConfirmDialog (this , "You are about to turn on music and can be VERY loud" , "Music Options" , 2 , 2 );
213215 if (musicOption == 0 ){
214216 musicThread .start ();
215- notActive = false ;
217+ notActive = false ;
216218 } else {
217219 System .out .println ("Canceled" );
218220 input .PlayMusic = false ;
219221 }
220222 }
221223
222-
223224 Graphics g = bs .getDrawGraphics ();
224225
225226 g .drawRect (0 , 0 , getWidth (), getHeight ());
226- g .drawImage (image , 0 , 0 , getWidth (), getHeight (), null );
227+ g .drawImage (image , 0 , 0 , getWidth (), getHeight ()-30 , null );
228+ // Font.render("Hi", screen, 0, 0, Colours.get(-1, -1, -1, 555), 1);
229+ g .drawImage (image2 , 0 , getHeight ()-30 , getWidth (), getHeight (), null );
230+ g .setColor (Color .WHITE );
231+ g .drawString ("Welcome " +player .getUsername (), 0 , getHeight ()-19 );
232+ if (notActive == true ){
233+ g .drawString ("MUSIC is OFF | press 'M' to start" , 0 , getHeight ()-8 );
234+ } else {
235+ g .drawString ("MUSIC is ON | You cannot turn off the music" , 0 , getHeight ()-8 );
236+ g .drawString (nowPlaying , (getWidth () - nowPlaying .length ()) - (120 + nowPlaying .length ()), getHeight () - 20 );
237+ }
227238 g .dispose ();
228239 bs .show ();
229240 }
@@ -310,4 +321,12 @@ public void setWindow(WindowHandler window) {
310321 this .window = window ;
311322 }
312323
324+ public String getNowPlaying () {
325+ return nowPlaying ;
326+ }
327+
328+ public void setNowPlaying (String nowPlaying ) {
329+ this .nowPlaying = nowPlaying ;
330+ }
331+
313332}
0 commit comments