fix: blocks have proper collision and can be broken. Basically done.

This commit is contained in:
DarthMooMancer
2025-09-01 05:35:54 -04:00
parent 702be0363f
commit f1e32089ae
6 changed files with 56 additions and 22 deletions
+3 -3
View File
@@ -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
View File
@@ -1,7 +1,7 @@
#ifndef GLOBALS_HPP
#define GLOBALS_HPP
constexpr int ROW = 10;
constexpr int ROW = 15;
constexpr int COL = 15;
#endif
+1
View File
@@ -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