initial commit.

main
Nick Forrer 2 years ago
commit 66d38616a3
  1. 36
      .cargo/config.toml
  2. 1
      .gitignore
  3. 3862
      Cargo.lock
  4. 18
      Cargo.toml
  5. 3
      rust-toolchain.toml
  6. 32
      src/main.rs

@ -0,0 +1,36 @@
# Add the contents of this file to `config.toml` to enable "fast build" configuration. Please read the notes below.
# NOTE: For maximum performance, build using a nightly compiler
# If you are using rust stable, remove the "-Zshare-generics=y" below.
[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-Clink-arg=-fuse-ld=lld", "-Zshare-generics=y"]
# NOTE: you must install [Mach-O LLD Port](https://lld.llvm.org/MachO/index.html) on mac. you can easily do this by installing llvm which includes lld with the "brew" package manager:
# `brew install llvm`
[target.x86_64-apple-darwin]
rustflags = [
"-C",
"link-arg=-fuse-ld=/usr/local/opt/llvm/bin/ld64.lld",
"-Zshare-generics=y",
]
[target.aarch64-apple-darwin]
rustflags = [
"-C",
"link-arg=-fuse-ld=/opt/homebrew/opt/llvm/bin/ld64.lld",
"-Zshare-generics=y",
]
[target.x86_64-pc-windows-msvc]
linker = "rust-lld.exe"
rustflags = ["-Zshare-generics=n"]
# Optional: Uncommenting the following improves compile times, but reduces the amount of debug info to 'line number tables only'
# In most cases the gains are negligible, but if you are on macos and have slow compile times you should see significant gains.
#[profile.dev]
#debug = 1

1
.gitignore vendored

@ -0,0 +1 @@
/target

3862
Cargo.lock generated

File diff suppressed because it is too large Load Diff

@ -0,0 +1,18 @@
[package]
name = "bevy_template"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
bevy = { version = "0.10.1", features = ["dynamic_linking"] }
bevy-inspector-egui = "0.18.3"
[profile.dev]
opt-level = 1
[profile.dev.package."*"]
opt-level = 3

@ -0,0 +1,3 @@
[toolchain]
channel = "nightly"

@ -0,0 +1,32 @@
use bevy::prelude::*;
use bevy_inspector_egui::quick::WorldInspectorPlugin;
#[derive(Resource, Default)]
struct GameDebug {
show_debug_windows: bool,
}
fn run_if_debug(game_debug: Res<GameDebug>) -> bool {
game_debug.show_debug_windows
}
fn player_debug_input(keyboard: Res<Input<KeyCode>>, mut game_debug: ResMut<GameDebug>) {
if keyboard.just_pressed(KeyCode::Tab) {
game_debug.show_debug_windows = !game_debug.show_debug_windows;
}
}
fn setup_camera(mut commands: Commands) {
commands.spawn(Camera2dBundle::default());
}
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugin(WorldInspectorPlugin::new().run_if(run_if_debug))
.insert_resource(GameDebug::default())
.add_startup_system(setup_camera)
.add_system(player_debug_input)
.run();
}
Loading…
Cancel
Save