-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
41 lines (34 loc) · 1.11 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
35
36
37
38
39
40
41
#include <SFML/Graphics.hpp>
#include <filesystem>
#include <string>
#include <ctime>
#include <chrono>
#include "Player.h"
#include "Window.h"
#include "Text.h"
#include "Game.h"
#include "assets.h"
using namespace std;
int main(int count, const char **args) {
srand(time(NULL));
//fs::path assets = fs::path(args[0]).parent_path() / "assets";
if (count > 1) {
assets = args[1];
} else if (count > 0) {
assets = fs::path(args[0]).parent_path() / "assets";
} else {
assets = "assets";
}
sf::Texture playerBulletTexture;
playerBulletTexture.loadFromFile((assets / "redBullet.png").string());
sf::Texture beholderBulletTexture;
beholderBulletTexture.loadFromFile((assets / "beholderBullet.png").string());
sf::Texture beholderTexture;
beholderTexture.loadFromFile((assets / "beholder.png").string());
Player player1(assets);
player1.readData(assets);
Window window1;
Game thisGame(assets);
thisGame.looping(window1.background, window1, player1, playerBulletTexture, beholderBulletTexture, beholderTexture, assets);
return EXIT_SUCCESS;
}