feat: _check_collision for stage one of checks to collide

This commit is contained in:
DarthMooMancer
2025-09-16 09:10:41 -04:00
parent 3d184ee7a7
commit c25beb21fb
4 changed files with 74 additions and 20 deletions
+17 -1
View File
@@ -4,6 +4,13 @@
#include "window.hpp"
#include "elements.hpp"
bool _check_collision(Point &a, Point &b) {
if(a.m_row == b.m_row && a.m_col == b.m_col && a.m_symbol == b.m_symbol) {
return true;
}
return false;
}
int main() {
Input input;
Window window;
@@ -15,9 +22,18 @@ int main() {
collection.m_point_list.back().assign();
while (running) {
collection.check_collision();
// collection.check_collision();
collection.move();
window.draw_window(collection);
for(int i = collection.m_point_list.size() - 1; i >= 0; i--) {
for(int a = collection.m_point_list.size() - 1; a >= 0; a--) {
if (i == a) continue;
if(_check_collision(collection.m_point_list[i], collection.m_point_list[a])) {
std::cout << "Collision with " << collection.m_point_list[i].to_string() << " & " << collection.m_point_list[a].to_string() << "\n";
}
}
}
std::cout << collection.m_point_list.size() << "\n";
}
input_thread.join();