Here are a few cargo-generate templates for use when creating bevy applications

Overview

Bevy-template-rs

Here are a few cargo-generate templates for use when creating bevy applications.

Templates

Game

This is a template for starting a new game.

  • Binary
  • Latest (0.6) Bevy version, or GitHub main version (as a patch), are both supported.
  • The template can optionally setup the project for using "fast compiles" as described in The Bevy Book.
  • Basic GitHub workflow for building/testing the resulting project
  • Code example for doing integration tests
  • VSCode launch configuration for executable/unit-tests and integration test
  • VSCode tasks

lib-plugin

A simple template for creating a plugin with Bevy.

  • Library
  • Code example for doing integration tests
  • VSCode launch configuration for debugging unit and integration tests
  • VSCode tasks

lib-assets

A library for hosting embedded assets by utilizing the Bevy-Embasset crate.

  • Library
  • Assets folder for assets that should be embedded
  • VSCode launch configuration for debugging unit-tests
  • VSCode tasks

Usage

cargo generate taurr/bevy-template-rs

Template expansion

Requirements

cargo-generate must be installed. The easiest way to do this is:

cargo install cargo-generate

Tips'n'tricks

If the template is used on a regular basis, cargo-generate allows to setup favorite templates and default variables.

To do this, open or create the file $CARGO_HOME/cargo-generate.toml, insert this:

[favorites.bevy]
path = "taurr/bevy-template-rs"

After this, the template can be expanded using a simple:

cargo generate bevy
Comments
  • Minimal template for testing and messing around

    Minimal template for testing and messing around

    Quite often i find myself in need of a minimal bevy project for testing something, helping others or just messing around.

    Sadly i wasn't able to disable git initialisation, see: https://github.com/cargo-generate/cargo-generate/issues/635

    This PR adds that minimal setup, with fast compiles always enabled and no other bells or whistles.

    • [x] "Minimal" Template
    • [ ] update README.md
    • [ ] update CHANGELOG.md
    opened by laundmo 5
  • Confusing crate/workflow option on initial generation

    Confusing crate/workflow option on initial generation

    With the intention of creating a standalone game using the bevy engine, I ran cargo generate taurr/bevy-template-rs --name tbev2.

    I was asked

    ⚠️   Favorite `taurr/bevy-template-rs` not found in config, using it as a git repository: https://github.com/taurr/bevy-template-rs.git
    ? 🤷   Which sub-template should be expanded? ›
    ❯ Crate
      Workflow
    

    I really had no idea what to do here. I'm building a game / binary, not something that I intend to publish as a crate. I do want github workflows though, so I selected "Workflow"

    But this just created a .github directory right in my ~/src directory.

    I then selected "Crate" instead and got what seems to be a game project going. However, there are docs.rs and crates.io links in the generated README.md which don't seem appropriate for a non-library.

    So I'm just pretty confused by all of this.

    opened by rparrett 3
  • the colon in the variable prefix is not needed

    the colon in the variable prefix is not needed

    https://github.com/taurr/bevy-template-rs/blob/4834251e9b274d2fdeeccf11e60a2e509bb64b36/cargo-generate.toml#L12

    the : is rendered already by cargo-generate.

    opened by sassman 1
  • Invalid PNG warning in new project

    Invalid PNG warning in new project

    Generated a project like this:

     cargo generate taurr/bevy-template-rs --name tbev
    ⚠️   Favorite `taurr/bevy-template-rs` not found in config, using it as a git repository: https://github.com/taurr/bevy-template-rs.git
    ✔ 🤷   Which sub-template should be expanded? · Crate
    🔧   Destination: /Users/robparrett/src/tbev ...
    🔧   Generating template ...
    🤷   Github Username? : rparrett
    ✔ 🤷   Camera type? · 2D
    ✔ 🤷   Which IDE to use? · vscode
    [ 1/13]   Done: .gitignore
    [ 2/13]   Done: .vscode/launch.json
    [ 3/13]   Done: .vscode/tasks.json
    [ 4/13]   Done: .vscode
    [ 5/13]   Done: Cargo.toml.liquid
    [ 6/13]   Done: README.md
    [ 7/13]   Done: assets/.keepme
    [ 9/13]   Done: assets/icon.png
    [10/13]   Done: assets
    [11/13]   Ignored: final-msg.rhai
    [12/13]   Done: src/main.rs
    [13/13]   Done: src
    🔧   Moving generated files into: `/Users/robparrett/src/tbev`...
    💡   Initializing a fresh Git repository
    ✨   Done! New project created /Users/robparrett/src/tbev
    

    And launched with cargo run and received this warning in the console:

    2022-08-02T19:05:26.049930Z  WARN bevy_asset::asset_server: encountered an error while loading an asset: Error reading image file icon.png: failed to load an image: Format error decoding Png: Invalid PNG signature., this is an error in `bevy_render`.
    

    icon.png seems to be a git-lfs thing. Is git-lfs required? Should that be documented somewhere?

    opened by rparrett 0
  • Create GH action for checking that the template

    Create GH action for checking that the template "builds"

    cargo-generate has a GH action for expanding the template directly. Use this for expanding the template in all configurations, and verify that each one at least builds.

    opened by taurr 0
Releases(v1.6.0)
  • v1.6.0(Nov 20, 2022)

    All templates are now updated for Bevy 0.9.

    Binary and Library templates now both contain a small integration test setup, utilizing Bevy in headless mode. This enables more elaborate tests as Bevy is actually running - though without window and renderer!

    Source code(tar.gz)
    Source code(zip)
  • v1.5.0(Aug 5, 2022)

  • v1.0.0(Jan 17, 2022)

    Templates for Bevy projects, initial release, now in the wild!

    Read the README - it says it all 😄

    Full Changelog: https://github.com/taurr/bevy-template-rs/commits/v1.0.0

    Source code(tar.gz)
    Source code(zip)
Owner
Johnny Tidemand Vestergaard
Rust entusiast since 2019. SW Designer and consultant by trade. Father & husband by heart!
Johnny Tidemand Vestergaard
cargo extension for flashing embedded rust programs via dfu based on jacobrosenthals cargo-hf2

cargo-dfu This crate provides a cargo subcommand to flash ELF binaries via dfu Most STM chips will probably work with this, although you might need to

Roman Kretschmer 0 Feb 6, 2022
cargo-check This is a wrapper around cargo rustc

cargo-check This is a wrapper around cargo rustc -- -Zno-trans. It can be helpful for running a faster compile if you only need correctness checks. In

Ray Solomon 99 Oct 13, 2022
Just toying with rust, nothing to see here :)

Just toying with rust, nothing to see here :)

Alexander Schüssler 1 Feb 24, 2022
Powerfull Discord Raid Bot written in Rust, use VPN / Proxy because creating 200 channels in 10s Will ratelimit you.

Harakiri-Rust This the first Discord Raid Bot made in RustLang I recommend you use with a VPN or a Proxy to evade Discord Ratelimit. If bot doesn't st

Marco 6 May 1, 2023
Quick templates script for codeforces contests.

Codeforces Template Tool I created this tool to help me quickly set up codeforces contests/singular problems with templates. Tested for windows, shoul

null 1 Jun 2, 2022
A example bevy application using bevy-kajiya for its renderer

☀️ bevy-kajiya playground A example bevy application using bevy-kajiya for its renderer NOTE: only tested on Windows. For more context, check out the

Sebastian Hamel 20 Dec 5, 2022
Frame is a markdown language for creating state machines (automata) in 7 programming languages as well as generating UML documentation.

Frame Language Transpiler v0.5.1 Hi! So very glad you are interested in Frame. Frame system design markdown language for software architects and engin

Mark Truluck 35 Dec 31, 2022
A library for creating/parsing Serenity slash commands.

Serenity Commands A library for creating/parsing Serenity slash commands. Usage See the examples directory for more examples. use serenity::all::{

Vidhan Bhatt 4 Dec 9, 2023
Cargo - The Rust package manager

Cargo downloads your Rust project’s dependencies and compiles your project.

The Rust Programming Language 9.5k Jan 4, 2023
Wally is a modern package manager for Roblox projects inspired by Cargo

Wally is a package manager for Roblox inspired by Cargo (Rust) and npm (JavaScript). It brings the familiar, community-oriented world of sharing code from other communities into the Roblox ecosystem.

Uplift Games 194 Jan 3, 2023
Demonstration of an issue with cargo-udeps

the setup lib1 exports a function lib2 contains a dependency to lib1, and calls into lib1's method binary contains a dependency to lib2, and uses it b

Benjamin Bouvier 1 Nov 28, 2021
Minimal cargo but for c/c++

Introduction We all love cargo, having an idea, do cargo new, type our idea and cargo r, easy right? Well... sometimes you want to do that in C or C++

cdecompilador 6 Oct 31, 2022
This crate provides a convenient macro that allows you to generate type wrappers that promise to always uphold arbitrary invariants that you specified.

prae This crate provides a convenient macro that allows you to generate type wrappers that promise to always uphold arbitrary invariants that you spec

null 96 Dec 4, 2022
Generate markdown footer links.

WIP Generate markdown footer links.

Arijit Basu 8 Nov 20, 2022
Generate manual pages from mdBooks!

mdbook-man Generate man pages from mdBooks! Usage To use mdbook-man you'll first need to install it with: $ cargo install mdbook-man And add the follo

Wojciech Kępka 22 Oct 6, 2022
Rust crate to generate, manipulate and traverse trees.

SOCAREL Rust crate to generate, manipulate and traverse trees. It provides iterators for eight different traversal algorithms. Add and remove nodes in

Andreu 8 Nov 14, 2021
Generate nginx vhosts for mlcdf/cc-reverve-proxy

nvhosts Generate nginx vhosts given a configuration file. Made to work with mlcdf/cc-reverse-proxy. Usage Usage: nvhosts [-c <config>] [--example] [-V

Maxime Le Conte des Floris 0 Feb 28, 2022
Ampseer examines reads in fastq format and identifies which multiplex PCR primer set was used to generate the SARS-CoV-2 sequencing library they are read from.

Ampseer examines reads in fastq format and identifies which multiplex PCR primer set was used to generate the SARS-CoV-2 sequencing library they are read from.

New England Biolabs Inc. 7 Nov 2, 2022
Generate permutations & combinations

Pincer Generate permutations and combinations of sets of elements. Inspired by crunch. Usage: Multiple functions are provided with this Rust library.

null 4 Nov 20, 2022