generated from 2ndbeam/bevy-template
fix: Applying player direction to AttackArea
This commit is contained in:
parent
fb1923fe53
commit
e80a7cc154
1 changed files with 2 additions and 1 deletions
|
|
@ -89,8 +89,9 @@ pub fn handle_input(
|
||||||
|
|
||||||
if let Some(attack_area) = weapon.attack_area(attacking.phys, attacking.accuracy) {
|
if let Some(attack_area) = weapon.attack_area(attacking.phys, attacking.accuracy) {
|
||||||
let offset = weapon.attack_offset();
|
let offset = weapon.attack_offset();
|
||||||
|
let direction = if sprite.flip_x { vec2(-1., 1.) } else { vec2(1., 1.) };
|
||||||
commands.entity(player_id)
|
commands.entity(player_id)
|
||||||
.with_child(attack_area.into_bundle(offset, sprite.flip_x, GROUP_ENEMY));
|
.with_child(attack_area.into_bundle(offset * direction, sprite.flip_x, GROUP_ENEMY));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if let Some(mut awaiting) = maybe_awaiting {
|
} else if let Some(mut awaiting) = maybe_awaiting {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue