diff --git a/src/level.rs b/src/level.rs index db1756f..fce14e2 100644 --- a/src/level.rs +++ b/src/level.rs @@ -13,14 +13,14 @@ impl Plugin for LevelPlugin { } } -pub struct Level { - pub id: u32, - pub blocks: Vec, - pub jump_collision_block_boxes: Vec, +struct Level { + id: u32, + blocks: Vec, + jump_collision_block_boxes: Vec, } impl Level { - pub fn new(id: u32) -> Self { + fn new(id: u32) -> Self { debug!("Creating level (id: {})", id); let num_blocks = match id { @@ -55,7 +55,7 @@ impl Level { impl Resource for Level {} -pub fn spawn_blocks(mut commands: Commands, level: Res) { +fn spawn_blocks(mut commands: Commands, level: Res) { debug!("Spawning blocks"); for block in level.blocks.iter() { commands.spawn(block.clone()); diff --git a/src/player.rs b/src/player.rs index 79030f6..21702ac 100644 --- a/src/player.rs +++ b/src/player.rs @@ -2,7 +2,7 @@ use bevy::{prelude::*, window::PrimaryWindow}; use bevy_xpbd_2d::prelude::*; use leafwing_input_manager::prelude::*; -pub mod grapple; +mod grapple; const SIZE: f32 = 64.0; const SIZE_VEC2: Vec2 = Vec2::new(SIZE, SIZE); @@ -24,7 +24,7 @@ impl Plugin for PlayerPlugin { pub struct Player; #[derive(Bundle, Default)] -pub struct PlayerBundle { +struct PlayerBundle { sprite_bundle: SpriteBundle, rigid_body: RigidBody, collider: Collider, @@ -37,7 +37,7 @@ pub struct PlayerBundle { } impl PlayerBundle { - pub fn new(asset_server: Res, window: &Window) -> Self { + fn new(asset_server: Res, window: &Window) -> Self { debug!("Creating player bundle"); let mut input_map = InputMap::default(); @@ -91,7 +91,7 @@ pub enum Action { #[derive(Resource, Default)] pub struct CanJump(pub bool); -pub fn spawn( +fn spawn( mut commands: Commands, asset_server: Res, window_query: Query<&Window, With>, @@ -131,7 +131,7 @@ pub fn r#move( } } -pub fn can_jump( +fn can_jump( mut collisions: EventReader, mut can_jump: ResMut, query: Query<( diff --git a/src/player/grapple.rs b/src/player/grapple.rs index a1f6672..73ed001 100644 --- a/src/player/grapple.rs +++ b/src/player/grapple.rs @@ -37,14 +37,14 @@ impl Plugin for GrapplePlugin { } #[derive(States, Debug, Clone, Eq, PartialEq, Hash)] -pub enum GrappleState { +enum GrappleState { Idle, Aiming, Grappling, } impl GrappleState { - pub fn next(&self) -> Self { + fn next(&self) -> Self { match self { Self::Idle => Self::Aiming, Self::Aiming => Self::Grappling,