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:
DarthMooMancer
2025-09-18 22:46:51 -04:00
parent 28bd852531
commit f7cb337d8f
7 changed files with 94 additions and 110 deletions
+6 -16
View File
@@ -1,4 +1,3 @@
#include <iostream>
#include <thread>
#include "input.hpp"
#include "window.hpp"
@@ -8,26 +7,17 @@ int main() {
std::srand(std::time(0));
Input input;
Window window;
PointCollection collection;
bool running = true;
std::thread input_thread(&Input::get_input, &input, std::ref(running), std::ref(collection), std::ref(window.m_board));
std::thread input_thread(&Input::get_input, &input, std::ref(running), std::ref(window.m_board));
// collection.m_point_list.push_back(Point());
// collection.m_point_list[0].assign();
// collection.m_point_list.push_back(Point());
// collection.m_point_list[1].assign();
create_point_on_board(window.m_board);
create_point_on_board(window.m_board);
for(int i = 0; i < 4; i++) {
for(int j = 0; j < 4; j++) {
std::cout << window.m_board[i][j] << "\n";
}
}
while (running) {
move(window.m_board);
collection.collide_with_adjacent(window.m_board);
window.draw_window(collection);
window.tick(16);
collide_with_adjacent_point(window.m_board);
move_points(window.m_board);
window.draw_window();
}
input_thread.join();