1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 21:17:44 +00:00

2048: Add pop-in animation for newly added tiles

This commit is contained in:
Dmitrii Ubskii 2021-06-11 15:28:42 +03:00 committed by Andreas Kling
parent 30c831a3be
commit 9ce5ce3560
3 changed files with 47 additions and 5 deletions

View file

@ -41,10 +41,23 @@ public:
Tiles tiles;
struct Position {
size_t row;
size_t column;
bool operator==(Position const& other) const
{
return row == other.row && column == other.column;
}
};
void add_tile(size_t row, size_t column, u32 value)
{
tiles[row][column] = value;
last_added_position = Position { row, column };
}
Position last_added_position { 0, 0 };
};
Board const& board() const { return m_board; }