Skip to content

Repository files navigation

Marble Solitaire Logo



A C++/OpenGL recreation of the classic Marble Solitaire board game, built as part of a Computer Graphics with C++ coursework.


📋 Table of Contents


🎥 YouTube Demo

Watch the Marble Solitaire Demo on YouTube

🔎 About

Marble Solitaire challenges you to clear the board down to a single marble by “jumping” marbles over one another and removing the jumped marble.

  • Start with the board filled except for one empty hole in the center.
  • Click a marble, then click an adjacent empty spot two spaces away to jump and remove the in-between marble.
  • Keep playing until no moves remain or you’ve won by leaving just one marble.

This project showcases:

  • 🎨 Custom 3D assets — board and marbles modeled in Blender
  • 🔊 Audio design — sound effects & background music via irrKlang
  • 💻 Core OpenGL coursework concepts
    • 📐 Geometric primitives & transformations
    • 🎥 Projection, view matrices & camera
    • 💡 Lighting & shading
    • 🖥️ GLSL vertex/fragment shaders

⚙️ Features

  • ✔️ 3D board & marbles rendered with modern OpenGL
  • 🔧 Code-level board layout selection — choose a preset (e.g. “plus”, “cross”, “diamond”) by passing it to GameController::newGame() in your source before building (not a runtime option)
  • 🔄 Rotate board by holding the right mouse button and dragging
  • 🧱 Self-modeled Blender assets for a polished look
  • 🎶 Background music and jump sound effects

🚫 Limitations

  • ❌ No scoring system or move/time tracking
  • ❌ Winning marble may end anywhere (should be center)
  • ❌ No undo, hint, or “solve from here” assistance
  • ❌ No choice of board configuration as part of the gameplay

🛠️ Tech Stack

  • Language: C++
  • Graphics: OpenGL, GLEW, GLFW, GLM, SOIL2
  • Audio: irrKlang
  • Modeling: Blender (.obj assets)
  • Build: Visual Studio solution (.sln)

🚀 Installation

  1. Clone the repository
    git clone --recurse-submodules https://github.com/patrykkuta/marble-solitaire.git
    cd marble-solitaire
    git submodule update --init --recursive
  2. Open MarbleSolitaire.sln in Visual Studio
  3. Build & Run

🎮 How to Play

  1. Press Space to start the game
  2. Click a marble, then click an empty spot two spaces away to jump
  3. Continue until you clear all but one marble or no moves remain

💡 Tip: Hold the right mouse button and drag to rotate the board view.


🤝 Contributing

  1. Fork the repo
  2. Clone your fork
    git clone <your-fork-url>
    cd marble-solitaire
  3. Create a feature branch
  4. Commit your changes & push
  5. Open a Pull Request

📄 License

This project is released under the MIT License. See LICENSE for details.

About

OpenGL-based Marble Solitaire game with Blender models and irrKlang audio.

Topics

Resources

Stars

Watchers

Forks

Used by

Contributors

Languages