diff --git a/src/bin/flappy/main.rs b/src/bin/flappy/main.rs index 766989e..d70eff0 100644 --- a/src/bin/flappy/main.rs +++ b/src/bin/flappy/main.rs @@ -226,14 +226,14 @@ fn init_obstacles( info!("Jitter for {i} is {jitter}"); let above = { let x = 300.0 * i as f32; - let y = 300.0 + jitter; + let y = f32::min(300.0 + jitter, 400.0); Transform::from_xyz(x, y, -1.0).with_scale(Vec3::splat(100.0)) }; commands.spawn((pipe.clone(), above)); let below = { let x = 300.0 * i as f32; - let y = -200.0 + jitter; + let y = f32::max(-200.0 + jitter, -300.0); Transform::from_xyz(x, y, -1.0).with_scale(Vec3::splat(100.0)) }; commands.spawn((pipe.clone(), below));