A modern implementation of the classic Connect Four game with customizable board sizes and an elegant user interface.
Connect Four is a two-player strategy game where players take turns dropping colored discs into a vertically suspended grid. The objective is to be the first to form a line of four discs of your color horizontally, vertically, or diagonally.
- Two-player gameplay with Navy (X) and Turquoise (O) discs
- Configurable board sizes (8x5, 10x6, 12x7)
- Visual player turn indicators
- Win detection with animated golden highlighting
- Modern, flat UI design with hover effects
- Automatic new game option after win/draw
Built using Model-View-Controller (MVC) architecture:
- Model: Handles game logic and state
- View: Custom-drawn components using Java2D
- Controller: Manages user interactions and updates
- Dynamic resizing while maintaining UI proportions
- Maintains circular piece aspect ratio
- Multiple standard board size support
- Modern flat UI design
- Circular disc slots with smooth edges
- Animated winning highlights with golden glow effect
- Responsive hover effects on interface elements
- Manages individual board positions
- Handles player symbols and colors
- Provides state checking functionality
- Implements game logic and move validation
- Win condition detection
- Game state management
- Handles user interactions
- Updates visual game state
- Manages animations and highlights
- Creates and manages the main game interface
- Handles menu system
- Manages board size changes
- Custom-drawn circular buttons
- Handles highlighting and animations
- Manages visual states
- Players take turns clicking on a column to drop their disc
- Discs fall to the lowest available position in the chosen column
- First player to align four discs wins
- Game ends in a draw if the board fills up without a winner
The game has been thoroughly tested with:
- Basic gameplay mechanics
- Win conditions (horizontal, vertical, diagonal)
- Draw conditions
- Invalid move prevention
- UI responsiveness
- Animation smoothness
- Menu functionality
- Java Runtime Environment (JRE)
- Graphical display support
- Minimum resolution to accommodate largest board size (12x7)
Potential areas for future development:
- Network multiplayer support
- AI opponent
- Custom board sizes
- Score tracking
- Game replay functionality
This project is licensed under the Apache License.
Joseph Paul Koyi