Skip to content

Commit

Permalink
make sure birds don't go off screen
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf committed Dec 18, 2021
1 parent 35cd9c5 commit 889797b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/tools/bevymark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ fn collision_system(windows: Res<Windows>, mut bird_query: Query<(&mut Bird, &Tr
if y_vel < 0. && y_pos - HALF_BIRD_SIZE < -half_height {
bird.velocity.y = -y_vel;
}
if y_pos + HALF_BIRD_SIZE > half_height && y_vel > 0.0 {
bird.velocity.y = 0.0;
}
}
}

Expand Down

0 comments on commit 889797b

Please sign in to comment.