diff --git a/AK/CircularQueue.h b/AK/CircularQueue.h index e19a58f4fa4..605402e0c1e 100644 --- a/AK/CircularQueue.h +++ b/AK/CircularQueue.h @@ -14,6 +14,12 @@ public: m_elements[i] = T(); } + void clear() + { + m_head = 0; + m_size = 0; + } + bool is_empty() const { return !m_size; } int size() const { return m_size; } diff --git a/Games/Snake/SnakeGame.cpp b/Games/Snake/SnakeGame.cpp index d3a1b139a9d..5f5541ef082 100644 --- a/Games/Snake/SnakeGame.cpp +++ b/Games/Snake/SnakeGame.cpp @@ -19,6 +19,7 @@ void SnakeGame::reset() m_head = { m_rows / 2, m_columns / 2 }; m_tail.clear_with_capacity(); m_length = 2; + m_velocity_queue.clear(); stop_timer(); start_timer(120); spawn_fruit();