Skip to content

Commit

Permalink
Fix breakout example scoreboard (#2770)
Browse files Browse the repository at this point in the history
# Objective

- The breakout scoreboard was not using the correct text section to display the score integer.

## Solution

- This updates the code to use the correct text section.
  • Loading branch information
squidboylan committed Sep 4, 2021
1 parent 321d998 commit ca54478
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/game/breakout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ fn ball_movement_system(mut ball_query: Query<(&Ball, &mut Transform)>) {

fn scoreboard_system(scoreboard: Res<Scoreboard>, mut query: Query<&mut Text>) {
let mut text = query.single_mut().unwrap();
text.sections[0].value = format!("Score: {}", scoreboard.score);
text.sections[1].value = format!("{}", scoreboard.score);
}

fn ball_collision_system(
Expand Down

0 comments on commit ca54478

Please sign in to comment.