Compare commits
2 Commits
f17917ecad
...
51af43c831
Author | SHA1 | Date |
---|---|---|
Zynh Ludwig | 51af43c831 | |
Zynh Ludwig | f684d4edcd |
|
@ -550,6 +550,30 @@ dependencies = [
|
|||
"encase_derive_impl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bevy_eventlistener"
|
||||
version = "0.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "63aff74ac1477b88b57ff2f82fc711a7931414be7ee7d0e96aeea45b6d4a7cb6"
|
||||
dependencies = [
|
||||
"bevy_app",
|
||||
"bevy_ecs",
|
||||
"bevy_eventlistener_derive",
|
||||
"bevy_hierarchy",
|
||||
"bevy_utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bevy_eventlistener_derive"
|
||||
version = "0.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3fc779559aa23b81da2b14fba90586755d225983c5b6d3154658e42fc088de7f"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.72",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bevy_gilrs"
|
||||
version = "0.14.1"
|
||||
|
@ -751,6 +775,56 @@ dependencies = [
|
|||
"glam",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bevy_mod_picking"
|
||||
version = "0.20.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e290b8ad3e72dc621da7a9c21129da10540d78290ef8857353190e0213cac692"
|
||||
dependencies = [
|
||||
"bevy_app",
|
||||
"bevy_color",
|
||||
"bevy_core",
|
||||
"bevy_core_pipeline",
|
||||
"bevy_ecs",
|
||||
"bevy_eventlistener",
|
||||
"bevy_math",
|
||||
"bevy_picking_core",
|
||||
"bevy_picking_highlight",
|
||||
"bevy_picking_input",
|
||||
"bevy_picking_raycast",
|
||||
"bevy_picking_selection",
|
||||
"bevy_picking_sprite",
|
||||
"bevy_picking_ui",
|
||||
"bevy_reflect",
|
||||
"bevy_render",
|
||||
"bevy_text",
|
||||
"bevy_ui",
|
||||
"bevy_utils",
|
||||
"bevy_window",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bevy_mod_raycast"
|
||||
version = "0.18.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d9e4ff45885c4716771a9f55977d8ce69596502a5241da55bf608d7cd71a9cb3"
|
||||
dependencies = [
|
||||
"bevy_app",
|
||||
"bevy_asset",
|
||||
"bevy_color",
|
||||
"bevy_derive",
|
||||
"bevy_ecs",
|
||||
"bevy_gizmos",
|
||||
"bevy_math",
|
||||
"bevy_reflect",
|
||||
"bevy_render",
|
||||
"bevy_sprite",
|
||||
"bevy_transform",
|
||||
"bevy_utils",
|
||||
"bevy_window",
|
||||
"crossbeam-channel",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bevy_pbr"
|
||||
version = "0.14.1"
|
||||
|
@ -778,6 +852,128 @@ dependencies = [
|
|||
"static_assertions",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bevy_picking_core"
|
||||
version = "0.20.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "020b6cf6079927a1e6a3dd883986546632d8d09ab77840997f4936a74eade722"
|
||||
dependencies = [
|
||||
"bevy_app",
|
||||
"bevy_derive",
|
||||
"bevy_ecs",
|
||||
"bevy_eventlistener",
|
||||
"bevy_math",
|
||||
"bevy_reflect",
|
||||
"bevy_render",
|
||||
"bevy_transform",
|
||||
"bevy_utils",
|
||||
"bevy_window",
|
||||
"uuid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bevy_picking_highlight"
|
||||
version = "0.20.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8ba45161608da1bb58cbc55fd83cf5e529e616a180778c394733c85056cd2b76"
|
||||
dependencies = [
|
||||
"bevy_app",
|
||||
"bevy_asset",
|
||||
"bevy_color",
|
||||
"bevy_ecs",
|
||||
"bevy_pbr",
|
||||
"bevy_picking_core",
|
||||
"bevy_picking_selection",
|
||||
"bevy_reflect",
|
||||
"bevy_render",
|
||||
"bevy_sprite",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bevy_picking_input"
|
||||
version = "0.20.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0ba8cf67c68a5e150c066366744f9a44006ead9ad280de1c9ca69a6a13c5e283"
|
||||
dependencies = [
|
||||
"bevy_app",
|
||||
"bevy_ecs",
|
||||
"bevy_hierarchy",
|
||||
"bevy_input",
|
||||
"bevy_math",
|
||||
"bevy_picking_core",
|
||||
"bevy_picking_selection",
|
||||
"bevy_reflect",
|
||||
"bevy_render",
|
||||
"bevy_utils",
|
||||
"bevy_window",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bevy_picking_raycast"
|
||||
version = "0.20.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "679184dad110d1532ee6c4c872a0a5807277ea091406915aab27149a3b344fed"
|
||||
dependencies = [
|
||||
"bevy_app",
|
||||
"bevy_ecs",
|
||||
"bevy_mod_raycast",
|
||||
"bevy_picking_core",
|
||||
"bevy_reflect",
|
||||
"bevy_render",
|
||||
"bevy_transform",
|
||||
"bevy_window",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bevy_picking_selection"
|
||||
version = "0.20.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bf0769d84e944fbc09b0475f068e5232a8a4be15339796539aecd747413ededd"
|
||||
dependencies = [
|
||||
"bevy_app",
|
||||
"bevy_ecs",
|
||||
"bevy_eventlistener",
|
||||
"bevy_input",
|
||||
"bevy_picking_core",
|
||||
"bevy_reflect",
|
||||
"bevy_utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bevy_picking_sprite"
|
||||
version = "0.20.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9fcbde61e315f78b027f4b03f42339307b1f5ffef4f514e39007e9fb2be8aea5"
|
||||
dependencies = [
|
||||
"bevy_app",
|
||||
"bevy_asset",
|
||||
"bevy_ecs",
|
||||
"bevy_math",
|
||||
"bevy_picking_core",
|
||||
"bevy_render",
|
||||
"bevy_sprite",
|
||||
"bevy_transform",
|
||||
"bevy_window",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bevy_picking_ui"
|
||||
version = "0.20.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d611d001f531794d40e6bf233f5cf5f41bed8e2928f1876dbeafc1f61996a444"
|
||||
dependencies = [
|
||||
"bevy_app",
|
||||
"bevy_ecs",
|
||||
"bevy_hierarchy",
|
||||
"bevy_math",
|
||||
"bevy_picking_core",
|
||||
"bevy_render",
|
||||
"bevy_transform",
|
||||
"bevy_ui",
|
||||
"bevy_utils",
|
||||
"bevy_window",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bevy_ptr"
|
||||
version = "0.14.1"
|
||||
|
@ -2990,6 +3186,7 @@ name = "queeridor"
|
|||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bevy",
|
||||
"bevy_mod_picking",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
|
@ -5,6 +5,7 @@ edition = "2021"
|
|||
|
||||
[dependencies]
|
||||
bevy = "0.14.1"
|
||||
bevy_mod_picking = "0.20.1"
|
||||
|
||||
# Enable a small amount of optimization in the dev profile.
|
||||
[profile.dev]
|
||||
|
|
12
src/main.rs
12
src/main.rs
|
@ -4,6 +4,7 @@ use bevy::{
|
|||
sprite::{MaterialMesh2dBundle, Mesh2dHandle},
|
||||
winit::WinitSettings,
|
||||
};
|
||||
use bevy_mod_picking::{debug::DebugPickingMode, DefaultPickingPlugins, PickableBundle};
|
||||
|
||||
// In a vacuum this is just 2, 2 dimenionsal arrays, but I think
|
||||
// that sort of state pattern doesn't fit well in the ECS architecture
|
||||
|
@ -59,6 +60,8 @@ fn main() {
|
|||
App::new()
|
||||
.insert_resource(WinitSettings::desktop_app())
|
||||
.add_plugins(DefaultPlugins)
|
||||
.add_plugins(DefaultPickingPlugins)
|
||||
.insert_resource(DebugPickingMode::Normal)
|
||||
.add_systems(Startup, setup)
|
||||
.run();
|
||||
}
|
||||
|
@ -87,7 +90,7 @@ fn setup(
|
|||
commands
|
||||
.spawn((
|
||||
SpatialBundle {
|
||||
transform: Transform::from_xyz(0., 0., 0.).with_scale(Vec3::splat(10.)),
|
||||
transform: Transform::from_scale(Vec3::splat(10.)),
|
||||
..default()
|
||||
},
|
||||
Board,
|
||||
|
@ -97,12 +100,15 @@ fn setup(
|
|||
for j in 0..TILES {
|
||||
let tile_x = i as f32 * TILE_SPACE - CENTER + OFFSET;
|
||||
let tile_y = j as f32 * TILE_SPACE - CENTER + OFFSET;
|
||||
parent.spawn(MaterialMesh2dBundle {
|
||||
parent.spawn((
|
||||
MaterialMesh2dBundle {
|
||||
mesh: tile_mesh.clone(),
|
||||
material: materials.add(tile_color),
|
||||
transform: Transform::from_xyz(tile_x, tile_y, 0.),
|
||||
..default()
|
||||
});
|
||||
},
|
||||
PickableBundle::default(),
|
||||
));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue