diff --git a/src/bin/tetris/main.rs b/src/bin/tetris/main.rs index 4dd03f0..25aa4b7 100644 --- a/src/bin/tetris/main.rs +++ b/src/bin/tetris/main.rs @@ -92,6 +92,10 @@ struct BlockOf { parent: Entity, } +// Just marks a block either of a shape or line +#[derive(Component, Debug)] +struct Block; + #[derive(Component, Debug)] #[require(GridPosition)] struct RelativePosition { @@ -454,7 +458,7 @@ fn set_piece( .entity(e) .with_related_entities::(|parent| { positions.into_iter().for_each(|rp| { - parent.spawn((Mesh2d(mesh.clone()), MeshMaterial2d(mat.clone()), rp)); + parent.spawn((Mesh2d(mesh.clone()), MeshMaterial2d(mat.clone()), rp, Block)); }); }); } else { @@ -569,9 +573,9 @@ fn clock_cycle(n: f32) -> impl FnMut(Res