From 696c55c8b6ffb353c1c5d655fef6c05df1cdd167 Mon Sep 17 00:00:00 2001 From: Sergei Surovtsev Date: Thu, 6 Jun 2024 17:04:48 +0300 Subject: [PATCH] pills --- src/entities/characters/psychiatrist.rs | 2 +- src/entities/weapons/mod.rs | 2 ++ src/entities/weapons/speargun.rs | 5 ++--- src/loading.rs | 2 ++ 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/entities/characters/psychiatrist.rs b/src/entities/characters/psychiatrist.rs index a1a2995..82b36bd 100644 --- a/src/entities/characters/psychiatrist.rs +++ b/src/entities/characters/psychiatrist.rs @@ -96,7 +96,7 @@ pub fn psychiatrist_activity( - psychiatrist.move_direction.y * rotation_angle.sin(), psychiatrist.move_direction.x * rotation_angle.sin() + psychiatrist.move_direction.y * rotation_angle.cos(), - ) * 50.0; + ) * 100.0; } } diff --git a/src/entities/weapons/mod.rs b/src/entities/weapons/mod.rs index 8322116..de1e234 100644 --- a/src/entities/weapons/mod.rs +++ b/src/entities/weapons/mod.rs @@ -1,3 +1,4 @@ +pub mod pill; pub mod speargun; pub mod weapon_arrow; @@ -10,6 +11,7 @@ impl Plugin for WeaponsPlugin { app.add_plugins(( // weapon_arrow::WeaponArrowPlugin, speargun::WeaponSpeargunPlugin, + pill::WeaponPillPlugin, )); } } diff --git a/src/entities/weapons/speargun.rs b/src/entities/weapons/speargun.rs index 9511be2..93f2b2d 100644 --- a/src/entities/weapons/speargun.rs +++ b/src/entities/weapons/speargun.rs @@ -10,7 +10,6 @@ use bevy::prelude::*; use bevy::window::PrimaryWindow; use bevy_magic_light_2d::SpriteCamera; use bevy_rapier2d::geometry::Collider; -use bevy_rapier2d::na::ComplexField; use bevy_rapier2d::prelude::*; // ---------- @@ -126,7 +125,7 @@ fn handle_speargun_attack_event( for _ in ev_arrow_attack.read() { for (speargun_transform, _) in q_spearguns.iter() { for (_, parent, player_transform, _) in q_players.iter() { - commands.entity(parent.get()).with_children(|parent_| { + commands.entity(parent.get()).with_children(|parent| { let timer_despawn = SpeargunArrowDespawnTimer(Timer::new( Duration::from_secs_f32(1.0), TimerMode::Repeating, @@ -142,7 +141,7 @@ fn handle_speargun_attack_event( + 32.0 * Vec3::new(z_rot.cos(), z_rot.sin(), 0.0); let arrow_velocity = 350.0; - parent_.spawn(( + parent.spawn(( SpeargunArrowBundle { sprite_bundle: SpriteBundle { texture: static_sprite_assets.speargun_arrow.clone(), diff --git a/src/loading.rs b/src/loading.rs index a9def5e..0c44623 100644 --- a/src/loading.rs +++ b/src/loading.rs @@ -89,6 +89,8 @@ pub struct StaticSpriteAssets { pub speargun: Handle, #[asset(path = "sprites/speargun-arrow.png")] pub speargun_arrow: Handle, + #[asset(path = "sprites/pill.png")] + pub pill: Handle, } #[derive(AssetCollection, Resource)]