-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.cpp
96 lines (79 loc) · 2.62 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*
Grid
PathFinder.hpp
Copyright (c) 2011 by Marc Gilleron, <[email protected]>
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
*/
// TODO add ingame console module (chat, commands...)
// TODO improve GUI with listviews, sliders, checkboxes, auto-alignment...
// TODO add level selector (game state LevelSelector)
// TODO add a Player class with informations like lives, score, last death position, score etc...
// TODO add a beginning and an end to levels
// TODO add an undroppable default weapon to players,
// to give them a chance to win even if they are disarmed... :D
// TODO add fullscreen
// TODO add scripting API for extensibility (with Lua)
// TODO add a graphical error state when bad exceptions occurs,
// because if the game runs on fullscreen, there is no way to close it
// TODO Level edit passwords
#include <iostream>
#include <cstdio>
#include <cmath>
#include "game/Game.hpp"
#include "utility/Sampler.hpp"
using namespace std;
using namespace grid;
int main()
{
std::cout << "Main begin" << std::endl;
int exitCode = 0;
// Game creation
grid::Game * g = new grid::Game();
try
{
g->run(); // Game running
}
catch(std::exception & e)
{
std::cout << "MAIN EXCEPTION" << std::endl;
std::cout << e.what() << std::endl;
std::cout << "The game will exit." << std::endl;
std::cout << "Press a key to dismiss...";
getchar();
exitCode = -1;
}
// Game deletion
delete g;
std::cout << "Main end" << std::endl;
return exitCode;
}
//void drawOrigin(sf::RenderWindow & screen)
//{
// screen.Draw(sf::Shape::Line(0, 0, 1, 0, 0.05, sf::Color(255, 0, 0)));
// screen.Draw(sf::Shape::Line(0, 1, 0, 0, 0.05, sf::Color(0, 255, 0)));
//
//// glBegin(GL_LINES);
////
//// glColor3ub(255, 0, 0);
//// glVertex3i(0, 0, 0);
//// glVertex3i(1, 0, 0);
////
//// glColor3ub(0, 255, 0);
//// glVertex3i(0, 0, 0);
//// glVertex3i(0, 1, 0);
////
//// glColor3ub(0, 0, 255);
//// glVertex3i(0, 0, 0);
//// glVertex3i(0, 0, 1);
////
//// glEnd();
//}