Coder Social home page Coder Social logo

puzzle-potential's Introduction

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/windows/icon.ico (used for windows executable and as favicon for the web-builds)
  2. 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 macos directory) - Warning: sadly this seems to require a mac...

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.

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 to keep up to date with the development and get feedback + 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).

puzzle-potential's People

Contributors

dependabot[bot] avatar killercup avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.