mirror of
https://github.com/Noratrieb/game-wip-dontplay.git
synced 2026-01-16 20:35:02 +01:00
Add arg parsing, support multiple worlds
This commit is contained in:
parent
83f35e51ee
commit
129585ba64
5 changed files with 140 additions and 22 deletions
|
|
@ -18,6 +18,7 @@ use crate::{
|
|||
input::Input,
|
||||
math::{center_offset, TILE_SIZE},
|
||||
res::Res,
|
||||
CliArgs,
|
||||
};
|
||||
|
||||
/// Application level state (includes game and ui state, etc.)
|
||||
|
|
@ -38,7 +39,7 @@ pub struct App {
|
|||
}
|
||||
|
||||
impl App {
|
||||
pub fn new() -> anyhow::Result<Self> {
|
||||
pub fn new(args: CliArgs) -> anyhow::Result<Self> {
|
||||
let rw = graphics::make_window();
|
||||
let sf_egui = SfEgui::new(&rw);
|
||||
let mut res = Res::load()?;
|
||||
|
|
@ -53,7 +54,7 @@ impl App {
|
|||
Ok(Self {
|
||||
rw,
|
||||
should_quit: false,
|
||||
game: GameState::default(),
|
||||
game: GameState::new(args.world_name),
|
||||
res,
|
||||
sf_egui,
|
||||
input: Input::default(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue