Skip to content

A lightweight C++ game collection featuring classic console games like Tic-Tac-Toe and Hangman, designed for easy expansion and modular gameplay.

Notifications You must be signed in to change notification settings

Nour-Fawaz/GameHub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎮 GameHub

GameHub is a lightweight C++ game collection project designed to host multiple classic games such as Tic-Tac-Toe and Hangman under a single hub.
It is built entirely in C++ and uses CMake for cross-platform builds.


📦 Features

  • Modular design with a GameFactory to easily add new games
  • Currently includes:
    • Tic-Tac-Toe
    • Hangman
  • Lightweight, console-based interface
  • Cross-platform (Windows, Linux, macOS)

🏗️ Architecture

The GameHub project follows a modular and extensible architecture:

  • GameHub (core manager):
    The main application manager that orchestrates available games and handles user interaction.

  • GameService (abstract game interface):
    Defines the functions that all games must implement. Each game service inherits from this class to provide its own game logic.

  • GameFactory (abstract factory class):
    Responsible for creating game instances. Each game has a concrete factory to produce its corresponding GameService.

  • Concrete Game Services:
    Each game encapsulates its own rules, logic, and state. These are returned by their respective factories and managed by GameHub.

This architecture makes it simple to extend GameHub:
➡️ Create a new game service → Add a concrete factory for it → Register it in GameHub’s game directory.


📦 Download

Follow these steps to build and run the project.

1. Install Prerequisites

  • Install a C++ compiler:
    • Windows: Visual Studio (MSVC) or MinGW
    • Linux/macOS: g++ or clang (already available on most systems)
  • Install CMake

2. Open PowerShell (or terminal) and navigate to the project folder

cd path\to\GameHub

3. Create a build directory and configure with CMake

mkdir build
cd build
cmake ..

4. Build the project

cmake --build .

5. Find the executable

  • If using Visual Studio / MSVC:
    • The executable will be inside build/Debug or build/Release
  • If using MinGW or NMake
    • The executable wil be inside build/

6. Run the program

  • If in Debug:
./Debug/GameHub.exe
  • If in build:
./GameHub.exe

⚠️ Troubleshooting

  • If you encounter errors during build:
    • Check that CMake and your C++ compiler are installed and available in your PATH
    • Review the error messages printed during the build process
    • Ensure your compiler version supports C++17 or later

About

A lightweight C++ game collection featuring classic console games like Tic-Tac-Toe and Hangman, designed for easy expansion and modular gameplay.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published