{"id":46267199,"url":"https://github.com/deadronos/asteroid-defender","last_synced_at":"2026-04-18T04:06:37.794Z","repository":{"id":341658773,"uuid":"1170815031","full_name":"deadronos/asteroid-defender","owner":"deadronos","description":"Asteroid Defender is an interactive idle clicker / automatic defense simulation where a central platform survives endless swarms of incoming space debris and asteroids. The game features an automated targeting system where four dual-barrel turrets continually scan for, track, and destroy enemy space rocks using dynamic laser beams.","archived":false,"fork":false,"pushed_at":"2026-04-14T11:19:47.000Z","size":740,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-14T12:11:02.151Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://deadronos.github.io/asteroid-defender/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deadronos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-02T14:54:09.000Z","updated_at":"2026-04-14T11:19:21.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/deadronos/asteroid-defender","commit_stats":null,"previous_names":["deadronos/asteroid-defender"],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/deadronos/asteroid-defender","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deadronos%2Fasteroid-defender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deadronos%2Fasteroid-defender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deadronos%2Fasteroid-defender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deadronos%2Fasteroid-defender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deadronos","download_url":"https://codeload.github.com/deadronos/asteroid-defender/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deadronos%2Fasteroid-defender/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31955937,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"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":[],"created_at":"2026-03-04T02:23:12.579Z","updated_at":"2026-04-18T04:06:37.774Z","avatar_url":"https://github.com/deadronos.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Asteroid Defender\n\nA visually polished, 3D browser-based space defense simulation built with React Three Fiber.\n\n## Overview\n\nAsteroid Defender is an interactive idle clicker / automatic defense simulation where a central platform survives endless swarms of incoming space debris and asteroids. The game features an automated targeting system where four dual-barrel turrets continually scan for, track, and destroy enemy space rocks using dynamic laser beams.\n\nBuilt using modern web technologies, the game emphasizes visual fidelity with a procedurally baked nebula skybox, real-time lighting, post-processing bloom, and dynamic particle explosion effects when asteroids are shattered.\n\n## Features\n\n- **3D Procedural Environment**: A seamless, procedurally generated nebula texture sampled on a skybox representing deep space.\n- **Automated Combat**: Turrets automatically select targets, track them, and fire lasers to defend the central platform.\n- **Dynamic Spawning**: A continuous flow of different asteroid types (Basic, Fast, Heavy, Swarmer, Splitter) with varying behaviors.\n- **Entity Component System**: Built on top of `miniplex` for managing game entities and logic efficiently.\n- **Visual Polish**:\n  - Post-processing bloom for glowing lasers and explosions.\n  - Custom shader streaks for shooting stars.\n  - Fragmented particle physics for destroyed asteroids.\n  - Smooth camera movements and UI overlays.\n\n## Tech Stack\n\n- **Framework**: [React 19](https://react.dev/)\n- **3D Rendering**: [Three.js](https://threejs.org/) + [@react-three/fiber](https://docs.pmnd.rs/react-three-fiber/)\n- **Utility / Helpers**: [@react-three/drei](https://github.com/pmndrs/drei)\n- **Physics \u0026 Effects**: [@react-three/rapier](https://github.com/pmndrs/react-three-rapier) + [@react-three/postprocessing](https://github.com/pmndrs/react-postprocessing)\n- **ECS Engine**: [miniplex](https://miniplex.dev/)\n- **State Management**: [Zustand](https://zustand-demo.pmnd.rs/)\n- **Build Tool**: [Vite+](https://viteplus.dev/) on top of Vite\n\n## Getting Started\n\n### Prerequisites\n\nInstall [Vite+ (`vp`)](https://viteplus.dev/guide/) first. Vite+ manages the project runtime, package manager, and frontend toolchain commands.\n\n### Installation \u0026 Running Locally\n\n1. Install dependencies:\n\n   ```bash\n   vp install\n   ```\n\n2. Start the development server:\n\n   ```bash\n   vp dev\n   ```\n\n3. Open your browser and navigate to the address shown in your terminal (usually `http://localhost:5173`).\n\n### Validation\n\nRun the unified Vite+ checks and build commands:\n\n```bash\nvp check\nvp test\nvp build\n```\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE.md).\n\n## Performance Budget\n\nThese targets guide optimization work and help detect regressions. See [docs/PERFORMANCE.md](docs/PERFORMANCE.md) for the full bundle-analysis (before/after breakdown) and further optimization guidance.\n\n| Metric                        | Target                                                      |\n| ----------------------------- | ----------------------------------------------------------- |\n| Initial JS payload (gzip)     | \u003c 500 kB per chunk (see note), \u003c 1.5 MB total               |\n| Time to Interactive (TTI)     | \u003c 5 s on a mid-range device (4× CPU throttle)               |\n| Gameplay frame rate           | ≥ 60 FPS on a discrete GPU; ≥ 30 FPS on integrated graphics |\n| Memory (heap) at steady state | \u003c 256 MB                                                    |\n\n\u003e **Note on chunk size:** `vendor-rapier` (~838 kB gzip) exceeds the per-chunk cap because it contains the compiled Rust/WASM Rapier physics engine — an upstream constraint that cannot be reduced by tree-shaking. All other chunks meet the \u003c 500 kB target.\n\n### Bundle strategy\n\nThe build is split into six vendor chunks so browsers can cache them independently and download them in parallel. Additional lazy-loaded chunks (`PostEffects`, `SpaceBackground`) are only fetched after the first frame renders:\n\n| Chunk                   | Contents                                        |\n| ----------------------- | ----------------------------------------------- |\n| `vendor-react`          | `react`, `react-dom`                            |\n| `vendor-three`          | `three`                                         |\n| `vendor-r3f`            | `@react-three/fiber`, `@react-three/drei`       |\n| `vendor-rapier`         | `@react-three/rapier`                           |\n| `vendor-postprocessing` | `@react-three/postprocessing`, `postprocessing` |\n| `vendor-state`          | `zustand`, `miniplex`, `miniplex-react`         |\n\nPost-processing effects (`EffectComposer`, `Bloom`, `DepthOfField`) and the cosmetic `SpaceBackground` are lazy-loaded so the core game canvas becomes interactive before those chunks finish downloading. Once loaded, the same adaptive quality system also trims the background itself: reduced tiers lower star density, freeze the dust simulation, and eventually fall back to a sparse static star field with no nebula or shooting stars.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeadronos%2Fasteroid-defender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeadronos%2Fasteroid-defender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeadronos%2Fasteroid-defender/lists"}