feat: move with collision but doesnt work

This commit is contained in:
DarthMooMancer
2025-09-16 20:24:53 -04:00
parent bdeb8d9fc7
commit 3091026d95
7 changed files with 123 additions and 73 deletions
+3
View File
@@ -2,6 +2,8 @@
#define ELEMENTS_HPP
#include <vector>
#include <string>
#include "globals.hpp"
struct Point {
Point() : m_row(0), m_col(0), m_symbol(2), m_direction('n'), m_collide(false) {};
@@ -19,6 +21,7 @@ struct Point {
struct PointCollection {
std::vector<Point> m_point_list;
void move();
void move(Point* m_board[ROW][COL]);
void set_direction(char direction);
void check_collision();
};
+2 -1
View File
@@ -2,10 +2,11 @@
#define INPUT_HPP
#include "elements.hpp"
#include "globals.hpp"
struct Input {
int _getch;
void get_input(bool &running, PointCollection &collection);
void get_input(bool &running, PointCollection &collection, Point* board[ROW][COL]);
};
#endif
+2 -1
View File
@@ -6,7 +6,8 @@
#include <array>
struct Window {
std::array<std::array<int, COL>, ROW> m_board = {};
// std::array<std::array<int, COL>, ROW> m_board = {};
Point* m_board[ROW][COL] = { nullptr };
void draw_window(PointCollection &collection);
};