{"id":13733134,"url":"https://github.com/ggez/good-web-game","last_synced_at":"2025-04-12T14:58:08.721Z","repository":{"id":37854641,"uuid":"168157558","full_name":"ggez/good-web-game","owner":"ggez","description":"An alternative ggez implementation on top of miniquad.","archived":false,"fork":false,"pushed_at":"2024-05-24T18:31:00.000Z","size":1777,"stargazers_count":339,"open_issues_count":16,"forks_count":31,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-12T14:58:03.484Z","etag":null,"topics":["game","gamedev","ggez","rust","wasm","webassembly"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/ggez.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2019-01-29T13:17:02.000Z","updated_at":"2025-03-26T21:20:55.000Z","dependencies_parsed_at":"2024-08-03T03:12:14.722Z","dependency_job_id":null,"html_url":"https://github.com/ggez/good-web-game","commit_stats":{"total_commits":159,"total_committers":13,"mean_commits":12.23076923076923,"dds":0.5786163522012578,"last_synced_commit":"3ebef5da9ad1ce336eac2804904caa0dd9d59323"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ggez%2Fgood-web-game","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ggez%2Fgood-web-game/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ggez%2Fgood-web-game/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ggez%2Fgood-web-game/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ggez","download_url":"https://codeload.github.com/ggez/good-web-game/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248586249,"owners_count":21128997,"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","gamedev","ggez","rust","wasm","webassembly"],"created_at":"2024-08-03T03:00:38.138Z","updated_at":"2025-04-12T14:58:08.698Z","avatar_url":"https://github.com/ggez.png","language":"Rust","funding_links":[],"categories":["Game engines"],"sub_categories":[],"readme":"\u003cimg align=\"right\" width=\"25%\" src=\"about/logo.svg\"\u003e\n\n# Good Web Game\n\n[![Discord chat](https://img.shields.io/discord/710177966440579103.svg?label=discord%20chat)](https://discord.gg/jum3Fjek2A)\n[![Docs Status](https://docs.rs/good-web-game/badge.svg)](https://docs.rs/good-web-game)\n[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/ggez/good-web-game/blob/master/LICENSE)\n[![Crates.io](https://img.shields.io/crates/v/good-web-game.svg)](https://crates.io/crates/good-web-game)\n\ngood-web-game is a wasm32-unknown-unknown implementation of a [ggez](https://github.com/ggez/ggez) subset on top of [miniquad](https://github.com/not-fl3/miniquad/). Originally built to run [Zemeroth](https://github.com/ozkriff/zemeroth) on the web.\n\nIt currently supports most of the ggez 0.7.0 API. If you're already working with ggez you might use this library to port your game to the web (or even mobile).\nSince it also runs well on desktop it also offers an alternative implementation of ggez, which might always come in handy.\n\nIf you are just looking for a well supported, more serious, minimal high-level engine on top of miniquad you might want to take a look at [macroquad](https://github.com/not-fl3/macroquad/).\n\n## Supported Platforms\n\nThe idea behind good-web-game is to offer a way to easily port ggez games to the web and even to mobile platforms. As it's mostly a subset of ggez, porting from good-web-game to ggez is even simpler.\n\n\u003cp align=\"center\" width=\"100%\"\u003e\n    \u003cimg width=\"90%\" src=\"about/supported_platforms.svg\"\u003e\n\u003c/p\u003e\n\nNote that we don't give any guarantees for iOS / macOS support, as we currently simply don't have Macs lying around to test it on. In theory, it _should_ work though.\n\n## Status\n\n\"good-web-game\" implements most of the ggez 0.7.0 API.\n\n### Differences\n\n* boilerplate code differs slightly, [as shown here](https://github.com/PSteinhaus/PSteinhaus.github.io/tree/main/ggez/web-examples#ggez-animation-example)\n* audio API differs somewhat due to use of `quad-snd` instead of `rodio` for easy portability\n* if you want to run on the web, shaders have to be written in GLSL100, due to support for WebGL1\n* API for creation of shaders and their corresponding uniform structs differs slightly, but the workflow remains the same, see [the `shader` example](examples/shader.rs)\n\n### Missing / Not available:\n\n* ggez (and therefore good-web-game) usually loads files in a blocking fashion, which doesn't work on WASM\n  * loading files asynchronously is possible through [`load_file_async`](https://docs.rs/good-web-game/0.5.0/good_web_game/filesystem/fn.load_file_async.html) everywhere though\n* filesystem with writing access (if you need it take a look at [`quad-storage`](https://github.com/optozorax/quad-storage))\n* writing your own event loop (doesn't make much sense on callback-only platforms like HTML5)\n* spatial audio (overall audio support is still relatively limited)\n* resolution control in fullscreen mode\n* setting window position / size (the latter is available on Windows, but buggy)\n* screenshot function\n* window icon\n* gamepad support on WASM (as `gilrs` depends on wasm-bindgen)\n \n## Demo \n\nRunning Zemeroth: \u003chttps://not-fl3.github.io/miniquad-samples/zemeroth.html\u003e\n\n![screen](https://i.imgur.com/TjvCNwa.jpg)\n\nYou can also check out [astroblasto running on the web](https://psteinhaus.github.io/gwg-example/) ([source](https://github.com/PSteinhaus/PSteinhaus.github.io/tree/main/gwg-example)).\n\n## Building for different platforms\n\nTo build and run an example as a native binary:\n\n```\ncargo run --example astroblasto\n```\n\n### WebAssembly\n\n```\nrustup target add wasm32-unknown-unknown\ncargo build --example astroblasto --target wasm32-unknown-unknown\n```\n\nAnd then use the following .html to load .wasm:\n\n\u003cdetails\u003e\u003csummary\u003eindex.html\u003c/summary\u003e\n\n```html\n\u003chtml lang=\"en\"\u003e\n\n\u003chead\u003e\n    \u003cmeta charset=\"utf-8\"\u003e\n    \u003ctitle\u003eTITLE\u003c/title\u003e\n    \u003cstyle\u003e\n        html,\n        body,\n        canvas {\n            margin: 0px;\n            padding: 0px;\n            width: 100%;\n            height: 100%;\n            overflow: hidden;\n            position: absolute;\n            background: black;\n            z-index: 0;\n        }\n    \u003c/style\u003e\n\u003c/head\u003e\n\n\u003cbody\u003e\n    \u003ccanvas id=\"glcanvas\" tabindex='1'\u003e\u003c/canvas\u003e\n    \u003c!-- For now this is just the same js glue macroquad uses: https://github.com/not-fl3/macroquad/tree/master/js --\u003e\n    \u003cscript src=\"https://psteinhaus.github.io/js/js_bundle.js\"\u003e\u003c/script\u003e\n    \u003cscript\u003eload(\"astroblasto.wasm\");\u003c/script\u003e \u003c!-- Your compiled wasm file --\u003e\n\u003c/body\u003e\n\n\u003c/html\u003e\n```\n\u003c/details\u003e\n\nTo run it you need a server. An easy way to start one:\n\n```\ncargo install basic-http-server\nbasic-http-server .\n```\n\n### Android\n\n\nRecommended way to build for android is using Docker.\u003cbr/\u003e\nminiquad uses a slightly modifed version of `cargo-apk`\n\n```\ndocker run --rm -v (your project folder):/root/src -w /root/src notfl3/cargo-apk cargo quad-apk build --example astroblasto\n```\n\nAPK file will be in `target/android-artifacts/(debug|release)/apk`\n\nWith \"log-impl\" enabled all log calls will be forwarded to the adb console.\nNo code modifications for Android required.\n\nNote that all examples starting with numbers (for example `03_drawing.rs`) won't install correctly. You need to remove the leading numbers: `drawing.rs`\n\n### iOS\n\nSee miniquad iOS [sample project](https://github.com/Gordon-F/miniquad_ios_example).\n\n## On blurry graphics\n\nYou may run into somewhat blurry graphics. This is caused by high-dpi rendering:\n\nWhen run on a system with a scaling factor unequal to 1 the graphics may appear blurry, due to the drawbuffer being scaled up, to achieve a window of the size requested by your OS.\nThis size is usually \"the size you specified in `Conf`\" * \"your OS scaling factor\".\n\nTo avoid this set `Conf::high_dpi` to `true`. This leads to the drawbuffer being the size of your actual physical window. It also means though that you can't be sure how big your drawable space will actually be, as this will then depend on where the program is being run.\n\nWe aim towards changing this, so that windows are always created with the physical size specified in `Conf`, but that's not directly supported by miniquad currently.\n\n## Architecture\n\nHere is how `good-web-game` fits into your rust-based game:\n\n![software stack](about/gwg-stack.png?raw=true \"good-web-game software stack\")\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fggez%2Fgood-web-game","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fggez%2Fgood-web-game","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fggez%2Fgood-web-game/lists"}