fix(snake.cpp .hpp): first step to extracting tail functions and head movement to just head and tail separately

This commit is contained in:
DarthMooMancer
2025-08-23 00:33:48 -04:00
parent bb1040fff5
commit 667d7219bf
5 changed files with 72 additions and 94 deletions
+8 -6
View File
@@ -23,19 +23,21 @@
* separate the snake and tail from each other
* */
struct Snake {
Snake(int default_direction, int row, int col);
struct Head {
Head(int default_direction, int row, int col);
Point m_head;
std::vector<Point> m_tails;
// 1: Down, 2: Up, 3: Left, 4: Right
// -1: Left, 1: Right, 2: Down, -2: Up
int m_direction;
// Adds a new tail to m_tails at { row, col }
void create_tail(int row, int col);
void get_new_head_point(int tail_index, int direction);
void get_new_point(int direction);
};
// struct Tail {
//
// }
struct Tail {
Point m_tail_pos;
};
#endif