Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initialize a new binary crate ```shell cargo init boxes ``` Add bevy as a dependency using cargo-edit. ```shell cargo add bevy ``` Bring the bevy prelude into scope in `src/main.rs` ```rust use bevy::prelude::*; ``` A prelude is a common term for "things the crate author thinks you'll need most of the time when using their crate". Instead of manually bringing everything we want into scope using it's own module path, which can get tiring, we can bring everything from the prelude into scope using `*`. Since a prelude is usually only re-exporting functions from the rest of the crate, this gives us easier access to what we would've needed anyway. Bevy games are called "App"s and are constructed using a builder pattern. In this case we use [`App::build()`](https://docs.rs/bevy/0.5.0/bevy/app/struct.App.html) to kick off the builder, then we add the `DefaultPlugins` from the bevy prelude, and finally `.run()` executes the application. ```rust fn main() { App::build().add_plugins(DefaultPlugins).run() } ``` Bevy by itself doesn't do much because it allows us to add all of the functionality we want via plugins. These plugins can come from the project itself or third party crates. `DefaultPlugins` is a group of plugins that handle core bevy functionality such as enabling the window holding our game to show, handling user keyboard input, or diagnostics and logging. You could imagine scenarios where we wouldn't want to render a window, such as if we were running bevy on a server in a multiplayer game. Running this program shows us a window with the title `bevy` and no content. Seeing this window means everything is set up appropriately.
- Loading branch information