|
|
|
|
@ -201,11 +201,11 @@ impl Tape {
|
|
|
|
|
fn init_bird(mut commands: Commands, bird_assets: Res<BirdAssets>) {
|
|
|
|
|
let name = Name::new("bird");
|
|
|
|
|
|
|
|
|
|
let t = Transform::from_xyz(0.0, 0.0, 0.0).with_scale(Vec3::splat(50.0));
|
|
|
|
|
let t = Transform::from_xyz(0.0, 0.0, 0.0).with_scale(Vec3::new(62.5, 50.0, 50.0));
|
|
|
|
|
|
|
|
|
|
let physics = (
|
|
|
|
|
RigidBody::Static,
|
|
|
|
|
Collider::rectangle(1.0, 1.2),
|
|
|
|
|
Collider::rectangle(1.0, 1.0),
|
|
|
|
|
Mass(10.0),
|
|
|
|
|
ExternalImpulse::default().with_persistence(false),
|
|
|
|
|
MaxLinearSpeed(500.0),
|
|
|
|
|
@ -318,8 +318,8 @@ fn populate_ground(
|
|
|
|
|
ground_assets.mesh.clone(),
|
|
|
|
|
Name::new("ground"),
|
|
|
|
|
RigidBody::Static,
|
|
|
|
|
Collider::rectangle(1.0, 1.0),
|
|
|
|
|
Transform::from_xyz(100.0 * (*idx) as f32, -300.0, -1.0).with_scale(Vec3::splat(100.0)),
|
|
|
|
|
Collider::rectangle(1.0, 0.75),
|
|
|
|
|
Transform::from_xyz(100.0 * (*idx) as f32, -275.0, -1.0).with_scale(Vec3::splat(100.0)),
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -336,7 +336,7 @@ fn populate_ceiling(
|
|
|
|
|
ceiling_assets.mesh.clone(),
|
|
|
|
|
Name::new("ceiling"),
|
|
|
|
|
RigidBody::Static,
|
|
|
|
|
Collider::rectangle(1.0, 1.0),
|
|
|
|
|
Collider::rectangle(1.0, 0.75),
|
|
|
|
|
Transform::from_xyz(100.0 * (*idx) as f32, 300.0, -3.0).with_scale(Vec3::splat(100.0)),
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
@ -473,14 +473,14 @@ fn init_assets(
|
|
|
|
|
|
|
|
|
|
ground_assets.material = MeshMaterial2d(materials.add(ColorMaterial {
|
|
|
|
|
texture: Some(server.load("flappy/ground.png")),
|
|
|
|
|
color: Srgba::new(0.1, 0.1, 0.1, 1.0).into(),
|
|
|
|
|
color: GREEN.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: Srgba::new(0.1, 0.1, 0.1, 1.0).into(),
|
|
|
|
|
color: FIRE_BRICK.into(),
|
|
|
|
|
..default()
|
|
|
|
|
}));
|
|
|
|
|
ceiling_assets.mesh = Mesh2d(meshes.add(Rectangle::new(1.0, 0.777)));
|
|
|
|
|
@ -742,7 +742,7 @@ fn init_background(
|
|
|
|
|
{
|
|
|
|
|
let material = MeshMaterial2d(materials.add(ColorMaterial {
|
|
|
|
|
texture: Some(server.load("flappy/background-city.png")),
|
|
|
|
|
color: Srgba::new(0.3, 0.3, 0.3, 1.0).into(),
|
|
|
|
|
color: LIGHT_GREY.with_alpha(0.8).into(),
|
|
|
|
|
alpha_mode: AlphaMode2d::Blend,
|
|
|
|
|
..default()
|
|
|
|
|
}));
|
|
|
|
|
@ -760,7 +760,7 @@ fn init_background(
|
|
|
|
|
{
|
|
|
|
|
let material = MeshMaterial2d(materials.add(ColorMaterial {
|
|
|
|
|
texture: Some(server.load("flappy/background-clouds.png")),
|
|
|
|
|
color: Srgba::new(0.2, 0.2, 0.2, 1.0).into(),
|
|
|
|
|
color: WHITE_SMOKE.with_alpha(0.8).into(),
|
|
|
|
|
alpha_mode: AlphaMode2d::Blend,
|
|
|
|
|
..default()
|
|
|
|
|
}));
|
|
|
|
|
|