{"id":13344074,"url":"https://github.com/daneelsan/Dodgeballz","last_synced_at":"2025-03-12T06:31:10.507Z","repository":{"id":133848793,"uuid":"483136735","full_name":"daneelsan/Dodgeballz","owner":"daneelsan","description":"A mini game using Zig, WASM and JS","archived":false,"fork":false,"pushed_at":"2023-09-04T21:43:47.000Z","size":1038,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-09T01:51:45.201Z","etag":null,"topics":["html5-canvas","webassembly","zig"],"latest_commit_sha":null,"homepage":"","language":"Zig","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/daneelsan.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":"2022-04-19T07:13:46.000Z","updated_at":"2024-03-11T10:04:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"89b25576-2886-4527-be84-4aea90ffadce","html_url":"https://github.com/daneelsan/Dodgeballz","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daneelsan%2FDodgeballz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daneelsan%2FDodgeballz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daneelsan%2FDodgeballz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daneelsan%2FDodgeballz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daneelsan","download_url":"https://codeload.github.com/daneelsan/Dodgeballz/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243171622,"owners_count":20247877,"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":["html5-canvas","webassembly","zig"],"created_at":"2024-07-29T19:32:20.125Z","updated_at":"2025-03-12T06:31:10.501Z","avatar_url":"https://github.com/daneelsan.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DodgeBallz\n\nPlay the game at: https://daneelsan.github.io/Dodgeballz/\n\n[DodgeBalls](https://github.com/daneelsan/DodgeBalls) implemented in zig (compiled to wasm-freestanding).\n\nThis mini game shows how Zig, WASM, Javascript and HTML5 canvas can interact.\n\nIn particular, there are lots of back and forth between imported and exported wasm functions.\nAmong those imported functions are functions that draw things on a canvas, e.g. `arc` or `strokeRect`.\n\n![dodgeballz](./dodgeballz.gif)\n\n## Build\n\nTested in version:\n\n```shell\n$ zig version\n0.14.0\n```\n\nTo build the wasm module, run:\n\n```shell\n$ zig build\n\n$ ls zig-out/lib/\nDodgeBallz.wasm\n```\n\n## Run\n\nStart up the server in this repository's directory:\n\n```shell\npython3 -m http.server\n```\n\nGo to your favorite browser and type to the URL `localhost:8000`. You should see the checkboard changing colors.\n\n## TODOs\n\n-   Find a better way to debug from the wasm module. I used a lot of `console.log` to debug, but given that we can only pass a limited set of types between JS and WASM (e.g. `i32` or `f32`), this was tedious. Perhaps there is a way to write a zig `Writer` that writes into the console.\n\n-   Of course, there are many improvements to the game. The score could be made to depend on the size of the enemy, the number of enemies could increase depending on the score achieved, etc.\n\n## Resources\n\n-   https://github.com/daneelsan/DodgeBalls\n-   https://github.com/daneelsan/minimal-zig-wasm-canvas\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaneelsan%2FDodgeballz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaneelsan%2FDodgeballz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaneelsan%2FDodgeballz/lists"}