update to BTB release!

This commit is contained in:
2025-05-16 14:27:21 +02:00
parent c69a528625
commit 16aaf2a961
5 changed files with 26 additions and 30 deletions

View File

@@ -12,21 +12,11 @@ pub struct ProjectileOrigin;
#[derive(Component, Debug)]
pub struct AnimatedCharacter {
head: usize,
rotate_180: bool,
}
impl AnimatedCharacter {
pub fn new(head: usize) -> Self {
Self {
head,
rotate_180: false,
}
}
pub fn with_rotation(self) -> Self {
let mut s = self;
s.rotate_180 = true;
s
Self { head }
}
}
@@ -92,9 +82,7 @@ fn spawn(
let mut t =
Transform::from_translation(Vec3::new(0., -1.45, 0.)).with_scale(Vec3::splat(1.2));
if character.rotate_180 {
t.rotate_y(PI);
}
t.rotate_y(PI);
commands
.entity(entity)

View File

@@ -45,10 +45,7 @@ fn init(mut commands: Commands, query: Query<(Entity, &EnemySpawn)>, heads_db: R
]),
))
.insert_if(Ai, || !spawn.disable_ai)
.with_child((
Name::from("body-rig"),
AnimatedCharacter::new(id).with_rotation(),
))
.with_child((Name::from("body-rig"), AnimatedCharacter::new(id)))
.observe(on_kill);
}
}

View File

@@ -36,25 +36,25 @@ impl SpawnPoint {
#[derive(SolidClass, Component, Reflect, Default)]
#[reflect(QuakeClass, Component)]
#[geometry(GeometryProvider::new().convex_collider())]
#[spawn_hooks(SpawnHooks::new().convex_collider())]
pub struct Worldspawn;
#[derive(SolidClass, Component, Reflect, Default)]
#[reflect(QuakeClass, Component)]
#[geometry(GeometryProvider::new())]
#[spawn_hooks(SpawnHooks::new())]
#[base(Transform)]
pub struct Water;
#[derive(SolidClass, Component, Reflect, Default)]
#[reflect(QuakeClass, Component)]
#[base(Transform)]
#[geometry(GeometryProvider::new().convex_collider())]
#[spawn_hooks(SpawnHooks::new().convex_collider())]
pub struct Crates;
#[derive(SolidClass, Component, Reflect, Default)]
#[reflect(QuakeClass, Component)]
#[base(Transform)]
#[geometry(GeometryProvider::new().convex_collider())]
#[spawn_hooks(SpawnHooks::new().convex_collider())]
pub struct NamedEntity {
pub name: String,
}
@@ -62,7 +62,7 @@ pub struct NamedEntity {
#[derive(SolidClass, Component, Reflect, Default)]
#[reflect(QuakeClass, Component)]
#[base(Transform, Target)]
#[geometry(GeometryProvider::new().convex_collider())]
#[spawn_hooks(SpawnHooks::new().convex_collider())]
pub struct Platform;
#[derive(PointClass, Component, Reflect, Default)]
@@ -75,7 +75,7 @@ pub struct PlatformTarget {
#[derive(SolidClass, Component, Reflect, Default)]
#[reflect(QuakeClass, Component)]
#[base(Transform, Target)]
#[geometry(GeometryProvider::new().convex_collider())]
#[spawn_hooks(SpawnHooks::new().convex_collider())]
pub struct Movable {
pub name: String,
}