By Satyam Singh
It is a game where players have to connect four of their balls. The one who connects first will be the winner. JavaFX is used for the GUI presentation.
Here, in this packet, we made a Connect four game using JavaFX.
Initially, GUI was designed in the connect4.fxml file of JavaFX, in which all the components visible to the users are well placed according to their function. Then in the Main.class file, a start method was introduced which displays the top index of the window which contains menu options, also contains a link between the FXML file and the Main.class file. Then in the Controller.java file every button, text field, etc. is assigned their function code that'll be performed whenever it'll be used. After someone wins, it popups an alert message displaying the winner's name and an option to play more or exit the game.
It uses all the concepts of JavaFX and a very good project to learn and also a good game to play.
Submitted by Satyam Singh (satyams671)
Download packets of source code on Coders Packet