1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 19:37:35 +00:00

BrickGame: Show where a piece would end up when after a fast drop

To show it to the player, draw a faint outline of where the piece would
end up.
This commit is contained in:
Karol Baraniecki 2023-04-07 21:10:19 +02:00 committed by Jelle Raaijmakers
parent 652a19b232
commit f3f14a7ef1
2 changed files with 55 additions and 8 deletions

View file

@ -15,6 +15,13 @@ class BrickGame : public GUI::Frame {
C_OBJECT(BrickGame);
public:
// How should a particular space on the board be presented to the user
enum class BoardSpace {
FullyOn,
ShadowHint,
Off
};
virtual ~BrickGame() override = default;
void reset();
@ -28,7 +35,7 @@ private:
void paint_sidebar_text(GUI::Painter&, int row, StringView);
void paint_paused_text(GUI::Painter&);
void paint_cell(GUI::Painter&, Gfx::IntRect, bool);
void paint_cell(GUI::Painter&, Gfx::IntRect, BoardSpace);
void paint_game(GUI::Painter&, Gfx::IntRect const&);
void game_over();
@ -45,4 +52,5 @@ private:
Color m_back_color { Color::from_rgb(0x8fbc8f) };
Color m_front_color { Color::Black };
Color m_shadow_color { Color::from_rgb(0x729672) };
Color m_hint_block_color { Color::from_rgb(0x485e48) };
};