refactor: first step to final product by removing redundant code

This commit is contained in:
DarthMooMancer
2025-08-29 23:03:08 -04:00
parent 684041b3c1
commit d488f6464a
8 changed files with 30 additions and 41 deletions
+2 -6
View File
@@ -5,12 +5,8 @@
struct Fruit {
Fruit();
int unsigned m_row;
int unsigned m_col;
int unsigned m_total_eaten;
Point m_point;
void create_point();
void reset(std::array<std::array<char, COL>, ROW> &arr, int row, int col, int &score);
void reset(std::array<std::array<char, COL>, ROW> &board, int row, int col, int &score);
};
#endif // FRUIT_HPP
+2 -2
View File
@@ -3,8 +3,8 @@
#include <cstdint>
constexpr uint16_t ROW = 10;
constexpr uint16_t COL = 10;
constexpr uint16_t ROW = 11;
constexpr uint16_t COL = 11;
constexpr uint16_t FPS = 5;
#endif // GLOBALS_HPP
+1
View File
@@ -5,6 +5,7 @@
#include "point.hpp"
struct Head {
Head();
Head(int default_direction, int row, int col);
Point m_head;
Point m_previous_head;
-1
View File
@@ -13,7 +13,6 @@ struct Window {
int m_previous_reset;
void draw_window();
void clear_window();
void tick(double frames_per_second);
void kill(bool &running);
void update_score(Fruit &fruit, Body &body);