World size configuration

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.
This commit is contained in:
2024-11-28 09:50:13 -06:00
parent 17cb15c249
commit 941c2f6bea
3 changed files with 23 additions and 5 deletions

View File

@@ -1,10 +1,16 @@
use bevy::prelude::*;
use bevy::{prelude::*, window::WindowResolution};
use asteroids::AsteroidPlugin;
use asteroids::{config::WINDOW_SIZE, AsteroidPlugin};
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(DefaultPlugins.set(WindowPlugin {
primary_window: Some(Window {
resolution: WindowResolution::new(WINDOW_SIZE.x, WINDOW_SIZE.y),
..default()
}),
..default()
}))
.add_plugins(AsteroidPlugin)
.run();
}