Files
snake/include/element.hpp
T
2025-11-01 18:06:21 -04:00

31 lines
600 B
C++

#ifndef ELEMENT_HPP
#define ELEMENT_HPP
#include "globals.hpp"
enum Direction {
NONE = 0,
UP = -2,
DOWN = 2,
LEFT = -1,
RIGHT = 1
};
struct Point {
int m_row;
int m_col;
char m_symbol;
enum Direction m_dir;
Point() : m_row(0), m_col(0), m_symbol('@') {}
Point(int x, int y, char s) : m_row(x), m_col(y), m_symbol(s) {}
void set_new_point(int row, int col);
};
int get_score();
void determine_index_zero_pos(Point** buffer);
void move_tail_indicies(Point** buffer);
void on_fruit_eaten(Point (*board)[COL], Point** buffer);
bool segment_overlap(Point** buffer);
#endif // ELEMENT_HPP