|
|
|
@ -31,48 +31,35 @@ fn main() {
|
|
|
|
app.add_state::<GameState>();
|
|
|
|
app.add_state::<GameState>();
|
|
|
|
app.add_systems(Update, state.run_if(resource_changed::<State<GameState>>()));
|
|
|
|
app.add_systems(Update, state.run_if(resource_changed::<State<GameState>>()));
|
|
|
|
app.add_systems(Update, loading.run_if(in_state(GameState::Loading)));
|
|
|
|
app.add_systems(Update, loading.run_if(in_state(GameState::Loading)));
|
|
|
|
app.add_systems(Update,toggle_display_mode.run_if(on_event::<KeyboardInput>()));
|
|
|
|
app.add_systems(
|
|
|
|
|
|
|
|
Update,
|
|
|
|
|
|
|
|
toggle_display_mode.run_if(on_event::<KeyboardInput>()),
|
|
|
|
|
|
|
|
);
|
|
|
|
app.add_plugins(
|
|
|
|
app.add_plugins(
|
|
|
|
DefaultPlugins
|
|
|
|
DefaultPlugins
|
|
|
|
.set(ImagePlugin::default_nearest())
|
|
|
|
.set(ImagePlugin::default_nearest())
|
|
|
|
.set(WindowPlugin {
|
|
|
|
.set(WindowPlugin {
|
|
|
|
primary_window: Some(Window {
|
|
|
|
primary_window: Some(Window {
|
|
|
|
title: "Martian Chess".into(),
|
|
|
|
title: "Martian Chess".into(),
|
|
|
|
resolution: (640., 480.).into(),
|
|
|
|
resolution: (640., 480.).into(),
|
|
|
|
..default()
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
..default()
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.set(AssetPlugin {
|
|
|
|
|
|
|
|
watch_for_changes: ChangeWatcher::with_delay(Duration::from_millis(200)),
|
|
|
|
|
|
|
|
..default()
|
|
|
|
..default()
|
|
|
|
})
|
|
|
|
}),
|
|
|
|
|
|
|
|
..default()
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.set(AssetPlugin {
|
|
|
|
|
|
|
|
watch_for_changes: ChangeWatcher::with_delay(Duration::from_millis(200)),
|
|
|
|
|
|
|
|
..default()
|
|
|
|
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
app.add_plugins(
|
|
|
|
app.add_plugins(credits::CreditsPlugin);
|
|
|
|
credits::CreditsPlugin,
|
|
|
|
app.add_plugins(debug::DebugPlugin);
|
|
|
|
);
|
|
|
|
app.add_plugins(display2d::Display2dPlugin);
|
|
|
|
app.add_plugins(
|
|
|
|
app.add_plugins(display3d::Display3dPlugin);
|
|
|
|
debug::DebugPlugin,
|
|
|
|
app.add_plugins(game::GamePlugin);
|
|
|
|
);
|
|
|
|
app.add_plugins(loading::LoadingPlugin);
|
|
|
|
app.add_plugins(
|
|
|
|
app.add_plugins(menu::MenuPlugin);
|
|
|
|
display2d::Display2dPlugin,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
app.add_plugins(
|
|
|
|
|
|
|
|
display3d::Display3dPlugin,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
app.add_plugins(
|
|
|
|
|
|
|
|
game::GamePlugin,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
app.add_plugins(
|
|
|
|
|
|
|
|
loading::LoadingPlugin,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
app.add_plugins(
|
|
|
|
|
|
|
|
menu::MenuPlugin,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
#[cfg(feature = "fmod")]
|
|
|
|
#[cfg(feature = "fmod")]
|
|
|
|
app.add_plugins(
|
|
|
|
app.add_plugins(audio::AudioPlugin);
|
|
|
|
audio::AudioPlugin,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
app.run();
|
|
|
|
app.run();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|