{"id":27073055,"url":"https://github.com/kh3rld/make-your-game","last_synced_at":"2025-08-10T03:03:34.671Z","repository":{"id":278734297,"uuid":"935901162","full_name":"kh3rld/make-your-game","owner":"kh3rld","description":"Space Invaders","archived":false,"fork":false,"pushed_at":"2025-03-31T02:03:09.000Z","size":395,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T23:35:26.115Z","etag":null,"topics":["spaceinvaders"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/kh3rld.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}},"created_at":"2025-02-20T07:51:21.000Z","updated_at":"2025-03-31T02:03:13.000Z","dependencies_parsed_at":"2025-03-12T12:33:58.545Z","dependency_job_id":null,"html_url":"https://github.com/kh3rld/make-your-game","commit_stats":null,"previous_names":["kh3rld/make-your-game"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kh3rld/make-your-game","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kh3rld%2Fmake-your-game","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kh3rld%2Fmake-your-game/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kh3rld%2Fmake-your-game/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kh3rld%2Fmake-your-game/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kh3rld","download_url":"https://codeload.github.com/kh3rld/make-your-game/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kh3rld%2Fmake-your-game/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269668185,"owners_count":24456495,"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-08-10T02:00:08.965Z","response_time":71,"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":["spaceinvaders"],"created_at":"2025-04-05T23:35:29.404Z","updated_at":"2025-08-10T03:03:34.420Z","avatar_url":"https://github.com/kh3rld.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"#  Make Your Game: Space Invaders\n \nA browser-based implementation of the classic arcade game, built to demonstrate core web development and game programming concepts. This project leverages modern JavaScript to recreate the iconic 1978 gameplay.\n\n##  Program Overview \u0026 Functionality  \n**Core Systems**:  \n1. **Game Loop**: `requestAnimationFrame`-driven updates  \n2. **Entity Management**: Player, enemies, bullets  \n3. **Collision Detection**: Grid-based hit checks  \n4. **State Machine**: Pause/play/win/loss states  \n5. **Rendering Pipeline**: DOM manipulation for visuals  \n\n**Key Interactions**:  \n- Player movement via keyboard events  \n- Real-time bullet trajectory calculations  \n- Dynamic enemy formation adjustments  \n\n## Features  \n- Classic enemy wave patterns with modern CSS animations  \n- Score tracking \u0026 lives system  \n- Responsive pause/restart functionality  \n- Frame-rate independent movement  \n- Visual feedback for hits (explosion effects)  \n\n##  Installation \u0026 Setup  \n1. Clone repo:  \n   ```bash\n   git clone https://github.com/kh3rld/make-your-game.git\n   ```\n2. Open `index.html` in any modern browser  \n3. No build tools required - pure JS/CSS/HTML!\n\n##  Learning Objectives  \n\n###  **requestAnimationFrame**  \n- Used in `gameLoop()` for browser-optimized rendering  \n- Synchronizes with display refresh rate (vs `setInterval`)  \n- Example:  \n  ```javascript\n  function gameLoop() {\n    requestAnimationFrame(gameLoop);\n    // Update logic\n  }\n  ```\n\n###  **Event Loop**  \n- Browser's main thread handling:  \n  - Input events → Game state updates → Rendering  \n- Demonstrated in keyboard input handling:  \n  ```javascript\n  document.addEventListener('keydown', handleInput);\n  ```\n\n###  **FPS Management**  \n- Target 60 FPS via delta timing:  \n  ```javascript\n  const FRAME_INTERVAL = 1000 / 60; // 16.67ms per frame\n  if (deltaTime \u003c FRAME_INTERVAL) return;\n  ```\n\n###  **DOM Manipulation**  \n- Grid creation:  \n  ```javascript\n  for (let i = 0; i \u003c 225; i++) {\n    grid.appendChild(document.createElement('div'));\n  }\n  ```\n- Dynamic class updates for rendering:  \n  ```javascript\n  squares[pos].classList.add('enemy');\n  ```\n\n###  **Jank Prevention**  \n- Techniques used:  \n  - Batch DOM updates in `render()`  \n  - CSS `transform` for animations (GPU-accelerated)  \n  - Avoid synchronous layout thrashing  \n\n###  **CSS Transform/Opacity**  \n- Smoother animations via GPU offloading:  \n  ```css\n  .enemy {\n    transition: transform 0.15s ease-in-out;\n  }\n  .boom {\n    opacity: 0;\n    transform: scale(1.5);\n  }\n  ```\n\n###  **Browser Rendering Pipeline**  \n1. **JavaScript**: Game state updates  \n2. **Styles**: CSS rule calculations  \n3. **Layout**: Position calculations  \n4. **Paint**: Pixel filling (minimized via layers)  \n5. **Composite**: Layer merging (GPU-optimized)  \n\n###  **Developer Tools**  \n- **Chrome/Firefox**:  \n  - Performance profiling (identify frame drops)  \n  - Layout inspector (debug grid positioning)  \n  - Frame debugger (break down rendering steps)  \n\n##  Contribution  \nContributions are welcome, feel free to  create a branch with your awesome  update or feature and submit a pull request\n\n**Process**:  \n1. Fork repository  \n2. Create feature branch  \n3. Submit PR with detailed description  \n\n## Authors  \n- Khalid Hussein\n- Ray Muiruri\n- Sheila Fana\n\n\n\n##  License  \nMIT License - See [LICENSE.md](LICENSE.md)  \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkh3rld%2Fmake-your-game","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkh3rld%2Fmake-your-game","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkh3rld%2Fmake-your-game/lists"}