{"id":29273298,"url":"https://github.com/myounesdev/hexaclash","last_synced_at":"2026-05-16T12:31:29.139Z","repository":{"id":276531940,"uuid":"870598884","full_name":"MYounesDev/HexaClash","owner":"MYounesDev","description":"A turn-based battle simulator featuring a hexagonal grid, dynamic unit interactions, and epic clashes between Humans and Orcs","archived":false,"fork":false,"pushed_at":"2025-02-21T18:28:06.000Z","size":32268,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-05T02:25:47.212Z","etag":null,"topics":["c","c-language","consle","cpp","curl-library","game","sfml"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MYounesDev.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-10-10T10:32:51.000Z","updated_at":"2025-02-24T11:36:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"1d9ccbb4-c68a-4827-907f-6cd05ef3c747","html_url":"https://github.com/MYounesDev/HexaClash","commit_stats":null,"previous_names":["myouneseg/hexaclash","myounesdev/hexaclash"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MYounesDev/HexaClash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MYounesDev%2FHexaClash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MYounesDev%2FHexaClash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MYounesDev%2FHexaClash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MYounesDev%2FHexaClash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MYounesDev","download_url":"https://codeload.github.com/MYounesDev/HexaClash/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MYounesDev%2FHexaClash/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33102743,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","c-language","consle","cpp","curl-library","game","sfml"],"created_at":"2025-07-05T02:08:58.629Z","updated_at":"2026-05-16T12:31:29.122Z","avatar_url":"https://github.com/MYounesDev.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HexaClash - Battle Simulation Project\n\n## Overview\n\n**HexaClash** is a battle simulation project that simulates a turn-based battle between two teams: the **Human Empire** (`insan_imparatorlugu`) and the **Orc Legion** (`ork_legi`). The project includes a graphical interface built with **SFML (Simple and Fast Multimedia Library)** and uses JSON files to define unit types, heroes, monsters, and research levels. The simulation calculates damage, critical hits, and other battle mechanics, and logs the results to a file.\n\n---\n\n## Features\n\n- **Turn-Based Battle Simulation**: Simulates battles between two teams with attack, defense, and critical hit mechanics.\n- **Graphical Interface**: Renders a hexagonal grid with unit images, health bars, and main characters (heroes and monsters).\n- **Dynamic Unit Placement**: Units are randomly placed on the grid based on their team.\n- **Health Bars and Stats**: Displays health percentages and unit stats in real-time.\n- **Interactive UI**: Click on units to enlarge or shrink their images.\n- **Sound Effects**: Plays background music during the welcome screen.\n- **Logging**: Logs battle results to a file (`savas_sim.txt`).\n\n---\n\n## Prerequisites\n\nBefore running the project, ensure you have the following installed:\n\n1. **C/C++ Compiler**: \n   - GCC (Linux/Mac) or MinGW (Windows).\n2. **SFML Library**:\n   - Download and install SFML from [SFML's official website](https://www.sfml-dev.org/).\n   - Make sure SFML is properly linked to your project.\n3. **CURL** (for downloading scenario files):\n   - Ensure `curl` is installed on your system.\n4. **Windows API** (for sound and system commands):\n   - Required for `PlaySound` and `system` commands.\n\n---\n\n## Installation\n\n### Step 1: Clone the Repository\n\n```bash\ngit clone https://github.com/your-username/HexaClash.git\ncd HexaClash\n```\n\n### Step 2: Install Dependencies\n\n#### On Windows:\n\u003col start=\"1\"\u003e\n  \u003cli\u003e\n    \u003cp\u003e\n      Download and install\n      \u003ca\n        href=\"https://www.sfml-dev.org/download.php\"\n        target=\"_blank\"\n        rel=\"noreferrer\"\n        \u003eSFML\u003c/a\n      \u003e.\n    \u003c/p\u003e\n  \u003c/li\u003e\n  \u003cli\u003e\n    \u003cp\u003e\n      Add SFML's \u003ccode\u003einclude\u003c/code\u003e and \u003ccode\u003elib\u003c/code\u003e directories to your\n      compiler's search paths.\n    \u003c/p\u003e\n  \u003c/li\u003e\n  \u003cli\u003e\n    \u003cp\u003e\n      Ensure \u003ccode\u003esfml-audio-2.dll\u003c/code\u003e, \u003ccode\u003esfml-graphics-2.dll\u003c/code\u003e,\n      and other SFML DLLs are in the \u003ccode\u003ebin/Debug\u003c/code\u003e or\n      \u003ccode\u003ebin/Release\u003c/code\u003e folder.\n    \u003c/p\u003e\n  \u003c/li\u003e\n\u003c/ol\u003e\n\n#### On Linux/Mac:\nInstall SFML using your package manager:\n```bash\nsudo apt-get install libsfml-dev  # For Ubuntu/Debian\nbrew install sfml                # For Mac\n```\n### Step 3: Compile the Project\n\n#### Using GCC:\n```bash\ng++ -std=c++11 main.c gameInterface.cpp -o HexaClash -lsfml-graphics -lsfml-window -lsfml-system -lsfml-audio\n```\n\n#### Using Code::Blocks\n1. open `HexaClash.cbp` using Code::Blocks\n2. click \"Build and run\" or press F9\n\n## Usage\n\n\u003col start=\"1\"\u003e\n  \u003cli\u003e\n    \u003cp\u003e\u003cstrong\u003eRun the Program\u003c/strong\u003e\u003c/p\u003e\n\n  \u003c/li\u003e\n  \u003cli\u003e\n    \u003cp\u003e\u003cstrong\u003eEnter a Scenario Number\u003c/strong\u003e:\u003c/p\u003e\n    \u003cul\u003e\n      \u003cli\u003e\n        \u003cp\u003eThe program will prompt you to enter a scenario number (1-10).\u003c/p\u003e\n      \u003c/li\u003e\n      \u003cli\u003e\n        \u003cp\u003e\n          The scenario file will be downloaded automatically if it doesn't exist\n          locally.\n        \u003c/p\u003e\n      \u003c/li\u003e\n    \u003c/ul\u003e\n  \u003c/li\u003e\n  \u003cli\u003e\n    \u003cp\u003e\u003cstrong\u003eView the Battle\u003c/strong\u003e:\u003c/p\u003e\n    \u003cul\u003e\n      \u003cli\u003e\n        \u003cp\u003e\n          The graphical interface will display the battle grid, units, and\n          health bars.\n        \u003c/p\u003e\n      \u003c/li\u003e\n      \u003cli\u003e\u003cp\u003eClick on units to enlarge or shrink their images.\u003c/p\u003e\u003c/li\u003e\n    \u003c/ul\u003e\n  \u003c/li\u003e\n  \u003cli\u003e\n    \u003cp\u003e\u003cstrong\u003eBattle Simulation\u003c/strong\u003e:\u003c/p\u003e\n    \u003cul\u003e\n      \u003cli\u003e\n        \u003cp\u003e\n          The battle is simulated automatically, and the results are logged to\n          \u003ccode\u003esavas_sim.txt\u003c/code\u003e.\n        \u003c/p\u003e\n      \u003c/li\u003e\n    \u003c/ul\u003e\n  \u003c/li\u003e\n  \u003cli\u003e\n    \u003cp\u003e\u003cstrong\u003eReplay or Exit\u003c/strong\u003e:\u003c/p\u003e\n    \u003cul\u003e\n      \u003cli\u003e\n        \u003cp\u003e\n          After the battle, you can choose to replay the simulation or exit the\n          program.\n        \u003c/p\u003e\n      \u003c/li\u003e\n    \u003c/ul\u003e\n  \u003c/li\u003e\n\u003c/ol\u003e\n\n## Project Structure\n```mathematica\nHexaClash/\n├── bin/                  # Compiled binaries and SFML DLLs\n├── fonts/                # Font files (e.g., Arial.ttf)\n├── images/               # Unit, hero, monster, and background images\n├── json/                 # JSON files for unit types, heroes, monsters, and research\n├── music/                # Background music (music.wav)\n├── obj/                  # Object files (generated during compilation)\n├── src/                  # Source code files\n│   ├── classes.h         # Data structures for units, heroes, monsters, and teams\n│   ├── fightFunction.h   # Battle simulation logic\n│   ├── functions.h       # Utility functions for file handling and user interaction\n│   ├── gameInterface.cpp # Graphical interface implementation\n│   ├── main.c            # Entry point of the program\n├── README.md             # Project documentation\n```\n\n## JSON File Format\nThe project uses JSON files to define scenarios. Here's an example structure:\n```json\n{\n  \"insan_imparatorlugu\": {\n    \"birimler\": [\n      {\"isim\": \"piyade\", \"sayi\": 100},\n      {\"isim\": \"okcu\", \"sayi\": 50}\n    ],\n    \"kahramanlar\": [\n      {\"isim\": \"Alparslan\", \"bonus_turu\": \"saldiri\", \"bonus_degeri\": 10, \"etkilenen\": \"piyade\"}\n    ],\n    \"canavarlar\": [\n      {\"isim\": \"Ejderha\", \"etki_turu\": \"savunma\", \"etki_degeri\": 5, \"etkilenen\": \"okcu\"}\n    ],\n    \"arastirma_seviyesi\": {\n      \"isim\": \"savunma_ustaligi\",\n      \"seviye\": 1,\n      \"oran\": 10\n    }\n  },\n  \"ork_legi\": {\n    \"birimler\": [\n      {\"isim\": \"ork_dovuscu\", \"sayi\": 120},\n      {\"isim\": \"trol\", \"sayi\": 30}\n    ],\n    \"kahramanlar\": [\n      {\"isim\": \"Goruk_Vahsi\", \"bonus_turu\": \"kritik\", \"bonus_degeri\": 15, \"etkilenen\": \"ork_dovuscu\"}\n    ],\n    \"canavarlar\": [\n      {\"isim\": \"Tepegoz\", \"etki_turu\": \"saldiri\", \"etki_degeri\": 8, \"etkilenen\": \"trol\"}\n    ],\n    \"arastirma_seviyesi\": {\n      \"isim\": \"elit_egitim\",\n      \"seviye\": 2,\n      \"oran\": 20\n    }\n  }\n}\n```\n\n\n\n\u003chr\u003e\n\n![ww](images/Screenshots(1).bmp)\n\n![ww](images/Screenshots(2).bmp)\n\n\u003chr\u003e\n\n## Collaborators\n\n\u003cul\u003e\n  \u003cli\u003e\n    \u003cp\u003e\n      \u003cstrong\n        \u003e\u003ca\n          href=\"https://github.com/MYounesEG\"\n          target=\"_blank\"\n          rel=\"noreferrer\"\n          \u003eMYounes\u003c/a\n        \u003e\u003c/strong\n      \u003e: JSON file parsing and unit data management.\n    \u003c/p\u003e\n  \u003c/li\u003e\n  \u003cli\u003e\n    \u003cp\u003e\n      \u003cstrong\n        \u003e\u003ca\n          href=\"https://github.com/MerveSevim44\"\n          target=\"_blank\"\n          rel=\"noreferrer\"\n          \u003eMerve Sevim\u003c/a\n        \u003e\u003c/strong\n      \u003e: SFML integration and UI design.\n    \u003c/p\u003e\n  \u003c/li\u003e\n\u003c/ul\u003e\n\n# Enjoy the HexaClash simulation! 🎮\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyounesdev%2Fhexaclash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmyounesdev%2Fhexaclash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyounesdev%2Fhexaclash/lists"}