mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-23 08:00:20 +00:00
FlappyBug: Standardize on "high score" rather than "highscore"
"High score" should be two words, and this matches other games in the system.
This commit is contained in:
parent
1a2053781f
commit
675b8ba995
Notes:
sideshowbarker
2024-07-18 11:38:30 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/675b8ba995f Pull-request: https://github.com/SerenityOS/serenity/pull/8202
2 changed files with 5 additions and 5 deletions
|
@ -28,14 +28,14 @@ void Game::reset()
|
|||
void Game::game_over()
|
||||
{
|
||||
if (on_game_end)
|
||||
m_highscore = on_game_end(static_cast<u32>(m_difficulty));
|
||||
m_high_score = on_game_end(static_cast<u32>(m_difficulty));
|
||||
|
||||
reset();
|
||||
}
|
||||
|
||||
bool Game::ready_to_start() const
|
||||
{
|
||||
if (!m_highscore.has_value()) {
|
||||
if (!m_high_score.has_value()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -70,8 +70,8 @@ void Game::paint_event(GUI::PaintEvent& event)
|
|||
|
||||
if (m_active) {
|
||||
painter.draw_text({ 10, 10, 100, 100 }, String::formatted("{:.0}", m_difficulty), Gfx::TextAlignment::TopLeft, Color::White);
|
||||
} else if (m_highscore.has_value()) {
|
||||
auto message = String::formatted("Your score: {:.0}\nHighscore: {:.0}\n\n{}", m_last_score, m_highscore.value(), m_restart_cooldown < 0 ? "Press any key to play again" : " ");
|
||||
} else if (m_high_score.has_value()) {
|
||||
auto message = String::formatted("Your score: {:.0}\nHigh score: {:.0}\n\n{}", m_last_score, m_high_score.value(), m_restart_cooldown < 0 ? "Press any key to play again" : " ");
|
||||
painter.draw_text(rect(), message, Gfx::TextAlignment::Center, Color::White);
|
||||
} else {
|
||||
painter.draw_text(rect(), "Press any key to start", Gfx::TextAlignment::Center, Color::White);
|
||||
|
|
|
@ -143,7 +143,7 @@ private:
|
|||
Obstacle m_obstacle;
|
||||
Cloud m_cloud;
|
||||
bool m_active;
|
||||
Optional<float> m_highscore {};
|
||||
Optional<float> m_high_score {};
|
||||
float m_last_score {};
|
||||
float m_difficulty {};
|
||||
float m_restart_cooldown {};
|
||||
|
|
Loading…
Reference in a new issue