Skip to content

Commit

Permalink
Snake: Set Snake as default skin
Browse files Browse the repository at this point in the history
Set 'Snake' as the default skin for its aesthetic appeal and color
harmony with the game's icon.
  • Loading branch information
cubiclove committed Mar 13, 2024
1 parent 3d48c55 commit d2d115e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Userland/Games/Snake/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ ErrorOr<NonnullRefPtr<Game>> Game::try_create()
}

auto color = Color::from_argb(Config::read_u32("Snake"sv, "Snake"sv, "BaseColor"sv, Color(Color::Green).value()));
auto skin_name = TRY(String::from_byte_string(Config::read_string("Snake"sv, "Snake"sv, "SnakeSkin"sv, "Classic"sv)));
auto skin_name = TRY(String::from_byte_string(Config::read_string("Snake"sv, "Snake"sv, "SnakeSkin"sv, "Snake"sv)));
auto skin = TRY(SnakeSkin::create(skin_name, color));

return adopt_nonnull_ref_or_enomem(new (nothrow) Game(move(food_bitmaps), color, skin_name, move(skin)));
Expand Down
2 changes: 1 addition & 1 deletion Userland/Games/Snake/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
game.set_focus(true);

auto high_score = Config::read_u32("Snake"sv, "Snake"sv, "HighScore"sv, 0);
auto snake_skin_name = Config::read_string("Snake"sv, "Snake"sv, "SnakeSkin"sv, "Classic"sv);
auto snake_skin_name = Config::read_string("Snake"sv, "Snake"sv, "SnakeSkin"sv, "Snake"sv);

auto& statusbar = *widget->find_descendant_of_type_named<GUI::Statusbar>("statusbar"sv);
statusbar.set_text(0, "Score: 0"_string);
Expand Down

0 comments on commit d2d115e

Please sign in to comment.