main menu
This commit is contained in:
17
src/main.rs
17
src/main.rs
@@ -1,3 +1,5 @@
|
||||
use std::default;
|
||||
|
||||
use asset_loading::ImageAssets;
|
||||
use bevy::prelude::*;
|
||||
use player_plugin::PlayerPlugin;
|
||||
@@ -6,18 +8,25 @@ use physics_plugin::PhysicsPlugin;
|
||||
mod asset_loading;
|
||||
mod player_plugin;
|
||||
mod physics_plugin;
|
||||
mod level_instantiation;
|
||||
mod main_menu;
|
||||
|
||||
fn main() {
|
||||
App::new()
|
||||
.add_plugins((DefaultPlugins, asset_loading::plugin, PlayerPlugin, PhysicsPlugin))
|
||||
.init_state::<GameState>()
|
||||
// We need to register components to make them visible to Blenvy
|
||||
.add_plugins((
|
||||
DefaultPlugins,
|
||||
asset_loading::plugin,
|
||||
PlayerPlugin,
|
||||
PhysicsPlugin,
|
||||
level_instantiation::map_plugin,
|
||||
main_menu::plugin
|
||||
))
|
||||
.add_systems(Startup, setup)
|
||||
.add_systems(OnExit(GameState::Loading), debug_our_king)
|
||||
.run();
|
||||
}
|
||||
|
||||
#[derive(States, Default, Clone, Eq, PartialEq, Debug, Hash)]
|
||||
#[derive(States, Debug, Clone, Copy, Eq, PartialEq, Hash, Default)]
|
||||
enum GameState {
|
||||
/// During the loading State the loading_plugin will load our assets
|
||||
#[default]
|
||||
|
||||
Reference in New Issue
Block a user