The WorldSize is a Resource so that I can use it in the entity wrapping system. The size is pulled from a public constant in the config.rs file, and the window is made that same size.
17 lines
446 B
Rust
17 lines
446 B
Rust
use bevy::{prelude::*, window::WindowResolution};
|
|
|
|
use asteroids::{config::WINDOW_SIZE, AsteroidPlugin};
|
|
|
|
fn main() {
|
|
App::new()
|
|
.add_plugins(DefaultPlugins.set(WindowPlugin {
|
|
primary_window: Some(Window {
|
|
resolution: WindowResolution::new(WINDOW_SIZE.x, WINDOW_SIZE.y),
|
|
..default()
|
|
}),
|
|
..default()
|
|
}))
|
|
.add_plugins(AsteroidPlugin)
|
|
.run();
|
|
}
|