if (quelle == neu) {
mechanics.restart();
btnMusik.setSelected(false);
musicThread.stop();
musicThread = new PlayerThread();
PlayerThread.setLied(props.getSelectedTrack());
musicThread.start();
canvas.showString("Zum Starten P drücken!");
setSpiel(true);
repaint();
}
if (quelle == btnPause) {
if (mechanics.isPaused()) {
canvas.showString("");
mechanics.resumeMovement();
} else {
canvas.showString("Fortsetzen? P drücken!");
mechanics.pauseMovement();
}
}
if (quelle == btnMusik) {
if (spiel) {
if (musicThread.isAlive()) {
if (btnMusik.isSelected()) {
musicThread.stop();
}
}
if (btnMusik.isSelected() == false) {
musicThread = new PlayerThread();
musicThread.start();
}
}
}
canvas.requestFocus();