fn rotate_bonus(game: Res<Game>, time: Res<Time>, mut transforms: Query<&mut Transform>) {
    if let Some(entity) = game.bonus.entity {
        if let Ok(mut cake_transform) = transforms.get_mut(entity) {
            cake_transform.rotate(Quat::from_rotation_y(time.delta_seconds()));
            cake_transform.scale = Vec3::splat(
                1.0 + (game.score as f32 / 10.0 * time.seconds_since_startup().sin() as f32).abs(),
            );
        }
    }
}
// let the cake turn on itself
let the cake turn on itself
let the cake turn on itself
fn rotate_bonus(game: Res<Game>, time: Res<Time>, mut transforms: Query<&mut Transform>) {
    if let Some(entity) = game.bonus.entity {
        if let Ok(mut cake_transform) = transforms.get_mut(entity) {
            cake_transform.rotate(Quat::from_rotation_y(time.delta_seconds()));
            cake_transform.scale = Vec3::splat(
                1.0 + (game.score as f32 / 10.0 * time.seconds_since_startup().sin() as f32).abs(),
            );
        }
    }
}
fn rotate_bonus ( game : Res < Game > , time : Res < Time > , mut transforms : Query < & mut Transform > ) { if let Some ( entity ) = game . bonus . entity { if let Ok ( mut cake_transform ) = transforms . get_mut ( entity ) { cake_transform . rotate ( Quat :: from_rotation_y ( time . delta_seconds ( ) ) ) ; cake_transform . scale = Vec3 :: splat ( 1.0 + ( game . score as f32 / 10.0 * time . seconds_since_startup ( ) . sin ( ) as f32 ) . abs ( ) , ) ; } } }
let the cake turn on itself
let the cake turn on itself
game
Res<Game>
time
Res<Time>
transforms
Query<&mut Transform>
game
Res<Game>
time
Res<Time>
transforms
Query<&mut Transform>