Skip to content

Connect Four game project is a two-player game using JavaFX GUI. Players take turns dropping checkers on a 7x6 game board to get four checkers in a row.

Notifications You must be signed in to change notification settings

AlexisRodriguezCS/ConnectFour

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grid

Connect Four

About The ProjectGetting StartedUsageContact

About The Project

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.

(back to top)

Getting Started

To set up a project locally, follow these simple steps.

Prerequisites

Software used to run the program.

Installation

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()' 

(back to top)

Usage

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.

Home Screen

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.

Game Screen

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.

Reverse

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

Theme

Below is the Rick & Morty theme, featuring button icons, background, and player's icon inspired by the popular animated series.

Rick & Morty

Below is the Dragon Ball Z theme, featuring button icons, background, and player's icon inspired by the iconic anime and manga franchise.

Dragon Ball Z

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.

Star Wars

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.

Options

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.

Play

(back to top)

Contact

Alexis Rodriguez - LinkedIn - [email protected]

Project Link: https://github.com/AlexisRodriguezCS/ConnectFour

(back to top)

About

Connect Four game project is a two-player game using JavaFX GUI. Players take turns dropping checkers on a 7x6 game board to get four checkers in a row.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages