{"id":25461066,"url":"https://github.com/bkeating/2cars","last_synced_at":"2025-11-03T11:30:39.516Z","repository":{"id":277247312,"uuid":"931607523","full_name":"bkeating/2Cars","owner":"bkeating","description":"An SVG knock-off of a retro-style racing game where the player controls two cars simultaneously","archived":false,"fork":false,"pushed_at":"2025-02-12T22:43:53.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-12T23:29:36.307Z","etag":null,"topics":["game","svelte","svg"],"latest_commit_sha":null,"homepage":"https://bpk-endless.s3.amazonaws.com/2Cars.html","language":"Svelte","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/bkeating.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-12T15:05:30.000Z","updated_at":"2025-02-12T22:46:02.000Z","dependencies_parsed_at":"2025-02-12T23:39:42.285Z","dependency_job_id":null,"html_url":"https://github.com/bkeating/2Cars","commit_stats":null,"previous_names":["bkeating/2cars"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkeating%2F2Cars","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkeating%2F2Cars/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkeating%2F2Cars/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkeating%2F2Cars/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bkeating","download_url":"https://codeload.github.com/bkeating/2Cars/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239413137,"owners_count":19634169,"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":["game","svelte","svg"],"created_at":"2025-02-18T05:22:25.596Z","updated_at":"2025-02-18T05:22:26.314Z","avatar_url":"https://github.com/bkeating.png","language":"Svelte","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 2Cars Game\n\nA retro-style racing game where the player controls two cars simultaneously. Built with Svelte. This game weighs under 20kb, is highly portable (single-file), and runs on any device with a modern web browser.\n\n[Play the demo](https://bpk-endless.s3.amazonaws.com/2Cars.html)\n\n![2Cars Game Screenshot](./screenshot.webp)\n\n## How to Play\n\n- Control two cars simultaneously\n- Left car: Press 'S' key or tap left side of screen\n- Right car: Press 'K' key or tap right side of screen\n- Collect circles for points\n- Avoid squares\n- Press 'P' to pause\n\n## Technical Overview\n\n- **SVG-Based Rendering**: Uses SVG for declarative rendering that automatically scales. All game objects (cars, obstacles, lanes) are SVG primitives composed together.\n\n- **Reactive Game State**: Built with Svelte's reactivity to automatically update visual elements when game state changes. Car positions, obstacle locations, and scrolling road effects are all driven by reactive statements.\n\n- **Game Loop Architecture**: Uses requestAnimationFrame for the main game loop to handle physics, collision detection, scoring, and obstacle spawning. The loop updates game state which triggers reactive UI updates.\n\n- **Cross-Platform Controls**: Playable via both keyboard and touch controls, with transparent touch zones overlaying each side of the screen for mobile play.\n\n## Development\n\n### Installation\n\n```bash\nnpm install\nnpm run dev\nnpm run build  # produces a single-file HTML of the game\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbkeating%2F2cars","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbkeating%2F2cars","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbkeating%2F2cars/lists"}