{"id":23209006,"url":"https://github.com/raccoon-hero/threads-siege","last_synced_at":"2025-04-05T12:09:56.077Z","repository":{"id":268427245,"uuid":"904324034","full_name":"raccoon-hero/threads-siege","owner":"raccoon-hero","description":"A multithreaded arcade-style space defense game built with Java Swing, featuring real-time shooting mechanics, dynamic difficulty scaling, and responsive gameplay elements.","archived":false,"fork":false,"pushed_at":"2024-12-16T17:10:18.000Z","size":38,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T22:52:08.974Z","etag":null,"topics":["2d-game","arcade-game","concurrent-programming","dynamic-difficulty","java","java-games","multithreading","semaphore","space-shooter","swing","synchronization","thread-management"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raccoon-hero.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-12-16T17:06:05.000Z","updated_at":"2024-12-16T17:21:47.000Z","dependencies_parsed_at":"2024-12-16T18:34:04.497Z","dependency_job_id":null,"html_url":"https://github.com/raccoon-hero/threads-siege","commit_stats":null,"previous_names":["raccoon-hero/threads-siege"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raccoon-hero%2Fthreads-siege","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raccoon-hero%2Fthreads-siege/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raccoon-hero%2Fthreads-siege/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raccoon-hero%2Fthreads-siege/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raccoon-hero","download_url":"https://codeload.github.com/raccoon-hero/threads-siege/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247332611,"owners_count":20921853,"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","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":["2d-game","arcade-game","concurrent-programming","dynamic-difficulty","java","java-games","multithreading","semaphore","space-shooter","swing","synchronization","thread-management"],"created_at":"2024-12-18T18:13:34.705Z","updated_at":"2025-04-05T12:09:56.056Z","avatar_url":"https://github.com/raccoon-hero.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Threads Siege 🚀  \r\n\r\n![Java](https://img.shields.io/badge/Java-8+-blue?logo=java\u0026logoColor=white)\r\n![Status](https://img.shields.io/badge/Status-Prototype-yellow)\r\n\r\nAn under 500 lines of code prototype **Threads Siege** made for a subject in uni, an arcade-style space defense game built with **Java Swing**. Players use their spaceship cannon to shoot down incoming alien enemies while avoiding letting too many enemies slip through.  \r\n\r\n![Gameplay Screenshot](assets/gameplay-screenshot.png)  \r\n_**Screenshot 1.** Gameplay Screenshot (UI in Ukrainian)_\r\n\r\n⚠️ **Expect bugs and unpolished gameplay.** Contributions, feedback, and suggestions are welcome to help refine this game.  \r\n\r\n---\r\n\r\n## Features 🌟  \r\n\r\n- **Multithreaded Mechanics**: Each enemy and bullet runs independently on its thread, allowing real-time movement and interaction.  \r\n- **Dynamic Difficulty Adjustment**: The number of active enemies and their spawn rate automatically increase as the game progresses, based on the player's score and elapsed time.  \r\n- **Collision-Based Scoring**: Bullets destroy enemies on contact, incrementing the score while missed enemies contribute to the game-over counter.  \r\n- **Limited Ammo**: Players can have only three active bullets at a time, managed using a semaphore for concurrency control.  \r\n- **Game State Feedback**: The UI dynamically updates to reflect the player's score and missed enemies, with win/lose conditions displayed at the game end.  \r\n\r\n---\r\n\r\n## Getting Started 🛠️  \r\n\r\n### Prerequisites  \r\n\r\nEnsure you have the following installed:  \r\n\r\n- **Java 8** or higher  \r\n- Any Java IDE or a command-line terminal  \r\n\r\n### Installation  \r\n\r\n1. **Clone the repository**:  \r\n   ```bash  \r\n   git clone https://github.com/raccoon-hero/threads-siege.git  \r\n   cd threads-siege  \r\n   ```  \r\n\r\n2. **Compile the project**:  \r\n   Using the terminal:  \r\n   ```bash  \r\n   javac ThreadsSiege.java  \r\n   ```  \r\n\r\n3. **Run the game**:  \r\n   ```bash  \r\n   java ThreadsSiege  \r\n   ```  \r\n\r\n---\r\n\r\n## Controls 🎮  \r\n\r\n- **Arrow Keys**: Move your cannon left and right.  \r\n- **Spacebar**: Shoot bullets (limited to three active bullets at a time).  \r\n\r\n---\r\n\r\n## Project Structure 📂  \r\n\r\n```plaintext  \r\nthreads-siege/  \r\n├── assets/                     # Assets for showcasing gameplay (e.g., screenshots)  \r\n├── ThreadsSiege.java           # Main game file  \r\n└── README.md                   # Project Documentation (you’re here! :D)  \r\n```  \r\n\r\n---\r\n\r\n## Known Issues 👾  \r\n\r\n- **Thread Termination**: Active threads (e.g., enemies and bullets) are not guaranteed to terminate when the game exits, which may lead to memory leaks or lingering processes.  \r\n- **Concurrency Management**: Shared resources like `enemies` and `bullets` are manually synchronized, which could cause subtle bugs under certain conditions.  \r\n- **UI Scaling**: Game objects do not resize dynamically when the window size is changed, resulting in potential layout issues.  \r\n- **Repaint Performance**: Under heavy load, the UI may experience performance drops due to frequent updates and rendering of multiple threads.  \r\n- **Error Handling**: Exceptions such as `InterruptedException` are caught but not logged, which may hinder debugging.  \r\n\r\n---\r\n\r\n## Future Plans ⏩  \r\n\r\n- **Thread Management**: Implement a proper cleanup mechanism for threads to ensure they terminate cleanly when the game ends.  \r\n- **Improved Concurrency**: Replace manual synchronization with safer concurrent collections like `ConcurrentLinkedQueue` for managing enemies and bullets.  \r\n- **Customizable Settings**: Introduce configuration options for adjusting game parameters such as enemy speed, bullet speed, and spawn rates.  \r\n- **Graphics Scaling**: Add support for responsive scaling of game objects to adapt to window resizing.  \r\n- **Performance Optimization**: Profile and optimize repaint intervals to reduce lag during heavy gameplay.  \r\n- **Logging System**: Integrate basic logging to capture runtime exceptions and errors for debugging purposes.  \r\n\r\n---\r\n\r\n## Contributing 🤝  \r\n\r\n1. Fork this repository.  \r\n2. Create a feature branch (`git checkout -b feature/amazing-feature`).  \r\n3. Commit your changes (`git commit -m 'Add some amazing feature'`).  \r\n4. Push to the branch (`git push origin feature/amazing-feature`).  \r\n5. Open a Pull Request. \r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraccoon-hero%2Fthreads-siege","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraccoon-hero%2Fthreads-siege","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraccoon-hero%2Fthreads-siege/lists"}