-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
34 lines (32 loc) · 1.02 KB
/
main.cpp
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
26
27
28
29
30
31
32
33
34
/*
** EPITECH PROJECT, 2024
** StellarForge
** File description:
** No file there , just an epitech header example .
** You can even have multiple lines if you want !
*/
#include "assets/objects/scripts/Background.hpp"
#include "assets/objects/scripts/Bird.hpp"
#include "assets/objects/scripts/Pipes.hpp"
#include "assets/objects/scripts/Score.hpp"
#include "StellarForge/Engine/Engine.hpp"
#include "StellarForge/Common/factories/ComponentFactory.hpp"
#include "StellarForge/Common/components/DynamicComponentLoader.hpp"
#include <iostream>
int main(int argc, char* argv[])
{
try {
auto loader = DynamicComponentLoader("assets/components");
Engine const engine([&loader]() {
REGISTER_COMPONENT(Background);
REGISTER_COMPONENT(Bird);
REGISTER_COMPONENT(Pipes);
REGISTER_COMPONENT(Score);
loader.loadComponents();
}, "FlappyBird");
} catch (const std::exception &e) {
std::cerr << e.what() << std::endl;
return 1;
}
return 0;
}