Skip to content

Commit

Permalink
Merge pull request #440 from mwbryant/bevy_0.11
Browse files Browse the repository at this point in the history
Bevy 0.11 Update
  • Loading branch information
StarArawn committed Jul 17, 2023
2 parents 1bdc8d3 + 72cbb7e commit 55c15bf
Show file tree
Hide file tree
Showing 51 changed files with 300 additions and 274 deletions.
11 changes: 6 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "bevy_ecs_tilemap"
description = "A tilemap rendering plugin for bevy which is more ECS friendly by having an entity per tile."
version = "0.10.0"
version = "0.11.0"
authors = ["John Mitchell"]
homepage = "https://github.com/StarArawn/bevy_ecs_tilemap"
repository = "https://github.com/StarArawn/bevy_ecs_tilemap"
Expand All @@ -15,7 +15,7 @@ atlas = []
render = []

[dependencies]
bevy = { version = "0.10", default-features = false, features = [
bevy = { version = "0.11", default-features = false, features = [
"bevy_core_pipeline",
"bevy_render",
"bevy_asset",
Expand All @@ -28,12 +28,12 @@ regex = "1.5.4"
anyhow = { version = "1.0" }
ldtk_rust = { version = "0.6" }
rand = "0.8"
env_logger = "0.9"
env_logger = "0.10"
serde_json = { version = "1.0" }
tiled = { version = "0.11.0", default-features = false }

[dev-dependencies.bevy]
version = "0.10"
version = "0.11"
default-features = false
features = [
"bevy_core_pipeline",
Expand All @@ -45,10 +45,11 @@ features = [
"bevy_text",
"bevy_sprite",
"filesystem_watcher",
"webgl2"
]

[target.'cfg(unix)'.dev-dependencies.bevy]
version = "0.10"
version = "0.11"
default-features = false
features = [
"bevy_core_pipeline",
Expand Down
13 changes: 7 additions & 6 deletions examples/3d_iso.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use bevy::prelude::*;
use bevy::utils::Duration;

use bevy::{asset::ChangeWatcher, prelude::*};
use bevy_ecs_tilemap::prelude::*;

mod helpers;
Expand Down Expand Up @@ -33,13 +35,12 @@ fn main() {
})
.set(ImagePlugin::default_nearest())
.set(AssetPlugin {
watch_for_changes: true,
watch_for_changes: ChangeWatcher::with_delay(Duration::from_millis(200)),
..default()
}),
)
.add_plugin(TilemapPlugin)
.add_plugin(helpers::tiled::TiledMapPlugin)
.add_startup_system(startup)
.add_system(helpers::camera::movement)
.add_plugins((TilemapPlugin, helpers::tiled::TiledMapPlugin))
.add_systems(Startup, startup)
.add_systems(Update, helpers::camera::movement)
.run();
}
8 changes: 4 additions & 4 deletions examples/accessing_tiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ fn main() {
})
.set(ImagePlugin::default_nearest()),
)
.add_plugin(TilemapPlugin)
.add_startup_system(startup)
.add_system(helpers::camera::movement)
.add_system(update_map)
.add_plugins(TilemapPlugin)
.add_systems(Startup, startup)
.add_systems(Update, helpers::camera::movement)
.add_systems(Update, update_map)
.run();
}
14 changes: 7 additions & 7 deletions examples/animation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,12 @@ fn main() {
})
.set(ImagePlugin::default_nearest()),
)
.add_plugin(LogDiagnosticsPlugin::default())
.add_plugin(FrameTimeDiagnosticsPlugin::default())
.add_plugin(TilemapPlugin)
.add_startup_system(startup)
.add_startup_system(create_background)
.add_startup_system(create_animated_flowers)
.add_system(helpers::camera::movement)
.add_plugins(LogDiagnosticsPlugin::default())
.add_plugins(FrameTimeDiagnosticsPlugin::default())
.add_plugins(TilemapPlugin)
.add_systems(Startup, startup)
.add_systems(Startup, create_background)
.add_systems(Startup, create_animated_flowers)
.add_systems(Update, helpers::camera::movement)
.run();
}
8 changes: 4 additions & 4 deletions examples/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ fn main() {
}),
..default()
}).set(ImagePlugin::default_nearest()))
.add_plugin(TilemapPlugin)
.add_startup_system(startup)
.add_system(helpers::camera::movement)
.add_system(swap_texture_or_hide)
.add_plugins(TilemapPlugin)
.add_systems(Startup, startup)
.add_systems(Update, helpers::camera::movement)
.add_systems(Update, swap_texture_or_hide)
.run();
}
10 changes: 5 additions & 5 deletions examples/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ fn main() {
render_chunk_size: UVec2::new(256, 256),
..Default::default()
})
.add_plugin(LogDiagnosticsPlugin::default())
.add_plugin(FrameTimeDiagnosticsPlugin::default())
.add_plugin(TilemapPlugin)
.add_startup_system(startup)
.add_system(helpers::camera::movement)
.add_plugins(LogDiagnosticsPlugin::default())
.add_plugins(FrameTimeDiagnosticsPlugin::default())
.add_plugins(TilemapPlugin)
.add_systems(Startup, startup)
.add_systems(Update, helpers::camera::movement)
.run();
}
10 changes: 5 additions & 5 deletions examples/chunking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ fn main() {
render_chunk_size: RENDER_CHUNK_SIZE,
..Default::default()
})
.add_plugin(TilemapPlugin)
.add_plugins(TilemapPlugin)
.insert_resource(ChunkManager::default())
.add_startup_system(startup)
.add_system(helpers::camera::movement)
.add_system(spawn_chunks_around_camera)
.add_system(despawn_outofrange_chunks)
.add_systems(Startup, startup)
.add_systems(Update, helpers::camera::movement)
.add_systems(Update, spawn_chunks_around_camera)
.add_systems(Update, despawn_outofrange_chunks)
.run();
}
6 changes: 3 additions & 3 deletions examples/colors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ fn main() {
})
.set(ImagePlugin::default_nearest()),
)
.add_plugin(TilemapPlugin)
.add_startup_system(startup)
.add_system(helpers::camera::movement)
.add_plugins(TilemapPlugin)
.add_systems(Startup, startup)
.add_systems(Update, helpers::camera::movement)
.run();
}
11 changes: 7 additions & 4 deletions examples/frustum_cull_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,17 @@ fn main() {
filter: "bevy_ecs_tilemap=trace".into(),
}),
)
.add_plugin(TilemapPlugin)
.add_plugins(TilemapPlugin)
.init_resource::<TileHandleIso>()
.init_resource::<TileHandleHexCol>()
.init_resource::<TileHandleHexRow>()
.init_resource::<TileHandleSquare>()
.init_resource::<FontHandle>()
.add_startup_systems((spawn_tilemap, apply_system_buffers, spawn_map_type_label).chain())
.add_system(camera_movement.in_base_set(CoreSet::First))
.add_system(swap_map_type)
.add_systems(
Startup,
(spawn_tilemap, apply_deferred, spawn_map_type_label).chain(),
)
.add_systems(First, camera_movement)
.add_systems(Update, swap_map_type)
.run();
}
8 changes: 4 additions & 4 deletions examples/game_of_life.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ fn main() {
})
.set(ImagePlugin::default_nearest()),
)
.add_plugin(TilemapPlugin)
.add_startup_system(startup)
.add_system(helpers::camera::movement)
.add_system(update)
.add_plugins(TilemapPlugin)
.add_systems(Startup, startup)
.add_systems(Update, helpers::camera::movement)
.add_systems(Update, update)
.run();
}
6 changes: 3 additions & 3 deletions examples/helpers/ldtk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use bevy_ecs_tilemap::{
};
use std::collections::HashMap;

use bevy::reflect::TypeUuid;
use bevy::reflect::{TypePath, TypeUuid};
use bevy::{
asset::{AssetLoader, AssetPath, BoxedFuture, LoadContext, LoadedAsset},
prelude::*,
Expand All @@ -20,11 +20,11 @@ impl Plugin for LdtkPlugin {
fn build(&self, app: &mut App) {
app.add_asset::<LdtkMap>()
.add_asset_loader(LdtkLoader)
.add_system(process_loaded_tile_maps);
.add_systems(Update, process_loaded_tile_maps);
}
}

#[derive(TypeUuid)]
#[derive(TypeUuid, TypePath)]
#[uuid = "abf9eaf2-f21c-4b46-89b0-8aa5c42199af"]
pub struct LdtkMap {
pub project: ldtk_rust::Project,
Expand Down
8 changes: 4 additions & 4 deletions examples/helpers/tiled.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ use bevy::{
log,
prelude::{
AddAsset, Added, AssetEvent, Assets, Bundle, Commands, Component, DespawnRecursiveExt,
Entity, EventReader, GlobalTransform, Handle, Image, Plugin, Query, Res, Transform,
Entity, EventReader, GlobalTransform, Handle, Image, Plugin, Query, Res, Transform, Update,
},
reflect::TypeUuid,
reflect::{TypePath, TypeUuid},
utils::HashMap,
};
use bevy_ecs_tilemap::prelude::*;
Expand All @@ -37,11 +37,11 @@ impl Plugin for TiledMapPlugin {
fn build(&self, app: &mut bevy::prelude::App) {
app.add_asset::<TiledMap>()
.add_asset_loader(TiledLoader)
.add_system(process_loaded_maps);
.add_systems(Update, process_loaded_maps);
}
}

#[derive(TypeUuid)]
#[derive(TypeUuid, TypePath)]
#[uuid = "e51081d0-6168-4881-a1c6-4249b2000d7f"]
pub struct TiledMap {
pub map: tiled::Map,
Expand Down
14 changes: 7 additions & 7 deletions examples/hex_neighbors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,16 +441,16 @@ fn main() {
})
.set(ImagePlugin::default_nearest()),
)
.add_plugin(TilemapPlugin)
.add_plugins(TilemapPlugin)
.init_resource::<CursorPos>()
.init_resource::<TileHandleHexCol>()
.init_resource::<TileHandleHexRow>()
.init_resource::<FontHandle>()
.add_startup_systems((spawn_tilemap, apply_system_buffers).chain().in_set(SpawnTilemapSet))
.add_startup_systems((spawn_tile_labels, spawn_map_type_label).after(SpawnTilemapSet))
.add_systems((camera_movement, update_cursor_pos).chain().in_base_set(CoreSet::First))
.add_system(swap_map_type)
.add_system(hover_highlight_tile_label.after(swap_map_type))
.add_system(highlight_neighbor_label.after(hover_highlight_tile_label))
.add_systems(Startup, (spawn_tilemap, apply_deferred).chain().in_set(SpawnTilemapSet))
.add_systems(Startup, (spawn_tile_labels, spawn_map_type_label).after(SpawnTilemapSet))
.add_systems(First, (camera_movement, update_cursor_pos).chain())
.add_systems(Update, swap_map_type)
.add_systems(Update, hover_highlight_tile_label.after(swap_map_type))
.add_systems(Update, highlight_neighbor_label.after(hover_highlight_tile_label))
.run();
}
16 changes: 8 additions & 8 deletions examples/hex_neighbors_radius_chunks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -541,18 +541,18 @@ fn main() {
})
.set(ImagePlugin::default_nearest()),
)
.add_plugin(TilemapPlugin)
.add_plugins(TilemapPlugin)
.init_resource::<CursorPos>()
.init_resource::<HighlightRadius>()
.init_resource::<TileHandleHexCol>()
.init_resource::<TileHandleHexRow>()
.init_resource::<FontHandle>()
.add_startup_systems((spawn_chunks, apply_system_buffers).chain().in_set(SpawnChunksSet))
.add_startup_system(spawn_tile_labels.after(SpawnChunksSet))
.add_systems((camera_movement, update_cursor_pos).chain().in_base_set(CoreSet::First))
.add_system(swap_map_type)
.add_system(hover_highlight_tile_label.after(swap_map_type))
.add_system(update_radius.after(hover_highlight_tile_label))
.add_system(highlight_neighbor_labels.after(update_radius))
.add_systems(Startup, (spawn_chunks, apply_deferred).chain().in_set(SpawnChunksSet))
.add_systems(Startup, spawn_tile_labels.after(SpawnChunksSet))
.add_systems(First, (camera_movement, update_cursor_pos).chain())
.add_systems(Update, swap_map_type)
.add_systems(Update, hover_highlight_tile_label.after(swap_map_type))
.add_systems(Update, update_radius.after(hover_highlight_tile_label))
.add_systems(Update, highlight_neighbor_labels.after(update_radius))
.run();
}
8 changes: 4 additions & 4 deletions examples/hexagon_column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ fn main() {
})
.set(ImagePlugin::default_nearest()),
)
.add_plugin(TilemapPlugin)
.add_startup_system(startup)
.add_system(helpers::camera::movement)
.add_system(swap_mesh_type)
.add_plugins(TilemapPlugin)
.add_systems(Startup, startup)
.add_systems(Update, helpers::camera::movement)
.add_systems(Update, swap_mesh_type)
.run();
}
11 changes: 7 additions & 4 deletions examples/hexagon_generation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,12 +226,15 @@ fn main() {
})
.set(ImagePlugin::default_nearest()),
)
.add_plugin(TilemapPlugin)
.add_plugins(TilemapPlugin)
.init_resource::<TileHandleHexCol>()
.init_resource::<TileHandleHexRow>()
.init_resource::<FontHandle>()
.add_startup_systems((spawn_tilemap, apply_system_buffers, spawn_map_type_label).chain())
.add_system(camera_movement)
.add_system(swap_map_type)
.add_systems(
Startup,
(spawn_tilemap, apply_deferred, spawn_map_type_label).chain(),
)
.add_systems(Update, camera_movement)
.add_systems(Update, swap_map_type)
.run();
}
8 changes: 4 additions & 4 deletions examples/hexagon_row.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ fn main() {
})
.set(ImagePlugin::default_nearest()),
)
.add_plugin(TilemapPlugin)
.add_startup_system(startup)
.add_system(helpers::camera::movement)
.add_system(swap_mesh_type)
.add_plugins(TilemapPlugin)
.add_systems(Startup, startup)
.add_systems(Update, helpers::camera::movement)
.add_systems(Update, swap_mesh_type)
.run();
}
6 changes: 3 additions & 3 deletions examples/iso_diamond.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ fn main() {
})
.set(ImagePlugin::default_nearest()),
)
.add_plugin(TilemapPlugin)
.add_startup_system(startup)
.add_system(helpers::camera::movement)
.add_plugins(TilemapPlugin)
.add_systems(Startup, startup)
.add_systems(Update, helpers::camera::movement)
.run();
}
6 changes: 3 additions & 3 deletions examples/iso_staggered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ fn main() {
})
.set(ImagePlugin::default_nearest()),
)
.add_plugin(TilemapPlugin)
.add_startup_system(startup)
.add_system(helpers::camera::movement)
.add_plugins(TilemapPlugin)
.add_systems(Startup, startup)
.add_systems(Update, helpers::camera::movement)
.run();
}
6 changes: 3 additions & 3 deletions examples/layers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ fn main() {
})
.set(ImagePlugin::default_nearest()),
)
.add_plugin(TilemapPlugin)
.add_startup_system(startup)
.add_system(helpers::camera::movement)
.add_plugins(TilemapPlugin)
.add_systems(Startup, startup)
.add_systems(Update, helpers::camera::movement)
.run();
}
Loading

0 comments on commit 55c15bf

Please sign in to comment.