IN GAME MUSIIIIIIC
This commit is contained in:
parent
1c281bae4f
commit
71dce7a1be
|
@ -6,6 +6,8 @@ import javafx.scene.image.Image;
|
|||
import javafx.scene.image.ImageView;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
import javafx.scene.layout.Pane;
|
||||
import javafx.scene.media.Media;
|
||||
import javafx.scene.media.MediaPlayer;
|
||||
import javafx.scene.paint.Color;
|
||||
import javafx.scene.shape.Circle;
|
||||
import javafx.scene.text.Text;
|
||||
|
@ -84,6 +86,15 @@ public class Game extends Pane {
|
|||
playerTurn.setImage(Menu.images[players.get(1).getCh()]);
|
||||
l.setText(Menu.names[players.get(1).getCh()]);
|
||||
|
||||
String loc = this.getClass().getResource("/music/game.mp3").toString();
|
||||
Media music = new Media(loc);
|
||||
MediaPlayer menuplayer = new MediaPlayer(music);
|
||||
menuplayer.setCycleCount(Integer.MAX_VALUE);
|
||||
menuplayer.setVolume(0.6f);
|
||||
menuplayer.setAutoPlay(true);
|
||||
menuplayer.play();
|
||||
menuplayer.play();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -97,6 +97,7 @@ public class Menu extends Group {
|
|||
Game.players.add(new Player(image, ch));
|
||||
hoeveel--;
|
||||
if (hoeveel == 0) {
|
||||
menuplayer.stop();
|
||||
Main.scene.setRoot(new Game());
|
||||
} else {
|
||||
String een = "Er moet nog 1 persoon kiezen!";
|
||||
|
|
BIN
src/main/resources/music/game.mp3
Normal file
BIN
src/main/resources/music/game.mp3
Normal file
Binary file not shown.
Loading…
Reference in a new issue