plugins!!!
This commit is contained in:
parent
fb9c5e6589
commit
bc639c5f1d
1 changed files with 12 additions and 1 deletions
13
src/main.rs
13
src/main.rs
|
@ -4,27 +4,36 @@ use bevy_rapier2d::prelude::*;
|
||||||
mod game {
|
mod game {
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
use bevy_rapier2d::prelude::*;
|
use bevy_rapier2d::prelude::*;
|
||||||
|
use player::player_plugin;
|
||||||
|
|
||||||
mod player {
|
mod player {
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
use bevy_rapier2d::prelude::*;
|
use bevy_rapier2d::prelude::*;
|
||||||
#[derive(Component)]
|
#[derive(Component)]
|
||||||
struct Player;
|
struct Player;
|
||||||
|
|
||||||
|
pub(super) fn player_plugin(app: &mut App) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn game_plugin(app: &mut App) {}
|
fn game_plugin(app: &mut App) {
|
||||||
|
app.add_plugins((player_plugin));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const METER: f32 = 120.;
|
const METER: f32 = 120.;
|
||||||
|
|
||||||
|
#[derive(States, Debug, Clone, PartialEq, Eq, Hash, Default)]
|
||||||
enum AppState {
|
enum AppState {
|
||||||
|
#[default]
|
||||||
MainMenu,
|
MainMenu,
|
||||||
InGame,
|
InGame,
|
||||||
GameOver,
|
GameOver,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(States, Debug, Clone, PartialEq, Eq, Hash, Default)]
|
||||||
enum PausedState {
|
enum PausedState {
|
||||||
Paused,
|
Paused,
|
||||||
|
#[default]
|
||||||
Running,
|
Running,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,5 +41,7 @@ fn main() {
|
||||||
App::new()
|
App::new()
|
||||||
.add_plugins(DefaultPlugins)
|
.add_plugins(DefaultPlugins)
|
||||||
.add_plugins(RapierPhysicsPlugin::<NoUserData>::pixels_per_meter(METER))
|
.add_plugins(RapierPhysicsPlugin::<NoUserData>::pixels_per_meter(METER))
|
||||||
|
.init_state::<AppState>()
|
||||||
|
.init_state::<PausedState>()
|
||||||
.run();
|
.run();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue