beginning of world loader

This commit is contained in:
TudbuT 2024-11-23 17:09:42 +01:00
parent 1b53a5f15f
commit 4d848a3acb
6 changed files with 23 additions and 1 deletions

View file

@ -30,7 +30,7 @@ pub fn add_player(
MaterialMesh2dBundle {
mesh: meshes.add(Circle::new(20.)).into(),
material: materials.add(asset_server.load("test.png")),
transform: Transform::from_xyz(100., 100., 0.),
transform: Transform::from_xyz(10., 10., 0.),
..default()
},
))

View file

@ -1,10 +1,21 @@
use std::fs;
use bevy::{core_pipeline::smaa::SmaaSpecializedRenderPipelines, prelude::*};
use bevy::{prelude::*, scene::ScenePlugin};
use bevy_editor_pls::EditorPlugin;
use bevy_rapier2d::prelude::*;
use readformat::readf;
use crate::AppState;
pub(super) fn scene_plugin(app: &mut App) {
app.add_plugins(EditorPlugin::default());
// app.add_systems(, )
app.add_systems(Startup, (import_text_world,));
}
pub(super) fn import_text_world(mut commands: Commands, assets: Res<AssetServer>) {
let world_string = fs::read_to_string("assets/world.txt");
let &[info_string, world_string] = readf("info section\n{}\nworld section\n{}", world_string);
println!()
}