• Stars
    star
    795
  • Rank 57,274 (Top 2 %)
  • Language
    Rust
  • License
    Creative Commons ...
  • Created over 3 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Template for a Bevy game including CI/CD for web, Windows, Linux, macOS, iOS and Android

A Bevy game template

Template for a Game using the awesome Bevy engine featuring out of the box builds for Windows, Linux, macOS, and Web (Wasm).

Since Bevy is in heavy development, there regularly are unpublished new features or bug fixes. If you like living on the edge, you can use the branch bevy_main of this template to be close to the current state of Bevy's main branch

What does this template give you?

  • small example "game" (warning: biased; e.g., split into a lot of plugins and using bevy_kira_audio for sound)
  • easy setup for running the web build using trunk (trunk serve)
  • run the native version with cargo run
  • workflow for GitHub actions creating releases for Windows, Linux, macOS, and Web (Wasm) ready for distribution
    • push a tag in the form of v[0-9]+.[0-9]+.[0-9]+* (e.g. v1.1.42) to trigger the flow
    • WARNING: if you work in a private repository, please be aware that macOS and Windows runners cost more build minutes. You might want to consider running the workflow less often or removing some builds from it. For public repositories the builds are free!

How to use this template?

  1. Click "Use this template" on the repository's page
  2. Look for ToDo to use your own game name everywhere
  3. Update the icons as described below
  4. Start coding 🎉
    • Start the native app: cargo run
    • Start the web build: trunk serve
      • requires trunk: cargo install --locked trunk
      • requires wasm32-unknown-unknown target: rustup target add wasm32-unknown-unknown
      • this will serve your app on 8080 and automatically rebuild + reload it after code changes

You should keep the credits directory up to date. The release workflow automatically includes the directory in every build.

Updating the icons

  1. Replace build/macos/icon_1024x1024.png with a 1024 times 1024 pixel png icon and run create_icns.sh (make sure to run the script inside the build/macos directory) - Note: this requires a mac
  2. Replace build/windows/icon.ico (used for windows executable and as favicon for the web-builds)
    • You can create an .ico file for windows by following these steps:
      1. Open macos/AppIcon.iconset/icon_256x256.png in Gimp
      2. Select the File > Export As menu item.
      3. Change the file extension to .ico (or click Select File Type (By Extension) and select Microsoft Windows Icon)
      4. Save as build/windows/icon.ico

Deploy web build to GitHub pages

  1. Trigger the deploy-github-page workflow
  2. Activate GitHub pages for your repository
    1. Source from the gh-pages branch (created by the just executed action)
  3. After a few minutes your game is live at http://username.github.io/repository

To deploy newer versions, just run the deploy-github-page workflow again.

Note that this does a cargo build and thus does not work with local dependencies. Consider pushing your "custom Bevy fork" to GitHub and using it as a git dependency.

Getting started with Bevy

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.

Known issues

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).

License

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 / @[email protected] ).

More Repositories

1

bevy_asset_loader

Bevy plugin helping with asset loading and organization
Rust
467
star
2

bevy_kira_audio

A Bevy plugin to use Kira for game audio
Rust
336
star
3

bevy_common_assets

Collection of generic asset loaders for common file formats
Rust
180
star
4

oicana

Tower defence game with some puzzling
Rust
56
star
5

cinnog

Experimental static site generator using Leptos with Bevy ECS as a data layer
Rust
34
star
6

gamebox

Minecraft plugin with a vast selection of inventory games
Java
13
star
7

wasm-opt-action

Rust
9
star
8

calendarevents

Minecraft plugin for customized events called at specific dates/times
Java
8
star
9

jekyll_custom_permalink

Jekyll plugin adding support for any Front Matter in permalinks
Ruby
8
star
10

wicked_potions

Rust
7
star
11

jekyll-exif-data

Jekyll plugin to supply websites with exif data from images
Ruby
6
star
12

clempire

Idle game
JavaScript
5
star
13

cinnog_example

Rust
4
star
14

leptos-ssg-with-islands

Rust
3
star
15

the_chase

Rust
2
star
16

nmsutilities

Java
2
star
17

LMGTFY

Bukkit plugin that adds commands for lmgtfy and search engines
Java
2
star
18

friends_vs_zombies

Rust
2
star
19

bevy_jam2

Rust
2
star
20

games-nikl-me

Website with html5 games for my telegram bot
JavaScript
2
star
21

start-axum-workspace-islands-ssg

Rust
2
star
22

gemcrush-for-gamebox

Game for GameBox inspired by Candycrush
Java
1
star
23

cookieclicker-for-gamebox

Cookie Clicker for GameBox
Java
1
star
24

node-chess

A node chess server for playing matches in telegram
JavaScript
1
star
25

NiklsAwesomeBot

Telegram bot serving a few puzzle games
JavaScript
1
star
26

calendarevents-example

Small example usage of the API provided by CalendarEvents
Java
1
star
27

html5-sudoku

JavaScript
1
star
28

test-expo-router

TypeScript
1
star
29

connectfour-for-gamebox

Inventory game ConnectFour for GameBox
Java
1
star
30

dots-and-boxes-python

Dots and Boxes written in Python
Python
1
star
31

me_and_my_unicycle

Rust
1
star
32

gfi_bevy_talk

CSS
1
star