feat: move with collision but doesnt work
This commit is contained in:
@@ -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
@@ -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
@@ -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);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user