Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package application;
- import java.util.Random;
- import javafx.event.ActionEvent;
- import javafx.fxml.FXML;
- import javafx.scene.control.TextArea;
- import javafx.scene.control.TextField;
- public class SampleController {
- Random rand = new Random();
- int result = 1 + rand.nextInt(6);
- //Variables
- public int player1Score = 0;
- public int player2Score = 0;
- public int player3Score = 0;
- public int player4Score = 0;
- public int numberOfPlayers = 0;
- public int currentRound = 0;
- @FXML
- private TextField txtResult;
- @FXML
- private void handleButtonRollAction(ActionEvent event) {
- System.out.print(result);
- txtResult.setText(String.valueOf(result));
- }
- @FXML
- private TextField txtIn;
- @FXML
- private TextArea txtOut;
- @FXML
- private void handleRoll(ActionEvent event) {
- for(int i = 0; i < numberOfPlayers; i++) {
- }
- currentRound++;
- }
- @FXML
- private void handleConfirmButton(ActionEvent event) {
- if (txtIn.getText() == "2") {
- numberOfPlayers += 2;
- }
- else if (txtIn.getText() == "3") {
- numberOfPlayers += 3;
- }
- else if (txtIn.getText() == "4") {
- numberOfPlayers += 4;
- }
- else {
- System.out.print("Invalid Input");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement