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:
12
src/main.rs
12
src/main.rs
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user