Skip to content

georgstsc/Knucklebones_project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Knucklebones - Multiplayer Strategy Game

Knucklebones Game Scala License

📋 Project Overview

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!

🎯 Key Features

  • 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

👥 Team Members

This project was developed by Team 199 as part of the CS-214 Software Construction course at EPFL:

🚀 Getting Started

Prerequisites

  • Scala 3.5.0 or higher
  • SBT (Scala Build Tool)
  • Modern web browser (Chrome, Firefox, Safari, or Edge)

Installation & Setup

  1. Clone the repository

    git clone https://github.com/georgstsc/Knucklebones_project.git
    cd Knucklebones_project
  2. Start the application

    Navigate to the project directory and run:

    sbt --client run
  3. Access the game

    Once the server is running, open your preferred browser and navigate to:

    http://localhost:8080
    

🎮 How to Play

Game Setup

  1. Enter your name and your opponent's name in the setup screen
  2. Share the game link with your opponent
  3. Whoever clicks "Ready" first will start the game

Objective

Fill your 3x3 grid with dice to score more points than your opponent. The first player to win 2 rounds wins the game.

Scoring Rules

  • 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

Gameplay Mechanics

  • 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

Game Controls

  • 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

🏗️ Technical Architecture

Backend (Scala)

  • 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

Frontend

  • 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

Project Structure

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

🧪 Testing

The project includes comprehensive test coverage. Run the test suite with:

sbt test

🔮 Future Enhancements

The 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

📄 License

This project was developed as part of the CS-214 Software Construction course at EPFL.

🙏 Acknowledgments

Special thanks to the CS-214 course staff at EPFL for their guidance and support throughout this project.


Enjoy playing Knucklebones! 🎲✨

About

Repository for the knucklebones project migrated from gitlab

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages