mirror of
https://github.com/bevyengine/bevy
synced 2024-09-20 14:32:06 +00:00
So I think that the underlying issue is actually a system order ambiguity thing between `spawn_bonus` and `rotate_bonus`, but I'm not confident enough about `run_criteria`, `FixedTimeStep`, etc. to sort that out.
This commit is contained in:
parent
cd8025d0a7
commit
3dc7b685ab
1 changed files with 6 additions and 5 deletions
|
@ -330,11 +330,12 @@ fn spawn_bonus(
|
|||
// 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 {
|
||||
let mut cake_transform = transforms.get_mut(entity).unwrap();
|
||||
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(),
|
||||
);
|
||||
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(),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue