small enemies spawn adjustments
This commit is contained in:
@@ -162,7 +162,7 @@ fn shot_collision(
|
|||||||
let shot_entity = if query_shot.contains(*e1) { *e1 } else { *e2 };
|
let shot_entity = if query_shot.contains(*e1) { *e1 } else { *e2 };
|
||||||
|
|
||||||
if let Ok(mut entity) = commands.get_entity(shot_entity) {
|
if let Ok(mut entity) = commands.get_entity(shot_entity) {
|
||||||
entity.despawn();
|
entity.try_despawn();
|
||||||
} else {
|
} else {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ fn shot_collision(
|
|||||||
};
|
};
|
||||||
|
|
||||||
if let Ok(mut entity) = commands.get_entity(shot_entity) {
|
if let Ok(mut entity) = commands.get_entity(shot_entity) {
|
||||||
entity.despawn();
|
entity.try_despawn();
|
||||||
} else {
|
} else {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ impl EnemySpawn {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let mut this_transform = *this_transform;
|
let mut this_transform = *this_transform;
|
||||||
this_transform.translation += Vec3::new(0., 1., 0.);
|
this_transform.translation += Vec3::new(0., 1.5, 0.);
|
||||||
|
|
||||||
let head = this.head.clone();
|
let head = this.head.clone();
|
||||||
|
|
||||||
@@ -141,7 +141,7 @@ impl EnemySpawn {
|
|||||||
Name::from(format!("enemy [{}]", head)),
|
Name::from(format!("enemy [{}]", head)),
|
||||||
Visibility::default(),
|
Visibility::default(),
|
||||||
RigidBody::Dynamic,
|
RigidBody::Dynamic,
|
||||||
Collider::capsule(0.4, 2.),
|
Collider::capsule(0.6, 2.),
|
||||||
CollisionLayers::new(LayerMask(GameLayer::Npc.to_bits()), LayerMask::ALL),
|
CollisionLayers::new(LayerMask(GameLayer::Npc.to_bits()), LayerMask::ALL),
|
||||||
LockedAxes::new().lock_rotation_z().lock_rotation_x(),
|
LockedAxes::new().lock_rotation_z().lock_rotation_x(),
|
||||||
));
|
));
|
||||||
|
|||||||
Reference in New Issue
Block a user