feat: added paddle, point and ball (collision and movement)
This commit is contained in:
+8
-5
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user