Skip to content

Commit e6a270d

Browse files
committed
Removed music class
1 parent cff5d59 commit e6a270d

File tree

4 files changed

+2
-141
lines changed

4 files changed

+2
-141
lines changed

src/com/redomar/game/Game.java

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import com.redomar.game.gfx.SpriteSheet;
88
import com.redomar.game.level.LevelHandler;
99
import com.redomar.game.lib.Font;
10-
import com.redomar.game.lib.Music;
1110
import com.redomar.game.lib.Time;
1211
import com.redomar.game.script.PrintTypes;
1312
import com.redomar.game.script.Printing;
@@ -66,12 +65,9 @@ public class Game extends Canvas implements Runnable {
6665
private Player player;
6766
private Dummy dummy;
6867
private Vendor vendor;
69-
private Music music = new Music();
7068
private Font font = new Font();
71-
private Thread musicThread = new Thread(music, "MUSIC");
7269
private String nowPlaying;
7370
private boolean notActive = true;
74-
private boolean noAudioDevice = false;
7571
private int trigger = 0;
7672
private Printing print = new Printing();
7773

@@ -425,22 +421,6 @@ public void render() {
425421
}
426422
}
427423

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-
444424
if (isChangeLevel() == true && getTickCount() % 60 == 0) {
445425
Game.setChangeLevel(true);
446426
setChangeLevel(false);
@@ -492,35 +472,6 @@ public void render() {
492472
g.setColor(Color.YELLOW);
493473
g.drawString(time.getTime(), (getWidth() - 58), (getHeight() - 3));
494474
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-
}
524475
g.dispose();
525476
bs.show();
526477
}

src/com/redomar/game/InputHandler.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ public class InputHandler implements KeyListener {
1717
private Key left = new Key();
1818
private Key right = new Key();
1919
private Printing print = new Printing();
20-
private boolean PlayMusic = false;
2120
private int map;
2221
private boolean ignoreInput = false;
2322
private PopUp popup = new PopUp();
@@ -70,7 +69,7 @@ private void toggleKey(int keyCode, boolean isPressed) {
7069
right.toggle(false);
7170
}
7271
if (keyCode == KeyEvent.VK_M) {
73-
this.setPlayMusic(true);
72+
//music here
7473
}
7574

7675
if (keyCode == KeyEvent.VK_W && isAzertyCountry || keyCode == KeyEvent.VK_Z && !isAzertyCountry) {
@@ -149,14 +148,6 @@ public void setMap(int map) {
149148
this.map = map;
150149
}
151150

152-
boolean isPlayMusic() {
153-
return PlayMusic;
154-
}
155-
156-
void setPlayMusic(boolean playMusic) {
157-
PlayMusic = playMusic;
158-
}
159-
160151
public Key getUp() {
161152
return up;
162153
}

src/com/redomar/game/lib/Music.java

Lines changed: 0 additions & 81 deletions
This file was deleted.

src/com/redomar/game/script/Printing.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ private PrintToLog printToLogType(PrintTypes type){
6666
}
6767

6868
public void removeLog(){
69-
new File(".log.txt").delete()
69+
new File(".log.txt").delete();
7070
}
7171

7272
public String getMessage() {

0 commit comments

Comments
 (0)