{"id":20846742,"url":"https://github.com/kimgoetzke/rusteroids","last_synced_at":"2025-10-30T22:43:39.513Z","repository":{"id":247571407,"uuid":"825353579","full_name":"kimgoetzke/rusteroids","owner":"kimgoetzke","description":"An Asteroids-like mini game written in Rust.","archived":false,"fork":false,"pushed_at":"2024-09-07T06:23:17.000Z","size":8058,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-12T11:48:57.020Z","etag":null,"topics":["bevy","game","nix-flake","pixel-art","rapier2d","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/kimgoetzke.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":"2024-07-07T14:52:26.000Z","updated_at":"2025-03-11T23:55:35.000Z","dependencies_parsed_at":"2024-07-19T00:43:19.459Z","dependency_job_id":"21c8c03e-8239-48b0-bc6b-5548748afa84","html_url":"https://github.com/kimgoetzke/rusteroids","commit_stats":null,"previous_names":["kimgoetzke/rusteriods","kimgoetzke/rusteroids"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kimgoetzke/rusteroids","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimgoetzke%2Frusteroids","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimgoetzke%2Frusteroids/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimgoetzke%2Frusteroids/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimgoetzke%2Frusteroids/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kimgoetzke","download_url":"https://codeload.github.com/kimgoetzke/rusteroids/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimgoetzke%2Frusteroids/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281896643,"owners_count":26580138,"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-10-30T02:00:06.501Z","response_time":61,"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":["bevy","game","nix-flake","pixel-art","rapier2d","rust"],"created_at":"2024-11-18T02:17:48.178Z","updated_at":"2025-10-30T22:43:39.489Z","avatar_url":"https://github.com/kimgoetzke.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rusteroids\n\nThis is a basic Asteroids-like game written in Rust, using Bevy engine and Rapier2d. The purpose of this project was to\nlearn Rust in a playful way. This the first time I'm looking at Rust (and Bevy), so there will be a million things\nthat could have been done in a better and more idiomatic way.\n\n[\u003cimg src=\"assets/ignore/itcho_io_button.png\"\u003e](https://captainhindsight.itch.io/rusteroids)\n\n## Demo\n\n![Demo GIF](assets/ignore/demo.gif)\n\n## Features\n\n- Infinite wave system with increasing difficulty\n- Power-ups that upgrade weapons and shield\n- Single-button menu to exit the game :-)\n- Some basic SFX\n- Collision system powered by `bevy_rapier2d`\n- Particles powered by `bevy_enoki`\n- Parallax background effect\n\n## Attribution\n\nThe in-game (non-UI) font is Bulky Pixels by John Bloor's [Smoking Drum ](http://www.smokingdrum.com) (domain no longer\nactive but required by license).\n\nAudio files from [Pixabay](https://pixabay.com) under a CC0 license, Dustyroom's Casual Game Sound - One Shot SFX Pack\nunder a CC0 license, or created by myself.\n\n## How to develop\n\n### Using Nix Flakes, JetBrains RustRover \u0026 Direnv\n\nYou can run this project in any way you like, but I have set things up to make it easy to develop using JetBrains\nRustRover. For this, you'll need:\n\n- `direnv`\n- Any Direnv integration plugin e.g. https://plugins.jetbrains.com/plugin/15285-direnv-integration\n- `nix`\n\nThis way, you'll just need to `direnv allow` in the project directory after which all prerequisites (incl. Rust, Cargo,\nall Bevy dependencies, etc.) will be available to you. The JetBrains plugin will ensure that the environment is\navailable to your IDE and you can run the project from there (vs `cargo build` and `cargo run` in the terminal).\n\n### Using Nix Flakes\n\nWithout `direnv`, you can use the Nix Flake by running `nix develop` in the project directory. If you want to use an IDE\nsuch as JetBrains RustRover, you'll have to set up the environment manually. You'll most likely have to make\n`LD_LIBRARY_PATH` available to your IDE.\n\n### Reminders\n\n- Create a run configuration with environment variable `RUST_LOG=rusteroids=debug` for debug logs e.g. damage,\n  collisions, explosions\n- Create a run configuration with `--features dev` to enable `RapierDebugRenderPlugin` and `WorldInspectorPlugin`\n\n## How to build WASM for the web\n\n#### Prerequisites\n\n1. Run:\n   ```shell\n   rustup target add wasm32-unknown-unknown\n   ```\n2. Set `RUSTFLAGS`\n    1. **Linux**:\n       ```bash\n       export RUSTFLAGS=\"--cfg=web_sys_unstable_apis\"\n       ```\n    2. **Windows**:\n       ```powershell\n       $env:RUSTFLAGS=\"--cfg=web_sys_unstable_apis\"\n       ```\n3. Make sure you have Node.js with `serve` installed\n\n#### Building\n\nThen you can build the WASM file:\n\n1. Build the WASM file:\n   ```shell\n   cargo build --target wasm32-unknown-unknown --release\n   ```\n2. Clean the `www/public` directory and copy the game's assets over:\n   ```powershell\n   ./scripts/clean-rusteroids-files.ps1 # Windows only, bash script may be coming later\n   ./scripts/copy-assets.ps1   # Windows only, bash script may be coming later\n   ```\n3. Run `wasm-bindgen` to generate the JS bindings and move all relevant files to the `www/public` directory:\n    1. **Linux**:\n       ```shell\n       wasm-bindgen --out-dir ./www/public --target web ./target/wasm32-unknown-unknown/release/rusteroids.wasm\n       ```\n    2. **Windows**:\n       ```powershell\n       wasm-bindgen.exe --out-dir ./www/public --target web ./target/wasm32-unknown-unknown/release/rusteroids.wasm\n       ```\n\n#### Optimising\n\nYou can optimise the WASM file (from the\n[Unofficial Bevy Cheat Book](https://bevy-cheatbook.github.io/platforms/wasm/size-opt.html)):\n\n   ```shell\n   # Optimize for size (z profile).\n   wasm-opt -Oz -o output.wasm input.wasm\n   \n   # Optimize for size (s profile).\n   wasm-opt -Os -o output.wasm input.wasm\n   \n   # Optimize for speed.\n   wasm-opt -O3 -o output.wasm input.wasm\n   \n   # Optimize for both size and speed.\n   wasm-opt -O -ol 100 -s 100 -o output.wasm input.wasm\n   ```\n\n#### Running\n\nFinally, to run the game in your browser locally, run the below and paste the URL copied to your clipboard into your\nbrowser:\n\n```shell\nnpx serve ./www/public\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkimgoetzke%2Frusteroids","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkimgoetzke%2Frusteroids","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkimgoetzke%2Frusteroids/lists"}