mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 15:46:33 +00:00
FlappyBug: Propagate errors in Cloud class
Move-construct Cloud into the Game class to improve error handling.
This commit is contained in:
parent
ff359c27e3
commit
6f592a32cc
Notes:
sideshowbarker
2024-07-17 22:18:46 +09:00
Author: https://github.com/creator1creeper1
Commit: 6f592a32cc
Pull-request: https://github.com/SerenityOS/serenity/pull/11383
Reviewed-by: https://github.com/sin-ack ✅
3 changed files with 19 additions and 9 deletions
|
@ -37,7 +37,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
window->set_title("Flappy Bug");
|
||||
window->set_double_buffering_enabled(false);
|
||||
window->set_resizable(false);
|
||||
auto widget = TRY(window->try_set_main_widget<FlappyBug::Game>(TRY(FlappyBug::Game::Bug::construct())));
|
||||
auto widget = TRY(window->try_set_main_widget<FlappyBug::Game>(TRY(FlappyBug::Game::Bug::construct()), TRY(FlappyBug::Game::Cloud::construct())));
|
||||
|
||||
widget->on_game_end = [&](u32 score) {
|
||||
if (score <= high_score)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue