|
7 | 7 | import com.redomar.game.gfx.SpriteSheet; |
8 | 8 | import com.redomar.game.level.LevelHandler; |
9 | 9 | import com.redomar.game.lib.Font; |
10 | | -import com.redomar.game.lib.Music; |
11 | 10 | import com.redomar.game.lib.Time; |
12 | 11 | import com.redomar.game.script.PrintTypes; |
13 | 12 | import com.redomar.game.script.Printing; |
@@ -66,12 +65,9 @@ public class Game extends Canvas implements Runnable { |
66 | 65 | private Player player; |
67 | 66 | private Dummy dummy; |
68 | 67 | private Vendor vendor; |
69 | | - private Music music = new Music(); |
70 | 68 | private Font font = new Font(); |
71 | | - private Thread musicThread = new Thread(music, "MUSIC"); |
72 | 69 | private String nowPlaying; |
73 | 70 | private boolean notActive = true; |
74 | | - private boolean noAudioDevice = false; |
75 | 71 | private int trigger = 0; |
76 | 72 | private Printing print = new Printing(); |
77 | 73 |
|
@@ -425,22 +421,6 @@ public void render() { |
425 | 421 | } |
426 | 422 | } |
427 | 423 |
|
428 | | - if (!noAudioDevice) { |
429 | | - if (input.isPlayMusic() && notActive == true) { |
430 | | - int musicOption = JOptionPane.showConfirmDialog(this, |
431 | | - "You are about to turn on music and can be VERY loud", |
432 | | - "Music Options", 2, 2); |
433 | | - if (musicOption == 0) { |
434 | | - musicThread.start(); |
435 | | - notActive = false; |
436 | | - } else { |
437 | | - // System.out.println("[GAME] Canceled music option"); |
438 | | - print.print(" Canceled music option", PrintTypes.GAME); |
439 | | - input.setPlayMusic(false); |
440 | | - } |
441 | | - } |
442 | | - } |
443 | | - |
444 | 424 | if (isChangeLevel() == true && getTickCount() % 60 == 0) { |
445 | 425 | Game.setChangeLevel(true); |
446 | 426 | setChangeLevel(false); |
@@ -492,35 +472,6 @@ public void render() { |
492 | 472 | g.setColor(Color.YELLOW); |
493 | 473 | g.drawString(time.getTime(), (getWidth() - 58), (getHeight() - 3)); |
494 | 474 | g.setColor(Color.WHITE); |
495 | | - if (noAudioDevice == true) { |
496 | | - g.setColor(Color.RED); |
497 | | - g.drawString("MUSIC is OFF | no audio device for playback", 3, |
498 | | - getHeight() - 3); |
499 | | - trigger++; |
500 | | - if (trigger == 25) { |
501 | | - JOptionPane.showMessageDialog(this, "No Audio device found", |
502 | | - "Audio Issue", 0); |
503 | | - } |
504 | | - } else if (notActive == true) { |
505 | | - g.setColor(Color.RED); |
506 | | - g.drawString("MUSIC is OFF | press 'M' to start", 3, |
507 | | - getHeight() - 3); |
508 | | - } else { |
509 | | - g.setColor(Color.GREEN); |
510 | | - g.drawString("MUSIC is ON | You cannot turn off the music", 3, |
511 | | - getHeight() - 3); |
512 | | - g.setColor(Color.WHITE); |
513 | | - setNowPlaying(WordUtils.capitalize(music.getSongName()[music |
514 | | - .getSongNumber()].substring(7, |
515 | | - (music.getSongName()[music.getSongNumber()].length() - 4)))); |
516 | | - if (getNowPlaying().startsWith("T")) { |
517 | | - g.drawString(nowPlaying, getWidth() - (nowPlaying.length() * 9) |
518 | | - + 12, getHeight() - 17); |
519 | | - } else { |
520 | | - g.drawString(nowPlaying, getWidth() - (nowPlaying.length() * 9) |
521 | | - + 8, getHeight() - 17); |
522 | | - } |
523 | | - } |
524 | 475 | g.dispose(); |
525 | 476 | bs.show(); |
526 | 477 | } |
|
0 commit comments