Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,272 changes: 973 additions & 299 deletions Cargo.lock

Large diffs are not rendered by default.

14 changes: 9 additions & 5 deletions src/audio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ pub use music::*;
pub fn game_plugin(game: &mut Game) {
game.init_shared_resource::<AudioCenter>();

let session = match game.sessions.get_mut(SessionNames::AUDIO) {
Some(session) => session,
None => panic!("Audio plugin failed to find existing bones audio session, make sure jumpy audio plugin is installed after bones default plugins.")
};
let modified_session = game.sessions.modify_and_replace_existing_session(
SessionNames::AUDIO,
|session: &mut SessionBuilder| {
session.stages().add_system_to_stage(First, music_system);
},
);

session.stages.add_system_to_stage(First, music_system);
if modified_session.is_none() {
panic!("Audio plugin failed to find existing bones audio session, make sure jumpy audio plugin is installed after bones default plugins.")
}
}

/// Extension of bones [`AudioCenter`].
Expand Down
10 changes: 5 additions & 5 deletions src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pub struct MatchPlayerInfo {
}

impl SessionPlugin for MatchPlugin {
fn install(self, session: &mut Session) {
fn install(self, session: &mut SessionBuilder) {
session
.install_plugin(DefaultSessionPlugin)
.install_plugin(LuaPluginLoaderSessionPlugin(self.plugins));
Expand All @@ -94,7 +94,7 @@ impl SessionPlugin for MatchPlugin {
scoring::session_plugin(session);

let current_map = self.maps.current_map;
session.world.insert_resource(self.maps);
session.insert_resource(self.maps);

// Initialize LoadedMap on startup as we cannot access AssetServer during MatchPlugin install
// to get map meta.
Expand All @@ -105,11 +105,11 @@ impl SessionPlugin for MatchPlugin {
},
);

session.world.insert_resource(MatchInputs {
session.insert_resource(MatchInputs {
players: self.player_info,
});
session.world.insert_resource(self.score);
session.runner = self.session_runner;
session.insert_resource(self.score);
session.set_session_runner(self.session_runner);
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/core/attachment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
//! sure that, for example, a held item will bob up and down with the player.
use crate::prelude::*;

pub fn install(session: &mut Session) {
pub fn install(session: &mut SessionBuilder) {
session
.stages
.add_system_to_stage(CoreStage::Last, update_player_body_attachments)
.add_system_to_stage(CoreStage::Last, remove_player_body_attachments)
.add_system_to_stage(CoreStage::Last, update_attachments);
Expand Down
2 changes: 1 addition & 1 deletion src/core/bullet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub fn game_plugin(game: &mut Game) {
}

/// Install this module.
pub fn session_plugin(session: &mut Session) {
pub fn session_plugin(session: &mut SessionBuilder) {
Bullet::register_schema();
BulletHandle::register_schema();

Expand Down
2 changes: 1 addition & 1 deletion src/core/camera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use crate::prelude::*;

/// Install this module.
pub fn install(session: &mut Session) {
pub fn install(session: &mut SessionBuilder) {
session
.stages
.add_system_to_stage(CoreStage::Last, camera_controller);
Expand Down
6 changes: 2 additions & 4 deletions src/core/damage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ use crate::prelude::*;
use super::utils::Rect;

/// Install this module.
pub fn install(session: &mut Session) {
pub fn install(session: &mut SessionBuilder) {
DamageRegion::register_schema();
DamageRegionOwner::register_schema();

session
.stages
.add_system_to_stage(CoreStage::PostUpdate, kill_players_in_damage_region);
session.add_system_to_stage(CoreStage::PostUpdate, kill_players_in_damage_region);
}

/// A rectangular damage region.
Expand Down
2 changes: 1 addition & 1 deletion src/core/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::prelude::*;
use rapier2d::prelude as rapier;

/// Install this module.
pub fn plugin(session: &mut Session) {
pub fn plugin(session: &mut SessionBuilder) {
session
.stages
.add_system_to_stage(CoreStage::Last, debug_render_colliders)
Expand Down
2 changes: 1 addition & 1 deletion src/core/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::core::map_constructor::{shiftnanigans::ShiftnanigansMapConstructor, M
use crate::prelude::*;

/// Install this module.
pub fn install(session: &mut Session) {
pub fn install(session: &mut SessionBuilder) {
session
.stages
.add_system_to_stage(CoreStage::PreUpdate, handle_editor_input);
Expand Down
2 changes: 1 addition & 1 deletion src/core/elements.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ impl<'a> SpawnerManager<'a> {
/// Helper macro to install element game and session plugins
macro_rules! install_plugins {
($($module:ident),* $(,)?) => {
pub fn session_plugin(session: &mut Session) {
pub fn session_plugin(session: &mut SessionBuilder) {
ElementHandle::register_schema();
MapElementHydrated::register_schema();
DehydrateOutOfBounds::register_schema();
Expand Down
2 changes: 1 addition & 1 deletion src/core/elements/buss.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub fn game_plugin(game: &mut Game) {
game.init_shared_resource::<AssetServer>();
}

pub fn session_plugin(session: &mut Session) {
pub fn session_plugin(session: &mut SessionBuilder) {
session
.stages
.add_system_to_stage(CoreStage::PreUpdate, hydrate)
Expand Down
3 changes: 1 addition & 2 deletions src/core/elements/cannon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ pub fn game_plugin(game: &mut Game) {
game.init_shared_resource::<AssetServer>();
}

pub fn session_plugin(session: &mut Session) {
pub fn session_plugin(session: &mut SessionBuilder) {
session
.stages
.add_system_to_stage(CoreStage::PreUpdate, hydrate)
.add_system_to_stage(CoreStage::PostUpdate, update);
}
Expand Down
3 changes: 1 addition & 2 deletions src/core/elements/crab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ pub struct CrabMeta {
pub atlas: Handle<Atlas>,
}

pub fn session_plugin(session: &mut Session) {
pub fn session_plugin(session: &mut SessionBuilder) {
session
.stages
.add_system_to_stage(CoreStage::PreUpdate, hydrate)
.add_system_to_stage(CoreStage::PostUpdate, update_crabs);
}
Expand Down
3 changes: 1 addition & 2 deletions src/core/elements/crate_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ pub fn game_plugin(game: &mut Game) {
game.init_shared_resource::<AssetServer>();
}

pub fn session_plugin(session: &mut Session) {
pub fn session_plugin(session: &mut SessionBuilder) {
session
.stages
.add_system_to_stage(CoreStage::PreUpdate, hydrate_crates)
.add_system_to_stage(CoreStage::PostUpdate, update_idle_crates)
.add_system_to_stage(CoreStage::PostUpdate, update_thrown_crates);
Expand Down
2 changes: 1 addition & 1 deletion src/core/elements/decoration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub fn game_plugin(game: &mut Game) {
game.init_shared_resource::<AssetServer>();
}

pub fn session_plugin(session: &mut Session) {
pub fn session_plugin(session: &mut SessionBuilder) {
session
.stages
.add_system_to_stage(CoreStage::First, hydrate);
Expand Down
2 changes: 1 addition & 1 deletion src/core/elements/fish_school.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub fn game_plugin(game: &mut Game) {
game.init_shared_resource::<AssetServer>();
}

pub fn session_plugin(session: &mut Session) {
pub fn session_plugin(session: &mut SessionBuilder) {
session
.stages
.add_system_to_stage(CoreStage::PreUpdate, hydrate)
Expand Down
3 changes: 1 addition & 2 deletions src/core/elements/flappy_jellyfish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ impl FlappyJellyfishMetaSchemaExts for SchemaBox {
}
}

pub fn session_plugin(session: &mut Session) {
pub fn session_plugin(session: &mut SessionBuilder) {
session
.stages
.add_system_to_stage(CoreStage::PostUpdate, control_flappy_jellyfish)
.add_system_to_stage(CoreStage::PostUpdate, explode_flappy_jellyfish);
}
Expand Down
3 changes: 1 addition & 2 deletions src/core/elements/grenade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ pub fn game_plugin(game: &mut Game) {
game.init_shared_resource::<AssetServer>();
}

pub fn session_plugin(session: &mut Session) {
pub fn session_plugin(session: &mut SessionBuilder) {
session
.stages
.add_system_to_stage(CoreStage::PreUpdate, hydrate)
.add_system_to_stage(CoreStage::PostUpdate, update_lit_grenades)
.add_system_to_stage(CoreStage::PostUpdate, update_idle_grenades);
Expand Down
2 changes: 1 addition & 1 deletion src/core/elements/jellyfish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub fn game_plugin(game: &mut Game) {
game.init_shared_resource::<AssetServer>();
}

pub fn session_plugin(session: &mut Session) {
pub fn session_plugin(session: &mut SessionBuilder) {
session
.stages
.add_system_to_stage(CoreStage::PreUpdate, hydrate)
Expand Down
2 changes: 1 addition & 1 deletion src/core/elements/kick_bomb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub fn game_plugin(_game: &mut Game) {
KickBombMeta::register_schema();
}

pub fn session_plugin(session: &mut Session) {
pub fn session_plugin(session: &mut SessionBuilder) {
session
.stages
.add_system_to_stage(CoreStage::PreUpdate, hydrate)
Expand Down
2 changes: 1 addition & 1 deletion src/core/elements/machine_gun.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub fn game_plugin(game: &mut Game) {
game.init_shared_resource::<AssetServer>();
}

pub fn session_plugin(session: &mut Session) {
pub fn session_plugin(session: &mut SessionBuilder) {
session
.stages
.add_system_to_stage(CoreStage::PreUpdate, hydrate)
Expand Down
3 changes: 1 addition & 2 deletions src/core/elements/mine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ pub fn game_plugin(game: &mut Game) {
game.init_shared_resource::<AssetServer>();
}

pub fn session_plugin(session: &mut Session) {
pub fn session_plugin(session: &mut SessionBuilder) {
session
.stages
.add_system_to_stage(CoreStage::PreUpdate, hydrate)
.add_system_to_stage(CoreStage::PostUpdate, update_thrown_mines)
.add_system_to_stage(CoreStage::PostUpdate, update_idle_mines);
Expand Down
2 changes: 1 addition & 1 deletion src/core/elements/musket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub fn game_plugin(game: &mut Game) {
game.init_shared_resource::<AssetServer>();
}

pub fn session_plugin(session: &mut Session) {
pub fn session_plugin(session: &mut SessionBuilder) {
session
.stages
.add_system_to_stage(CoreStage::PreUpdate, hydrate)
Expand Down
3 changes: 1 addition & 2 deletions src/core/elements/periscope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ pub fn game_plugin(game: &mut Game) {
game.init_shared_resource::<AssetServer>();
}

pub fn session_plugin(session: &mut Session) {
pub fn session_plugin(session: &mut SessionBuilder) {
session
.stages
.add_system_to_stage(CoreStage::PreUpdate, hydrate)
.add_system_to_stage(CoreStage::PostUpdate, update);
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/elements/player_spawner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub fn game_plugin(game: &mut Game) {
game.init_shared_resource::<AssetServer>();
}

pub fn session_plugin(session: &mut Session) {
pub fn session_plugin(session: &mut SessionBuilder) {
session
.stages
.add_system_to_stage(CoreStage::First, hydrate)
Expand Down
2 changes: 1 addition & 1 deletion src/core/elements/slippery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub fn game_plugin(game: &mut Game) {
game.init_shared_resource::<AssetServer>();
}

pub fn session_plugin(session: &mut Session) {
pub fn session_plugin(session: &mut SessionBuilder) {
session
.stages
.add_system_to_stage(CoreStage::PreUpdate, hydrate)
Expand Down
2 changes: 1 addition & 1 deletion src/core/elements/slippery_seaweed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub fn game_plugin(game: &mut Game) {
game.init_shared_resource::<AssetServer>();
}

pub fn session_plugin(session: &mut Session) {
pub fn session_plugin(session: &mut SessionBuilder) {
session
.stages
.add_system_to_stage(CoreStage::PreUpdate, hydrate)
Expand Down
2 changes: 1 addition & 1 deletion src/core/elements/snail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub fn game_plugin(game: &mut Game) {
game.init_shared_resource::<AssetServer>();
}

pub fn session_plugin(session: &mut Session) {
pub fn session_plugin(session: &mut SessionBuilder) {
session
.stages
.add_system_to_stage(CoreStage::PreUpdate, hydrate)
Expand Down
2 changes: 1 addition & 1 deletion src/core/elements/spike.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub fn game_plugin(game: &mut Game) {
game.init_shared_resource::<AssetServer>();
}

pub fn session_plugin(session: &mut Session) {
pub fn session_plugin(session: &mut SessionBuilder) {
session
.stages
.add_system_to_stage(CoreStage::PreUpdate, hydrate)
Expand Down
2 changes: 1 addition & 1 deletion src/core/elements/sproinger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub fn game_plugin(game: &mut Game) {
game.init_shared_resource::<AssetServer>();
}

pub fn session_plugin(session: &mut Session) {
pub fn session_plugin(session: &mut SessionBuilder) {
session
.stages
.add_system_to_stage(CoreStage::PreUpdate, hydrate)
Expand Down
2 changes: 1 addition & 1 deletion src/core/elements/stomp_boots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub fn game_plugin(game: &mut Game) {
game.init_shared_resource::<AssetServer>();
}

pub fn session_plugin(session: &mut Session) {
pub fn session_plugin(session: &mut SessionBuilder) {
session
.stages
.add_system_to_stage(CoreStage::PreUpdate, hydrate)
Expand Down
2 changes: 1 addition & 1 deletion src/core/elements/sword.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub fn game_plugin(game: &mut Game) {
game.init_shared_resource::<AssetServer>();
}

pub fn session_plugin(session: &mut Session) {
pub fn session_plugin(session: &mut SessionBuilder) {
session
.stages
.add_system_to_stage(CoreStage::PreUpdate, hydrate)
Expand Down
2 changes: 1 addition & 1 deletion src/core/elements/urchin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub fn game_plugin(game: &mut Game) {
game.init_shared_resource::<AssetServer>();
}

pub fn session_plugin(session: &mut Session) {
pub fn session_plugin(session: &mut SessionBuilder) {
session
.stages
.add_system_to_stage(CoreStage::PreUpdate, hydrate)
Expand Down
4 changes: 2 additions & 2 deletions src/core/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use bones_framework::input::PlayerControls;

use crate::{prelude::*, MAX_PLAYERS};

pub fn install(session: &mut Session) {
session.world.init_resource::<MatchInputs>();
pub fn install(session: &mut SessionBuilder) {
session.init_resource::<MatchInputs>();
}

/// The inputs for each player in this simulation frame.
Expand Down
2 changes: 1 addition & 1 deletion src/core/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use crate::prelude::*;

pub fn install(session: &mut Session) {
pub fn install(session: &mut SessionBuilder) {
Item::register_schema();
ItemThrow::register_schema();
ItemGrab::register_schema();
Expand Down
3 changes: 1 addition & 2 deletions src/core/lifetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ use std::time::Duration;

use crate::{core::FPS, prelude::*};

pub fn install(session: &mut Session) {
pub fn install(session: &mut SessionBuilder) {
Lifetime::register_schema();

session
.stages
.add_system_to_stage(CoreStage::PostUpdate, lifetime_system)
.add_system_to_stage(CoreStage::PostUpdate, invincibility);
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::{
use super::physics::collisions::{CollisionWorld, TileCollisionKind, TileDynamicCollider};
use crate::prelude::*;

pub fn install(session: &mut Session) {
pub fn install(session: &mut SessionBuilder) {
session
.stages
.add_system_to_stage(CoreStage::First, spawn_map)
Expand Down
2 changes: 1 addition & 1 deletion src/core/physics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl StageLabel for PhysicsStage {
}
}

pub fn install(session: &mut Session) {
pub fn install(session: &mut SessionBuilder) {
KinematicBody::register_schema();
ColliderShape::register_schema();

Expand Down
Loading
Loading