Knucklebones is a strategic multiplayer dice game built in Scala, featuring a complete full-stack implementation with integrated backend logic and responsive frontend UI. This project demonstrates modern web application architecture with real-time server communication for seamless multiplayer functionality across varied devices and networks.
The game provides an engaging 2-player, 1-vs-1 experience where players strategically place dice on a 3x3 grid to outscore their opponent. The first player to win 2 rounds claims victory!
- Backend Logic: Robust Scala implementation handling game mechanics, rule enforcement, move validation, and state management
- Frontend UI: Responsive HTML-based interface with interactive gameplay elements and sprite animations
- Multiplayer Support: Real-time server synchronization enabling seamless multiplayer experiences
- Modular Architecture: Scalable design supporting future expansions such as additional game modes or enhanced graphics
- Cross-Platform: Works across various devices and networks with consistent performance
This project was developed by Team 199 as part of the CS-214 Software Construction course at EPFL:
- Marti Léonard Timothée - 364185, leonard.marti@epfl.ch
- Philippe Cyriac Eric Arnaud - 360553, cyriac.philippe@epfl.ch
- Schwabedal Georg Tilman Peter - 328434, georg.schwabedal@epfl.ch
- Scala 3.5.0 or higher
- SBT (Scala Build Tool)
- Modern web browser (Chrome, Firefox, Safari, or Edge)
-
Clone the repository
git clone https://github.com/georgstsc/Knucklebones_project.git cd Knucklebones_project -
Start the application
Navigate to the project directory and run:
sbt --client run
-
Access the game
Once the server is running, open your preferred browser and navigate to:
http://localhost:8080
- Enter your name and your opponent's name in the setup screen
- Share the game link with your opponent
- Whoever clicks "Ready" first will start the game
Fill your 3x3 grid with dice to score more points than your opponent. The first player to win 2 rounds wins the game.
- Column Scoring: Scores are calculated by summing the values in each column
- Multiplier Bonus: Dice of the same value in a column are multiplied together
- Strategic Elimination: Placing a die with the same value as your opponent in the corresponding column will eliminate their dice
- Random Dice: Dice values are randomly generated for fair play
- Information Advantage: You can see:
- Your opponent's next dice
- Your current dice to be placed
- Your upcoming dice (hidden from your opponent)
- Strategic Placement: Choose your column placement wisely to maximize points and disrupt your opponent's strategy
- Reset Button: Available throughout the game to restart and return to the Game Over screen
- Play Again: After a game ends, easily start a new match with the same or different opponent
- Game Logic: Core mechanics implementation with type-safe data structures
- State Management: Immutable state handling for reliable game flow
- Server Communication: WebSocket-based real-time multiplayer synchronization
- Testing Suite: Comprehensive unit and integration tests ensuring game integrity
- Responsive Design: HTML/CSS implementation adapting to various screen sizes
- Interactive UI: Dynamic game board with real-time updates
- Visual Elements: Custom sprites and animations for engaging gameplay
- Screen Management:
- Welcome/Setup screen
- Game board interface with 3x3 grid layout
- Score display and round tracking
- Winner declaration and game over screen
app199/
├── apps/
│ ├── js/ # Frontend JavaScript/Scala.js code
│ ├── jvm/ # Backend Scala code
│ │ ├── src/
│ │ │ ├── main/ # Main application logic
│ │ │ └── test/ # Test suites
│ └── shared/ # Shared code between frontend and backend
├── build.sbt # Build configuration
└── Readme.md # This file
The project includes comprehensive test coverage. Run the test suite with:
sbt testThe modular architecture supports potential expansions:
- Additional game modes (tournament, timed matches)
- Enhanced graphics and animations
- Player statistics and leaderboards
- AI opponent for single-player mode
- Mobile app development
This project was developed as part of the CS-214 Software Construction course at EPFL.
Special thanks to the CS-214 course staff at EPFL for their guidance and support throughout this project.
Enjoy playing Knucklebones! 🎲✨