feat: added paddle, point and ball (collision and movement)

This commit is contained in:
DarthMooMancer
2025-09-01 03:07:46 -04:00
parent 6cb55e0e1a
commit 0fc5a08ab2
9 changed files with 132 additions and 23 deletions
+8 -5
View File
@@ -1,19 +1,22 @@
#include <iostream>
#include <thread>
#include "input.hpp"
#include "window.hpp"
#include "elements.hpp"
int main() {
Input input;
Window window;
Paddle paddle;
Ball ball;
bool running = true;
std::thread input_thread(&Input::get_input, &input, std::ref(running));
std::thread input_thread(&Input::get_input, &input, std::ref(running), std::ref(paddle));
while (running) {
std::cout << "Hello World" << std::endl;
window.update_display();
window.update_display(paddle, ball);
paddle.get_new_pos();
ball.check_collision();
ball.get_new_pos();
}
input_thread.join();
return 0;