Skip to main content
Game Development2023

Connect 5 Java Game

Overview

Connect-Five is a strategic two-player board game similar to tic-tac-toe, featuring an 8-column by 7-row vertical board. Players take turns placing colored pieces (typically black and red) with the goal of being the first to align five pieces horizontally, vertically, or diagonally. The game implements a sophisticated AI opponent using the minimax algorithm with alpha-beta pruning optimization, providing challenging gameplay at multiple difficulty levels. The vertical board design adds a unique twist where pieces drop to the lowest available position in each column, creating strategic depth and requiring players to think several moves ahead. Built with Java and Swing, the game features a polished graphical user interface that makes gameplay intuitive and enjoyable. The AI implementation showcases advanced game theory concepts and provides an excellent demonstration of algorithmic problem-solving in game development.

Tech Stack

Java
Swing
AI/ML
Minimax Algorithm
Alpha-Beta Pruning
Game Theory

Key Features

  • Custom graphical user interface using Java Swing
  • Intelligent AI opponent with minimax algorithm
  • Alpha-beta pruning for optimal move calculation
  • Multiple difficulty levels
  • Two-player mode support
  • Win detection for horizontal, vertical, and diagonal alignments
  • Smooth piece dropping animations
  • Strategic gameplay with depth and complexity

Screenshots

Active Game Session

Connect 5 Game - Main Gameplay

AI Opponent in Action

Connect 5 Game - AI Move
Connect 5 Game | Zisis Kostakakis