add impaler scaffolding and teams

This commit is contained in:
Jim 2025-08-25 08:31:33 -04:00
parent af45237701
commit 6659fe8e5a
Signed by: jim
GPG key ID: 3236D2F059A7C0AC
12 changed files with 151 additions and 21 deletions

View file

@ -11,6 +11,7 @@ state = { path = "../state" }
camera = { path = "../camera" }
combat = { path = "../combat" }
building_core = { path = "../building_core" }
building_impaler = { path = "../building_impaler" }
[lints]
workspace = true

View file

@ -10,6 +10,7 @@ use bevy::{
render::camera::Exposure,
};
use building_core::SpawnCore;
use building_impaler::SpawnImpaler;
use camera::ControlledCamera;
use combat::{Attacked, Defense, Health};
use state::AppState;
@ -27,6 +28,7 @@ fn setup(
mut meshes: ResMut<Assets<Mesh>>,
mut materials: ResMut<Assets<StandardMaterial>>,
mut core_writer: EventWriter<SpawnCore>,
mut impaler_writer: EventWriter<SpawnImpaler>,
) {
let level_size = 50.0;
// Static physics object with a collision shape
@ -47,9 +49,9 @@ fn setup(
commands
.spawn((
RigidBody::Dynamic,
Collider::cuboid(1.0, 1.0, 1.0),
Collider::cuboid(0.5, 0.5, 0.5),
AngularVelocity(Vec3::new(2.5, 3.5, 1.5)),
Mesh3d(meshes.add(Cuboid::from_length(1.0))),
Mesh3d(meshes.add(Cuboid::from_length(0.5))),
MeshMaterial3d(materials.add(StandardMaterial {
base_color: Color::srgb_u8(220, 156, 86),
metallic: 1.0,
@ -78,6 +80,9 @@ fn setup(
core_writer.write(SpawnCore {
transform: Transform::from_xyz(5.0, 1.0, 5.0),
});
impaler_writer.write(SpawnImpaler {
transform: Transform::from_xyz(-5.0, 0.5, 5.0),
});
// Light
commands.spawn((