A professional Java Swing application demonstrating Object-Oriented Programming principles and modern GUI development.
This multiplayer dice game is a complete Java Swing application built to showcase software development skills. It features a clean MVC architecture, intuitive UI, and demonstrates core OOP principles including encapsulation, inheritance, polymorphism, and abstraction.
Perfect for:
- โ GitHub portfolio projects
- โ Resume enhancement
- โ Learning Java Swing
- โ Understanding game development logic
- โ Practicing OOP concepts
- ๐ฅ 2-6 Player Support - Play with friends in hot-seat multiplayer
- ๐ฒ Interactive Dice - Click to hold/unhold dice between rolls
- ๐ Score Tracking - Real-time scoreboard with active player highlighting
- ๐ฏ Multiple Scoring Combos - Five of a Kind, Straights, Full House, and more
- ๐พ Customizable Settings - Adjust target scores and game rules
- ๐จ Modern Dark UI - Clean, professional interface with smooth interactions
- ๐ Turn Management - Automatic turn progression and winner detection
- โ๏ธ Menu System - Easy access to game controls and help
Add screenshots of your game here after running it!
[Main Game Screen] [Scoreboard] [Winner Screen]
Be the first player to reach the target score (default: 10,000 points)!
| Combination | Score | Description |
|---|---|---|
| Five of a Kind | 5000 | All five dice show the same number |
| Four of a Kind | 2000 | Four dice show the same number |
| Straight | 1500 | 1-2-3-4-5 or 2-3-4-5-6 |
| Three of a Kind | 1000 | Three dice show the same number |
| Full House | 750 | Three of one number + two of another |
| Two Pairs | 500 | Two different pairs |
| Single 1 | 100 | Each 1 is worth 100 points |
| Single 5 | 50 | Each 5 is worth 50 points |
- Roll the Dice - Click "Roll Dice" to roll all five dice
- Hold Dice - Click on individual dice to hold them for the next roll
- Re-roll - You get up to 3 rolls per turn
- End Turn - Click "End Turn" to add your score and pass to next player
- Win - First player to reach the target score wins!
- Java JDK 11 or higher
- Maven (recommended) or Gradle
- Git
git clone https://github.com/yourusername/multiplayer-dice-game.git
cd multiplayer-dice-game# Compile the project
mvn clean compile
# Run the game
mvn exec:java -Dexec.mainClass="com.dicegame.Main"
# Create executable JAR
mvn clean package
java -jar target/multiplayer-dice-game-1.0.0.jar# Build the project
./gradlew build
# Run the game
./gradlew run
# Create executable JAR
./gradlew jar
java -jar build/libs/multiplayer-dice-game-1.0.0.jar- Import the project into IntelliJ IDEA, Eclipse, or VS Code
- Wait for dependencies to resolve
- Run
Main.javafromsrc/main/java/com/dicegame/
multiplayer-dice-game/
โโโ src/
โ โโโ main/
โ โโโ java/
โ โโโ com/
โ โโโ dicegame/
โ โโโ Main.java # Application entry point
โ โโโ models/ # Data models
โ โ โโโ Player.java # Player entity
โ โ โโโ Dice.java # Single die
โ โ โโโ DiceSet.java # Set of 5 dice
โ โ โโโ ScoreCalculator.java # Scoring logic
โ โโโ controllers/ # Business logic
โ โ โโโ GameController.java # Game state manager
โ โโโ views/ # UI components
โ โ โโโ MainFrame.java # Main window
โ โ โโโ GamePanel.java # Game display
โ โ โโโ DicePanel.java # Dice visualization
โ โ โโโ ControlPanel.java # Game controls
โ โ โโโ ScoreBoardPanel.java # Score display
โ โโโ utils/ # Utilities
โ โโโ Constants.java # App constants
โ โโโ ColorScheme.java # UI colors
โโโ pom.xml # Maven config
โโโ build.gradle # Gradle config
โโโ .gitignore # Git ignore rules
โโโ README.md # This file
- Private fields with public getters/setters in
PlayerandDiceclasses - Data hiding and controlled access to internal state
- All view panels extend
JPanelwith customized behavior - Demonstrates code reuse and hierarchical relationships
- Different scoring strategies can be implemented
- Mouse event handling with overridden methods
ScoreCalculatorprovides high-level scoring interface- Complex scoring logic hidden behind simple methods
GameControllercontainsPlayers,DiceSetMainFramecomposed of multiple panel components
- Models:
Player,Dice,DiceSet,ScoreCalculator - Views:
MainFrame,GamePanel,DicePanel,ControlPanel,ScoreBoardPanel - Controllers:
GameController
- Java 11+ - Core programming language
- Swing - GUI framework
- Maven/Gradle - Build automation
- Git - Version control
- MVC Architecture - Design pattern
This project demonstrates:
- โ Java Collections (ArrayList, HashMap)
- โ Exception Handling
- โ Event-Driven Programming
- โ GUI Layout Managers
- โ Custom Component Painting
- โ State Management
- โ Algorithm Implementation