{"id":30663292,"url":"https://github.com/rmssanali/shotgungame","last_synced_at":"2026-06-17T23:31:02.020Z","repository":{"id":310720582,"uuid":"1040931474","full_name":"RMSSanali/ShotGunGame","owner":"RMSSanali","description":"A Windows Forms (C# .NET) school project – Shotgun Game from the course Objektorienterad programmering med C# .NET.","archived":false,"fork":false,"pushed_at":"2025-08-19T19:44:14.000Z","size":6127,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-31T17:13:00.934Z","etag":null,"topics":["csharp","game","objectorientedprogramming","schoolproject","shotgungame","winforms"],"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/RMSSanali.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":"2025-08-19T18:09:58.000Z","updated_at":"2025-08-19T19:44:17.000Z","dependencies_parsed_at":"2025-08-19T21:29:20.343Z","dependency_job_id":null,"html_url":"https://github.com/RMSSanali/ShotGunGame","commit_stats":null,"previous_names":["rmssanali/shotgungame"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RMSSanali/ShotGunGame","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RMSSanali%2FShotGunGame","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RMSSanali%2FShotGunGame/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RMSSanali%2FShotGunGame/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RMSSanali%2FShotGunGame/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RMSSanali","download_url":"https://codeload.github.com/RMSSanali/ShotGunGame/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RMSSanali%2FShotGunGame/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274864463,"owners_count":25364232,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-12T02:00:09.324Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["csharp","game","objectorientedprogramming","schoolproject","shotgungame","winforms"],"created_at":"2025-08-31T17:04:46.418Z","updated_at":"2026-06-17T23:31:01.978Z","avatar_url":"https://github.com/RMSSanali.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shotgun – Windows Forms Game 🎯\n\nThis repository contains my implementation of the **Shotgun** game as part of *Inlämningsuppgift 2* in the course **Objektorienterad programmering med C# .NET**.  \nThe player competes against the computer using actions **Shoot**, **Load**, **Block**, and the special **Shotgun** move.\n\n---\n\n## Table of Contents\n- Extended Description\n- Assignment Scope\n- Game Rules\n- How to Run Locally\n- Implementation Notes (OOP)\n- Screenshots / Demo\n- Project Documentation\n- Author\n- Assignment Status\n\n---\n\n## Extended Description\nThis project was created during the course *Objektorienterad programmering med C# .NET*.  \nThe task was to build a playable **Windows Forms (WinForms)** application where the user plays *Shotgun* against a computer opponent that picks moves randomly.\n\nKey objectives:\n- Show each player’s current bullet count clearly at all times.\n- Prevent shooting unless the player has bullets (same for the computer).\n- Announce the winner and allow “Play Again.”\n- Enable the **Shotgun** action only when the player has **≥ 3 bullets**.\n- Write clean, object-oriented C# code following the course guidelines.\n\nAll core features are implemented as required for a passing grade (G).\n\n---\n\n## Assignment Scope\nThis submission focuses on:\n- A functional **WinForms UI** for interaction and status display.\n- A **game engine** enforcing rules, turn results, and win conditions.\n- A **simple AI** (random move selection).\n\nOptional improvements (not required for G) are noted in the roadmap and can be added later (e.g., smarter AI).\n\n---\n\n## Game Rules\n- **Load vs Load** → Both players gain **+1 bullet**.  \n- **Load vs Block** → The loading player gains **+1 bullet**.  \n- **Block vs Block** → No change.  \n- **Shoot vs Block** → The shooter **loses 1 bullet**.  \n- **Shoot vs Shoot** → Both players **lose 1 bullet**.  \n- **Shoot vs Load** → **Shooter wins** the game.  \n- **Shotgun (needs 3+ bullets)** → **Instant win** (even if opponent shoots or blocks).\n\n---\n\n## How to Run Locally\n1. **Clone** the repo:\n   ```bash\n   git clone https://github.com/\u003cyour-username\u003e/ShotgunGame.git\n\n   \n## Implementation Notes (OOP)\n\n- **GameState** class to track bullets, last moves, and win state.\n\n- **Player** abstraction for Human and Computer:\n\n  - Human: selected via UI buttons.\n\n  - Computer: random strategy (can be extended).\n\n- **GameEngine** service:\n\n  - Validates actions (e.g., cannot Shoot with 0 bullets).\n\n  - Resolves round outcomes based on rules.\n\n  - Exposes events/results to the UI.\n\n- **WinForms** UI:\n\n  - Clearly displays bullet counts and last actions.\n\n  - Disables invalid buttons (e.g., Shoot when bullets = 0; Shotgun when bullets \u003c 3).\n\n  - Dialog to show winner and Play Again option.\n\n- **Roadmap (optional):**\n\n    - Smarter AI (avoid “Block” when opponent has 0 bullets, etc.)\n    - Sound effects and animations\n    - Persistent high scores\n\n## Screenshots / Demo\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/user-attachments/assets/dcbc1273-f3a8-4bd6-906b-10f5af25c480\" width=\"400\"/\u003e\n  \u003cimg src=\"https://github.com/user-attachments/assets/5ba5fec1-a5a2-4086-a3c9-f0f0c5ede2a7\" width=\"400\"/\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\u003cem\u003ePlayer loads a bullet while opponent blocks\u003c/em\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/user-attachments/assets/d00d211a-e9f2-4bd8-9a15-5373fe6e2bf1\" width=\"400\"/\u003e\n  \u003cimg src=\"https://github.com/user-attachments/assets/e77a9eb5-91cd-4b18-827f-fd3beb78f8af\" width=\"400\"/\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\u003cem\u003eShooting action and empty bullets warning\u003c/em\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/user-attachments/assets/8bba091d-ba9d-4f59-b69a-a4069cbfb1e4\" width=\"400\"/\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\u003cem\u003eShotgun move → instant win\u003c/em\u003e\u003c/p\u003e\n\n## 📄 Project Documentation\n\nA short technical note is included in the repo (e.g., docs/notes.md) describing:\n\n- Class responsibilities (GameState, GameEngine, Player).\n- UI flow and state updates.\n- How to extend AI logic.\n\n## 👤 Author\nSanali Sewwandi\nCloud Developer Student – CUA24S\nJENSEN Yrkeshögskola, 2025\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmssanali%2Fshotgungame","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frmssanali%2Fshotgungame","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmssanali%2Fshotgungame/lists"}