Game Speed debug text (#103)

This commit is contained in:
Daedliy 2022-03-27 18:11:32 -03:00 committed by GitHub
parent 7c8f2ac60a
commit 730d1cb5d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 4 deletions

View File

@ -2063,9 +2063,10 @@ impl Scene for GameScene {
}
if state.settings.god_mode {
let debug_name = "GOD";
state.font.draw_text_with_shadow(
"GOD".chars(),
state.canvas_size.0 - 32.0,
debug_name.chars(),
state.canvas_size.0 - state.font.text_width(debug_name.chars(), &state.constants) - 10.0,
20.0,
&state.constants,
&mut state.texture_set,
@ -2074,9 +2075,10 @@ impl Scene for GameScene {
}
if state.settings.infinite_booster {
let debug_name = "INF.B";
state.font.draw_text_with_shadow(
"INF.B".chars(),
state.canvas_size.0 - 32.0,
debug_name.chars(),
state.canvas_size.0 - state.font.text_width(debug_name.chars(), &state.constants) - 10.0,
32.0,
&state.constants,
&mut state.texture_set,
@ -2084,6 +2086,18 @@ impl Scene for GameScene {
)?;
}
if state.settings.speed != 1.0 {
let tick_spd_mod = format!("{:.1}x SPD", state.settings.speed);
state.font.draw_text_with_shadow(
tick_spd_mod.chars(),
state.canvas_size.0 - state.font.text_width(tick_spd_mod.chars(), &state.constants) - 10.0,
44.0,
&state.constants,
&mut state.texture_set,
ctx,
)?;
}
self.replay.draw(state, ctx, &self.frame)?;
self.pause_menu.draw(state, ctx)?;