Skip to content

Commit

Permalink
more precision
Browse files Browse the repository at this point in the history
  • Loading branch information
Nertsal committed May 30, 2024
1 parent 57c3d11 commit b2331e0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/render/game.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ impl GameRender {

let fading = model.restart_button.is_fading() || model.exit_button.is_fading();

let accuracy = (model.score.calculated.accuracy.as_f32() * 100.0).floor() as i32;
let precision = (model.score.calculated.precision.as_f32() * 100.0).floor() as i32;
let accuracy = model.score.calculated.accuracy.as_f32() * 100.0;
let precision = model.score.calculated.precision.as_f32() * 100.0;

if let State::Lost { .. } | State::Finished = model.state {
if !fading {
Expand All @@ -218,14 +218,14 @@ impl GameRender {
framebuffer,
);
self.util.draw_text(
&format!("ACCURACY: {}%", accuracy),
&format!("ACCURACY: {:.2}%", accuracy),
vec2(-3.0, -3.5),
TextRenderOptions::new(0.7).color(theme.light),
&model.camera,
framebuffer,
);
self.util.draw_text(
&format!("PRECISION: {}%", precision),
&format!("PRECISION: {:.2}%", precision),
vec2(-3.0, -4.0),
TextRenderOptions::new(0.7).color(theme.light),
&model.camera,
Expand All @@ -244,7 +244,7 @@ impl GameRender {
);

self.util.draw_text(
format!("acc: {:3}%", accuracy),
format!("acc: {:3.2}%", accuracy),
vec2(-8.0, 4.0).as_r32(),
TextRenderOptions::new(0.7)
.color(theme.light)
Expand All @@ -254,7 +254,7 @@ impl GameRender {
);

self.util.draw_text(
format!("prec: {:3}%", precision),
format!("prec: {:3.2}%", precision),
vec2(-8.0, 3.5).as_r32(),
TextRenderOptions::new(0.7)
.color(theme.light)
Expand Down

0 comments on commit b2331e0

Please sign in to comment.