From b523c52b120286926b9161fdff46d26741539317 Mon Sep 17 00:00:00 2001 From: paulobressan Date: Thu, 18 Apr 2024 19:09:44 -0300 Subject: [PATCH] feat: added dynamic ship hud --- Cargo.lock | 203 ++++++++++++++++++++++++++++++ visualizer/Cargo.toml | 9 +- visualizer/assets/fonts/pixel.ttf | Bin 0 -> 66716 bytes visualizer/src/main.rs | 4 +- visualizer/src/ships.rs | 141 +++++++++++++++++++-- 5 files changed, 346 insertions(+), 11 deletions(-) create mode 100644 visualizer/assets/fonts/pixel.ttf diff --git a/Cargo.lock b/Cargo.lock index d84b6c7..7da5713 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -495,6 +495,7 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65b9eadaacf8fe971331bc3f250f35c18bc9dace3f96b483062f38ac07e3a1b4" dependencies = [ + "bevy_dylib", "bevy_internal", ] @@ -671,6 +672,15 @@ dependencies = [ "sysinfo", ] +[[package]] +name = "bevy_dylib" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "922826e3b8f37c19836b49e18ceca662260cce87ab8faa4db6df8433903660cc" +dependencies = [ + "bevy_internal", +] + [[package]] name = "bevy_ecs" version = "0.13.2" @@ -713,6 +723,30 @@ dependencies = [ "encase_derive_impl", ] +[[package]] +name = "bevy_eventlistener" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9d65c75b4f81818cacdc8a4302c5413910c5fb7727564deaf95e56e0dea4bd0" +dependencies = [ + "bevy_app", + "bevy_ecs", + "bevy_eventlistener_derive", + "bevy_hierarchy", + "bevy_utils", +] + +[[package]] +name = "bevy_eventlistener_derive" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa29be733a02a5d7ca4507ef15f294711c1a0884b9a9a2730640ff4e7d0200ab" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.58", +] + [[package]] name = "bevy_gilrs" version = "0.13.2" @@ -909,6 +943,54 @@ dependencies = [ "glam", ] +[[package]] +name = "bevy_mod_picking" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d79f17a34025d95e2e3525207ec73090647c6f40c3136fc674f87e167a9ae6be" +dependencies = [ + "bevy_app", + "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.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ca646aeaab4a170e1f3e8284b925e2f990eb18616e95d7826c873c8e26ee945" +dependencies = [ + "bevy_app", + "bevy_asset", + "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_pancam" version = "0.11.1" @@ -952,6 +1034,126 @@ dependencies = [ "thread_local", ] +[[package]] +name = "bevy_picking_core" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41c8cdca408508a7d006bf077c6cbb6660a65895323333f206b7cce7b801a8e2" +dependencies = [ + "bevy_app", + "bevy_derive", + "bevy_ecs", + "bevy_eventlistener", + "bevy_math", + "bevy_reflect", + "bevy_render", + "bevy_transform", + "bevy_utils", + "bevy_window", +] + +[[package]] +name = "bevy_picking_highlight" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e684569b5f7dae06d1ff66e2287cee808b3862d9ae0d01dbe114d7d199d40cfd" +dependencies = [ + "bevy_app", + "bevy_asset", + "bevy_ecs", + "bevy_pbr", + "bevy_picking_core", + "bevy_picking_selection", + "bevy_reflect", + "bevy_render", + "bevy_sprite", +] + +[[package]] +name = "bevy_picking_input" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60182209f48943de6c8bc3305a70f52012a18ef26f92f460f9436441b8badf0b" +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.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2677d0a3402fea3327a216649c104f969685a5c01d969d274c89facba86c164d" +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.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc986eefd38058918322418d1e6ae398e74d48730e623a55dc20be78d5ee24b" +dependencies = [ + "bevy_app", + "bevy_ecs", + "bevy_eventlistener", + "bevy_input", + "bevy_picking_core", + "bevy_reflect", + "bevy_utils", +] + +[[package]] +name = "bevy_picking_sprite" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ac5309026e8c7f5aed2afec3aa2f21fb0a0487e9bb3d851860377891459df75" +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.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85ad6d40e33203115af38adc984341cf5637911baa940028b6a43a9917d64e79" +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_prng" version = "0.5.2" @@ -5212,6 +5414,7 @@ name = "visualizer" version = "0.1.0" dependencies = [ "bevy", + "bevy_mod_picking", "bevy_pancam", "bevy_panorbit_camera", "bevy_rand", diff --git a/visualizer/Cargo.toml b/visualizer/Cargo.toml index d875dc3..ceb3546 100644 --- a/visualizer/Cargo.toml +++ b/visualizer/Cargo.toml @@ -6,12 +6,19 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -bevy = "0.13.2" +bevy = { version = "0.13.2", features = ["dynamic_linking"] } bevy_pancam = "0.11.1" bevy_panorbit_camera = "0.17.0" rand = "0.8.5" rand_core = "0.6" bevy_rand = { version = "0.5", features = ["rand_chacha", "wyrand"] } +bevy_mod_picking = "0.18.2" [target.wasm32-unknown-unknown] runner = "wasm-server-runner" + +[profile.dev] +opt-level = 1 + +[profile.dev.package."*"] +opt-level = 3 diff --git a/visualizer/assets/fonts/pixel.ttf b/visualizer/assets/fonts/pixel.ttf new file mode 100644 index 0000000000000000000000000000000000000000..f7691c8d55c567739efaac6c168dacd842a71b62 GIT binary patch literal 66716 zcmeIb34k3(b?;r>ckYa4-xtkjxmUAE8ZDzc8m+c4M&3YxkXR&QWDAeH$eXZ@<2XPZ zVt70~!cz#04RLtj0C5N*0`iCveqh8lCSU{@LW}`p3^;}uLqtLbYwq{|ovOaKXEgFc z@_pZXc{5Vq(_LNNU3K<4b-LO`&bb!-RJh#Mo#&mSqu50iZxft%&epTeu3S|4ug?AJ z13KPz&h{7X{Oz;feXVo9TIyU)_c=RXa_07-Yv19bc&jec+0})@KYj7*&P8{q{)HD^ zx%a@!-o9thx$I%*GKVg@{<>WJwJM#fyHDqrTzue?E3aExzt*|xGj#orF4=qS0hKrD zd7Phj$rZnI@n3y^^DV0XE9ZWA)1~|NjxAmJxiz}~3Y}kfsS2vsWWTE8F&+0^dgXOD zyno-)59nU=^t?N+xcZ{K?a#XZM(2KUgX(*~Mzg2vN+>3TAc zsKkB$muGNZ@Y(x|U!K~MJ*VPz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_WMTree>1Vj9um4 zYQMMI@4K#j^?_^Md+qlF_Io(AJMDY2A6t3)m$rIOHu=q1N%|Kr7J2c%m1;SkRU43B zwjq>iBG1mAVf~CW@~PBu>~59L@lW_>sPULe>x8KrY@88k&yUPzFO4*o!na?myVQuH z-5RUCM%T1RDt^~sryV~Wjvp4q__%z7#w*n7G)O6ZZ&SN9{#JRU@gKcmgpT*$8jfRW z#H~+Rr=SrXiKvn2$kXbiPh*Yv7)iWPrI9o*qxuSI+TXDa-1bQ;Z`GClxzYav$::default()) + .add_plugins(DefaultPickingPlugins) .add_systems(Startup, setup_camera) .add_systems(Startup, setup_ui) .add_plugins((map::MapPlugin, ships::ShipsPlugin, asteroid::AsteroidPlugin)) diff --git a/visualizer/src/ships.rs b/visualizer/src/ships.rs index 7ee2c00..834bbca 100644 --- a/visualizer/src/ships.rs +++ b/visualizer/src/ships.rs @@ -1,11 +1,8 @@ -use std::time::Duration; - use bevy::{prelude::*, time::common_conditions::on_timer}; -use bevy_rand::{ - prelude::{ChaCha8Rng, WyRand}, - resource::GlobalEntropy, -}; +use bevy_mod_picking::prelude::*; +use bevy_rand::{prelude::WyRand, resource::GlobalEntropy}; use rand::Rng; +use std::time::Duration; use crate::map::{Fuel, Position, ShipIdentity}; @@ -86,7 +83,6 @@ fn render(mut query: Query<(&mut Transform, &Position)>) { fn random_move( mut query: Query<(&mut Position, &Fuel), With>, - time: Res