SHARE
TWEET

MultiplayerController

a guest Jun 19th, 2017 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package fxml_controller;
  2.  
  3. import java.io.IOException;
  4. import java.net.URL;
  5. import java.util.ArrayList;
  6. import java.util.ResourceBundle;
  7.  
  8. import game.GameMaster;
  9. import game.Player;
  10. import javafx.beans.value.ChangeListener;
  11. import javafx.beans.value.ObservableValue;
  12. import javafx.event.ActionEvent;
  13. import javafx.event.EventHandler;
  14. import javafx.fxml.FXML;
  15. import javafx.fxml.FXMLLoader;
  16. import javafx.fxml.Initializable;
  17. import javafx.scene.Parent;
  18. import javafx.scene.control.Button;
  19. import javafx.scene.control.Toggle;
  20. import javafx.scene.control.ToggleGroup;
  21. import javafx.scene.input.MouseEvent;
  22. import javafx.scene.layout.AnchorPane;
  23. import sound.MP3handler;
  24. import start_MEMORY.Start;
  25.  
  26. public class MultiplayerController implements Initializable {
  27.    
  28.     @FXML
  29.     private AnchorPane Anchor;
  30.    
  31.     @FXML
  32.     private Button two;
  33.  
  34.    
  35.     FXMLLoader loader = new FXMLLoader();
  36.    
  37.     //Set the number of players and redirect to the next scene
  38.     @FXML
  39.     private void handleButtonTwo (ActionEvent event) {
  40.         System.out.println("Es geht holla");
  41.         System.out.println(GameMaster.getPlayers());
  42.         Start.setGamemode(2);
  43.         loadNextScene();
  44.     }
  45.     @FXML
  46.     private void handleButtonThree (ActionEvent event) {
  47.         Start.setGamemode(3);
  48.         loadNextScene();
  49.     }
  50.     @FXML
  51.     private void handleButtonFour (ActionEvent event) {
  52.         Start.setGamemode(4);
  53.         loadNextScene();
  54.     }
  55.        
  56.     private void loadNextScene() {
  57.         AnchorPane pane;
  58.         try {
  59.             pane = FXMLLoader.load(getClass().getResource("/fxml/Multiplayer/Multiplayer2.fxml"));
  60.             Anchor.getChildren().setAll(pane);
  61.         } catch (IOException e) {
  62.             e.printStackTrace();
  63.         }
  64.  
  65.     }
  66.    
  67.     @Override
  68.     public void initialize(URL arg0, ResourceBundle arg1) {
  69.        
  70.     }
  71.  
  72. }
RAW Paste Data
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top