-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
26 lines (22 loc) · 694 Bytes
/
main.cpp
File metadata and controls
26 lines (22 loc) · 694 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <engine/graphics/Rect.h>
#include <engine/Game.h>
#include <Paddle.h>
#include <Ball.h>
auto main(int argc, char* argv[]) -> int
{
engine::Game g;
auto playerOnePaddle = std::make_unique<pong::Paddle>(
"paddle_p1",
engine::graphics::Rect((g.screen_width() - 150), g.screen_height() / 2, 25, 100)
);
auto ball = std::make_unique<pong::Ball>(
"ball",
engine::graphics::Circle(g.screen_width() / 2 , g.screen_height() / 2, 10.0)
);
ball->add_velocity(glm::vec2(1.0f, 1.0f));
g.add_game_object(std::move(playerOnePaddle));
g.add_game_object(std::move(ball));
g.init();
g.update();
return 0;
}