IN GAME MUSIIIIIIC

This commit is contained in:
Julius de Jeu 2017-04-11 12:00:54 +02:00
parent 1c281bae4f
commit 71dce7a1be
3 changed files with 12 additions and 0 deletions

View file

@ -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();
}
}

View file

@ -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!";

Binary file not shown.