About The Project • Getting Started • Usage • Contact
Welcome to the Connect Four game project, a fun and exciting endeavor that challenges you to create a fully functional two-player game using JavaFX GUI. In this game, players take turns dropping checkers into a slot on a 7x6 game board, with the ultimate goal of getting four checkers in a row either vertically, horizontally, or diagonally.
The game board is represented by a GridPane, a JavaFX layout container that arranges nodes in a grid-like pattern. The checkers are represented by GameButton instances, which extend the Button class. Players make moves by clicking on a GameButton on the GridPane, which then updates the game board and displays the checkers accordingly.
The game's GUI includes a welcome screen and a gameplay screen. The welcome screen displays a brief description of the game and a "Start Game" button, which takes the player to the gameplay screen. The gameplay screen consists of a menu bar, a game board, an area displaying whose turn it is, and a history of moves made.
The menu bar has three menus: Game Play, Themes, and Options. The Game Play menu provides options for the players to control the game. For instance, there is a "reverse move" option to undo the last move, and players can also choose to start a new game or exit the game. The Themes menu provides the player with the option to choose from three different themes, such as Star Wars, Dragon Ball Z, and Rick & Morty. The Options menu provides additional settings for how to play, initiate a new game session, and exit the application.
The implementation of this game shows a comprehensive understanding of JavaFX, event handling, and game logic. Additionally, proper error handling, input validation, and edge cases are considered in the implementation to ensure a smooth and enjoyable gaming experience.
To set up a project locally, follow these simple steps.
Software used to run the program.
Here's how to install and set up the program.
From your command line:
# Clone this repository
$ git clone https://github.com/AlexisRodriguezCS/ConnectFour.git
# Go into the repository
$ Click File
$ Open
$ Select ConnectFour Folder
# Run the program
$ Right click on Main and select Run 'Main.main()'
Home Screen
The game's home screen, featuring the Star Wars theme by default, includes two buttons that allow the player to start the game and exit the application.
Gameplay Screen
The gameplay screen features the game board where players drop checkers into slots and strive to get four in a row, along with an indicator in the top left corner displaying whose turn it is. Additionally, the bottom left corner displays the previous move made. The menu bar, situated at the top of the screen, includes three menus: Game Play, Themes, and Options.
Menu
The Game Play menu, accessible from the menu bar, allows players to control the game. One of the options available is the "reverse move" feature, which allows the player to undo the last move made in the game.
The Theme menu provides the player with three different options to change the look and feel of the game, including Star Wars, Rick & Morty, and Dragon Ball Z. The default theme is Star Wars, but players can switch to a different theme at any time. When a new theme is selected, the button icons, background, and player's icon will change to match the new theme.
Themes
Below is the Rick & Morty theme, featuring button icons, background, and player's icon inspired by the popular animated series.
Below is the Dragon Ball Z theme, featuring button icons, background, and player's icon inspired by the iconic anime and manga franchise.
Below is the Star Wars theme, which serves as the default theme for the game, featuring button icons, background, and player's icon inspired by the legendary space opera.
Options
The "Options" menu provides additional settings for gameplay, including "How to play" which displays an alert text explaining how to play the game, "New game" which restarts the game, and "Exit" which quits the game application.
Play
To make a move in Connect Four, simply click on a valid spot on the game board during your turn to drop your checker into the corresponding slot.
Alexis Rodriguez - LinkedIn - [email protected]
Project Link: https://github.com/AlexisRodriguezCS/ConnectFour