Skip to content

Commit

Permalink
pills
Browse files Browse the repository at this point in the history
  • Loading branch information
stillonearth committed Jun 6, 2024
1 parent 9719676 commit 696c55c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/entities/characters/psychiatrist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/entities/weapons/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pub mod pill;
pub mod speargun;
pub mod weapon_arrow;

Expand All @@ -10,6 +11,7 @@ impl Plugin for WeaponsPlugin {
app.add_plugins((
// weapon_arrow::WeaponArrowPlugin,
speargun::WeaponSpeargunPlugin,
pill::WeaponPillPlugin,
));
}
}
5 changes: 2 additions & 3 deletions src/entities/weapons/speargun.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;

// ----------
Expand Down Expand Up @@ -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,
Expand All @@ -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(),
Expand Down
2 changes: 2 additions & 0 deletions src/loading.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ pub struct StaticSpriteAssets {
pub speargun: Handle<Image>,
#[asset(path = "sprites/speargun-arrow.png")]
pub speargun_arrow: Handle<Image>,
#[asset(path = "sprites/pill.png")]
pub pill: Handle<Image>,
}

#[derive(AssetCollection, Resource)]
Expand Down

0 comments on commit 696c55c

Please sign in to comment.