diff --git a/Cargo.toml b/Cargo.toml index cb43d0e..e8cd2e6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,27 +23,20 @@ default = ["premade_pools"] premade_pools = [] [dependencies] -bevy = { version = "0.14", default-features = false, features = [ +bevy = { version = "0.15", default-features = false, features = [ "serialize", "bevy_gilrs", ] } serde = { version = "1.0", features = ["derive"] } -leafwing-input-manager = { version = "0.15", default-features = false } +leafwing-input-manager = { version = "0.16", default-features = false } leafwing_abilities_macros = { path = "macros", version = "0.3" } thiserror = "1.0.37" derive_more = "0.99.17" [dev-dependencies] -bevy = { version = "0.14", default-features = false, features = [ - "bevy_asset", - "bevy_sprite", - "bevy_text", - "bevy_ui", - "bevy_render", - "bevy_core_pipeline", - "x11", +bevy = { version = "0.15", default-features = true, features = [ "default_font", ] } # Needed to provide implementations for standard input devices -leafwing-input-manager = { version = "0.15", default-features = true } +leafwing-input-manager = { version = "0.16", default-features = true } diff --git a/RELEASES.md b/RELEASES.md index cc20e34..e7d0840 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,5 +1,11 @@ # Release Notes +## Version 0.10 + +## Dependencies (0.10) + +- now support `bevy` 0.15 and `leafwing-input-manager` 0.16 + ## Version 0.9 ## Dependencies (0.9) diff --git a/examples/cooldown.rs b/examples/cooldown.rs index 06c4cde..d49d714 100644 --- a/examples/cooldown.rs +++ b/examples/cooldown.rs @@ -74,7 +74,8 @@ struct Cookie; #[derive(Bundle)] struct CookieBundle { cookie: Cookie, - button_bundle: ButtonBundle, + node: Node, + background_color: BackgroundColor, abilities_bundle: AbilitiesBundle, input_manager_bundle: InputManagerBundle, } @@ -87,15 +88,12 @@ impl CookieBundle { fn new() -> CookieBundle { CookieBundle { cookie: Cookie, - button_bundle: ButtonBundle { - style: Style { - height: Val::Px(100.), - width: Val::Px(100.), - ..Default::default() - }, - background_color: BackgroundColor(Self::COOKIE_COLOR.into()), - ..default() + node: Node { + height: Val::Px(100.), + width: Val::Px(100.), + ..Default::default() }, + background_color: BackgroundColor(Self::COOKIE_COLOR.into()), abilities_bundle: AbilitiesBundle { cooldowns: CookieAbility::cooldowns(), ..default() @@ -113,7 +111,7 @@ fn spawn_cookie(mut commands: Commands) { } fn spawn_camera(mut commands: Commands) { - commands.spawn(Camera2dBundle::default()); + commands.spawn(Camera2d); } // We need a huge amount of space to be able to let you play this game for long enough ;) @@ -185,20 +183,10 @@ fn reset_cookie_color(mut query: Query<&mut BackgroundColor, With>) { struct ScoreText; fn spawn_score_text(mut commands: Commands) { - commands - .spawn(TextBundle::from_section( - "Score: ", - TextStyle { - font_size: 50., - color: Color::WHITE, - ..Default::default() - }, - )) - .insert(ScoreText); + commands.spawn(Text::new("Score")).insert(ScoreText); } -fn display_score(score: Res, mut query: Query<&mut Text, With>) { +fn display_score(score: Res, mut text: Single<&mut Text, With>) { let score = score.0; - let mut text = query.single_mut(); - text.sections[0].value = format!("Score: {score}"); + **text = Text::new(format!("Score: {}", score)); }