/// Your worst nightmare
#[derive(Component)]
struct Polly;
// Make Polly, your *nightmare*
fn setup_debug(
mut commands: Commands,
mut meshes: ResMut<Assets<Mesh>>,
mut materials: ResMut<Assets<ColorMaterial>>,
) {
commands.spawn((
Polly,
movement_pointer::MovementDirection(Vec2::X, 0.0),
MaterialMesh2dBundle {
mesh: meshes
.add(Rectangle {
half_size: (16.0, 24.0).into(),
})
.into(),
// Be careful not to overwrite the LDtk transform
// Change our origin
material: materials.add(Color::PURPLE),
..default()
},
spawn_children(|cb| {
cb.spawn(movement_pointer::MovementPointerBundle {
pointer: movement_pointer::MovementPointer,
shape: ShapeBundle {
spatial: SpatialBundle {
transform: Transform::default().with_scale(Vec3::new(0.5, 1.0, 1.0)),
..default()
},
path: GeometryBuilder::build_as(&shapes::RegularPolygon {
sides: 3,
feature: shapes::RegularPolygonFeature::Apothem(5.0),
..default()
}),
material: materials.add(Color::ORANGE_RED),
..default()
},
});
}),
));
}