feat: fixed window starting size

feat/simulation
hheik 2022-12-18 17:17:09 +02:00
parent 3460df2e18
commit bed39b9a5f
1 changed files with 7 additions and 0 deletions

View File

@ -27,9 +27,16 @@ pub fn init() {
.add_plugin(Terrain2DPlugin)
.add_plugin(PlayerPlugin)
.add_startup_system(setup_terrain)
.add_startup_system(setup_window)
.run();
}
fn setup_window(mut windows: ResMut<Windows>) {
if let Some(window) = windows.get_primary_mut() {
window.set_resolution(1280.0 / 2.0, 720.0 / 2.0);
}
}
fn setup_terrain(mut commands: Commands, mut terrain: ResMut<Terrain2D>) {
let terrain_gen = TerrainGen2D::new(432678);
for y in 0..(WORLD_WIDTH / Chunk2D::SIZE_Y as i32) {