cargo: fmt
This commit is contained in:
parent
a8a342c379
commit
f34c4a4803
|
@ -57,7 +57,10 @@ fn main() {
|
|||
.init_resource::<UiState>()
|
||||
.init_resource::<OpenWindows>()
|
||||
.add_systems(Startup, (setup, setup_ui))
|
||||
.add_systems(Update, (render_ui, movement, camera_follow, player_regen, attack))
|
||||
.add_systems(
|
||||
Update,
|
||||
(render_ui, movement, camera_follow, player_regen, attack),
|
||||
)
|
||||
.run();
|
||||
}
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ pub fn attack(
|
|||
keys: Res<ButtonInput<KeyCode>>,
|
||||
mut set: ParamSet<(
|
||||
Query<&mut Transform, With<Attack>>,
|
||||
Query<&Transform, With<Player>>
|
||||
Query<&Transform, With<Player>>,
|
||||
)>,
|
||||
mut player_query: Query<&mut Player>,
|
||||
mut commands: Commands,
|
||||
|
@ -81,7 +81,8 @@ pub fn attack(
|
|||
let mut player = player_query.single_mut();
|
||||
|
||||
for player_transform in set.p1().iter_mut() {
|
||||
let attack_position = player_transform.translation + ((player_transform.rotation * Vec3::Y) * 100.);
|
||||
let attack_position =
|
||||
player_transform.translation + ((player_transform.rotation * Vec3::Y) * 100.);
|
||||
|
||||
if keys.just_pressed(KeyCode::Enter) {
|
||||
commands
|
||||
|
|
|
@ -118,12 +118,12 @@ pub fn render_ui(
|
|||
.show(ui, |ui| {
|
||||
let health_bar = egui::widgets::ProgressBar::new(player.health)
|
||||
.desired_width(window_width / 10.);
|
||||
let mut stamina_bar = egui::widgets::ProgressBar::new(player.stamina / player.stamina_max)
|
||||
let mut stamina_bar =
|
||||
egui::widgets::ProgressBar::new(player.stamina / player.stamina_max)
|
||||
.desired_width(window_width / 10.);
|
||||
let mana_bar = egui::widgets::ProgressBar::new(player.mana / player.mana_max)
|
||||
.desired_width(window_width / 10.);
|
||||
|
||||
|
||||
// Show the stamina bar to be empty if the player has no stamina
|
||||
if player.stamina <= 0. {
|
||||
stamina_bar =
|
||||
|
|
Reference in a new issue