generated from Madour/NasNas-game-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
41 lines (32 loc) · 1.28 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 "ConfigWindow.hpp"
#include "Game.hpp"
int main() {
// load all assets
ns::Res::load("assets");
// open config window
ConfigWindow cfg_window;
cfg_window.open();
ns::Config::debug.show_fps = true;
ns::Config::debug.show_text = true;
ns::Config::debug.show_bounds = false;
ns::Config::Window::title = "CyberSlayer";
ns::Config::Window::size = {VIEW_WIDTH, VIEW_HEIGHT};
ns::Config::Window::antialiasing = cfg_window.getConfig("antialiasing");
ns::Config::Window::update_rate = 60;
ns::Config::Window::framerate_limit = 60;
ns::Config::Window::vertical_sync = cfg_window.getConfig("vertical_sync");
ns::Config::Window::cursor_visible = false;
// configure some inputs buttons
ns::Config::Inputs::setButtonKey("up", sf::Keyboard::Z);
ns::Config::Inputs::setButtonKey("down", sf::Keyboard::S);
ns::Config::Inputs::setButtonKey("left", sf::Keyboard::Q);
ns::Config::Inputs::setButtonKey("right", sf::Keyboard::D);
ns::Config::Inputs::setButtonKey("jump", sf::Keyboard::Space);
ns::Config::Inputs::setButtonKey("run", sf::Keyboard::LShift);
ns::Config::Inputs::setButtonKey("slide", sf::Keyboard::C);
Game g;
g.run();
// dont forget to unload all the assets
ns::Res::dispose();
return 0;
}