Template for a Game using the awesome Bevy engine featuring out of the box builds for Windows, Linux, macOS, Web (Wasm), Android, and iOS.
trunk serve
) cargo run
v[0-9]+.[0-9]+.[0-9]+*
(e.g. v1.1.42
) to trigger the flowWARNING: if you work in a private repository, please be aware that macOS and Windows runners cost more build minutes. For public repositories the workflow runners are free!
ToDo
to use your own game name everywherecargo run
trunk serve
cargo install --locked trunk
wasm32-unknown-unknown
target: rustup target add wasm32-unknown-unknown
8080
and automatically rebuild + reload it after code changescargo apk run -p mobile
Preferences > Platforms
later)rustup target add aarch64-apple-ios x86_64-apple-ios aarch64-apple-ios-sim
make run
inside the /mobile
directoryYou should keep the credits
directory up to date. The release workflow automatically includes the directory in every build.
build/macos/icon_1024x1024.png
with a 1024
times 1024
pixel png icon and run create_icns.sh
or create_icns_linux.sh
if you use linux (make sure to run the script inside the build/macos
directory) - _Note: create_icns.sh
requires a mac, and create_icns_linux.sh
requires imagemagick and png2icns_build/windows/icon.ico
(used for windows executable and as favicon for the web-builds)
.ico
file for windows by following these steps:
macos/AppIcon.iconset/icon_256x256.png
in GimpFile > Export As
menu item..ico
(or click Select File Type (By Extension)
and select Microsoft Windows Icon
)build/windows/icon.ico
build/android/res/mipmap-mdpi/icon.png
with macos/AppIcon.iconset/icon_256x256.png
, but rename it to icon.png
deploy-github-page
workflowgh-pages
branch (created by the just executed action)http://username.github.io/repository
To deploy newer versions, just run the deploy-github-page
workflow again.
For general info on mobile support, you can take a look at one of my blog posts about mobile development with Bevy which is relevant to the current setup.
Currently, cargo-apk
is used to run the development app. But APKs can no longer be published in the store and cargo-apk
cannot produce the required AAB. This is why there is setup for two android related tools. In mobile/Cargo.toml
, the package.metadata.android
section configures cargo-apk
while mobile/manifest.yaml
configures a custom fork of xbuild
which is used in the release-android-google-play
workflow to create an AAB.
There is a post about how to set up the android release workflow on my blog.
The setup is pretty much what Bevy does for the mobile example.
There is a post about how to set up the iOS release workflow on my blog.
If you don't want to target Android or iOS, you can just delete the /mobile
, /build/android
, and /build/ios
directories.
Then delete the [workspace]
section from Cargo.toml
.
You should check out the Bevy website for links to resources and the Bevy Cheat Book for a bunch of helpful documentation and examples. I can also recommend the official Bevy Discord server for keeping up to date with the development and getting help from other Bevy users.
Audio in web-builds can have issues in some browsers. This seems to be a general performance issue and not due to the audio itself (see bevy_kira_audio/#9).
This project is licensed under CC0 1.0 Universal except some content of assets
and the Bevy icons in the build
directory (see Credits). Go crazy and feel free to show me whatever you build with this (@nikl_me / @nikl_me@mastodon.online ).