From d1957652c512b7dfb5ed46392a629d97bb3bf231 Mon Sep 17 00:00:00 2001 From: Elijah Voigt Date: Tue, 19 Aug 2025 11:25:53 -0700 Subject: [PATCH] technically functional, just looks very bad. --- src/bin/flappy/main.rs | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/src/bin/flappy/main.rs b/src/bin/flappy/main.rs index 789e11a..928e259 100644 --- a/src/bin/flappy/main.rs +++ b/src/bin/flappy/main.rs @@ -110,7 +110,7 @@ fn main() { fn tweak_camera(camera: Single<(Entity, &mut Camera)>, mut commands: Commands) { debug!("Tweaking camera"); let (e, mut c) = camera.into_inner(); - c.clear_color = ClearColorConfig::Custom(WHITE.into()); + c.clear_color = ClearColorConfig::Custom(DEEP_SKY_BLUE.into()); commands.entity(e).insert(ColorGrading { ..default() }); } @@ -440,14 +440,14 @@ fn init_assets( ground_assets.material = MeshMaterial2d(materials.add(ColorMaterial { texture: Some(server.load("flappy/ground.png")), - color: BLACK.into(), + color: Srgba::new(0.9, 0.9, 0.9, 1.0).into(), ..default() })); ground_assets.mesh = Mesh2d(meshes.add(Rectangle::new(1.0, 1.0))); ceiling_assets.material = MeshMaterial2d(materials.add(ColorMaterial { texture: Some(server.load("flappy/ceiling.png")), - color: BLACK.into(), + color: Srgba::new(0.9, 0.9, 0.9, 1.0).into(), ..default() })); ceiling_assets.mesh = Mesh2d(meshes.add(Rectangle::new(1.0, 0.777))); @@ -709,35 +709,37 @@ fn init_background( { let material = MeshMaterial2d(materials.add(ColorMaterial { texture: Some(server.load("flappy/background-city.png")), - color: BLACK.into(), + color: Srgba::new(0.3, 0.3, 0.3, 1.0).into(), alpha_mode: AlphaMode2d::Blend, ..default() })); let mesh = Mesh2d(meshes.add(Rectangle::new(1.0, 1.0))); - let t = Transform::from_xyz(0.0, 0.0, -32.0).with_scale(Vec3::splat(650.0)); - commands.spawn((ParallaxDepth(4.0), mesh, material, t)); + { + let t = Transform::from_xyz(-325.0, 0.0, -32.0).with_scale(Vec3::splat(650.0)); + commands.spawn((ParallaxDepth(4.0), mesh.clone(), material.clone(), t)); + } + + { + let t = Transform::from_xyz(325.0, 0.0, -32.0).with_scale(Vec3::splat(650.0)); + commands.spawn((ParallaxDepth(4.0), mesh.clone(), material.clone(), t)); + } } { let material = MeshMaterial2d(materials.add(ColorMaterial { texture: Some(server.load("flappy/background-clouds.png")), - color: BLACK.into(), - alpha_mode: AlphaMode2d::Blend, - ..default() - })); - let mesh = Mesh2d(meshes.add(Rectangle::new(1.0, 1.0))); - let t = Transform::from_xyz(0.0, 0.0, -64.0).with_scale(Vec3::splat(650.0)); - commands.spawn((ParallaxDepth(8.0), mesh, material, t)); - } - { - let material = MeshMaterial2d(materials.add(ColorMaterial { - texture: Some(server.load("flappy/background-gradient.png")), - color: BLACK.into(), + color: Srgba::new(0.2, 0.2, 0.2, 1.0).into(), alpha_mode: AlphaMode2d::Blend, ..default() })); let mesh = Mesh2d(meshes.add(Rectangle::new(1.0, 1.0))); - let t = Transform::from_xyz(0.0, 0.0, -128.0).with_scale(Vec3::splat(650.0)); - commands.spawn((ParallaxDepth(16.0), mesh, material, t)); + { + let t = Transform::from_xyz(-325.0, 0.0, -64.0).with_scale(Vec3::splat(650.0)); + commands.spawn((ParallaxDepth(8.0), mesh.clone(), material.clone(), t)); + } + { + let t = Transform::from_xyz(325.0, 0.0, -64.0).with_scale(Vec3::splat(650.0)); + commands.spawn((ParallaxDepth(8.0), mesh.clone(), material.clone(), t)); + } } }