1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:27:43 +00:00

Snake: Try to only repaint the parts that actually changed between ticks.

This commit is contained in:
Andreas Kling 2019-04-20 15:04:02 +02:00
parent 2d736d5591
commit 79573ce7e6
2 changed files with 43 additions and 15 deletions

View file

@ -35,6 +35,8 @@ private:
bool is_available(const Coordinate&);
void queue_velocity(int v, int h);
const Velocity& last_velocity() const;
Rect cell_rect(const Coordinate&) const;
Rect score_rect() const;
int m_rows { 20 };
int m_columns { 20 };
@ -51,6 +53,7 @@ private:
int m_length { 0 };
unsigned m_score { 0 };
String m_score_text;
RetainPtr<GraphicsBitmap> m_fruit_bitmap;
};