normalized shooting direction. remove unnecessary prop
This commit is contained in:
parent
05ca78229f
commit
164f248066
@ -153,11 +153,10 @@ pub fn spawn_projectile(commands: &mut Commands, origin: Vec2, direction: Vec2)
|
||||
)))
|
||||
//.insert(Collider::ball(0.1))
|
||||
.insert(RigidBody::Dynamic)
|
||||
.insert(Velocity::linear(direction))
|
||||
.insert(Velocity::linear(direction.normalize() * 130.))
|
||||
//.insert(ActiveEvents::COLLISION_EVENTS)
|
||||
.insert(Projectile {
|
||||
duration: Timer::from_seconds(3.5, false),
|
||||
direction,
|
||||
})
|
||||
.id()
|
||||
}
|
||||
@ -165,5 +164,4 @@ pub fn spawn_projectile(commands: &mut Commands, origin: Vec2, direction: Vec2)
|
||||
#[derive(Debug, Component)]
|
||||
pub struct Projectile {
|
||||
pub duration: Timer,
|
||||
pub direction: Vec2,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user