fix: collision mostly works and game is functional. Some bugs I think I need to work out but good enough to come back to later. The game is playable now
This commit is contained in:
+7
-17
@@ -1,30 +1,20 @@
|
||||
#ifndef ELEMENTS_HPP
|
||||
#define ELEMENTS_HPP
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include "globals.hpp"
|
||||
|
||||
struct Point;
|
||||
void move(Point* board[ROW][COL]);
|
||||
void create_point_on_board(Point* board[ROW][COL]);
|
||||
|
||||
struct Point {
|
||||
Point() : m_row(0), m_col(0), m_symbol(2), m_direction('n') {};
|
||||
Point(int row, int col) : m_row(row), m_col(col), m_symbol(2), m_direction('n') {};
|
||||
char m_direction;
|
||||
Point(int row, int col) : m_row(row), m_col(col), m_symbol(2), m_direction(' '), m_collide(false) {};
|
||||
int m_row;
|
||||
int m_col;
|
||||
char m_direction;
|
||||
int m_symbol;
|
||||
void assign();
|
||||
void assign(int row, int col);
|
||||
std::string to_string();
|
||||
bool m_collide;
|
||||
};
|
||||
|
||||
struct PointCollection {
|
||||
std::vector<Point> m_point_list;
|
||||
void collide_with_adjacent(Point* board[ROW][COL]);
|
||||
void set_direction(char direction, Point* board[ROW][COL]);
|
||||
};
|
||||
void move_points(Point* board[ROW][COL]);
|
||||
void create_point_on_board(Point* board[ROW][COL]);
|
||||
void collide_with_adjacent_point(Point* board[ROW][COL]);
|
||||
void set_direction(char direction, Point* board[ROW][COL]);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user