From fdd691f29a6dc0aad5cdb31d6b1c1c3b6afa3b3e Mon Sep 17 00:00:00 2001 From: Elijah Voigt Date: Fri, 8 Aug 2025 13:10:47 -0700 Subject: [PATCH] Fix bird, maybe other suff too Still failing at scoring in weird, need to do something about that... --- assets/flappy/bird.png | 4 ++-- src/bin/flappy/main.rs | 15 ++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/assets/flappy/bird.png b/assets/flappy/bird.png index 035078a..ca5fcc5 100644 --- a/assets/flappy/bird.png +++ b/assets/flappy/bird.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8ca8a74c9a35e081d87a658b043fed83cea064eff010f4989624de5759227d39 -size 144 +oid sha256:c9b7438371f7bb0639d93b4b6b3bb99cc7179f740b1e77e7e6b5c7aeec89335d +size 247 diff --git a/src/bin/flappy/main.rs b/src/bin/flappy/main.rs index 9d51f52..921df4c 100644 --- a/src/bin/flappy/main.rs +++ b/src/bin/flappy/main.rs @@ -143,20 +143,21 @@ fn init_bird( ) { let material = MeshMaterial2d(materials.add(ColorMaterial { texture: Some(server.load("flappy/bird.png")), - color: ORANGE.into(), + // color: ORANGE.into(), + color: BLACK.into(), alpha_mode: AlphaMode2d::Blend, ..default() })); - let mesh = Mesh2d(meshes.add(Rectangle::new(1.0, 1.0))); + let mesh = Mesh2d(meshes.add(Rectangle::new(1.0, 1.2))); let name = Name::new("bird"); - let t = Transform::from_xyz(0.0, 0.0, 0.0).with_scale(Vec3::splat(100.0)); + let t = Transform::from_xyz(0.0, 0.0, 0.0).with_scale(Vec3::splat(50.0)); let physics = ( RigidBody::Static, - Collider::circle(0.5), + Collider::rectangle(1.0, 1.2), Mass(10.0), ExternalImpulse::default().with_persistence(false), MaxLinearSpeed(500.0), @@ -450,8 +451,7 @@ fn init_ui(mut commands: Commands) { )) .with_children(|parent| { parent.spawn((Node { - align_self: AlignSelf::End, - justify_self: JustifySelf::End, + align_self: AlignSelf::Center, ..default() }, Button, children![Text::new("Close")])); }).observe(hide_credits); @@ -836,7 +836,8 @@ fn debug_collision_end_observations( /// When the player moves forward while alive /// spawn more batches and despawn old batches fn manage_batches( - trigger: Trigger, + // TODO: Trigger on both start and end?? + trigger: Trigger, state: Res>, bird: Query>, batches: Query<(Entity, &Batch)>,