refactor: first step to final product by removing redundant code
This commit is contained in:
+2
-6
@@ -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
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user