#ifndef SNAKE_HPP #define SNAKE_HPP #include #include "point.hpp" /* NOTE * tail * ARGS * - direction * - old point * - new point * - new direction (x and y of old point and what direction it needs to swtich to so once it gets to it changes) * - symbol * IMPLEMENTATION * - predict the new point * - save old point * - find if previous tail has new direction * - once tail hits point change direction */ /* Struct Tail * separate the snake and tail from each other * */ struct Head { Head(int default_direction, int row, int col); Point m_head; void get_new_point(int direction); }; struct Tail { Tail(int follow_direction, int row, int col); Point m_tail_pos; std::vector m_move_history; void get_new_point(Point &d); }; struct Body { std::vector m_body; void clear(std::array, ROW> &arr); void draw(std::array, ROW> &arr); void move(Head &head); }; #endif