|
|
|
|
@ -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));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|