fix: blocks have proper collision and can be broken. Basically done.
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
#ifndef ELEMENTS_HPP
|
||||
#define ELEMENTS_HPP
|
||||
|
||||
#include <string>
|
||||
|
||||
struct Point {
|
||||
Point();
|
||||
int m_row;
|
||||
@@ -32,10 +30,12 @@ struct Paddle {
|
||||
struct Block {
|
||||
Block(char symbol, int row, int col);
|
||||
int _size;
|
||||
bool _deleted;
|
||||
char m_symbol;
|
||||
Point m_nodes[3];
|
||||
void get_pos();
|
||||
void check_collision(Ball &ball);
|
||||
void check_collision(Ball &ball, int &blocks_left);
|
||||
void _delete();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
#ifndef GLOBALS_HPP
|
||||
#define GLOBALS_HPP
|
||||
|
||||
constexpr int ROW = 10;
|
||||
constexpr int ROW = 15;
|
||||
constexpr int COL = 15;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -9,5 +9,6 @@ struct Window {
|
||||
std::array<std::array<char, COL>, ROW> m_board = {};
|
||||
void update_display(Paddle &paddle, Ball &ball, Block (&block_list)[15]);
|
||||
void tick(int fps);
|
||||
void clear();
|
||||
};
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user