Fix bird, maybe other suff too

Still failing at scoring in weird, need to do something about that...
main
Elijah Voigt 3 months ago
parent 5f4a170a05
commit fdd691f29a

BIN
assets/flappy/bird.png (Stored with Git LFS)

Binary file not shown.

@ -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<OnCollisionStart>,
// TODO: Trigger on both start and end??
trigger: Trigger<OnCollisionEnd>,
state: Res<State<PlayerState>>,
bird: Query<Entity, With<Bird>>,
batches: Query<(Entity, &Batch)>,

Loading…
Cancel
Save