Last active
June 25, 2025 23:17
-
-
Save bones-ai/96f165f9206261dd5561338b571c64cd to your computer and use it in GitHub Desktop.
An basic empty bevy app template with all the plugins I use
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use bevy::diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin}; | |
use bevy::prelude::*; | |
use bevy::window::close_on_esc; | |
const WW: f32 = 1200.0; | |
const WH: f32 = 900.0; | |
const BG_COLOR: (u8, u8, u8) = (25, 20, 43); | |
fn main() { | |
App::new() | |
.add_plugins( | |
DefaultPlugins | |
.set(ImagePlugin::default_nearest()) | |
.set(WindowPlugin { | |
primary_window: Some(Window { | |
resizable: true, | |
focused: true, | |
resolution: (WW, WH).into(), | |
..default() | |
}), | |
..default() | |
}), | |
) | |
.insert_resource(ClearColor(Color::rgb_u8( | |
BG_COLOR.0, BG_COLOR.1, BG_COLOR.2, | |
))) | |
.insert_resource(Msaa::Off) | |
.add_plugins(LogDiagnosticsPlugin::default()) | |
.add_plugins(FrameTimeDiagnosticsPlugin) | |
.add_systems(Startup, setup) | |
.add_systems(Update, close_on_esc) | |
.run(); | |
} | |
fn setup(mut commands: Commands) { | |
commands.spawn(Camera2dBundle::default()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Initial setup that goes into
cargo.toml