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 {
|
||||
use bevy::prelude::*;
|
||||
use bevy_rapier2d::prelude::*;
|
||||
use player::player_plugin;
|
||||
|
||||
mod player {
|
||||
use bevy::prelude::*;
|
||||
use bevy_rapier2d::prelude::*;
|
||||
#[derive(Component)]
|
||||
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.;
|
||||
|
||||
#[derive(States, Debug, Clone, PartialEq, Eq, Hash, Default)]
|
||||
enum AppState {
|
||||
#[default]
|
||||
MainMenu,
|
||||
InGame,
|
||||
GameOver,
|
||||
}
|
||||
|
||||
#[derive(States, Debug, Clone, PartialEq, Eq, Hash, Default)]
|
||||
enum PausedState {
|
||||
Paused,
|
||||
#[default]
|
||||
Running,
|
||||
}
|
||||
|
||||
|
@ -32,5 +41,7 @@ fn main() {
|
|||
App::new()
|
||||
.add_plugins(DefaultPlugins)
|
||||
.add_plugins(RapierPhysicsPlugin::<NoUserData>::pixels_per_meter(METER))
|
||||
.init_state::<AppState>()
|
||||
.init_state::<PausedState>()
|
||||
.run();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue